﻿function toggleSPsection(objname){
	closeAll();
	openDiv(objname);
	window.location="#spsectionlist";
}
function toggleSPsubSection(objname){
	closeAllsubs();
	openDiv(objname);
	if (objname.length > 0)
	{
		var subListName = String(objname).substring(0,objname.length-1);
		window.location="#" + subListName + "list";
	} else {
		window.location="#spsectionlist";
	}
}
function openDiv(objname){
	if (objname.length > 0)
	{
		if (document.getElementById(objname) != null)
		{
			document.getElementById(objname).style.display = 'block';
		}
	}
}
function closeDiv(objname){
	document.getElementById(objname).style.display = 'none';
}
function closeAll(){
	for (var f=1;f<=100;f++)
	{
		if(document.getElementById("spsection" + f) != null) {
			closeDiv("spsection" + f);
		}
	}
	window.location="#spsectionlist";
}
function closeAllsubs(){
	for (var f=1;f<=100;f++)
	{
		if(document.getElementById("spsubsection" + f) != null) {
			closeDiv("spsubsection" + f);
		}
	}
	window.location="#spsectionlist";
}
function openAll(){
	var lastSPsection
	for (var f=1;f<=100;f++)
	{
		if(document.getElementById("spsection" + f) != null) {
			openDiv("spsection" + f);
		}
	}
}
function checkURL(){
	var sectionLink = unescape(location.search.substr(1));
	if (sectionLink) {
		toggleSPsection("spsection" + sectionLink);
	}
}


