/*
	Copyright (c) 2004-2009, 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
*/

/*
	This is a compiled version of Dojo, built for deployment and not for
	development. To get an editable version, please visit:

		http://dojotoolkit.org

	for documentation and information on getting the source.
*/

if(!dojo._hasResource["dojox.gfx.matrix"]){dojo._hasResource["dojox.gfx.matrix"]=true;dojo.provide("dojox.gfx.matrix");(function(){var m=dojox.gfx.matrix;m._degToRad=function(_2){return Math.PI*_2/180;};m._radToDeg=function(_3){return _3/Math.PI*180;};m.Matrix2D=function(_4){if(_4){if(typeof _4=="number"){this.xx=this.yy=_4;}else{if(_4 instanceof Array){if(_4.length>0){var _5=m.normalize(_4[0]);for(var i=1;i<_4.length;++i){var l=_5,r=dojox.gfx.matrix.normalize(_4[i]);_5=new m.Matrix2D();_5.xx=l.xx*r.xx+l.xy*r.yx;_5.xy=l.xx*r.xy+l.xy*r.yy;_5.yx=l.yx*r.xx+l.yy*r.yx;_5.yy=l.yx*r.xy+l.yy*r.yy;_5.dx=l.xx*r.dx+l.xy*r.dy+l.dx;_5.dy=l.yx*r.dx+l.yy*r.dy+l.dy;}dojo.mixin(this,_5);}}else{dojo.mixin(this,_4);}}}};dojo.extend(m.Matrix2D,{xx:1,xy:0,yx:0,yy:1,dx:0,dy:0});dojo.mixin(m,{identity:new m.Matrix2D(),flipX:new m.Matrix2D({xx:-1}),flipY:new m.Matrix2D({yy:-1}),flipXY:new m.Matrix2D({xx:-1,yy:-1}),translate:function(a,b){if(arguments.length>1){return new m.Matrix2D({dx:a,dy:b});}return new m.Matrix2D({dx:a.x,dy:a.y});},scale:function(a,b){if(arguments.length>1){return new m.Matrix2D({xx:a,yy:b});}if(typeof a=="number"){return new m.Matrix2D({xx:a,yy:a});}return new m.Matrix2D({xx:a.x,yy:a.y});},rotate:function(_d){var c=Math.cos(_d);var s=Math.sin(_d);return new m.Matrix2D({xx:c,xy:-s,yx:s,yy:c});},rotateg:function(_10){return m.rotate(m._degToRad(_10));},skewX:function(_11){return new m.Matrix2D({xy:Math.tan(_11)});},skewXg:function(_12){return m.skewX(m._degToRad(_12));},skewY:function(_13){return new m.Matrix2D({yx:Math.tan(_13)});},skewYg:function(_14){return m.skewY(m._degToRad(_14));},reflect:function(a,b){if(arguments.length==1){b=a.y;a=a.x;}var a2=a*a,b2=b*b,n2=a2+b2,xy=2*a*b/n2;return new m.Matrix2D({xx:2*a2/n2-1,xy:xy,yx:xy,yy:2*b2/n2-1});},project:function(a,b){if(arguments.length==1){b=a.y;a=a.x;}var a2=a*a,b2=b*b,n2=a2+b2,xy=a*b/n2;return new m.Matrix2D({xx:a2/n2,xy:xy,yx:xy,yy:b2/n2});},normalize:function(_21){return (_21 instanceof m.Matrix2D)?_21:new m.Matrix2D(_21);},clone:function(_22){var obj=new m.Matrix2D();for(var i in _22){if(typeof (_22[i])=="number"&&typeof (obj[i])=="number"&&obj[i]!=_22[i]){obj[i]=_22[i];}}return obj;},invert:function(_25){var M=m.normalize(_25),D=M.xx*M.yy-M.xy*M.yx,M=new m.Matrix2D({xx:M.yy/D,xy:-M.xy/D,yx:-M.yx/D,yy:M.xx/D,dx:(M.xy*M.dy-M.yy*M.dx)/D,dy:(M.yx*M.dx-M.xx*M.dy)/D});return M;},_multiplyPoint:function(_28,x,y){return {x:_28.xx*x+_28.xy*y+_28.dx,y:_28.yx*x+_28.yy*y+_28.dy};},multiplyPoint:function(_2b,a,b){var M=m.normalize(_2b);if(typeof a=="number"&&typeof b=="number"){return m._multiplyPoint(M,a,b);}return m._multiplyPoint(M,a.x,a.y);},multiply:function(_2f){var M=m.normalize(_2f);for(var i=1;i<arguments.length;++i){var l=M,r=m.normalize(arguments[i]);M=new m.Matrix2D();M.xx=l.xx*r.xx+l.xy*r.yx;M.xy=l.xx*r.xy+l.xy*r.yy;M.yx=l.yx*r.xx+l.yy*r.yx;M.yy=l.yx*r.xy+l.yy*r.yy;M.dx=l.xx*r.dx+l.xy*r.dy+l.dx;M.dy=l.yx*r.dx+l.yy*r.dy+l.dy;}return M;},_sandwich:function(_34,x,y){return m.multiply(m.translate(x,y),_34,m.translate(-x,-y));},scaleAt:function(a,b,c,d){switch(arguments.length){case 4:return m._sandwich(m.scale(a,b),c,d);case 3:if(typeof c=="number"){return m._sandwich(m.scale(a),b,c);}return m._sandwich(m.scale(a,b),c.x,c.y);}return m._sandwich(m.scale(a),b.x,b.y);},rotateAt:function(_3b,a,b){if(arguments.length>2){return m._sandwich(m.rotate(_3b),a,b);}return m._sandwich(m.rotate(_3b),a.x,a.y);},rotategAt:function(_3e,a,b){if(arguments.length>2){return m._sandwich(m.rotateg(_3e),a,b);}return m._sandwich(m.rotateg(_3e),a.x,a.y);},skewXAt:function(_41,a,b){if(arguments.length>2){return m._sandwich(m.skewX(_41),a,b);}return m._sandwich(m.skewX(_41),a.x,a.y);},skewXgAt:function(_44,a,b){if(arguments.length>2){return m._sandwich(m.skewXg(_44),a,b);}return m._sandwich(m.skewXg(_44),a.x,a.y);},skewYAt:function(_47,a,b){if(arguments.length>2){return m._sandwich(m.skewY(_47),a,b);}return m._sandwich(m.skewY(_47),a.x,a.y);},skewYgAt:function(_4a,a,b){if(arguments.length>2){return m._sandwich(m.skewYg(_4a),a,b);}return m._sandwich(m.skewYg(_4a),a.x,a.y);}});})();dojox.gfx.Matrix2D=dojox.gfx.matrix.Matrix2D;}if(!dojo._hasResource["dojox.gfx._base"]){dojo._hasResource["dojox.gfx._base"]=true;dojo.provide("dojox.gfx._base");(function(){var g=dojox.gfx,b=g._base;g._hasClass=function(_4f,_50){var cls=_4f.getAttribute("className");return cls&&(" "+cls+" ").indexOf(" "+_50+" ")>=0;};g._addClass=function(_52,_53){var cls=_52.getAttribute("className")||"";if(!cls||(" "+cls+" ").indexOf(" "+_53+" ")<0){_52.setAttribute("className",cls+(cls?" ":"")+_53);}};g._removeClass=function(_55,_56){var cls=_55.getAttribute("className");if(cls){_55.setAttribute("className",cls.replace(new RegExp("(^|\\s+)"+_56+"(\\s+|$)"),"$1$2"));}};b._getFontMeasurements=function(){var _58={"1em":0,"1ex":0,"100%":0,"12pt":0,"16px":0,"xx-small":0,"x-small":0,"small":0,"medium":0,"large":0,"x-large":0,"xx-large":0};if(dojo.isIE){dojo.doc.documentElement.style.fontSize="100%";}var div=dojo.doc.createElement("div");div.style.position="absolute";div.style.left="-100px";div.style.top="0";div.style.width="30px";div.style.height="1000em";div.style.border="0";div.style.margin="0";div.style.padding="0";div.style.outline="0";div.style.lineHeight="1";div.style.overflow="hidden";dojo.body().appendChild(div);for(var p in _58){div.style.fontSize=p;_58[p]=Math.round(div.offsetHeight*12/16)*16/12/1000;}dojo.body().removeChild(div);div=null;return _58;};var _5b=null;b._getCachedFontMeasurements=function(_5c){if(_5c||!_5b){_5b=b._getFontMeasurements();}return _5b;};var _5d=null,_5e={};b._getTextBox=function(_5f,_60,_61){var m;if(!_5d){m=_5d=dojo.doc.createElement("div");m.style.position="absolute";m.style.left="-10000px";m.style.top="0";dojo.body().appendChild(m);}else{m=_5d;}m.className="";m.style.border="0";m.style.margin="0";m.style.padding="0";m.style.outline="0";if(arguments.length>1&&_60){for(var i in _60){if(i in _5e){continue;}m.style[i]=_60[i];}}if(arguments.length>2&&_61){m.className=_61;}m.innerHTML=_5f;return dojo.marginBox(m);};var _64=0;b._getUniqueId=function(){var id;do{id=dojo._scopeName+"Unique"+(++_64);}while(dojo.byId(id));return id;};})();dojo.mixin(dojox.gfx,{defaultPath:{type:"path",path:""},defaultPolyline:{type:"polyline",points:[]},defaultRect:{type:"rect",x:0,y:0,width:100,height:100,r:0},defaultEllipse:{type:"ellipse",cx:0,cy:0,rx:200,ry:100},defaultCircle:{type:"circle",cx:0,cy:0,r:100},defaultLine:{type:"line",x1:0,y1:0,x2:100,y2:100},defaultImage:{type:"image",x:0,y:0,width:0,height:0,src:""},defaultText:{type:"text",x:0,y:0,text:"",align:"start",decoration:"none",rotated:false,kerning:true},defaultTextPath:{type:"textpath",text:"",align:"start",decoration:"none",rotated:false,kerning:true},defaultStroke:{type:"stroke",color:"black",style:"solid",width:1,cap:"butt",join:4},defaultLinearGradient:{type:"linear",x1:0,y1:0,x2:100,y2:100,colors:[{offset:0,color:"black"},{offset:1,color:"white"}]},defaultRadialGradient:{type:"radial",cx:0,cy:0,r:100,colors:[{offset:0,color:"black"},{offset:1,color:"white"}]},defaultPattern:{type:"pattern",x:0,y:0,width:0,height:0,src:""},defaultFont:{type:"font",style:"normal",variant:"normal",weight:"normal",size:"10pt",family:"serif"},normalizeColor:function(_66){return (_66 instanceof dojo.Color)?_66:new dojo.Color(_66);},normalizeParameters:function(_67,_68){if(_68){var _69={};for(var x in _67){if(x in _68&&!(x in _69)){_67[x]=_68[x];}}}return _67;},makeParameters:function(_6b,_6c){if(!_6c){return dojo.clone(_6b);}var _6d={};for(var i in _6b){if(!(i in _6d)){_6d[i]=dojo.clone((i in _6c)?_6c[i]:_6b[i]);}}return _6d;},formatNumber:function(x,_70){var val=x.toString();if(val.indexOf("e")>=0){val=x.toFixed(4);}else{var _72=val.indexOf(".");if(_72>=0&&val.length-_72>5){val=x.toFixed(4);}}if(x<0){return val;}return _70?" "+val:val;},makeFontString:function(_73){return _73.style+" "+_73.variant+" "+_73.weight+" "+_73.size+" "+_73.family;},splitFontString:function(str){var _75=dojo.clone(dojox.gfx.defaultFont);var t=str.split(/\s+/);do{if(t.length<5){break;}_75.style=t[0];_75.varian=t[1];_75.weight=t[2];var i=t[3].indexOf("/");_75.size=i<0?t[3]:t[3].substring(0,i);var j=4;if(i<0){if(t[4]=="/"){j=6;break;}if(t[4].substr(0,1)=="/"){j=5;break;}}if(j+3>t.length){break;}_75.size=t[j];_75.family=t[j+1];}while(false);return _75;},cm_in_pt:72/2.54,mm_in_pt:7.2/2.54,px_in_pt:function(){return dojox.gfx._base._getCachedFontMeasurements()["12pt"]/12;},pt2px:function(len){return len*dojox.gfx.px_in_pt();},px2pt:function(len){return len/dojox.gfx.px_in_pt();},normalizedLength:function(len){if(len.length==0){return 0;}if(len.length>2){var _7c=dojox.gfx.px_in_pt();var val=parseFloat(len);switch(len.slice(-2)){case "px":return val;case "pt":return val*_7c;case "in":return val*72*_7c;case "pc":return val*12*_7c;case "mm":return val*dojox.gfx.mm_in_pt*_7c;case "cm":return val*dojox.gfx.cm_in_pt*_7c;}}return parseFloat(len);},pathVmlRegExp:/([A-Za-z]+)|(\d+(\.\d+)?)|(\.\d+)|(-\d+(\.\d+)?)|(-\.\d+)/g,pathSvgRegExp:/([A-Za-z])|(\d+(\.\d+)?)|(\.\d+)|(-\d+(\.\d+)?)|(-\.\d+)/g,equalSources:function(a,b){return a&&b&&a==b;}});}if(!dojo._hasResource["dojox.gfx"]){dojo._hasResource["dojox.gfx"]=true;dojo.provide("dojox.gfx");dojo.loadInit(function(){var gfx=dojo.getObject("dojox.gfx",true),sl,_82,_83;if(!gfx.renderer){var _84=(typeof dojo.config.gfxRenderer=="string"?dojo.config.gfxRenderer:"svg,vml,silverlight,canvas").split(",");var ua=navigator.userAgent,_86=0,_87=0;if(dojo.isSafari>=3){if(ua.indexOf("iPhone")>=0||ua.indexOf("iPod")>=0){_83=ua.match(/Version\/(\d(\.\d)?(\.\d)?)\sMobile\/([^\s]*)\s?/);if(_83){_86=parseInt(_83[4].substr(0,3),16);}}}if(dojo.isWebKit){if(!_86){_83=ua.match(/Android\s+(\d+\.\d+)/);if(_83){_87=parseFloat(_83[1]);}}}for(var i=0;i<_84.length;++i){switch(_84[i]){case "svg":if(!dojo.isIE&&(!_86||_86>=1521)&&!_87&&!dojo.isAIR){dojox.gfx.renderer="svg";}break;case "vml":if(dojo.isIE){dojox.gfx.renderer="vml";}break;case "silverlight":try{if(dojo.isIE){sl=new ActiveXObject("AgControl.AgControl");if(sl&&sl.IsVersionSupported("1.0")){_82=true;}}else{if(navigator.plugins["Silverlight Plug-In"]){_82=true;}}}catch(e){_82=false;}finally{sl=null;}if(_82){dojox.gfx.renderer="silverlight";}break;case "canvas":if(!dojo.isIE){dojox.gfx.renderer="canvas";}break;}if(dojox.gfx.renderer){break;}}if(dojo.config.isDebug){}}});dojo.requireIf(dojox.gfx.renderer=="svg","dojox.gfx.svg");dojo.requireIf(dojox.gfx.renderer=="vml","dojox.gfx.vml");dojo.requireIf(dojox.gfx.renderer=="silverlight","dojox.gfx.silverlight");dojo.requireIf(dojox.gfx.renderer=="canvas","dojox.gfx.canvas");}
