//>>built
define("dojox/widget/rotator/Controller","dojo/_base/declare dojo/_base/lang dojo/_base/html dojo/_base/event dojo/_base/array dojo/_base/connect dojo/query".split(" "),function(n,p,f,q,r,l,e){return n("dojox.widget.rotator.Controller",null,{rotator:null,commands:"prev,play/pause,info,next",constructor:function(a,d){p.mixin(this,a);var b=this.rotator;if(b){for(;d.firstChild;)d.removeChild(d.firstChild);var k=this._domNode=f.create("ul",null,d),h=function(g,m,c){f.create("li",{className:m,innerHTML:'\x3ca href\x3d"#"\x3e\x3cspan\x3e'+
g+"\x3c/span\x3e\x3c/a\x3e",onclick:function(t){q.stop(t);b&&b.control.apply(b,c)}},k)};r.forEach(this.commands.split(","),function(g,m){switch(g){case "prev":h("Prev","dojoxRotatorPrev dojoxRotatorIcon",["prev"]);break;case "play/pause":h("Play","dojoxRotatorPlay dojoxRotatorIcon",["play"]);h("Pause","dojoxRotatorPause dojoxRotatorIcon",["pause"]);break;case "info":this._info=f.create("li",{className:"dojoxRotatorInfo",innerHTML:this._buildInfo(b)},k);break;case "next":h("Next","dojoxRotatorNext dojoxRotatorIcon",
["next"]);break;case "#":case "titles":for(var c=0;c<b.panes.length;c++)h("#"==g?c+1:b.panes[c].title||"Tab "+(c+1),("#"==g?"dojoxRotatorNumber":"dojoxRotatorTab")+" "+(c==b.idx?"dojoxRotatorSelected":"")+" dojoxRotatorPane"+c,["go",c])}},this);e("li:first-child",k).addClass("dojoxRotatorFirst");e("li:last-child",k).addClass("dojoxRotatorLast");this._togglePlay();this._con=l.connect(b,"onUpdate",this,"_onUpdate")}},destroy:function(){l.disconnect(this._con);f.destroy(this._domNode)},_togglePlay:function(a){a=
this.rotator.playing;e(".dojoxRotatorPlay",this._domNode).style("display",a?"none":"");e(".dojoxRotatorPause",this._domNode).style("display",a?"":"none")},_buildInfo:function(a){return"\x3cspan\x3e"+(a.idx+1)+" / "+a.panes.length+"\x3c/span\x3e"},_onUpdate:function(a){var d=this.rotator;switch(a){case "play":case "pause":this._togglePlay();break;case "onAfterTransition":this._info&&(this._info.innerHTML=this._buildInfo(d)),a=function(b){d.idx<b.length&&f.addClass(b[d.idx],"dojoxRotatorSelected")},
a(e(".dojoxRotatorNumber",this._domNode).removeClass("dojoxRotatorSelected")),a(e(".dojoxRotatorTab",this._domNode).removeClass("dojoxRotatorSelected"))}}})});