/* BEGIN NAV MENUS */ var last_subnav = ''; var last_top = ''; var last_left = ''; var mouse_over_item = new Array(); var mouse_over_subitem = new Array(); function subnav_change(ob_a, subnav){ //hide_subnav(); if (subnav == '') { // mouse out item mouse_over_item[last_subnav] = false; hide_subnav(last_subnav, false); } else { // mouse over item // kill previous drop-down if there is one if (last_subnav && last_subnav != subnav){ hide_subnav(last_subnav, true); } // store current subnav for later use last_subnav = subnav; last_top = (_offsetTop(ob_a) + ob_a.offsetHeight) + 'px'; last_left = _offsetLeft(ob_a) + 'px'; // display subnav show_subnav() // set over states for link and drop-down mouse_over_item[subnav] = true; mouse_over_subitem[subnav] = false; } } function mouse_over_subnav(subnav, mouse_over){ // mouse over / out subnav mouse_over_subitem[subnav] = mouse_over; if (mouse_over == false){ hide_subnav(last_subnav, false); } else { mouse_over_item[subnav] = false; show_subnav() } } function show_subnav(){ // setup DIV's position and show ob_subnav = document.getElementById(last_subnav); ob_subnav.style.top = last_top; ob_subnav.style.left = last_left; ob_subnav.style.display = ''; // setup IFrame shim hack to make IE overlay select boxes ob_iframe = document.getElementById('div_shim'); ob_iframe.width = ob_subnav.offsetWidth; ob_iframe.height = ob_subnav.offsetHeight; ob_iframe.style.top = last_top; ob_iframe.style.left = last_left; ob_iframe.style.display = ''; } function hide_subnav(subnav, keep_shim){ //alert(last_subnav + ", " + subnav + ', ' + mouse_over_item[subnav] + ', ' + mouse_over_subitem[subnav]); // hide subnav if needed, called from settimeout('', 100) to give slight delay required for correct operation if (mouse_over_item[subnav] == false && mouse_over_subitem[subnav] == false) { document.getElementById(subnav).style.display = 'none'; // kill IFrame shim normally except when triggered from new subnav if (!keep_shim) { ob_iframe = document.getElementById('div_shim').style.display = 'none'; } } } /* IE and Mozilla render the this.offsetLeft and this.offsetTop properties differently, so instead use these functions to make them behave the same. Basically IE reports offset from the parent object and everything else reports it from the page. These functions recursively go to the parent objects and add up offsets. */ function _offsetLeft(ob) { var x = ob.offsetLeft, parent = ob.offsetParent; while(parent) { x += parent.offsetLeft; parent = parent.offsetParent; } return x; } function _offsetTop(ob) { var x = ob.offsetTop, parent = ob.offsetParent; while(parent) { x += parent.offsetTop; parent = parent.offsetParent; } return x; } /* END NAV MENUS */