try { Sys && Sys.Application && Sys.Application.notifyScriptLoaded() } catch (ex) { } var ob_em_AutoPosition = true, ob_em_displayOffset = 10, isMenuOnTop = false; function ob_EasyMenu(ob_em_menu_id, ob_em_oat_id, ob_em_ui, ob_em_il, ob_em_hz_o, ob_em_vt_o, ob_em_mc, ob_em_ds, ob_em_ds_mc, ob_em_ds_ec, ob_em_se, ob_em_zi, ob_em_isMSAJAXAvailable, ob_em_isAJAXPageAvailable, ob_em_ss, ob_em_vt, ob_em_sf, ob_em_ev, ob_em_uniqueid, ob_em_SelectTreeNode, ob_dropdownIncrement, ob_dropSpeed, ob_keepOpen, ob_isMultiColumn) { this.showEvent = ob_em_se.toLowerCase(); this.ZIndex = ob_em_zi; this.id = "ob_em_" + ob_em_menu_id; this.menu_id = ob_em_menu_id; this.items = []; this.subMenus = []; this.parentMenu = null; this.oat_id = ob_em_oat_id; this.oat_ids = []; this.ui = ob_em_ui; this.il = ob_em_il; this.vt = ob_em_vt; this.iconsFolder = ob_em_sf; this.Events = ob_em_ev; this.selectedItemId = ""; this.SelectTreeNode = ob_em_SelectTreeNode; this.KeepOpen = ob_keepOpen; this.isMultiColumn = ob_isMultiColumn; this.DropIncrement = typeof ob_dropdownIncrement == "undefined" ? 10 : ob_dropdownIncrement; this.DropTime = typeof ob_dropSpeed == "undefined" ? 10 : ob_dropSpeed; if (isIE) { this.DropTime -= 3; this.DropIncrement -= 2 } this.classes = ob_em_mc; ob_em_getDefaultClasses(this); this.styleSheet = ob_em_ss == null ? this.id : ob_em_ss; this.hz_o = ob_em_hz_o; if (isIE) this.hz_o = this.hz_o - Math.ceil(this.hz_o / 95); this.vt_o = ob_em_vt_o; this.displayPosition = ob_em_ds.toLowerCase(); this.menuCorner = ob_em_arrangeAlignProperty(ob_em_ds_mc.toLowerCase()); this.elementCorner = ob_em_arrangeAlignProperty(ob_em_ds_ec.toLowerCase()); this.underlayOffsets; this.el = null; this.menu = document.getElementById(this.menu_id); this.menu.firstChild.cellPadding = "0"; this.menu.firstChild.cellSpacing = "0"; this.menu.firstChild.style.width = "100%"; if (isIE || isSafari || !this.vt) this.menu.style.display = ""; else { var overflowValue = ob_em_getStyle(this.menu, "overflow"); if (isOpera) overflowValue = this.menu.currentStyle.overflow; if (overflowValue == "auto" || overflowValue == "scroll") this.menu.style.display = ""; else this.menu.style.display = "" } this.menu.style.visibility = "visible"; this.type = "ob_em_menu"; this.menu.object = this; this.underlay = null; this.showCoords = null; this.visibleFor = null; this.documentMouseDown = ob_em_documentMouseDown; this.mouseHover = ob_em_mouseHover; this.showMenu = ob_em_showMenu; this.hideMenu = ob_em_hideMenu; this.menuItemClick = ob_em_menuItemClick; this.attachToControls = ob_em_attachToControls; this.attachToControl = ob_em_attachToControl; this.detachFromControl = ob_em_detachFromControl; this.detachFromAllControls = ob_em_detachFromAllControls; this.mouseOverMenu = ob_em_mouseOverMenu; this.getMenuCoords = ob_em_getMenuCoords; this.GetMenuCoordsFromElement = ob_em_GetMenuCoordsFromElement; this.IsLoaded = false; this.AddItem = ob_em_AddItem; this.RemoveItem = ob_em_RemoveItem; this.HideItem = ob_em_HideItem; this.ShowItem = ob_em_ShowItem; this.SetItemInnerHTML = ob_em_SetItemInnerHTML; this.isMSAJAXAvailable = ob_em_isMSAJAXAvailable; this.isAJAXPageAvailable = ob_em_isAJAXPageAvailable; try { document.execCommand("BackgroundImageCache", false, true) } catch (err) { } if (this.showEvent == "always") ob_em_buildMenuItems(this); else for (var i = 0; i < this.oat_id.length; i++) { try { var pm = document.getElementById(this.oat_id[i]); if (typeof pm == "number") { ob_em_buildMenuItems(this); break } if (pm == null && typeof pm == "object") { ob_em_buildMenuItems(this); break } } catch (ex) { if (typeof pm == "undefined") { ob_em_buildMenuItems(this); break } continue } if (this.oat_id[i] == "" || pm != null && pm.getAttribute("emType") != "MenuItem") { ob_em_buildMenuItems(this); break } } if (this.showEvent != "always") { this.menu.style.top = "-2000px"; this.menu.style.left = "0px"; ob_em_CreateMenuUnderlay(this.menu_id); this.underlay = document.getElementById(this.menu_id + "__underlay"); this.cover_iframe = document.getElementById(this.menu_id + "__iframe"); if (this.cover_iframe != null) { this.cover_iframe.style.display = ""; this.cover_iframe.style.position = "absolute"; this.cover_iframe.style.visibility = "hidden"; this.cover_iframe.style.top = "-2000px"; this.cover_iframe.style.left = "0px" } else isIE = false; if (!ob_em_isAJAXPageAvailable && !ob_em_isMSAJAXAvailable) if (document.body != this.underlay.parentNode) { document.body.insertBefore(this.cover_iframe, document.body.firstChild); document.body.insertBefore(this.menu, document.body.firstChild) } this.underlay.style.zIndex = 1 + parseInt(this.ZIndex, 10); this.menu.style.zIndex = 2 + parseInt(this.ZIndex, 10); !this.KeepOpen && ob_em_safeAddOnEvent("onclick", "document", "document.ob_em_mouseclickcollection", "documentMouseDown(ev)", this.id); if (this.showEvent == "mouseover") { eval("this.menu.onmouseover = function(e) {heo_ProcessEvent(e, ob_em_MouseMoveProcess, null, '" + this.menu_id + "')};"); eval("this.menu.onmouseout = function(e) {heo_ProcessEvent(e, null, ob_em_MouseMoveProcess, '" + this.menu_id + "')};"); eval("this.underlay.onmouseover = function(e) {heo_ProcessEvent(e, ob_em_MouseMoveProcess, null, '" + this.menu_id + "__underlay')};"); eval("this.underlay.onmouseout = function(e) {heo_ProcessEvent(e, null, ob_em_MouseMoveProcess, '" + this.menu_id + "__underlay')};") } window.setTimeout(Function("ob_em_loadComplete(" + this.id + ")"), 1); this.underlay.oncontextmenu = ob_em_cancelEvent } this.menu.oncontextmenu = ob_em_cancelEvent; window.onunload = ob_em_cleanUp; this.uniqueid = ob_em_uniqueid } function ob_em_loadComplete(menu) { for (var loadedMenus = 0, index = 0; index < ob_em_Menus.length; index++) { try { var isMenuLoaded = false; isMenuLoaded = typeof eval(ob_em_Menus[index]) == "object"; if (isMenuLoaded) { loadedMenus++; continue } } catch (ex) { } break } if (loadedMenus == ob_em_Menus.length) ob_em_attachToControls(menu); else window.setTimeout(Function("ob_em_loadComplete(" + (eval(menu)).id + ")"), 100) } function ob_em_buildMenuItems(menuObject, isSubmenu) { var menuFirstChild2 = menuObject.menu.firstChild.firstChild, itemsContainer = menuObject.vt ? menuFirstChild2.childNodes : menuFirstChild2.firstChild.childNodes; if (!menuObject.vt && menuObject.isMultiColumn) { itemsContainer = []; for (var i = 0; i < menuFirstChild2.childNodes.length; i++) for (var j = 0; j < menuFirstChild2.childNodes[i].childNodes.length; j++) itemsContainer.push(menuFirstChild2.childNodes[i].childNodes[j]) } for (var i = 0; i < itemsContainer.length; i++) { obj = menuObject.vt ? itemsContainer[i].firstChild : itemsContainer[i]; if (obj.id.toLowerCase().indexOf("_7r14l") == -1) { if (isSubmenu) for (var hasMenuAttached = false, j = 0; j < ob_em_Menus.length; j++) if (isOpera) { if (document.getElementById(ob_em_Menus[j].replace("ob_em_", "")) == null) { hasMenuAttached = false; break } for (var attachToArray = document.getElementById(ob_em_Menus[j].replace("ob_em_", "")).getAttribute("attachTo").split(","), index = 0; index < attachToArray.length; index++) if (attachToArray[index] == obj.id) { hasMenuAttached = true; break } if (hasMenuAttached) break } else if ((eval(ob_em_Menus[j])).oat_id == obj.id) { hasMenuAttached = true; break } if ((!isSubmenu || isSubmenu && hasMenuAttached) && !obj.alreadyAdded) { new ob_em_MenuItem(obj, menuObject); if (isSubmenu && hasMenuAttached) obj.alreadyAdded = true } } isOpera && obj.getAttribute("selected") != null && obj.getAttribute("selected") == "selected" && ob_em_SelectItem(obj.id) } if (!isSubmenu) { menuObject.itemsAdded = true; menuObject.IsLoaded = true } } function ob_em_buildSubmenu(id) { for (var menuObject = null, i = 0; i < ob_em_Menus.length; i++) if (ob_em_searchArrayForElement((eval(ob_em_Menus[i])).oat_ids, id) != -1) menuObject = eval(ob_em_Menus[i]); if (menuObject != null && typeof menuObject == "object") !menuObject.itemsAdded && ob_em_buildMenuItems(menuObject) } function ob_em_getStyle(oElm, strCssRule) { var strValue = ""; if (document.defaultView && document.defaultView.getComputedStyle) strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule); else if (oElm.currentStyle) try { strCssRule = strCssRule.replace(/\-(\w)/g, function(strMatch, p1) { return p1.toUpperCase() }); strValue = oElm.currentStyle[strCssRule] } catch (ex) { } return strValue } function ob_em_MenuItem(obj, objMenu) { var disabled = obj.getAttribute("disabled") != null && obj.getAttribute("disabled") == "disabled"; this.isSelected = obj.getAttribute("selected") != null && obj.getAttribute("selected") == "true"; obj.className = objMenu.classes[obj.getAttribute("emtype")]["c" + (this.isSelected ? "_o" : "")]; objMenu.items.push(obj); obj.object = this; this.item = obj; this.menu = objMenu.menu; this.type = "ob_em_menuitem"; obj.firstChild.cellPadding = "0"; obj.firstChild.cellSpacing = "0"; obj.firstChild.style.width = "100%"; obj.firstChild.style.height = "100%"; this.clickLink = ob_em_clickLink; this.iconCell = null; this.leftroundcornerCell = obj.firstChild.firstChild.firstChild.firstChild; this.contentCell = obj.firstChild.firstChild.firstChild.firstChild.nextSibling; this.subMenuCell = obj.firstChild.firstChild.firstChild.firstChild.nextSibling.nextSibling; this.rightroundcornerCell = obj.firstChild.firstChild.firstChild.firstChild.nextSibling.nextSibling.nextSibling; if (objMenu.ui) { this.iconCell = objMenu.il ? obj.firstChild.firstChild.firstChild.firstChild.nextSibling : obj.firstChild.firstChild.firstChild.firstChild.nextSibling.nextSibling.nextSibling; this.subMenuCell = objMenu.il ? obj.firstChild.firstChild.firstChild.firstChild.nextSibling.nextSibling.nextSibling : obj.firstChild.firstChild.firstChild.firstChild.nextSibling; this.contentCell = this.contentCell.nextSibling; this.rightroundcornerCell = obj.firstChild.firstChild.firstChild.firstChild.nextSibling.nextSibling.nextSibling.nextSibling } if (disabled) this.contentCell.style.color = "#A8A8A8"; if (!disabled) { ob_em_safeAddOnEvent("onmouseover", "document.getElementById('" + obj.id + "')", "document.getElementById('" + obj.id + "').ob_em_mouseovercollection", "heo_ProcessEvent(ev, function(ev){ob_em_buildSubmenu('" + obj.id + "');ob_em_ElementHover(ev, '" + obj.id + "', '" + objMenu.menu_id + "')}, null, '" + obj.id + "')", null); ob_em_safeAddOnEvent("onmouseout", "document.getElementById('" + obj.id + "')", "document.getElementById('" + obj.id + "').ob_em_mouseoutcollection", "heo_ProcessEvent(ev, null, function(ev){ob_em_ElementHover(ev, '" + obj.id + "', '" + objMenu.menu_id + "')}, '" + obj.id + "')", null) } if (this.isSelected) objMenu.selectedItemId = obj.id; if (objMenu.isAJAXPageAvailable || objMenu.isMSAJAXAvailable) document.getElementById(obj.id).ob_em_mouseclickcollection = undefined; if (!disabled) { ob_em_safeAddOnEvent("onclick", "document.getElementById('" + obj.id + "')", "document.getElementById('" + obj.id + "').ob_em_mouseclickcollection", "menuItemClick(document.getElementById('" + obj.id + "'), ev)", objMenu.id); obj.oncontextmenu = ob_em_cancelEvent } } function ob_em_attachToControls(menuObject) { ob_em_buildMenuItems(menuObject, true); var i = 0, IsMenuItemInitialized = true; while (i < menuObject.oat_id.length) { var itemObject = document.getElementById(menuObject.oat_id[i]); if (itemObject != null && (itemObject.getAttribute("emType") != "MenuItem" || typeof itemObject.object != "undefined") && menuObject.attachToControl(menuObject.oat_id[i])) menuObject.oat_id.splice(i, 1); else { if (itemObject != null && itemObject.getAttribute("emType") == "MenuItem" && typeof itemObject.object == "undefined") IsMenuItemInitialized = false; i++ } } if (menuObject.oat_id.length > 0 && !ob_em_wdl || !IsMenuItemInitialized) { window.setTimeout(Function("ob_em_attachToControls(" + menuObject.id + ")"), 100); return } menuObject.IsLoaded = true } function ob_em_attachToControl(id) { var ob_em_oat = id.toLowerCase() == "document" ? document.body : document.getElementById(id); if (ob_em_oat != null) { if (ob_em_searchArrayForElement(this.oat_ids, id) != -1) return; this.oat_ids.push(id); if (ob_em_oat.id == "") alert('The EasyMenu needs to be attached to some html element.\n\nPlease specify "AttachTo" value!'); else { var obj = document.getElementById(ob_em_oat.id), disabled = obj.getAttribute("disabled") != null && obj.getAttribute("disabled") == "disabled"; if (!disabled) if (this.showEvent == "contextmenu") ob_em_safeAddOnEvent("oncontextmenu", "document.getElementById('" + ob_em_oat.id + "')", "document.getElementById('" + ob_em_oat.id + "').ob_em_contextmenucollection", "documentMouseDown(" + (document.all ? "window.event" : "ev") + ");", this.id); else if (this.showEvent == "mouseclick") { ob_em_safeAddOnEvent("onclick", "document.getElementById('" + ob_em_oat.id + "')", "document.getElementById('" + ob_em_oat.id + "').ob_em_mouseclickcollection", "documentMouseDown(" + (document.all ? "window.event" : "ev") + ")", this.id); ob_em_safeAddOnEvent("oncontextmenu", "document.getElementById('" + ob_em_oat.id + "')", "document.getElementById('" + ob_em_oat.id + "').ob_em_contextmenucollection", "hideMenu(" + (document.all ? "window.event" : "ev") + ", true, false, true)", this.id) } else if (this.showEvent == "doubleclick") { ob_em_safeAddOnEvent("ondblclick", "document.getElementById('" + ob_em_oat.id + "')", "document.getElementById('" + ob_em_oat.id + "').ob_em_mouseclickcollection", "documentMouseDown(" + (document.all ? "window.event" : "ev") + ")", this.id); ob_em_safeAddOnEvent("oncontextmenu", "document.getElementById('" + ob_em_oat.id + "')", "document.getElementById('" + ob_em_oat.id + "').ob_em_contextmenucollection", "hideMenu(" + (document.all ? "window.event" : "ev") + ", true, false, true)", this.id) } else if (this.showEvent == "mouseover") { ob_em_safeAddOnEvent("onmouseover", "document.getElementById('" + ob_em_oat.id + "')", "document.getElementById('" + ob_em_oat.id + "').ob_em_mouseovercollection", "heo_ProcessEvent(ev, function(ev){ob_em_ElementHover(ev, '" + ob_em_oat.id + "', '" + this.menu_id + "')}, null, '" + ob_em_oat.id + "')", null); ob_em_safeAddOnEvent("onmouseout", "document.getElementById('" + ob_em_oat.id + "')", "document.getElementById('" + ob_em_oat.id + "').ob_em_mouseoutcollection", "heo_ProcessEvent(ev, null, function(ev){ob_em_ElementHover(ev, '" + ob_em_oat.id + "', '" + this.menu_id + "')}, '" + ob_em_oat.id + "')", null) } } var pm = ob_em_oat.object; if (pm != null && typeof pm.type != "undefined" && pm.type == "ob_em_menuitem" && pm.menu.object.id != this.id) { pm = pm.menu.object; pm.subMenus.push(this); this.parentMenu = pm; this.parentItem = ob_em_oat; ob_em_oat.object.ob_em_submenu = this; document.getElementById(ob_em_oat.id).object.ob_em_submenu = this; if (this.showEvent == "mouseclick" || this.showEvent == "doubleclick" || this.showEvent == "contextmenu") { var noHide = ob_em_oat.getAttribute("nohide"); ob_em_oat.object.wasNoHide = typeof noHide != "undefined" && noHide != null && noHide.toLowerCase() == "true"; ob_em_oat.setAttribute("nohide", "true") } ob_em_oat.object.subMenuCell.style.display = ""; ob_em_oat.object.contentCell.style.colspan = "1"; if (pm.menu.style.zIndex != "") this.underlay.style.zIndex = parseInt(pm.menu.style.zIndex, 10) + 1; this.menu.style.zIndex = parseInt(this.underlay.style.zIndex, 10) + 1; this.showEvent == "contextmenu" && ob_em_removeEvent(ob_em_oat, "oncontextmenu", ob_em_oat.ob_em_contextmenucollection, ob_em_cancelEvent) } if (typeof ob_em_oat.object == "undefined" || ob_em_oat.object == null) { ob_em_oat.object = {}; ob_em_oat.object.type = "ob_em_attachelement" } ob_em_oat.object.item = ob_em_oat; ob_em_oat.object.ob_em_submenu = this; this.parentItem = ob_em_oat; return true } return false } function ob_em_detachFromAllControls() { for (var y = [], i = 0; i < this.oat_ids.length; i++) y[i] = this.oat_ids[i]; for (var j = 0; j < y.length; j++) this.detachFromControl(y[j]) } function ob_em_detachFromControl(id) { var positionInArray = ob_em_searchArrayForElement(this.oat_ids, id); if (positionInArray == -1) return; var ob_em_oat = id.toLowerCase() == "document" ? document.body : document.getElementById(id); if (ob_em_oat != null) { try { if (this.showEvent == "contextmenu") ob_em_removeEvent(ob_em_oat, "oncontextmenu", ob_em_oat.ob_em_contextmenucollection, this.id + ".documentMouseDown"); else if (this.showEvent == "mouseclick") { ob_em_removeEvent(ob_em_oat, "onclick", ob_em_oat.ob_em_mouseclickcollection, this.id + ".documentMouseDown"); ob_em_removeEvent(ob_em_oat, "oncontextmenu", ob_em_oat.ob_em_contextmenucollection, this.id + ".hideMenu") } else if (this.showEvent == "doubleclick") { ob_em_removeEvent(ob_em_oat, "ondblclick", ob_em_oat.ob_em_mouseclickcollection, this.id + ".documentMouseDown"); ob_em_removeEvent(ob_em_oat, "oncontextmenu", ob_em_oat.ob_em_contextmenucollection, this.id + ".hideMenu") } else if (this.showEvent == "mouseover") { ob_em_removeEvent(ob_em_oat, "onmouseover", ob_em_oat.ob_em_mouseovercollection, "ob_em_ElementHover(ev, '" + ob_em_oat.id + "', '" + this.menu_id + "')"); ob_em_removeEvent(ob_em_oat, "onmouseout", ob_em_oat.ob_em_mouseoutcollection, "ob_em_ElementHover(ev, '" + ob_em_oat.id + "', '" + this.menu_id + "')") } } catch (ex) { } var pm = ob_em_oat.object; if (pm != null && typeof pm.type != "undefined" && pm.type == "ob_em_menuitem" && pm.menu.object.id != this.id) { pm = pm.menu.object; var subMenuPosition = ob_em_searchArrayForElement(pm.subMenus, this); subMenuPosition != -1 && pm.subMenus.splice(subMenuPosition, 1); (this.showEvent == "mouseclick" || this.showEvent == "doubleclick" || this.showEvent == "contextmenu") && (typeof ob_em_oat.object.wasNoHide == "undefined" || !ob_em_oat.object.wasNoHide) && ob_em_oat.setAttribute("nohide", "false"); ob_em_oat.object.ob_em_submenu = null; ob_em_oat.object.subMenuCell.style.display = "none"; ob_em_oat.object.contentCell.colspan = "2"; this.parentMenu = null; this.parentItem = null } } this.oat_ids.splice(positionInArray, 1) } var isMenuElement = true, keepMenu = false; function ob_em_documentMouseDown(e) { if (!e) e = window.event; if (!e) { this.hideMenu(null, true, false, true); return false } var eventType = e.type.toLowerCase(); if (e.type.toLowerCase() == "click") eventType = "mouseclick"; if (e.type.toLowerCase() == "dblclick") eventType = "doubleclick"; if (!document.all && e.type.toLowerCase() == "click" && e.which == 3) eventType = "contextmenu"; var evElems = ob_em_GetEventElements(e), itemSource = ob_em_GetParentItemFromElement(evElems[1], eventType, this.showEvent); if (itemSource != null) var itemIndex = ob_em_searchArrayForElement(this.oat_ids, itemSource.id); else itemIndex = -1; if (this.KeepOpen && eventType == "mouseclick" && itemIndex != -1) keepMenu = true; else if (eventType == "mouseclick" && itemIndex != -1) keepMenu = false; if (keepMenu && itemIndex == -1) return; if (eventType == this.showEvent && itemIndex != -1) { this.visibleFor = itemSource.object; this.showMenu(e); ob_em_cancelEvent(e); isMenuElement = true } else { var menu = ob_em_GetParentMenuFromElement(evElems[1]), index = 0; if (menu == null) { isMenuElement = false; var item = ob_em_GetParentItemFromElement(evElems[1], eventType, this.showEvent); if (item != null) { var index = -1; if (item.object.ob_em_submenu.menu.visibleFor == item) { index = ob_em_VisibleArrayIndexOf(item.object.ob_em_submenu.menu); if (index != -1) index += 2; else index = 0 } else return false } } else { isMenuElement = true; index = ob_em_VisibleArrayIndexOf(menu); if (index != -1) index += 2; else index = 0 } ob_em_HideAllFromIndex(index, false); return true } return false } function ob_em_MouseMoveProcess(e) { if (!e) e = window.event; if (!e) return false; var over = e.type.toLowerCase() == "mouseover", evElems = ob_em_GetEventElements(e), targetMenu = ob_em_GetParentMenuFromElement(evElems[0]), sourceMenu = ob_em_GetParentMenuFromElement(evElems[1]); targetMenu = targetMenu != null ? targetMenu : ob_em_GetUnderlayFromElement(evElems[0]); sourceMenu = sourceMenu != null ? sourceMenu : ob_em_GetUnderlayFromElement(evElems[1]); if (!over) { if (typeof sourceMenu.menu != "undefined" && typeof sourceMenu.menu.object == "object" && typeof sourceMenu.menu.object.type != "undefined" && sourceMenu.menu.object.type == "ob_em_menu") sourceMenu = sourceMenu.menu; if (targetMenu != null) { if (typeof targetMenu.menu != "undefined" && typeof targetMenu.menu.object == "object" && typeof targetMenu.menu.object.type != "undefined" && targetMenu.menu.object.type == "ob_em_menu") targetMenu = targetMenu.menu; if (ob_em_VisibleArrayElementHasPrecedence(sourceMenu, targetMenu)) return; else if (ob_em_VisibleArrayElementHasPrecedence(targetMenu, sourceMenu)) { var menuItem = ob_em_GetParentItemFromElement(evElems[0]); if (menuItem != null && ob_em_MenuIsSubmenuOfElement(sourceMenu, menuItem)) return; var menuIndex = ob_em_VisibleArrayIndexOf(sourceMenu); menuIndex > 0 && ob_em_HideAllFromIndex(menuIndex, true); return } else if (targetMenu.object.showEvent == "always") { var menuItem = ob_em_GetParentItemFromElement(evElems[0]); if (menuItem != null && ob_em_VisibleArrayElementHasPrecedence(menuItem, sourceMenu)) return } } else { targetMenu = ob_em_GetParentItemFromElement(evElems[0]); if (targetMenu != null && ob_em_MenuIsSubmenuOfElement(sourceMenu, targetMenu) && ob_em_MenuIsVisibleForElement(sourceMenu, targetMenu)) return } ob_em_HideAll(true) } return false } function ob_em_ElementHover(e, elementId, menuId) { var over = e.type.toLowerCase() == "mouseover", element = document.getElementById(elementId), menu = document.getElementById(menuId); if (over) { if (ob_em_MenuIsSubmenuOfElement(menu, element)) { menu.object.visibleFor = element.object; menu.object.showMenu(e) } } else { var mouseTo = ob_em_GetEventElements(e)[0], elementTo = ob_em_GetParentMenuFromElement(mouseTo); elementTo = elementTo == null ? ob_em_GetUnderlayFromElement(mouseTo) : elementTo; if (elementTo == null) menu.object.showEvent == "mouseover" && ob_em_HideAllFromIndex(Math.max(0, ob_em_VisibleArrayIndexOf(element)), menu.object.showEvent == "mouseover"); else { if (typeof elementTo.menu != "undefined" && typeof elementTo.menu.object == "object" && typeof elementTo.menu.object.type != "undefined" && elementTo.menu.object.type == "ob_em_menu") elementTo = elementTo.menu; if (!(element.object.type == "ob_em_menuitem" && element.object.menu == elementTo)) { var itemTo = ob_em_GetParentItemFromElement(mouseTo); if (itemTo != null && itemTo.object.type == "ob_em_menuitem" && ob_em_VisibleArrayElementHasPrecedence(itemTo.object.menu, menu)) return; else if (!ob_em_MenuIsSubmenuOfElement(elementTo, element) && !ob_em_MenuIsVisibleForElement(elementTo, element)) ob_em_HideAllFromIndex(Math.max(0, ob_em_VisibleArrayIndexOf(menu)), menu.object.showEvent != "mouseover" || menu.object.showEvent == "always"); else return } } } element.object.type == "ob_em_menuitem" && ob_em_mouseHover(element, e, over, false) } function ob_em_mouseHover(obj, e, over, force) { if (!force && !over && obj.object.ob_em_submenu != null && obj.object.ob_em_submenu.showEvent != "mouseover" && obj.object.ob_em_submenu.underlay != null && obj.object.ob_em_submenu.underlay.style.visibility.toLowerCase() == "visible") return; if (!obj.object.isSelected || over) { obj.className = obj.object.menu.object.classes[obj.getAttribute("emtype")]["c" + (over ? "_o" : "")]; try { obj.object.leftroundcornerCell.className = obj.object.menu.object.classes[obj.getAttribute("emtype")]["c_" + obj.object.leftroundcornerCell.getAttribute("emtype") + (over ? "_o" : "")]; obj.object.contentCell.className = obj.object.menu.object.classes[obj.getAttribute("emtype")]["c_" + obj.object.contentCell.getAttribute("emtype") + (over ? "_o" : "")]; obj.object.subMenuCell.firstChild.className = obj.object.menu.object.classes[obj.getAttribute("emtype")]["c_" + obj.object.subMenuCell.getAttribute("emtype") + (over ? "_o" : "")]; obj.object.rightroundcornerCell.className = obj.object.menu.object.classes[obj.getAttribute("emtype")]["c_" + obj.object.rightroundcornerCell.getAttribute("emtype") + (over ? "_o" : "")]; if (this.ui) obj.object.iconCell.className = obj.object.menu.object.classes[obj.getAttribute("emtype")]["c_" + obj.object.iconCell.getAttribute("emtype") + (over ? "_o" : "")] } catch (ex) { } } if (over && obj.object.ob_em_submenu == null) { var index = ob_em_VisibleArrayIndexOf(obj.object.menu); index >= 0 && ob_em_HideAllFromIndex(index + 2, obj.object.menu.object.showEvent != "mouseover") } if (!over && obj.object.ob_em_submenu != null) { var index = ob_em_VisibleArrayIndexOf(obj.object.ob_em_submenu.menu); index > -1 && ob_em_HideAllFromIndex(index, obj.object.menu.object.showEvent != "mouseover") } } var tp_increment = 0; function ob_em_showMenu(e, virtualElement, left, top) { if (ob_em_eventSet(this, "OnBeforeMenuOpen")) if (!ob_em_OnBeforeMenuOpen(this.menu)) return; if (this.visibleFor != null) if (this.underlay.style.visibility.toLowerCase() == "visible" && this.visibleFor.item == this.parentItem) return; if (!e) e = window.event; if (virtualElement != null) this.el = virtualElement; else this.el = ob_em_GetParentItemFromElement(ob_em_GetEventElements(e)[1]); if (this.el != null && typeof this.el.object != "undefined") if (typeof this.el.object.ob_em_submenu == "undefined" || this.el.object.ob_em_submenu == null || this.el.object.ob_em_submenu != this) return; if (this.el != null) if (this.parentMenu != null && this.el.menu != null && this.el.menu == this.parentMenu && this.parentMenu.underlay.style.visibility.toLowerCase() == "hidden") return; this.parentItem = this.visibleFor != null ? this.visibleFor.item : this.parentItem; if (this.parentItem.object.type == "ob_em_menuitem" && this.parentItem.object.menu.object.showEvent != "always") { var index = ob_em_VisibleArrayIndexOf(this.parentItem.object.menu); index >= 0 && ob_em_HideAllFromIndex(index + 2, false) } else { ob_em_HideAll(false); ob_em_VisibleArrayPush(this.parentItem) } this.parentItem.object.type == "ob_em_menuitem" && ob_em_mouseHover(this.parentItem, e, true, false); ob_em_VisibleArrayPush(this.menu); ob_em_VisibleArrayPush(this.underlay); ob_em_changeStyle(this.styleSheet); for (var i = 0; i < this.items.length; i++) this.items[i].id != obj.id && this.mouseHover(this.items[i], null, false, true); this.underlayOffsets = { left: ob_em_displayOffset, top: ob_em_displayOffset, right: ob_em_displayOffset, bottom: ob_em_displayOffset }; this.underlay.style.width = this.menu.offsetWidth + this.underlayOffsets["left"] + this.underlayOffsets["right"] + "px"; this.underlay.style.height = this.menu.offsetHeight + this.underlayOffsets["top"] + this.underlayOffsets["bottom"] + "px"; if (virtualElement != null) if (parseInt(left) > 0 && parseInt(top) > 0) this.showCoords = [parseInt(left), parseInt(top)]; else this.showCoords = [e.clientX + this.hz_o, e.clientY + this.vt_o]; else if (e != null) this.showCoords = this.getMenuCoords(e, true); else { var parentHeight = parseInt(ob_em_getStyle(this.parentItem, "height")); this.showCoords = [parseInt(findPosX(this.parentItem)), parseInt(findPosY(this.parentItem) + parentHeight + 1)]; ob_em_buildMenuItems(this) } this.underlay.style.width = this.menu.offsetWidth + this.underlayOffsets["left"] + this.underlayOffsets["right"] + "px"; this.underlay.style.height = this.menu.offsetHeight + this.underlayOffsets["top"] + this.underlayOffsets["bottom"] + "px"; this.menu.style.left = this.showCoords[0] + "px"; this.menu.style.top = this.showCoords[1] + "px"; this.underlay.style.left = this.showCoords[0] - this.underlayOffsets["left"] + "px"; this.underlay.style.top = this.showCoords[1] - this.underlayOffsets["top"] + "px"; this.menu.style.overflowY = "hidden"; this.menu.style.visibility = "visible"; this.underlay.style.visibility = "visible"; if (isIE) { this.cover_iframe.style.width = this.menu.offsetWidth + "px"; this.cover_iframe.style.height = this.menu.offsetHeight + "px"; this.cover_iframe.style.top = this.showCoords[1] + "px"; this.cover_iframe.style.left = this.showCoords[0] + "px"; this.cover_iframe.style.visibility = "visible"; } if (isMenuOnTop) this.menu.style.top = this.showCoords[1] + this.menu.offsetHeight + "px"; tp_increment = this.menu.offsetHeight - this.menu.firstChild.offsetHeight; this.menu.style.height = "0px"; slideContent(this.menu.id, this.DropIncrement, this.showCoords[1], this.DropTime); virtualElement != null && ob_em_cancelEvent(e); if (this.SelectTreeNode) try { if (this.el.tagName.toLowerCase() == "td" && this.el.className == "ob_t2" && typeof tree_node_exp_col != "undefined") { tree_node_exp_col = true; this.el.onclick(); tree_node_exp_col = false } } catch (ex) { } ob_em_eventSet(this, "OnAfterMenuOpen") && ob_em_OnAfterMenuOpen(this.menu); return false } function findPosX(obj) { var curleft = 0; if (obj.offsetParent) while (1) { curleft += obj.offsetLeft; if (!obj.offsetParent) break; obj = obj.offsetParent } else if (obj.x) curleft += obj.x; return curleft } function findPosY(obj) { var curtop = 0; if (obj.offsetParent) while (1) { curtop += obj.offsetTop; if (!obj.offsetParent) break; obj = obj.offsetParent } else if (obj.y) curtop += obj.y; return curtop } function ob_em_hideMenu(e, withVerify, force, closeParents) { if (force == null) force = false; if (!e) e = window.event; if (this.showEvent == "always" || this.underlay.style.visibility == "hidden") return true; var isMouseOverMenu = force ? false : e ? this.showCoords != null ? this.mouseOverMenu(e, this.showCoords) : false : false; if (!force && isMouseOverMenu == null) return true; if (ob_em_eventSet(this, "OnBeforeMenuClose")) if (!ob_em_OnBeforeMenuClose(this.menu)) return false; if (force || (this.showEvent != "mouseover" || e && (!withVerify || !isMouseOverMenu))) { for (var i = 0; i < this.subMenus.length; i++) if (!this.subMenus[i].hideMenu(e, false, true, false)) return false; this.cover_iframe.style.visibility = "hidden"; this.menu.style.left = "0px"; this.menu.style.top = "-2000px"; this.menu.style.visibility = "hidden"; this.underlay.style.left = "0px"; this.underlay.style.top = "-2000px"; this.underlay.style.visibility = "hidden"; if (this.parentMenu != null) { this.parentMenu.mouseHover(this.parentItem, e, false, true); closeParents && (force || this.showEvent == "mouseover" && this.parentMenu.showEvent == "mouseover") && this.parentMenu.hideMenu(e, true, false, true) } this.showCoords = null; this.visibleFor = null } ob_em_eventSet(this, "OnAfterMenuClose") && ob_em_OnAfterMenuClose(this.menu); return true } function slideContent(menuObj, Increment, el_top, _dropTime) { var dropTime = _dropTime, menuTop = el_top, top = null, obj = document.getElementById(menuObj), contentObj = obj.firstChild; height = obj.offsetHeight; height = height + Increment; rerunFunction = true; obj.style.height = height + "px"; if (obj.offsetHeight < height) { obj.style.overflow = "auto"; rerunFunction = false } if (isMenuOnTop) { top = obj.offsetTop; top = top - (Increment + tp_increment); obj.style.top = top + "px" } if (height >= contentObj.offsetHeight) { height = contentObj.offsetHeight; rerunFunction = false } if (rerunFunction) setTimeout("slideContent('" + menuObj + "'," + Increment + "," + menuTop + "," + dropTime + ")", dropTime); else { obj.style.height = height + 1 + "px"; if (isMenuOnTop) obj.style.top = menuTop + "px" } } var targetMenu = ""; function ob_em_menuItemClick(htmlItem, menuEvent) { if (!menuEvent) menuEvent = window.event; var targetEl = this.el, easyMenu = this, menuObject = htmlItem.object; targetEl = ob_em_visibleMenus[0]; if (this.showEvent == "always") targetEl = htmlItem; targetMenu = targetEl.id; if (ob_em_eventSet(this, "OnBeforeItemClick")) if (!ob_em_OnBeforeItemClick(this.menu, htmlItem, targetEl, menuEvent)) return false; if (htmlItem.getAttribute("nohide") == null || htmlItem.getAttribute("nohide").toString().toLowerCase() != "true") ob_em_HideAllFromIndex(0, false); else this.mouseHover(htmlItem, menuEvent, true, true); eval(htmlItem.getAttribute("OnClientClick")); typeof htmlItem.object.contentCell.firstChild != "undefined" && htmlItem.object.contentCell.firstChild != null && htmlItem.object.contentCell.firstChild.nodeType == 1 && htmlItem.object.contentCell.firstChild.tagName.toLowerCase() == "a" && htmlItem.object.clickLink(menuEvent); ob_em_eventSet(this, "OnAfterItemClick") && ob_em_OnAfterItemClick(htmlItem, this.menu, targetEl, menuEvent); return false } function ob_em_clickLink(e) { if (!e) e = window.event; if (!e) return; var el = null; if (e.target) el = e.target; else if (e.srcElement) el = e.srcElement; if (el != null) { var hasLinkAsParent = el.tagName.toLowerCase() == "a", tmpEl = el; while (!hasLinkAsParent && tmpEl.tagName.toLowerCase() != "td" && tmpEl.getAttribute("emType") == null) { hasLinkAsParent = tmpEl.tagName.toLowerCase() == "a"; tmpEl = tmpEl.parentNode } if (!(el.nodeType == 1 && hasLinkAsParent)) if (this.contentCell.firstChild.href != null) try { if (typeof this.contentCell.firstChild.target != "undefined" && this.contentCell.firstChild.target != null && this.contentCell.firstChild.target.length > 0) if (this.contentCell.firstChild.target.toLowerCase() == "_self") self.location.href = this.contentCell.firstChild.href; else if (this.contentCell.firstChild.target.toLowerCase() == "_top") top.location.href = this.contentCell.firstChild.href; else if (this.contentCell.firstChild.target.toLowerCase() == "_parent") self.parent.location.href = this.contentCell.firstChild.href; else if (this.contentCell.firstChild.target.toLowerCase() == "_blank") window.open(this.contentCell.firstChild.href, this.contentCell.firstChild.target); else if (top.frames) if (top.frames[this.contentCell.firstChild.target]) top.frames[this.contentCell.firstChild.target].location.href = this.contentCell.firstChild.href; else window.alert("Frame '" + this.contentCell.firstChild.target + "' doesn't exist"); else window.open(this.contentCell.firstChild.href, this.contentCell.firstChild.target); else self.location.href = this.contentCell.firstChild.href } catch (ex) { } } return false } function ob_em_SelectItem(id) { var item = document.getElementById(id); if (item) { var itemObject = item.object; if (itemObject) { ob_em_DeselectItem(itemObject.menu.object.selectedItemId); itemObject.isSelected = true; itemObject.menu.object.selectedItemId = id; ob_em_mouseHover(item, null, true, false) } } } function ob_em_DeselectItem(id) { var item = document.getElementById(id); if (item) { var itemObject = item.object; if (itemObject) { itemObject.isSelected = false; itemObject.menu.object.selectedItemId = ""; ob_em_mouseHover(item, null, false, false) } } } function ob_em_HideItem(id) { var item = document.getElementById(id); if (item != null) item.style.display = "none" } function ob_em_ShowItem(id) { var item = document.getElementById(id); if (item != null) item.style.display = "" } function ob_em_SetItemInnerHTML(id, innerHTML) { var item = document.getElementById(id); if (item != null) for (var rows = item.getElementsByTagName("td"), i = 0; i < rows.length; i++) if (rows[i].getAttribute("emtype") == "c") { rows[i].innerHTML = innerHTML; break } } function ob_em_AddItem(id, type, innerHTML, icon, url, urlTarget, onClientClick, AutoHideMenu, position) { var itemsContainer = this.vt ? this.menu.firstChild : this.menu.firstChild.firstChild; if (typeof type == "undefined" || typeof this.classes[type] == "undefined" || this.classes[type] == null) type = "MenuItem"; if (typeof AutoHideMenu == "undefined") AutoHideMenu = true; var itemTD; if (position == null) position = this.items.length; if (this.vt) { itemsContainer = itemsContainer.insertRow(position); itemTD = document.createElement("td"); itemTD.id = id; itemsContainer.appendChild(itemTD) } else { itemTD = itemsContainer.rows[0].insertCell(position); itemTD.id = id } itemTD.setAttribute("emType", type); typeof onClientClick == "string" && onClientClick.length > 0 && itemTD.setAttribute("OnClientClick", onClientClick); itemTD.setAttribute("nohide", AutoHideMenu ? "true" : "false"); itemTD.className = this.classes[type]["c"]; var table = document.createElement("table"); table.id = "ob_em_mc"; itemTD.appendChild(table); var tr = table.appendChild(document.createElement("tbody")).appendChild(document.createElement("tr")), leftroundcornerCell = document.createElement("td"); leftroundcornerCell.setAttribute("emType", "lrc"); leftroundcornerCell.className = this.classes[type]["c_lrc"]; tr.appendChild(leftroundcornerCell); if (this.ui) { var iconCell = document.createElement("td"); tr.appendChild(iconCell); iconCell.setAttribute("emType", "i"); iconCell.className = this.classes[type]["c_i"]; if (typeof icon == "string" && icon.length > 0) { var iconImg = document.createElement("img"); iconCell.appendChild(iconImg); iconImg.src = this.iconsFolder + "/" + icon; iconImg.border = 0 } else iconCell.innerHTML = "&nbsp;" } var contentCell = document.createElement("td"); if (this.il) tr.appendChild(contentCell); else tr.insertBefore(contentCell, tr.firstChild.nextSibling); contentCell.className = this.classes[type]["c_c"]; contentCell.setAttribute("emType", "c"); contentCell.colSpan = this.ui ? 2 : 3; if (typeof url == "string" && url.length > 0) { var link = document.createElement("a"); contentCell.appendChild(link); link.href = url; if (typeof urlTarget == "string" && urlTarget.length > 0) link.target = urlTarget; link.innerHTML = innerHTML } else contentCell.innerHTML = innerHTML; var submenuCell = document.createElement("td"), submenuCellDiv = document.createElement("div"); submenuCell.appendChild(submenuCellDiv); if (this.il) tr.appendChild(submenuCell); else tr.insertBefore(submenuCell, tr.firstChild.nextSibling); var rightroundcornerCell = document.createElement("td"); rightroundcornerCell.setAttribute("emType", "rrc"); rightroundcornerCell.className = this.classes[type]["c_rrc"]; tr.appendChild(rightroundcornerCell); submenuCell.setAttribute("emType", "m"); submenuCell.style.display = "none"; submenuCell.style.width = "1px"; submenuCellDiv.className = this.classes[type]["c_m"]; submenuCellDiv.innerHTML = "&nbsp;"; new ob_em_MenuItem(itemTD, this) } function ob_em_RemoveItem(id) { var item = document.getElementById(id); if (item != null) { var index = ob_em_searchArrayForElement(this.items, item); if (index != -1) { this.items.splice(index, 1); if (this.vt) item.parentNode.parentNode.removeChild(item.parentNode); else item.parentNode.removeChild(item) } } } function ob_em_safeAddOnEvent(eventName, object, collection, functionToExecute, menuId) { obj = eval(object); if (typeof eval(collection) != "object") eval(collection + " = new Array();"); if (typeof eval("obj." + eventName) == "function" && (eval("obj." + eventName)).toString().indexOf("ob_em_safeOnEvent") == -1) eval(collection + "[0] = obj." + eventName); if (document.all && navigator.appVersion.indexOf("Mac") != -1 && (document.all && navigator.appVersion.indexOf("MSIE 4.") != -1)) eval(collection + "[" + collection + ".length] = Function(" + (menuId != null ? menuId + "." : "") + functionToExecute + ")"); else eval(collection + "[" + collection + ".length] = function(ev){" + (menuId != null ? menuId + "." : "") + functionToExecute + "}"); eval("obj." + eventName + " = function(ev) {ob_em_safeOnEvent(collection, ev)}") } function ob_em_safeOnEvent(collection, ev) { for (var i = 0; i < (eval(collection)).length; i++) { ran = false; try { (eval(collection))[i](ev); ran = true } catch (ex) { } if (!ran) try { (eval(collection))[i] } catch (ex) { } } } function ob_em_getAllSheets() { if (!window.ScriptEngine && navigator.__ice_version) return document.styleSheets; if (document.getElementsByTagName) var Lt = document.getElementsByTagName("link"), St = document.getElementsByTagName("style"); else if (document.styleSheets && document.all) var Lt = document.all.tags("LINK"), St = document.all.tags("STYLE"); else return []; for (var x = 0, os = []; Lt[x]; x++) { var rel = Lt[x].rel ? Lt[x].rel : Lt[x].getAttribute ? Lt[x].getAttribute("rel") : ""; if (typeof rel == "string" && rel.toLowerCase().indexOf("style") + 1) os[os.length] = Lt[x] } for (var x = 0; St[x]; x++) os[os.length] = St[x]; return os } function ob_em_changeStyle() { for (var x = 0, ss = ob_em_getAllSheets(); ss[x]; x++) { if (ss[x].title && typeof ss[x].rel == "string" && ss[x].rel.toLowerCase().indexOf("alternate") != -1) ss[x].disabled = true; for (var y = 0; y < arguments.length; y++) if (ss[x].title == arguments[y]) ss[x].disabled = false } } function ob_em_getMenuCoords(e, returnCurrentIfVisible) { if (this.el == null) return [0, 0]; if (this.underlay.style.visibility == "hidden" || returnCurrentIfVisible) { var documentRtl = typeof document.dir == "string" && document.dir.toLowerCase() == "rtl", windowWidth = 0, windowHeight = 0, documentScrollLeft = document.body.scrollLeft + document.documentElement.scrollLeft, documentScrollTop = document.body.scrollTop + document.documentElement.scrollTop; if (isOpera) { documentScrollLeft /= 2; documentScrollTop /= 2 } if (typeof window.innerWidth == "number") { windowWidth = window.innerWidth; windowHeight = window.innerHeight } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) { windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight } if (documentRtl) documentScrollLeft = -15; windowHeight += documentScrollTop - 15; windowWidth += documentScrollLeft - 15; var elementCorner = [this.elementCorner[0], this.elementCorner[1]], menuCorner = [this.menuCorner[0], this.menuCorner[1]]; if (this.displayPosition == "cursor") var menuLeft = e.clientX + this.hz_o, menuTop = e.clientY + this.vt_o; else var elementCoords = ob_em_GetElementCoords(this.el), menuElementCoords = this.GetMenuCoordsFromElement(elementCoords), menuLeft = menuElementCoords["left"], menuTop = menuElementCoords["top"]; if (!isSafari || this.displayPosition != "cursor") { menuTop += documentScrollTop; menuLeft += documentScrollLeft } var changed = false; if (this.displayPosition == "cursor" || ob_em_AutoPosition) { if (menuLeft + this.menu.offsetWidth > windowWidth && menuLeft - this.menu.offsetWidth - (this.displayPosition != "cursor" && this.elementCorner[1] == "left" ? -this.el.offsetWidth : 0) > documentScrollLeft) { if (this.displayPosition == "cursor") menuLeft -= this.menu.offsetWidth; if (menuCorner[0] == elementCorner[0] || menuCorner[1] == elementCorner[1]) elementCorner[1] = elementCorner[1] == "left" ? "right" : "left"; menuCorner[1] = menuCorner[1] == "left" ? "right" : "left"; changed = true } else if (menuLeft < documentScrollLeft && menuLeft + 2 * this.menu.offsetWidth + (this.displayPosition != "cursor" && this.menuCorner[1] == "left" ? 0 : this.el.offsetWidth) < windowWidth) { if (this.displayPosition == "cursor") menuLeft += this.menu.offsetWidth; if (menuCorner[0] == elementCorner[0] || menuCorner[1] == elementCorner[1]) elementCorner[1] = elementCorner[1] == "left" ? "right" : "left"; menuCorner[1] = menuCorner[1] == "left" ? "right" : "left"; changed = true } else if (menuLeft < documentScrollTop && menuLeft + this.menu.offsetWidth > windowWidth || menuLeft < documentScrollLeft && menuLeft + this.menu.offsetWidth < documentScrollLeft || menuLeft > windowWidth && menuLeft + this.menu.offsetWidth > windowWidth) if (menuLeft < documentScrollLeft && menuLeft + this.menu.offsetWidth + this.el.offsetWidth > documentScrollLeft) { menuCorner[0] = "left"; elementCorner[0] = "right"; changed = true } else if (menuLeft > windowWidth && menuLeft - this.menu.offsetWidth - this.el.offsetWidth < windowWidth) { menuCorner[0] = "right"; elementCorner[0] = "left"; changed = true } if (menuTop + this.menu.offsetHeight > windowHeight && menuTop - this.menu.offsetHeight - (this.displayPosition != "cursor" && this.menuCorner[0] == "top" ? this.el.offsetHeight : 0) > documentScrollTop) { if (this.displayPosition == "cursor") menuTop -= this.menu.offsetHeight; if (menuCorner[0] == elementCorner[0] || menuCorner[1] == elementCorner[1]) elementCorner[0] = elementCorner[0] == "top" ? "bottom" : "top"; menuCorner[0] = menuCorner[0] == "top" ? "bottom" : "top"; changed = true } else if (menuTop < documentScrollTop && menuTop + 2 * this.menu.offsetHeight + (this.displayPosition != "cursor" && this.menuCorner[0] == "top" ? 0 : this.el.offsetHeight) < windowHeight) { if (this.displayPosition == "cursor") menuTop += this.menu.offsetHeight; if (menuCorner[0] == elementCorner[0] || menuCorner[1] == elementCorner[1]) elementCorner[0] = elementCorner[0] == "top" ? "bottom" : "top"; menuCorner[0] = menuCorner[0] == "top" ? "bottom" : "top"; changed = true } else if (menuTop < documentScrollTop && menuTop + this.menu.offsetHeight > windowHeight || menuTop < documentScrollTop && menuTop + this.menu.offsetHeight < documentScrollTop || menuTop > windowHeight && menuTop + this.menu.offsetHeight > windowHeight) if (menuTop < documentScrollTop && menuTop + this.menu.offsetHeight + this.el.offsetHeight > documentScrollTop) { menuCorner[0] = "top"; elementCorner[0] = "bottom"; changed = true } else if (menuTop > windowHeight && menuTop - this.menu.offsetHeight - this.el.offsetHeight < windowHeight) { menuCorner[0] = "bottom"; elementCorner[0] = "top"; changed = true } } if (this.displayPosition != "cursor" && changed) { menuElementCoords = this.GetMenuCoordsFromElement(elementCoords, menuCorner, elementCorner); menuLeft = menuElementCoords["left"]; menuTop = menuElementCoords["top"]; menuTop += documentScrollTop; menuLeft += documentScrollLeft } if (elementCorner[0] != menuCorner[0] && elementCorner[1] == menuCorner[1]) this.underlayOffsets[menuCorner[0]] = 2 + Math.max(0, -this.vt_o); if (elementCorner[1] != menuCorner[1] && elementCorner[0] == menuCorner[0]) this.underlayOffsets[menuCorner[1]] = 2 + Math.max(0, -this.hz_o); this.underlayOffsets["bottom"] = Math.max(0, Math.min(this.underlayOffsets["bottom"], windowHeight - (menuTop + this.menu.offsetHeight) - 1)); this.underlayOffsets["right"] = Math.max(0, Math.min(this.underlayOffsets["right"], windowWidth - (menuLeft + this.menu.offsetWidth) - 1)); return [menuLeft, menuTop] } else return [this.underlay.offsetLeft, this.underlay.offsetTop] } function ob_em_GetMenuCoordsFromElement(elementCoords, menuCorner, elementCorner) { isMenuOnTop = false; if (menuCorner == null) menuCorner = this.menuCorner; if (elementCorner == null) elementCorner = this.elementCorner; var scrollLeft = document.body.scrollLeft + document.documentElement.scrollLeft, scrollTop = document.body.scrollTop + document.documentElement.scrollTop; if (isOpera) { scrollLeft /= 2; scrollTop /= 2 } var cNode = this.el.object.type == "ob_em_attachelement" ? this.el : this.el.object.menu; do { cNode = cNode.parentNode; if (cNode != null && cNode != document.body) { if (typeof cNode.scrollLeft != "undefined" && (!isOpera || cNode.scrollWidth != cNode.clientWidth)) scrollLeft += cNode.scrollLeft; if (typeof cNode.scrollTop != "undefined" && (!isOpera || cNode.scrollHeight != cNode.clientHeight)) scrollTop += cNode.scrollTop } else break } while (true); var documentRtl = typeof document.dir == "string" && document.dir.toLowerCase() == "rtl"; if (documentRtl) scrollLeft = -15; var menuTop = this.vt_o - scrollTop, menuLeft = this.hz_o - scrollLeft; if (elementCorner[0] == "top") menuTop += elementCoords["top"]; else menuTop += elementCoords["bottom"]; if (elementCorner[1] == "left") menuLeft += elementCoords["left"]; else menuLeft += elementCoords["right"]; if (menuCorner[0] == "bottom") { menuTop -= this.menu.offsetHeight; isMenuOnTop = true } if (menuCorner[1] == "right") menuLeft -= this.menu.offsetWidth; return { left: menuLeft, top: menuTop} } function ob_em_mouseOverMenu(e, coords) { if (this.underlay.style.visibility != "visible") return false; if (!coords) coords = this.getMenuCoords(e, false); var menuLeft = eval(coords[0]), menuTop = eval(coords[1]), scrollLeft = document.body.scrollLeft + document.documentElement.scrollLeft, scrollTop = document.body.scrollTop + document.documentElement.scrollTop; if (isOpera) { scrollLeft /= 2; scrollTop /= 2 } for (var mouseLeft = e.clientX == -1 ? ob_em_getLeft(e.fromElement) - e.offsetX : e.clientX, mouseTop = e.clientY == -1 ? ob_em_getTop(e.fromElement) - e.offsetY : e.clientY, result = this.underlay.style.visibility == "visible" && mouseLeft + scrollLeft >= menuLeft && mouseLeft + scrollLeft <= menuLeft + this.underlay.offsetWidth && mouseTop + scrollTop >= menuTop && mouseTop + scrollTop <= menuTop + this.underlay.offsetHeight, i = 0; i < this.subMenus.length; i++) result = result || this.subMenus[i].mouseOverMenu(e, null); return result } function ob_em_GetElementCoords(element, coordLeft, coordTop, coordRight, coordBottom) { var parentelement = ob_em_GetParentMenuFromElement(element), includeScroll = false; if (parentelement != null) { var parentmenu = eval("ob_em_" + ob_em_GetParentMenuFromElement(element).id); if (typeof parentmenu == "object" && parentmenu.showEvent != "always") includeScroll = true } if (typeof element == "undefined" || element == null) return { left: 0, top: 0, right: 0, bottom: 0 }; if (coordLeft == null) coordLeft = ob_em_getLeft(element, includeScroll); if (coordTop == null) coordTop = ob_em_getTop(element, includeScroll); if (coordRight == null) coordRight = coordLeft + element.offsetWidth; if (coordBottom == null) coordBottom = coordTop + element.offsetHeight; return { left: coordLeft, top: coordTop, right: coordRight, bottom: coordBottom} } function ob_em_getLeft(obj, includeScroll) { var pos = 0; if (isFF == true || isOpera == true) var arrUsedElements = [], oInitialObj = obj; if (obj) if (isIE) if (!isNaN(parseInt(obj.currentStyle.borderLeftWidth))) pos += parseInt(obj.currentStyle.borderLeftWidth); if (obj.offsetParent) while (obj.offsetParent) { if (obj.nodeName != "TR" || isSafari == false) if (includeScroll) pos += obj.offsetLeft - (obj.nodeName != "TR" && isOpera == false ? obj.scrollLeft : 0); else pos += obj.offsetLeft; else if (includeScroll) pos += obj.firstChild.offsetLeft - obj.firstChild.scrollLeft; else pos += obj.firstChild.offsetLeft; (isFF == true || isOpera == true) && arrUsedElements.push(obj); obj = obj.offsetParent } else if (obj.x) pos += obj.x; if ((isFF == true || isOpera == true) && arrUsedElements.length > 0) { obj = oInitialObj; while (obj.parentNode) { if (obj.nodeName == "DIV" && obj.style.position != "absolute" && obj.style.position != "relative" && obj.style.position != "fixed") { for (var bAlreadyUsed = false, j = 0; j < arrUsedElements.length; j++) if (arrUsedElements[j] == obj) { bAlreadyUsed = true; break } if (bAlreadyUsed == false) if (includeScroll) pos -= obj.scrollLeft } obj = obj.parentNode } } return pos } function ob_em_getTop(obj, includeScroll) { var pos = 0, count = 0; if (isFF == true || isOpera == true) var arrUsedElements = [], oInitialObj = obj; if (obj) { if (isIE) if (!isNaN(parseInt(obj.currentStyle.borderTopWidth))) pos += parseInt(obj.currentStyle.borderTopWidth); while (obj) { count++; var parentmenu = undefined; if (obj.id != "") try { parentmenu = eval("ob_em_" + obj.id) } catch (ex) { } if (obj.nodeName != "TR" || isSafari == false) if (includeScroll && typeof parentmenu == "object" && parentmenu.showEvent != "always") pos += obj.offsetTop - (obj.nodeName != "TR" && isOpera == false ? obj.scrollTop : 0); else pos += obj.offsetTop; else if (includeScroll && typeof parentmenu == "object" && parentmenu.showEvent != "always") pos += obj.firstChild.offsetTop - obj.firstChild.scrollTop; else pos += obj.firstChild.offsetTop; (isFF == true || isOpera == true) && arrUsedElements.push(obj); obj = obj.offsetParent } } else if (obj.y) pos += obj.y; if ((isFF == true || isOpera == true) && arrUsedElements.length > 0) { obj = oInitialObj; while (obj.parentNode) { if (obj.nodeName == "DIV" && obj.style.position != "absolute" && obj.style.position != "relative" && obj.style.position != "fixed") { for (var bAlreadyUsed = false, j = 0; j < arrUsedElements.length; j++) if (arrUsedElements[j] == obj) { bAlreadyUsed = true; break } if (bAlreadyUsed == false) if (includeScroll) pos -= obj.scrollTop } obj = obj.parentNode } } return pos } function ob_em_getStyle(oElm, strCssRule) { var strValue = ""; if (document.defaultView && document.defaultView.getComputedStyle) strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule); else if (oElm.currentStyle) try { strCssRule = strCssRule.replace(/\-(\w)/g, function(strMatch, p1) { return p1.toUpperCase() }); strValue = oElm.currentStyle[strCssRule] } catch (ex) { } return strValue } function ob_em_searchArrayForElement(array, element) { if (element == null || array == null || typeof array != "object") return -1; for (var i = 0; i < array.length; i++) if (typeof element == "string") { if (array[i].toLowerCase() == element.toLowerCase()) return i } else if (array[i] == element) return i; return -1 } function ob_em_arrangeAlignProperty(align) { var result = []; if (align == "") { result[0] = ""; result[1] = "" } else if (align.substr(0, 3) == "top") { result[0] = align.substr(0, 3); result[1] = align.substr(3, align.length) } else { result[0] = align.substr(0, 6); result[1] = align.substr(6, align.length) } return result } function ob_em_removeEvent(elem, ev, collection, fct) { fct = fct.toString(); if (collection.length == 0) { if ((eval("elem." + ev)).toString().toLowerCase().replace(/'/g, '"').indexOf(fct.toLowerCase().replace(/'/g, '"')) != -1) eval("elem." + ev + " = null") } else { for (var i = 0; i < collection.length; i++) collection[i].toString().toLowerCase().replace(/'/g, '"').indexOf(fct.toLowerCase().replace(/'/g, '"')) != -1 && collection.splice(i, 1); if (collection.length == 0) eval("elem." + ev + " = null") } } function ob_em_getDefaultClasses(menu) { for (var itemType in menu.classes) if (menu.classes[itemType] == "default") switch (itemType.toLowerCase()) { case "menuseparator": menu.classes[itemType] = { c: "easyMenuSeparator", c_o: "easyMenuSeparatorOver", c_c: "easyMenuSeparatorContentCell", c_c_o: "easyMenuSeparatorContentCellOver", c_lrc: "easyMenuSeparatorLeftRoundCornerCell", c_lrc_o: "easyMenuSeparatorLeftRoundCornerCellOver", c_rrc: "easyMenuSeparatorRightRoundCornerCell", c_rrc_o: "easyMenuSeparatorRightRoundCornerCellOver", c_i: "easyMenuSeparatorIconCell", c_i_o: "easyMenuSeparatorIconCellOver", c_m: "easyMenuSeparatorSubMenuCell", c_m_o: "easyMenuSeparatorSubMenuCellOver" }; break; default: menu.classes[itemType] = { c: "easyMenuItem", c_o: "easyMenuItemOver", c_c: "easyMenuItemContentCell", c_c_o: "easyMenuItemContentCellOver", c_lrc: "easyMenuItemLeftRoundCornerCell", c_lrc_o: "easyMenuItemLeftRoundCornerCellOver", c_rrc: "easyMenuItemRightRoundCornerCell", c_rrc_o: "easyMenuItemRightRoundCornerCellOver", c_i: "easyMenuItemIconCell", c_i_o: "easyMenuItemIconCellOver", c_m: "easyMenuItemSubMenuCell", c_m_o: "easyMenuItemSubMenuCellOver" }; break } } function ob_em_CreateMenuUnderlay(menuObjectId) { var menu = document.getElementById(menuObjectId), div = document.getElementById(menuObjectId + "__underlay"); div.type = "ob_em_underlay"; div.style.display = ""; div.style.backgroundColor = "transparent"; div.style.visibility = "hidden"; div.menu = menu; var span = document.createElement("span"); div.appendChild(span); span.style.width = "100%"; span.style.height = "100%"; span.style.backgroundColor = "transparent" } function ob_em_GetEventElements(e) { if (!e) e = window.event; if (!e) return [null, null]; var relTarg; if (typeof e.relatedTarget != "undefined") relTarg = e.relatedTarget; else if (typeof e.fromElement != "undefined" || typeof e.toElement != "undefined") relTarg = e.type.toLowerCase() == "mouseover" ? e.fromElement : e.toElement; var curTarg; if (typeof e.target != "undefined") curTarg = e.target; else if (typeof e.srcElement != "undefined") curTarg = e.srcElement; return [relTarg, curTarg] } function ob_em_GetParentMenuFromElement(element) { while (element != null && (element.nodeType == 3 || typeof element.tagName == "undefined" || element.tagName.toLowerCase() != "div" || (typeof element.object != "object" || (typeof element.object.type == "undefined" || element.object.type.toLowerCase() != "ob_em_menu")))) element = element.parentNode; return element } function ob_em_GetUnderlayFromElement(element) { while (element != null && (element.nodeType == 3 || typeof element.tagName == "undefined" || element.tagName.toLowerCase() != "div" || (typeof element.menu != "object" || (typeof element.menu.object == "undefined" || (typeof element.menu.object.type == "undefined" || element.menu.object.type.toLowerCase() != "ob_em_menu"))))) element = element.parentNode; return element } function ob_em_GetParentItemFromElement(element, eventType, showEvent) { try { if ((showEvent == "contextmenu" && eventType == "mouseclick" || showEvent == "mouseclick" && eventType == "contextmenu") && (element != null && typeof element.object == "object" && element.object.type.toLowerCase() == "ob_em_attachelement")) return null; while (element != null && (element.nodeType == 3 || (typeof element.object != "object" || (typeof element.object.type == "undefined" || element.object.type.toLowerCase() != "ob_em_menuitem" && element.object.type.toLowerCase() != "ob_em_attachelement")))) element = element.parentNode } catch (ex) { } return element } function ob_em_MenuIsSubmenuOfElement(menu, element) { if (menu == null || typeof menu != "object" || element == null || typeof element != "object") return false; menu = typeof menu.object == "object" && menu.object != null ? menu.object : menu; element = typeof element.object == "object" && element.object != null ? element.object : element; return typeof element.ob_em_submenu == "object" && element.ob_em_submenu == menu } function ob_em_MenuIsVisibleForElement(menu, element) { if (menu == null || typeof menu != "object" || element == null || typeof element != "object") return false; menu = typeof menu.object == "object" && menu.object != null ? menu.object : menu; element = typeof element.object == "object" && element.object != null ? element.object : element; return typeof menu.visibleFor == "object" && menu.visibleFor == element } function heo_ProcessEvent(e, onMouseOver, onMouseOut, elementId) { if (!e) e = window.event; if (!e) return false; var over = e.type.toLowerCase() == "mouseover", element = document.getElementById(elementId), relTarg; if (typeof e.relatedTarget != "undefined") relTarg = e.relatedTarget; else if (typeof e.fromElement != "undefined" || typeof e.toElement != "undefined") relTarg = over ? e.fromElement : e.toElement; while (relTarg != null && relTarg != element) relTarg = relTarg.parentNode; var curTarg; if (typeof e.target != "undefined") curTarg = e.target; else if (typeof e.srcElement != "undefined") curTarg = e.srcElement; while (curTarg != null && curTarg != element) curTarg = curTarg.parentNode; if (relTarg == curTarg && curTarg != null) { ob_em_cancelEvent(e); return false } else if (over) return typeof onMouseOver == "function" ? onMouseOver(e, element) : true; else return typeof onMouseOut == "function" ? onMouseOut(e, element) : true } var ob_em_visibleMenus = []; function ob_em_HideAll(onlymouseover) { ob_em_HideAllFromIndex(0, onlymouseover) } function ob_em_VisibleArrayElementHasPrecedence(element1, element2) { for (var i = 0; i < ob_em_visibleMenus.length; i++) if (element1 == ob_em_visibleMenus[i]) { for (var j = i; j < ob_em_visibleMenus.length; j++) if (element2 == ob_em_visibleMenus[j]) return true; break } return false } function ob_em_VisibleArrayIndexOf(element) { for (var i = ob_em_visibleMenus.length - 1; i >= 0; i--) if (ob_em_visibleMenus[i] == element) return i; return -1 } function ob_em_HideAllFromIndex(index, onlymouseover) { if (onlymouseover) { var i = ob_em_visibleMenus.length - 1; while (i >= index) { if (ob_em_visibleMenus[i] != null && typeof ob_em_visibleMenus[i].object != "undefined" && ob_em_visibleMenus[i].object != null && typeof ob_em_visibleMenus[i].object.hideMenu == "function") if (ob_em_visibleMenus[i].object.showEvent != "mouseover") { index = i + 2; break } i-- } } for (var i = index; i < ob_em_visibleMenus.length; i++) if (ob_em_visibleMenus[i] != null && (typeof ob_em_visibleMenus[i].object != "undefined" && ob_em_visibleMenus[i].object != null && typeof ob_em_visibleMenus[i].object.hideMenu == "function")) { index = i; if (ob_em_visibleMenus[i].object.hideMenu(null, false, true, false)) break; else if (i + 1 == ob_em_visibleMenus.length - 1) return } if (index >= 1 && typeof ob_em_visibleMenus[index - 1] != "undefined" && typeof ob_em_visibleMenus[index - 1].object != "undefined" && typeof ob_em_visibleMenus[index - 1].object != "undefined" && ob_em_visibleMenus[index - 1].object != null && typeof ob_em_visibleMenus[index - 1].object.type != "undefined" && (ob_em_visibleMenus[index - 1].object.type == "ob_em_attachelement" || ob_em_visibleMenus[index - 1].object.type == "ob_em_menuitem")) index--; ob_em_VisibleArrayRemoveFromIndex(index) } function ob_em_VisibleArrayRemoveFromIndex(index) { for (var tmpInclusions = [], i = 0; i < index; i++) if (typeof ob_em_visibleMenus[i] != "undefined") tmpInclusions[i] = ob_em_visibleMenus[i]; ob_em_visibleMenus = tmpInclusions } function ob_em_VisibleArrayPush(value) { ob_em_visibleMenus.push(value) } var agt = navigator.userAgent.toLowerCase(), isNav = agt.indexOf("mozilla") != -1 && agt.indexOf("spoofer") == -1 && agt.indexOf("compatible") == -1 && agt.indexOf("opera") == -1 && agt.indexOf("webtv") == -1 && agt.indexOf("hotjava") == -1, isGecko = agt.indexOf("gecko") != -1, isSafari = agt.indexOf("safari") != -1, isIE = agt.indexOf("msie") != -1 && agt.indexOf("opera") == -1, isAol = agt.indexOf("aol") != -1, isOpera = agt.indexOf("opera") != -1, isFF = navigator.userAgent.indexOf("Firefox") != -1 && parseInt(navigator.userAgent.charAt(navigator.userAgent.indexOf("Firefox") + 8)) >= 1 ? true : false, isWebtv = agt.indexOf("webtv") != -1, isTVNavigator = agt.indexOf("navio") != -1 || agt.indexOf("navio_aoltv") != -1, isAOLTV = isTVNavigator, ishotjava = agt.indexOf("hotjava") != -1, ob_em_gSafeOnLoad = []; function ob_em_cleanUp() { if (window.event == null || window.event != null && window.event.type == "") return; if (typeof ob_em_Menus != "object" || typeof ob_em_Menus.length == "undefined") return; for (var i = 0, j = 0, i = 0; i < ob_em_Menus.length; i++) try { var menuObject = eval(ob_em_Menus[i]); if (typeof menuObject == "undefined" || menuObject == null) continue; if (menuObject.menu != null) menuObject.menu.object = null; ob_em_removeEvents(menuObject.menu); menuObject.parentMenu = null; menuObject.parentItem = null; if (menuObject.underlay != null) { ob_em_removeEvents(menuObject.underlay); menuObject.underlay.menu = null; menuObject.underlay = null } menuObject.cover_iframe = null; if (typeof menuObject.items != "undefined" && menuObject.items != null && typeof menuObject.items.length != "undefined") for (j = 0; j < menuObject.items.length; j++) { var item = menuObject.items[j]; if (item != null) { if (menuObject.showEvent == "always") item.object.subMenuCell != null && item.object.subMenuCell.parentNode.removeChild(item.object.subMenuCell); else item.parentNode.removeChild(item); if (item.object != null) { item.object.item = null; item.object.ob_em_submenu = null; item.object.menu = null; item.object.iconCell = null; item.object.contentCell = null; item.object.subMenuCell = null } item.object = null; ob_em_removeEvents(item) } } for (j = 0; j < menuObject.oat_ids.length; j++) { var item = document.getElementById(menuObject.oat_ids[j]); if (item != null) { if (item.object != null) { item.object.item = null; item.object.ob_em_submenu = null; item.object.menu = null } item.object = null; ob_em_removeEvents(item) } } menuObject.items = null; menuObject.menu = null; menuObject = null } catch (ex) { } ob_em_Menus = null; window.onload = null; window.onunload = null } function ob_em_removeEvents(object) { if (typeof object == "undefined" || object == null) return; object.onmouseover = null; object.onmouseout = null; object.oncontextmenu = null; object.onclick = null } function ob_em_cancelEvent(ev) { if (!ev) ev = window.event; ev.returnValue = false; ev.cancelBubble = true; ev.stopPropagation && ev.stopPropagation(); return false } function ob_em_eventSet(menuObject, eventName) { return ob_em_searchArrayForElement(menuObject.Events, eventName) != -1 } var ob_em_wdl = false; ob_em_safeAddOnEvent("onload", "window", "ob_em_gSafeOnLoad", 'new Function("ob_em_wdl=true;")()', null)