// JavaScript Document
function showSubNav(subnavID)
{
	if (subnavID) // if id was passed
	{
		if (document.getElementById("HomeSubnavRow"))
		{
			var subNavRow = document.getElementById("HomeSubnavRow");
			var openIMG = "url(/media/navs/front/headerTopOpen.png)";
		}else{
			var subNavRow = document.getElementById("InsideSubnavRow");
			var openIMG = "url(/media/navs/about/headerTopOpen.jpg)";
		}
		subNavRow.style.backgroundImage = openIMG;
		//hide others show selected
		for(i=0; i < document.subnavCounter; i ++)
		{
			var subnav = document.getElementById("subnav" + i);
			if (i == subnavID)
			{
				subnav.style.display = "block";	//display if is the selected one
			}else{
				subnav.style.display = "none";	//hide others
			}
		}
	}else{
		//swap picture
		if (document.getElementById("HomeSubnavRow"))
		{
			var subNavRow = document.getElementById("HomeSubnavRow");
			var closeIMG = "url(/media/navs/front/headerTopClose.png)";
		}else{
			var subNavRow = document.getElementById("InsideSubnavRow");
			var closeIMG = "url(/media/navs/about/headerTopClose.jpg)"
		}
		subNavRow.style.backgroundImage = closeIMG;
		//hide all
		for(i=0; i < document.subnavCounter; i ++)
		{
			var subnav = document.getElementById("subnav" + i);
			subnav.style.display = "none";
		}
	}
}