function setActiveMenu(arr, crtPage, classname)
{
	for (var i=0; i<arr.length; i++)
	{
		if(arr[i].href == crtPage)
		{
			arr[i].className = classname;
		}
		else if(arr[i].href.substring(arr[i].href.length-3,arr[i].href.length) == crtPage.substring(crtPage.length-3,crtPage.length))
		{
			arr[i].className = classname;
		}
		else if(arr[i].href.substring(arr[i].href.length-3,arr[i].href.length) == crtPage.substring(crtPage.length-8,crtPage.length-5))
		{
			arr[i].className = classname;
		}
		
	}
}

function setPage(divname,classname)
{
	hrefString = document.location.href ? document.location.href : document.location;
	if (document.getElementById(divname)!=null)
		setActiveMenu(document.getElementById(divname).getElementsByTagName("a"), hrefString, classname);
}

