function NS4resize() { if (NS4sIW NS4sIW > window.innerWidth || NS4sIH > window.innerHeight || NS4sIH { window.location.reload(); } }
function onMenuItemOver(e, l) { FW_clearTimeout(); l = l || this; a = window.ActiveMenuItem; if (document.layers) { if (a) { a.document.bgColor = a.saveColor; if (a.hilite) a.hilite.visibility = "hidden"; if (a.Menu.bgImageOver) { a.background.src = a.Menu.bgImageUp; } a.focusItem.top = -100; a.clicked = false; } if (l.hilite) { l.document.bgColor = l.menuHiliteBgColor; l.zIndex = 1; l.hilite.visibility = "inherit"; l.hilite.zIndex = 2; l.document.layers[1].zIndex = 1; l.focusItem.zIndex = this.zIndex +2; } if (l.Menu.bgImageOver) { l.background.src = l.Menu.bgImageOver; } l.focusItem.top = this.top; l.Menu.hideChildMenu(l); } else if (l.style && l.Menu) { if (a) { a.style.backgroundColor = a.saveColor; if (a.hilite) a.hilite.style.visibility = "hidden"; if (a.Menu.bgImageUp) { a.style.background = "url(" + a.Menu.bgImageUp +")";; } } if (l.isSeparator) return; l.style.backgroundColor = l.menuHiliteBgColor; l.zIndex = 1; // magic IE 4.5 mac happy doohicky. jba if (l.Menu.bgImageOver) { l.style.background = "url(" + l.Menu.bgImageOver +")"; } if (l.hilite) { l.style.backgroundColor = l.menuHiliteBgColor; l.hilite.style.visibility = "inherit"; } l.focusItem.style.top = l.focusItem.style.pixelTop = l.style.pixelTop; l.focusItem.style.zIndex = l.zIndex +1; l.Menu.hideChildMenu(l); } else { return; // not a menu - magic IE 4.5 mac happy doohicky. jba } window.ActiveMenuItem = l; }
function onMenuItemAction(e, l) { l = window.ActiveMenuItem; if (!l) return; hideActiveMenus(); if (l.action) { eval("" + l.action); } window.ActiveMenuItem = 0; }
function FW_clearTimeout() { if (fwHideMenuTimer) clearTimeout(fwHideMenuTimer); fwHideMenuTimer = null; fwDHFlag = false; } function FW_startTimeout() { fwStart = new Date(); fwDHFlag = true; fwHideMenuTimer = setTimeout("fwDoHide()", 1000); }
function fwDoHide() { if (!fwDHFlag) return; var elapsed = new Date() - fwStart; if (elapsed fwHideMenuTimer = setTimeout("fwDoHide()", 1100-elapsed); return; } fwDHFlag = false; hideActiveMenus(); window.ActiveMenuItem = 0; }
function FW_showMenu(menu, x, y, child) { if (!window.fwWroteMenu) return; FW_clearTimeout(); if (document.layers) { if (menu) { var l = menu.menuLayer || menu; l.left = 1; l.top = 1; hideActiveMenus(); if (this.visibility) l = this; window.ActiveMenu = l; } else { var l = child; } if (!l) return; for (var i=0; i if (!l.layers[i].isHilite) l.layers[i].visibility = "inherit"; if (l.layers[i].document.layers.length > 0) FW_showMenu(null, "relative", "relative", l.layers[i]); } if (l.parentLayer) { if (x != "relative") l.parentLayer.left = x || window.pageX || 0; if (l.parentLayer.left + l.clip.width > window.innerWidth) l.parentLayer.left -= (l.parentLayer.left + l.clip.width - window.innerWidth); if (y != "relative") l.parentLayer.top = y || window.pageY || 0; if (l.parentLayer.isContainer) { l.Menu.xOffset = window.pageXOffset; l.Menu.yOffset = window.pageYOffset; l.parentLayer.clip.width = window.ActiveMenu.clip.width +2; l.parentLayer.clip.height = window.ActiveMenu.clip.height +2; if (l.parentLayer.menuContainerBgColor) l.parentLayer.document.bgColor = l.parentLayer.menuContainerBgColor; } } l.visibility = "inherit"; if (l.Menu) l.Menu.container.visibility = "inherit"; } else if (FIND("menuItem0")) { var l = menu.menuLayer || menu; hideActiveMenus(); if (typeof(l) == "string") { l = FIND(l); } window.ActiveMenu = l; var s = l.style; s.visibility = "inherit"; if (x != "relative") s.left = s.pixelLeft = x || (window.pageX + document.body.scrollLeft) || 0; if (y != "relative") s.top = s.pixelTop = y || (window.pageY + document.body.scrollTop) || 0; l.Menu.xOffset = document.body.scrollLeft; l.Menu.yOffset = document.body.scrollTop; } if (menu) { window.activeMenus[window.activeMenus.length] = l; } }
function onMenuItemDown(e, l) { var a = window.ActiveMenuItem; if (document.layers) { if (a) { a.eX = e.pageX; a.eY = e.pageY; a.clicked = true; } } }
function mouseupMenu(e) { hideMenu(true, e); hideActiveMenus(); return true; }
function mouseoutMenu() { hideMenu(false, false); return true; }
function hideMenu(mouseup, e) { var a = window.ActiveMenuItem; if (a && document.layers) { a.document.bgColor = a.saveColor; a.focusItem.top = -30; if (a.hilite) a.hilite.visibility = "hidden"; if (mouseup && a.action && a.clicked && window.ActiveMenu) { if (a.eX = e.pageX-15 && a.eY = e.pageY-10) { setTimeout('window.ActiveMenu.Menu.onMenuItemAction();', 2); } } a.clicked = false; if (a.Menu.bgImageOver) { a.background.src = a.Menu.bgImageUp; } } else if (window.ActiveMenu && FIND("menuItem0")) { if (a) { a.style.backgroundColor = a.saveColor; if (a.hilite) a.hilite.style.visibility = "hidden"; if (a.Menu.bgImageUp) { a.style.background = "url(" + a.Menu.bgImageUp +")";; } } } if (!mouseup && window.ActiveMenu) { if (window.ActiveMenu.Menu) { if (window.ActiveMenu.Menu.hideOnMouseOut) { FW_startTimeout(); } return(true); } } return(true); }
function PxToNum(pxStr) { // pxStr == 27px, we want 27. if (pxStr.length > 2) { n = Number(pxStr.substr(0, pxStr.length-2)); return(n); } return(0); }
function hideChildMenu(hcmLayer) { FW_clearTimeout(); var l = hcmLayer; for (var i=0; i var theLayer = l.Menu.childMenus[i]; if (document.layers) { theLayer.visibility = "hidden"; } else { theLayer = FIND(theLayer); theLayer.style.visibility = "hidden"; } theLayer.Menu.hideChildMenu(theLayer); }
if (l.childMenu) { var childMenu = l.childMenu; if (document.layers) { l.Menu.FW_showMenu(null,null,null,childMenu.layers[0]); childMenu.zIndex = l.parentLayer.zIndex +1; childMenu.top = l.top + l.parentLayer.top + l.Menu.menuLayer.top + l.Menu.menuItemHeight/3; if (childMenu.left + childMenu.clip.width > window.innerWidth) { childMenu.left = l.parentLayer.left - childMenu.clip.width + l.Menu.menuLayer.left + 15; l.Menu.container.clip.left -= childMenu.clip.width; } else { childMenu.left = l.parentLayer.left + l.parentLayer.clip.width + l.Menu.menuLayer.left -5; } var w = childMenu.clip.width+childMenu.left-l.Menu.container.clip.left; if (w > l.Menu.container.clip.width) l.Menu.container.clip.width = w; var h = childMenu.clip.height+childMenu.top-l.Menu.container.clip.top; if (h > l.Menu.container.clip.height) l.Menu.container.clip.height = h; l.document.layers[1].zIndex = 0; childMenu.visibility = "inherit"; } else if (FIND("menuItem0")) { childMenu = FIND(l.childMenu); var menuLayer = FIND(l.Menu.menuLayer); var s = childMenu.style; s.zIndex = menuLayer.style.zIndex+1; if (document.all) { // ie case. s.pixelTop = l.style.pixelTop + menuLayer.style.pixelTop + l.Menu.menuItemHeight/3; s.left = s.pixelLeft = (menuLayer.style.pixelWidth) + menuLayer.style.pixelLeft -5; } else { // zilla case var top = PxToNum(l.style.top) + PxToNum(menuLayer.style.top) + l.Menu.menuItemHeight/3; var left = (PxToNum(menuLayer.style.width)) + PxToNum(menuLayer.style.left) -5; s.top = top; s.left = left; } childMenu.style.visibility = "inherit"; } else { return; } window.activeMenus[window.activeMenus.length] = childMenu; } }
function hideActiveMenus() { if (!window.activeMenus) return; for (var i=0; i if (!activeMenus[i]) continue; if (activeMenus[i].visibility && activeMenus[i].Menu) { activeMenus[i].visibility = "hidden"; activeMenus[i].Menu.container.visibility = "hidden"; activeMenus[i].Menu.container.clip.left = 0; } else if (activeMenus[i].style) { var s = activeMenus[i].style; s.visibility = "hidden"; s.left = -200; s.top = -200; } } if (window.ActiveMenuItem) { hideMenu(false, false); } window.activeMenus.length = 0; }
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.