//>>built
define("mill/animatedMill",["mill/mill"],function(){window.mill||(mill={});dojo.declare("mill.animatedMill",[dijit._Widget,dijit._Templated],{templateString:dojo.cache("mill","animatedMill.html",'\x3cdiv class\x3d"animatedMill" xmlns:v\x3d"urn:schemas-microsoft-com:vml"\x3e\x3cdiv class\x3d"animatedMillDial" dojoAttachPoint\x3d"dialNode" style\x3d"display:none"\x3e\x3ccanvas dojoAttachPoint\x3d"canvasNode" height\x3d"156" style\x3d"position:absolute;left:8px;top:-8;width:192px;height:156px" width\x3d"192"\x3e\x3c/canvas\x3e\x3ccanvas dojoAttachPoint\x3d"traceCanvasNode" height\x3d"156" style\x3d"position:absolute;left:8px;top:-8;width:192px;height:156px" width\x3d"192"\x3e\x3c/canvas\x3e\x3cv:image coordsize\x3d"21600,21600" dojoAttachPoint\x3d"vmlNode" style\x3d"left: 0px; width: 192px; position: absolute; top: 0px; height: 156px"\x3e\x3c/v:image\x3e\x3cv:image coordsize\x3d"21600,21600" dojoAttachPoint\x3d"vmlTraceNode" style\x3d"display:none; left: 0px; width: 192px; position: absolute; top: 0px; height: 156px"\x3e\x3c/v:image\x3e\x3c/div\x3e\x3cdiv class\x3d"animatedMillContent" dojoAttachPoint\x3d"containerNode"\x3e\x3c/div\x3e\x3c/div\x3e'),
attributeMap:dojo.delegate(dijit._WidgetBase,{active:""}),active:!0,_setActiveAttr:function(a){(this.active=a)&&!this._tickInterval&&(this._tickInterval=setInterval(dojo.hitch(this,this._tick),30));!this.active&&this._tickInterval&&clearInterval(this._tickInterval)},_Angle:0,_Increment:.1,_image:null,_traceImage:null,_context:null,_traceContext:null,_canvasCoords:null,prepareCanvas:function(){this._context=this.canvasNode.getContext("2d");this._traceContext=this.traceCanvasNode.getContext("2d");this._image=
new Image;this._image.onload=dojo.hitch(this,function(){this.dialNode.style.display=""});this._image.src=dojo.moduleUrl("mill","animatedMillWings.png");this._traceImage=new Image;this._traceImage.src=dojo.moduleUrl("mill","animatedMillTrace.png")},rotateVML:function(){var a=Math.sin(this._Angle),c=Math.cos(this._Angle),b=this._canvasCoords.w/2-85,d=this._canvasCoords.h/2-74;dojo.style(this.vmlNode,{rotation:Math.round(180*this._Angle/Math.PI)+"deg",left:b*c-d*a-10+"px",top:b*a+d*c-7+"px"});9==dojo.isIE&&
dojo.style(this.vmlTraceNode,{rotation:Math.round(180*this._Angle/Math.PI)+"deg",left:b*c-d*a-10+"px",top:b*a+d*c-7+"px",filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity\x3d"+100*(.1+a/2)+")"});this.dialNode.style.display=""},prepareVML:function(){this.vmlNode.src=dojo.moduleUrl("mill","animatedMillWings.png");9<=dojo.isIE&&(this.vmlTraceNode.src=dojo.moduleUrl("mill","animatedMillTrace.png"),this.vmlTraceNode.style.display="")},rotateCanvas:function(){var a=Math.sin(this._Angle),c=Math.cos(this._Angle);
dojo.forEach([{c:this._context,i:this._image},{c:this._traceContext,i:this._traceImage}],dojo.hitch(this,function(b){b.c.clearRect(2*-this._canvasCoords.w,2*-this._canvasCoords.h,4*this._canvasCoords.w,4*this._canvasCoords.h);b.c.rotate(this._Increment);b.c.drawImage(b.i,85*c+74*a-85,-85*a+74*c-74,this._canvasCoords.w,this._canvasCoords.h)}));this.traceCanvasNode.style.opacity=.1+a/2},_tickInterval:null,_tick:function(){this._Angle+=this._Increment;this._Angle>2*Math.PI&&(this._Angle-=2*Math.PI);
this.canvasNode?this.rotateCanvas():this.vmlNode&&this.rotateVML()},startup:function(){this.inherited(arguments);this._canvasCoords={h:156,w:192};this.canvasNode?(this.prepareCanvas(),this.rotateCanvas()):this.vmlNode&&(this.prepareVML(),this.rotateVML());this.active&&(this._tickInterval=setInterval(dojo.hitch(this,this._tick),45))}})});