/*
	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.gfx.gradutils"],["require","dojox.gfx.matrix"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.gfx.gradutils"]){_4._hasResource["dojox.gfx.gradutils"]=true;_4.provide("dojox.gfx.gradutils");_4.require("dojox.gfx.matrix");(function(){var d=_4,m=_6.gfx.matrix,C=d.Color;function _7(o,c){if(o<=0){return c[0].color;}var _8=c.length;if(o>=1){return c[_8-1].color;}for(var i=0;i<_8;++i){var _9=c[i];if(_9.offset>=o){if(i){var _a=c[i-1];return d.blendColors(new C(_a.color),new C(_9.color),(o-_a.offset)/(_9.offset-_a.offset));}return _9.color;}}return c[_8-1].color;};_6.gfx.gradutils.getColor=function(_b,pt){var o;if(_b){switch(_b.type){case "linear":var _c=Math.atan2(_b.y2-_b.y1,_b.x2-_b.x1),_d=m.rotate(-_c),_e=m.project(_b.x2-_b.x1,_b.y2-_b.y1),p=m.multiplyPoint(_e,pt),_f=m.multiplyPoint(_e,_b.x1,_b.y1),pf2=m.multiplyPoint(_e,_b.x2,_b.y2),_10=m.multiplyPoint(_d,pf2.x-_f.x,pf2.y-_f.y).x,o=m.multiplyPoint(_d,p.x-_f.x,p.y-_f.y).x/_10;break;case "radial":var dx=pt.x-_b.cx,dy=pt.y-_b.cy,o=Math.sqrt(dx*dx+dy*dy)/_b.r;break;}return _7(o,_b.colors);}return new C(_b||[0,0,0,0]);};_6.gfx.gradutils.reverse=function(_11){if(_11){switch(_11.type){case "linear":case "radial":_11=_4.delegate(_11);if(_11.colors){var c=_11.colors,l=c.length,i=0,_12,n=_11.colors=new Array(c.length);for(;i<l;++i){_12=c[i];n[i]={offset:1-_12.offset,color:_12.color};}n.sort(function(a,b){return a.offset-b.offset;});}break;}}return _11;};})();}}};});