ShowHideList = function() {
	this.elements = [];

}

ShowHideList.prototype.elements;

ShowHideList.prototype.lastLink;
ShowHideList.prototype.lastDisplayElement;

ShowHideList.prototype.linkSection = function(linkElement, displayElement) {
	
	this.elements.push({l:linkElement, d:displayElement});
	
	var t = this;
	
	var f = function() {
		t.linkClicked.apply(t, [this]);
		return false;
	}
	
	linkElement.onclick = f;
	
}

ShowHideList.prototype.linkClicked = function(linkElement) {
	if (linkElement.className != "selectedLink")
	{
		for(var i = 0; i < this.elements.length; i++) {
			if(linkElement == this.elements[i].l) {
				this.elements[i].l.className = "selectedLink";
				if(this.lastLink != null) this.lastLink.className = "";
				this.lastLink = this.elements[i].l;
			
				this.showSection(this.elements[i].d);
				
				break;
			}
		}
	}
}

ShowHideList.prototype.showSection = function(displayElement) {

	if(displayElement.style != null) {
		
		if(this.lastDisplayElement != null) this.lastDisplayElement.style.display = "none";
		this.lastDisplayElement = displayElement;
		
		displayElement.style.display = "block";
	}
}