var dropdownGO = true; var hide_menu = true; if (dropdownGO) { var isIE = new isIE(); } var height = 14; function isIE () { var agt=navigator.userAgent.toLowerCase(); this.ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)); this.gecko = (agt.indexOf('ecko') != -1); this.firefox = (agt.indexOf('irefox') != -1); this.mac = (agt.indexOf("mac")!=-1); this.macppc = (this.mac && ((agt.indexOf("ppc")!=-1) || (agt.indexOf("powerpc")!=-1))); this.konq = (agt.indexOf('onqueror') != -1); this.linux = (agt.indexOf("inux")!=-1); } function setLayer(layerID,visible) { if (dropdownGO) { var click_target = document.getElementById(layerID); var menu = new nameObj(layerID+'Menu'); if (click_target) { var targetX = coorX(click_target); var targetY = coorY(click_target); if (isIE.ie) { targetY += height - 1; } else if (isIE.gecko && isIE.mac && !isIE.firefox) { targetY += height - 2; targetX += 0; } else if (isIE.firefox) { targetY += height - 1; targetX += 0; } else if (isIE.konq && isIE.linux) { targetY += height - 1; targetX += 0; } else { targetY += height; } menu.style.top = targetY + 'px'; menu.style.left = targetX + 'px'; } if (visible=='toggle') hide_menu = !hide_menu; if (visible=='hidden') hide_menu = true; if (visible=='visible') hide_menu = false; menu.style.visibility = (hide_menu) ? 'hidden' : 'visible'; } } function coorX(obj) { var left = 0; if (obj.offsetParent) { while (obj.offsetParent) { left += obj.offsetLeft; obj = obj.offsetParent; } } else if (obj.x) { left += obj.x; } return left; } function coorY(obj) { var curtop = 0; if (obj.offsetParent) { while (obj.offsetParent) { curtop += obj.offsetTop; obj = obj.offsetParent; } } else if (obj.y) { curtop += obj.y; } return curtop; } function nameObj(name) { if (document.getElementById) { this.obj = document.getElementById(name); this.style = document.getElementById(name).style; } else if (document.all) { this.obj = document.all[name]; this.style = document.all[name].style; } else if (document.layers) { if (document.layers[name]) { this.obj = document.layers[name]; this.style = document.layers[name]; } } } var b_menu = ''; b_menu += ''; b_menu += ''; b_menu += ''; b_menu += ''; b_menu += ''; tmpObj = document.getElementById('dropMenu'); tmpObj.innerHTML = b_menu;