/*
	Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/


window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojox.drawing.ui.dom.Toolbar"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.drawing.ui.dom.Toolbar"]){_4._hasResource["dojox.drawing.ui.dom.Toolbar"]=true;_4.provide("dojox.drawing.ui.dom.Toolbar");_4.deprecated("dojox.drawing.ui.dom.Toolbar","It may not even make it to the 1.4 release.",1.4);(function(){_4.declare("dojox.drawing.ui.dom.Toolbar",[],{baseClass:"drawingToolbar",buttonClass:"drawingButton",iconClass:"icon",constructor:function(_7,_8){_4.addOnLoad(this,function(){this.domNode=_4.byId(_8);_4.addClass(this.domNode,this.baseClass);this.parse();});},createIcon:function(_9,_a){var _b=_a&&_a.setup?_a.setup:{};if(_b.iconClass){var _c=_b.iconClass?_b.iconClass:"iconNone";var _d=_b.tooltip?_b.tooltip:"Tool";var _e=_4.create("div",{title:_d},_9);_4.addClass(_e,this.iconClass);_4.addClass(_e,_c);_4.connect(_9,"mouseup",function(_f){_4.stopEvent(_f);_4.removeClass(_9,"active");});_4.connect(_9,"mouseover",function(evt){_4.stopEvent(evt);_4.addClass(_9,"hover");});_4.connect(_9,"mousedown",this,function(evt){_4.stopEvent(evt);_4.addClass(_9,"active");});_4.connect(_9,"mouseout",this,function(evt){_4.stopEvent(evt);_4.removeClass(_9,"hover");});}},createTool:function(_10){_10.innerHTML="";var _11=_4.attr(_10,"tool");this.toolNodes[_11]=_10;_4.attr(_10,"tabIndex",1);var _12=_4.getObject(_11);this.createIcon(_10,_12);this.drawing.registerTool(_11,_12);_4.connect(_10,"mouseup",this,function(evt){_4.stopEvent(evt);_4.removeClass(_10,"active");this.onClick(_11);});_4.connect(_10,"mouseover",function(evt){_4.stopEvent(evt);_4.addClass(_10,"hover");});_4.connect(_10,"mousedown",this,function(evt){_4.stopEvent(evt);_4.addClass(_10,"active");});_4.connect(_10,"mouseout",this,function(evt){_4.stopEvent(evt);_4.removeClass(_10,"hover");});},parse:function(){var _13=_4.attr(this.domNode,"drawingId");this.drawing=_6.drawing.util.common.byId(_13);!this.drawing&&console.error("Drawing not found based on 'drawingId' in Toolbar. ");this.toolNodes={};var _14;_4.query(">",this.domNode).forEach(function(_15,i){_15.className=this.buttonClass;var _16=_4.attr(_15,"tool");var _17=_4.attr(_15,"action");var _18=_4.attr(_15,"plugin");if(_16){if(i==0||_4.attr(_15,"selected")=="true"){_14=_16;}this.createTool(_15);}else{if(_18){var p={name:_18,options:{}},opt=_4.attr(_15,"options");if(opt){p.options=eval("("+opt+")");}p.options.node=_15;_15.innerHTML="";this.drawing.addPlugin(p);this.createIcon(_15,_4.getObject(_4.attr(_15,"plugin")));}}},this);this.drawing.initPlugins();_4.connect(this.drawing,"setTool",this,"onSetTool");this.drawing.setTool(_14);},onClick:function(_19){this.drawing.setTool(_19);},onSetTool:function(_1a){for(var n in this.toolNodes){if(n==_1a){_4.addClass(this.toolNodes[_1a],"selected");this.toolNodes[_1a].blur();}else{_4.removeClass(this.toolNodes[n],"selected");}}}});})();}}};});