<!--
//MENU CURRENT 1.0
//Script parses URLs and find the best match and makes corrisponding menu active.

function menuCurrent()
{
	var menuRootId = "menu_root"; //Configure this to the ID of the root UL of the navigation
	var docURL = document.URL;
	
	//Make sure the menu root ID variable has been set
	if(!menuRootId){
		alert("menuRootId variable must be set");
		return;
	}
	
	//Make sure this ID exists.
	if(!document.getElementById(menuRootId))
	{
		alert("No ID matching \""+menuRootId+"\" has been found.");
		return;
	}
	
	var menuRoot = document.getElementById(menuRootId);
	
	//Make sure ID is set on a <UL> tag
	if(menuRoot.nodeName != "UL"){
		alert("\""+menuRootId+"\" must be an ID attribute on a <UL> tag");
		return;
	}
	
	//Make sure <UL> tag has <LI> tags
	if(menuRoot.getElementsByTagName("li").length < 1){
		alert("<UL> tag must have at least one <LI> tag");
		return;
	}
	
	var menuLInkArray = menuRoot.getElementsByTagName("a");
	var matchedArray = new Array();
	
	//Make the correct menu current based on the page's URL
	for (var i=0;i<menuLInkArray.length;i++)
	{
		var menuHREF = menuLInkArray[i];
		var docURLArray = docURL.split(menuHREF);

		if(docURLArray.length > 1)
		{
			var matchedIndex = docURLArray[1].length;
			matchedArray[matchedIndex] = menuLInkArray[i];
		}
	}
	// If there are no matches set home to be active
	if(matchedArray.length < 1)
	{
		matchedArray[0] = menuLInkArray[0];
	}		
	for (var i=0;i<matchedArray.length;i++)
	{
		if(matchedArray[i])
		{
			matchedArray[i].className = "current";
		}
	}
}

-->