// JavaScript Document
//Nasty hack for IE6
function swapColor(hElement)	{
	//alert("swapColor called");	
	hElement.className = "mouseOver";
}

function swapBack(hElement)	{
	//alert('swapBack Called');
	hElement.className = "";
}

function openPage(linkContainer)	{
	if(linkContainer.childNodes[0].childNodes[0].href)	{
		location.href=linkContainer.childNodes[0].childNodes[0].href;
	}
}

function showTab(targetTab)	{
	
	if(targetTab.parentNode.className == "tabHeader_on")	{
		//do nothing
		return;
	}
	
	var allTabHeaders = document.getElementById("tabHeaders")
	var allTabs = allTabHeaders.getElementsByTagName("a");
	
	for(var i=0;i<allTabs.length;i++)	{
		//Hide all of the tabs
		/*alert("tab " + i + " is " + allTabs[i]);*/
		//var target = allTabs[i].href.split("#")[1];
		
		var selectedTabId = allTabs[i].parentNode.id;
		target = selectedTabId.substr(0, selectedTabId.length - 4);
		
		allTabs[i].parentNode.className = "tabHeader";
		
		tabToHide = document.getElementById(target);
		
		if(tabToHide.className == "tab_on")	{
			tabToHide.className = "tab";
		}
	}
	
	//And then show the one that the link that was passed points at
	//var targetLink = targetTab.href.split('#');
	selectedTabId =targetTab.parentNode.id;
	target = selectedTabId.substr(0, selectedTabId.length - 4);
	
	var tabToShow = document.getElementById(target);
	tabToShow.className = "tab_on";
	targetTab.parentNode.className="tabHeader_on";
	//The final thing we have to do is hide any other tabs that are currently showing
}
