/*
	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
*/

/*
	This is an optimized version of Dojo, built for deployment and not for
	development. To get sources and documentation, please visit:

		http://dojotoolkit.org
*/

if(!dojo._hasResource["dojox.gfx.shape"]){dojo._hasResource["dojox.gfx.shape"]=true;dojo.provide("dojox.gfx.shape");dojo.declare("dojox.gfx.shape.Shape",null,{constructor:function(){this.rawNode=null;this.shape=null;this.matrix=null;this.fillStyle=null;this.strokeStyle=null;this.bbox=null;this.parent=null;this.parentMatrix=null;},getNode:function(){return this.rawNode;},getShape:function(){return this.shape;},getTransform:function(){return this.matrix;},getFill:function(){return this.fillStyle;},getStroke:function(){return this.strokeStyle;},getParent:function(){return this.parent;},getBoundingBox:function(){return this.bbox;},getTransformedBoundingBox:function(){var b=this.getBoundingBox();if(!b){return null;}var m=this._getRealMatrix();gm=dojox.gfx.matrix;return [gm.multiplyPoint(m,b.x,b.y),gm.multiplyPoint(m,b.x+b.width,b.y),gm.multiplyPoint(m,b.x+b.width,b.y+b.height),gm.multiplyPoint(m,b.x,b.y+b.height)];},getEventSource:function(){return this.rawNode;},setShape:function(_1){this.shape=dojox.gfx.makeParameters(this.shape,_1);this.bbox=null;return this;},setFill:function(_2){if(!_2){this.fillStyle=null;return this;}var f=null;if(typeof (_2)=="object"&&"type" in _2){switch(_2.type){case "linear":f=dojox.gfx.makeParameters(dojox.gfx.defaultLinearGradient,_2);break;case "radial":f=dojox.gfx.makeParameters(dojox.gfx.defaultRadialGradient,_2);break;case "pattern":f=dojox.gfx.makeParameters(dojox.gfx.defaultPattern,_2);break;}}else{f=dojox.gfx.normalizeColor(_2);}this.fillStyle=f;return this;},setStroke:function(_3){if(!_3){this.strokeStyle=null;return this;}if(typeof _3=="string"||dojo.isArray(_3)||_3 instanceof dojo.Color){_3={color:_3};}var s=this.strokeStyle=dojox.gfx.makeParameters(dojox.gfx.defaultStroke,_3);s.color=dojox.gfx.normalizeColor(s.color);return this;},setTransform:function(_4){this.matrix=dojox.gfx.matrix.clone(_4?dojox.gfx.matrix.normalize(_4):dojox.gfx.matrix.identity);return this._applyTransform();},_applyTransform:function(){return this;},moveToFront:function(){var p=this.getParent();if(p){p._moveChildToFront(this);this._moveToFront();}return this;},moveToBack:function(){var p=this.getParent();if(p){p._moveChildToBack(this);this._moveToBack();}return this;},_moveToFront:function(){},_moveToBack:function(){},applyRightTransform:function(_5){return _5?this.setTransform([this.matrix,_5]):this;},applyLeftTransform:function(_6){return _6?this.setTransform([_6,this.matrix]):this;},applyTransform:function(_7){return _7?this.setTransform([this.matrix,_7]):this;},removeShape:function(_8){if(this.parent){this.parent.remove(this,_8);}return this;},_setParent:function(_9,_a){this.parent=_9;return this._updateParentMatrix(_a);},_updateParentMatrix:function(_b){this.parentMatrix=_b?dojox.gfx.matrix.clone(_b):null;return this._applyTransform();},_getRealMatrix:function(){var m=this.matrix;var p=this.parent;while(p){if(p.matrix){m=dojox.gfx.matrix.multiply(p.matrix,m);}p=p.parent;}return m;}});dojox.gfx.shape._eventsProcessing={connect:function(_c,_d,_e){return arguments.length>2?dojo.connect(this.getEventSource(),_c,_d,_e):dojo.connect(this.getEventSource(),_c,_d);},disconnect:function(_f){dojo.disconnect(_f);}};dojo.extend(dojox.gfx.shape.Shape,dojox.gfx.shape._eventsProcessing);dojox.gfx.shape.Container={_init:function(){this.children=[];},openBatch:function(){},closeBatch:function(){},add:function(_10){var _11=_10.getParent();if(_11){_11.remove(_10,true);}this.children.push(_10);return _10._setParent(this,this._getRealMatrix());},remove:function(_12,_13){for(var i=0;i<this.children.length;++i){if(this.children[i]==_12){if(_13){}else{_12.parent=null;_12.parentMatrix=null;}this.children.splice(i,1);break;}}return this;},clear:function(){this.children=[];return this;},_moveChildToFront:function(_14){for(var i=0;i<this.children.length;++i){if(this.children[i]==_14){this.children.splice(i,1);this.children.push(_14);break;}}return this;},_moveChildToBack:function(_15){for(var i=0;i<this.children.length;++i){if(this.children[i]==_15){this.children.splice(i,1);this.children.unshift(_15);break;}}return this;}};dojo.declare("dojox.gfx.shape.Surface",null,{constructor:function(){this.rawNode=null;this._parent=null;this._nodes=[];this._events=[];},destroy:function(){dojo.forEach(this._nodes,dojo.destroy);this._nodes=[];dojo.forEach(this._events,dojo.disconnect);this._events=[];this.rawNode=null;if(dojo.isIE){while(this._parent.lastChild){dojo.destroy(this._parent.lastChild);}}else{this._parent.innerHTML="";}this._parent=null;},getEventSource:function(){return this.rawNode;},_getRealMatrix:function(){return null;},isLoaded:true,onLoad:function(_16){},whenLoaded:function(_17,_18){var f=dojo.hitch(_17,_18);if(this.isLoaded){f(this);}else{var h=dojo.connect(this,"onLoad",function(_19){dojo.disconnect(h);f(_19);});}}});dojo.extend(dojox.gfx.shape.Surface,dojox.gfx.shape._eventsProcessing);dojo.declare("dojox.gfx.Point",null,{});dojo.declare("dojox.gfx.Rectangle",null,{});dojo.declare("dojox.gfx.shape.Rect",dojox.gfx.shape.Shape,{constructor:function(_1a){this.shape=dojox.gfx.getDefault("Rect");this.rawNode=_1a;},getBoundingBox:function(){return this.shape;}});dojo.declare("dojox.gfx.shape.Ellipse",dojox.gfx.shape.Shape,{constructor:function(_1b){this.shape=dojox.gfx.getDefault("Ellipse");this.rawNode=_1b;},getBoundingBox:function(){if(!this.bbox){var _1c=this.shape;this.bbox={x:_1c.cx-_1c.rx,y:_1c.cy-_1c.ry,width:2*_1c.rx,height:2*_1c.ry};}return this.bbox;}});dojo.declare("dojox.gfx.shape.Circle",dojox.gfx.shape.Shape,{constructor:function(_1d){this.shape=dojox.gfx.getDefault("Circle");this.rawNode=_1d;},getBoundingBox:function(){if(!this.bbox){var _1e=this.shape;this.bbox={x:_1e.cx-_1e.r,y:_1e.cy-_1e.r,width:2*_1e.r,height:2*_1e.r};}return this.bbox;}});dojo.declare("dojox.gfx.shape.Line",dojox.gfx.shape.Shape,{constructor:function(_1f){this.shape=dojox.gfx.getDefault("Line");this.rawNode=_1f;},getBoundingBox:function(){if(!this.bbox){var _20=this.shape;this.bbox={x:Math.min(_20.x1,_20.x2),y:Math.min(_20.y1,_20.y2),width:Math.abs(_20.x2-_20.x1),height:Math.abs(_20.y2-_20.y1)};}return this.bbox;}});dojo.declare("dojox.gfx.shape.Polyline",dojox.gfx.shape.Shape,{constructor:function(_21){this.shape=dojox.gfx.getDefault("Polyline");this.rawNode=_21;},setShape:function(_22,_23){if(_22&&_22 instanceof Array){this.inherited(arguments,[{points:_22}]);if(_23&&this.shape.points.length){this.shape.points.push(this.shape.points[0]);}}else{this.inherited(arguments,[_22]);}return this;},_normalizePoints:function(){var p=this.shape.points,l=p&&p.length;if(l&&typeof p[0]=="number"){var _24=[];for(var i=0;i<l;i+=2){_24.push({x:p[i],y:p[i+1]});}this.shape.points=_24;}},getBoundingBox:function(){if(!this.bbox&&this.shape.points.length){var p=this.shape.points;var l=p.length;var t=p[0];var _25={l:t.x,t:t.y,r:t.x,b:t.y};for(var i=1;i<l;++i){t=p[i];if(_25.l>t.x){_25.l=t.x;}if(_25.r<t.x){_25.r=t.x;}if(_25.t>t.y){_25.t=t.y;}if(_25.b<t.y){_25.b=t.y;}}this.bbox={x:_25.l,y:_25.t,width:_25.r-_25.l,height:_25.b-_25.t};}return this.bbox;}});dojo.declare("dojox.gfx.shape.Image",dojox.gfx.shape.Shape,{constructor:function(_26){this.shape=dojox.gfx.getDefault("Image");this.rawNode=_26;},getBoundingBox:function(){return this.shape;},setStroke:function(){return this;},setFill:function(){return this;}});dojo.declare("dojox.gfx.shape.Text",dojox.gfx.shape.Shape,{constructor:function(_27){this.fontStyle=null;this.shape=dojox.gfx.getDefault("Text");this.rawNode=_27;},getFont:function(){return this.fontStyle;},setFont:function(_28){this.fontStyle=typeof _28=="string"?dojox.gfx.splitFontString(_28):dojox.gfx.makeParameters(dojox.gfx.defaultFont,_28);this._setFont();return this;}});dojox.gfx.shape.Creator={createShape:function(_29){var gfx=dojox.gfx;switch(_29.type){case gfx.defaultPath.type:return this.createPath(_29);case gfx.defaultRect.type:return this.createRect(_29);case gfx.defaultCircle.type:return this.createCircle(_29);case gfx.defaultEllipse.type:return this.createEllipse(_29);case gfx.defaultLine.type:return this.createLine(_29);case gfx.defaultPolyline.type:return this.createPolyline(_29);case gfx.defaultImage.type:return this.createImage(_29);case gfx.defaultText.type:return this.createText(_29);case gfx.defaultTextPath.type:return this.createTextPath(_29);}return null;},createGroup:function(){return this.createObject(dojox.gfx.Group);},createRect:function(_2a){return this.createObject(dojox.gfx.Rect,_2a);},createEllipse:function(_2b){return this.createObject(dojox.gfx.Ellipse,_2b);},createCircle:function(_2c){return this.createObject(dojox.gfx.Circle,_2c);},createLine:function(_2d){return this.createObject(dojox.gfx.Line,_2d);},createPolyline:function(_2e){return this.createObject(dojox.gfx.Polyline,_2e);},createImage:function(_2f){return this.createObject(dojox.gfx.Image,_2f);},createText:function(_30){return this.createObject(dojox.gfx.Text,_30);},createPath:function(_31){return this.createObject(dojox.gfx.Path,_31);},createTextPath:function(_32){return this.createObject(dojox.gfx.TextPath,{}).setText(_32);},createObject:function(_33,_34){return null;}};}if(!dojo._hasResource["dojox.gfx.path"]){dojo._hasResource["dojox.gfx.path"]=true;dojo.provide("dojox.gfx.path");dojo.declare("dojox.gfx.path.Path",dojox.gfx.shape.Shape,{constructor:function(_35){this.shape=dojo.clone(dojox.gfx.defaultPath);this.segments=[];this.tbbox=null;this.absolute=true;this.last={};this.rawNode=_35;this.segmented=false;},setAbsoluteMode:function(_36){this._confirmSegmented();this.absolute=typeof _36=="string"?(_36=="absolute"):_36;return this;},getAbsoluteMode:function(){this._confirmSegmented();return this.absolute;},getBoundingBox:function(){this._confirmSegmented();return (this.bbox&&("l" in this.bbox))?{x:this.bbox.l,y:this.bbox.t,width:this.bbox.r-this.bbox.l,height:this.bbox.b-this.bbox.t}:null;},_getRealBBox:function(){this._confirmSegmented();if(this.tbbox){return this.tbbox;}var _37=this.bbox,_38=this._getRealMatrix();this.bbox=null;for(var i=0,len=this.segments.length;i<len;++i){this._updateWithSegment(this.segments[i],_38);}var t=this.bbox;this.bbox=_37;this.tbbox=t?[{x:t.l,y:t.t},{x:t.r,y:t.t},{x:t.r,y:t.b},{x:t.l,y:t.b}]:null;return this.tbbox;},getLastPosition:function(){this._confirmSegmented();return "x" in this.last?this.last:null;},_applyTransform:function(){this.tbbox=null;return this.inherited(arguments);},_updateBBox:function(x,y,_39){if(_39){var t=dojox.gfx.matrix.multiplyPoint(_39,x,y);x=t.x;y=t.y;}if(this.bbox&&("l" in this.bbox)){if(this.bbox.l>x){this.bbox.l=x;}if(this.bbox.r<x){this.bbox.r=x;}if(this.bbox.t>y){this.bbox.t=y;}if(this.bbox.b<y){this.bbox.b=y;}}else{this.bbox={l:x,b:y,r:x,t:y};}},_updateWithSegment:function(_3a,_3b){var n=_3a.args,l=n.length;switch(_3a.action){case "M":case "L":case "C":case "S":case "Q":case "T":for(var i=0;i<l;i+=2){this._updateBBox(n[i],n[i+1],_3b);}this.last.x=n[l-2];this.last.y=n[l-1];this.absolute=true;break;case "H":for(var i=0;i<l;++i){this._updateBBox(n[i],this.last.y,_3b);}this.last.x=n[l-1];this.absolute=true;break;case "V":for(var i=0;i<l;++i){this._updateBBox(this.last.x,n[i],_3b);}this.last.y=n[l-1];this.absolute=true;break;case "m":var _3c=0;if(!("x" in this.last)){this._updateBBox(this.last.x=n[0],this.last.y=n[1],_3b);_3c=2;}for(var i=_3c;i<l;i+=2){this._updateBBox(this.last.x+=n[i],this.last.y+=n[i+1],_3b);}this.absolute=false;break;case "l":case "t":for(var i=0;i<l;i+=2){this._updateBBox(this.last.x+=n[i],this.last.y+=n[i+1],_3b);}this.absolute=false;break;case "h":for(var i=0;i<l;++i){this._updateBBox(this.last.x+=n[i],this.last.y,_3b);}this.absolute=false;break;case "v":for(var i=0;i<l;++i){this._updateBBox(this.last.x,this.last.y+=n[i],_3b);}this.absolute=false;break;case "c":for(var i=0;i<l;i+=6){this._updateBBox(this.last.x+n[i],this.last.y+n[i+1],_3b);this._updateBBox(this.last.x+n[i+2],this.last.y+n[i+3],_3b);this._updateBBox(this.last.x+=n[i+4],this.last.y+=n[i+5],_3b);}this.absolute=false;break;case "s":case "q":for(var i=0;i<l;i+=4){this._updateBBox(this.last.x+n[i],this.last.y+n[i+1],_3b);this._updateBBox(this.last.x+=n[i+2],this.last.y+=n[i+3],_3b);}this.absolute=false;break;case "A":for(var i=0;i<l;i+=7){this._updateBBox(n[i+5],n[i+6],_3b);}this.last.x=n[l-2];this.last.y=n[l-1];this.absolute=true;break;case "a":for(var i=0;i<l;i+=7){this._updateBBox(this.last.x+=n[i+5],this.last.y+=n[i+6],_3b);}this.absolute=false;break;}var _3d=[_3a.action];for(var i=0;i<l;++i){_3d.push(dojox.gfx.formatNumber(n[i],true));}if(typeof this.shape.path=="string"){this.shape.path+=_3d.join("");}else{Array.prototype.push.apply(this.shape.path,_3d);}},_validSegments:{m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,z:0},_pushSegment:function(_3e,_3f){this.tbbox=null;var _40=this._validSegments[_3e.toLowerCase()];if(typeof _40=="number"){if(_40){if(_3f.length>=_40){var _41={action:_3e,args:_3f.slice(0,_3f.length-_3f.length%_40)};this.segments.push(_41);this._updateWithSegment(_41);}}else{var _41={action:_3e,args:[]};this.segments.push(_41);this._updateWithSegment(_41);}}},_collectArgs:function(_42,_43){for(var i=0;i<_43.length;++i){var t=_43[i];if(typeof t=="boolean"){_42.push(t?1:0);}else{if(typeof t=="number"){_42.push(t);}else{if(t instanceof Array){this._collectArgs(_42,t);}else{if("x" in t&&"y" in t){_42.push(t.x,t.y);}}}}}},moveTo:function(){this._confirmSegmented();var _44=[];this._collectArgs(_44,arguments);this._pushSegment(this.absolute?"M":"m",_44);return this;},lineTo:function(){this._confirmSegmented();var _45=[];this._collectArgs(_45,arguments);this._pushSegment(this.absolute?"L":"l",_45);return this;},hLineTo:function(){this._confirmSegmented();var _46=[];this._collectArgs(_46,arguments);this._pushSegment(this.absolute?"H":"h",_46);return this;},vLineTo:function(){this._confirmSegmented();var _47=[];this._collectArgs(_47,arguments);this._pushSegment(this.absolute?"V":"v",_47);return this;},curveTo:function(){this._confirmSegmented();var _48=[];this._collectArgs(_48,arguments);this._pushSegment(this.absolute?"C":"c",_48);return this;},smoothCurveTo:function(){this._confirmSegmented();var _49=[];this._collectArgs(_49,arguments);this._pushSegment(this.absolute?"S":"s",_49);return this;},qCurveTo:function(){this._confirmSegmented();var _4a=[];this._collectArgs(_4a,arguments);this._pushSegment(this.absolute?"Q":"q",_4a);return this;},qSmoothCurveTo:function(){this._confirmSegmented();var _4b=[];this._collectArgs(_4b,arguments);this._pushSegment(this.absolute?"T":"t",_4b);return this;},arcTo:function(){this._confirmSegmented();var _4c=[];this._collectArgs(_4c,arguments);this._pushSegment(this.absolute?"A":"a",_4c);return this;},closePath:function(){this._confirmSegmented();this._pushSegment("Z",[]);return this;},_confirmSegmented:function(){if(!this.segmented){var _4d=this.shape.path;this.shape.path=[];this._setPath(_4d);this.shape.path=this.shape.path.join("");this.segmented=true;}},_setPath:function(_4e){var p=dojo.isArray(_4e)?_4e:_4e.match(dojox.gfx.pathSvgRegExp);this.segments=[];this.absolute=true;this.bbox={};this.last={};if(!p){return;}var _4f="",_50=[],l=p.length;for(var i=0;i<l;++i){var t=p[i],x=parseFloat(t);if(isNaN(x)){if(_4f){this._pushSegment(_4f,_50);}_50=[];_4f=t;}else{_50.push(x);}}this._pushSegment(_4f,_50);},setShape:function(_51){this.inherited(arguments,[typeof _51=="string"?{path:_51}:_51]);this.segmented=false;this.segments=[];if(!dojox.gfx.lazyPathSegmentation){this._confirmSegmented();}return this;},_2PI:Math.PI*2});dojo.declare("dojox.gfx.path.TextPath",dojox.gfx.path.Path,{constructor:function(_52){if(!("text" in this)){this.text=dojo.clone(dojox.gfx.defaultTextPath);}if(!("fontStyle" in this)){this.fontStyle=dojo.clone(dojox.gfx.defaultFont);}},getText:function(){return this.text;},setText:function(_53){this.text=dojox.gfx.makeParameters(this.text,typeof _53=="string"?{text:_53}:_53);this._setText();return this;},getFont:function(){return this.fontStyle;},setFont:function(_54){this.fontStyle=typeof _54=="string"?dojox.gfx.splitFontString(_54):dojox.gfx.makeParameters(dojox.gfx.defaultFont,_54);this._setFont();return this;}});}if(!dojo._hasResource["dojox.gfx.arc"]){dojo._hasResource["dojox.gfx.arc"]=true;dojo.provide("dojox.gfx.arc");(function(){var m=dojox.gfx.matrix,_55=2*Math.PI,pi4=Math.PI/4,pi8=Math.PI/8,_56=pi4+pi8,_57=_58(pi8);function _58(_59){var _5a=Math.cos(_59),_5b=Math.sin(_59),p2={x:_5a+(4/3)*(1-_5a),y:_5b-(4/3)*_5a*(1-_5a)/_5b};return {s:{x:_5a,y:-_5b},c1:{x:p2.x,y:-p2.y},c2:p2,e:{x:_5a,y:_5b}};};dojox.gfx.arc={unitArcAsBezier:_58,curvePI4:_57,arcAsBezier:function(_5c,rx,ry,_5d,_5e,_5f,x,y){_5e=Boolean(_5e);_5f=Boolean(_5f);var _60=m._degToRad(_5d),rx2=rx*rx,ry2=ry*ry,pa=m.multiplyPoint(m.rotate(-_60),{x:(_5c.x-x)/2,y:(_5c.y-y)/2}),_61=pa.x*pa.x,_62=pa.y*pa.y,c1=Math.sqrt((rx2*ry2-rx2*_62-ry2*_61)/(rx2*_62+ry2*_61));if(isNaN(c1)){c1=0;}var ca={x:c1*rx*pa.y/ry,y:-c1*ry*pa.x/rx};if(_5e==_5f){ca={x:-ca.x,y:-ca.y};}var c=m.multiplyPoint([m.translate((_5c.x+x)/2,(_5c.y+y)/2),m.rotate(_60)],ca);var _63=m.normalize([m.translate(c.x,c.y),m.rotate(_60),m.scale(rx,ry)]);var _64=m.invert(_63),sp=m.multiplyPoint(_64,_5c),ep=m.multiplyPoint(_64,x,y),_65=Math.atan2(sp.y,sp.x),_66=Math.atan2(ep.y,ep.x),_67=_65-_66;if(_5f){_67=-_67;}if(_67<0){_67+=_55;}else{if(_67>_55){_67-=_55;}}var _68=pi8,_69=_57,_6a=_5f?_68:-_68,_6b=[];for(var _6c=_67;_6c>0;_6c-=pi4){if(_6c<_56){_68=_6c/2;_69=_58(_68);_6a=_5f?_68:-_68;_6c=0;}var c1,c2,e,M=m.normalize([_63,m.rotate(_65+_6a)]);if(_5f){c1=m.multiplyPoint(M,_69.c1);c2=m.multiplyPoint(M,_69.c2);e=m.multiplyPoint(M,_69.e);}else{c1=m.multiplyPoint(M,_69.c2);c2=m.multiplyPoint(M,_69.c1);e=m.multiplyPoint(M,_69.s);}_6b.push([c1.x,c1.y,c2.x,c2.y,e.x,e.y]);_65+=2*_6a;}return _6b;}};})();}if(!dojo._hasResource["dojox.gfx.gradient"]){dojo._hasResource["dojox.gfx.gradient"]=true;dojo.provide("dojox.gfx.gradient");(function(){var d=dojo,m=dojox.gfx.matrix,C=d.Color;dojox.gfx.gradient.rescale=function(_6d,_6e,to){var len=_6d.length,_6f=(to<_6e),_70;if(_6f){var tmp=_6e;_6e=to;to=tmp;}if(!len){return [];}if(to<=_6d[0].offset){_70=[{offset:0,color:_6d[0].color},{offset:1,color:_6d[0].color}];}else{if(_6e>=_6d[len-1].offset){_70=[{offset:0,color:_6d[len-1].color},{offset:1,color:_6d[len-1].color}];}else{var _71=to-_6e,_72,_73,i;_70=[];if(_6e<0){_70.push({offset:0,color:new C(_6d[0].color)});}for(i=0;i<len;++i){_72=_6d[i];if(_72.offset>=_6e){break;}}if(i){_73=_6d[i-1];_70.push({offset:0,color:d.blendColors(new C(_73.color),new C(_72.color),(_6e-_73.offset)/(_72.offset-_73.offset))});}else{_70.push({offset:0,color:new C(_72.color)});}for(;i<len;++i){_72=_6d[i];if(_72.offset>=to){break;}_70.push({offset:(_72.offset-_6e)/_71,color:new C(_72.color)});}if(i<len){_73=_6d[i-1];_70.push({offset:1,color:d.blendColors(new C(_73.color),new C(_72.color),(to-_73.offset)/(_72.offset-_73.offset))});}else{_70.push({offset:1,color:new C(_6d[len-1].color)});}}}if(_6f){_70.reverse();for(i=0,len=_70.length;i<len;++i){_72=_70[i];_72.offset=1-_72.offset;}}return _70;};function _74(x,y,_75,_76,_77,_78){var r=m.multiplyPoint(_75,x,y),p=m.multiplyPoint(_76,r);return {r:r,p:p,o:m.multiplyPoint(_77,p).x/_78};};function _79(a,b){return a.o-b.o;};dojox.gfx.gradient.project=function(_7a,_7b,tl,rb,ttl,trb){_7a=_7a||m.identity;var f1=m.multiplyPoint(_7a,_7b.x1,_7b.y1),f2=m.multiplyPoint(_7a,_7b.x2,_7b.y2),_7c=Math.atan2(f2.y-f1.y,f2.x-f1.x),_7d=m.project(f2.x-f1.x,f2.y-f1.y),pf1=m.multiplyPoint(_7d,f1),pf2=m.multiplyPoint(_7d,f2),_7e=new m.Matrix2D([m.rotate(-_7c),{dx:-pf1.x,dy:-pf1.y}]),_7f=m.multiplyPoint(_7e,pf2).x,_80=[_74(tl.x,tl.y,_7a,_7d,_7e,_7f),_74(rb.x,rb.y,_7a,_7d,_7e,_7f),_74(tl.x,rb.y,_7a,_7d,_7e,_7f),_74(rb.x,tl.y,_7a,_7d,_7e,_7f)].sort(_79),_81=_80[0].o,to=_80[3].o,_82=dojox.gfx.gradient.rescale(_7b.colors,_81,to),_83=Math.atan2(_80[3].r.y-_80[0].r.y,_80[3].r.x-_80[0].r.x);return {type:"linear",x1:_80[0].p.x,y1:_80[0].p.y,x2:_80[3].p.x,y2:_80[3].p.y,colors:_82,angle:_7c};};})();}if(!dojo._hasResource["dojox.gfx.vml"]){dojo._hasResource["dojox.gfx.vml"]=true;dojo.provide("dojox.gfx.vml");(function(){var d=dojo,g=dojox.gfx,m=g.matrix,gs=g.shape,vml=g.vml;vml.xmlns="urn:schemas-microsoft-com:vml";vml.text_alignment={start:"left",middle:"center",end:"right"};vml._parseFloat=function(str){return str.match(/^\d+f$/i)?parseInt(str)/65536:parseFloat(str);};vml._bool={"t":1,"true":1};d.declare("dojox.gfx.vml.Shape",gs.Shape,{setFill:function(_84){if(!_84){this.fillStyle=null;this.rawNode.filled="f";return this;}var i,f,fo,a,s;if(typeof _84=="object"&&"type" in _84){switch(_84.type){case "linear":var _85=this._getRealMatrix(),_86=this.getBoundingBox(),_87=this._getRealBBox?this._getRealBBox():this.getTransformedBoundingBox();s=[];if(this.fillStyle!==_84){this.fillStyle=g.makeParameters(g.defaultLinearGradient,_84);}f=g.gradient.project(_85,this.fillStyle,{x:_86.x,y:_86.y},{x:_86.x+_86.width,y:_86.y+_86.height},_87[0],_87[2]);a=f.colors;if(a[0].offset.toFixed(5)!="0.00000"){s.push("0 "+g.normalizeColor(a[0].color).toHex());}for(i=0;i<a.length;++i){s.push(a[i].offset.toFixed(5)+" "+g.normalizeColor(a[i].color).toHex());}i=a.length-1;if(a[i].offset.toFixed(5)!="1.00000"){s.push("1 "+g.normalizeColor(a[i].color).toHex());}fo=this.rawNode.fill;fo.colors.value=s.join(";");fo.method="sigma";fo.type="gradient";fo.angle=(270-m._radToDeg(f.angle))%360;fo.on=true;break;case "radial":f=g.makeParameters(g.defaultRadialGradient,_84);this.fillStyle=f;var l=parseFloat(this.rawNode.style.left),t=parseFloat(this.rawNode.style.top),w=parseFloat(this.rawNode.style.width),h=parseFloat(this.rawNode.style.height),c=isNaN(w)?1:2*f.r/w;a=[];if(f.colors[0].offset>0){a.push({offset:1,color:g.normalizeColor(f.colors[0].color)});}d.forEach(f.colors,function(v,i){a.push({offset:1-v.offset*c,color:g.normalizeColor(v.color)});});i=a.length-1;while(i>=0&&a[i].offset<0){--i;}if(i<a.length-1){var q=a[i],p=a[i+1];p.color=d.blendColors(q.color,p.color,q.offset/(q.offset-p.offset));p.offset=0;while(a.length-i>2){a.pop();}}i=a.length-1,s=[];if(a[i].offset>0){s.push("0 "+a[i].color.toHex());}for(;i>=0;--i){s.push(a[i].offset.toFixed(5)+" "+a[i].color.toHex());}fo=this.rawNode.fill;fo.colors.value=s.join(";");fo.method="sigma";fo.type="gradientradial";if(isNaN(w)||isNaN(h)||isNaN(l)||isNaN(t)){fo.focusposition="0.5 0.5";}else{fo.focusposition=((f.cx-l)/w).toFixed(5)+" "+((f.cy-t)/h).toFixed(5);}fo.focussize="0 0";fo.on=true;break;case "pattern":f=g.makeParameters(g.defaultPattern,_84);this.fillStyle=f;fo=this.rawNode.fill;fo.type="tile";fo.src=f.src;if(f.width&&f.height){fo.size.x=g.px2pt(f.width);fo.size.y=g.px2pt(f.height);}fo.alignShape="f";fo.position.x=0;fo.position.y=0;fo.origin.x=f.width?f.x/f.width:0;fo.origin.y=f.height?f.y/f.height:0;fo.on=true;break;}this.rawNode.fill.opacity=1;return this;}this.fillStyle=g.normalizeColor(_84);fo=this.rawNode.fill;if(!fo){fo=this.rawNode.ownerDocument.createElement("v:fill");}fo.method="any";fo.type="solid";fo.opacity=this.fillStyle.a;var _88=this.rawNode.filters["DXImageTransform.Microsoft.Alpha"];if(_88){_88.opacity=Math.round(this.fillStyle.a*100);}this.rawNode.fillcolor=this.fillStyle.toHex();this.rawNode.filled=true;return this;},setStroke:function(_89){if(!_89){this.strokeStyle=null;this.rawNode.stroked="f";return this;}if(typeof _89=="string"||d.isArray(_89)||_89 instanceof d.Color){_89={color:_89};}var s=this.strokeStyle=g.makeParameters(g.defaultStroke,_89);s.color=g.normalizeColor(s.color);var rn=this.rawNode;rn.stroked=true;rn.strokecolor=s.color.toCss();rn.strokeweight=s.width+"px";if(rn.stroke){rn.stroke.opacity=s.color.a;rn.stroke.endcap=this._translate(this._capMap,s.cap);if(typeof s.join=="number"){rn.stroke.joinstyle="miter";rn.stroke.miterlimit=s.join;}else{rn.stroke.joinstyle=s.join;}rn.stroke.dashstyle=s.style=="none"?"Solid":s.style;}return this;},_capMap:{butt:"flat"},_capMapReversed:{flat:"butt"},_translate:function(_8a,_8b){return (_8b in _8a)?_8a[_8b]:_8b;},_applyTransform:function(){var _8c=this._getRealMatrix();if(_8c){var _8d=this.rawNode.skew;if(typeof _8d=="undefined"){for(var i=0;i<this.rawNode.childNodes.length;++i){if(this.rawNode.childNodes[i].tagName=="skew"){_8d=this.rawNode.childNodes[i];break;}}}if(_8d){_8d.on="f";var mt=_8c.xx.toFixed(8)+" "+_8c.xy.toFixed(8)+" "+_8c.yx.toFixed(8)+" "+_8c.yy.toFixed(8)+" 0 0",_8e=Math.floor(_8c.dx).toFixed()+"px "+Math.floor(_8c.dy).toFixed()+"px",s=this.rawNode.style,l=parseFloat(s.left),t=parseFloat(s.top),w=parseFloat(s.width),h=parseFloat(s.height);if(isNaN(l)){l=0;}if(isNaN(t)){t=0;}if(isNaN(w)||!w){w=1;}if(isNaN(h)||!h){h=1;}var _8f=(-l/w-0.5).toFixed(8)+" "+(-t/h-0.5).toFixed(8);_8d.matrix=mt;_8d.origin=_8f;_8d.offset=_8e;_8d.on=true;}}if(this.fillStyle&&this.fillStyle.type=="linear"){this.setFill(this.fillStyle);}return this;},_setDimensions:function(_90,_91){return this;},setRawNode:function(_92){_92.stroked="f";_92.filled="f";this.rawNode=_92;},_moveToFront:function(){this.rawNode.parentNode.appendChild(this.rawNode);return this;},_moveToBack:function(){var r=this.rawNode,p=r.parentNode,n=p.firstChild;p.insertBefore(r,n);if(n.tagName=="rect"){n.swapNode(r);}return this;},_getRealMatrix:function(){return this.parentMatrix?new g.Matrix2D([this.parentMatrix,this.matrix]):this.matrix;}});dojo.declare("dojox.gfx.vml.Group",vml.Shape,{constructor:function(){gs.Container._init.call(this);},_applyTransform:function(){var _93=this._getRealMatrix();for(var i=0;i<this.children.length;++i){this.children[i]._updateParentMatrix(_93);}return this;},_setDimensions:function(_94,_95){var r=this.rawNode,rs=r.style,bs=this.bgNode.style;rs.width=_94;rs.height=_95;r.coordsize=_94+" "+_95;bs.width=_94;bs.height=_95;for(var i=0;i<this.children.length;++i){this.children[i]._setDimensions(_94,_95);}return this;}});vml.Group.nodeType="group";dojo.declare("dojox.gfx.vml.Rect",[vml.Shape,gs.Rect],{setShape:function(_96){var _97=this.shape=g.makeParameters(this.shape,_96);this.bbox=null;var r=Math.min(1,(_97.r/Math.min(parseFloat(_97.width),parseFloat(_97.height)))).toFixed(8);var _98=this.rawNode.parentNode,_99=null;if(_98){if(_98.lastChild!==this.rawNode){for(var i=0;i<_98.childNodes.length;++i){if(_98.childNodes[i]===this.rawNode){_99=_98.childNodes[i+1];break;}}}_98.removeChild(this.rawNode);}if(d.isIE>7){var _9a=this.rawNode.ownerDocument.createElement("v:roundrect");_9a.arcsize=r;_9a.style.display="inline-block";this.rawNode=_9a;}else{this.rawNode.arcsize=r;}if(_98){if(_99){_98.insertBefore(this.rawNode,_99);}else{_98.appendChild(this.rawNode);}}var _9b=this.rawNode.style;_9b.left=_97.x.toFixed();_9b.top=_97.y.toFixed();_9b.width=(typeof _97.width=="string"&&_97.width.indexOf("%")>=0)?_97.width:_97.width.toFixed();_9b.height=(typeof _97.height=="string"&&_97.height.indexOf("%")>=0)?_97.height:_97.height.toFixed();return this.setTransform(this.matrix).setFill(this.fillStyle).setStroke(this.strokeStyle);}});vml.Rect.nodeType="roundrect";dojo.declare("dojox.gfx.vml.Ellipse",[vml.Shape,gs.Ellipse],{setShape:function(_9c){var _9d=this.shape=g.makeParameters(this.shape,_9c);this.bbox=null;var _9e=this.rawNode.style;_9e.left=(_9d.cx-_9d.rx).toFixed();_9e.top=(_9d.cy-_9d.ry).toFixed();_9e.width=(_9d.rx*2).toFixed();_9e.height=(_9d.ry*2).toFixed();return this.setTransform(this.matrix);}});vml.Ellipse.nodeType="oval";dojo.declare("dojox.gfx.vml.Circle",[vml.Shape,gs.Circle],{setShape:function(_9f){var _a0=this.shape=g.makeParameters(this.shape,_9f);this.bbox=null;var _a1=this.rawNode.style;_a1.left=(_a0.cx-_a0.r).toFixed();_a1.top=(_a0.cy-_a0.r).toFixed();_a1.width=(_a0.r*2).toFixed();_a1.height=(_a0.r*2).toFixed();return this;}});vml.Circle.nodeType="oval";dojo.declare("dojox.gfx.vml.Line",[vml.Shape,gs.Line],{constructor:function(_a2){if(_a2){_a2.setAttribute("dojoGfxType","line");}},setShape:function(_a3){var _a4=this.shape=g.makeParameters(this.shape,_a3);this.bbox=null;this.rawNode.path.v="m"+_a4.x1.toFixed()+" "+_a4.y1.toFixed()+"l"+_a4.x2.toFixed()+" "+_a4.y2.toFixed()+"e";return this.setTransform(this.matrix);}});vml.Line.nodeType="shape";dojo.declare("dojox.gfx.vml.Polyline",[vml.Shape,gs.Polyline],{constructor:function(_a5){if(_a5){_a5.setAttribute("dojoGfxType","polyline");}},setShape:function(_a6,_a7){if(_a6&&_a6 instanceof Array){this.shape=g.makeParameters(this.shape,{points:_a6});if(_a7&&this.shape.points.length){this.shape.points.push(this.shape.points[0]);}}else{this.shape=g.makeParameters(this.shape,_a6);}this.bbox=null;this._normalizePoints();var _a8=[],p=this.shape.points;if(p.length>0){_a8.push("m");_a8.push(p[0].x.toFixed(),p[0].y.toFixed());if(p.length>1){_a8.push("l");for(var i=1;i<p.length;++i){_a8.push(p[i].x.toFixed(),p[i].y.toFixed());}}}_a8.push("e");this.rawNode.path.v=_a8.join(" ");return this.setTransform(this.matrix);}});vml.Polyline.nodeType="shape";dojo.declare("dojox.gfx.vml.Image",[vml.Shape,gs.Image],{setShape:function(_a9){var _aa=this.shape=g.makeParameters(this.shape,_a9);this.bbox=null;this.rawNode.firstChild.src=_aa.src;return this.setTransform(this.matrix);},_applyTransform:function(){var _ab=this._getRealMatrix(),_ac=this.rawNode,s=_ac.style,_ad=this.shape;if(_ab){_ab=m.multiply(_ab,{dx:_ad.x,dy:_ad.y});}else{_ab=m.normalize({dx:_ad.x,dy:_ad.y});}if(_ab.xy==0&&_ab.yx==0&&_ab.xx>0&&_ab.yy>0){s.filter="";s.width=Math.floor(_ab.xx*_ad.width);s.height=Math.floor(_ab.yy*_ad.height);s.left=Math.floor(_ab.dx);s.top=Math.floor(_ab.dy);}else{var ps=_ac.parentNode.style;s.left="0px";s.top="0px";s.width=ps.width;s.height=ps.height;_ab=m.multiply(_ab,{xx:_ad.width/parseInt(s.width),yy:_ad.height/parseInt(s.height)});var f=_ac.filters["DXImageTransform.Microsoft.Matrix"];if(f){f.M11=_ab.xx;f.M12=_ab.xy;f.M21=_ab.yx;f.M22=_ab.yy;f.Dx=_ab.dx;f.Dy=_ab.dy;}else{s.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+_ab.xx+", M12="+_ab.xy+", M21="+_ab.yx+", M22="+_ab.yy+", Dx="+_ab.dx+", Dy="+_ab.dy+")";}}return this;},_setDimensions:function(_ae,_af){var r=this.rawNode,f=r.filters["DXImageTransform.Microsoft.Matrix"];if(f){var s=r.style;s.width=_ae;s.height=_af;return this._applyTransform();}return this;}});vml.Image.nodeType="rect";dojo.declare("dojox.gfx.vml.Text",[vml.Shape,gs.Text],{constructor:function(_b0){if(_b0){_b0.setAttribute("dojoGfxType","text");}this.fontStyle=null;},_alignment:{start:"left",middle:"center",end:"right"},setShape:function(_b1){this.shape=g.makeParameters(this.shape,_b1);this.bbox=null;var r=this.rawNode,s=this.shape,x=s.x,y=s.y.toFixed(),_b2;switch(s.align){case "middle":x-=5;break;case "end":x-=10;break;}_b2="m"+x.toFixed()+","+y+"l"+(x+10).toFixed()+","+y+"e";var p=null,t=null,c=r.childNodes;for(var i=0;i<c.length;++i){var tag=c[i].tagName;if(tag=="path"){p=c[i];if(t){break;}}else{if(tag=="textpath"){t=c[i];if(p){break;}}}}if(!p){p=r.ownerDocument.createElement("v:path");r.appendChild(p);}if(!t){t=r.ownerDocument.createElement("v:textpath");r.appendChild(t);}p.v=_b2;p.textPathOk=true;t.on=true;var a=vml.text_alignment[s.align];t.style["v-text-align"]=a?a:"left";t.style["text-decoration"]=s.decoration;t.style["v-rotate-letters"]=s.rotated;t.style["v-text-kern"]=s.kerning;t.string=s.text;return this.setTransform(this.matrix);},_setFont:function(){var f=this.fontStyle,c=this.rawNode.childNodes;for(var i=0;i<c.length;++i){if(c[i].tagName=="textpath"){c[i].style.font=g.makeFontString(f);break;}}this.setTransform(this.matrix);},_getRealMatrix:function(){var _b3=this.inherited(arguments);if(_b3){_b3=m.multiply(_b3,{dy:-g.normalizedLength(this.fontStyle?this.fontStyle.size:"10pt")*0.35});}return _b3;},getTextWidth:function(){var _b4=this.rawNode,_b5=_b4.style.display;_b4.style.display="inline";var _b6=g.pt2px(parseFloat(_b4.currentStyle.width));_b4.style.display=_b5;return _b6;}});vml.Text.nodeType="shape";dojo.declare("dojox.gfx.vml.Path",[vml.Shape,g.path.Path],{constructor:function(_b7){if(_b7&&!_b7.getAttribute("dojoGfxType")){_b7.setAttribute("dojoGfxType","path");}this.vmlPath="";this.lastControl={};},_updateWithSegment:function(_b8){var _b9=d.clone(this.last);this.inherited(arguments);if(arguments.length>1){return;}var _ba=this[this.renderers[_b8.action]](_b8,_b9);if(typeof this.vmlPath=="string"){this.vmlPath+=_ba.join("");this.rawNode.path.v=this.vmlPath+" r0,0 e";}else{Array.prototype.push.apply(this.vmlPath,_ba);}},setShape:function(_bb){this.vmlPath=[];this.lastControl.type="";this.inherited(arguments);this.vmlPath=this.vmlPath.join("");this.rawNode.path.v=this.vmlPath+" r0,0 e";return this;},_pathVmlToSvgMap:{m:"M",l:"L",t:"m",r:"l",c:"C",v:"c",qb:"Q",x:"z",e:""},renderers:{M:"_moveToA",m:"_moveToR",L:"_lineToA",l:"_lineToR",H:"_hLineToA",h:"_hLineToR",V:"_vLineToA",v:"_vLineToR",C:"_curveToA",c:"_curveToR",S:"_smoothCurveToA",s:"_smoothCurveToR",Q:"_qCurveToA",q:"_qCurveToR",T:"_qSmoothCurveToA",t:"_qSmoothCurveToR",A:"_arcTo",a:"_arcTo",Z:"_closePath",z:"_closePath"},_addArgs:function(_bc,_bd,_be,_bf){var n=_bd instanceof Array?_bd:_bd.args;for(var i=_be;i<_bf;++i){_bc.push(" ",n[i].toFixed());}},_adjustRelCrd:function(_c0,_c1,_c2){var n=_c1 instanceof Array?_c1:_c1.args,l=n.length,_c3=new Array(l),i=0,x=_c0.x,y=_c0.y;if(typeof x!="number"){_c3[0]=x=n[0];_c3[1]=y=n[1];i=2;}if(typeof _c2=="number"&&_c2!=2){var j=_c2;while(j<=l){for(;i<j;i+=2){_c3[i]=x+n[i];_c3[i+1]=y+n[i+1];}x=_c3[j-2];y=_c3[j-1];j+=_c2;}}else{for(;i<l;i+=2){_c3[i]=(x+=n[i]);_c3[i+1]=(y+=n[i+1]);}}return _c3;},_adjustRelPos:function(_c4,_c5){var n=_c5 instanceof Array?_c5:_c5.args,l=n.length,_c6=new Array(l);for(var i=0;i<l;++i){_c6[i]=(_c4+=n[i]);}return _c6;},_moveToA:function(_c7){var p=[" m"],n=_c7 instanceof Array?_c7:_c7.args,l=n.length;this._addArgs(p,n,0,2);if(l>2){p.push(" l");this._addArgs(p,n,2,l);}this.lastControl.type="";return p;},_moveToR:function(_c8,_c9){return this._moveToA(this._adjustRelCrd(_c9,_c8));},_lineToA:function(_ca){var p=[" l"],n=_ca instanceof Array?_ca:_ca.args;this._addArgs(p,n,0,n.length);this.lastControl.type="";return p;},_lineToR:function(_cb,_cc){return this._lineToA(this._adjustRelCrd(_cc,_cb));},_hLineToA:function(_cd,_ce){var p=[" l"],y=" "+_ce.y.toFixed(),n=_cd instanceof Array?_cd:_cd.args,l=n.length;for(var i=0;i<l;++i){p.push(" ",n[i].toFixed(),y);}this.lastControl.type="";return p;},_hLineToR:function(_cf,_d0){return this._hLineToA(this._adjustRelPos(_d0.x,_cf),_d0);},_vLineToA:function(_d1,_d2){var p=[" l"],x=" "+_d2.x.toFixed(),n=_d1 instanceof Array?_d1:_d1.args,l=n.length;for(var i=0;i<l;++i){p.push(x," ",n[i].toFixed());}this.lastControl.type="";return p;},_vLineToR:function(_d3,_d4){return this._vLineToA(this._adjustRelPos(_d4.y,_d3),_d4);},_curveToA:function(_d5){var p=[],n=_d5 instanceof Array?_d5:_d5.args,l=n.length,lc=this.lastControl;for(var i=0;i<l;i+=6){p.push(" c");this._addArgs(p,n,i,i+6);}lc.x=n[l-4];lc.y=n[l-3];lc.type="C";return p;},_curveToR:function(_d6,_d7){return this._curveToA(this._adjustRelCrd(_d7,_d6,6));},_smoothCurveToA:function(_d8,_d9){var p=[],n=_d8 instanceof Array?_d8:_d8.args,l=n.length,lc=this.lastControl,i=0;if(lc.type!="C"){p.push(" c");this._addArgs(p,[_d9.x,_d9.y],0,2);this._addArgs(p,n,0,4);lc.x=n[0];lc.y=n[1];lc.type="C";i=4;}for(;i<l;i+=4){p.push(" c");this._addArgs(p,[2*_d9.x-lc.x,2*_d9.y-lc.y],0,2);this._addArgs(p,n,i,i+4);lc.x=n[i];lc.y=n[i+1];}return p;},_smoothCurveToR:function(_da,_db){return this._smoothCurveToA(this._adjustRelCrd(_db,_da,4),_db);},_qCurveToA:function(_dc){var p=[],n=_dc instanceof Array?_dc:_dc.args,l=n.length,lc=this.lastControl;for(var i=0;i<l;i+=4){p.push(" qb");this._addArgs(p,n,i,i+4);}lc.x=n[l-4];lc.y=n[l-3];lc.type="Q";return p;},_qCurveToR:function(_dd,_de){return this._qCurveToA(this._adjustRelCrd(_de,_dd,4));},_qSmoothCurveToA:function(_df,_e0){var p=[],n=_df instanceof Array?_df:_df.args,l=n.length,lc=this.lastControl,i=0;if(lc.type!="Q"){p.push(" qb");this._addArgs(p,[lc.x=_e0.x,lc.y=_e0.y],0,2);lc.type="Q";this._addArgs(p,n,0,2);i=2;}for(;i<l;i+=2){p.push(" qb");this._addArgs(p,[lc.x=2*_e0.x-lc.x,lc.y=2*_e0.y-lc.y],0,2);this._addArgs(p,n,i,i+2);}return p;},_qSmoothCurveToR:function(_e1,_e2){return this._qSmoothCurveToA(this._adjustRelCrd(_e2,_e1,2),_e2);},_arcTo:function(_e3,_e4){var p=[],n=_e3.args,l=n.length,_e5=_e3.action=="a";for(var i=0;i<l;i+=7){var x1=n[i+5],y1=n[i+6];if(_e5){x1+=_e4.x;y1+=_e4.y;}var _e6=g.arc.arcAsBezier(_e4,n[i],n[i+1],n[i+2],n[i+3]?1:0,n[i+4]?1:0,x1,y1);for(var j=0;j<_e6.length;++j){p.push(" c");var t=_e6[j];this._addArgs(p,t,0,t.length);this._updateBBox(t[0],t[1]);this._updateBBox(t[2],t[3]);this._updateBBox(t[4],t[5]);}_e4.x=x1;_e4.y=y1;}this.lastControl.type="";return p;},_closePath:function(){this.lastControl.type="";return ["x"];}});vml.Path.nodeType="shape";dojo.declare("dojox.gfx.vml.TextPath",[vml.Path,g.path.TextPath],{constructor:function(_e7){if(_e7){_e7.setAttribute("dojoGfxType","textpath");}this.fontStyle=null;if(!("text" in this)){this.text=d.clone(g.defaultTextPath);}if(!("fontStyle" in this)){this.fontStyle=d.clone(g.defaultFont);}},setText:function(_e8){this.text=g.makeParameters(this.text,typeof _e8=="string"?{text:_e8}:_e8);this._setText();return this;},setFont:function(_e9){this.fontStyle=typeof _e9=="string"?g.splitFontString(_e9):g.makeParameters(g.defaultFont,_e9);this._setFont();return this;},_setText:function(){this.bbox=null;var r=this.rawNode,s=this.text,p=null,t=null,c=r.childNodes;for(var i=0;i<c.length;++i){var tag=c[i].tagName;if(tag=="path"){p=c[i];if(t){break;}}else{if(tag=="textpath"){t=c[i];if(p){break;}}}}if(!p){p=this.rawNode.ownerDocument.createElement("v:path");r.appendChild(p);}if(!t){t=this.rawNode.ownerDocument.createElement("v:textpath");r.appendChild(t);}p.textPathOk=true;t.on=true;var a=vml.text_alignment[s.align];t.style["v-text-align"]=a?a:"left";t.style["text-decoration"]=s.decoration;t.style["v-rotate-letters"]=s.rotated;t.style["v-text-kern"]=s.kerning;t.string=s.text;},_setFont:function(){var f=this.fontStyle,c=this.rawNode.childNodes;for(var i=0;i<c.length;++i){if(c[i].tagName=="textpath"){c[i].style.font=g.makeFontString(f);break;}}}});vml.TextPath.nodeType="shape";dojo.declare("dojox.gfx.vml.Surface",gs.Surface,{constructor:function(){gs.Container._init.call(this);},setDimensions:function(_ea,_eb){this.width=g.normalizedLength(_ea);this.height=g.normalizedLength(_eb);if(!this.rawNode){return this;}var cs=this.clipNode.style,r=this.rawNode,rs=r.style,bs=this.bgNode.style,ps=this._parent.style,i;ps.width=_ea;ps.height=_eb;cs.width=_ea;cs.height=_eb;cs.clip="rect(0px "+_ea+"px "+_eb+"px 0px)";rs.width=_ea;rs.height=_eb;r.coordsize=_ea+" "+_eb;bs.width=_ea;bs.height=_eb;for(i=0;i<this.children.length;++i){this.children[i]._setDimensions(_ea,_eb);}return this;},getDimensions:function(){var t=this.rawNode?{width:g.normalizedLength(this.rawNode.style.width),height:g.normalizedLength(this.rawNode.style.height)}:null;if(t.width<=0){t.width=this.width;}if(t.height<=0){t.height=this.height;}return t;}});vml.createSurface=function(_ec,_ed,_ee){if(!_ed&&!_ee){var pos=d.position(_ec);_ed=_ed||pos.w;_ee=_ee||pos.h;}if(typeof _ed=="number"){_ed=_ed+"px";}if(typeof _ee=="number"){_ee=_ee+"px";}var s=new vml.Surface(),p=d.byId(_ec),c=s.clipNode=p.ownerDocument.createElement("div"),r=s.rawNode=p.ownerDocument.createElement("v:group"),cs=c.style,rs=r.style;if(d.isIE>7){rs.display="inline-block";}s._parent=p;s._nodes.push(c);p.style.width=_ed;p.style.height=_ee;cs.position="absolute";cs.width=_ed;cs.height=_ee;cs.clip="rect(0px "+_ed+" "+_ee+" 0px)";rs.position="absolute";rs.width=_ed;rs.height=_ee;r.coordsize=(_ed==="100%"?_ed:parseFloat(_ed))+" "+(_ee==="100%"?_ee:parseFloat(_ee));r.coordorigin="0 0";var b=s.bgNode=r.ownerDocument.createElement("v:rect"),bs=b.style;bs.left=bs.top=0;bs.width=rs.width;bs.height=rs.height;b.filled=b.stroked="f";r.appendChild(b);c.appendChild(r);p.appendChild(c);s.width=g.normalizedLength(_ed);s.height=g.normalizedLength(_ee);return s;};function _ef(_f0,f,o){o=o||d.global;f.call(o,_f0);if(_f0 instanceof g.Surface||_f0 instanceof g.Group){d.forEach(_f0.children,function(_f1){_ef(_f1,f,o);});}};var C=gs.Container,_f2={add:function(_f3){if(this!=_f3.getParent()){var _f4=_f3.getParent();if(_f4){_f4.remove(_f3);}this.rawNode.appendChild(_f3.rawNode);if(!_f4){_f3.setFill(_f3.getFill());_f3.setStroke(_f3.getStroke());}C.add.apply(this,arguments);}return this;},remove:function(_f5,_f6){if(this==_f5.getParent()){if(this.rawNode==_f5.rawNode.parentNode){this.rawNode.removeChild(_f5.rawNode);}C.remove.apply(this,arguments);}return this;},clear:function(){var r=this.rawNode;while(r.firstChild!=r.lastChild){if(r.firstChild!=this.bgNode){r.removeChild(r.firstChild);}if(r.lastChild!=this.bgNode){r.removeChild(r.lastChild);}}return C.clear.apply(this,arguments);},_moveChildToFront:C._moveChildToFront,_moveChildToBack:C._moveChildToBack};var _f7={createGroup:function(){var _f8=this.createObject(vml.Group,null);var r=_f8.rawNode.ownerDocument.createElement("v:rect");r.style.left=r.style.top=0;r.style.width=_f8.rawNode.style.width;r.style.height=_f8.rawNode.style.height;r.filled=r.stroked="f";_f8.rawNode.appendChild(r);_f8.bgNode=r;return _f8;},createImage:function(_f9){if(!this.rawNode){return null;}var _fa=new vml.Image(),doc=this.rawNode.ownerDocument,_fb=doc.createElement("v:rect");_fb.stroked="f";_fb.style.width=this.rawNode.style.width;_fb.style.height=this.rawNode.style.height;var img=doc.createElement("v:imagedata");_fb.appendChild(img);_fa.setRawNode(_fb);this.rawNode.appendChild(_fb);_fa.setShape(_f9);this.add(_fa);return _fa;},createRect:function(_fc){if(!this.rawNode){return null;}var _fd=new vml.Rect,_fe=this.rawNode.ownerDocument.createElement("v:roundrect");if(d.isIE>7){_fe.style.display="inline-block";}_fd.setRawNode(_fe);this.rawNode.appendChild(_fe);_fd.setShape(_fc);this.add(_fd);return _fd;},createObject:function(_ff,_100){if(!this.rawNode){return null;}var _101=new _ff(),node=this.rawNode.ownerDocument.createElement("v:"+_ff.nodeType);_101.setRawNode(node);this.rawNode.appendChild(node);switch(_ff){case vml.Group:case vml.Line:case vml.Polyline:case vml.Image:case vml.Text:case vml.Path:case vml.TextPath:this._overrideSize(node);}_101.setShape(_100);this.add(_101);return _101;},_overrideSize:function(node){var s=this.rawNode.style,w=s.width,h=s.height;node.style.width=w;node.style.height=h;node.coordsize=parseInt(w)+" "+parseInt(h);}};d.extend(vml.Group,_f2);d.extend(vml.Group,gs.Creator);d.extend(vml.Group,_f7);d.extend(vml.Surface,_f2);d.extend(vml.Surface,gs.Creator);d.extend(vml.Surface,_f7);if(g.loadAndSwitch==="vml"){g.switchTo("vml");delete g.loadAndSwitch;}})();}
