function loadDynNav(elid) {
    if(window.navigator.systemLanguage && !window.navigator.language) {
        sucheLI(document.getElementById(elid));
        /*var LI = document.getElementById(elid).firstChild;
        do {
            if (UL = sucheUL(LI.firstChild)) {
                LI.onmouseover=einblenden;
                LI.onmouseout=ausblenden;
                sucheLI(UL);
            }
            LI = LI.nextSibling;
        }
        while(LI);*/
    }
}

function sucheUL(UL) {
    do {
        if(UL) UL = UL.nextSibling;
        if(UL && UL.nodeName == "UL") return UL;
    }
    while(UL);
    return false;
}

function sucheLI(UL) {
    var LI = UL.firstChild;
    do {
        if (UL = sucheUL(LI.firstChild)) {
            LI.onmouseover=einblenden;
            LI.onmouseout=ausblenden;
            sucheLI(UL);
        }
        LI = LI.nextSibling;
    }
    while(LI);
}

function einblenden() {
    var UL = sucheUL(this.firstChild);
    UL.style.display = "block";
}

function ausblenden() {
    sucheUL(this.firstChild).style.display = "none";
}


function loadDynNav2(elid) {
    navList = document.getElementById(elid);
    if (navList) {
        loadJSforChilds(navList);
    }
}

function loadJSforChilds(el) {
    if (el) {
        //Javascript den Unterpunkten hinzufuegen
        var childs1 = el.childNodes;
        for (i = 0; i < childs1.length; i++) {
            if (childs1[i].nodeName.toUpperCase() == "LI") {
                var childs2 = childs1[i].childNodes;
                var check = false;
                for (j = 0; j < childs2.length; j++) {
                    if (childs2[j].nodeName.toUpperCase() == "UL") {
                        check = true;
                    }
                }
                if (check) {
                    childs1[i].onmouseover = new Function ("showMenu(this)");
                    childs1[i].onmouseout = new Function ("hideMenu(this)");
                    //childs1[i].setAttribute("onmouseout", "");
                    //childs1[i].setAttribute("onmouseover", );
                    //childs1[i].setAttribute("onmouseout", "hideMenu()");
                }
            }
        }
    }
}

function showMenu(el) {
    el.className = "hover";
}

function hideMenu(el) {
    el.className = "";
}

function hideMenuNow() {
    if (oldEL) {
        hideSubmenu(oldEL);
    }
}

function showSubmenu(el) {
    if (el) {
        var childs1 = el.childNodes;
        for (i = 0; i < childs1.length; i++) {
            if (childs1[i].nodeName.toUpperCase() == "UL") {
                displayOLD = childs1[i].style.display;
                childs1[i].style.display = displayNEW;
            }
        }
    }
}

function hideSubmenu(el) {
    if (el) {
        var childs1 = el.childNodes;
        for (i = 0; i < childs1.length; i++) {
            if (childs1[i].nodeName.toUpperCase() == "UL") {
                childs1[i].style.display = displayOLD;
            }
        }
    }
}

