/* Copyright (c) 2004-2010, 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 */ if(!dojo._hasResource["dojox.gfx.svg"]){dojo._hasResource["dojox.gfx.svg"]=true;dojo.provide("dojox.gfx.svg");dojo.require("dojox.gfx._base");dojo.require("dojox.gfx.shape");dojo.require("dojox.gfx.path");(function(){var d=dojo,g=dojox.gfx,gs=g.shape,_1=g.svg;_1.useSvgWeb=(typeof (window.svgweb)!=="undefined");var _2=function(ns,_3){if(dojo.doc.createElementNS){return dojo.doc.createElementNS(ns,_3);}else{return dojo.doc.createElement(_3);}};var _4=function(_5){if(_1.useSvgWeb){return dojo.doc.createTextNode(_5,true);}else{return dojo.doc.createTextNode(_5);}};var _6=function(){if(_1.useSvgWeb){return dojo.doc.createDocumentFragment(true);}else{return dojo.doc.createDocumentFragment();}};_1.xmlns={xlink:"http://www.w3.org/1999/xlink",svg:"http://www.w3.org/2000/svg"};_1.getRef=function(_7){if(!_7||_7=="none"){return null;}if(_7.match(/^url\(#.+\)$/)){return d.byId(_7.slice(5,-1));}if(_7.match(/^#dojoUnique\d+$/)){return d.byId(_7.slice(1));}return null;};_1.dasharray={solid:"none",shortdash:[4,1],shortdot:[1,1],shortdashdot:[4,1,1,1],shortdashdotdot:[4,1,1,1,1,1],dot:[1,3],dash:[4,3],longdash:[8,3],dashdot:[4,3,1,3],longdashdot:[8,3,1,3],longdashdotdot:[8,3,1,3,1,3]};d.extend(g.Shape,{setFill:function(_8){if(!_8){this.fillStyle=null;this.rawNode.setAttribute("fill","none");this.rawNode.setAttribute("fill-opacity",0);return this;}var f;var _9=function(x){this.setAttribute(x,f[x].toFixed(8));};if(typeof (_8)=="object"&&"type" in _8){switch(_8.type){case "linear":f=g.makeParameters(g.defaultLinearGradient,_8);var _a=this._setFillObject(f,"linearGradient");d.forEach(["x1","y1","x2","y2"],_9,_a);break;case "radial":f=g.makeParameters(g.defaultRadialGradient,_8);var _a=this._setFillObject(f,"radialGradient");d.forEach(["cx","cy","r"],_9,_a);break;case "pattern":f=g.makeParameters(g.defaultPattern,_8);var _b=this._setFillObject(f,"pattern");d.forEach(["x","y","width","height"],_9,_b);break;}this.fillStyle=f;return this;}var f=g.normalizeColor(_8);this.fillStyle=f;this.rawNode.setAttribute("fill",f.toCss());this.rawNode.setAttribute("fill-opacity",f.a);this.rawNode.setAttribute("fill-rule","evenodd");return this;},setStroke:function(_c){var rn=this.rawNode;if(!_c){this.strokeStyle=null;rn.setAttribute("stroke","none");rn.setAttribute("stroke-opacity",0);return this;}if(typeof _c=="string"||d.isArray(_c)||_c instanceof d.Color){_c={color:_c};}var s=this.strokeStyle=g.makeParameters(g.defaultStroke,_c);s.color=g.normalizeColor(s.color);if(s){rn.setAttribute("stroke",s.color.toCss());rn.setAttribute("stroke-opacity",s.color.a);rn.setAttribute("stroke-width",s.width);rn.setAttribute("stroke-linecap",s.cap);if(typeof s.join=="number"){rn.setAttribute("stroke-linejoin","miter");rn.setAttribute("stroke-miterlimit",s.join);}else{rn.setAttribute("stroke-linejoin",s.join);}var da=s.style.toLowerCase();if(da in _1.dasharray){da=_1.dasharray[da];}if(da instanceof Array){da=d._toArray(da);for(var i=0;i