AdfRichUIPeer.createPeerClass(AdfRichUIPeer,"AdfDhtmlMenuPeer",!1);
AdfDhtmlMenuPeer.InitSubclass=function(){AdfObject.ensureClassInitialization(AdfMenuUtils);AdfObject.ensureClassInitialization(AdfSwipeSupport);AdfRichUIPeer.addComponentEventHandlers(this,AdfUIInputEvent.MOUSE_DOWN_EVENT_TYPE,AdfUIInputEvent.MOUSE_UP_EVENT_TYPE,AdfUIInputEvent.FOCUS_EVENT_TYPE,AdfUIInputEvent.BLUR_EVENT_TYPE,AdfUIInputEvent.KEY_UP_EVENT_TYPE,AdfUIInputEvent.KEY_DOWN_EVENT_TYPE,AdfUIInputEvent.KEY_PRESS_EVENT_TYPE);AdfAgent.AGENT.isTouchFirstDevice()||AdfRichUIPeer.addComponentEventHandlers(this,
AdfUIInputEvent.MOUSE_IN_EVENT_TYPE,AdfUIInputEvent.MOUSE_OUT_EVENT_TYPE);AdfRichUIPeer.addComponentPropertyChanges(this,AdfRichMenu.DISABLED,AdfRichMenu.VISIBLE,AdfRichMenu.TEXT);this._sBarMenus=[];this._sDetachedMenus=[];this._SCROLL_DELTA=3;this._JUMP_SCROLL_DELTA=15;this._OPEN_CLOSE_DELAY=300;var a=AdfKeyStroke.M_KEY,b=AdfKeyStroke.SHIFT_MASK|AdfKeyStroke.CTRL_MASK;this._menuBarKeyStroke=AdfKeyStroke.getKeyStroke(a,b);a=AdfKeyStroke.W_KEY;b=AdfKeyStroke.SHIFT_MASK|AdfKeyStroke.CTRL_MASK;this._focusDetachedMenuKeyStroke=
AdfKeyStroke.getKeyStroke(a,b)};AdfDhtmlMenuPeer.prototype.Init=function(a){a.getParent();AdfDhtmlMenuPeer.superclass.Init.call(this,a);a=AdfPage.PAGE.getLookAndFeel();a=parseInt(a.getSkinProperty("af|menu-tr-visible-items"));this._maxDisplayItems=isNaN(a)?14:a;this._spaceKeyDown=this._enterKeyDown=this._isDetached=!1};AdfDhtmlMenuPeer.prototype.InitDomElement=function(a,b){if("1"==b.getAttribute(AdfMenuUtils.MENU_DEPTH_KEY)){var d=a.getClientId();AdfDhtmlMenuPeer._addBarMenu(d)}};
AdfDhtmlMenuPeer.cancelShowing=function(){AdfDhtmlMenuPeer._popupShowingHandle&&(window.clearTimeout(AdfDhtmlMenuPeer._popupShowingHandle),delete AdfDhtmlMenuPeer._popupShowingHandle,delete AdfDhtmlMenuPeer._popupPeerWaitingForShow)};
AdfDhtmlMenuPeer.prototype.show=function(a,b){var d=this.getDomElement(),e=this.getComponent(),f=e.getClientId();AdfDomUtils.addCSSClassName(d,AdfMenuUtils.HIGHLIGHTED_STYLE_CLASS);!this.isContextMenu()&&this.isRootMenu()&&AdfMenuUtils.setLastOpenedRootMenuId(f);null==b&&null!=a&&(d=a[AdfDhtmlPopupHints.FOCUS],b=null!=d?d:this.isContextMenu()?!0:!1);this._reattachMenu();if("noContent"==this._getLazyState())this._setLazyState("fetching"),f={},f.menuDepth=this._getDepth(),this._lazyFetchPopupHints=
a,this._lazyFetchFocusOnFirstElement=b,(new AdfContentFetchEvent(e,AdfContentFetchEvent.FETCH_EVENT_TYPE,f)).queue(),this._showFetchingDataPopup();else if("fetching"==this._getLazyState())AdfLogger.LOGGER.info("Currently waiting on menu content fetch: "+e.getClientId());else if(d=this._getMenuElement(),"block"==d.style.display)e=AdfAgent.AGENT,e.getDomWindow().AdfSafariMobileAgent&&e instanceof AdfSafariMobileAgent?AdfFocusUtils.focusPreviousTabStop(d):b&&AdfFocusUtils.focusElement(this._activeDescendant);
else{this.resetActiveDescendant();var g=this._createMenuPopupHints(a,b);d.style.display="block";var h=this._elemsInitialized;h||(d.style.visibility="hidden");this.showPopup(e,d,g,f);h||(this._initElements(e,f,d),d.style.visibility="",this._elemsInitialized=!0,this._areScrollButtonsDisplayed&&this._moveShadow(!0));this._areScrollButtonsDisplayed&&this.updateScrollIconsState();this._isDetachable()&&this._createDetachableWindow()}};
AdfDhtmlMenuPeer.prototype.showPopup=function(a,b,d,e){AdfMenuUtils.addOpenMenu(e);AdfDhtmlMenuPeer.superclass.showPopup.call(this,a,b,d,e)};AdfDhtmlMenuPeer.prototype.hidePopup=function(){var a=this.getComponent(),b=a.getClientId();b==AdfDhtmlMenuPeer._reattachedMenuId&&AdfDhtmlMenuPeer._redetachMenu();this.isDetached()||(this._handleHideRequest(a,b),AdfDhtmlMenuPeer.superclass.hidePopup.call(this,a,b),this._isDetachable()&&(this._detachableWindow&&this._detachableWindow.destroy(),delete this._detachableWindow))};
AdfDhtmlMenuPeer.prototype.cancelPopup=function(){var a=this.getComponent(),b=a.getClientId();this.isDetached()?b==AdfDhtmlMenuPeer._reattachedMenuId&&AdfDhtmlMenuPeer._redetachMenu():(this._handleHideRequest(a,b),AdfLogger.LOGGER.finest("menuBar auto open mode, set to OFF due to cancel popup event"),AdfMenuUtils.setMenuBarAutoOpenMode(!1),AdfDhtmlMenuPeer.superclass.cancelPopup.call(this,a,b))};
AdfDhtmlMenuPeer.prototype.close=function(a,b){var d=this.getComponent();if(this.isDetached()){AdfDomUtils.addCSSClassName(this._getMenuElement(),AdfMenuUtils.DETACHED_STYLE_CLASS);if(this._detachedMenuLeft&&this._detachedMenuTop){var e=this._detachableWindow.getElement();e.style.left=this._detachedMenuLeft;e.style.top=this._detachedMenuTop}b||this._deselectElement();e=d.getClientId();AdfDhtmlMenuPeer._removeFromDetachedMenus(e);AdfDhtmlMenuPeer.superclass.hidePopup.call(this,d,e)}else this.isContextMenu()?
d.getParent().hide():(a?this.hidePopup():this._delayPopupHiding(),b||this._deselectElement())};AdfDhtmlMenuPeer.prototype.isDetached=function(){return this._isDetached};AdfDhtmlMenuPeer.prototype.isContextMenu=function(){return this.getComponent().getParent()instanceof AdfRichPopup};AdfDhtmlMenuPeer.prototype.isRootMenu=function(){return 1==this._getDepth()};
AdfDhtmlMenuPeer.prototype.updateScrollIconsState=function(){if(this._areScrollButtonsDisplayed){for(var a=this._scrollContentElement.rows,b=a.length,d=0,e=0,f=0;f<b;f++){var g=a[f];if("none"!=g.style.display){d=f;break}}for(f=b-1;-1<f;f--)if(g=a[f],"none"!=g.style.display){e=f;break}f=AdfAgent.AGENT;g=!1;b=f.getElementPageBounds(this._scrollBoxElement);d=f.getElementPageBounds(a[d]);a=f.getElementPageBounds(a[e]);g=90<=(b.bottom-a.top)/(a.bottom-a.top)*100;90<=(d.bottom-b.top)/(d.bottom-d.top)*100?
(AdfDomUtils.addCSSClassName(this._scrollUpElement,AdfRichUIPeer.DISABLED_STYLECLASS),AdfDomUtils.addCSSClassName(this._scrollUpBackgroundElement,AdfRichUIPeer.DISABLED_STYLECLASS)):(AdfDomUtils.removeCSSClassName(this._scrollUpElement,AdfRichUIPeer.DISABLED_STYLECLASS),AdfDomUtils.removeCSSClassName(this._scrollUpBackgroundElement,AdfRichUIPeer.DISABLED_STYLECLASS));g?(AdfDomUtils.addCSSClassName(this._scrollDownElement,AdfRichUIPeer.DISABLED_STYLECLASS),AdfDomUtils.addCSSClassName(this._scrollDownBackgroundElement,
AdfRichUIPeer.DISABLED_STYLECLASS)):(AdfDomUtils.removeCSSClassName(this._scrollDownElement,AdfRichUIPeer.DISABLED_STYLECLASS),AdfDomUtils.removeCSSClassName(this._scrollDownBackgroundElement,AdfRichUIPeer.DISABLED_STYLECLASS))}};AdfDhtmlMenuPeer.prototype.resetActiveDescendant=function(){this._activeDescendant&&this._activeDescendant.setAttribute("tabIndex","-1");var a=this._getMenuElement();this._activeDescendant=AdfFocusUtils.setFirstActiveDescendant(a,{includeVisibilityHidden:!0,includeDisplayNone:!0})};
AdfDhtmlMenuPeer.prototype.ReplaceDomElement=function(a,b){if("fetching"!=this._getLazyState())AdfDhtmlMenuPeer.superclass.ReplaceDomElement.call(this,a,b);else{var d=AdfDomUtils.getFirstChildElement(a);null==d?(AdfLogger.LOGGER.warning("Unexpected element received by AdfDhtmlMenuPeer.prototype.ReplaceDomElement"),AdfDhtmlMenuPeer.superclass.ReplaceDomElement.call(this,a,b)):(this.getDomElement().appendChild(d),AdfAgent.AGENT.elementsAdded(d),this._setLazyState("contentLoaded"),this._hideFetchingDataPopup(),
this.show(this._lazyFetchPopupHints,this._lazyFetchFocusOnFirstElement))}};AdfDhtmlMenuPeer.prototype.PopupClosed=function(a,b,d){d=this.getDomElement();AdfMenuUtils.dismiss(d,!0,!1);b.style.display="none";AdfDhtmlMenuPeer.superclass.PopupClosed.call(this,a,b);d.appendChild(b);this.isContextMenu()&&(a=a.getParent(),AdfDhtmlPopupPeer.__handlePopupCanceled(a,b),a.getPeer().PopupClosed(a,null))};
AdfDhtmlMenuPeer.prototype.HandleComponentMouseOut=function(a){AdfMenuUtils.unhighlightRootMenuItem();this._isSubMenu()&&!this._isMenuVisible()&&(AdfDhtmlMenuPeer._popupPeerWaitingForShow==this&&AdfDhtmlMenuPeer.cancelShowing(),a=this.getDomElement(),AdfDomUtils.removeCSSClassName(a,AdfMenuUtils.HIGHLIGHTED_STYLE_CLASS),AdfDomUtils.removeCSSClassName(a,AdfMenuUtils.DEPRESSED_STYLE_CLASS))};
AdfDhtmlMenuPeer.prototype.HandleComponentKeyUp=function(a){if(!a.isCanceled()&&!this._isDisabled()){var b=this.getDomElement(),d=a.getKeyCode(),e=this._isSubMenu(),f=this.getComponent(),g=a.getSource();switch(d){case AdfKeyStroke.HOME_KEY:g!=f&&(f=AdfFocusUtils.getFirstFocusableDescendant(this._getMenuElement()),this._updateActiveDescendant(f),AdfFocusUtils.focusElement(f),a.cancel());return;case AdfKeyStroke.END_KEY:g!=f&&(f=AdfFocusUtils.getLastFocusableDescendant(this._getMenuElement()),this._updateActiveDescendant(f),
AdfFocusUtils.focusElement(f),a.cancel());return;case AdfKeyStroke.ENTER_KEY:this._enterKeyDown&&(AdfDomUtils.addCSSClassName(b,AdfMenuUtils.DEPRESSED_STYLE_CLASS),this.show(null,!0));this._enterKeyDown=!1;a.cancel();return;case AdfKeyStroke.SPACE_KEY:this._spaceKeyDown&&(AdfDomUtils.addCSSClassName(b,AdfMenuUtils.DEPRESSED_STYLE_CLASS),this.show(null,!0));this._spaceKeyDown=!1;a.cancel();return;case AdfKeyStroke.ESC_KEY:this.isDetached()?(this._closeDetachedMenu(),a.cancel()):e?b!=AdfPage.PAGE.getActiveDomElement()&&
(this.focus(f),this.close(!0,!0),a.cancel()):this.isContextMenu()?(AdfMenuUtils.closeAllMenus(),b.blur(),this.focus(f),f=f.getParent(),f.getPeer().hide(f),a.cancel()):(AdfLogger.LOGGER.finest("menuBar auto open mode, set to OFF due to escape pressed while on a root menu"),AdfMenuUtils.setMenuBarAutoOpenMode(!1),AdfMenuUtils.closeAllMenus(!0));return}b=this._isMenuVisible();d=this.isRootMenu();f=a.getSource()==f;if(b&&d||!f)f=this._scrollContentElement||this._getMenuElement(),AdfDhtmlMenuPeer._handleMenuItemAccessKeys(f,
a)}};AdfDhtmlMenuPeer.prototype.HandleComponentKeyDown=function(a){if(!a.isCanceled()&&!this._isDisabled()){var b=a.getKeyCode(),d=AdfAgent.AGENT;b==AdfKeyStroke.ENTER_KEY?(this._enterKeyDown=!0,a.cancel(),a.stopBubbling()):b==AdfKeyStroke.SPACE_KEY?(this._spaceKeyDown=!0,a.cancel(),a.stopBubbling()):d.getPreferredKeyEventForRepetition()==AdfUIInputEvent.KEY_DOWN_EVENT_TYPE&&this._handleArrowKeys(b,a)}};
AdfDhtmlMenuPeer.prototype.HandleComponentKeyPress=function(a){if(!a.isCanceled()&&!this._isDisabled()&&AdfAgent.AGENT.getPreferredKeyEventForRepetition()==AdfUIInputEvent.KEY_PRESS_EVENT_TYPE){var b=a.getKeyCode();this._handleArrowKeys(b,a)}};
AdfDhtmlMenuPeer.prototype.HandleComponentFocus=function(a){var b=a.getSource(),d=this.getComponent();b==d?(b=this.getDomElement(),this._isSubMenu()?AdfDomUtils.addCSSClassName(b,AdfMenuUtils.HIGHLIGHTED_STYLE_CLASS):AdfMenuUtils.isMenuBarAutoOpenMode()?(AdfMenuUtils.dismiss(b,!0),AdfDomUtils.addCSSClassName(b,AdfMenuUtils.DEPRESSED_STYLE_CLASS),this.show(null,!1)):AdfMenuUtils.highlightRootMenuItem(b)):b.getParent()==d&&(b=b.getClientId(),b=AdfAgent.AGENT.getElementById(b),(b=AdfFocusUtils.getFirstFocusableDescendant(b))&&
b!=this._activeDescendant&&this._updateActiveDescendant(b));a.cancel()};
AdfDhtmlMenuPeer.prototype.HandleComponentMouseOver=function(a){this._cancelHiding();if(this._isDisabled())AdfMenuUtils.isMenuBarAutoOpenMode()&&this.isRootMenu()&&AdfMenuUtils.closeAllMenus(!1);else if(!a.isCanceled()){var b=AdfAgent.AGENT,d=a.getNativeEvent(),e=this.getDomElement();b.isEventInElement(d,e)&&(a.cancel(),this.isContextMenu()||(a=this.getComponent(),this._isSubMenu()?(AdfDomUtils.addCSSClassName(e,AdfMenuUtils.HIGHLIGHTED_STYLE_CLASS),AdfMenuUtils.dismiss(e,!1),this._delayShow(),AdfFocusUtils.containsFocus(e)||
this.focus(a)):this._isMenuVisible()||AdfMenuUtils.isMenuBarAutoOpenMode()?(AdfMenuUtils.isMenuBarAutoOpenMode()&&(AdfMenuUtils.dismiss(e,!0),AdfDomUtils.addCSSClassName(e,AdfMenuUtils.DEPRESSED_STYLE_CLASS),this.show(null,!1)),AdfFocusUtils.containsFocus(e)||this.focus(a)):AdfMenuUtils.highlightRootMenuItem(e)))}};
AdfDhtmlMenuPeer.prototype.HandleComponentMouseDown=function(a){var b=this.getComponent();if(!this._isDisabled()&&a.isLeftButtonPressed()&&b==a.getSource()){var b=AdfAgent.AGENT,d=a.getNativeEvent();a=this.getDomElement();var e=this._scrollUpElement&&b.isEventInElement(d,this._scrollUpElement),f=this._scrollDownElement&&b.isEventInElement(d,this._scrollDownElement);e||f?(b.getPlatform()==AdfAgent.IE_PLATFORM&&(a=e?this._scrollUpElement:this._scrollDownElement,a!=AdfPage.PAGE.getActiveDomElement()&&
(a.tabIndex=0,a.focus(),a.tabIndex=-1)),b.getCapabilities()[AdfAgent.CAP_TOUCH_SCREEN]!=AdfAgent.CAP_TOUCH_SCREEN_NONE?this._startScroll(f,!0):this._startScroll(f)):b.isEventInElement(d,a)&&(b.eatEvent(d),this.isContextMenu()?AdfDomUtils.addCSSClassName(a,AdfMenuUtils.DEPRESSED_STYLE_CLASS):(b=!!(AdfPage.PAGE.getDomWindow().AdfSafariMobileAgent&&AdfAgent.AGENT instanceof AdfSafariMobileAgent),this._isSubMenu()?(AdfDomUtils.addCSSClassName(a,AdfMenuUtils.DEPRESSED_STYLE_CLASS),this.show(null,b)):this._isMenuVisible()&&
(AdfDomUtils.addCSSClassName(a,AdfMenuUtils.DEPRESSED_STYLE_CLASS),this.close(!0,!0),AdfLogger.LOGGER.finest("menuBar auto open mode, set to OFF due to menu clicked while menu IS visible"),AdfMenuUtils.setMenuBarAutoOpenMode(!1))))}};
AdfDhtmlMenuPeer.prototype.HandleComponentMouseUp=function(a){if(!this._isDisabled()&&a.isLeftButtonPressed()){var b=AdfAgent.AGENT,d=a.getNativeEvent();this._handleElement&&AdfDomUtils.removeCSSClassName(this._handleElement,AdfMenuUtils.DEPRESSED_STYLE_CLASS);var e=this._scrollUpElement&&b.isEventInElement(d,this._scrollUpElement),f=this._scrollDownElement&&b.isEventInElement(d,this._scrollDownElement),g=this.getComponent();e||f?(this._endScroll(),this.updateScrollIconsState()):g==a.getSource()&&
(a=this.getDomElement(),!b.isEventInElement(d,a)||this.isContextMenu()||this._isSubMenu()||this._isMenuVisible()||(b=AdfPage.PAGE.getDomWindow(),this.show(null,!!(b.AdfSafariMobileAgent&&AdfAgent.AGENT instanceof AdfSafariMobileAgent)),AdfLogger.LOGGER.finest("menuBar auto open mode, set to ON due to menu clicked while menu IS NOT visible"),AdfMenuUtils.setMenuBarAutoOpenMode(!0)))}};
AdfDhtmlMenuPeer.prototype.HandleComponentBlur=function(a){a=this.getDomElement();var b=!this._isSubMenu(),d=this._isSubMenu()&&!this._isMenuVisible(),e=this._isSubMenu()&&this._isMenuVisible()&&this.isDetached();(b||d||e)&&AdfDomUtils.removeCSSClassName(a,AdfMenuUtils.HIGHLIGHTED_STYLE_CLASS);!this.isDetached()&&this._isMenuVisible()||AdfDomUtils.removeCSSClassName(a,AdfMenuUtils.DEPRESSED_STYLE_CLASS)};
AdfDhtmlMenuPeer.prototype.ComponentRemoved=function(a){var b=a.getClientId();AdfMenuUtils.isMenuOpen(b)?this.hidePopup():this.isDetached()&&this._closeDetachedMenu();if(this._isDetachable()){var d=AdfAgent.AGENT,e=this._closeDetachedMenuCallback;e&&d.removeBubbleEventListener(this._closeElement,"click",e);delete this._closeElement;delete this._closeDetachedMenuCallback;(e=this._stopCallback)&&d.removeBubbleEventListener(this._handleElement,"mousedown",e);delete this._handleElement;delete this._stopCallback}this._isSubMenu()||
AdfDhtmlMenuPeer._removeBarMenu(b);this._areScrollButtonsDisplayed&&(this._scrollBoxElement.removeEventListener("wheel",this._mouseWheelHandle),this._swipeMgr.release(),this._swipeMgr=null);delete this._menuElement;delete this._scrollUpElement;delete this._scrollDownElement;delete this._scrollUpBackgroundElement;delete this._scrollDownBackgroundElement;delete this._scrollBoxElement;delete this._scrollContentElement;AdfDhtmlMenuPeer.superclass.ComponentRemoved.call(this,a)};
AdfDhtmlMenuPeer.prototype.ComponentDisabledChanged=function(a,b,d,e){AdfMenuUtils.menuItemDisabledChanged(a,b,d,this._getMenuElement())};AdfDhtmlMenuPeer.prototype.ComponentVisibleChanged=function(a,b,d,e){AdfDhtmlMenuPeer.superclass.ComponentVisibleChanged.call(this,a,b,d,e);AdfMenuUtils.menuItemVisibleChanged(a,b,d,this._getMenuElement())};
AdfDhtmlMenuPeer.prototype.ComponentTextChanged=function(a,b,d,e){return null!=e&&(b=AdfDomUtils.getFirstDescendentElement(b,"A"))?AdfDomUtils.handleTextChangeWithAccessKey(a,b,d):!1};AdfDhtmlMenuPeer.prototype.GetInlineEditor=function(a){return AdfDhtmlSimpleTextEditor.getAnchorInlineEditor()};AdfDhtmlMenuPeer.prototype.setVisibleItems=function(a){this._maxDisplayItems=a};
AdfDhtmlMenuPeer.prototype.__preferredSizeChangeNotify=function(a){this.bind(a);if(this.isRootMenu()){a=this.getComponentParent(a);var b=null!=a?a.getPeer():null;b&&b.__preferredSizeChangeNotify&&b.__preferredSizeChangeNotify(a)}};
AdfDhtmlMenuPeer._redetachMenu=function(){var a=AdfDhtmlMenuPeer._reattachedMenuId;if(null!=a){if((a=AdfPage.PAGE.findComponent(a))&&(a=a.getPeer())&&a instanceof AdfDhtmlMenuPeer&&a._detachableWindow){var b=a._detachableWindow.getElement();b.style.left=a._detachedMenuLeft;b.style.top=a._detachedMenuTop;var b={y:a._detachedMenuTop,x:a._detachedMenuLeft},d=a._getMenuPopup();d&&d.setAlignPosition(b);a._makeDetached()}AdfDhtmlMenuPeer._reattachedMenuId=null}};
AdfDhtmlMenuPeer._focusNextDetachedMenuKeyHandler=function(){if(!AdfCollections.isEmpty(AdfDhtmlMenuPeer._sDetachedMenus)){var a,b=AdfDhtmlMenuPeer._lastSelectedDetachableMenuId;null==b?a=AdfDhtmlMenuPeer._sDetachedMenus[0]:(a=AdfDhtmlMenuPeer._sDetachedMenus.length,1==a?a=AdfDhtmlMenuPeer._sDetachedMenus[0]:(b=AdfCollections.indexOf(AdfDhtmlMenuPeer._sDetachedMenus,b),a=b>=a-1?AdfDhtmlMenuPeer._sDetachedMenus[0]:AdfDhtmlMenuPeer._sDetachedMenus[b+1]));if(b=AdfPage.PAGE.findComponent(a)){var d=b.getPeer();
d.bind(b);null!=d._activeDescendant&&AdfFocusUtils.isFocusableDescendant(d._activeDescendant)||d.resetActiveDescendant();AdfFocusUtils.focusElement(d._activeDescendant);AdfDhtmlMenuPeer._lastSelectedDetachableMenuId=a}else AdfDhtmlMenuPeer._removeFromDetachedMenus(a),AdfDhtmlMenuPeer._focusNextDetachedMenuKeyHandler()}};
AdfDhtmlMenuPeer._addToDetachedMenus=function(a){var b=AdfAgent.AGENT;if(AdfCollections.isEmpty(AdfDhtmlMenuPeer._sDetachedMenus)){if(b.getPlatform()==AdfAgent.GECKO_PLATFORM){var d=AdfPage.PAGE.getDomDocument();b.addBubbleEventListener(d,"keypress",AdfDhtmlMenuPeer._cancelKeyPress)}AdfPage.PAGE.registerKeyStroke(AdfDhtmlMenuPeer._focusDetachedMenuKeyStroke,AdfDhtmlMenuPeer._focusNextDetachedMenuKeyHandler)}0>AdfCollections.indexOf(AdfDhtmlMenuPeer._sDetachedMenus,a)&&(AdfDhtmlMenuPeer._lastSelectedDetachableMenuId=
a,AdfDhtmlMenuPeer._sDetachedMenus.push(a))};
AdfDhtmlMenuPeer._removeFromDetachedMenus=function(a){AdfCollections.removeArrayValue(AdfDhtmlMenuPeer._sDetachedMenus,a);var b=AdfCollections.isEmpty(AdfDhtmlMenuPeer._sDetachedMenus);if(b||a==AdfDhtmlMenuPeer._lastSelectedDetachableMenuId)AdfDhtmlMenuPeer._lastSelectedDetachableMenuId=null;b&&(AdfPage.PAGE.unregisterKeyStroke(AdfDhtmlMenuPeer._focusDetachedMenuKeyStroke),a=AdfAgent.AGENT,a.getPlatform()==AdfAgent.GECKO_PLATFORM&&(b=AdfPage.PAGE.getDomDocument(),a.removeBubbleEventListener(b,"keypress",
AdfDhtmlMenuPeer._cancelKeyPress)))};AdfDhtmlMenuPeer._cancelKeyPress=function(a){var b=AdfAgent.AGENT.getKeyCode(a);a.ctrlKey&&a.shiftKey&&b==AdfKeyStroke.W_KEY&&AdfAgent.AGENT.eatEvent(a)};AdfDhtmlMenuPeer._menuBarKeyHandler=function(a){AdfDhtmlMenuPeer._focusMenuBar()};AdfDhtmlMenuPeer._addBarMenu=function(a){var b=AdfDhtmlMenuPeer._sBarMenus;0==b.length&&AdfPage.PAGE.registerKeyStroke(AdfDhtmlMenuPeer._menuBarKeyStroke,AdfDhtmlMenuPeer._menuBarKeyHandler);b.push(a)};
AdfDhtmlMenuPeer._removeBarMenu=function(a){var b=AdfDhtmlMenuPeer._sBarMenus;AdfCollections.removeArrayValue(b,a);0==b.length&&AdfPage.PAGE.unregisterKeyStroke(AdfDhtmlMenuPeer._menuBarKeyStroke)};AdfDhtmlMenuPeer._focusMenuBar=function(){var a=AdfDhtmlMenuPeer._sBarMenus;AdfAssert.assert(1<a.length);var a=AdfPage.PAGE.findComponent(a[0]),b=a.getParent();AdfAssert.assert(!(b instanceof AdfRichMenu));a=a.getPeer()._getParentId();a=AdfAgent.AGENT.getElementById(a);AdfFocusUtils.focusFirstTabStop(a)};
AdfDhtmlMenuPeer._handleMenuItemAccessKeys=function(a,b){var d=b.getKeyStroke(),e=d.getModifiers();if(!(e&AdfKeyStroke.CTRL_MASK||e&AdfKeyStroke.ALT_MASK||e&AdfKeyStroke.META_MASK)){e&AdfKeyStroke.SHIFT_MASK&&(e>>=AdfKeyStroke.SHIFT_MASK,d=AdfKeyStroke.getKeyStroke(d.getKeyCode(),e));for(var d=d.toMarshalledString().toUpperCase(),e=a.getElementsByTagName("tr"),f=e.length,g=0;g<f;g++){var h=e[g];if(h&&1==h.nodeType){var k=h.getAttribute("accessKey");if(k&&d==k.toUpperCase()){AdfFocusUtils.focusElement(h);
b.cancel();break}}}}};
AdfDhtmlMenuPeer.prototype._handleArrowKeys=function(a,b){var d=b.getNativeEvent();if(d.ctrlKey)this._handleCtrlArrowKeys(a,b);else if(!(d.altKey||d.shiftKey||d.metaKey)&&b.getSource()!=this.getComponent())switch(d=b.getSource().getPeer().getDomElement(),a){case AdfKeyStroke.ARROWUP_KEY:this._focusPreviousMenuItem(d);b.cancel();break;case AdfKeyStroke.ARROWDOWN_KEY:this._focusNextMenuItem(d);b.cancel();break;case AdfKeyStroke.ARROWLEFT_KEY:this._handleMenuItemLeftArrowKey(b);break;case AdfKeyStroke.ARROWRIGHT_KEY:this._handleMenuItemRightArrowKey(b)}};
AdfDhtmlMenuPeer.prototype._handleCtrlArrowKeys=function(a,b){if(this.isDetached()||this._detachableWindow&&this._isMenuVisible()){var d=AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM?187==a:61==a;if(b.getNativeEvent().altKey&&d)this._moveDetachable(0,0),b.cancel();else{d=!0;switch(a){case AdfKeyStroke.ARROWUP_KEY:this._moveDetachable(0,-20);break;case AdfKeyStroke.ARROWDOWN_KEY:this._moveDetachable(0,20);break;case AdfKeyStroke.ARROWLEFT_KEY:this._moveDetachable(-20,0);break;case AdfKeyStroke.ARROWRIGHT_KEY:this._moveDetachable(20,
0);break;default:d=!1}d&&b.cancel()}}};AdfDhtmlMenuPeer.prototype._handleMenuItemLeftArrowKey=function(a){var b=this.getComponent();this.isRootMenu()?(this.focus(b),this.close(!0,!0),AdfMenuUtils.MenuBarAutoOpenMode=!1):this.isDetached()||this.isContextMenu()||(this.focus(b),this.close(!0,!0));a.cancel()};
AdfDhtmlMenuPeer.prototype._handleMenuItemRightArrowKey=function(a){var b=a.getSource();b instanceof AdfRichMenu?(b.getPeer().show(null,!0),a.cancel()):this.isDetached()||this.isContextMenu()?a.cancel():this.isRootMenu()&&(b=this.getComponent(),this.focus(b),this.close(!0,!0),AdfLogger.LOGGER.finest("menuBar auto open mode, set to OFF due to right arrow key pressed on root menu item"),AdfMenuUtils.setMenuBarAutoOpenMode(!1),a.cancel())};
AdfDhtmlMenuPeer.prototype._focusNextMenuItem=function(a){AdfAssert.assertDomElement(this._activeDescendant);AdfAssert.assert(a==this._activeDescendant);this._activeDescendant||(AdfLogger.LOGGER.warning("Menu has lost its assigned activeDescendant!"),this.resetActiveDescendant());a=AdfFocusUtils.focusNextActiveDescendant(this._getMenuElement(),a,!0);AdfAssert.assertDomElement(a);this._activeDescendant=a;this.updateScrollIconsState()};
AdfDhtmlMenuPeer.prototype._focusPreviousMenuItem=function(a){AdfAssert.assertDomElement(this._activeDescendant);AdfAssert.assert(a==this._activeDescendant);this._activeDescendant||(AdfLogger.LOGGER.warning("Menu has lost its assigned activeDescendant!"),this.resetActiveDescendant());a=AdfFocusUtils.focusPreviousActiveDescendant(this._getMenuElement(),a,!0);AdfAssert.assertDomElement(a);this._activeDescendant=a;this.updateScrollIconsState()};
AdfDhtmlMenuPeer.prototype._onHandleClick=function(a){AdfAgent.AGENT.eatEvent(a);AdfDomUtils.addCSSClassName(this._handleElement,AdfMenuUtils.DEPRESSED_STYLE_CLASS)};
AdfDhtmlMenuPeer.prototype._initElements=function(a,b,d){a=AdfAgent.AGENT;this._isDetachable()&&(d=AdfRichUIPeer.CreateSubId(b,"close"),this._closeElement=a.getElementById(d),this._closeDetachedMenuCallback=this.createCallback(this._closeDetachedMenu),a.addBubbleEventListener(this._closeElement,"click",this._closeDetachedMenuCallback),d=AdfRichUIPeer.CreateSubId(b,"handle"),this._handleElement=a.getElementById(d),this._stopCallback=this.createCallback(this._onHandleClick),a.addBubbleEventListener(this._handleElement,
"mousedown",this._stopCallback));d=AdfRichUIPeer.CreateSubId(b,"ScrollContent");this._scrollContentElement=a.getElementById(d);var e=this._scrollContentElement.rows;if(e.length<this._maxDisplayItems)this._areScrollButtonsDisplayed=!1;else{d=[];for(i=0;i<e.length;i++){var f=e[i];"none"!=f.style.display&&d.push(f)}if(this._areScrollButtonsDisplayed=d.length>this._maxDisplayItems)e=AdfRichUIPeer.CreateSubId(b,"ScrollUp"),this._scrollUpElement=a.getElementById(e),this._scrollUpElement.style.display="block",
e=AdfRichUIPeer.CreateSubId(b,"sUpBg"),this._scrollUpBackgroundElement=a.getElementById(e),e=AdfRichUIPeer.CreateSubId(b,"ScrollDown"),this._scrollDownElement=a.getElementById(e),this._scrollDownElement.style.display="block",e=AdfRichUIPeer.CreateSubId(b,"sDwnBg"),this._scrollDownBackgroundElement=a.getElementById(e),b=AdfRichUIPeer.CreateSubId(b,"ScrollBox"),this._scrollBoxElement=a.getElementById(b),this._scrollBoxElement.style.height=d[this._maxDisplayItems].offsetTop-2-d[0].offsetTop+"px",this._mouseWheelHandle=
this.createCallback(this._mouseWheel),this._scrollBoxElement.addEventListener("wheel",this._mouseWheelHandle),b={},b[AdfSwipeSupport.PANNING_CALLBACK]=this.createCallback(this._handlePanning),a={},a[AdfSwipeSupport.MODE]=AdfSwipeSupport.MODE_VERTICAL,this._swipeMgr=new AdfSwipeSupport(this._scrollBoxElement,b,a)}};
AdfDhtmlMenuPeer.prototype._createMenuPopupHints=function(a,b){var d={},e=this.getDomElement(),f=this.getComponent();d[AdfDhtmlPopupHints.TYPE]=AdfDhtmlPopupHints.TYPE_MENU;d[AdfDhtmlPopupHints.AUTODISMISS]=AdfDhtmlPopupHints.AUTODISMISS_MENU;d[AdfDhtmlPopupHints.ALIGN_ELEMENT]=e;d[AdfDhtmlPopupHints.FOCUS]=b?!0:!1;var g=f.getText();null==g&&(g=f.getShortDesc());d[AdfDhtmlPopupHints.TITLE]=g;d[AdfDhtmlPopupHints.ANIMATE]=AdfRichPopup.ANIMATE_DEFAULT;d[AdfDhtmlPopupHints.CLOSE_ON_ESCAPE]=!1;if(null==
a||null==a[AdfDhtmlPopupHints.MOUSEPOSITION])this._isSubMenu()||AdfMenuUtils.isInOverflow(e)?d[AdfRichPopup.HINT_ALIGN]=AdfRichPopup.ALIGN_END_BEFORE:d[AdfRichPopup.HINT_ALIGN]=AdfRichPopup.ALIGN_AFTER_START;AdfCollections.copyInto(d,a);return d};
AdfDhtmlMenuPeer.prototype._showFetchingDataPopup=function(){var a=AdfAgent.AGENT,b=this.getComponent(),d=this.getDomElement().getAttribute("id"),d=AdfRichUIPeer.CreateSubId(d,"lazy-fetch-message"),a=a.getElementById(d),a=AdfDomUtils.getFirstChildElement(a),e=this._createMenuPopupHints(null,!1);e[AdfDhtmlPopupHints.TYPE]=AdfDhtmlPopupHints.TYPE_INLINESELECTOR;AdfDomUtils.setVisible(a,!0);AdfDhtmlMenuPeer.superclass.showPopup.call(this,b,a,e,d)};
AdfDhtmlMenuPeer.prototype._hideFetchingDataPopup=function(){var a=this.getComponent(),b=this.getDomElement().getAttribute("id"),b=AdfRichUIPeer.CreateSubId(b,"lazy-fetch-message");AdfDhtmlMenuPeer.superclass.hidePopup.call(this,a,b)};
AdfDhtmlMenuPeer.prototype._reattachMenu=function(){if(this.isDetached()){var a=this.getComponent().getClientId();AdfDhtmlMenuPeer._reattachedMenuId=a;AdfMenuUtils.addOpenMenu(a);AdfDhtmlMenuPeer._removeFromDetachedMenus(a);this._showShadow(!1);a=this._calculateReattachPosition();this._isDetached=!1;if(AdfPage.PAGE.isAnimationEnabled())this._animateReattach({left:a.x,top:a.y});else{this._moveShadow(!0);var b=this._getMenuPopup();b&&b.setAlignPosition(a);AdfDomUtils.removeCSSClassName(this._getMenuElement(),
AdfMenuUtils.DETACHED_STYLE_CLASS)}}};AdfDhtmlMenuPeer.prototype._animateReattach=function(a){AdfDomUtils.removeCSSClassName(this._getMenuElement(),AdfMenuUtils.DETACHED_STYLE_CLASS);var b=this._detachableWindow.getElement();AdfDhtmlElementAnimator.animate(AdfDhtmlElementAnimator.FRAME_METHOD_SLOW_FAST_SLOW,300,[{element:b,properties:a}],null,AdfDhtmlMenuPeer._animateReattachComplete,[this,a.y,a.x])};
AdfDhtmlMenuPeer._animateReattachComplete=function(a){var b=a[0],d=a[1];a=a[2];b._moveShadow(!0);d={y:d,x:a};(b=b._getMenuPopup())&&b.setAlignPosition(d)};AdfDhtmlMenuPeer.prototype._calculateReattachPosition=function(){var a=AdfPage.PAGE.getPositionManager(),b=this.getDomElement(),d=this._getMenuElement(),e=AdfRichPopup.ALIGN_END_BEFORE,f=d.clientHeight-4,d=d.clientWidth+AdfDhtmlShadowDecorator.getShadowSize();return a.calculatePlacementPosition(f,d,e,b,null)};
AdfDhtmlMenuPeer.prototype._contains=function(a){var b=this.getDomElement(),b=AdfDomUtils.isAncestorOrSelf(b,a);if("noContent"==this._getLazyState())return b;a=AdfDomUtils.isAncestor(this._getMenuElement(),a);return b||a};AdfDhtmlMenuPeer.prototype._getParentId=function(){if(!this._parentId){var a=this.getDomElement().parentNode;do var b=a.getAttribute("id"),a=a.parentNode;while(!b&&a);b&&(this._parentId=b)}return this._parentId};
AdfDhtmlMenuPeer.prototype._getDepth=function(){if(!this._depth){var a=this.getDomElement();this._depth=parseInt(a.getAttribute(AdfMenuUtils.MENU_DEPTH_KEY))}return this._depth};AdfDhtmlMenuPeer.prototype._isSubMenu=function(){return 1<this._getDepth()};AdfDhtmlMenuPeer.prototype._isDisabled=function(){var a=this.getDomElement();return a.disabled||AdfDomUtils.containsCSSClassName(a,AdfRichUIPeer.DISABLED_STYLECLASS)};AdfDhtmlMenuPeer.prototype._isDetachable=function(){return this.getComponent().getDetachable()};
AdfDhtmlMenuPeer.prototype._handleHideRequest=function(a,b){AdfAssert.assert(!this.isDetached(),"this method is not intended for detached menus");if(this.isRootMenu()){var d=this.getDomElement();AdfDomUtils.removeCSSClassName(d,AdfMenuUtils.DEPRESSED_STYLE_CLASS);AdfDomUtils.removeCSSClassName(d,AdfMenuUtils.HIGHLIGHTED_STYLE_CLASS)}AdfDhtmlMenuPeer._popupPeerWaitingForShow&&this._contains(AdfDhtmlMenuPeer._popupPeerWaitingForShow.getDomElement())&&AdfDhtmlMenuPeer.cancelShowing();this._scrollBoxElement&&
(this._scrollBoxElement.scrollTop=0);AdfMenuUtils.removeOpenMenu(b)};AdfDhtmlMenuPeer.prototype._createDetachableWindow=function(){this._isMenuVisible()&&null==this._detachableWindow&&(this._detachableWindow=new AdfRepositionable(this._getMenuPopup(),this._handleElement),this._detachableWindow.setDragStartHandler(this.createCallback(this._dragStart)),this._detachableWindow.setDragEndHandler(this.createCallback(this._dragEnd)))};
AdfDhtmlMenuPeer.prototype._dragStart=function(){this._deselectElement();this._showShadow(!1);var a=this.getDomElement();AdfMenuUtils.dismiss(a,!0);a=this._detachableWindow.getElement();this._detachedMenuLeft=a.style.left;this._detachedMenuTop=a.style.top;a=this.getComponent().getClientId();AdfMenuUtils.removeOpenMenu(a);AdfDhtmlMenuPeer._addToDetachedMenus(a);AdfLogger.LOGGER.finest("menuBar auto open mode, set to OFF due to menu first becoming detached");AdfMenuUtils.setMenuBarAutoOpenMode(!1)};
AdfDhtmlMenuPeer.prototype._dragEnd=function(){var a=this._getMenuPopup();AdfAssert.assert(null!=a,"menuPopup should not disappear during a drag.");if(a){a.setAlignElement(null);var b={y:a.getTop(),x:a.getLeft()};a.setAlignPosition(b);this._makeDetached();this._moveShadow(!0);a.activate();AdfMenuUtils.closeAllMenus()}};
AdfDhtmlMenuPeer.prototype._delayPopupHiding=function(a){this._popupHidingHandle&&this._cancelHiding();this._popupHidingHandle=AdfPage.PAGE.getDomWindow().setTimeout(this.createCallback(this._delayPopupHidingCallback),AdfDhtmlMenuPeer._OPEN_CLOSE_DELAY-a)};AdfDhtmlMenuPeer.prototype._delayPopupHidingCallback=function(){var a=this.getComponent();a&&this.isPopupVisible(a,a.getClientId())&&this.hidePopup()};
AdfDhtmlMenuPeer.prototype._delayShow=function(){AdfDhtmlMenuPeer.cancelShowing();AdfDhtmlMenuPeer._popupShowingHandle=AdfPage.PAGE.getDomWindow().setTimeout(this.createCallback(this._delayShowCallback),AdfDhtmlMenuPeer._OPEN_CLOSE_DELAY);AdfDhtmlMenuPeer._popupPeerWaitingForShow=this};
AdfDhtmlMenuPeer.prototype._delayShowCallback=function(){var a=this.getComponent();this.isPopupVisible(a,a.getClientId())?this._reattachMenu():(delete AdfDhtmlMenuPeer._popupPeerWaitingForShow,delete AdfDhtmlMenuPeer._popupShowingHandle,this.show(null,!1))};AdfDhtmlMenuPeer.prototype._cancelHiding=function(){if(this._popupHidingHandle){window.clearTimeout(this._popupHidingHandle);delete this._popupHidingHandle;var a=AdfDhtmlMenuPeer._popupPeerWaitingForShow;a&&a._getDepth()<=this._getDepth()&&AdfDhtmlMenuPeer.cancelShowing()}};
AdfDhtmlMenuPeer.prototype.__makeDetached=function(){this._makeDetached()};AdfDhtmlMenuPeer.prototype._makeDetached=function(){AdfDomUtils.removeCSSClassName(this._handleElement,AdfMenuUtils.DEPRESSED_STYLE_CLASS);var a=this._detachableWindow.getElement();this._isDetached=!0;this._detachedMenuLeft=a.style.left;this._detachedMenuTop=a.style.top;AdfDomUtils.addCSSClassName(this._getMenuElement(),AdfMenuUtils.DETACHED_STYLE_CLASS);AdfMenuUtils.dismiss(this.getDomElement().parentNode,!0,!0);this._getMenuPopup().autoSize()};
AdfDhtmlMenuPeer.prototype._deselectElement=function(){var a=this.getDomElement();AdfDomUtils.removeCSSClassName(a,AdfMenuUtils.HIGHLIGHTED_STYLE_CLASS);AdfDomUtils.removeCSSClassName(a,AdfMenuUtils.DEPRESSED_STYLE_CLASS)};
AdfDhtmlMenuPeer.prototype._closeDetachedMenu=function(a){a=this.getComponent();var b=a.getClientId();AdfDomUtils.removeCSSClassName(this._getMenuElement(),AdfMenuUtils.DETACHED_STYLE_CLASS);this._isDetached=!1;var d=this.getDomElement();AdfDomUtils.removeCSSClassName(d,AdfMenuUtils.HIGHLIGHTED_STYLE_CLASS);AdfDhtmlMenuPeer._removeFromDetachedMenus(b);this._detachableWindow&&this._detachableWindow.destroy();delete this._detachableWindow;b==AdfDhtmlMenuPeer._reattachedMenuId&&(AdfDhtmlMenuPeer._reattachedMenuId=
null);AdfDhtmlMenuPeer.superclass.hidePopup.call(this,a,b);AdfMenuUtils.closeAllMenus();AdfMenuUtils.restoreFocusToLastOpenedRootMenu()};AdfDhtmlMenuPeer.prototype._moveDetachable=function(a,b){this._dragStart();var d=this._detachableWindow.getElement();d.style.left=d.offsetLeft+a+"px";d.style.top=d.offsetTop+b+"px";this._dragEnd()};AdfDhtmlMenuPeer.prototype._getShadowAnchor=function(){var a=this._getMenuPopup();if(null!=a&&null!=a.getShadowAnchor())return a.getShadowAnchor()};
AdfDhtmlMenuPeer.prototype._showShadow=function(a){var b=this._getShadowAnchor();AdfDhtmlShadowDecorator.hasShadowDecorator(b)&&AdfDhtmlShadowDecorator.showShadowDecorator(b,a)};AdfDhtmlMenuPeer.prototype._moveShadow=function(a){var b=this._getShadowAnchor();null!=b&&AdfDhtmlShadowDecorator.hasShadowDecorator(b)&&(AdfDhtmlShadowDecorator.moveShadowDecorator(b),AdfDhtmlShadowDecorator.showShadowDecorator(b,a))};AdfDhtmlMenuPeer.prototype.__startScroll=function(a,b){this._startScroll(a,b)};
AdfDhtmlMenuPeer.prototype._startScroll=function(a,b){this._scrollDelta=AdfDhtmlMenuPeer._SCROLL_DELTA;b&&(this._scrollDelta=AdfDhtmlMenuPeer._JUMP_SCROLL_DELTA);a||(this._scrollDelta*=-1);if(b)this._scroll();else{var d=this.createCallback(this._scroll);this._scrollTimer=setInterval(d,10)}};
AdfDhtmlMenuPeer.prototype._endScroll=function(){this._scrollTimer&&clearInterval(this._scrollTimer);this._scrollTimer=null;var a=this._scrollBoxElement.scrollTop,b=this._scrollContentElement.rows,d=b.length;if(0>this._scrollDelta)for(var e=d-1;-1<e;e--){var f=b[e];if("none"!=f.style.display&&(d=f.offsetTop,a>=d)){this._scrollBoxElement.scrollTop=d;break}}else for(var g=a+this._scrollBoxElement.offsetHeight,e=0;e<d;e++)if(f=b[e],"none"!=f.style.display&&(f=f.offsetTop+f.offsetHeight,g<=f)){this._scrollBoxElement.scrollTop=
a+(f-g);break}};AdfDhtmlMenuPeer.prototype._getMenuItemHeight=function(){if(null!=this._menuItemHeight)return this._menuItemHeight;var a=AdfDomUtils.getFirstChildElement(this._scrollContentElement),a=AdfDomUtils.getFirstChildElement(a);this._menuItemHeight=a.clientHeight;0==this._menuItemHeight&&(this._menuItemHeight=a.scrollHeight);return this._menuItemHeight};
AdfDhtmlMenuPeer.prototype._scroll=function(){this._scrollBoxElement.scrollTop+=this._scrollDelta;var a=this._scrollBoxElement.scrollTop,b=this._scrollContentElement.offsetHeight-this._scrollBoxElement.offsetHeight;(0>=a||a>=b)&&this._endScroll();this.updateScrollIconsState()};AdfDhtmlMenuPeer.prototype._getMenuElement=function(){if(null==this._menuElement){var a=this.getDomElement().getAttribute("id"),a=AdfRichUIPeer.CreateSubId(a,"menu");this._menuElement=AdfAgent.AGENT.getElementById(a)}return this._menuElement};
AdfDhtmlMenuPeer.prototype._getMenuPopup=function(){var a=this.getComponent(),b=a.getClientId();return this.getPopupWindow(a,b)};AdfDhtmlMenuPeer.prototype._isMenuVisible=function(){return this._getMenuPopup()?!0:!1};AdfDhtmlMenuPeer.prototype.isContentLoaded=function(){return null!=this._lazyState&&"contentLoaded"==this._lazyState};AdfDhtmlMenuPeer.prototype._getLazyState=function(){null==this._lazyState&&(this._lazyState=null==this._getMenuElement()?"noContent":"contentLoaded");return this._lazyState};
AdfDhtmlMenuPeer.prototype._setLazyState=function(a){this._lazyState=a};AdfDhtmlMenuPeer.prototype._updateActiveDescendant=function(a){AdfAssert.assertDomElement(a);this._activeDescendant&&this._activeDescendant.setAttribute("tabIndex","-1");a.setAttribute("tabIndex","0");this._activeDescendant=a};AdfDhtmlMenuPeer.prototype.SimulateMouseOnDescendant=function(a,b,d){AdfDhtmlMenuPeer.superclass.SimulateMouseOnDescendant.call(this,a,b,d);this.isContextMenu()||this._isMenuVisible()||this.show(null,!1)};
AdfDhtmlMenuPeer.prototype._mouseWheel=function(a){AdfAgent.AGENT.eatEvent(a);this._scrollBoxElement.scrollTop+=a.deltaY;this.updateScrollIconsState()};AdfDhtmlMenuPeer.prototype._handlePanning=function(a){a=a.deltaY;this._scrollBoxElement.scrollTop+=-1*a;this.updateScrollIconsState()};