var theDivs = new Array();
var theTabs = new Array();

function addTabToSwitchSet(thisTab)
{
	theTabs[theTabs.length] = document.getElementById(thisTab);
	if (theTabs.length == 1)
	{
		theTabs[0].className = "menuon";
	}
}

function addDivToSwitchSet(thisDiv)
{
	theDivs[theDivs.length] = document.getElementById(thisDiv);
	if (theDivs.length == 1)
	{
		theDivs[0].style.display = "block";
	}
}

function showDiv(thisDiv,thisTab)
{
	for (i=0;i<theDivs.length;i++)
	{
		theDivs[i].style.display = "none";
	}
	document.getElementById(thisDiv).style.display = "block";
	
	for (j=0;j<theTabs.length;j++)
	{
		theTabs[j].className = "menuoff";
		theTabs[j].style.color = "Black";
		theTabs[j].style.backgroundColor = "Silver";
		// alert("set menuoff for " + theTabs[j].innerHTML + " " + theTabs[j].className);
	}
	
	theTab = document.getElementById(thisTab);
	theTab.className = "menuon";
	theTab.style.color = "White";
	theTab.style.backgroundColor = "#0099CC";

	//alert("set menuon for " + document.getElementById(thisTab).innerHTML);
}

function tabMouseOut(tabid)
{
	theTab = document.getElementById(tabid);
	//theTab.className='menuoff';
	
	if (theTab.className != "menuon")
	{
		theTab.style.color = "Black";
		theTab.style.backgroundColor = "silver";
	}
	// alert("MouseOut" + document.getElementById(tabid).className);
	// background-color: silver;

}
function tabMouseOver(tabid)
{
	theTab = document.getElementById(tabid);
	if (theTab.className != "menuon")
	{
		theTab.style.color = "White";
		theTab.style.backgroundColor = "#0099CC";
	}
	
	
	//color: White;
	//background-color: #0099CC;

}

function showInfoDiv(divid, dividtoggle)
{

	if (document.getElementById(divid).style.display == "block")
		{
			document.getElementById(divid).style.display = "none";
			document.getElementById(dividtoggle).innerHTML = "&#187;";
		}
	else
		{
			document.getElementById(divid).style.display = "block";
			document.getElementById(dividtoggle).innerHTML = "&#171;";
		}
}

function getHttpGetParameterForCurrentPage(parameterName)
{
	var pageURL = window.document.URL.toString();
	if (pageURL.indexOf("?") > 0)
	{
		var allParams = pageURL.split("?")[1].split("&"); // post-questionmark part in vars
		// now loop the names arrray to find the value of parameterName
		var i = 0;
		for (i = 0; i < allParams.length ; i++)
		{
			var aPar = allParams[i].split("=");
			var theName = aPar[0];
			var theValue = aPar[1];
			if (theName == parameterName)
			{
				return theValue;
			}
		}
		return null;
	}
	else
	{
		// no get parameters
		return null;
	}


}