function showTab(tabix)
{
	// loop across each potential tab.  Max==20
	for (var i = 1; i < 20; i++)
	{
		if (document.getElementById("tab-" + i))
		{
			if (tabix==i) 
			{	// Show the tab
				document.getElementById("tab-" + i).className			= "active";
				document.getElementById("tabContent-" + i).style.display= "block";
				document.getElementById("tab-" + i).blur();
			}
			else
			{	// Hide the tab
				document.getElementById("tab-" + i).className			= "inactive";
				document.getElementById("tabContent-" + i).style.display= "none";
			}
		}		
	} 
}

function getFormVar(variable)
{
	var query = window.location.search.substring(1);
	var vars = query.split("&");
	
	for (var i=0;i<vars.length;i++)
	{
		var pair = vars[i].split("=");
		if (pair[0] == variable)
		{
			return pair[1];
		}
	}
	return null;
}

function displayRequestedTab()
{
	var tabId = getFormVar("tab")
	if (tabId != null) {
		showTab(tabId)
	}
}

function toggleLayer(layer)
{
	if (document.getElementById)
	{
		// this is the way the standards work
		var style2 = document.getElementById(layer).style;
		style2.display = style2.display? "":"block";
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var style2 = document.all[layer].style;
		style2.display = style2.display? "":"block";
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var style2 = document.layers[layer].style;
		style2.display = style2.display? "":"block";
	}
}