function showTab(tab)
{
	document.location.hash = "#tab-" + tab;
}
function setDefaultTab(tab)
{
	document.defaultTab = tab;
}
function checkHash()
{
	if(document.location.hash != document.lastHash)
	{
		if(!document.location.hash.split("#tab-")[1]) { tab = document.defaultTab; }
		else { tab = document.location.hash.split("#tab-")[1]; }
		if(document.getElementById("content-" + tab))
		{
			for(var i = 0; i < document.tabs.length; i++)
			{
				$("nav-" + document.tabs[i]).className = "";
				$("content-" + document.tabs[i]).style.display = "none";
			}
			$("nav-" + tab).className = "active";
			$("content-" + tab).style.display="block";
		}
		document.lastHash = document.location.hash;
	}
}
whenLoad(checkHash);
whenLoad(function(){ setInterval(checkHash,100); });