var p2mnu_active = null; var p2mnu_class = null; function findPos(obj) { var coords = {x: 0, y: 0}; if (obj.offsetParent) { coords.x = obj.offsetLeft; coords.y = obj.offsetTop; while (obj = obj.offsetParent) { coords.x += obj.offsetLeft; coords.y += obj.offsetTop; } } return coords; } function p2mnu_coords (element) { var coords = {x: 0, y: 0}; coords = findPos(element); coords.y += element.offsetHeight;//24; return coords; } function p2mnu_changeOrderMaps(zi){ var m = getElement("map"); if(m == null) return; m.style.zIndex = zi; } function p2mnu_show(sID) { if(sID == p2mnu_active) return; else p2mnu_hide(p2mnu_active); //p2mnu_changeOrderMaps(-1); var elmCache = getElement(sID); if(elmCache == null) return; p2mnu_active = sID; p2mnu_class = elmCache.className; elmCache.className = "on"; var subCache = getElement("submenu_" + sID); if(subCache == null) return; coords = p2mnu_coords(elmCache); subCache.style.left = coords.x + "px"; subCache.style.top = coords.y + "px"; subCache.style.display = "block"; //subCache.style.visibility = "visible"; } function p2mnu_hide(sID) { if(sID == null) return; //p2mnu_changeOrderMaps(1); var elmCache = getElement(sID); if(elmCache == null) return; elmCache.className = p2mnu_class;//"off"; var subCache = getElement("submenu_" + sID); if(subCache == null) return; // var x = -1000; // var y = -1000; // subCache.style.left = x + "px"; // subCache.style.top = y + "px"; //subCache.style.visibility = "hidden"; subCache.style.display = "none"; p2mnu_active = null; } function p2mnu_power(mID) { var elmCache = getElement(mID); if(elmCache == null) return; }