
function extractPageName(hrefString)
{
	var hrefSplit = hrefString.split("?content=");
	if (hrefSplit.length >= 2)
		return (hrefSplit[1].toLowerCase());
	else
		return ("");
}

function setActiveMenu(arr, crtPage)
{
	for(var i=0; i < arr.length; i++)
	{
		if(extractPageName(arr[i].href) == crtPage && crtPage != '')
		{
			//alert("OK:" + arr[i].href);
			arr[i].className = "current";
			arr[i].parentNode.className = "current";
		}
	}
}

function setPage()
{
	if(document.location.href) 
		hrefString = document.location.href;
	else
		hrefString = document.location;

	if (document.getElementById("nav")!=null) 
	{
		setActiveMenu(document.getElementById("nav").getElementsByTagName("a"), extractPageName(hrefString));
	}
}

