/*
	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.util.common"],["require","dojox.math.round"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.drawing.util.common"]){_4._hasResource["dojox.drawing.util.common"]=true;_4.provide("dojox.drawing.util.common");_4.require("dojox.math.round");(function(){var _7={};var _8=0;_6.drawing.util.common={radToDeg:function(n){return (n*180)/Math.PI;},degToRad:function(n){return (n*Math.PI)/180;},angle:function(_9,_a){if(_a){_a=_a/180;var _b=this.radians(_9),_c=Math.PI*_a,_d=_6.math.round(_b/_c),_e=_d*_c;return _6.math.round(this.radToDeg(_e));}else{return this.radToDeg(this.radians(_9));}},oppAngle:function(_f){(_f+=180)>360?_f=_f-360:_f;return _f;},radians:function(o){return Math.atan2(o.start.y-o.y,o.x-o.start.x);},length:function(o){return Math.sqrt(Math.pow(o.start.x-o.x,2)+Math.pow(o.start.y-o.y,2));},lineSub:function(x1,y1,x2,y2,amt){var len=this.distance(this.argsToObj.apply(this,arguments));len=len<amt?amt:len;var pc=(len-amt)/len;var x=x1-(x1-x2)*pc;var y=y1-(y1-y2)*pc;return {x:x,y:y};},argsToObj:function(){var a=arguments;if(a.length<4){return a[0];}return {start:{x:a[0],y:a[1]},x:a[2],y:a[3]};},distance:function(){var o=this.argsToObj.apply(this,arguments);return Math.abs(Math.sqrt(Math.pow(o.start.x-o.x,2)+Math.pow(o.start.y-o.y,2)));},slope:function(p1,p2){if(!(p1.x-p2.x)){return 0;}return ((p1.y-p2.y)/(p1.x-p2.x));},pointOnCircle:function(cx,cy,_10,_11){var _12=_11*Math.PI/180;var x=_10*Math.cos(_12);var y=_10*Math.sin(_12);return {x:cx+x,y:cy-y};},constrainAngle:function(obj,min,max){var _13=this.angle(obj);if(_13>=min&&_13<=max){return obj;}var _14=this.length(obj);var _15=_13>max?max:min-_13<100?min:max;return this.pointOnCircle(obj.start.x,obj.start.y,_14,_15);},snapAngle:function(obj,ca){var _16=this.radians(obj),_17=this.length(obj),seg=Math.PI*ca,rnd=Math.round(_16/seg),_18=rnd*seg,_19=this.radToDeg(_18),pt=this.pointOnCircle(obj.start.x,obj.start.y,_17,_19);return pt;},idSetStart:function(num){_8=num;},uid:function(str){str=str||"shape";_7[str]=_7[str]===undefined?_8:_7[str]+1;return str+_7[str];},abbr:function(_1a){return _1a.substring(_1a.lastIndexOf(".")+1).charAt(0).toLowerCase()+_1a.substring(_1a.lastIndexOf(".")+2);},mixin:function(o1,o2){},objects:{},register:function(obj){this.objects[obj.id]=obj;},byId:function(id){return this.objects[id];},attr:function(_1b,_1c,_1d,_1e){if(!_1b){return false;}try{if(_1b.shape&&_1b.util){_1b=_1b.shape;}if(!_1d&&_1c=="id"&&_1b.target){var n=_1b.target;while(!_4.attr(n,"id")){n=n.parentNode;}return _4.attr(n,"id");}if(_1b.rawNode||_1b.target){var _1f=Array.prototype.slice.call(arguments);_1f[0]=_1b.rawNode||_1b.target;return _4.attr.apply(_4,_1f);}return _4.attr(_1b,"id");}catch(e){if(!_1e){}return false;}}};})();}}};});