(function(){var q=YAHOO.util.Event,s=YAHOO.util.Dom,AJ=YAHOO.lang,e=YAHOO.env.ua,D=YAHOO.widget.Panel,g=YAHOO.widget.Tooltip,F=YAHOO.widget.Module.prototype,AH=F.initDefaultConfig,w=F._initResizeMonitor,G=YAHOO.widget.Overlay.prototype,j=G.showIframe,y,A,m=false,X,p,B=false,z={},AB={},T="aria-",AI="role",u="presentation",i="usearia",l="blur",AF="focus",b="visible",W="beforeHide",o="dialog",Z="describedby",AA="context",I="hidden",J="container-close",R="a",v="href",M="button",AK="keydown",L="beforeShow",AE="close",V="alertdialog",Y="labelledby",U="xy",f="tooltip",t="destroy";var O=function(AL,AM){AL.setAttribute(AI,AM);};var Q=function(AL,AN,AM){AL.setAttribute((T+AN),AM);};AJ.augmentObject(F,{_initResizeMonitor:function(){w.call(this);var AL=this.resizeMonitor;if(AL){O(AL,u);AL.tabIndex=-1;}},configUseARIA:function(AM,AL){},configDescribedBy:function(AN,AM){var AL=AM[0];if(this.cfg.getProperty(i)&&AL){Q(this.element,Z,AL);}},configLabelledBy:function(AN,AM){var AL=AM[0];if(this.cfg.getProperty(i)&&AL){Q(this.element,Y,AL);}},initDefaultConfig:function(){this.cfg.addProperty(i,{handler:this.configUseARIA,value:(e.gecko&&e.gecko>=1.9)||(e.ie&&e.ie>=8),validator:AJ.isBoolean});this.cfg.addProperty(Y,{handler:this.configLabelledBy,validator:AJ.isString});this.cfg.addProperty(Z,{handler:this.configDescribedBy,validator:AJ.isString});AH.call(this);}},"initDefaultConfig","configUseARIA","configLabelledBy","configDescribedBy","_initResizeMonitor");G.showIframe=function(){j.call(this);var AL=this.iframe;if(this.cfg.getProperty(i)&&AL&&!AL.getAttribute(AI)){O(AL,u);AL.tabIndex=-1;}};var H=function(AM){var AL=q.getCharCode(AM);if(AL===27){if(this.cancel){this.cancel();}else{this.hide();}}};var N=function(AL){this.fireEvent(AF,AL);};var AD=function(AL){this.fireEvent(l,AL);};var AG=function(AN,AM){var AL=AM[0];if(p._manageFocus(this)){if(this.cfg.getProperty(b)&&this.focusFirst){if(!AL){this.focusFirst();}}}};var C=function(AN,AM){var AL=AM[0];if(p._manageBlur(this)&&!AL){this.fireEvent(l);}};var d=function(AN,AL,AM){this.blur();if(AM&&AM.focus){try{AM.focus();}catch(AO){}}this.unsubscribe(W,d,AM);};var P=function(){this.subscribe(W,d,X);};var E=function(){var AL=this.cfg.getProperty(AI)===o?this.innerElement:this.body;Q(AL,I,!this.cfg.getProperty(b));};var S=function(){s.getElementsByClassName(J,R,this.element,function(AL){AL.removeAttribute(v);O(AL,M);AL.tabIndex=0;});};var x=function(AM,AL){var AN=AL[0];if(AN){S.call(this);}};if(D){y=D.prototype;A=y.initDefaultConfig;AJ.augmentObject(y,{hasFocus:function(){return(p&&this===p.getActive());},configUseARIA:function(AN,AM){var AL=AM[0];if(AL){if(!p){p=new YAHOO.widget.OverlayManager();}p.register(this);this.focus=function(){if(!this.hasFocus()){this.fireEvent(AF);}};this.blur=function(){if(this.hasFocus()){this.fireEvent(l);}};q.onFocus(this.element,N,null,this);q.onBlur(this.element,AD,null,this);this.subscribe(AF,AG);this.subscribe(l,C);q.on(this.element,AK,H,null,this);this.subscribe(L,P);E.call(this);this.cfg.subscribeToConfigEvent(b,E);this.cfg.subscribeToConfigEvent(AE,x);if(!m){q.onFocus(document,function(AO){X=q.getTarget(AO);});m=true;}}},configDescribedBy:function(AO,AM){var AL=AM[0],AN;if(this.cfg.getProperty(i)&&AL){AN=this.cfg.getProperty(AI)===o?this.innerElement:this.body;Q(AN,Z,AL);}},configLabelledBy:function(AO,AM){var AL=AM[0],AN;if(this.cfg.getProperty(i)&&AL){AN=this.cfg.getProperty(AI)===o?this.innerElement:this.body;Q(AN,Y,AL);}},configRole:function(AQ,AN){var AP=AN[0],AO,AL,AM;if(AP){switch(AP){case o:AO=this.innerElement;break;case V:AO=this.body;break;}if(AO){O(AO,AP);AL=this.header;AM=AL.id||s.generateId(AL);this.cfg.setProperty(Y,AM);S.call(this);}}},initDefaultConfig:function(){A.call(this);this.cfg.addProperty(AI,{handler:this.configRole,value:o,validator:AJ.isString});}},"initDefaultConfig","configRole","configUseARIA","configLabelledBy","configDescribedBy","hasFocus");}var K=function(AN){var AL=q.getTarget(AN),AO=AB[AL.id],AM;if(AO){AM=s.getXY(AL);AO.cfg.setProperty(U,[AM[0],(AM[1]+AL.offsetHeight+5)]);AO.show();}};var h=function(AM){var AL=q.getTarget(AM),AN=AB[AL.id];if(AN&&AN.cfg.getProperty(b)){AN.hide();}};var r=function(AM){var AL=AM.id,AN=AB[AL];if(AN===this){delete AB[AL];AM.removeAttribute(Z);}};var c=function(){var AM=this.element.id,AL=z[AM];s.batch(AL,r,this,true);z[AM]=null;};var k=function(AM){var AL=AM.id||s.generateId(AM);AB[AL]=this;Q(AM,Z,this.element.id);};var a=function(){var AL=this.cfg.getProperty(AA);s.batch(AL,k,this,true);z[this.element.id]=AL;};var n=function(AN,AL){c.call(this);var AM=AL[0];if(AM){a.call(this);}};var AC=function(){Q(this.body,I,!this.cfg.getProperty(b));};if(g){g.prototype.configUseARIA=function(AN,AM){var AL=AM[0];if(AL){O(this.body,f);this.cfg.subscribeToConfigEvent(AA,n);AC.call(this);this.cfg.subscribeToConfigEvent(b,AC);this.subscribe(t,c);if(!B){q.onFocus(document,K);q.onBlur(document,h);B=true;}}};}}());