/*
 * This is a custom menu script sorta based on suckerfish.  This (along with
 * the stylesheet) adds awesome custom gradient expandable menus to xdCMS.
 * This is a pretty good example of the benefits of having the cms spit out
 * strictly markup and handling display with css and dom based scripting.
 * One thing to note is that we need to turn this off for the admin side of
 * the xdPageMenu module to still work.  We do this in the template with the
 * func_admin() sigma function.  Pretty slick!
 */

//suckerf-ish menu?
startList = function() {
    if(document.getElementById) {
        navRoot = document.getElementById("nav");
        if(!navRoot) return;
        for(i = 0; i < navRoot.childNodes.length; i++) {
            node = navRoot.childNodes[i];
            if(node.nodeName == "LI") {
                if(node.getElementsByTagName("LI").length == 0)
                    node.style.height = "18px";
                //childGrad(node);
                if(document.all) {
                    node.onmouseover = function() {
                        this.className += " over";
                    }
                    node.onmouseout = function() {
                        this.className = "";
                    }
                }
            }
        }
    }
}

var customOnLoad = window.onload;
window.onload = function() {
    if(customOnLoad) customOnLoad();
    startList();
}


