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 != 'linkselected')
	{
		for(var i = 0; i < this.elements.length; i++) {
			if(linkElement == this.elements[i].l) {
				this.elements[i].l.className = 'linkselected';
				
				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) {
	//alert(displayElement.style.display == "block");
	//displayElement.style.display != "block"
	
	if(displayElement.style != null) {// && displayElement.style.display != "block") {
		displayElement.style.display = 'block';
		if(this.lastDisplayElement != null) this.lastDisplayElement.style.display = 'none';
		this.lastDisplayElement = displayElement;
	}
}