/* ====================================================
Menu Current page highlight
==================================================== */

function GetcurrentPage() {  

if (!document.getElementsByTagName)
{
alert("element by name doesn't exist");
return;
}

var anchors = document.getElementsByTagName("a");  
var thisPage = location.href;  


for (var i=0; i<anchors.length; i++) 
{   
	var anchor = anchors[i];  
	

	thisHREF = anchor.getAttribute("href");  
	thisREL = anchor.getAttribute("rel");
	thisREV = anchor.getAttribute("rev");
	
	
	//if(thisREV && document.getElementById(thisREV) != null)
	//{
		therev = thisREV;
	//}
	//else
	//{
	//	therev = "nok";
	//}
	
	
	var location_page = location.protocol + "//" + location.hostname + thisHREF;

	if((therev && thisHREF == thisPage && thisREL == "leftmenu") || (therev && location_page == thisPage && thisREL == "leftmenu"))
	{ 
		if(therev != "nok")
		{
			var str = therev;
			var parentID = str.replace(/c/i, "m");

			document.getElementById(parentID).className ="currentB";
			anchors.item(i).className ="current";
			if(document.getElementById(therev))
			{
				document.getElementById(therev).style.display = "block";
			}
			return;  
		}
	}  
	else if((thisHREF == thisPage && thisREL == "leftmenu") || (location_page == thisPage && thisREL == "leftmenu"))
	{  
	anchors.item(i).className ="current";
	return;  
	} 
	else
	{
		//alert("NO MATCH: "+location_page);
	}
}  

}  
GetcurrentPage();








