/*############################################################ ########### DHTML MENU v1.0 by Andres Gonzalez ########### ############################################################## *- you are free to use this code as you wish, as long as you keep these comments on the top of the code. ############################################################*/ var timeout = 400; // time in ms for menu before menu hides var clear; // holds timeout funtion for menu to be cleared // submenus var menuSubs = new Array(8); // total menu items -1 (0 is first) menuSubs[1] = 'mn1Sub'; // list all submenus in array format, following their order menuSubs[2] = 'mn2Sub'; // list all submenus in array format, following their order menuSubs[3] = 'mn3Sub'; // list all submenus in array format, following their order menuSubs[4] = 'mn4Sub'; // list all submenus in array format, following their order menuSubs[5] = 'mn5Sub'; // list all submenus in array format, following their order menuSubs[6] = 'mn6Sub'; // list all submenus in array format, following their order menuSubs[7] = 'mn7Sub'; // list all submenus in array format, following their order menuSubs[8] = 'mn8Sub'; // list all submenus in array format, following their order function mnuTgl(tgl,menu) { if (tgl == 1) { clearTimeout(clear); mnuHideOth(menu); mnuShow(menu); }else{ clear = setTimeout("mnuHide('"+menu+"')",timeout); } } function mnuShow(m){ document.getElementById(m).style.display = "block"; } function mnuHide(m){ document.getElementById(m).style.display = "none"; } function mnuHideOth(m){ for(x=0; x <= menuSubs.length; x++){ //loop through array if(m.indexOf(x) == -1 && menuSubs[x] != null){ // if its not the current menu item && submenu exists mnuHide(menuSubs[x]); } } } function kadabra(zap) { if (document.getElementById) { var abra = document.getElementById(zap).style; if (abra.display == "block") { abra.display = "none"; } else { abra.display = "block"; } return false; } else { return true; } }