var Pi=M.U(M,"AdfDhtmlButtonPeer");v("AdfDhtmlButtonPeer",Pi);Pi.m=function(){M.ha(this,I.ec,I.jb,I.Xc,I.Xf);w.b.cd()[w.Vc]==w.Wc&&M.ha(this,I.Qd,I.Ve);M.hb(this,AdfRichButton.DISABLED,AdfRichButton.SELECTED,AdfRichButton.SHORT_DESC,AdfRichButton.TEXT);M.$b(this,AdfRichButton.TEXT);this.jM="popEl";this.hM="popCtr";this.iM="popArea";this.Y6="popup";this.rf="_afrPopId";this.yL="_afrGrp";this.Zf="p_AFDepressed";this.ii="p_AFSelected";this.ve="_busy"};v("AdfDhtmlButtonPeer.InitSubclass",Pi.m);
Pi.prototype.Za=function(a,b){Pi.f.Za.call(this,a,b);this.CA=H.ta(b,"p_AFActionDisabled")};z.a("AdfDhtmlButtonPeer.prototype.BindToComponent",{Za:Pi.prototype.Za});Pi.prototype.ba=function(a){if(!a.na()){var b=a.ia();if(this.Bl(a)){var d=this.an(),e=this.CA&&(b==E.$a||b==E.zd);b==E.Ja||e?this.uP(d,l,a):b==E.zd&&(this.d().getDestination()!=n?(this.bX(a),Qi(this,f)):this.aX(),a.cancel())}if(b==E.xh){var f=this.d();d||(d=f.e());this.ob(f,d)}}};
z.a("AdfDhtmlButtonPeer.prototype.HandleComponentKeyDown",{ba:Pi.prototype.ba});Pi.prototype.C=function(a){if(a.Jb()&&!this.CA&&!this.SO(a)&&this.Bl(a)){var b=this.d(),d=b.r(Pi.ve);!b.getDisabled()&&!d&&(this.d().getDestination()!=n?(this.bX(a),Qi(this,b)):this.aX())}};z.a("AdfDhtmlButtonPeer.prototype.HandleComponentClick",{C:Pi.prototype.C});Pi.prototype.Ka=function(a){!this.d().getDisabled()&&this.Bl(a)&&this.wk(this.d())};z.a("AdfDhtmlButtonPeer.prototype.HandleComponentMouseOver",{Ka:Pi.prototype.Ka});
Pi.prototype.vb=function(a){var b=this.d();!b.getDisabled()&&this.Bl(a)&&(b.getSelected()?(this.Hb(b,l),this.vk(b)):(this.Hb(b,p),this.Gh(b)))};z.a("AdfDhtmlButtonPeer.prototype.HandleComponentMouseOut",{vb:Pi.prototype.vb});Pi.prototype.cc=function(a){var b=this.d();!b.getDisabled()&&(a.Jb()&&this.Bl(a))&&(this.Hb(b,p),this.wk(b))};z.a("AdfDhtmlButtonPeer.prototype.HandleComponentMouseUp",{cc:Pi.prototype.cc});
Pi.prototype.qa=function(a){var b=this.d(),d=a.Jb();if(!b.getDisabled()&&(d&&this.Bl(a))&&(this.Hb(b,l),this.vk(b),this.CA||this.SO(a)))b=this.an(),this.uP(b,p,a)};z.a("AdfDhtmlButtonPeer.prototype.HandleComponentMouseDown",{qa:Pi.prototype.qa});Pi.prototype.Od=function(a,b,d){var e=H.Ua(b,"A");d==l?(H.n(b,M.gb),e.removeAttribute("href"),this.Yw(a),this.TB(a),e.setAttribute(O.Jg,"false")):(H.F(b,M.gb),e.setAttribute("href","#"),this.Gh(a),this.IB(a),e.setAttribute(O.Jg,"true"))};
z.a("AdfDhtmlButtonPeer.prototype.ComponentDisabledChanged",{Od:Pi.prototype.Od});Pi.prototype.Zn=function(a,b,d){var e=a.getType();d?(this.Hb(a,l),H.n(b,Pi.ii),this.vk(a),"radio"==e&&(this.Px(),this.n$(a)),"check"==e&&this.o$(a)):(this.Hb(a,p),H.F(b,Pi.ii),this.Gh(a),"radio"==e&&this.U9(a),"check"==e&&this.V9(a))};z.a("AdfDhtmlButtonPeer.prototype.ComponentSelectedChanged",{Zn:Pi.prototype.Zn});
Pi.prototype.Jv=function(a,b,d){b.setAttribute("title",d);if(a=this.zk(a))a.setAttribute("title",d),a.setAttribute("alt",d)};z.a("AdfDhtmlButtonPeer.prototype.ComponentShortDescChanged",{Jv:Pi.prototype.Jv});Pi.prototype.Qf=H.yA;Pi.prototype.Aa=function(){return ng.Hc()};z.a("AdfDhtmlButtonPeer.prototype.GetInlineEditor",{Aa:Pi.prototype.Aa});
Pi.prototype.Xb=function(a,b){var d=M.g(a.e(),Pi.iM);if(d=(d=w.b.getElementById(d))?H.nc(d):b){if(d=H.Ua(d,"span"))if(d=w.b.Mb(d),""!=d)return d;return n}B.assert(p,"Unable to find the element containing the text")};z.a("AdfDhtmlButtonPeer.prototype.GetComponentText",{Xb:Pi.prototype.Xb});Pi.prototype.Va=function(a,b,d){Pi.f.Va.call(this,a,b);a=a.e();d==a&&(d=M.Na(a,Pi.hM),(d=w.b.getElementById(d))&&d.appendChild(b))};z.a("AdfDhtmlButtonPeer.prototype.PopupClosed",{Va:Pi.prototype.Va});
Pi.prototype.gd=function(a){var b=this.d(),d=this.h();H.Se(d)&&(!b.getDisabled()&&!F.c.Dg())&&(H.td(a,d,M.gb),b.setProperty(Pi.ve,a,p,J.Pc))};z.a("AdfDhtmlButtonPeer.prototype.SetBusy",{gd:Pi.prototype.gd});Pi.prototype.od=function(){var a=this.d();return a&&a.r(Pi.ve)};z.a("AdfDhtmlButtonPeer.prototype.isBusy",{od:Pi.prototype.od});Pi.prototype.uc=function(a){this.bind(a);a=this.Ee(a);var b=a!=n?a.k():n;b&&b.uc&&b.uc(a)};z.a("AdfDhtmlButtonPeer.prototype.__preferredSizeChangeNotify",{uc:Pi.prototype.uc});
u=Pi.prototype;u.aX=function(){var a=this.d(),b=new bb(a);b.v(a.getPartialSubmit());b.na()||Qi(this,a)};u.bX=function(a){var b=this.h(),b=H.Ua(b,"a"),d=b.getAttribute("href");if(d==n||""==d)a.cancel();else{var e=w.b.w().location.href,f=e.indexOf("#");if(-1==d.indexOf(-1==f?e:e.substring(0,f))||1<d.substring(d.indexOf("#")).length)d=b.getAttribute("target"),F.c.zA(b.attributes.href.value,d),a.cancel()}};
function Qi(a,b){var d=b.getType();"check"==d?b.setSelected(!b.getSelected()):"radio"==d&&a.Px()}
u.uP=function(a,b,d){var e=this.d(),f=e.e(),g=M.Na(f,Pi.jM);if(w.b.getElementById(g))if(g=this.h(),a!=n)e=F.c.j(a).k(),a={},a.alignElement=g,a[AdfRichPopup.fd]=AdfRichPopup.of,a.focus=b,e.show(a),d.cancel();else{a=M.Na(f,Pi.hM);var h=w.b.getElementById(a);if(h!=n){for(var m=h.firstChild;m&&8==m.nodeType;)m=m.nextSibling;if(m!=n){a={};var q=M.Na(f,Pi.Y6);m.id!=q&&(h=h.ownerDocument.createElement("div"),h.appendChild(m),m=h,m.id=q);a.autodismiss="autodismissAlways";a.alignElement=g;a[AdfRichPopup.fd]=
AdfRichPopup.of;a.focus=b;this.fe(e,m,a,f);d.cancel()}}}};u.Px=function(){for(var a=this.d(),b=this.h(),b=this.Pt(b),d=a.getParent(),d=d.k().ce(d),e=0;e<d.length;e++){var f=d[e],g=M.Ib(f),g=this.Pt(g);b==g&&f!=a&&(f.getType&&"radio"==f.getType())&&this.Rda(f)}a.setSelected(l)};u.Pt=function(a){return a.getAttribute(Pi.yL)};u.Rda=function(a){a.setSelected(p);this.Hb(a,p);this.Gh(a)};u.zk=function(a){a=a.e();a=M.Na(a,"icon");return w.b.getElementById(a)};u.Gh=function(a){this.$c(a,n)};
u.vk=function(a){this.$c(a,a.getDepressedIcon())};u.wk=function(a){a.getSelected()||this.$c(a,a.getHoverIcon())};u.Yw=function(a){this.$c(a,a.getDisabledIcon())};u.$c=function(a,b){var d=a.getIcon(),e=this.zk(a);e&&d&&(e.src=b||d)};u.Hb=function(a,b){var d=M.Ib(a),e=Pi.Zf;b?H.n(d,e):H.F(d,e)};u.SO=function(a){var b=this.d().e(),d=M.Na(b,Pi.iM);for(a=a.Q();a!=n&&a.id!=b;){if(a.id==d)return l;a=a.parentNode}return p};
u.an=function(){var a=this.d(),a=M.Na(a.e(),Pi.jM),a=w.b.getElementById(a);if(!a)return n;var a=a.parentNode,b=a.getAttribute(Pi.rf);b==n&&(b=a.parentNode.getAttribute(Pi.rf));return b};u.Bl=function(a){var b=a.Q();a=this.an();for(var d=a!=n,e=this.h();b.parentNode&&!(d&&a==b.id);b=b.parentNode)if(b==e)return l;return p};u.o$=function(){var a=this.h();"A"!=a.tagName&&(a=H.qc(a,"a",0));a.setAttribute("aria-pressed","true")};
u.V9=function(){var a=this.h();"A"!=a.tagName&&(a=H.qc(a,"a",0));a.setAttribute("aria-pressed","false")};u.n$=function(){var a=this.h();"A"!=a.tagName&&(a=H.qc(a,"a",0));var b="button"==a.getAttribute("role").toLowerCase()?"aria-pressed":"aria-checked";a.setAttribute(b,"true")};u.U9=function(){var a=this.h();"A"!=a.tagName&&(a=H.qc(a,"a",0));var b="button"==a.getAttribute("role").toLowerCase()?"aria-pressed":"aria-checked";a.setAttribute(b,"false")};
u.TB=function(){var a=this.h();"A"!=a.tagName&&(a=H.qc(a,"a",0));a.setAttribute("aria-disabled","true")};u.IB=function(){var a=this.h();"A"!=a.tagName&&(a=H.qc(a,"a",0));a.removeAttribute("aria-disabled")};