// JavaScript Document function init() { //========================================================================================== // if supported, initialize TransMenus //========================================================================================== // Check isSupported() so that menus aren't accidentally sent to non-supporting browsers. // This is better than server-side checking because it will also catch browsers which would // normally support the menus but have javascript disabled. // // If supported, call initialize() and then hook whatever image rollover code you need to do // to the .onactivate and .ondeactivate events for each menu. //========================================================================================== if (TransMenu.isSupported()) { TransMenu.initialize(); // hook all the highlight swapping of the main toolbar to menu activation/deactivation // instead of simple rollover to get the effect where the button stays hightlit until // the menu is closed. //adicionado controle para verificação da existência do DIV if (document.getElementById("processo")) { menu1.onactivate = function() { document.getElementById("processo").className = "hover";hideSelects(); }; menu1.ondeactivate = function() { document.getElementById("processo").className = "";showSelects(); }; } //adicionado controle para verificação da existência do DIV if (document.getElementById("documento")) { menu2.onactivate = function() { document.getElementById("documento").className = "hover";hideSelects(); }; menu2.ondeactivate = function() { document.getElementById("documento").className = "";showSelects(); }; } //adicionado controle para verificação da existência do DIV if (document.getElementById("arquivo")) { menu3.onactivate = function() { document.getElementById("arquivo").className = "hover";hideSelects(); }; menu3.ondeactivate = function() { document.getElementById("arquivo").className = "";showSelects(); }; } //adicionado controle para verificação da existência do DIV if (document.getElementById("mala_direta")) { menu7.onactivate = function() { document.getElementById("mala_direta").className = "hover";hideSelects(); }; menu7.ondeactivate = function() { document.getElementById("mala_direta").className = "";showSelects(); }; } //adicionado controle para verificação da existência do DIV if (document.getElementById("gerencia")) { menu8.onactivate = function() { document.getElementById("gerencia").className = "hover";hideSelects(); }; menu8.ondeactivate = function() { document.getElementById("gerencia").className = "";showSelects(); }; } //adicionado controle para verificação da existência do DIV if (document.getElementById("manual")) { menu11.onactivate = function() { document.getElementById("manual").className = "hover";hideSelects(); }; menu11.ondeactivate = function() { document.getElementById("manual").className = "";showSelects(); }; } } } // ======================================================================================================== // Estas duas funções abaixo não são originais do script. Elas foram incluídas para fazer sumir os <SELECT> que estavam aparecendo sobre os menus. // Elas detectam se o browser oferece problemas antes de apagar os selects // ======================================================================================================== function hideSelects(){ if (typeof document.body.style.maxHeight != "undefined") { // IE 7, mozilla, safari, opera 9 } else { // IE6, older browsers var oSelects=document.getElementsByTagName("select"); for(var i=0;i < oSelects.length;i++){ oSelects[i].className+=" hide"; } } } function showSelects(){ if (typeof document.body.style.maxHeight != "undefined") { // IE 7, mozilla, safari, opera 9 } else { // IE6, older browsers var oSelects=document.getElementsByTagName("select"); for(var i=0;i < oSelects.length;i++){ oSelects[i].className=oSelects[i].className.replace(" hide",""); } } }