function activateMenu(nav) {

    /* currentStyle restricts the Javascript to IE only */
    if (document.getElementById(nav)) {  
        var navroot = document.getElementById(nav);
        
        /* Get all the list items within the menu */
        var lis=navroot.getElementsByTagName("LI");
        for (i=0; i<lis.length; i++) {
        
           /* If the LI has another menu level */
            if(lis[i].lastChild.tagName=="UL"){
            
                /* assign the function to the LI */
             	lis[i].onmouseover=function() {	
                   this.lastChild.style.display="block";

                   //alert(this.lastChild.tagName);
                   var subList = this.lastChild.getElementsByTagName("LI");
                   for (n = 0; n < subList.length; n++) {
   //                    alert(subList[n].tagName);
   //                    subList[n].style.background-color = "#000000";
                   }

                
                   /* display the inner menu */
                   
                }
                lis[i].onmouseout=function() {                       
                   this.lastChild.style.display="none";
                }
            }
        }
    }
}

function init(){
    activateMenu('nav'); 
    activateMenu('vertnav'); 
}

function registerOnloadFunction(func) {
    if (window.addEventListener)
        window.addEventListener("load", func, false);
    else
        window.attachEvent("onload", func);
}

registerOnloadFunction(init);

