var primarycolor = "#005FBE"; /*"#009982";*/
var secondarycolor = "#00359F"; /*"#007364";*/

function OpenNewWindow(URL)
{
	var WindowFeatures;
	WindowFeatures="scrollbars=yes,menubar=yes,toolbar=yes,resizable=yes,width=400,height=400"
	NWindow=window.open(URL,'glossary',WindowFeatures);
}

function toggle(itemno)
	{
		document.getElementById(itemno).style.display = (document.getElementById(itemno).style.display == "none" ) ? "" : "none";
	}
	

function ToggleOuterTab(itemno)
	{
	var i = 1;
	var item;
	while (i < 5)
		{
		item = "OuterTab" + i;
		document.getElementById(item).style.backgroundColor = "#FFFFFF";
		document.getElementById(item).style.color = primarycolor;
		item = item + "A";
		document.getElementById(item).style.backgroundColor = "#FFFFFF";
		document.getElementById(item).style.color = primarycolor;
		i=i+1;
		}

	item = "OuterTab" + itemno;
	document.getElementById(item).style.color = "#FFFFFF";
	document.getElementById(item).style.backgroundColor = primarycolor;
  item = item + "A";
	document.getElementById(item).style.color = "#FFFFFF";
	document.getElementById(item).style.backgroundColor = primarycolor;
	}
function ToggleInnerTab(itemno)
	{
	var i = 1;
	var item;
	while (i < 5)
		{
		item = "InnerTab" + i;
		document.getElementById(item).style.backgroundColor = "#FFFFFF";
		document.getElementById(item).style.color = secondarycolor;
		item = item + "A";
		document.getElementById(item).style.backgroundColor = "#FFFFFF";
		document.getElementById(item).style.color = secondarycolor;
		i=i+1;
		}

	item = "InnerTab" + itemno;
	document.getElementById(item).style.color = "#FFFFFF";
	document.getElementById(item).style.backgroundColor = secondarycolor;
  item = item + "A";
	document.getElementById(item).style.color = "#FFFFFF";
	document.getElementById(item).style.backgroundColor = secondarycolor;
	}

function ToggleColor(itemno1, itemno2, itemno3, itemno4)
	{
	var inputs = document.getElementsByTagName("input"); 
	for (var i = 0; i < inputs.length; i++) { 
	    inputs[i].style.backgroundColor = "";
	    }
	if (itemno1 != null) {document.getElementById(itemno1).style.backgroundColor = "#E6FAF4";}
	if (itemno2 != null) {document.getElementById(itemno2).style.backgroundColor = "#E6FAF4";}
	if (itemno3 != null) {document.getElementById(itemno3).style.backgroundColor = "#E6FAF4";}
	if (itemno4 != null) {document.getElementById(itemno4).style.backgroundColor = "#E6FAF4";}
	}
function ToggleColorOld(itemno)
	{
	if (document.getElementById(itemno).style.backgroundColor.length < 1)
	{document.getElementById(itemno).style.backgroundColor = "#E6FAF4";}
	else
	{document.getElementById(itemno).style.backgroundColor = "";}
	}
//************************************************
//This is called by the nav menu on the web page
//************************************************
function loadXMLDoc(URL, target)
	{
  document.getElementById(target).src = URL
	}


function startup()
	{
	// Get CGI input variable pairs
	var Vars = new Array("Name","Value");
	var VarsIndex = 0;

	var i=0;
	var posamp;
	var pair;
	//document.write (location.search)
	while (i<location.search.length && location.search.indexOf("?", 1)<0)
		{
		//alert(VarsIndex)
		posamp=location.search.indexOf("&", posamp);
		//document.write ("<br>posamp=" + posamp)
		if (posamp==-1){posamp=location.search.length};
		pair=location.search.substring(i+1,posamp);
		//document.write ("<br>i=" + i + ", posamp=" + posamp + ", Pair: " + pair)
		Vars[VarsIndex] = new Array("Name","Value")
		Vars[VarsIndex][0] = pair.substring(0,pair.indexOf("=")) + 0;
		Vars[VarsIndex][1] = pair.substring(pair.indexOf("=")+1);
		document.forms[0].elements[VarsIndex+1].value=Vars[VarsIndex][1];
		//document.write ("<br>" +Vars[VarsIndex][1] )
//No work	alert(Vars[VarsIndex]["Name"]+'\n'+Vars[VarsIndex]["Value"]);
//Works		alert(Vars[VarsIndex][0]+'\n'+Vars[VarsIndex][1]);
		i=posamp;
		posamp=posamp+pair.length
		VarsIndex=VarsIndex+1;
		}
	}
	
window.onload=startup()