function generic() { /* alert('Generic onload function'); */ }; 
startList = function() { 
    if (document.all&&document.getElementById) { 
        var node_m1 = document.getElementById("menu_1"); 
        var node_m2 = document.getElementById("menu_2"); 
        var node_m3 = document.getElementById("menu_3"); 
        AssignMenuEvents(node_m1); 
        AssignMenuEvents(node_m2); 
        AssignMenuEvents(node_m3); 
    } 
}; 
AssignMenuEvents = function(pObject) { 
    var node; 
    var vPreviousIndex; 

    for (i=0; i<pObject.childNodes.length; i++) { 
        node = pObject.childNodes[i]; 

        if (node.nodeName=="LI") { 
            node.onmouseover=function() { 
                this.className+=(this.className.length>0? " ": "") + "over"; 
            } 
            node.onmouseout=function() { 
                this.className=this.className.replace(new RegExp("( ?|^)over\\b"), ""); 
            } 
            node.onclick=function() { 
                this.className=this.className.replace(new RegExp("( ?|^)over\\b"), ""); 
            } 
        } 

        if (node.childNodes.length>0) { 
            vPreviousIndex = i; 
            AssignMenuEvents(node); 
            i = vPreviousIndex; 
        } 
    } 
}; 
// thanks http://www.brothercake.com/site/resources/scripts/onload/ 
if(window.addEventListener) window.addEventListener('load', generic, false); // gecko, safari, konqueror and standard 
else if(document.addEventListener) document.addEventListener('load', generic, false); // opera 7 
else if(window.attachEvent) { // win/ie 
    window.attachEvent('onload', startList); 
    /* window.attachEvent('onload', generic); */ // Add more functions here. 
} else { // mac/ie5 
    if(typeof window.onload == 'function') { 
        var existing = onload; 
        window.onload = function() { 
            existing(); 
            startList(); 
            /* window.attachEvent('onload', generic); */ // Add more functions here. 
        } 
    } else { 
        window.onload = function() { 
            startList(); 
            /* window.attachEvent('onload', generic); */ // Add more functions here. 
        } 
    } 
} 
