// JavaScript Document
//suckerfish//
var lastSubMenu;

function hideAllMenus(el) {        
    var rootNav = document.getElementById('rollover');   
         
    if(rootNav == null)
    {
        rootNav = document.getElementById('rollover1');                
    }
    
    if(rootNav == null)
        return;
    
    //loop thru all the li's in the main navbar and assign event handlers
    for(i = 0; i< rootNav.childNodes.length; i++)
    {
        node = rootNav.childNodes[i];
        if(node.nodeName == 'LI')
        {
            if(el == null)
            {
                node.className=node.className.replace(new RegExp(" sfhover"), "");                
            }
            else
            {                
                if(el.id != node.id)
                {
                   node.className=node.className.replace(new RegExp(" sfhover"), "");                                          
                }
            }            
        }
    }
}

sfHover = function() 
    {
    
        var rootNav = document.getElementById('rollover');    
        
        if(rootNav == null)
        {
            rootNav = document.getElementById('rollover1');                
        }
        
        if(rootNav == null)
            return;
        
        //loop thru all the li's in the main navbar and assign event handlers
        for(i = 0; i< rootNav.childNodes.length; i++)
        {
            node = rootNav.childNodes[i];
            if(node.nodeName == 'LI')
            {                
                node.onmouseover=function() 
                {                           
                    this.className+=" sfhover";    
                    hideAllMenus(this);          
                    event.cancelBubble = true;                                       
                }                             
                node.onmouseout=function() 
                {   
                    this.className=this.className.replace(new RegExp(" sfhover"), "");                              
                }                 
                
                for(j=0;j<node.childNodes.length;j++)
                {
                    liNode = node.childNodes[j];    
                    if(liNode.nodeName == 'UL')
                    {
                        for(k=0;k<liNode.childNodes.length;k++)
                        {
                            if(liNode.childNodes[k].nodeName == 'LI')
                            {
                                liNode.childNodes[k].onmouseover=function() {
                                    this.className += ' sfhover';
                                    event.cancelBubble = true;  
                                    }
                                    
                                liNode.childNodes[k].onmouseout=function() {
                                    this.className = this.className.replace(new RegExp(" sfhover"), "");
                                    event.cancelBubble = true;
                                }                                
                            }
                        }
                    }                
                    liNode.onmouseout = function() { event.cancelBubble = true; }
                }                
            }    
        }

    };
    
sfHide = function() {
        
    var rootNav = document.getElementById('rollover');        
       
    if(rootNav == null)
    {
        rootNav = document.getElementById('rollover1');                
    }
    
    if(rootNav == null)
        return;
    //loop thru all the li's in the main navbar and assign event handlers
    for(i = 0; i< rootNav.childNodes.length; i++)
    {
        node = rootNav.childNodes[i];
        if(node.nodeName == 'LI')
        {
            node.className=node.className.replace(new RegExp(" sfhover"), "");
        }
    }
}    
    
if (window.attachEvent) window.attachEvent("onload", sfHover);
document.onmouseover = hideAllMenus;
document.onmouseout = hideAllMenus;