
    // Explorerbenben 0, Firefoxban
    var firstChildNodeID = document.all ? 0 : 1;
    var secondChildNodeID = document.all ? 1 : 3;

    // Operát külön állítjuk be
    if (navigator.userAgent.indexOf("Opera") != -1) {
  
        firstChildNodeID = 1;
        secondChildNodeID = 3;

    }


    /*******************************************************************/

    // árnyékot rakunk
    function menuOver(m) {

        if (m == 7) return;

        var balID = m; balID--;
        var jobbID = m; jobbID++;

        var bal = $div("menu"+balID);
        var akt = $div("menu"+m);
        var jobb = $div("menu"+jobbID);

        // nem az első, és balra selected
        if (m > 1 && bal.className == "selected") {

            akt.childNodes[0].style.background = '#FFF url('+url+'/template/images/menu_shadow_white.gif) no-repeat bottom left';
            jobb.style.background = 'url('+url+'/template/images/menu_shadow_orange.gif) no-repeat bottom left';

        }

        // mindegy hanyadik, de jobbra selected
        if (jobb.className == "selected") {

            jobb.childNodes[0].style.background = '#FFF url('+url+'/template/images/menu_shadow_white.gif) no-repeat bottom left';
            akt.style.background = '#FFF url('+url+'/template/images/menu_shadow_white.gif) no-repeat bottom left';

        }

        // nem az első, és se balra, se jobbra nincs selected
        if ((m > 1 && bal.className != "selected") && jobb.className != "selected") {

            jobb.style.background = 'url('+url+'/template/images/menu_shadow_orange.gif) no-repeat bottom left';

        }

        // az első, és jobbra nem selected
        if (m == 1 && jobb.className != "selected") {

            akt.childNodes[0].style.background = '#FFF url('+url+'/template/images/menu_shadow_white.gif) no-repeat bottom left';
            jobb.style.background = 'url('+url+'/template/images/menu_shadow_orange.gif) no-repeat bottom left';

        }

        // az első, és jobbra selected
        if (m == 1 && jobb.className == "selected") {

            akt.childNodes[0].style.background = 'url('+url+'/template/images/menu_shadow_white.gif) no-repeat bottom left';
            jobb.style.background = '';

        }

    }

    // visszaállítunk mindent a helyére
    function menuOut(m) {

        if (m == 7) return;

        var balID = m; balID--;
        var jobbID = m; jobbID++;

        var bal = $div("menu"+balID);
        var akt = $div("menu"+m);
        var jobb = $div("menu"+jobbID);

        // nem az első, és balra selected
        if (m > 1 && bal.className == "selected") {

            akt.childNodes[0].style.background = 'url('+url+'/template/images/menu_shadow_orange.gif) no-repeat bottom left';
            jobb.style.background = '';

        }

        // mindegy hanyadik, de jobbra selected
        if (jobb.className == "selected") {

            jobb.childNodes[0].style.background = '#FFF';
            akt.style.background = '';

        }

        // nem az első, és se balra, se jobbra nincs selected
        if ((m > 1 && bal.className != "selected") && jobb.className != "selected") {

            jobb.style.background = '';

        }

        // az első, és jobbra nem selected
        if (m == 1 && jobb.className != "selected") {

            akt.childNodes[0].style.background = 'url('+url+'/template/images/menu_shadow_orange.gif) no-repeat bottom left';
            jobb.style.background = '';

        }

        // az első, és jobbra selected
        if (m == 1 && jobb.className == "selected") {

            akt.childNodes[0].style.background = 'url('+url+'/template/images/menu_shadow_orange.gif) no-repeat bottom left';
            jobb.style.background = '';

        }

        // az aktuális selected
        if (m > 1 && akt.className == "selected") {

            jobb.style.background = 'url('+url+'/template/images/menu_shadow_orange.gif) no-repeat bottom left';

        }

        // az első, és selected
        if (m == 1 && akt.className == "selected") {

            akt.childNodes[0].style.background = '#FFF url('+url+'/template/images/menu_shadow_white.gif) no-repeat bottom left';
            jobb.style.background = 'url('+url+'/template/images/menu_shadow_orange.gif) no-repeat bottom left';

        }

    }

    // az oldal betöltődésekor rárakjuk a rollover funkciókat a menüpontokra
    // illetve beállítjuk a selected-et, valamint a mellette lévőnek az árnyékát
    function setRolloversOnMenus() {

        var ii = 0;

        navRoot = document.getElementById("mainMenu");
        for (i=0; i<navRoot.childNodes.length; i++) {
            node = navRoot.childNodes[i];
            if (node.nodeName=="LI") {

                ii++;
                
                // ha az elsőbe botlunk, akkor raknunk kell rá alapból egy árnyékot, vagyis a keresőboxra
                if (ii == 1 && node.className != "selected") {
                    $div("menu"+ii).childNodes[0].style.background = 'url('+url+'/template/images/menu_shadow_orange.gif) no-repeat bottom left';
                }
                if (ii == 1 && node.className == "selected") {
                    $div("menu"+ii).childNodes[0].style.background = '#FFF url('+url+'/template/images/menu_shadow_white.gif) no-repeat bottom left';
                }

                // ha ki van választva, akkor a mellette lévőre kell árnyékot raknunk
                // ez az oldal betöltődésekor történik
                if (node.className == "selected") $div("menu"+(ii+1)).style.background = 'url('+url+'/template/images/menu_shadow_orange.gif) no-repeat bottom left';

                // rárakjuk a funkciókat a menüpontra
                node.onmouseover=function() { id = this.id.replace("menu", ""); menuOver(id); }
                node.onmouseout=function() { id = this.id.replace("menu", ""); menuOut(id); }
            }
        }

    }

    window.onload = setRolloversOnMenus;

    /*******************************************************************/

    // regisztrációnál
    // ha üres egy input, akkor kap egy "red" class-t is, ezzel jelezve, hogy ki kell tölteni
    function checkRegFormInput(w) {
      w.className = (w.value != '') ? 'input' : 'input red';
    }

    /*******************************************************************/

    // kép popup
    function kep(mit) {
      window.open(url+'/kep.php?pic='+mit,'','width=100,height=100,toolbar=no,status=no,resizable=yes,scrollbars=auto');
    }

    /*******************************************************************/

    // a kosár tartalmánál a darabszám és a "Változtatás" link helyére rakunk egy input mezőt
    function darabModify(id) {
      
        if ($div("darabModifyDiv"+id).style.display == "none") {
            hideDiv("darabDiv"+id);
            showDiv("darabModifyDiv"+id);
        } else {
            showDiv("darabDiv"+id);
            hideDiv("darabModifyDiv"+id);
        }
    }

    /*******************************************************************/

    // getElementById egyszerűsítve
    function $div(id) { return document.getElementById(id); }

    // láthatóvá tesz egy divet
    function showDiv(_id) {
      document.getElementById(_id).style.display = 'block';
    }
  
    // elrejt egy divet
    function hideDiv(_id) {
      document.getElementById(_id).style.display = 'none';
    }

