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