<!--
//NAV CURRENT 1.0
//Script parses URLs and find the best match and makes corrisponding navigation item current/active.

function navCurrent(menuRootId)
{
	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 do nothing
	if(matchedArray.length < 1)
	{
		//matchedArray[0] = menuLInkArray[1];
		return;
	}
	
	for (var i=0;i<matchedArray.length;i++)
	{
		if(matchedArray[i])
		{
			//matchedArray[i].parentNode.className = "current";
			menuItem = matchedArray[i];
			//Get the current class applied to the menuItem and add current to it
			menuClass = menuItem.className;
			menuItem.parentNode.className = menuClass+" current";
		}
	}
}

-->