(function(){var t=YAHOO.util.Event,u=YAHOO.util.Dom,AB=YAHOO.lang,k=YAHOO.env.ua,AD=YAHOO.widget.Carousel.prototype,P=AD.initAttributes,O={},o={},a=(k.gecko&&k.gecko>=1.9)||(k.ie&&k.ie>=8),p={"A":true,"SELECT":true,"TEXTAREA":true,"BUTTON":true,"INPUT":true},n="usearia",W="aria-",I="hidden",i="*",e="id",AA="role",j="option",r="listbox",b="li",d="selectedItem",A="selected",R="toolbar",AC="keydown",v="presentation",N="button",f="UL",V="A",c="render",G="selectedItemChange",D="show",K="pageChange",L="keypress",B="controls",Z="labelledby",Y="describedby",H=" (Current Page)";var S=function(AE,AF){AE.setAttribute(AA,AF);};var U=function(AE,AG,AF){AE.setAttribute((W+AG),AF);};var s=function(){var AE=this.getElementsByClassName(this.CLASSES.CAROUSEL_EL);if(AE.length===1){return AE[0];}};var J=function(){var AE=this.getElementsByClassName(this.CLASSES.NAVIGATION);if(AE.length===1){return AE[0];}};var x=function(AE){return((AE.tabIndex>-1||p[AE.nodeName.toUpperCase()])&&AE.type!==I&&!AE.disabled);};var C=function(AE){AE.tabIndex=0;};var w=function(AE){AE.tabIndex=-1;};var h=function(AE){var AF=this.getItem(AE);if(AF){u.getElementsBy(x,i,AF.id,C);}};var y=function(AE){var AF=this.getItem(AE);if(AF){u.getElementsBy(x,i,AF.id,w);}};var g=function(AF){var AE=AF.prevValue;if(AB.isNumber(AE)){y.call(this,AE);}h.call(this,AF.newValue);U(this.getElementForItem(AF.newValue),A,true);};var M=function(AJ){t.stopPropagation(AJ);var AI=this.get(e),AH=O[AI],AG=o[AI],AF,AE;switch(t.getCharCode(AJ)){case 37:case 38:AE=AH[AG];AE.tabIndex=-1;AG=AG-1;AF=AH[AG];if(!AF){AG=AH.length-1;AF=AH[AG];}o[AI]=AG;AF.tabIndex=0;AF.focus();break;case 39:case 40:AE=AH[AG];AE.tabIndex=-1;AG=AG+1;AF=AH[AG];if(!AF){AG=0;AF=AH[AG];}o[AI]=AG;AF.tabIndex=0;AF.focus();break;}};var q=function(AE){S(AE,j);u.getElementsBy(x,i,AE,w);};var E=function(){var AG=s.call(this),AF,AE;if(AG){S(AG,r);u.batch(AG.getElementsByTagName(b),q);AF=this.get(d);if(AB.isNumber(AF)){U(this.getElementForItem(AF),A,true);h.call(this,AF);}AE=J.call(this);if(AE){S(AE,R);t.on(AE,AC,M,null,this);}}};var X=function(AJ,AH){var AL=AH.carousel,AF=AH.toolbarButtons;S(AJ,v);var AK=u.getFirstChild(AJ);S(AK,N);U(AK,B,AH.listID);var AI=u.hasClass(AJ,AL.CLASSES.SELECTED_NAV)?0:-1;AK.tabIndex=AI;var AG=AF.length,AE=u.getFirstChild(AK);if(AI===0){o[AL.get(e)]=AG;AE.innerHTML=AE.innerHTML+H;}AF[AG]=AK;};var Q=function(AF,AE){var AG=AE.toolbarButtons;S(AF,v);U(AF,B,AE.listID);var AH=u.getFirstChild(AF);if(!AH.disabled){AH.tabIndex=-1;AG[AG.length]=AH;}};var m=function(AH){var AF=J.call(this),AE=[],AJ,AI,AG;if(AF){AJ=u.getFirstChild(AF);AI=s.call(this);if(AJ&&AI){AG=AI.id||u.generatId(AI);if(AJ.nodeName.toUpperCase()===f){S(AJ,v);u.batch(AJ.getElementsByTagName(b),X,{carousel:this,toolbarButtons:AE,listID:AG});}else{AJ.tabIndex=0;U(AJ,B,AG);}u.batch(this.getElementsByClassName(this.CLASSES.BUTTON),Q,{toolbarButtons:AE,listID:AG});O[this.get(e)]=AE;}}};var l=function(){AB.later(0,this,m);};var z=function(AG){var AE=t.getTarget(AG),AF=t.getCharCode(AG);if(AE.nodeName.toUpperCase()===V&&u.getAncestorByClassName(AE,this.CLASSES.NAVIGATION)&&(AF===13||AF===32)){this._pagerClickHandler(AG);}};var F=function(AE,AF){this.set(Z,AF,true);this.removeListener(c,F);};var T=function(AE,AF){this.set(Y,AF,true);this.removeListener(c,T);};AB.augmentObject(AD,{_setLabelledBy:function(AG){var AE=J.call(this),AF=s.call(this);if(this.get(n)&&AE&&AF){U(AE,Z,AG);U(AF,Z,AG);}else{this.on(c,F,AG);}},_setDescribedBy:function(AG){var AE=J.call(this),AF=s.call(this);if(this.get(n)&&AE&&AF){U(AE,Y,AG);U(AF,Y,AG);}else{this.on(c,T,AG);}},_setUseARIA:function(AE){if(AE){this.on(c,E);this.on(G,g);this.on(D,m);this.on(K,l);this.on(L,z);}},initAttributes:function(AE){this.setAttributeConfig(n,{value:AE.usearia||a,validator:AB.isBoolean,writeOnce:true,method:this._setUseARIA});this.setAttributeConfig(Z,{value:AE.labelledby,validator:AB.isString,method:this._setLabelledBy});this.setAttributeConfig(Y,{value:AE.describedby,validator:AB.isString,method:this._setDescribedBy});P.apply(this,arguments);if(a){this.set(n,true);}}},"initAttributes","_setUseARIA","_setLabelledBy","_setDescribedBy");}());YAHOO.register("carouselariaplugin",YAHOO.widget.Carousel,{version:"@VERSION@",build:"@BUILD@"});