/*
	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.gradient"],["require","dojox.gfx.matrix"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.gfx.gradient"]){_4._hasResource["dojox.gfx.gradient"]=true;_4.provide("dojox.gfx.gradient");_4.require("dojox.gfx.matrix");(function(){var d=_4,m=_6.gfx.matrix,C=d.Color;_6.gfx.gradient.rescale=function(_7,_8,to){var _9=_7.length,_a=(to<_8),_b;if(_a){var _c=_8;_8=to;to=_c;}if(!_9){return [];}if(to<=_7[0].offset){_b=[{offset:0,color:_7[0].color},{offset:1,color:_7[0].color}];}else{if(_8>=_7[_9-1].offset){_b=[{offset:0,color:_7[_9-1].color},{offset:1,color:_7[_9-1].color}];}else{var _d=to-_8,_e,_f,i;_b=[];if(_8<0){_b.push({offset:0,color:new C(_7[0].color)});}for(i=0;i<_9;++i){_e=_7[i];if(_e.offset>=_8){break;}}if(i){_f=_7[i-1];_b.push({offset:0,color:d.blendColors(new C(_f.color),new C(_e.color),(_8-_f.offset)/(_e.offset-_f.offset))});}else{_b.push({offset:0,color:new C(_e.color)});}for(;i<_9;++i){_e=_7[i];if(_e.offset>=to){break;}_b.push({offset:(_e.offset-_8)/_d,color:new C(_e.color)});}if(i<_9){_f=_7[i-1];_b.push({offset:1,color:d.blendColors(new C(_f.color),new C(_e.color),(to-_f.offset)/(_e.offset-_f.offset))});}else{_b.push({offset:1,color:new C(_7[_9-1].color)});}}}if(_a){_b.reverse();for(i=0,_9=_b.length;i<_9;++i){_e=_b[i];_e.offset=1-_e.offset;}}return _b;};function _10(x,y,_11,_12,_13,_14){var r=m.multiplyPoint(_11,x,y),p=m.multiplyPoint(_12,r);return {r:r,p:p,o:m.multiplyPoint(_13,p).x/_14};};function _15(a,b){return a.o-b.o;};_6.gfx.gradient.project=function(_16,_17,tl,rb,ttl,trb){_16=_16||m.identity;var f1=m.multiplyPoint(_16,_17.x1,_17.y1),f2=m.multiplyPoint(_16,_17.x2,_17.y2),_18=Math.atan2(f2.y-f1.y,f2.x-f1.x),_19=m.project(f2.x-f1.x,f2.y-f1.y),pf1=m.multiplyPoint(_19,f1),pf2=m.multiplyPoint(_19,f2),_1a=new m.Matrix2D([m.rotate(-_18),{dx:-pf1.x,dy:-pf1.y}]),_1b=m.multiplyPoint(_1a,pf2).x,_1c=[_10(tl.x,tl.y,_16,_19,_1a,_1b),_10(rb.x,rb.y,_16,_19,_1a,_1b),_10(tl.x,rb.y,_16,_19,_1a,_1b),_10(rb.x,tl.y,_16,_19,_1a,_1b)].sort(_15),_1d=_1c[0].o,to=_1c[3].o,_1e=_6.gfx.gradient.rescale(_17.colors,_1d,to),_1f=Math.atan2(_1c[3].r.y-_1c[0].r.y,_1c[3].r.x-_1c[0].r.x);return {type:"linear",x1:_1c[0].p.x,y1:_1c[0].p.y,x2:_1c[3].p.x,y2:_1c[3].p.y,colors:_1e,angle:_18};};})();}}};});