function mnpMenuGreenAttach(el) { el.attachEvent("onmouseenter", mnpMenuEnterColor); el.attachEvent("onmouseleave", mnpMenuLeaveColor); var divs = el.getElementsByTagName("DIV"); var t = divs.length; for (var i=0; i < t; i++) { var div = divs.item(i); if (div.className == "mnpMenuGreenRow") { div.attachEvent("onmouseenter", mnpMenuGreenMouseover); div.attachEvent("onmouseleave", mnpMenuGreenMouseout); div.attachEvent("onmousedown", mnpMenuGreenMousedown); div.attachEvent("onmouseup", mnpMenuGreenMouseup); div.setAttribute("save-background", div.style.background); div.setAttribute("save-border", div.style.borderColor); var a = div.getElementsByTagName("A"); if (a.length > 0) { var a0 = a[0]; if (a0.getAttribute("aoff")) a0.outerHTML = a0.innerHTML; else { div.setAttribute("status", a0.href); div.attachEvent("onclick", mnpMenuClick); } } if (div.getAttribute("menu")) { var imgs = div.getElementsByTagName("IMG"); if (imgs.length > 0) { var img = imgs[0]; img.style.visibility = "visible"; } else { var x; if (mnpMenuDirSave == "LTR") x = (div.offsetWidth - 10) + "px"; else if (mnpMenuTop.contains(div)) x = "4px"; else x = "6px"; var img = ""; div.insertAdjacentHTML("afterBegin", img); } } } } } function mnpMenuGreenOpen(id, parentId, x, y) { var parent; try { parent = document.getElementById(parentId); } catch(e) { return; } var current = parent.getAttribute("currentMenu"); if (id == current) return; mnpKillMenuColor(current); if (id) parent.setAttribute("currentMenu", id); else { parent.removeAttribute("currentMenu"); return; } var div = document.getElementById(id); if (div == null) { var menu = eval("new " + id + "()"); var html = "
"; html += ""; html += "
"; var isThisPage = false; var mLength = menu.items.length; for (var i=0; i" + label + ""; else html += "" + label + ""; } else html += "" + label + ""; html += "
"; } html += "
"; html += ""; html += ""; document.body.insertAdjacentHTML("afterBegin", html); var div = document.getElementById(id); var sa = div.childNodes.item(1); var max = 0; var saLength = sa.childNodes.length; for (var i=0; i max) max = w; } max += 34; if (max < 100) max = 100; else if (max > 410) max = 410; div.style.width = max + "px"; for (var i=0; i bodyHeight) { up.style.display = ""; up.childNodes.item(0).src = "/library/mnp/2/gif/up_disabled.gif"; down.style.display = ""; down.childNodes.item(0).src = "/library/mnp/2/gif/down_enabled.gif"; box.style.height = (bodyHeight - up.offsetHeight - down.offsetHeight - 6) + "px"; } var bodyBottom = bodyTop + bodyHeight; if (y + div.offsetHeight > bodyBottom) { y -= div.offsetHeight - 25; if (y < bodyTop) y = bodyTop + (bodyHeight - div.offsetHeight) / 2; } if (mnpMenuDirSave == "RTL") x -= div.offsetWidth; div.style.left = x + "px"; div.style.top = y + "px"; div.style.zIndex = parent.style.zIndex + 10; if (div.offsetLeft + div.offsetWidth > bodyWidth + bodyLeft) document.body.scrollLeft = div.offsetLeft + div.offsetWidth - bodyWidth; hide_elements("SELECT", div); hide_elements("OBJECT", div); if (mnpMenuShadowsEnabled) { mnpMenuShadows[id] = mnpMenuShadow(div, "#666666", 4, div.offsetWidth, div.offsetHeight); mnpMenuRenderStart = mnpMenuTime(); window.setTimeout("mnpMeasureRenderTime()", 1); } } function mnpMeasureRenderTime() { var msec = mnpMenuTime() - mnpMenuRenderStart; if (msec > 100) { // client is slow or document is huge, so disable shadows mnpMenuShadowsEnabled = false; } } function mnpMenuGreenMouseover() { var div = window.event.srcElement; var status = div.getAttribute("status"); if (status) window.status = status; div.style.background = "#B0E5C1"; div.style.borderColor = "#268740"; var pt = new mnpMenuPt(div); var x; if (mnpMenuDirSave == "LTR") x = pt.left + div.offsetWidth - 1; else x = pt.left + 2; var y = pt.top - 3; var menu = div.getAttribute("menu"); if (menu) menu = "'" + menu + "'"; else menu = "null"; if (mnpMenuPopup) window.clearTimeout(mnpMenuPopup); var parent = div.parentElement.parentElement; mnpMenuPopup = window.setTimeout("mnpMenuGreenOpen(" + menu + ", '" + parent.id + "', " + x + ", " + y + ")", 200); } function mnpMenuGreenMouseout() { var div = window.event.srcElement; window.status = ""; var menu = div.getAttribute("menu"); if (menu != null && menu == div.parentElement.parentElement.getAttribute("currentMenu")) { div.style.background = "#B0E5C1"; div.style.borderColor = "#268740"; } else { div.style.background = div.getAttribute("save-background"); div.style.borderColor = div.getAttribute("save-border"); } if (mnpMenuPopup) { window.clearTimeout(mnpMenuPopup); mnpMenuPopup = null; } } function mnpMenuGreenMousedown() { var div = window.event.srcElement; if (div.tagName != "DIV") div = div.parentElement; div.style.background = "#B0E5C1"; } function mnpMenuGreenMouseup() { var div = window.event.srcElement; if (div.tagName != "DIV") div = div.parentElement; div.style.background = div.getAttribute("save-background"); }