var Uq=I.ea(I,"AdfDhtmlMenuBarPeer",!1);m("AdfDhtmlMenuBarPeer",Uq);Uq.C=function(){r.bb(Vq);r.bb(W);this.tX=[];I.ra(this,D.Ad,D.Bc,D.gh,D.wb,D.Oc,D.Nd);q.b.Dd()||I.ra(this,D.ze,D.gg)};m("AdfDhtmlMenuBarPeer.InitSubclass",Uq.C);Uq.prototype.G=function(a,b){Uq.h.G.call(this,a,b);var d=a.g(),e=I.j(d,"eoc"),f=q.b;this.Qk=(this.oe=f.getElementById(e))?!0:!1;1==this.Qk&&(e=I.j(d,"eoi"),this.Mn=f.getElementById(e),A.c.pr(a));this.lF=f.Cm(f.Ay(b.getElementsByTagName("table")[0],0));this.Pa=J.oI(b)};
r.a("AdfDhtmlMenuBarPeer.prototype.InitDomElement",{G:Uq.prototype.G});Uq.prototype.ue=function(){return!0};r.a("AdfDhtmlMenuBarPeer.prototype.needsChildVisibilityChanges",{ue:Uq.prototype.ue});Uq.prototype.ya=function(){return!0};r.a("AdfDhtmlMenuBarPeer.prototype.needsResizeNotify",{ya:Uq.prototype.ya});Uq.prototype.Cd=function(a,b){b||(b=[]);Uq.h.Cd.call(this,a,b);1==this.Qk&&pl.ksa(a,b);return b};r.a("AdfDhtmlMenuBarPeer.prototype.getDescendantComponents",{Cd:Uq.prototype.Cd});
Uq.prototype.Mm=function(){};r.a("AdfDhtmlMenuBarPeer.prototype.updateScrollIconsState",{Mm:Uq.prototype.Mm});Uq.prototype.ah=function(){this.Pa&&this.Pa.setAttribute("tabIndex","-1");this.Pa=J.oI(this.i())};r.a("AdfDhtmlMenuBarPeer.prototype.resetActiveDescendant",{ah:Uq.prototype.ah});
Uq.prototype.Sa=function(){var a=this.i(),b=this.f(),d=b.g();if(0!=this.Qk||b.getStretchId()){this.cY();if(1==this.Qk){if(!this.Va)for(this.Va=new pl(d,this,"end",null,null,!0),b=q.b,a=b.Cm(b.Ay(a.getElementsByTagName("table")[0],0)),b=0,d=a[0];d;)this.Va.Lp(),this.Va.addElement(d),d=C.pa(d),Vq.Bta(d)&&(d=this.rF(d),this.Va.Vr(d)),b++,d=a[b];this.Va.te()}this.fX();this.Pa&&(0<this.Pa.offsetWidth||0<this.Pa.offsetHeight)||this.ah()}};r.a("AdfDhtmlMenuBarPeer.prototype.ResizeNotify",{Sa:Uq.prototype.Sa});
Uq.prototype.le=function(){A.c.Kc(this.f());return!1};r.a("AdfDhtmlMenuBarPeer.prototype.ChildVisibilityChanged",{le:Uq.prototype.le});Uq.prototype.yk=function(){if(!this.lu){var a=this.i().firstChild;this.cY();this.Va&&this.Va.iI();this.lu=a.offsetWidth;this.fX()}return this.lu};r.a("AdfDhtmlMenuBarPeer.prototype.GetPreferredWidth",{yk:Uq.prototype.yk});
Uq.prototype.wJ=function(){if(!this.Sj)if(0==this.Qk)this.Sj=this.yk();else if(this.lF&&0<this.lF.length){var a=this.Mn.style.display;this.Mn.style.display="block";this.Sj=this.Mn.offsetWidth;this.Mn.style.display=a;a=this.yk();this.Sj>a&&(this.Sj=a)}else this.Sj=0;return this.Sj};r.a("AdfDhtmlMenuBarPeer.prototype.GetMinimumWidth",{wJ:Uq.prototype.wJ});
Uq.prototype.ma=function(a){if(!a.Aa()){var b=q.b,d=a.na(),e=a.getSource();if(e instanceof AdfRichCommandNavigationItem){d==w.Ih&&e.getParent()instanceof AdfRichCommandNavigationItem&&(b=b.getElementById(e.getParent().g()),J.dk(b),Uq.h.ak.call(this,e),Uq.h.ak.call(this,e.getParent()),a.cancel());var e=q.b,f=a.getSource(),b=f.g(),g=e.getElementById(b),h=I.j(b,"menu"),l=e.getElementById(h),n=f.getParent(),t=n.g(),h=e.getElementById(t),t=I.j(t,"menu"),t=e.getElementById(t);if(n instanceof AdfRichMenuBar){if(e=
a.U(),!(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey))switch(d){case w.Ra:Wq(b)?J.dk(l):this.Wn(a,!0);a.cancel();break;case w.vb:(d=J.DO(h,this.Pa))?this.Pa=d:J.be(this.Pa);a.cancel();break;case w.ub:(d=J.EO(h,this.Pa))?this.Pa=d:J.ni(this.Pa),a.cancel()}}else switch(d){case w.Ra:J.be(g,t);a.cancel();break;case w.ab:J.ni(g,t);a.cancel();break;case w.vb:if(Wq(b))J.dk(l);else if(Xq(a))this.Wn(a,!0);else{for(b=f;!(b.getParent()instanceof AdfRichMenuBar);)b=b.getParent();d=e.getElementById(b.g());e=e.getElementById(b.getParent().g());
J.be(d,e);Yq(this)}a.cancel();break;case w.ub:n.getParent()instanceof AdfRichMenuBar?(e=e.getElementById(n.getParent().g()),J.ni(h,e),Yq(this)):(J.dk(h),Uq.h.ak.call(this,n)),a.cancel()}}else b.wC()==D.Bc&&this.rp(d,a)}};r.a("AdfDhtmlMenuBarPeer.prototype.HandleComponentKeyDown",{ma:Uq.prototype.ma});Uq.prototype.Yb=function(a){if(!a.Aa()&&q.b.wC()==D.gh){var b=a.na();this.rp(b,a)}};r.a("AdfDhtmlMenuBarPeer.prototype.HandleComponentKeyPress",{Yb:Uq.prototype.Yb});
Uq.prototype.za=function(a){var b=this.f();if(!a.Aa()&&!b.getDisabled()){var d=a.getSource(),e=a.na();if(d instanceof AdfRichCommandNavigationItem&&e==w.jb){var f=q.b,g=f.getElementById(d.g()),e=g.getAttribute("href"),f=f.R().location.href,h=f.indexOf("#"),f=-1==h?f:f.substring(0,h);e&&(-1==e.indexOf(f)||1<e.substring(e.indexOf("#")).length)?(A.c.Cc(!0,!0,!0,"User click Command Navigation , GET request"),d=g.getAttribute("target"),null!=d&&0<d.length?window.open(e,d):self.location=e,a.cancel()):ab.F(d,
d.getPartialSubmit())}Uq.hgb(b,a)}};r.a("AdfDhtmlMenuBarPeer.prototype.HandleComponentKeyUp",{za:Uq.prototype.za});Uq.prototype.ka=function(a){this.Va&&(this.Va.Yy(),delete this.Va);delete this.oe;delete this.Mn;delete this.lF;A.c.bp(a);Uq.h.ka.call(this,a)};r.a("AdfDhtmlMenuBarPeer.prototype.ComponentRemoved",{ka:Uq.prototype.ka});Uq.prototype.ad=function(a){this.bind(a);this.Sj=this.lu=null;a=this.af(a);var b=null!=a?a.o():null;b&&b.ad&&b.ad(a)};
r.a("AdfDhtmlMenuBarPeer.prototype.__preferredSizeChangeNotify",{ad:Uq.prototype.ad});Uq.hgb=function(a,b){var d=b.Yg(),e=d.sC();if(!(e&w.pi||e&w.Ao||e&w.Nq)){e&w.Bk&&(e>>=w.Bk,d=w.Yg(d.na(),e));for(var d=d.Ps().toUpperCase(),e=a.g(),e=q.b.getElementById(e).getElementsByTagName("A"),f=e.length,g=0;g<f;g++){var h=e[g];if(h&&1==h.nodeType){var l=h.getAttribute("accessKey");if(l&&d==l.toUpperCase()){J.va(h);b.cancel();break}}}}};k=Uq.prototype;
k.rp=function(a,b){var d=b.U();if(!(d.ctrlKey||d.altKey||d.shiftKey||d.metaKey)){var d=b.getSource().o().i(),e=b.getSource();if(W.lk(d))switch(a){case w.vb:e instanceof AdfRichMenu&&(e.o().show(null,!0),b.cancel());break;case w.ab:this.Va.P8(this.oe);b.cancel();break;case w.Ra:this.Va.O8(this.oe),b.cancel()}else switch(a){case w.Ra:e instanceof AdfRichMenu&&(C.w(d,W.cf),e.o().show(null,!0),b.cancel());break;case w.ub:this.LA()&&(d=this.i(),(d=J.EO(d,this.Pa))?this.Pa=d:J.ni(this.Pa));b.cancel();break;
case w.vb:this.LA()&&(d=this.i(),(d=J.DO(d,this.Pa))?this.Pa=d:J.be(this.Pa)),b.cancel()}}};k.LA=function(){u.u(this.Pa);u.assert("0"==this.Pa.getAttribute("tabindex"),"The menuBar's active descendant should have tabindex 0");this.Pa||(v.l.warning("MenuBar has lost its assigned activeDescendant!"),this.ah());return null!=this.Pa};k.cY=function(){var a=this.nM();a&&(a.parentNode.style.width="")};
k.fX=function(){var a=this.nM();if(a)if(W.lk(a))a.parentNode.style.width="100%";else{var b=q.b.getWindowWidth()+"px";a.parentNode.style.width=b}};k.rF=function(a){var b=a.ownerDocument.createElement("table");b.cellPadding=0;b.cellSpacing=0;b.style.width="100%";b.zo="presentation";var d=b.insertRow(-1).insertCell(-1);d.style.width="100%";d.setAttribute(W.cE,"true");d.setAttribute("role","presentation");C.w(d,W.DR);a=this.Va.wY(a);d.appendChild(a);return b};
k.nM=function(){var a=this.f(),b=a.getStretchId();if(b){if(a=a.m(b))return b=a.g(),q.b.getElementById(b);v.l.warning("Unable to find client component for stretch id "+b)}return null};k.fc=function(a){a=a.getSource();a instanceof AdfRichCommandNavigationItem&&a.getParent()instanceof AdfRichCommandNavigationItem&&a.o().i().blur()};r.a("AdfDhtmlMenuBarPeer.prototype.HandleComponentMouseOut",{fc:Uq.prototype.fc});
Uq.prototype.$a=function(a){var b=a.getSource();b instanceof AdfRichCommandNavigationItem?(b.o().focus(b),this.Wn(a,null)):a.cancel();a.Aa()};r.a("AdfDhtmlMenuBarPeer.prototype.HandleComponentMouseOver",{$a:Uq.prototype.$a});Uq.prototype.M=function(a){a.getSource()instanceof AdfRichCommandNavigationItem&&Yq(this)};r.a("AdfDhtmlMenuBarPeer.prototype.HandleComponentClick",{M:Uq.prototype.M});
Uq.prototype.Ta=function(a){var b=a.getSource(),d=b.g(),d=q.b.getElementById(d),e=a.U(),e=q.b.ca(e);b instanceof AdfRichCommandNavigationItem&&C.w(d,W.Nh);e==this.Mn?this.Pa!=e&&this.$x(this.Mn):W.lk(d)?(b=J.ym(d))&&this.Va.Taa(b):W.Ny(b)&&(b=J.ym(d))&&b!=this.Pa&&this.$x(b);a.cancel()};r.a("AdfDhtmlMenuBarPeer.prototype.HandleComponentFocus",{Ta:Uq.prototype.Ta});
Uq.prototype.Lb=function(a){var b=a.getSource();b instanceof AdfRichCommandNavigationItem?(b=q.b.getElementById(b.g()),C.O(b,W.Nh)):a.cancel();a.Aa()};r.a("AdfDhtmlMenuBarPeer.prototype.HandleComponentBlur",{Lb:Uq.prototype.Lb});
Uq.prototype.ob=function(a,b){if(a instanceof AdfRichCommandNavigationItem){var d=q.b.getElementById(a.g()),e=d,e=Zq(a);a.getParent()instanceof AdfRichMenuBar&&C.O(d,W.cf);b.style.display="none";E.Ig(Uq.tX,a.g());Uq.h.ob.call(this,a,b);e.appendChild(b)}else Uq.h.ob.call(this,a,b)};r.a("AdfDhtmlMenuBarPeer.prototype.PopupClosed",{ob:Uq.prototype.ob});function Xq(a){a=a.getSource();var b=null;Zq(a)&&(b=Zq(a).lastChild);return b}
Uq.prototype.Wn=function(a,b){var d=a.getSource(),e=d.g(),f=q.b;if(Wq(e))a.cancel();else{var g=Xq(a);if(g){f=f.getElementById(d.g());d.getParent()instanceof AdfRichMenuBar&&C.w(f,W.cf);var h={},l=q.b.getElementById(d.g());h.type="menu";h.autodismiss="autodismissMenu";h.alignElement=f;h.focus=b?!0:!1;h.closeOnEscape=!1;d.getParent()instanceof AdfRichCommandNavigationItem||W.lk(l)?h[AdfRichPopup.Ed]=AdfRichPopup.tz:h[AdfRichPopup.Ed]=AdfRichPopup.qf;g.style.display="block";Uq.tX.push(e);Uq.h.He.call(this,
d,g,h,e)}a.cancel();if((e=Uq.tX)&&0!=e.length)for(g=e.length-1;0<=g;g--){f=e[g];h=A.c.m(f);a:{for(var l=h,n=d;!(n instanceof AdfRichMenuBar);){if(l.g()==n.g()){l=!0;break a}n=n.getParent()}l=!1}l||Uq.h.Jb.call(this,h,f)}}};function Wq(a){return 0<=E.indexOf(Uq.tX,a)?!0:!1}
function Zq(a){var b=q.b,d=b.getElementById(a.g()),e=null;if(a.getParent()instanceof AdfRichMenuBar){a=d.childNodes;for(i=0;i<a.length;i++)"TABLE"==b.Na(a[i])&&(d=a[i]);for(;"TR"!=b.Na(d);)d=8==d.nodeType?d.nextSibling:d.firstChild}d=d.childNodes;for(i=0;i<d.length;i++)a=d[i],"TD"==b.Na(a)&&"popupContainer"==a.getAttribute("_afrClNm")&&(e=a);return e}function Yq(a){var b=Uq.tX;if(b&&0!=b.length)for(var d=b.length-1;0<=d;d--){var e=b[d],f=A.c.m(e);Uq.h.Jb.call(a,f,e)}}
Uq.prototype.$x=function(a){u.u(a);this.Pa&&this.Pa.setAttribute("tabIndex","-1");a.setAttribute("tabIndex","0");this.Pa=a};Uq.prototype.Od=function(a,b,d,e){a=a.g();0>d.indexOf(a)||(d=d.substring(a.length+1),b=d.indexOf(":"),0<b&&(d=d.substring(0,b),a=xa.count(a,":"),e.push([a+1,d])))};r.a("AdfDhtmlMenuBarPeer.prototype.ConvertClientIdToLocator",{Od:Uq.prototype.Od});
Uq.prototype.Sd=function(a,b){var d=a.Cd()[b];if(d){if(d instanceof AdfRichCommandNavigationItem)return d.g();u.assert(!1,"Use of [] locator notation is only supported when menuBar: "+a.g()+" is used with MenuModel")}return null};r.a("AdfDhtmlMenuBarPeer.prototype.convertLocatorToClientId",{Sd:Uq.prototype.Sd});Uq.prototype.Gj=function(a,b,d){Uq.h.Gj.call(this,a,b,d);this.Qk&&this.Va.lk(b)&&this.Va.Baa()};r.a("AdfDhtmlMenuBarPeer.prototype.SimulateMouseOnDescendant",{Gj:Uq.prototype.Gj});