addLoadEvent(setCurrentMenu);

 
 function addLoadEvent(func) 
 {

    var oldevt = window.onload;
    if (typeof oldevt != 'function') 
    {
        window.onload = func;
    } 
    else 
    {
        window.onload = function() {
        if (oldevt) 
        {
            oldevt();
        }
        func();
        };
    }
}
function addUnLoadEvent(func) 
 {

    var oldevt = window.onunload;
    if (typeof oldevt != 'function') 
    {
        window.onunload = func;
    } 
    else 
    {
        window.onunload = function() {
        if (oldevt) 
        {
            oldevt();
        }
        func();
        };
    }
}

function setCurrentMenu()
{

    if (document.getElementById) 
    {
	    if (navRoot = document.getElementById("submenu"))
	    {
		    for (i=0; i<navRoot.childNodes.length; i++) 
		    {
			    node = navRoot.childNodes[i];
			    if (node.nodeName=="A") 
			    {
			    //alert (node.href + " - " + window.location);
				    if (node.href == window.location)
				    {
  					    node.className += " current";
				    }  			
			    }    	 
		    }
	    }
		if (navRoot = document.getElementById("menu"))
	    {
		    for (i=0; i<navRoot.childNodes.length; i++) 
		    {
			    node = navRoot.childNodes[i];
			    if (node.nodeName=="A") 
			    {
			    //alert(node.href);
				    if (node.href == window.location)
				    {
					    node.className += " current";
				    }
			    }
		    }
	    }
    }
}