var $o=M.U(M,"AdfDhtmlMenuBarPeer",p);v("AdfDhtmlMenuBarPeer",$o);$o.m=function(){z.kb(ap);z.kb(W);this.UP=[];M.ha(this,I.qd,I.ec,I.Wf,I.jb,I.tc,I.Dd);w.b.cd()[w.Vc]==w.Wc&&M.ha(this,I.Qd,I.Ve)};v("AdfDhtmlMenuBarPeer.InitSubclass",$o.m);$o.prototype.q=function(a,b){$o.f.q.call(this,a,b);var d=a.e(),e=M.g(d,"eoc"),f=w.b;this.Gj=(this.Hd=f.getElementById(e))?l:p;this.Gj==l&&(e=M.g(d,"eoi"),this.Dl=f.getElementById(e),F.c.Go(a));this.HA=f.Sk(f.Su(b.getElementsByTagName("table")[0],0));this.ya=O.pD(b)};
z.a("AdfDhtmlMenuBarPeer.prototype.InitDomElement",{q:$o.prototype.q});$o.prototype.Md=t(l);z.a("AdfDhtmlMenuBarPeer.prototype.needsChildVisibilityChanges",{Md:$o.prototype.Md});$o.prototype.ja=t(l);z.a("AdfDhtmlMenuBarPeer.prototype.needsResizeNotify",{ja:$o.prototype.ja});$o.prototype.ce=function(a,b){b||(b=[]);$o.f.ce.call(this,a,b);this.Gj==l&&Oi.rga(a,b);return b};z.a("AdfDhtmlMenuBarPeer.prototype.getDescendantComponents",{ce:$o.prototype.ce});$o.prototype.Vn=ca();
z.a("AdfDhtmlMenuBarPeer.prototype.updateScrollIconsState",{Vn:$o.prototype.Vn});$o.prototype.kg=function(){this.ya&&this.ya.setAttribute("tabIndex","-1");this.ya=O.pD(this.h())};z.a("AdfDhtmlMenuBarPeer.prototype.resetActiveDescendant",{kg:$o.prototype.kg});
$o.prototype.Ia=function(){var a=this.h(),b=this.d(),d=b.e();if(this.Gj!=p||b.getStretchId()){this.uQ();if(this.Gj==l){if(!this.Fa){this.Fa=new Oi(d,this,"end",n,n,l);b=w.b;a=b.Sk(b.Su(a.getElementsByTagName("table")[0],0));b=0;for(d=a[0];d;)this.Fa.un(),this.Fa.addElement(d),d=H.ca(d),ap.sha(d)&&(d=this.MA(d),this.Fa.lp(d)),b++,d=a[b]}this.Fa.Nf()}this.JP();(!this.ya||!(0<this.ya.offsetWidth||0<this.ya.offsetHeight))&&this.kg()}};z.a("AdfDhtmlMenuBarPeer.prototype.ResizeNotify",{Ia:$o.prototype.Ia});
$o.prototype.Ed=function(){F.c.jc(this.d());return p};z.a("AdfDhtmlMenuBarPeer.prototype.ChildVisibilityChanged",{Ed:$o.prototype.Ed});$o.prototype.nj=function(){if(!this.Ar){var a=this.h().firstChild;this.uQ();this.Fa&&this.Fa.kD();this.Ar=a.offsetWidth;this.JP()}return this.Ar};z.a("AdfDhtmlMenuBarPeer.prototype.GetPreferredWidth",{nj:$o.prototype.nj});
$o.prototype.iE=function(){if(!this.Si)if(this.Gj==p)this.Si=this.nj();else if(this.HA&&0<this.HA.length){var a=this.Dl.style.display;this.Dl.style.display="block";this.Si=this.Dl.offsetWidth;this.Dl.style.display=a;a=this.nj();this.Si>a&&(this.Si=a)}else this.Si=0;return this.Si};z.a("AdfDhtmlMenuBarPeer.prototype.GetMinimumWidth",{iE:$o.prototype.iE});
$o.prototype.ba=function(a){if(!a.na()){var b=w.b,d=a.ia(),e=a.getSource();if(e instanceof AdfRichCommandNavigationItem){d==E.xh&&e.getParent()instanceof AdfRichCommandNavigationItem&&(b=b.getElementById(e.getParent().e()),O.Sj(b),$o.f.Wi.call(this,e),$o.f.Wi.call(this,e.getParent()),a.cancel());var e=w.b,f=a.getSource(),b=f.e(),g=e.getElementById(b),h=M.g(b,"menu"),m=e.getElementById(h),q=f.getParent(),s=q.e(),h=e.getElementById(s),s=M.g(s,"menu"),s=e.getElementById(s);if(q instanceof AdfRichMenuBar){if(e=
a.L(),!e.ctrlKey&&!e.altKey&&!e.shiftKey&&!e.metaKey)switch(d){case E.Ja:bp(b)?O.Sj(m):this.Jl(a,l);a.cancel();break;case E.Lb:(d=O.BI(h,this.ya))?this.ya=d:O.Ud(this.ya);a.cancel();break;case E.Kb:(d=O.CI(h,this.ya))?this.ya=d:O.Qh(this.ya),a.cancel()}}else switch(d){case E.Ja:O.Ud(g,s);a.cancel();break;case E.Ya:O.Qh(g,s);a.cancel();break;case E.Lb:if(bp(b))O.Sj(m);else if(cp(a))this.Jl(a,l);else{for(b=f;!(b.getParent()instanceof AdfRichMenuBar);)b=b.getParent();d=e.getElementById(b.e());e=e.getElementById(b.getParent().e());
O.Ud(d,e);dp(this)}a.cancel();break;case E.Kb:q.getParent()instanceof AdfRichMenuBar?(e=e.getElementById(q.getParent().e()),O.Qh(h,e),dp(this)):(O.Sj(h),$o.f.Wi.call(this,q)),a.cancel()}}else b.oy()==I.ec&&this.Ak(d,a)}};z.a("AdfDhtmlMenuBarPeer.prototype.HandleComponentKeyDown",{ba:$o.prototype.ba});$o.prototype.zb=function(a){if(!a.na()&&w.b.oy()==I.Wf){var b=a.ia();this.Ak(b,a)}};z.a("AdfDhtmlMenuBarPeer.prototype.HandleComponentKeyPress",{zb:$o.prototype.zb});
$o.prototype.pa=function(a){var b=this.d();if(!a.na()&&!b.getDisabled()){var d=a.getSource(),e=a.ia();if(d instanceof AdfRichCommandNavigationItem&&e==E.$a){var f=w.b,g=f.getElementById(d.e()),e=g.getAttribute("href"),f=f.w().location.href,h=f.indexOf("#"),f=-1==h?f:f.substring(0,h);e&&(-1==e.indexOf(f)||1<e.substring(e.indexOf("#")).length)?(F.c.hd(l,l,l,"User click Command Navigation , GET request"),d=g.getAttribute("target"),d!=n&&0<d.length?window.open(e,d):self.location=e,a.cancel()):bb.v(d,
d.getPartialSubmit())}$o.GWa(b,a)}};z.a("AdfDhtmlMenuBarPeer.prototype.HandleComponentKeyUp",{pa:$o.prototype.pa});$o.prototype.Z=function(a){this.Fa&&(this.Fa.lv(),delete this.Fa);delete this.Hd;delete this.Dl;delete this.HA;F.c.Nm(a);$o.f.Z.call(this,a)};z.a("AdfDhtmlMenuBarPeer.prototype.ComponentRemoved",{Z:$o.prototype.Z});$o.prototype.uc=function(a){this.bind(a);this.Si=this.Ar=n;a=this.Ee(a);var b=a!=n?a.k():n;b&&b.uc&&b.uc(a)};
z.a("AdfDhtmlMenuBarPeer.prototype.__preferredSizeChangeNotify",{uc:$o.prototype.uc});$o.GWa=function(a,b){var d=b.gg(),e=d.k0();if(!(e&E.uh||e&E.lm||e&E.mo)){e&E.qj&&(e>>=E.qj,d=E.gg(d.ia(),e));for(var d=d.eq().toUpperCase(),e=a.e(),e=w.b.getElementById(e).getElementsByTagName("A"),f=e.length,g=0;g<f;g++){var h=e[g];if(h&&1==h.nodeType){var m=h.getAttribute("accessKey");if(m&&d==m.toUpperCase()){O.ra(h);b.cancel();break}}}}};u=$o.prototype;
u.Ak=function(a,b){var d=b.L();if(!d.ctrlKey&&!d.altKey&&!d.shiftKey&&!d.metaKey){var d=b.getSource().k().h(),e=b.getSource();if(W.ej(d))switch(a){case E.Lb:e instanceof AdfRichMenu&&(e.k().show(n,l),b.cancel());break;case E.Ya:this.Fa.O_(this.Hd);b.cancel();break;case E.Ja:this.Fa.N_(this.Hd),b.cancel()}else switch(a){case E.Ja:e instanceof AdfRichMenu&&(H.n(d,W.Bf),e.k().show(n,l),b.cancel());break;case E.Kb:this.Ow()&&(d=this.h(),(d=O.CI(d,this.ya))?this.ya=d:O.Qh(this.ya));b.cancel();break;case E.Lb:this.Ow()&&
(d=this.h(),(d=O.BI(d,this.ya))?this.ya=d:O.Ud(this.ya)),b.cancel()}}};u.Ow=function(){B.p(this.ya);B.assert("0"==this.ya.getAttribute("tabindex"),"The menuBar's active descendant should have tabindex 0");this.ya||(D.i.warning("MenuBar has lost its assigned activeDescendant!"),this.kg());return this.ya!=n};u.uQ=function(){var a=this.CG();a&&(a.parentNode.style.width="")};
u.JP=function(){var a=this.CG();if(a)if(W.ej(a))a.parentNode.style.width="100%";else{var b=w.b.getWindowWidth()+"px";a.parentNode.style.width=b}};u.MA=function(a){var b=a.ownerDocument.createElement("table");b.cellPadding=0;b.cellSpacing=0;b.style.width="100%";b.setAttribute("role","presentation");var d=b.insertRow(-1).insertCell(-1);d.style.width="100%";d.setAttribute(W.Tz,"true");d.setAttribute("role","presentation");H.n(d,W.fL);a=this.Fa.OQ(a);d.appendChild(a);return b};
u.CG=function(){var a=this.d(),b=a.getStretchId();if(b){if(a=a.j(b))return b=a.e(),w.b.getElementById(b);D.i.warning("Unable to find client component for stretch id "+b)}return n};u.vb=function(a){a=a.getSource();a instanceof AdfRichCommandNavigationItem&&a.getParent()instanceof AdfRichCommandNavigationItem&&a.k().h().blur()};z.a("AdfDhtmlMenuBarPeer.prototype.HandleComponentMouseOut",{vb:$o.prototype.vb});
$o.prototype.Ka=function(a){var b=a.getSource();b instanceof AdfRichCommandNavigationItem?(b.k().focus(b),this.Jl(a,n)):a.cancel();a.na()};z.a("AdfDhtmlMenuBarPeer.prototype.HandleComponentMouseOver",{Ka:$o.prototype.Ka});$o.prototype.C=function(a){a.getSource()instanceof AdfRichCommandNavigationItem&&dp(this)};z.a("AdfDhtmlMenuBarPeer.prototype.HandleComponentClick",{C:$o.prototype.C});
$o.prototype.Ha=function(a){var b=a.getSource(),d=b.e(),d=w.b.getElementById(d),e=a.L(),e=w.b.T(e);b instanceof AdfRichCommandNavigationItem&&H.n(d,W.Pg);e==this.Dl?this.ya!=e&&this.tu(this.Dl):W.ej(d)?(b=O.Zl(d))&&this.Fa.u2(b):W.cv(b)&&(b=O.Zl(d))&&b!=this.ya&&this.tu(b);a.cancel()};z.a("AdfDhtmlMenuBarPeer.prototype.HandleComponentFocus",{Ha:$o.prototype.Ha});
$o.prototype.Eb=function(a){var b=a.getSource();b instanceof AdfRichCommandNavigationItem?(b=w.b.getElementById(b.e()),H.F(b,W.Pg)):a.cancel();a.na()};z.a("AdfDhtmlMenuBarPeer.prototype.HandleComponentBlur",{Eb:$o.prototype.Eb});
$o.prototype.Va=function(a,b){if(a instanceof AdfRichCommandNavigationItem){var d=w.b.getElementById(a.e()),e=d,e=ep(a);a.getParent()instanceof AdfRichMenuBar&&H.F(d,W.Bf);b.style.display="none";ya.Of($o.UP,a.e());$o.f.Va.call(this,a,b);e.appendChild(b)}else $o.f.Va.call(this,a,b)};z.a("AdfDhtmlMenuBarPeer.prototype.PopupClosed",{Va:$o.prototype.Va});function cp(a){a=a.getSource();var b=n;ep(a)&&(b=ep(a).lastChild);return b}
$o.prototype.Jl=function(a,b){var d=a.getSource(),e=d.e(),f=w.b;if(bp(e))a.cancel();else{var g=cp(a);if(g){f=f.getElementById(d.e());d.getParent()instanceof AdfRichMenuBar&&H.n(f,W.Bf);var h={},m=w.b.getElementById(d.e());h.type="menu";h.autodismiss="autodismissMenu";h.alignElement=f;h.focus=b?l:p;h.closeOnEscape=p;d.getParent()instanceof AdfRichCommandNavigationItem||W.ej(m)?h[AdfRichPopup.fd]=AdfRichPopup.bz:h[AdfRichPopup.fd]=AdfRichPopup.of;g.style.display="block";$o.UP.push(e);$o.f.fe.call(this,
d,g,h,e)}a.cancel();if((e=$o.UP)&&0!=e.length)for(g=e.length-1;0<=g;g--){f=e[g];h=F.c.j(f);a:{for(var m=h,q=d;!(q instanceof AdfRichMenuBar);){if(m.e()==q.e()){m=l;break a}q=q.getParent()}m=p}m||$o.f.ob.call(this,h,f)}}};function bp(a){return 0<=ya.indexOf($o.UP,a)?l:p}
function ep(a){var b=w.b,d=b.getElementById(a.e()),e=n;if(a.getParent()instanceof AdfRichMenuBar){a=d.childNodes;for(i=0;i<a.length;i++)"TABLE"==b.Ga(a[i])&&(d=a[i]);for(;"TR"!=b.Ga(d);)d=8==d.nodeType?d.nextSibling:d.firstChild}d=d.childNodes;for(i=0;i<d.length;i++)a=d[i],"TD"==b.Ga(a)&&"popupContainer"==a.getAttribute("_afrClNm")&&(e=a);return e}function dp(a){var b=$o.UP;if(b&&0!=b.length)for(var d=b.length-1;0<=d;d--){var e=b[d],f=F.c.j(e);$o.f.ob.call(a,f,e)}}
$o.prototype.tu=function(a){B.p(a);this.ya&&this.ya.setAttribute("tabIndex","-1");a.setAttribute("tabIndex","0");this.ya=a};$o.prototype.Fd=function(a,b,d,e){a=a.e();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])))};z.a("AdfDhtmlMenuBarPeer.prototype.ConvertClientIdToLocator",{Fd:$o.prototype.Fd});
$o.prototype.Jd=function(a,b){var d=a.ce()[b];if(d){if(d instanceof AdfRichCommandNavigationItem)return d.e();B.assert(p,"Use of [] locator notation is only supported when menuBar: "+a.e()+" is used with MenuModel")}return n};z.a("AdfDhtmlMenuBarPeer.prototype.convertLocatorToClientId",{Jd:$o.prototype.Jd});$o.prototype.Ki=function(a,b,d){$o.f.Ki.call(this,a,b,d);this.Gj&&this.Fa.ej(b)&&this.Fa.a2()};z.a("AdfDhtmlMenuBarPeer.prototype.SimulateMouseOnDescendant",{Ki:$o.prototype.Ki});