//>>built
define("mill/icon",["dijit/_Templated","mill/mill","mill/imageList"],function(){return dojo.declare("mill.icon",[dijit._Widget,dijit._Templated,dijit._CssStateMixin],{templateString:"\x3cdiv\x3e\x26#160;\x3c/div\x3e",imageList:null,imageIndex:"",visible:!0,rotation:null,baseClass:"millIcon",attributeMap:dojo.delegate(dijit._WidgetBase,{imageIndex:"",imageList:"",visible:"",rotation:""}),_setImageIndexAttr:function(d){this.imageIndex=d;this._started&&this.render()},_setImageListAttr:function(d){this.imageList=
d;this._started&&this.render()},_setVisibleAttr:function(d){this.visible=d;this._started&&this.render()},_setRotationAttr:function(d){this.rotation=d;this._started&&this.render()},_vmlShape:null,_vmlFill:null,render:function(){mill.enqueueRender(this)},_render:function(){if(this.imageList){this.domNode&&dojo.style(this.domNode,{width:this.imageList.width+"px",height:this.imageList.height+"px"});var d={padding:0,backgroundAttachment:"scroll"};if(9>=dojo.isIE){var a=dojo.coords(this.domNode);this.domNode.runtimeStyle.cssText=
"";this._vmlShape||(this._vmlShape=document.createElement("v:shape"));this._vmlFill||(this._vmlFill=document.createElement("v:fill"));var b=Number(this.imageList.width)+1,c=Number(this.imageList.height)+1,h=this.domNode.offsetLeft,f=this.domNode.offsetTop,l=1==h+this.domNode.clientLeft?1:0;h=a.l-this.imageList.positionX(this.imageIndex)-h;a=a.t-this.imageList.positionY(this.imageIndex)-f;0===h%2&&h++;0===a%2&&a++;var e=0,k=0;if(this.rotation){e=-parseInt(this.rotation)*Math.PI/180;f=Math.cos(e);var g=
Math.sin(e);e=b*f+c*Math.abs(g)-b+3;k=b*Math.abs(g)+c*f-c+3;this._vmlShape.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11\x3d"+f+",M12\x3d"+-g+",M21\x3d"+g+",M22\x3d"+f+",SizingMethod\x3d'auto expand')"}this._vmlShape.stroked=!1;this._vmlShape.fillcolor="none";this._vmlShape.coordsize=b+","+c;this._vmlShape.coordorigin="1,1";this._vmlShape.path="m0,0l"+b+",0l"+b+","+c+"l0,"+c+" xe";this._vmlShape.style.width=b+"px";this._vmlShape.style.height=c+"px";this._vmlShape.className=this.domNode.className;
this._vmlShape.style.left=this.domNode.style.left;this._vmlShape.style.top=this.domNode.style.top;this._vmlShape.style.right=this.domNode.style.right;this._vmlShape.style.bottom=this.domNode.style.bottom;this._vmlShape.style.clip="rect(1px "+(b+l+e)+"px "+(c+k)+"px "+(1+l)+"px)";this._vmlFill.position=h/b+","+a/c;this._vmlFill.type="tile";this._vmlFill.src=this.imageList.imageUrl;this._vmlFill.on=!0;this._vmlFill.color="none";this._vmlShape.appendChild(this._vmlFill);this.domNode.parentNode.insertBefore(this._vmlShape,
this.domNode);dojo.mixin(d,{behavior:"none",backgroundColor:"transparent"});dojo.connect(this._vmlShape,"onmouseenter",dojo.hitch(this,function(){dojo.addClass(this._vmlShape,this.baseClass+"Hover")}));dojo.connect(this._vmlShape,"onmouseleave",dojo.hitch(this,function(){dojo.removeClass(this._vmlShape,this.baseClass+"Hover")}));dojo.connect(this._vmlShape,"onclick",dojo.hitch(this,function(){this.domNode.fireEvent("onclick")}))}else if(dojo.mixin(d,{backgroundImage:"url("+this.imageList.imageUrl+
")",backgroundColor:"transparent",backgroundPosition:this.imageList.backgroundPosition(this.imageIndex,0,0)}),this.rotation){b=[];for(a=this.domNode;a.style;)"none"==a.style.display&&(b.push(a),a.style.display=""),a=a.parentNode;a=dojo.coords(this.domNode);dojo.forEach(b,function(m){m.style.display="none"});e=-parseInt(this.rotation)*Math.PI*2/360;f=Math.cos(e);g=Math.sin(e);b=this.imageList.width;c=this.imageList.height;e=b*f+c*Math.abs(g)-b;k=b*Math.abs(g)+c*f-c;dojo.mixin(d,{left:a.l+e/2+"px",
top:a.t+k/2+"px",position:"absolute",transform:"rotate("+-this.rotation+"deg)","-webkit-transform":"rotate("+-this.rotation+"deg)"})}this.domNode&&dojo.style(this.domNode,d)}this._vmlShape?(this._vmlShape.style.display=this.visible?"":"none",this.domNode.style.display="none"):this.domNode&&(this.domNode.style.display=this.visible?"":"none")},startup:function(){this.inherited(arguments);this.render()}})});