var Wq=I.ea(I,"AdfDhtmlMenuBarPeer",!1);m("AdfDhtmlMenuBarPeer",Wq);Wq.C=function(){r.bb(Xq);r.bb(W);this.tX=[];I.ra(this,D.Ad,D.Bc,D.hh,D.wb,D.Pc,D.Nd);q.b.Dd()||I.ra(this,D.ze,D.gg)};m("AdfDhtmlMenuBarPeer.InitSubclass",Wq.C);Wq.prototype.G=function(a,b){Wq.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.qr(a));this.lF=f.Cm(f.By(b.getElementsByTagName("table")[0],0));this.Pa=J.oI(b)};
r.a("AdfDhtmlMenuBarPeer.prototype.InitDomElement",{G:Wq.prototype.G});Wq.prototype.ue=function(){return!0};r.a("AdfDhtmlMenuBarPeer.prototype.needsChildVisibilityChanges",{ue:Wq.prototype.ue});Wq.prototype.ya=function(){return!0};r.a("AdfDhtmlMenuBarPeer.prototype.needsResizeNotify",{ya:Wq.prototype.ya});Wq.prototype.Cd=function(a,b){b||(b=[]);Wq.h.Cd.call(this,a,b);1==this.Qk&&rl.osa(a,b);return b};r.a("AdfDhtmlMenuBarPeer.prototype.getDescendantComponents",{Cd:Wq.prototype.Cd});
Wq.prototype.Mm=function(){};r.a("AdfDhtmlMenuBarPeer.prototype.updateScrollIconsState",{Mm:Wq.prototype.Mm});Wq.prototype.bh=function(){this.Pa&&this.Pa.setAttribute("tabIndex","-1");this.Pa=J.oI(this.i())};r.a("AdfDhtmlMenuBarPeer.prototype.resetActiveDescendant",{bh:Wq.prototype.bh});
Wq.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 rl(d,this,"end",null,null,!0),b=q.b,a=b.Cm(b.By(a.getElementsByTagName("table")[0],0)),b=0,d=a[0];d;)this.Va.Mp(),this.Va.addElement(d),d=C.pa(d),Xq.Fta(d)&&(d=this.rF(d),this.Va.Wr(d)),b++,d=a[b];this.Va.te()}this.fX();this.Pa&&(0<this.Pa.offsetWidth||0<this.Pa.offsetHeight)||this.bh()}};r.a("AdfDhtmlMenuBarPeer.prototype.ResizeNotify",{Sa:Wq.prototype.Sa});
Wq.prototype.le=function(){A.c.Kc(this.f());return!1};r.a("AdfDhtmlMenuBarPeer.prototype.ChildVisibilityChanged",{le:Wq.prototype.le});Wq.prototype.yk=function(){if(!this.mu){var a=this.i().firstChild;this.cY();this.Va&&this.Va.iI();this.mu=a.offsetWidth;this.fX()}return this.mu};r.a("AdfDhtmlMenuBarPeer.prototype.GetPreferredWidth",{yk:Wq.prototype.yk});
Wq.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:Wq.prototype.wJ});
Wq.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),Wq.h.ak.call(this,e),Wq.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:Yq(b)?J.dk(l):this.Wn(a,!0);a.cancel();break;case w.vb:(d=J.DO(h,this.Pa))?this.Pa=d:J.ce(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.ce(g,t);a.cancel();break;case w.ab:J.ni(g,t);a.cancel();break;case w.vb:if(Yq(b))J.dk(l);else if(Zq(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.ce(d,e);$q(this)}a.cancel();break;case w.ub:n.getParent()instanceof AdfRichMenuBar?(e=e.getElementById(n.getParent().g()),J.ni(h,e),$q(this)):(J.dk(h),Wq.h.ak.call(this,n)),a.cancel()}}else b.wC()==D.Bc&&this.sp(d,a)}};r.a("AdfDhtmlMenuBarPeer.prototype.HandleComponentKeyDown",{ma:Wq.prototype.ma});Wq.prototype.Yb=function(a){if(!a.Aa()&&q.b.wC()==D.hh){var b=a.na();this.sp(b,a)}};r.a("AdfDhtmlMenuBarPeer.prototype.HandleComponentKeyPress",{Yb:Wq.prototype.Yb});
Wq.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())}Wq.igb(b,a)}};r.a("AdfDhtmlMenuBarPeer.prototype.HandleComponentKeyUp",{za:Wq.prototype.za});Wq.prototype.ka=function(a){this.Va&&(this.Va.Yy(),delete this.Va);delete this.oe;delete this.Mn;delete this.lF;A.c.cp(a);Wq.h.ka.call(this,a)};r.a("AdfDhtmlMenuBarPeer.prototype.ComponentRemoved",{ka:Wq.prototype.ka});Wq.prototype.bd=function(a){this.bind(a);this.Sj=this.mu=null;a=this.bf(a);var b=null!=a?a.o():null;b&&b.bd&&b.bd(a)};
r.a("AdfDhtmlMenuBarPeer.prototype.__preferredSizeChangeNotify",{bd:Wq.prototype.bd});Wq.igb=function(a,b){var d=b.Yg(),e=d.sC();if(!(e&w.pi||e&w.Bo||e&w.Oq)){e&w.Bk&&(e>>=w.Bk,d=w.Yg(d.na(),e));for(var d=d.Qs().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=Wq.prototype;
k.sp=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.Ie),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.ce(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.bh());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.Ao="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:Wq.prototype.fc});
Wq.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:Wq.prototype.$a});Wq.prototype.M=function(a){a.getSource()instanceof AdfRichCommandNavigationItem&&$q(this)};r.a("AdfDhtmlMenuBarPeer.prototype.HandleComponentClick",{M:Wq.prototype.M});
Wq.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.ay(this.Mn):W.lk(d)?(b=J.ym(d))&&this.Va.Vaa(b):W.Ny(b)&&(b=J.ym(d))&&b!=this.Pa&&this.ay(b);a.cancel()};r.a("AdfDhtmlMenuBarPeer.prototype.HandleComponentFocus",{Ta:Wq.prototype.Ta});
Wq.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:Wq.prototype.Lb});
Wq.prototype.ob=function(a,b){if(a instanceof AdfRichCommandNavigationItem){var d=q.b.getElementById(a.g()),e=d,e=ar(a);a.getParent()instanceof AdfRichMenuBar&&C.O(d,W.Ie);b.style.display="none";E.Ig(Wq.tX,a.g());Wq.h.ob.call(this,a,b);e.appendChild(b)}else Wq.h.ob.call(this,a,b)};r.a("AdfDhtmlMenuBarPeer.prototype.PopupClosed",{ob:Wq.prototype.ob});function Zq(a){a=a.getSource();var b=null;ar(a)&&(b=ar(a).lastChild);return b}
Wq.prototype.Wn=function(a,b){var d=a.getSource(),e=d.g(),f=q.b;if(Yq(e))a.cancel();else{var g=Zq(a);if(g){f=f.getElementById(d.g());d.getParent()instanceof AdfRichMenuBar&&C.w(f,W.Ie);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";Wq.tX.push(e);Wq.h.He.call(this,
d,g,h,e)}a.cancel();if((e=Wq.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||Wq.h.Jb.call(this,h,f)}}};function Yq(a){return 0<=E.indexOf(Wq.tX,a)?!0:!1}
function ar(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 $q(a){var b=Wq.tX;if(b&&0!=b.length)for(var d=b.length-1;0<=d;d--){var e=b[d],f=A.c.m(e);Wq.h.Jb.call(a,f,e)}}
Wq.prototype.ay=function(a){u.u(a);this.Pa&&this.Pa.setAttribute("tabIndex","-1");a.setAttribute("tabIndex","0");this.Pa=a};Wq.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:Wq.prototype.Od});
Wq.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:Wq.prototype.Sd});Wq.prototype.Gj=function(a,b,d){Wq.h.Gj.call(this,a,b,d);this.Qk&&this.Va.lk(b)&&this.Va.Daa()};r.a("AdfDhtmlMenuBarPeer.prototype.SimulateMouseOnDescendant",{Gj:Wq.prototype.Gj});