
<!--

//***** SWITCH MENU *****

/***********************************************
* Switch Menu script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
* http://www.dynamicdrive.com/dynamicindex1/switchmenu.htm
***********************************************/

//closes every menu item onload
if (document.getElementById) {
        document.write('<style type="text/css">\n');
        document.write('.submenu{display: none;}\n');
        document.write('</style>\n');
        //var openMenuItem = document.getElementById(obj);
        //if (obj) el.style.display = "block";
}


function SwitchMenu(obj, smi) {
        if (document.getElementById) {
                var el = document.getElementById(obj);
                var mark = document.getElementById(smi);
                var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change

                if (el)
                {
                if (el.style.display != "block") { //open menuitem
                        var count = 0;
                        for (var i = 0; i < ar.length; i++) { //loop through span's and set submenu-spans to display=none
                                if (ar[i].className == "submenu") {
                                        ar[i].style.display = "none";
                                        count++;
                                }
                        }
                        //alert(obj + ' set to block ' + ar.length + ' ' + count);
                        el.style.display = "block";
                        if (mark)
                            //mark.style.color = "#000000";
                            mark.style.fontWeight = "bold";
                } else {        //close menuitem
                        //alert(obj + ' set to none');
                        el.style.display = "none";
                }
                }
        }
}


function closeall() {
        if (document.getElementById) {
                var ar = document.getElementById("masterdiv").getElementsByTagName("span");
                for (var i = 0; i < ar.length; i++) { //loop through span's and set submenu-spans to display=none
                        if (ar[i].className == "submenu") {
                                ar[i].style.display = "none";
                        }
                }
        }
}


function markme(menuitem) {
    if (document.getElementById) {
        //unmark all other submenuitems
        var ar = document.getElementById("masterdiv").getElementsByTagName("a");
        for (var i = 0; i < ar.length; i++) { //loop through span's and set submenu-spans to display=none
           if (ar[i].className == "submenutext" /*&& ar[i].id.substring(1,3) == "smi"*/) {
               ar[i].style.fontWeight = "normal";
           }
        }


        //var tomark = document.getElementById(smi);
        //tomark.style.fontWeight = "bolder";
        menuitem.style.fontWeight = "bolder";

    }
}


function mark(menuitem, bmarked) {
    if (document.getElementById) {
        if (bmarked)
            menuitem.style.color = "#AFAFAF";
        else
            menuitem.style.color = "#4F4F4F";
    }
}


//-->


