var enablepersist="off"; //Enable saving state of content structure? (on/off)
if (document.getElementById){
	$(function(){
		$('.switchcontent').hide();

	});
}
function getElementbyClass(classname){
	ccollect=new Array();
	var inc=0;
	var alltags=document.all? document.all : document.getElementsByTagName("*");
	for (i=0; i<alltags.length; i++){
	if (alltags[i].className==classname)
		ccollect[inc++]=alltags[i];
	}
}
function contractcontent(omit){
	var inc=0;
	while (ccollect[inc]){
		if (ccollect[inc].id!=omit)
		ccollect[inc].style.display="none";
		inc++;
	}
}
function expandcontent(cid){
	if (typeof ccollect!="undefined"){
		contractcontent(cid);
		for(i=1;i<=cid;++i) {
			 document.getElementById(i).style.display=(document.getElementById(i).style.display="block");
			 selectedItem=i+"|"+document.getElementById(i).style.display;
		}
	}
}
function revivecontent(){
	selectedItem=getselectedItem();
	selectedComponents=selectedItem.split("|");
	contractcontent(selectedComponents[0]);
	document.getElementById(selectedComponents[0]).style.display=selectedComponents[1];
}
$(function(){
	getElementbyClass("switchcontent");
	if (enablepersist=="on" && getselectedItem()!=""){
		revivecontent();
	}
});
if (enablepersist=="on" && document.getElementById){
	window.onunload=saveswitchstate;
}


