//>>built
define("mill/ToolBar","mill/mill mill/imageList mill/icon dijit/_Widget dijit/layout/_LayoutWidget dijit/layout/_ContentPaneResizeMixin dijit/_Container dijit/_Templated dojo/fx".split(" "),function(){dojo.declare("mill.ToolBarContainer",[dijit._Widget,dijit.layout._LayoutWidget,dijit.layout._ContentPaneResizeMixin,dijit._Templated],{baseClass:"toolBarContainer",imageList:"",templateString:dojo.cache("mill","toolBarContainer.html",'\x3cdiv\x3e\x3cdiv dojoattachpoint\x3d"containerNode"\x3e\x3c/div\x3e\x3cdiv class\x3d"clear"\x3e\x3c/div\x3e\x3c/div\x3e'),
resize:function(){this.inherited(arguments);var a=dojo.contentBox(this.domNode).w,b=parseInt(a/this.getChildren().length);dojo.forEach(this.getChildren(),dojo.hitch(this,function(c){var g=c.attr("_fullWidth");c.attr("currentWidth",g>b?b:g);a-=c.attr("currentWidth")}));var d=dojo.filter(this.getChildren(),function(c){return c.attr("_collapsed")});for(b=parseInt(a/d.length);0<d.length&&0<a&&0<b;){for(var f in d){var e=d[f].attr("_fullWidth")-d[f].attr("currentWidth");e=e>b?b:e;d[f].attr("currentWidth",
d[f].attr("currentWidth")+e);a-=e}d=dojo.filter(this.getChildren(),function(c){return c.attr("_collapsed")});b=parseInt(a/d.length)}dojo.forEach(this.getChildren(),function(c){dojo.marginBox(c.domNode,{w:c.attr("currentWidth")-.2});dojo.marginBox(c.containerWrapper,{w:dojo.contentBox(c.domNode).w});dojo.style(c.containerNode,{left:0});c._setScrollVisibility()});dojo.style(this.domNode,{height:dojo.marginBox(this.getChildren()[0].domNode).h+"px"})},startup:function(){this.inherited(arguments);6==dojo.isIE&&
dojo.connect(window,"resize",dojo.hitch(this,function(){this.resize()}))}});dojo.declare("mill.ToolBarPane",[dijit._Widget,dijit._Container,dijit._Contained,dijit._Templated],{templateString:dojo.cache("mill","toolBarPane.html",'\x3cdiv dojoattachevent\x3d"onmousedown: _onMouseDown" unselectable\x3d"on"\x3e\x3cdiv class\x3d"containerWrapper" dojoattachpoint\x3d"containerWrapper"\x3e\x3cdiv class\x3d"pane-container" dojoattachpoint\x3d"containerNode"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"scrollButton scrollButtonLeft" dojoattachevent\x3d"onclick: _scrollLeft" dojoattachpoint\x3d"scrollLeftButton"\x3e\x3c/div\x3e\x3cdiv class\x3d"scrollButton scrollButtonRight" dojoattachevent\x3d"onclick: _scrollRight" dojoattachpoint\x3d"scrollRightButton"\x3e\x3c/div\x3e\x3c/div\x3e'),
baseClass:"toolBarPane",color:"",currentWidth:"",_fullWidth:"",_collapsed:!1,_setCurrentWidthAttr:function(a){this.currentWidth=a;this.attr("_collapsed",this._fullWidth>this.currentWidth)},buildRendering:function(){this.inherited(arguments);switch(this.color){case "blue":dojo.addClass(this.domNode,"toolBarPaneBlue");dojo.addClass(this.scrollLeftButton,"scrollButtonBlueLeft");dojo.addClass(this.scrollRightButton,"scrollButtonBlueRight");break;case "red":dojo.addClass(this.domNode,"toolBarPaneRed");
dojo.addClass(this.scrollLeftButton,"scrollButtonRedLeft");dojo.addClass(this.scrollRightButton,"scrollButtonRedRight");break;case "green":dojo.addClass(this.domNode,"toolBarPaneGreen");dojo.addClass(this.scrollLeftButton,"scrollButtonGreenLeft");dojo.addClass(this.scrollRightButton,"scrollButtonGreenRight");break;default:dojo.addClass(this.domNode,"toolBarPaneGrey"),dojo.addClass(this.scrollLeftButton,"scrollButtonGreyLeft"),dojo.addClass(this.scrollRightButton,"scrollButtonGreyRight")}},resize:function(){this.inherited(arguments);
!this._fullWidth&&0<dojo.contentBox(this.domNode).w&&(this._fullWidth=dojo.marginBox(this.domNode).w)},_setScrollVisibility:function(){dojo.style(this.scrollLeftButton,{display:0==parseInt(dojo.style(this.containerNode).left)?"none":"block"});dojo.style(this.scrollRightButton,{display:parseInt(dojo.style(this.containerNode).left)==-(this._fullWidth-dojo.marginBox(this.domNode).w+24)?"none":"block"});this._fullWidth&&this._collapsed&&dojo.style(this.containerWrapper,{marginLeft:"16px"})&&dojo.style(this.containerWrapper,
{marginRight:"16px"});!this._collapsed&&dojo.style(this.scrollLeftButton,{display:"none"})&&dojo.style(this.scrollRightButton,{display:"none"})&&dojo.style(this.containerWrapper,{marginLeft:"4px"})&&dojo.style(this.containerWrapper,{marginRight:"4px"})},_scrollLeft:function(){dojo.fx.slideTo({node:this.containerNode,top:0,left:0<parseInt(dojo.style(this.containerNode).left)+60?0:parseInt(dojo.style(this.containerNode).left)+60,onBegin:dojo.hitch(this,function(){dojo.addClass(this.scrollLeftButton,
"scrollButtonLeftClick")}),onEnd:dojo.hitch(this,function(){dojo.removeClass(this.scrollLeftButton,"scrollButtonLeftClick");this._setScrollVisibility()})}).play()},_scrollRight:function(){var a=-(this._fullWidth-dojo.marginBox(this.domNode).w+24);dojo.fx.slideTo({node:this.containerNode,top:0,left:parseInt(dojo.style(this.containerNode).left)-60<a?a:parseInt(dojo.style(this.containerNode).left)-60,onBegin:dojo.hitch(this,function(){dojo.addClass(this.scrollRightButton,"scrollButtonRightClick")}),
onEnd:dojo.hitch(this,function(){dojo.removeClass(this.scrollRightButton,"scrollButtonRightClick");this._setScrollVisibility()})}).play()},_onMouseDown:function(a){a.preventDefault()}});dojo.declare("mill.ToolBarButton",[dijit._Widget,dijit._Contained,dijit._Templated],{baseClass:"toolBarButton",templateString:dojo.cache("mill","ToolBarButton.html",'\x3cdiv dojoAttachEvent\x3d"onclick: onClick, onmouseover: _onMouseOver, onmouseout: _onMouseOut"\x3e\x3cdiv class\x3d"iconWrapper"\x3e\x3cdiv dojoattachpoint\x3d"icon" dojotype\x3d"mill.icon" imageIndex\x3d"${imageIndex}"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv dojoattachpoint\x3d"labelNode"\x3e ${label} \x3c/div\x3e\x3c/div\x3e'),
widgetsInTemplate:!0,label:"",imageIndex:"",onClick:new Function,_setLabelAttr:{node:"labelNode",type:"innerHTML"},postMixInProperties:function(){this.inherited(arguments);for(var a=[],b=0;b<this.label.length;b++)this.label.substr(b,1).match(/\s/)&&a.push(b);var d=this.label.length;for(b in a)this.label.length/2-a[b]<d&&(d=a[b]);0<a.length&&12<this.label.length&&(this.label=this.label.substr(0,d)+"\x3cbr/\x3e"+this.label.substr(parseInt(d)+1))},buildRendering:function(){this.inherited(arguments);
dojo.style(this.labelNode,{lineHeight:this.label.match(/<br\/>/g)?1.2:2.4})},postCreate:function(){this.inherited(arguments);var a=this.getParent().getParent().imageList;a&&dijit.byId(a)&&this.imageIndex&&this.icon.attr("imageList",dijit.byId(a))},_onMouseOver:function(){dojo.addClass(this.domNode,"toolBarButtonHover")},_onMouseOut:function(){dojo.removeClass(this.domNode,"toolBarButtonHover")}})});