
function addLoadEvent(func) 
{
      var oldonload = window.onload;
      if (typeof window.onload != 'function') 
      {
        window.onload = func;
      } 
      else
      {
      window.onload = function()
        {
          if (oldonload) 
          {
            oldonload();
          }
          func();
        }
      }
}

function startList() 
{
    if (document.all&&document.getElementById) 
    {
        navRoot = document.getElementById("MainNavigationList");

        for (i=0; i<navRoot.childNodes.length; i++) 
        {
            node = navRoot.childNodes[i];

            if (node.nodeName=="LI") 
            {
                node.onmouseover=function() 
                {
                    this.className+=" hover";
                }
                node.onmouseout=function() 
                {
                    this.className=this.className.replace(" hover", "");
                }
            
                if(node.childNodes != null && node.childNodes.length > 0)
                {
                        for (x=0; x<node.childNodes.length; x++) 
                        {
                            chNode = node.childNodes[x];

                            if (chNode.nodeName=="UL") 
                            {
                                if(chNode.childNodes != null && chNode.childNodes.length > 0)
                                {
                                    for (y=0; y<chNode.childNodes.length; y++) 
                                    {
                                        ch2Node = chNode.childNodes[y];
                                        
                                        if (ch2Node.nodeName=="LI") 
                                        {
                                            ch2Node.onmouseover=function() 
                                            {
                                                this.className+=" hover";
                                            }
                                            ch2Node.onmouseout=function() 
                                            {
                                                this.className=this.className.replace(" hover", "");
                                            }
                                        }
                                    }
                                }
                            }                            
                        }
                }
            }
        }
    }
}
addLoadEvent(startList);



