/*
	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["esri.layers.osm"]){dojo._hasResource["esri.layers.osm"]=true;dojo.provide("esri.layers.osm");dojo.declare("esri.layers.OpenStreetMapLayer",esri.layers.TiledMapServiceLayer,{constructor:function(_1){this.spatialReference=new esri.SpatialReference({wkid:102100});this.tileInfo=new esri.layers.TileInfo({rows:256,cols:256,dpi:96,format:"PNG8",compressionQuality:0,origin:{x:-20037508.342787,y:20037508.342787},spatialReference:{wkid:102100},lods:[{level:0,scale:591657527.591555,resolution:156543.033928},{level:1,scale:295828763.795777,resolution:78271.5169639999},{level:2,scale:147914381.897889,resolution:39135.7584820001},{level:3,scale:73957190.948944,resolution:19567.8792409999},{level:4,scale:36978595.474472,resolution:9783.93962049996},{level:5,scale:18489297.737236,resolution:4891.96981024998},{level:6,scale:9244648.868618,resolution:2445.98490512499},{level:7,scale:4622324.434309,resolution:1222.99245256249},{level:8,scale:2311162.217155,resolution:611.49622628138},{level:9,scale:1155581.108577,resolution:305.748113140558},{level:10,scale:577790.554289,resolution:152.874056570411},{level:11,scale:288895.277144,resolution:76.4370282850732},{level:12,scale:144447.638572,resolution:38.2185141425366},{level:13,scale:72223.819286,resolution:19.1092570712683},{level:14,scale:36111.909643,resolution:9.55462853563415},{level:15,scale:18055.954822,resolution:4.77731426794937},{level:16,scale:9027.977411,resolution:2.38865713397468},{level:17,scale:4513.988705,resolution:1.19432856685505},{level:18,scale:2256.994353,resolution:0.597164283559817}]});this.fullExtent=new esri.geometry.Extent({xmin:-20037508.34,ymin:-20037508.34,xmax:20037508.34,ymax:20037508.34,spatialReference:{wkid:102100}});this.initialExtent=new esri.geometry.Extent({xmin:-20037508.34,ymin:-20037508.34,xmax:20037508.34,ymax:20037508.34,spatialReference:{wkid:102100}});this.tileServers=(_1&&_1.tileServers)||["http://a.tile.openstreetmap.org/","http://b.tile.openstreetmap.org/","http://c.tile.openstreetmap.org/"];this.serversLength=this.tileServers.length;this._displayLevels=_1?_1.displayLevels:null;this.loaded=true;this.onLoad(this);var _2=_1&&_1.loadCallback;if(_2){_2(this);}},getTileUrl:function(_3,_4,_5){return esri._getProxiedUrl(this.tileServers[_4%this.serversLength]+"/"+_3+"/"+_5+"/"+_4+".png");}});}if(!dojo._hasResource["dojo.io.iframe"]){dojo._hasResource["dojo.io.iframe"]=true;dojo.provide("dojo.io.iframe");dojo.getObject("io",true,dojo);dojo.io.iframe={create:function(_6,_7,_8){if(window[_6]){return window[_6];}if(window.frames[_6]){return window.frames[_6];}var _9=null;var _a=_8;if(!_a){if(dojo.config["useXDomain"]&&!dojo.config["dojoBlankHtmlUrl"]){console.warn("dojo.io.iframe.create: When using cross-domain Dojo builds,"+" please save dojo/resources/blank.html to your domain and set djConfig.dojoBlankHtmlUrl"+" to the path on your domain to blank.html");}_a=(dojo.config["dojoBlankHtmlUrl"]||dojo.moduleUrl("dojo","resources/blank.html"));}var _9=dojo.place("<iframe id=\""+_6+"\" name=\""+_6+"\" src=\""+_a+"\" onload=\""+_7+"\" style=\"position: absolute; left: 1px; top: 1px; height: 1px; width: 1px; visibility: hidden\">",dojo.body());window[_6]=_9;return _9;},setSrc:function(_b,_c,_d){try{if(!_d){if(dojo.isWebKit){_b.location=_c;}else{frames[_b.name].location=_c;}}else{var _e;if(dojo.isIE||dojo.isWebKit){_e=_b.contentWindow.document;}else{_e=_b.contentWindow;}if(!_e){_b.location=_c;return;}else{_e.location.replace(_c);}}}catch(e){console.log("dojo.io.iframe.setSrc: ",e);}},doc:function(_f){var doc=_f.contentDocument||(((_f.name)&&(_f.document)&&(dojo.doc.getElementsByTagName("iframe")[_f.name].contentWindow)&&(dojo.doc.getElementsByTagName("iframe")[_f.name].contentWindow.document)))||((_f.name)&&(dojo.doc.frames[_f.name])&&(dojo.doc.frames[_f.name].document))||null;return doc;},send:function(_10){if(!this["_frame"]){this._frame=this.create(this._iframeName,dojo._scopeName+".io.iframe._iframeOnload();");}var dfd=dojo._ioSetArgs(_10,function(dfd){dfd.canceled=true;dfd.ioArgs._callNext();},function(dfd){var _11=null;try{var _12=dfd.ioArgs;var dii=dojo.io.iframe;var ifd=dii.doc(dii._frame);var _13=_12.handleAs;_11=ifd;if(_13!="html"){if(_13=="xml"){if(dojo.isIE<9||(dojo.isIE&&dojo.isQuirks)){dojo.query("a",dii._frame.contentWindow.document.documentElement).orphan();var _14=(dii._frame.contentWindow.document).documentElement.innerText;_14=_14.replace(/>\s+</g,"><");_14=dojo.trim(_14);var _15={responseText:_14};_11=dojo._contentHandlers["xml"](_15);}}else{_11=ifd.getElementsByTagName("textarea")[0].value;if(_13=="json"){_11=dojo.fromJson(_11);}else{if(_13=="javascript"){_11=dojo.eval(_11);}}}}}catch(e){_11=e;}finally{_12._callNext();}return _11;},function(_16,dfd){dfd.ioArgs._hasError=true;dfd.ioArgs._callNext();return _16;});dfd.ioArgs._callNext=function(){if(!this["_calledNext"]){this._calledNext=true;dojo.io.iframe._currentDfd=null;dojo.io.iframe._fireNextRequest();}};this._dfdQueue.push(dfd);this._fireNextRequest();dojo._ioWatch(dfd,function(dfd){return !dfd.ioArgs["_hasError"];},function(dfd){return (!!dfd.ioArgs["_finished"]);},function(dfd){if(dfd.ioArgs._finished){dfd.callback(dfd);}else{dfd.errback(new Error("Invalid dojo.io.iframe request state"));}});return dfd;},_currentDfd:null,_dfdQueue:[],_iframeName:dojo._scopeName+"IoIframe",_fireNextRequest:function(){try{if((this._currentDfd)||(this._dfdQueue.length==0)){return;}do{var dfd=this._currentDfd=this._dfdQueue.shift();}while(dfd&&dfd.canceled&&this._dfdQueue.length);if(!dfd||dfd.canceled){this._currentDfd=null;return;}var _17=dfd.ioArgs;var _18=_17.args;_17._contentToClean=[];var fn=dojo.byId(_18["form"]);var _19=_18["content"]||{};if(fn){if(_19){var _1a=function(_1b,_1c){dojo.create("input",{type:"hidden",name:_1b,value:_1c},fn);_17._contentToClean.push(_1b);};for(var x in _19){var val=_19[x];if(dojo.isArray(val)&&val.length>1){var i;for(i=0;i<val.length;i++){_1a(x,val[i]);}}else{if(!fn[x]){_1a(x,val);}else{fn[x].value=val;}}}}var _1d=fn.getAttributeNode("action");var _1e=fn.getAttributeNode("method");var _1f=fn.getAttributeNode("target");if(_18["url"]){_17._originalAction=_1d?_1d.value:null;if(_1d){_1d.value=_18.url;}else{fn.setAttribute("action",_18.url);}}if(!_1e||!_1e.value){if(_1e){_1e.value=(_18["method"])?_18["method"]:"post";}else{fn.setAttribute("method",(_18["method"])?_18["method"]:"post");}}_17._originalTarget=_1f?_1f.value:null;if(_1f){_1f.value=this._iframeName;}else{fn.setAttribute("target",this._iframeName);}fn.target=this._iframeName;dojo._ioNotifyStart(dfd);fn.submit();}else{var _20=_18.url+(_18.url.indexOf("?")>-1?"&":"?")+_17.query;dojo._ioNotifyStart(dfd);this.setSrc(this._frame,_20,true);}}catch(e){dfd.errback(e);}},_iframeOnload:function(){var dfd=this._currentDfd;if(!dfd){this._fireNextRequest();return;}var _21=dfd.ioArgs;var _22=_21.args;var _23=dojo.byId(_22.form);if(_23){var _24=_21._contentToClean;for(var i=0;i<_24.length;i++){var key=_24[i];for(var j=0;j<_23.childNodes.length;j++){var _25=_23.childNodes[j];if(_25.name==key){dojo.destroy(_25);break;}}}if(_21["_originalAction"]){_23.setAttribute("action",_21._originalAction);}if(_21["_originalTarget"]){_23.setAttribute("target",_21._originalTarget);_23.target=_21._originalTarget;}}_21._finished=true;}};}if(!dojo._hasResource["esri.layers.FeatureLayer"]){dojo._hasResource["esri.layers.FeatureLayer"]=true;dojo.provide("esri.layers.FeatureLayer");dojo.declare("esri.layers.FeatureLayer",esri.layers.GraphicsLayer,{constructor:function(url,_26){this._outFields=_26&&_26.outFields;this._loadCallback=_26&&_26.loadCallback;var _27=_26&&_26._usePatch;this._usePatch=(_27===null||_27===undefined)?true:_27;this._trackIdField=_26&&_26.trackIdField;this.objectIdField=_26&&_26.objectIdField;this._maxOffset=_26&&_26.maxAllowableOffset;this._optEditable=_26&&_26.editable;this._optAutoGen=_26&&_26.autoGeneralize;this.editSummaryCallback=_26&&_26.editSummaryCallback;this.userId=_26&&_26.userId;this.userIsAdmin=_26&&_26.userIsAdmin;this.useMapTime=(_26&&_26.hasOwnProperty("useMapTime"))?(!!_26.useMapTime):true;this.source=_26&&_26.source;this.gdbVersion=_26&&_26.gdbVersion;this._selectedFeatures={};this._selectedFeaturesArr=[];this._newFeatures=[];this._deletedFeatures={};this._ulid=this._getUniqueId();var _28=this.constructor,_29=this.mode=(esri._isDefined(_26&&_26.mode)?_26.mode:_28.MODE_ONDEMAND);switch(_29){case _28.MODE_SNAPSHOT:this._mode=new esri.layers._SnapshotMode(this);this._isSnapshot=true;break;case _28.MODE_ONDEMAND:this._tileWidth=(_26&&_26.tileWidth)||512;this._tileHeight=(_26&&_26.tileHeight)||512;this._mode=new esri.layers._OnDemandMode(this);var _2a=_26&&_26.latticeTiling;this.latticeTiling=_2a;break;case _28.MODE_SELECTION:this._mode=new esri.layers._SelectionMode(this);this._isSelOnly=true;break;}this._initLayer=dojo.hitch(this,this._initLayer);this._selectHandler=dojo.hitch(this,this._selectHandler);this._editable=false;if(dojo.isObject(url)&&url.layerDefinition){var _2b=url;this._collection=true;this.mode=_28.MODE_SNAPSHOT;this._initLayer(_2b);return this;}this._task=new esri.tasks.QueryTask(this.url,{source:this.source,gdbVersion:this.gdbVersion});var _2c=this._url.path;this._fserver=false;if(_2c.search(/\/FeatureServer\//i)!==-1){this._fserver=true;}var _2d=_26&&_26.resourceInfo;if(_2d){this._initLayer(_2d);}else{if(this.source){var _2e={source:this.source.toJson()};this._url.query=dojo.mixin(this._url.query,{layer:dojo.toJson(_2e)});}if(this.gdbVersion){this._url.query=dojo.mixin(this._url.query,{gdbVersion:this.gdbVersion});}esri.request({url:_2c,content:dojo.mixin({f:"json"},this._url.query),callbackParamName:"callback",load:this._initLayer,error:this._errorHandler});}},_initLayer:function(_2f,io){if(_2f||io){this._json=_2f;this._findCredential();if(this._collection){this._mode=new esri.layers._SnapshotMode(this);this._isSnapshot=true;this._featureSet=_2f.featureSet;this._nextId=_2f.nextObjectId;_2f=_2f.layerDefinition;}if(_2f.hasOwnProperty("capabilities")){var _30=(this.capabilities=_2f.capabilities);if(_30&&_30.toLowerCase().indexOf("editing")!==-1){this._editable=true;}else{this._editable=false;}}else{if(!this._collection){this._editable=this._fserver;}}if(esri._isDefined(this._optEditable)){this._editable=this._optEditable;delete this._optEditable;}this._json=dojo.toJson(this._json);if(this._editable){delete this._maxOffset;}else{if(this.mode!==this.constructor.MODE_SNAPSHOT&&((_2f.geometryType==="esriGeometryPolyline")||(_2f.geometryType==="esriGeometryPolygon"))){this._autoGeneralize=esri._isDefined(this._optAutoGen)?this._optAutoGen:(this.mode===this.constructor.MODE_ONDEMAND);delete this._optAutoGen;}}this.minScale=_2f.minScale||0;this.maxScale=_2f.maxScale||0;this.layerId=_2f.id;this.name=_2f.name;this.description=_2f.description;this.copyright=_2f.copyrightText;this.type=_2f.type;this.geometryType=_2f.geometryType;this.displayField=_2f.displayField;this.defaultDefinitionExpression=_2f.definitionExpression;this.fullExtent=new esri.geometry.Extent(_2f.extent);if((this.geometryType==="esriGeometryPoint")||(this.geometryType==="esriGeometryMultipoint")){this.latticeTiling=false;}this.indexedFields=_2f.indexedFields;this.maxRecordCount=_2f.maxRecordCount;this.canModifyLayer=_2f.canModifyLayer;this.supportsStatistics=_2f.supportsStatistics;this.supportsAdvancedQueries=_2f.supportsAdvancedQueries;this.hasLabels=_2f.hasLabels;this.canScaleSymbols=_2f.canScaleSymbols;this.supportsRollbackOnFailure=_2f.supportsRollbackOnFailure;this.syncCanReturnChanges=_2f.syncCanReturnChanges;this.isDataVersioned=_2f.isDataVersioned;this.editFieldsInfo=_2f.editFieldsInfo;this.ownershipBasedAccessControlForFeatures=_2f.ownershipBasedAccessControlForFeatures;if(this.editFieldsInfo&&this.ownershipBasedAccessControlForFeatures){this.creatorField=this.editFieldsInfo.creatorField;}this.relationships=_2f.relationships;this.allowGeometryUpdates=esri._isDefined(_2f.allowGeometryUpdates)?_2f.allowGeometryUpdates:true;this._isTable=(this.type==="Table");var _31=(this.fields=[]),_32=_2f.fields,i;for(i=0;i<_32.length;i++){_31.push(new esri.layers.Field(_32[i]));}if(!this.objectIdField){this.objectIdField=_2f.objectIdField;if(!this.objectIdField){_32=_2f.fields;for(i=0;i<_32.length;i++){var _33=_32[i];if(_33.type==="esriFieldTypeOID"){this.objectIdField=_33.name;break;}}}if(!this.objectIdField){console.debug("esri.layers.FeatureLayer: "+esri.substitute({url:this.url},esri.bundle.layers.FeatureLayer.noOIDField));}}if(!esri._isDefined(this._nextId)){var _34=this.objectIdField,_35=-1;if(this._collection&&_34){var _36=this._featureSet,_37=_36&&_36.features,il=_37?_37.length:0,oid,_38;for(i=0;i<il;i++){_38=_37[i].attributes;oid=_38&&_38[_34];if(oid>_35){_35=oid;}}}this._nextId=(_35+1);}this.globalIdField=_2f.globalIdField;this.typeIdField=_2f.typeIdField;this.visibilityField=_2f.visibilityField;var _39=_2f.defaultSymbol;if(_39){this.defaultSymbol=esri.symbol.fromJson(_39);}var _3a=this.types=[],_3b=_2f.types,_3c,_3d,_3e,_3f=this.editFieldsInfo,_40=_3f&&_3f.creatorField,_41=_3f&&_3f.editorField,fix=(_40||_41),_42=[];if(_3b){for(i=0;i<_3b.length;i++){_3c=new esri.layers.FeatureType(_3b[i]);_3d=_3c.templates;if(fix&&_3d&&_3d.length){_42=_42.concat(_3d);}_3a.push(_3c);}}var _43=_2f.templates,_44,_45=this.templates=[];if(_43){for(i=0;i<_43.length;i++){_44=new esri.layers.FeatureTemplate(_43[i]);if(fix){_42.push(_44);}_45.push(_44);}}for(i=0;i<_42.length;i++){_3e=dojo.getObject("prototype.attributes",false,_42[i]);if(_3e){if(_40){delete _3e[_40];}if(_41){delete _3e[_41];}}}var _46=_2f.timeInfo;if(_46){this.timeInfo=new esri.layers.TimeInfo(_46);this._startTimeField=_46.startTimeField;this._endTimeField=_46.endTimeField;if(this._startTimeField&&this._endTimeField){this._twoTimeFields=true;}if(this._trackIdField){_46.trackIdField=this._trackIdField;}else{this._trackIdField=_46.trackIdField;}}this.hasAttachments=(!this._collection&&_2f.hasAttachments)?true:false;this.htmlPopupType=_2f.htmlPopupType;var _47=_2f.drawingInfo,_48;if(!this.renderer){if(_47&&_47.renderer){_48=_47.renderer;this.setRenderer(esri.renderer.fromJson(_48));if(_48.type==="classBreaks"){this.renderer._setMaxInclusiveness(true);}if(!this._collection){var _49=_48.type,_4a=[];_48=this.renderer;switch(_49){case "simple":_4a.push(_48.symbol);break;case "uniqueValue":case "classBreaks":_4a.push(_48.defaultSymbol);_4a=_4a.concat(dojo.map(_48.infos,function(_4b){return _4b.symbol;}));break;}_4a=dojo.filter(_4a,esri._isDefined);var _4c=this._url.path+"/images/",_4d=this._getToken();dojo.forEach(_4a,function(sym){var url=sym.url;if(url){if((url.search(/https?\:/)===-1)&&(url.indexOf("data:")===-1)){sym.url=_4c+url;}if(_4d&&sym.url.search(/https?\:/)!==-1){sym.url+=("?token="+_4d);}}});}}else{if(_39){_3b=this.types;if(_3b.length>0){_48=new esri.renderer.UniqueValueRenderer(this.defaultSymbol,this.typeIdField);dojo.forEach(_3b,function(_4e){_48.addValue(_4e.id,_4e.symbol);});}else{_48=new esri.renderer.SimpleRenderer(this.defaultSymbol);}this.setRenderer(_48);}else{if(!this._isTable){var _4f;switch(this.geometryType){case "esriGeometryPoint":case "esriGeometryMultipoint":_4f=new esri.symbol.SimpleMarkerSymbol();break;case "esriGeometryPolyline":_4f=new esri.symbol.SimpleLineSymbol();break;case "esriGeometryPolygon":_4f=new esri.symbol.SimpleFillSymbol();break;}this.setRenderer(_4f?new esri.renderer.SimpleRenderer(_4f):null);}}}}var _50=(_47&&_47.transparency)||0;if(!esri._isDefined(this.opacity)&&_50>0){this.opacity=1-(_50/100);}this.version=_2f.currentVersion;if(!this.version){var ver;if("capabilities" in _2f||"drawingInfo" in _2f||"hasAttachments" in _2f||"htmlPopupType" in _2f||"relationships" in _2f||"timeInfo" in _2f||"typeIdField" in _2f||"types" in _2f){ver=10;}else{ver=9.3;}this.version=ver;}if((dojo.isIE||dojo.isSafari)&&this._editable&&this.version<10.02){this._ts=true;}this.loaded=true;this._fixRendererFields();this._checkFields();this._updateCaps();if(this._collection){this._fireUpdateStart();var _51=this._featureSet;delete this._featureSet;this._mode._drawFeatures(new esri.tasks.FeatureSet(_51));this._fcAdded=true;}this.onLoad(this);var _52=this._loadCallback;if(_52){delete this._loadCallback;_52(this);}}},setRenderer:function(ren){this.inherited("setRenderer",arguments);var _53=this.renderer;if(_53){this._ager=(_53.declaredClass.indexOf("TemporalRenderer")!==-1&&_53.observationAger&&_53.observationRenderer);var _54=dojo.filter([_53,_53.observationRenderer,_53.latestObservationRenderer,_53.trackRenderer],esri._isDefined);var _55=[];dojo.forEach(_54,function(rnd){_55.push(rnd.attributeField);_55.push(rnd.attributeField2);_55.push(rnd.attributeField3);},this);this._rendererFields=dojo.filter(_55,esri._isDefined);}else{this._ager=false;this._rendererFields=[];}if(this.loaded&&this._rendererFields.length>0){this._fixRendererFields();this._checkFields(this._rendererFields);}if(this.loaded&&this._collection){this._typesDirty=true;}},_setMap:function(map,_56){this._map=map;this._toggleTime(true);var div=this.inherited("_setMap",arguments);this.clearSelection();var _57=this.renderer;if(this.timeInfo){if(this._trackIdField||(_57&&(_57.latestObservationRenderer||_57.trackRenderer))){this._trackManager=new esri.layers._TrackManager(this);this._trackManager.initialize(map);}}this._zoomConnect=dojo.connect(map,"onZoomEnd",this,this._zoomHandler);this._zoomHandler();var _58=this._mode;if(_58){_58.initialize(map);}return div;},_unsetMap:function(map,_59){var _5a=this._mode;if(_5a){_5a.destroy();this._mode=null;}if(this._trackManager){this._trackManager.destroy();this._trackManager=null;}dojo.disconnect(this._zoomConnect);this._zoomConnect=null;this._toggleTime(false);this.inherited("_unsetMap",arguments);},refresh:function(){var _5b=this._mode;if(_5b){_5b.refresh();}},setEditable:function(_5c){if(!this._collection){console.log("FeatureLayer:setEditCapabilities - this functionality is not yet supported for layer in a feature service");return this;}if(!this.loaded){this._optEditable=_5c;return this;}var _5d=this._editable;this._editable=_5c;this._updateCaps();if(_5d!==_5c){this.onCapabilitiesChange();}return this;},getEditCapabilities:function(_5e){var _5f={"canCreate":false,"canUpdate":false,"canDelete":false};if(!this.loaded||!this._editable){return _5f;}var _60=_5e&&_5e.feature,_61=_5e&&_5e.userId,_62=dojo.map((this.capabilities?this.capabilities.toLowerCase().split(","):[]),dojo.trim),_63=dojo.indexOf(_62,"editing")>-1,_64=_63&&(dojo.indexOf(_62,"create")>-1),_65=_63&&(dojo.indexOf(_62,"update")>-1),_66=_63&&(dojo.indexOf(_62,"delete")>-1),_67=this.ownershipBasedAccessControlForFeatures,_68=this.editFieldsInfo,_69=_68&&_68.creatorField,_6a=_68&&_68.realm,_6b=_60&&_60.attributes,_6c=(_6b&&_69)?_6b[_69]:undefined,_6d,_6e=!!this.userIsAdmin,_6f=!_67||_6e||!!(_67.allowOthersToUpdate||_67.allowUpdateToOthers),_70=!_67||_6e||!!(_67.allowOthersToDelete||_67.allowDeleteToOthers);if(_63&&(!(_64||_65||_66)||_6e)){_64=_65=_66=true;}_6d={"canCreate":_64,"canUpdate":_65,"canDelete":_66};if(_6c===null){_6d.canUpdate=_65&&_6f;_6d.canDelete=_66&&_70;}else{if(_6c===""){return _6d;}else{if(_6c){_61=_61||this.getUserId();if(_61&&_6a){_61=_61+"@"+_6a;}if(_61.toLowerCase()===_6c.toLowerCase()){return _6d;}else{_6d.canUpdate=_65&&_6f;_6d.canDelete=_66&&_70;}}}}return _6d;},getUserId:function(){var _71;if(this.loaded){_71=(this.credential&&this.credential.userId)||this.userId||"";}return _71;},setUserIsAdmin:function(_72){this.userIsAdmin=_72;},setEditSummaryCallback:function(_73){this.editSummaryCallback=_73;},getEditSummary:function(_74,_75,_76){_76=esri._isDefined(_76)?_76:(new Date()).getTime();var _77="",_78=this.getEditInfo(_74,_75,_76),_79=(_75&&_75.callback)||this.editSummaryCallback;if(_79){_78=_79(_74,_78)||"";}if(dojo.isString(_78)){_77=_78;}else{if(_78){var _7a=_78.action,_7b=_78.userId,_7c=_78.timeValue,_7d=0;if(_7a){_7d++;}if(_7b){_7d++;}if(esri._isDefined(_7c)){_7d++;}if(_7d>1){_77=(_7a==="edit"?"edit":"create")+(_7b?"User":"")+(esri._isDefined(_7c)?_78.displayPattern:"");}}_77=_77&&esri.substitute(_78,esri.bundle.layers.FeatureLayer[_77]);}return _77;},getEditInfo:function(_7e,_7f,_80){if(!this.loaded){return;}_80=esri._isDefined(_80)?_80:(new Date()).getTime();var _81=(_7f&&_7f.action)||"last",_82=this.editFieldsInfo,_83=_82&&_82.creatorField,_84=_82&&_82.creationDateField,_85=_82&&_82.editorField,_86=_82&&_82.editDateField,_87=_82&&_82.realm,_88=_7e&&_7e.attributes,_89=(_88&&_83)?_88[_83]:undefined,_8a=(_88&&_84)?_88[_84]:null,_8b=(_88&&_85)?_88[_85]:undefined,_8c=(_88&&_86)?_88[_86]:null,_8d=this._getEditData(_89,_8a,_80),_8e=this._getEditData(_8b,_8c,_80),_8f;switch(_81){case "creation":_8f=_8d;break;case "edit":_8f=_8e;break;case "last":_8f=_8e||_8d;break;}if(_8f){_8f.action=(_8f===_8e)?"edit":"creation";}return _8f;},_getEditData:function(_90,_91,_92){var _93,_94,_95,_96=60000,_97=3600000,_98=2*_97,_99=24*_97,_9a=7*_99;if(esri._isDefined(_91)){_94=_92-_91;if(_94<0){_95="Full";}else{if(_94<_96){_95="Seconds";}else{if(_94<(2*_96)){_95="Minute";}else{if(_94<_97){_95="Minutes";}else{if(_94<_98){_95="Hour";}else{if(_94<_99){_95="Hours";}else{if(_94<_9a){_95="WeekDay";}else{_95="Full";}}}}}}}}if((_90!==undefined)||_95){_93=_93||{};_93.userId=_90;if(_95){var _9b=dojo.date.locale.format,_9c=new Date(_91);_93.minutes=Math.floor(_94/_96);_93.hours=Math.floor(_94/_97);_93.weekDay=_9b(_9c,{datePattern:"EEEE",selector:"date"});_93.formattedDate=_9b(_9c,{selector:"date"});_93.formattedTime=_9b(_9c,{selector:"time"});_93.displayPattern=_95;_93.timeValue=_91;}}return _93;},isEditable:function(){return this._editable;},setMaxAllowableOffset:function(_9d){if(!this._editable){this._maxOffset=_9d;}return this;},getMaxAllowableOffset:function(){return this._maxOffset;},setAutoGeneralize:function(_9e){if(!this.loaded){this._optAutoGen=_9e;}else{if(!this._editable&&(this.mode!==this.constructor.MODE_SNAPSHOT)&&((this.geometryType==="esriGeometryPolyline")||(this.geometryType==="esriGeometryPolygon"))){this._autoGeneralize=_9e;if(_9e){var map=this._map;if(map&&map.loaded){this._maxOffset=Math.floor(map.extent.getWidth()/map.width);}}else{delete this._maxOffset;}}}return this;},setScaleRange:function(_9f,_a0){this.minScale=_9f||0;this.maxScale=_a0||0;if(this._map&&this._map.loaded){this._updateStatus();}},setGDBVersion:function(_a1){if(!this._collection&&(_a1!==this.gdbVersion)&&(_a1||this.gdbVersion)){this.gdbVersion=_a1;this._task.gdbVersion=_a1;this._url.query=dojo.mixin(this._url.query,{gdbVersion:_a1});if(this.loaded){this.clearSelection();if(this._map){this.refresh();}}this.onGDBVersionChange();}return this;},setDefinitionExpression:function(_a2){this._defnExpr=_a2;var _a3=this._mode;if(_a3){_a3.propertyChangeHandler(1);}return this;},getDefinitionExpression:function(){return this._defnExpr;},setTimeDefinition:function(_a4){if(this._isSnapshot){this._timeDefn=_a4;var _a5=this._mode;if(_a5){_a5.propertyChangeHandler(2);}}return this;},getTimeDefinition:function(){return this._timeDefn;},setTimeOffset:function(_a6,_a7){this._timeOffset=_a6;this._timeOffsetUnits=_a7;var _a8=this._mode;if(_a8){_a8.propertyChangeHandler(0);}return this;},setUseMapTime:function(use){this.useMapTime=use;this._toggleTime(!this._suspended);var _a9=this._mode;if(_a9){_a9.propertyChangeHandler(0);}},selectFeatures:function(_aa,_ab,_ac,_ad){_ab=_ab||this.constructor.SELECTION_NEW;var _ae=this._getShallowClone(_aa),map=this._map,_af,dfd=esri._fixDfd(new dojo.Deferred(esri._dfdCanceller));_ae.outFields=this._getOutFields();_ae.returnGeometry=true;if(map){_ae.outSpatialReference=new esri.SpatialReference(map.spatialReference.toJson());}if(!this._applyQueryFilters(_ae)){_af={features:[]};this._selectHandler(_af,_ab,_ac,_ad,dfd);return dfd;}var _b0=this._canDoClientSideQuery(_ae);if(_b0){_af={features:this._doQuery(_ae,_b0)};this._selectHandler(_af,_ab,_ac,_ad,dfd);return dfd;}else{if(this._collection){var err=new Error("FeatureLayer::selectFeatures - "+esri.bundle.layers.FeatureLayer.invalidParams);this._resolve([err],null,_ad,dfd,true);return dfd;}var _b1=this;if(this._ts){_ae._ts=(new Date()).getTime();}var _b2=dfd._pendingDfd=this._task.execute(_ae);_b2.addCallbacks(function(_b3){_b1._selectHandler(_b3,_ab,_ac,_ad,dfd);},function(err){_b1._resolve([err],null,_ad,dfd,true);});return dfd;}},getSelectedFeatures:function(){var _b4=this._selectedFeatures,_b5=[],_b6;for(_b6 in _b4){if(_b4.hasOwnProperty(_b6)){_b5.push(_b4[_b6]);}}return _b5;},clearSelection:function(_b7){var _b8=this._selectedFeatures,_b9=this._mode,_ba;for(_ba in _b8){if(_b8.hasOwnProperty(_ba)){this._unSelectFeatureIIf(_ba,_b9);_b9._removeFeatureIIf(_ba);}}this._selectedFeatures={};if(this._isSelOnly){_b9._applyTimeFilter(true);}if(!_b7){this.onSelectionClear();}return this;},setSelectionSymbol:function(_bb){this._selectionSymbol=_bb;if(_bb){var _bc=this._selectedFeatures,_bd;for(_bd in _bc){if(_bc.hasOwnProperty(_bd)){_bc[_bd].setSymbol(_bb);}}}return this;},getSelectionSymbol:function(){return this._selectionSymbol;},__msigns:[{n:"applyEdits",c:5,a:[{i:0},{i:1}],e:4,f:1}],applyEdits:function(_be,_bf,_c0,_c1,_c2,_c3){var _c4=_c3.assembly,dfd=_c3.dfd;this._applyNormalized(_be,_c4&&_c4[0]);this._applyNormalized(_bf,_c4&&_c4[1]);this.onBeforeApplyEdits(_be,_bf,_c0);var i,_c5={},_c6=this.objectIdField,_c7={f:"json"},_c8=false;if(this._collection){var _c9={};_c9.addResults=_be?dojo.map(_be,function(){_c8=true;return {objectId:this._nextId++,success:true};},this):null;_c9.updateResults=_bf?dojo.map(_bf,function(_ca){_c8=true;var oid=_ca.attributes[_c6];_c5[oid]=_ca;return {objectId:oid,success:true};},this):null;_c9.deleteResults=_c0?dojo.map(_c0,function(_cb){_c8=true;return {objectId:_cb.attributes[_c6],success:true};},this):null;if(_c8){this._editHandler(_c9,_be,_c5,_c1,_c2,dfd);}return;}if(_be&&_be.length>0){_c7.adds=this._convertFeaturesToJson(_be,0,1);_c8=true;}if(_bf&&_bf.length>0){for(i=0;i<_bf.length;i++){var _cc=_bf[i];_c5[_cc.attributes[_c6]]=_cc;}_c7.updates=this._convertFeaturesToJson(_bf,0,0,1);_c8=true;}if(_c0&&_c0.length>0){var ids=[];for(i=0;i<_c0.length;i++){ids.push(_c0[i].attributes[_c6]);}_c7.deletes=ids.join(",");_c8=true;}if(_c8){var _cd=this;return esri.request({url:this._url.path+"/applyEdits",content:dojo.mixin(_c7,this._url.query),callbackParamName:"callback",load:function(_ce){_cd._editHandler(_ce,_be,_c5,_c1,_c2,dfd);},error:function(err){_cd._resolve([err],null,_c2,dfd,true);}},{usePost:true});}},queryFeatures:function(_cf,_d0,_d1){return this._query("execute","onQueryFeaturesComplete",_cf,_d0,_d1);},queryRelatedFeatures:function(_d2,_d3,_d4){return this._query("executeRelationshipQuery","onQueryRelatedFeaturesComplete",_d2,_d3,_d4);},queryIds:function(_d5,_d6,_d7){return this._query("executeForIds","onQueryIdsComplete",_d5,_d6,_d7);},queryCount:function(_d8,_d9,_da){return this._query("executeForCount","onQueryCountComplete",_d8,_d9,_da);},queryAttachmentInfos:function(_db,_dc,_dd){var url=this._url.path+"/"+_db+"/attachments",dfd=new dojo.Deferred(esri._dfdCanceller),_de=this;dfd._pendingDfd=esri.request({url:url,content:dojo.mixin({f:"json"},this._url.query),callbackParamName:"callback",load:function(_df){var _e0=_df.attachmentInfos,_e1;dojo.forEach(_e0,function(_e2){_e1=dojo.objectToQuery({gdbVersion:_de._url.query&&_de._url.query.gdbVersion,layer:_de._url.query&&_de._url.query.layer,token:_de._getToken()});_e2.url=url+"/"+_e2.id+(_e1?("?"+_e1):"");_e2.objectId=_db;});_de._resolve([_e0],"onQueryAttachmentInfosComplete",_dc,dfd);},error:function(err){_de._resolve([err],null,_dd,dfd,true);}});return dfd;},addAttachment:function(_e3,_e4,_e5,_e6){return this._sendAttachment("add",_e3,_e4,_e5,_e6);},updateAttachment:function(_e7,_e8,_e9,_ea,_eb){_e9.appendChild(dojo.create("input",{type:"hidden",name:"attachmentId",value:_e8}));return this._sendAttachment("update",_e7,_e9,_ea,_eb);},deleteAttachments:function(_ec,_ed,_ee,_ef){var url=this._url.path+"/"+_ec+"/deleteAttachments",dfd=new dojo.Deferred(esri._dfdCanceller),_f0=this,_f1={f:"json",attachmentIds:_ed.join(",")};dfd._pendingDfd=esri.request({url:url,content:dojo.mixin(_f1,this._url.query),callbackParamName:"callback",load:dojo.hitch(this,function(_f2){var _f3=_f2.deleteAttachmentResults;_f3=dojo.map(_f3,function(_f4){var res=new esri.layers.FeatureEditResult(_f4);res.attachmentId=res.objectId;res.objectId=_ec;return res;});_f0._resolve([_f3],"onDeleteAttachmentsComplete",_ee,dfd);}),error:function(err){_f0._resolve([err],null,_ef,dfd,true);}},{usePost:true});return dfd;},addType:function(_f5){if(!this._collection){return false;}var _f6=this.types;if(_f6){var _f7=dojo.some(_f6,function(_f8){if(_f8.id==_f5.id){return true;}return false;});if(_f7){return false;}else{_f6.push(_f5);}}else{this.types=[_f5];}this._typesDirty=true;return true;},deleteType:function(_f9){if(!this._collection){return;}var _fa=this.types;if(_fa){var _fb=-1;dojo.some(_fa,function(_fc,_fd){if(_fc.id==_f9){_fb=_fd;return true;}return false;});if(_fb>-1){this._typesDirty=true;return _fa.splice(_fb,1)[0];}}},toJson:function(){var _fe=this._json,_ff=dojo.isString(_fe)?dojo.fromJson(_fe):dojo.clone(_fe);if(!_ff){return;}_ff=_ff.layerDefinition?_ff:{layerDefinition:_ff};var _100=_ff.layerDefinition,_101=this._collection;if(_101&&this._typesDirty){_100.types=dojo.map(this.types||[],function(type){return type.toJson();});var _102=this.renderer,_103=_100.drawingInfo;if(_103&&_102&&_102.declaredClass.indexOf("TemporalRenderer")===-1){_103.renderer=_102.toJson();}}var _104=null;if(!(_101&&!this._fcAdded)){_104={geometryType:_100.geometryType,features:this._convertFeaturesToJson(this.graphics,true)};}_ff.featureSet=dojo.mixin({},_ff.featureSet||{},_104);if(_101){_ff.nextObjectId=this._nextId;_100.capabilities=this.capabilities;}return _ff;},onSelectionComplete:function(){},onSelectionClear:function(){},onBeforeApplyEdits:function(){},onEditsComplete:function(){},onQueryFeaturesComplete:function(){},onQueryRelatedFeaturesComplete:function(){},onQueryIdsComplete:function(){},onQueryCountComplete:function(){},onQueryAttachmentInfosComplete:function(){},onAddAttachmentComplete:function(){},onUpdateAttachmentComplete:function(){},onDeleteAttachmentsComplete:function(){},onCapabilitiesChange:function(){},onGDBVersionChange:function(){},onQueryLimitExceeded:function(){},_updateCaps:function(){var _105=this._editable,_106=dojo.trim(this.capabilities||""),_107=dojo.map((_106?_106.split(","):[]),dojo.trim),caps=dojo.map((_106?_106.toLowerCase().split(","):[]),dojo.trim),_108=dojo.indexOf(caps,"editing"),cap,i,_109,_10a={"Create":dojo.indexOf(caps,"create"),"Update":dojo.indexOf(caps,"update"),"Delete":dojo.indexOf(caps,"delete")};if(_105&&_108===-1){_107.push("Editing");}else{if(!_105&&_108>-1){_109=[_108];for(cap in _10a){if(_10a[cap]>-1){_109.push(_10a[cap]);}}_109.sort();for(i=_109.length-1;i>=0;i--){_107.splice(_109[i],1);}}}this.capabilities=_107.join(",");},_counter:{value:0},_getUniqueId:function(){return this._counter.value++;},_getDesiredStatus:function(){return this.visible&&this._isMapAtVisibleScale();},_isMapAtVisibleScale:function(){if(!this._map){return false;}var _10b=esri.geometry.getScale(this._map);var _10c=this.minScale,_10d=this.maxScale,_10e=!_10c,_10f=!_10d;if(!_10e&&_10b<=_10c){_10e=true;}if(!_10f&&_10b>=_10d){_10f=true;}return (_10e&&_10f)?true:false;},_suspend:function(){this.inherited("_suspend",arguments);this._toggleTime(false);var mode=this._mode;if(mode){mode.suspend();}},_resume:function(){this.inherited("_resume",arguments);this._toggleTime(true);var mode=this._mode;if(mode){mode.resume();}},_zoomHandler:function(){var map=this._map;if(map&&map.loaded){if(this._autoGeneralize){this._maxOffset=Math.floor(map.extent.getWidth()/map.width);}this._updateStatus();}},_toggleTime:function(_110){var map=this._map;if(_110&&this.timeInfo&&this.useMapTime&&map){this._mapTimeExtent=map.timeExtent;if(!this._timeConnect){this._timeConnect=dojo.connect(map,"onTimeExtentChange",this,this._timeChangeHandler);}}else{this._mapTimeExtent=null;dojo.disconnect(this._timeConnect);this._timeConnect=null;}},_timeChangeHandler:function(_111){this._mapTimeExtent=_111;var mode=this._mode;if(mode){mode.propertyChangeHandler(0);}},_getOffsettedTE:function(_112){var _113=this._timeOffset,_114=this._timeOffsetUnits;return (_112&&_113&&_114)?_112.offset(-1*_113,_114):_112;},_getTimeOverlap:function(_115,_116){if(_115&&_116){return _115.intersection(_116);}else{return _115||_116;}},_getTimeFilter:function(_117){var _118=this.getTimeDefinition(),_119=null,_11a;if(_118||_119){_11a=this._getTimeOverlap(_118,_119);if(!_11a){return [false];}}if(_117){_117=_11a?this._getTimeOverlap(_117,_11a):_117;if(!_117){return [false];}}else{_117=_11a;}return [true,_117];},_getAttributeFilter:function(_11b){var _11c=this.getDefinitionExpression();if(_11b){_11b=_11c?"("+_11c+") AND ("+_11b+")":_11b;}else{_11b=_11c;}return _11b;},_applyQueryFilters:function(_11d){_11d.where=this._getAttributeFilter(_11d.where);_11d.maxAllowableOffset=this._maxOffset;if(this.timeInfo){var _11e=this._getTimeFilter(_11d.timeExtent);if(!_11e[0]){return false;}else{_11d.timeExtent=_11e[1];}}return true;},_add:function(_11f){var _120=this._selectionSymbol,attr=_11f.attributes,_121=this.visibilityField;if(_120&&this._isSelOnly){_11f.setSymbol(_120);}if(_121&&attr&&attr.hasOwnProperty(_121)){_11f[attr[_121]?"show":"hide"]();}return this.add.apply(this,arguments);},_remove:function(){return this.remove.apply(this,arguments);},_canDoClientSideQuery:function(_122){var _123=[],map=this._map;if(this._isTable||!map){return;}if(_122.text||(_122.where&&_122.where!==this.getDefinitionExpression())){return;}var _124=this._isSnapshot,_125=this._isSelOnly;var _126=_122.geometry;if(_126){if(!_125&&_122.spatialRelationship===esri.tasks.Query.SPATIAL_REL_INTERSECTS&&(_126.type==="extent"&&(_124||map.extent.contains(_126)))){_123.push(1);}else{return;}}var ids=_122.objectIds;if(ids){if(_124){_123.push(2);}else{var len=ids.length,mode=this._mode,_127=0,i;for(i=0;i<len;i++){if(mode._getFeature(ids[i])){_127++;}}if(_127===len){_123.push(2);}else{return;}}}if(this.timeInfo){var _128=_122.timeExtent,_129=this._mapTimeExtent;if(_124){if(_128){_123.push(3);}}else{if(_125){if(_128){return;}}else{if(_129){if(dojo.indexOf(_123,2)!==-1){if(_128){_123.push(3);}}else{return;}}else{if(_123.length>0){if(_128){_123.push(3);}}else{if(_128){return;}}}}}}return _123.length>0?_123:null;},_doQuery:function(_12a,_12b,_12c){var _12d=[],mode=this._mode,_12e=this.objectIdField,i,len,_12f;if(dojo.indexOf(_12b,2)!==-1){_12d=[];var ids=_12a.objectIds;len=ids.length;for(i=0;i<len;i++){var obj=mode._getFeature(ids[i]);if(obj){_12d.push(obj);}}if(_12d.length===0){return [];}}if(dojo.indexOf(_12b,1)!==-1){_12f=_12d.length>0?_12d:this.graphics;len=_12f.length;var _130=_12a.geometry._normalize(null,true);_12d=[];for(i=0;i<len;i++){var _131=_12f[i],_132=_131.geometry;if(_132){if(this.normalization&&_130.length){if(_130[0].intersects(_132)||_130[1].intersects(_132)){_12d.push(_131);}}else{if(_130.intersects(_132)){_12d.push(_131);}}}}if(_12d.length===0){return [];}}if(dojo.indexOf(_12b,3)!==-1){if(this.timeInfo){_12f=_12d.length>0?_12d:this.graphics;var time=_12a.timeExtent,_133=this._filterByTime(_12f,time.startTime,time.endTime);_12d=_133.match;}}if(_12c){return dojo.map(_12d,function(obj){return obj.attributes[_12e];},this);}else{return _12d;}},_filterByTime:function(_134,_135,_136){var _137=this._startTimeField,_138=this._endTimeField,_139;if(!this._twoTimeFields){_139=_137||_138;}var _13a=esri._isDefined,yea=[],nay=[],i,len=_134.length,_13b,_13c;_135=_135?_135.getTime():-Infinity;_136=_136?_136.getTime():Infinity;if(_139){for(i=0;i<len;i++){_13b=_134[i];_13c=_13b.attributes;var time=_13c[_139];if(time>=_135&&time<=_136){yea.push(_13b);}else{nay.push(_13b);}}}else{for(i=0;i<len;i++){_13b=_134[i];_13c=_13b.attributes;var _13d=_13c[_137],end=_13c[_138];_13d=_13a(_13d)?_13d:-Infinity;end=_13a(end)?end:Infinity;if((_13d>=_135&&_13d<=_136)||(end>=_135&&end<=_136)||(_135>=_13d&&_136<=end)){yea.push(_13b);}else{nay.push(_13b);}}}return {match:yea,noMatch:nay};},_resolve:function(args,_13e,_13f,dfd,_140){if(_13e){this[_13e].apply(this,args);}if(_13f){_13f.apply(null,args);}if(dfd){esri._resDfd(dfd,args,_140);}},_getShallowClone:function(_141){var _142=new esri.tasks.Query(),prop;for(prop in _141){if(_141.hasOwnProperty(prop)){_142[prop]=_141[prop];}}return _142;},_query:function(type,_143,_144,_145,_146){var that=this,dfd=new dojo.Deferred(esri._dfdCanceller);var _147=function(_148,_149){if(!_149&&type==="execute"&&!that._isTable){var _14a=_148.features,mode=that._mode,_14b=that.objectIdField,il=_14a.length,i;for(i=il-1;i>=0;i--){var oid=_14a[i].attributes[_14b];var _14c=mode._getFeature(oid);if(_14c){_14a.splice(i,1,_14c);}}}that._resolve([_148],_143,_145,dfd);};if(type!=="executeRelationshipQuery"){_144=this._getShallowClone(_144);_144.outFields=this._getOutFields();_144.returnGeometry=true;var map=this._map,_14d;if(map){_144.outSpatialReference=new esri.SpatialReference(map.spatialReference.toJson());}if(!this._applyQueryFilters(_144)){switch(type){case "execute":_14d=new esri.tasks.FeatureSet({features:[]});break;case "executeForIds":_14d=[];break;case "executeForCount":_14d=0;break;}_147(_14d,true);return dfd;}var _14e=this._canDoClientSideQuery(_144);if(_14e){var _14f=this._doQuery(_144,_14e,(type==="executeForIds"||type==="executeForCount"));switch(type){case "execute":_14d=new esri.tasks.FeatureSet();_14d.features=_14f;break;case "executeForIds":_14d=_14f;break;case "executeForCount":_14d=_14f.length;break;}_147(_14d,true);return dfd;}}if(this._collection){var err=new Error("FeatureLayer::_query - "+esri.bundle.layers.FeatureLayer.invalidParams);this._resolve([err],null,_146,dfd,true);return dfd;}if(this._ts){_144._ts=(new Date()).getTime();}var temp=dfd._pendingDfd=this._task[type](_144);temp.addCallbacks(_147,function(err){that._resolve([err],null,_146,dfd,true);});return dfd;},_convertFeaturesToJson:function(_150,_151,_152,_153){var json=[],_154=this._selectionSymbol,_155=this.visibilityField,i,_156,_157=this.objectIdField;if(_152||_153){_156=dojo.filter(this.fields,function(_158){return (_158.editable===false)&&(!_153||(_158.name!==_157));});}for(i=0;i<_150.length;i++){var _159=_150[i],_15a={},_15b=_159.geometry,attr=_159.attributes,_15c=_159.symbol;if(_15b&&(!_153||this.allowGeometryUpdates)){_15a.geometry=_15b.toJson();}if(_155){_15a.attributes=attr=dojo.mixin({},attr);attr[_155]=_159.visible?1:0;}else{if(attr){_15a.attributes=dojo.mixin({},attr);}}if(_15a.attributes&&_156&&_156.length){dojo.forEach(_156,function(_15d){delete _15a.attributes[_15d.name];});}if(_15c&&(_15c!==_154)){_15a.symbol=_15c.toJson();}json.push(_15a);}return _151?json:dojo.toJson(json);},_selectHandler:function(_15e,_15f,_160,_161,dfd){var _162,ctor=this.constructor;switch(_15f){case ctor.SELECTION_NEW:this.clearSelection(true);_162=true;break;case ctor.SELECTION_ADD:_162=true;break;case ctor.SELECTION_SUBTRACT:_162=false;break;}var i,_163=_15e.features,mode=this._mode,_164=[],_165=this.objectIdField,_166,oid;if(_162){for(i=0;i<_163.length;i++){_166=_163[i];oid=_166.attributes[_165];var _167=mode._addFeatureIIf(oid,_166);_164.push(_167);this._selectFeatureIIf(oid,_167,mode);}}else{for(i=0;i<_163.length;i++){_166=_163[i];oid=_166.attributes[_165];this._unSelectFeatureIIf(oid,mode);var _168=mode._removeFeatureIIf(oid);_164.push(_168||_166);}}if(this._isSelOnly){mode._applyTimeFilter(true);}this._resolve([_164,_15f,_15e.exceededTransferLimit?{queryLimitExceeded:true}:null],"onSelectionComplete",_160,dfd);if(_15e.exceededTransferLimit){this.onQueryLimitExceeded();}},_selectFeatureIIf:function(oid,_169,mode){var _16a=this._selectedFeatures,_16b=_16a[oid];if(!_16b){mode._incRefCount(oid);_16a[oid]=_169;if(!this._isTable){this._setSelectSymbol(_169);}}return _16b||_169;},_unSelectFeatureIIf:function(oid,mode){var _16c=this._selectedFeatures[oid];if(_16c){mode._decRefCount(oid);delete this._selectedFeatures[oid];if(!this._isTable){this._setUnSelectSymbol(_16c);}}return _16c;},_isSelected:function(_16d){},_setSelectSymbol:function(_16e){var _16f=this._selectionSymbol;if(_16f&&!this._isSelOnly){_16e.setSymbol(_16f);}},_setUnSelectSymbol:function(_170){var _171=this._selectionSymbol;if(_171&&!this._isSelOnly){if(_171===_170.symbol){_170.setSymbol(null,true);}}},_getOutFields:function(){var _172=dojo.filter([this.objectIdField,this.typeIdField,this.creatorField,this._startTimeField,this._endTimeField,this._trackIdField].concat(this._rendererFields),function(_173,_174,arr){return !!_173&&(dojo.indexOf(arr,_173)===_174);});var _175=dojo.clone(this._outFields);if(_175){if(dojo.indexOf(_175,"*")!==-1){return _175;}dojo.forEach(_172,function(_176){if(dojo.indexOf(_175,_176)===-1){_175.push(_176);}});return _175;}else{return _172;}},_checkFields:function(_177){var _178=_177||this._getOutFields();dojo.forEach(_178,function(_179){if(_179==="*"){return;}if(!this._getField(_179)){console.debug("esri.layers.FeatureLayer: "+esri.substitute({url:this.url,field:_179},esri.bundle.layers.FeatureLayer.fieldNotFound));}},this);if(!_177&&!this._isTable&&!this._fserver&&!this._collection){var _17a=dojo.some(this.fields,function(_17b){return (_17b&&_17b.type==="esriFieldTypeGeometry")?true:false;});if(!_17a){console.debug("esri.layers.FeatureLayer: "+esri.substitute({url:this.url},esri.bundle.layers.FeatureLayer.noGeometryField));}}},_fixRendererFields:function(){var _17c=this.renderer;if(_17c&&this.fields.length>0){var _17d=dojo.filter([_17c,_17c.observationRenderer,_17c.latestObservationRenderer,_17c.trackRenderer],esri._isDefined);var _17e=[];dojo.forEach(_17d,function(rnd){var _17f,_180;_180=rnd.attributeField;if(_180){_17f=!this._getField(_180)&&this._getField(_180,true);if(_17f){rnd.attributeField=_17f.name;}}_180=rnd.attributeField2;if(_180){_17f=!this._getField(_180)&&this._getField(_180,true);if(_17f){rnd.attributeField2=_17f.name;}}_180=rnd.attributeField3;if(_180){_17f=!this._getField(_180)&&this._getField(_180,true);if(_17f){rnd.attributeField3=_17f.name;}}_17e.push(rnd.attributeField);_17e.push(rnd.attributeField2);_17e.push(rnd.attributeField3);},this);this._rendererFields=dojo.filter(_17e,esri._isDefined);}},_getField:function(_181,_182){var _183=this.fields;if(_183.length===0){return null;}var _184;if(_182){_181=_181.toLowerCase();}dojo.some(_183,function(_185){var _186=false;if(_182){_186=(_185&&_185.name.toLowerCase()===_181)?true:false;}else{_186=(_185&&_185.name===_181)?true:false;}if(_186){_184=_185;}return _186;});return _184;},_getDateOpts:function(){if(!this._dtOpts){var _187=dojo.map(dojo.filter(this.fields,function(_188){return !!(_188&&_188.type==="esriFieldTypeDate");}),function(_189){return _189.name;});this._dtOpts={properties:_187};}return this._dtOpts;},_applyNormalized:function(_18a,_18b){if(_18a&&_18b){dojo.forEach(_18a,function(_18c,_18d){if(_18c&&_18b[_18d]){_18c.setGeometry(_18b[_18d]);}});}},_editHandler:function(_18e,adds,_18f,_190,_191,dfd){var _192=_18e.addResults,_193=_18e.updateResults,_194=_18e.deleteResults,i,_195,oid,_196,attr,_197=this.objectIdField,mode=this._mode,_198=this._isTable;var _199=this.editFieldsInfo,_19a=this._getOutFields()||[],_19b=_199&&_199.creatorField,_19c=_199&&_199.creationDateField,_19d=_199&&_199.editorField,_19e=_199&&_199.editDateField,_19f=_199&&_199.realm;if(dojo.indexOf(_19a,"*")===-1){if(_19b&&dojo.indexOf(_19a,_19b)===-1){_19b=null;}if(_19c&&dojo.indexOf(_19a,_19c)===-1){_19c=null;}if(_19d&&dojo.indexOf(_19a,_19d)===-1){_19d=null;}if(_19e&&dojo.indexOf(_19a,_19e)===-1){_19e=null;}}var _1a0=(_19c||_19e)?(new Date()).getTime():null,_1a1=(_19b||_19d)?this.getUserId():undefined;if(_1a1&&_19f){_1a1=_1a1+"@"+_19f;}if(_192){for(i=0;i<_192.length;i++){_192[i]=new esri.layers.FeatureEditResult(_192[i]);if(_198){continue;}_195=_192[i];if(_195.success){oid=_195.objectId;_196=adds[i];var gl=_196._graphicsLayer;if(gl&&gl!==this){gl.remove(_196);}attr=_196.attributes||{};attr[_197]=oid;if(_19b){attr[_19b]=_1a1;}if(_19d){attr[_19d]=_1a1;}if(_19c){attr[_19c]=_1a0;}if(_19e){attr[_19e]=_1a0;}_196.setAttributes(attr);mode.drawFeature(_196);}}}if(_193){for(i=0;i<_193.length;i++){_193[i]=new esri.layers.FeatureEditResult(_193[i]);if(_198){continue;}_195=_193[i];if(_195.success){oid=_195.objectId;_196=_18f[oid];var _1a2=mode._getFeature(oid);if(_1a2){if(_1a2.geometry!==_196.geometry){_1a2.setGeometry(esri.geometry.fromJson(_196.geometry.toJson()));}this._repaint(_1a2,oid);}_196=_1a2||_196;attr=_196.attributes||{};if(_19d){attr[_19d]=_1a1;}if(_19e){attr[_19e]=_1a0;}_196.setAttributes(attr);}}}if(_194){var _1a3=[];for(i=0;i<_194.length;i++){_194[i]=new esri.layers.FeatureEditResult(_194[i]);if(_198){continue;}_195=_194[i];if(_195.success){oid=_195.objectId;_196=mode._getFeature(oid);if(_196){if(this._unSelectFeatureIIf(oid,mode)){_1a3.push(_196);}_196._count=0;mode._removeFeatureIIf(oid);}}}if(_1a3.length>0){this.onSelectionComplete(_1a3,this.constructor.SELECTION_SUBTRACT);}}this._resolve([_192,_193,_194],"onEditsComplete",_190,dfd);},_sendAttachment:function(type,_1a4,_1a5,_1a6,_1a7){var _1a8=(type==="add")?"addAttachment":"updateAttachment",url=this._url.path+"/"+_1a4+"/"+_1a8,self=this;var dfd=esri.request({url:url,form:_1a5,content:dojo.mixin(this._url.query,{f:"json",token:this._getToken()||undefined}),callbackParamName:"callback.html",handleAs:"json"}).addCallback(function(_1a9){var _1aa=(type==="add")?"addAttachmentResult":"updateAttachmentResult",_1ab=(type==="add")?"onAddAttachmentComplete":"onUpdateAttachmentComplete",_1ac=new esri.layers.FeatureEditResult(_1a9[_1aa]);_1ac.attachmentId=_1ac.objectId;_1ac.objectId=_1a4;self._resolve([_1ac],_1ab,_1a6);return _1ac;}).addErrback(function(_1ad){self._resolve([_1ad],null,_1a7,null,true);});return dfd;},_repaint:function(_1ae,oid,_1af){oid=esri._isDefined(oid)?oid:_1ae.attributes[this.objectIdField];if(!(oid in this._selectedFeatures)||!this._selectionSymbol){_1ae.setSymbol(_1ae.symbol,_1af);}},_getKind:function(_1b0){var _1b1=this._trackManager;if(_1b1){return _1b1.isLatestObservation(_1b0)?1:0;}return 0;}});dojo.mixin(esri.layers.FeatureLayer,{MODE_SNAPSHOT:0,MODE_ONDEMAND:1,MODE_SELECTION:2,SELECTION_NEW:3,SELECTION_ADD:4,SELECTION_SUBTRACT:5,POPUP_NONE:"esriServerHTMLPopupTypeNone",POPUP_HTML_TEXT:"esriServerHTMLPopupTypeAsHTMLText",POPUP_URL:"esriServerHTMLPopupTypeAsURL"});esri._createWrappers("esri.layers.FeatureLayer");dojo.declare("esri.layers.FeatureType",null,{constructor:function(json){if(json&&dojo.isObject(json)){this.id=json.id;this.name=json.name;var _1b2=json.symbol;if(_1b2){this.symbol=esri.symbol.fromJson(_1b2);}var _1b3=json.domains,_1b4,i;var _1b5=this.domains={};for(_1b4 in _1b3){if(_1b3.hasOwnProperty(_1b4)){var _1b6=_1b3[_1b4];switch(_1b6.type){case "range":_1b5[_1b4]=new esri.layers.RangeDomain(_1b6);break;case "codedValue":_1b5[_1b4]=new esri.layers.CodedValueDomain(_1b6);break;case "inherited":_1b5[_1b4]=new esri.layers.InheritedDomain(_1b6);break;}}}var _1b7=json.templates;if(_1b7){var _1b8=this.templates=[];for(i=0;i<_1b7.length;i++){_1b8.push(new esri.layers.FeatureTemplate(_1b7[i]));}}}},toJson:function(){var json={id:this.id,name:this.name,symbol:this.symbol&&this.symbol.toJson()};var _1b9,_1ba=this.domains,_1bb=this.templates,_1bc=esri._sanitize;if(_1ba){var _1bd=json.domains={};for(_1b9 in _1ba){if(_1ba.hasOwnProperty(_1b9)){_1bd[_1b9]=_1ba[_1b9]&&_1ba[_1b9].toJson();}}_1bc(_1bd);}if(_1bb){json.templates=dojo.map(_1bb,function(_1be){return _1be.toJson();});}return _1bc(json);}});dojo.declare("esri.layers.FeatureTemplate",null,{constructor:function(json){if(json&&dojo.isObject(json)){this.name=json.name;this.description=json.description;this.drawingTool=json.drawingTool;var _1bf=json.prototype;this.prototype=new esri.Graphic(_1bf.geometry,null,_1bf.attributes);}},toJson:function(){return esri._sanitize({name:this.name,description:this.description,drawingTool:this.drawingTool,prototype:this.prototype&&this.prototype.toJson()});}});dojo.mixin(esri.layers.FeatureTemplate,{TOOL_AUTO_COMPLETE_POLYGON:"esriFeatureEditToolAutoCompletePolygon",TOOL_CIRCLE:"esriFeatureEditToolCircle",TOOL_ELLIPSE:"esriFeatureEditToolEllipse",TOOL_FREEHAND:"esriFeatureEditToolFreehand",TOOL_LINE:"esriFeatureEditToolLine",TOOL_NONE:"esriFeatureEditToolNone",TOOL_POINT:"esriFeatureEditToolPoint",TOOL_POLYGON:"esriFeatureEditToolPolygon",TOOL_RECTANGLE:"esriFeatureEditToolRectangle",TOOL_ARROW:"esriFeatureEditToolArrow",TOOL_TRIANGLE:"esriFeatureEditToolTriangle",TOOL_LEFT_ARROW:"esriFeatureEditToolLeftArrow",TOOL_RIGHT_ARROW:"esriFeatureEditToolRightArrow",TOOL_UP_ARROW:"esriFeatureEditToolUpArrow",TOOL_DOWN_ARROW:"esriFeatureEditToolDownArrow"});dojo.declare("esri.layers.FeatureEditResult",null,{constructor:function(json){if(json&&dojo.isObject(json)){this.objectId=json.objectId;this.success=json.success;if(!json.success){var err=json.error;this.error=new Error();this.error.code=err.code;this.error.message=err.description;}}}});dojo.declare("esri.layers._RenderMode",null,{constructor:function(){this._prefix="jsonp_"+(dojo._scopeName||"dojo")+"IoScript";},initialize:function(map){},propertyChangeHandler:function(type){},destroy:function(){},drawFeature:function(_1c0){},suspend:function(){},resume:function(){},refresh:function(){},_incRefCount:function(oid){var _1c1=this._featureMap[oid];if(_1c1){_1c1._count++;}},_decRefCount:function(oid){var _1c2=this._featureMap[oid];if(_1c2){_1c2._count--;}},_getFeature:function(oid){return this._featureMap[oid];},_addFeatureIIf:function(oid,_1c3){var fmap=this._featureMap,_1c4=fmap[oid],_1c5=this.featureLayer;if(!_1c4){fmap[oid]=_1c3;_1c5._add(_1c3);_1c3._count=0;}return _1c4||_1c3;},_removeFeatureIIf:function(oid){var _1c6=this._featureMap[oid],_1c7=this.featureLayer;if(_1c6){if(_1c6._count){return;}delete this._featureMap[oid];_1c7._remove(_1c6);}return _1c6;},_clearIIf:function(){var i,_1c8=this.featureLayer,_1c9=_1c8.graphics,_1ca=_1c8._selectedFeatures,_1cb=_1c8.objectIdField;for(i=_1c9.length-1;i>=0;i--){var _1cc=_1c9[i];var oid=_1cc.attributes[_1cb];if(oid in _1ca){_1cc._count=1;continue;}_1cc._count=0;this._removeFeatureIIf(oid);}},_isPending:function(id){var dfd=dojo.io.script[this._prefix+id];return dfd?true:false;},_cancelPendingRequest:function(dfd,id){dfd=dfd||dojo.io.script[this._prefix+id];if(dfd){try{dfd.cancel();dojo.io.script._validCheck(dfd);}catch(e){}}},_purgeRequests:function(){dojo.io.script._validCheck(null);},_toggleVisibility:function(show){var _1cd=this.featureLayer,_1ce=_1cd.graphics,_1cf=show?"show":"hide",i,len=_1ce.length;show=show&&_1cd._ager;for(i=0;i<len;i++){var _1d0=_1ce[i];_1d0[_1cf]();if(show){_1cd._repaint(_1d0);}}},_applyTimeFilter:function(_1d1){var _1d2=this.featureLayer;if(!_1d2.timeInfo||_1d2._suspended){return;}if(!_1d1){_1d2._fireUpdateStart();}var _1d3=_1d2._trackManager;if(_1d3){_1d3.clearTracks();}var defn=_1d2.getTimeDefinition(),_1d4=_1d2._getOffsettedTE(_1d2._mapTimeExtent);if(_1d4){_1d4=_1d2._getTimeOverlap(defn,_1d4);if(_1d4){var _1d5=_1d2._filterByTime(_1d2.graphics,_1d4.startTime,_1d4.endTime);if(_1d3){_1d3.addFeatures(_1d5.match);}dojo.forEach(_1d5.match,function(_1d6){var _1d7=_1d6._shape;if(!_1d6.visible){_1d6.show();_1d7=_1d6._shape;_1d7&&_1d7._moveToFront();}if(_1d2._ager&&_1d7){_1d2._repaint(_1d6);}});dojo.forEach(_1d5.noMatch,function(_1d8){if(_1d8.visible){_1d8.hide();}});}else{this._toggleVisibility(false);}}else{if(_1d3){_1d3.addFeatures(_1d2.graphics);}this._toggleVisibility(true);}if(_1d3){_1d3.moveLatestToFront();_1d3.drawTracks();}if(!_1d1){_1d2._fireUpdateEnd();}}});dojo.declare("esri.layers._SelectionMode",[esri.layers._RenderMode],{constructor:function(_1d9){this.featureLayer=_1d9;this._featureMap={};},initialize:function(map){this.map=map;this._init=true;},propertyChangeHandler:function(type){if(this._init&&type===0){this._applyTimeFilter();}},destroy:function(){this._init=false;},resume:function(){this.propertyChangeHandler(0);}});dojo.declare("esri.layers._SnapshotMode",[esri.layers._RenderMode],{constructor:function(_1da){this.featureLayer=_1da;this._featureMap={};this._drawFeatures=dojo.hitch(this,this._drawFeatures);this._queryErrorHandler=dojo.hitch(this,this._queryErrorHandler);},initialize:function(map){this.map=map;var _1db=this.featureLayer;if(_1db._collection){this._applyTimeFilter();}else{this._fetchAll();}this._init=true;},propertyChangeHandler:function(type){if(this._init){if(type){this._fetchAll();}else{this._applyTimeFilter();}}},destroy:function(){this._init=false;},drawFeature:function(_1dc){var _1dd=this.featureLayer,_1de=_1dd.objectIdField,oid=_1dc.attributes[_1de];this._addFeatureIIf(oid,_1dc);this._incRefCount(oid);},resume:function(){this.propertyChangeHandler(0);},refresh:function(){var _1df=this.featureLayer;if(_1df._collection){_1df._fireUpdateStart();_1df._refresh(true);_1df._fireUpdateEnd();}else{this._fetchAll();}},_getRequestId:function(_1e0){var id="_"+_1e0.name+_1e0.layerId+_1e0._ulid;return id.replace(/[^a-zA-Z0-9\_]+/g,"_");},_fetchAll:function(){var _1e1=this.featureLayer;if(_1e1._collection){return;}_1e1._fireUpdateStart();this._clearIIf();this._sendRequest();},_sendRequest:function(){var map=this.map,_1e2=this.featureLayer,_1e3=_1e2.getDefinitionExpression();var _1e4=new esri.tasks.Query();_1e4.outFields=_1e2._getOutFields();_1e4.where=_1e3||"1=1";_1e4.returnGeometry=true;_1e4.outSpatialReference=new esri.SpatialReference(map.spatialReference.toJson());_1e4.timeExtent=_1e2.getTimeDefinition();_1e4.maxAllowableOffset=_1e2._maxOffset;if(_1e2._ts){_1e4._ts=(new Date()).getTime();}var _1e5;if(_1e2._usePatch){_1e5=this._getRequestId(_1e2);this._cancelPendingRequest(null,_1e5);}_1e2._task.execute(_1e4,this._drawFeatures,this._queryErrorHandler,_1e5);},_drawFeatures:function(_1e6){this._purgeRequests();var _1e7=_1e6.features,_1e8=this.featureLayer,_1e9=_1e8.objectIdField,i,len=_1e7.length,_1ea,oid;for(i=0;i<len;i++){_1ea=_1e7[i];oid=_1ea.attributes[_1e9];this._addFeatureIIf(oid,_1ea);this._incRefCount(oid);}this._applyTimeFilter(true);_1e8._fireUpdateEnd(null,_1e6.exceededTransferLimit?{queryLimitExceeded:true}:null);if(_1e6.exceededTransferLimit){_1e8.onQueryLimitExceeded();}},_queryErrorHandler:function(err){this._purgeRequests();var _1eb=this.featureLayer;_1eb._errorHandler(err);_1eb._fireUpdateEnd(err);}});dojo.declare("esri.layers._OnDemandMode",[esri.layers._RenderMode],{constructor:function(_1ec){this.featureLayer=_1ec;this._featureMap={};this._queryErrorHandler=dojo.hitch(this,this._queryErrorHandler);},initialize:function(map){this.map=map;this._initialize();this._init=true;},propertyChangeHandler:function(type){if(this._init){if(type<2){this._zoomHandler();}}},destroy:function(){this._disableConnectors();this._init=false;},drawFeature:function(_1ed){var _1ee=this._gridLayer,geom=_1ed.geometry,_1ef=[];if(!geom){return;}_1ef=_1ee.getCellsInExtent((geom.type==="point")?{xmin:geom.x,ymin:geom.y,xmax:geom.x,ymax:geom.y}:geom.getExtent(),false).cells;var _1f0=this._cellMap,i,cell,oid=_1ed.attributes[this.featureLayer.objectIdField],_1f1,row,col;for(i=0;i<_1ef.length;i++){cell=_1ef[i];_1f1=cell.latticeID;row=cell.row;col=cell.col;if(_1f1){cell=(_1f0[_1f1]=(_1f0[_1f1]||cell));}else{_1f0[row]=_1f0[row]||{};cell=(_1f0[row][col]=(_1f0[row][col]||cell));}cell.features=cell.features||[];cell.features.push(_1ed);this._addFeatureIIf(oid,_1ed);this._incRefCount(oid);}},suspend:function(){if(!this._init){return;}this._disableConnectors();},resume:function(){if(!this._init){return;}this._enableConnectors();this._zoomHandler();},refresh:function(){this._zoomHandler();},_initialize:function(){var map=this.map,_1f2=this.featureLayer;var _1f3=_1f2._srInfo;this._gridLayer=new esri.layers._GridLayout(new esri.geometry.Point(_1f3?_1f3.valid[0]:map.extent.xmin,map.extent.ymax,map.spatialReference),{width:_1f2._tileWidth,height:_1f2._tileHeight},{width:map.width,height:map.height},_1f3);this._ioQueue=[];if(!_1f2._suspended){this._zoomHandler();this._enableConnectors();}},_enableConnectors:function(){var map=this.map;this._zoomConnect=dojo.connect(map,"onZoomEnd",this,this._zoomHandler);this._panConnect=dojo.connect(map,"onPanEnd",this,this._panHandler);this._resizeConnect=dojo.connect(map,"onResize",this,this._panHandler);},_disableConnectors:function(){dojo.disconnect(this._zoomConnect);dojo.disconnect(this._panConnect);dojo.disconnect(this._resizeConnect);},_zoomHandler:function(){this._processIOQueue(true);var _1f4=this.featureLayer,map=this.map;if(_1f4._suspended){return;}_1f4._fireUpdateStart();this._clearIIf();var _1f5=_1f4._trackManager;if(_1f5){_1f5.clearTracks();}this._cellMap={};this._gridLayer.setResolution(map.extent);this._sendRequest();},_panHandler:function(){this.featureLayer._fireUpdateStart();this._sendRequest(this.featureLayer._resized&&arguments[0]);},_getRequestId:function(_1f6,cell){var id="_"+_1f6.name+_1f6.layerId+_1f6._ulid+"_"+cell.resolution+"_"+(cell.latticeID||(cell.row+"_"+cell.col));return id.replace(/[^a-zA-Z0-9\_]+/g,"_");},_sendRequest:function(_1f7){this._exceeds=false;var _1f8=this.featureLayer,map=this.map,_1f9=_1f7||map.extent,_1fa=this._gridLayer.getCellsInExtent(_1f9,_1f8.latticeTiling),_1fb=_1fa.cells;if(!_1f8._editable){var _1fc=this._cellMap;_1fb=dojo.filter(_1fb,function(cell){if(cell.lattice){if(_1fc[cell.latticeID]){return false;}}else{if(_1fc[cell.row]&&_1fc[cell.row][cell.col]){return false;}}return true;});}var _1fd=_1f8._getOutFields(),_1fe=_1f8.getDefinitionExpression(),time=_1f8._getOffsettedTE(_1f8._mapTimeExtent),_1ff=_1f8._usePatch,_200=this._ioQueue,i,self=this,func=this._drawFeatures,cell,_201,_202;this._pending=this._pending||0;for(i=0;i<_1fb.length;i++){cell=_1fb[i];_201=new esri.tasks.Query();_201.geometry=cell.extent||cell.lattice;_201.outFields=_1fd;_201.where=_1fe;if(_1f8.latticeTiling&&cell.extent){_201.spatialRelationship=esri.tasks.Query.SPATIAL_REL_CONTAINS;}_201.returnGeometry=true;_201.timeExtent=time;_201.maxAllowableOffset=_1f8._maxOffset;if(_1f8._ts){_201._ts=(new Date()).getTime();}_202=null;if(_1ff){_202=this._getRequestId(_1f8,cell);if(this._isPending(_202)){continue;}}this._pending++;_200.push(_1f8._task.execute(_201,function(){var _203=cell;return function(_204){func.apply(self,[_204,_203]);};}.call(this),this._queryErrorHandler,_202));}this._removeOldCells(_1f9);this._endCheck();},_drawFeatures:function(_205,cell){this._exceeds=this._exceeds||_205.exceededTransferLimit;this._finalizeIO();var _206=this.featureLayer,map=this.map,_207=map.extent,_208=cell.extent,row=cell.row,col=cell.col,_209=_206.objectIdField,_20a=_205.features,_20b=this._gridLayer,_20c=this._cellMap,i,len,_20d=cell.latticeID,_20e=_20d?_20c[_20d]:(_20c[row]&&_20c[row][col]);if((cell.resolution!=_20b._resolution)||(_20d?(_20d!==_20b.getLatticeID(_207)):(!_20b.intersects(_208,_207)))){if(_20e){this._removeCell(row,col,_20d);}}else{if(_20e){this._updateCell(_20e,_20a);}else{cell.features=_20a;if(_20d){_20c[_20d]=cell;}else{_20c[row]=_20c[row]||{};_20c[row][col]=cell;}len=_20a.length;for(i=0;i<len;i++){var _20f=_20a[i];var oid=_20f.attributes[_209];this._addFeatureIIf(oid,_20f);this._incRefCount(oid);}}}this._endCheck();},_queryErrorHandler:function(err){this._finalizeIO();this.featureLayer._errorHandler(err);this._endCheck(true);},_finalizeIO:function(){this._purgeRequests();this._pending--;},_endCheck:function(_210){if(this._pending===0){this._processIOQueue();var _211=this.featureLayer,_212=_211._trackManager;if(_212){_212.clearTracks();_212.addFeatures(_211.graphics);if(_211._ager){dojo.forEach(_211.graphics,function(_213){if(_213._shape){_211._repaint(_213);}});}_212.moveLatestToFront();_212.drawTracks();}this.featureLayer._fireUpdateEnd(_210&&new Error("FeatureLayer: "+esri.bundle.layers.FeatureLayer.updateError),this._exceeds?{queryLimitExceeded:true}:null);if(this._exceeds){_211.onQueryLimitExceeded();}}},_processIOQueue:function(_214){this._ioQueue=dojo.filter(this._ioQueue,function(dfd){var keep=dfd.fired>-1?false:true;return keep;});if(_214){dojo.forEach(this._ioQueue,this._cancelPendingRequest);}},_removeOldCells:function(_215){var _216=this._cellMap,_217=this._gridLayer,_218,_219;for(_218 in _216){if(_216[_218]){var row=_216[_218],_21a=row.latticeID,_21b=0,_21c=0;if(_21a){_21b++;if(_21a!==_217.getLatticeID(_215)){this._removeCell(null,null,_21a);_21c++;}}else{for(_219 in row){if(row[_219]){_21b++;var _21d=row[_219].extent;if(!_217.intersects(_21d,_215)){this._removeCell(_218,_219);_21c++;}}}}if(_21c===_21b){delete _216[_218];}}}},_updateCell:function(cell,_21e){var _21f=this.featureLayer,_220=_21f.objectIdField,_221=_21f._selectedFeatures,i,len=_21e.length;cell.features=cell.features||[];for(i=0;i<len;i++){var _222=_21e[i];var oid=_222.attributes[_220];var _223=this._addFeatureIIf(oid,_222);if(_223===_222){this._incRefCount(oid);cell.features.push(_223);}else{if(!(oid in _221)){_223.setGeometry(_222.geometry);_223.setAttributes(_222.attributes);}}}},_removeCell:function(row,col,_224){var _225=this._cellMap,_226=this.featureLayer,_227=_226.objectIdField;var cell=_224?_225[_224]:(_225[row]&&_225[row][col]);if(cell){if(_224){delete _225[_224];}else{delete _225[row][col];}var _228=cell.features,i;for(i=0;i<_228.length;i++){var _229=_228[i];var oid=_229.attributes[_227];this._decRefCount(oid);if(oid in _226._selectedFeatures){continue;}this._removeFeatureIIf(oid);}}}});dojo.declare("esri.layers._GridLayout",null,{constructor:function(_22a,_22b,_22c,_22d){this.origin=_22a;this.cellWidth=_22b.width;this.cellHeight=_22b.height;this.mapWidth=_22c.width;this.mapHeight=_22c.height;this.srInfo=_22d;},setResolution:function(_22e){this._resolution=(_22e.xmax-_22e.xmin)/this.mapWidth;if(this.srInfo){var _22f=Math.round((2*this.srInfo.valid[1])/this._resolution),_230=Math.round(_22f/this.cellWidth);this._frameStats=[_230,0,_230-1];}},getCellCoordinates:function(_231){var res=this._resolution,_232=this.origin;return {row:Math.floor((_232.y-_231.y)/(this.cellHeight*res)),col:Math.floor((_231.x-_232.x)/(this.cellWidth*res))};},normalize:function(col){var _233=this._frameStats;if(_233){var _234=_233[0],m180=_233[1],p180=_233[2];if(col<m180){col=col%_234;col=col<m180?col+_234:col;}else{if(col>p180){col=col%_234;}}}return col;},intersects:function(_235,_236){var _237=this.srInfo;if(_237){return dojo.some(_236._getParts(_237),function(_238){return _235.intersects(_238.extent);});}else{return _235.intersects(_236);}},getCellExtent:function(row,col){var res=this._resolution,_239=this.origin,_23a=this.cellWidth,_23b=this.cellHeight;return new esri.geometry.Extent((col*_23a*res)+_239.x,_239.y-((row+1)*_23b*res),((col+1)*_23a*res)+_239.x,_239.y-(row*_23b*res),new esri.SpatialReference(_239.spatialReference.toJson()));},getLatticeID:function(_23c){var _23d=this.getCellCoordinates({x:_23c.xmin,y:_23c.ymax}),_23e=this.getCellCoordinates({x:_23c.xmax,y:_23c.ymin}),_23f=_23d.row,_240=_23e.row,_241=this.normalize(_23d.col),_242=this.normalize(_23e.col);return _23f+"_"+_240+"_"+_241+"_"+_242;},sorter:function(a,b){return (a<b)?-1:1;},getCellsInExtent:function(_243,_244){var _245=this.getCellCoordinates({x:_243.xmin,y:_243.ymax}),_246=this.getCellCoordinates({x:_243.xmax,y:_243.ymin}),_247=_245.row,_248=_246.row,_249=_245.col,_24a=_246.col,_24b=[],i,j,nj,_24c=[],_24d=[],len,xmin,xmax,ymin,ymax,_24e=[],_24f,_250;for(i=_247;i<=_248;i++){for(j=_249;j<=_24a;j++){nj=this.normalize(j);_243=this.getCellExtent(i,nj);_24b.push({row:i,col:nj,extent:_243,resolution:this._resolution});if(_244){_24c.push(_243.xmin,_243.xmax);_24d.push(_243.ymin,_243.ymax);}}}_249=this.normalize(_249);_24a=this.normalize(_24a);_24c.sort(this.sorter);_24d.sort(this.sorter);len=_24c.length;for(i=len-1;i>=0;i--){if(i<(len-1)){if(_24c[i]===_24c[i+1]){_24c.splice(i,1);}}}len=_24d.length;for(i=len-1;i>=0;i--){if(i<(len-1)){if(_24d[i]===_24d[i+1]){_24d.splice(i,1);}}}if(_24c.length&&_24d.length){xmin=_24c[0];xmax=_24c[_24c.length-1];ymin=_24d[0];ymax=_24d[_24d.length-1];len=_24c.length;for(i=0;i<len;i++){_24e.push([[_24c[i],ymax],[_24c[i],ymin]]);}len=_24d.length;for(i=0;i<len;i++){_24e.push([[xmin,_24d[i]],[xmax,_24d[i]]]);}_24f=new esri.geometry.Polyline({paths:_24e,spatialReference:this.origin.spatialReference.toJson()});_250=_247+"_"+_248+"_"+_249+"_"+_24a;_24b.push({latticeID:_250,lattice:_24f,resolution:this._resolution});}return {minRow:_247,maxRow:_248,minCol:_249,maxCol:_24a,cells:_24b};}});dojo.declare("esri.layers._TrackManager",null,{constructor:function(_251){this.layer=_251;this.trackMap={};},initialize:function(map){this.map=map;var _252=this.layer,_253=_252.renderer.trackRenderer;if(_253&&(_252.geometryType==="esriGeometryPoint")){var _254=(this.container=new esri.layers._GraphicsLayer({id:_252.id+"_tracks",_child:true}));_254._setMap(map,_252._div);_254.setRenderer(_253);}},addFeatures:function(_255){var tkid,_256=this.trackMap,_257=this.layer,_258=_257._trackIdField;dojo.forEach(_255,function(_259){var _25a=_259.attributes;tkid=_25a[_258];var ary=(_256[tkid]=(_256[tkid]||[]));ary.push(_259);});var _25b=_257._startTimeField,_25c=_257.objectIdField;var _25d=function(a,b){var _25e=a.attributes[_25b],_25f=b.attributes[_25b];if(_25e===_25f){return (a.attributes[_25c]<b.attributes[_25c])?-1:1;}else{return (_25e<_25f)?-1:1;}};for(tkid in _256){_256[tkid].sort(_25d);}},drawTracks:function(){var _260=this.container;if(!_260){return;}var _261=this.trackMap,sr=this.map.spatialReference,tkid,ary,path,i,_262;for(tkid in _261){ary=_261[tkid];path=[];for(i=ary.length-1;i>=0;i--){_262=ary[i].geometry;if(_262){path.push([_262.x,_262.y]);}}if(path.length>0){_260.add(new esri.Graphic(new esri.geometry.Polyline({paths:[path],spatialReference:sr})));}}},moveLatestToFront:function(){dojo.forEach(this.getLatestObservations(),function(_263){var _264=_263._shape;_264&&_264._moveToFront();this._repaint(_263,null,true);},this.layer);},getLatestObservations:function(){var _265=[];if(!this.layer.renderer.latestObservationRenderer){return _265;}var _266=this.trackMap,tkid;for(tkid in _266){var ary=_266[tkid];_265.push(ary[ary.length-1]);}return _265;},clearTracks:function(){var _267=this.getLatestObservations();this.trackMap={};var _268=this.container;if(_268){_268.clear();}dojo.forEach(_267,function(_269){this._repaint(_269,null,true);},this.layer);},isLatestObservation:function(_26a){var _26b=this.layer._trackIdField;var _26c=this.trackMap[_26a.attributes[_26b]];if(_26c){return (_26c[_26c.length-1]===_26a);}return false;},destroy:function(){var _26d=this.container;if(_26d){_26d.clear();_26d._unsetMap(this.map,this.layer._div);this.container=null;}this.map=null;this.layer=null;this.trackMap=null;}});}if(!dojo._hasResource["esri.layers.MapImageLayer"]){dojo._hasResource["esri.layers.MapImageLayer"]=true;dojo.provide("esri.layers.MapImageLayer");dojo.declare("esri.layers.MapImageLayer",[esri.layers.Layer],{"-chains-":{constructor:"manual"},constructor:function(_26e){this.inherited(arguments,[null,_26e]);this._mapImages=[];var _26f=dojo.hitch;this._panStart=_26f(this,this._panStart);this._pan=_26f(this,this._pan);this._extentChange=_26f(this,this._extentChange);this._zoom=_26f(this,this._zoom);this._zoomStart=_26f(this,this._zoomStart);this._scale=_26f(this,this._scale);this._resize=_26f(this,this._resize);this.loaded=true;this.onLoad(this);},opacity:1,_transform:esri._getDOMAccessor("transform"),addImage:function(_270){var _271=this._mapImages.push(_270);_271=_271-1;_270._idx=_271;_270._layer=this;if(this._div){this._createImage(_270,_271);}},removeImage:function(_272){if(_272){var idx=_272._idx,_273=this._mapImages;if(_273[idx]===_272){delete _273[idx];var node=_272._node;if(node){this._clearEvents(node);node.e_idx=node.e_bl=node.e_tr=node.e_l=node.e_t=node.e_w=node.e_h=null;if(node.parentNode){node.parentNode.removeChild(node);dojo.destroy(node);}}_272._node=_272._idx=_272._layer=null;}}},removeAllImages:function(){var _274=this._mapImages,i,len=_274.length;for(i=0;i<len;i++){var _275=_274[i];if(_275){this.removeImage(_275);}}this._mapImages=[];},getImages:function(){var _276=this._mapImages,_277=[],i,len=_276.length;for(i=0;i<len;i++){if(_276[i]){_277.push(_276[i]);}}return _277;},setOpacity:function(_278){if(this.opacity!=_278){this.onOpacityChange(this.opacity=_278);}},onOpacityChange:function(_279){var div=this._div,i,len,_27a;if(div){if(!dojo.isIE||dojo.isIE>8){dojo.style(div,"opacity",_279);}else{_27a=div.childNodes;len=_27a.length;for(i=0;i<len;i++){dojo.style(_27a[i],"opacity",_279);}}}},_createImage:function(_27b,idx){var node=dojo.create("img");dojo.style(node,{position:"absolute"});if(dojo.isIE<=8){dojo.style(node,"opacity",this.opacity);}if(_27b.rotation){var _27c="rotate("+(360-_27b.rotation)+"deg)";if(dojo.isIE<9){}else{dojo.style(node,this._transform,_27c);dojo.style(node,"transform",_27c);}}_27b._node=node;node.e_idx=idx;node.e_layer=this;node.e_load=dojo.connect(node,"onload",esri.layers.MapImageLayer.prototype._imageLoaded);node.e_error=dojo.connect(node,"onerror",esri.layers.MapImageLayer.prototype._imageError);node.e_abort=dojo.connect(node,"onabort",esri.layers.MapImageLayer.prototype._imageError);node.src=_27b.href;},_imageLoaded:function(evt,img){var node=img||evt.target||evt.currentTarget,self=node.e_layer,_27d=self._mapImages[node.e_idx];if(self._map&&(self._map.__zooming||self._map.__panning)){self._standby.push(node);return;}self._clearEvents(node);if(!_27d||_27d._node!==node){return;}if(self._map){self._attach(_27d);}},_imageError:function(evt){var node=evt.target||evt.currentTarget,self=node.e_layer,_27e=self._mapImages[node.e_idx];self._clearEvents(node);if(_27e){_27e._node=null;}},_clearEvents:function(node){var _27f=dojo.disconnect;_27f(node.e_load);_27f(node.e_error);_27f(node.e_abort);node.e_load=node.e_error=node.e_abort=node.e_layer=null;},_attach:function(_280){var _281=_280.extent,_282,_283=_281.spatialReference,_284=this._sr,div=this._div,node=_280._node,_285=new esri.geometry.Point({x:_281.xmin,y:_281.ymin}),_286=new esri.geometry.Point({x:_281.xmax,y:_281.ymax});if(_284.wkid){_282=(_284._isWebMercator()&&_283._isWebMercator())||(_284.wkid===_283.wkid);}else{if(_284.wkt){_282=(_284.wkt===_283.wkt);}}if(!_282){if(_284._isWebMercator()&&_283.wkid===4326){_285=esri.geometry.geographicToWebMercator(_285);_286=esri.geometry.geographicToWebMercator(_286);}else{if(_283._isWebMercator()&&_284.wkid===4326){_285=esri.geometry.webMercatorToGeographic(_285);_286=esri.geometry.webMercatorToGeographic(_286);}}}node.e_bl=_285;node.e_tr=_286;if(_280.visible){this._setPos(node,div._left,div._top);(this._active||div).appendChild(node);}},_setPos:function(node,_287,_288){var _289=node.e_bl,_28a=node.e_tr,map=this._map;_289=map.toScreen(_289);_28a=map.toScreen(_28a);var left=_289.x-_287,top=_28a.y-_288,_28b=Math.abs(_28a.x-_289.x),_28c=Math.abs(_289.y-_28a.y),css={width:_28b+"px",height:_28c+"px"},_28d=this._mapImages[node.e_idx];if(map.navigationMode==="css-transforms"){css[esri._css.names.transform]=esri._css.translate(left,top)+(_28d.rotation?(" "+esri._css.rotate(360-_28d.rotation)):"");}else{css.left=left+"px";css.top=top+"px";}dojo.style(node,css);node.e_l=left;node.e_t=top;node.e_w=_28b;node.e_h=_28c;},_setMap:function(map,_28e){this._map=map;this._sr=map.spatialReference;var div=this._div=dojo.create("div",null,_28e),_28f=esri._css.names,css={position:"absolute"},vd=map.__visibleDelta;if(!dojo.isIE||dojo.isIE>8){css.opacity=this.opacity;}if(map.navigationMode==="css-transforms"){css[_28f.transform]=esri._css.translate(vd.x,vd.y);dojo.style(div,css);div._left=vd.x;div._top=vd.y;css={position:"absolute",width:map.width+"px",height:map.height+"px",overflow:"visible"};this._active=dojo.create("div",null,div);dojo.style(this._active,css);this._passive=dojo.create("div",null,div);dojo.style(this._passive,css);}else{div._left=0;div._top=0;dojo.style(div,css);}this._standby=[];var _290=this._mapImages,i,len=_290.length;for(i=0;i<len;i++){var _291=_290[i],node=_291._node;if(!node){this._createImage(_291,_291._idx);}}this.onVisibilityChange(this.visible);return div;},_unsetMap:function(map,_292){this._disconnect();var div=this._div;if(div){var _293=this._mapImages,i,len=_293.length;for(i=0;i<len;i++){var _294=_293[i];if(_294){var node=_294._node;if(node){this._clearEvents(node);node.e_idx=node.e_bl=node.e_tr=node.e_l=node.e_t=node.e_w=node.e_h=null;}_294._node=null;}}_292.removeChild(div);dojo.destroy(div);}this._map=this._div=this._sr=this._active=this._passive=this._standby=null;},onVisibilityChange:function(_295){var div=this._div;if(div){if(_295){this._redraw();this._connect(this._map);esri.show(div);}else{this._disconnect();esri.hide(div);}}},_connect:function(map){if(!this._connections){var _296=dojo.connect,_297=(map.navigationMode==="css-transforms");this._connections=[_296(map,"onPanStart",this._panStart),_296(map,"onPan",this._pan),_296(map,"onExtentChange",this._extentChange),_297&&_296(map,"onZoomStart",this._zoomStart),_297?_296(map,"onScale",this._scale):_296(map,"onZoom",this._zoom),_297&&_296(map,"onResize",this._resize)];}},_disconnect:function(){if(this._connections){dojo.forEach(this._connections,dojo.disconnect);this._connections=null;}},_panStart:function(){this._panL=this._div._left;this._panT=this._div._top;},_pan:function(_298,_299){var div=this._div;div._left=this._panL+_299.x;div._top=this._panT+_299.y;if(this._map.navigationMode==="css-transforms"){dojo.style(div,esri._css.names.transform,esri._css.translate(div._left,div._top));}else{dojo.style(div,{left:div._left+"px",top:div._top+"px"});}},_extentChange:function(_29a,_29b,_29c){if(_29c){this._redraw(this._map.navigationMode==="css-transforms");}else{if(_29b){this._pan(_29a,_29b);}}var i,_29d=this._standby;if(_29d&&_29d.length){for(i=_29d.length-1;i>=0;i--){this._imageLoaded(null,_29d[i]);_29d.splice(i,1);}}},_redraw:function(_29e){if(_29e){var _29f=this._passive,_2a0=esri._css.names;dojo.style(_29f,_2a0.transition,"none");this._moveImages(_29f,this._active);dojo.style(_29f,_2a0.transform,"none");}var div=this._active||this._div,_2a1=this._div._left,_2a2=this._div._top,i,len=div.childNodes.length,node;for(i=0;i<len;i++){node=div.childNodes[i];this._setPos(node,_2a1,_2a2);}},_zoom:function(_2a3,_2a4,_2a5){var div=this._div,_2a6=div._left,_2a7=div._top,i,len=div.childNodes.length,node;for(i=0;i<len;i++){node=div.childNodes[i];var _2a8=node.e_w*_2a4,_2a9=node.e_h*_2a4,_2aa=(_2a5.x-_2a6-node.e_l)*(_2a8-node.e_w)/node.e_w,_2ab=(_2a5.y-_2a7-node.e_t)*(_2a9-node.e_h)/node.e_h;_2aa=isNaN(_2aa)?0:_2aa;_2ab=isNaN(_2ab)?0:_2ab;dojo.style(node,{left:(node.e_l-_2aa)+"px",top:(node.e_t-_2ab)+"px",width:_2a8+"px",height:_2a9+"px"});}},_zoomStart:function(){this._moveImages(this._active,this._passive);},_moveImages:function(_2ac,dest){var _2ad=_2ac.childNodes,i,len=_2ad.length;if(len>0){for(i=len-1;i>=0;i--){dest.appendChild(_2ad[i]);}}},_scale:function(mtx,_2ae){var css={},_2af=esri._css.names,_2b0=this._passive;dojo.style(_2b0,_2af.transition,_2ae?"none":(_2af.transformName+" "+esri.config.defaults.map.zoomDuration+"ms ease"));css[_2af.transform]=esri._css.matrix(mtx);dojo.style(_2b0,_2af.transform,esri._css.matrix(mtx));},_resize:function(_2b1,_2b2,_2b3){dojo.style(this._active,{width:_2b2+"px",height:_2b3+"px"});dojo.style(this._passive,{width:_2b2+"px",height:_2b3+"px"});}});dojo.extend(esri.layers.MapImage,{visible:true,getLayer:function(){return this._layer;},getNode:function(){return this._node;},show:function(){if(!this.visible){this.visible=true;var node=this._node,_2b4=this._layer,div;if(node){div=_2b4&&_2b4._div;if(div){_2b4._setPos(node,div._left,div._top);(_2b4._active||div).appendChild(node);}esri.show(node);}}},hide:function(){if(this.visible){this.visible=false;var node=this._node;if(node){esri.hide(node);if(node.parentNode){node.parentNode.removeChild(node);}}}}});}if(!dojo._hasResource["esri.PopupBase"]){dojo._hasResource["esri.PopupBase"]=true;dojo.provide("esri.PopupBase");dojo.declare("esri.PopupBase",null,{onSetFeatures:function(){},onClearFeatures:function(){},onSelectionChange:function(){},onDfdComplete:function(){},initialize:function(){this.count=0;this.selectedIndex=-1;},cleanup:function(){this.features=this.deferreds=null;},setFeatures:function(arg){if(!arg||!arg.length){return;}this.clearFeatures();var _2b5,_2b6;if(arg[0] instanceof dojo.Deferred){_2b6=arg;}else{_2b5=arg;}if(_2b5){this._updateFeatures(null,_2b5);}else{this.deferreds=_2b6;_2b6=_2b6.slice(0);dojo.forEach(_2b6,function(dfd){dfd.addBoth(dojo.hitch(this,this._updateFeatures,dfd));},this);}},clearFeatures:function(){this.features=this.deferreds=null;this.count=0;var _2b7=this.selectedIndex;this.selectedIndex=-1;if(_2b7>-1){this.onSelectionChange();}this.onClearFeatures();},getSelectedFeature:function(){var _2b8=this.features;if(_2b8){return _2b8[this.selectedIndex];}},select:function(_2b9){if(_2b9<0||_2b9>=this.count){return;}this.selectedIndex=_2b9;this.onSelectionChange();},enableHighlight:function(map){this._highlighted=map.graphics.add(new esri.Graphic(new esri.geometry.Point(0,0,map.spatialReference)));this._highlighted.hide();var ESYM=esri.symbol;if(!this.markerSymbol){var _2ba=(this.markerSymbol=new ESYM.SimpleMarkerSymbol());_2ba.setStyle(ESYM.SimpleMarkerSymbol.STYLE_TARGET);_2ba._setDim(16,16,7);_2ba.setOutline(new ESYM.CartographicLineSymbol(ESYM.SimpleLineSymbol.STYLE_SOLID,new dojo.Color([0,255,255]),2,ESYM.CartographicLineSymbol.CAP_ROUND,ESYM.CartographicLineSymbol.JOIN_ROUND));_2ba.setColor(new dojo.Color([0,0,0,0]));}if(!this.lineSymbol){this.lineSymbol=new ESYM.SimpleLineSymbol(ESYM.SimpleLineSymbol.STYLE_SOLID,new dojo.Color([0,255,255]),2);}if(!this.fillSymbol){this.fillSymbol=new ESYM.SimpleFillSymbol(ESYM.SimpleFillSymbol.STYLE_NULL,new ESYM.SimpleLineSymbol(ESYM.SimpleLineSymbol.STYLE_SOLID,new dojo.Color([0,255,255]),2),new dojo.Color([0,0,0,0]));}},disableHighlight:function(map){var _2bb=this._highlighted;if(_2bb){_2bb.hide();map.graphics.remove(_2bb);delete this._highlighted;}this.markerSymbol=this.lineSymbol=this.fillSymbol=null;},showHighlight:function(){if(this._highlighted&&this.features&&this.features[this.selectedIndex]){this._highlighted.show();}},hideHighlight:function(){if(this._highlighted){this._highlighted.hide();}},updateHighlight:function(map,_2bc){var _2bd=_2bc.geometry,_2be=this._highlighted;if(!_2bd||!_2be){return;}_2be.hide();if(!_2be.getLayer()&&map){map.graphics.add(_2be);}_2be.setGeometry(esri.geometry.fromJson(_2bd.toJson()));var _2bf;switch(_2bd.type){case "point":case "multipoint":_2bf=this.markerSymbol;_2bf.setOffset(0,0);_2bf.setAngle(0);var lyr=_2bc.getLayer();if(lyr){var _2c0=lyr._getSymbol(_2bc),_2c1,_2c2,xoff=0,yoff=0,_2c3=0;if(_2c0){switch(_2c0.type){case "simplemarkersymbol":_2c1=_2c2=(_2c0.size||0);break;case "picturemarkersymbol":_2c1=(_2c0.width||0);_2c2=(_2c0.height||0);break;}xoff=_2c0.xoffset||0;yoff=_2c0.yoffset||0;_2c3=_2c0.angle||0;}if(_2c1&&_2c2){_2bf._setDim(_2c1+1,_2c2+1,7);}_2bf.setOffset(xoff,yoff);_2bf.setAngle(_2c3);}break;case "polyline":_2bf=this.lineSymbol;break;case "polygon":_2bf=this.fillSymbol;break;}_2be.setSymbol(_2bf);},_unbind:function(dfd){var _2c4=dojo.indexOf(this.deferreds,dfd);if(_2c4===-1){return;}this.deferreds.splice(_2c4,1);if(!this.deferreds.length){this.deferreds=null;return 2;}return 1;},_updateFeatures:function(dfd,_2c5){if(dfd){if(this.deferreds){var res=this._unbind(dfd);if(!res){return;}if(_2c5&&_2c5 instanceof Error){this.onDfdComplete(_2c5);if(res===2){this.onSetFeatures();}return;}if(_2c5&&_2c5.length){if(!this.features){this.features=_2c5;this.count=_2c5.length;this.selectedIndex=0;this.onDfdComplete();if(res===2){this.onSetFeatures();}this.select(0);}else{var _2c6=dojo.filter(_2c5,function(_2c7){return dojo.indexOf(this.features,_2c7)===-1;},this);this.features=this.features.concat(_2c6);this.count=this.features.length;this.onDfdComplete();if(res===2){this.onSetFeatures();}}}else{this.onDfdComplete();if(res===2){this.onSetFeatures();}}}}else{this.features=_2c5;this.count=_2c5.length;this.selectedIndex=0;this.onSetFeatures();this.select(0);}}});dojo.declare("esri.PopupInfoTemplate",[esri.InfoTemplate],{"-chains-":{constructor:"manual"},initialize:function(json){if(!json){return;}this.info=json;this.title=this.getTitle;this.content=this.getContent;var _2c8=(this._fieldLabels={}),_2c9=(this._fieldsMap={});if(json.fieldInfos){dojo.forEach(json.fieldInfos,function(_2ca){_2c8[_2ca.fieldName]=_2ca.label;_2c9[_2ca.fieldName]=_2ca;});}},toJson:function(){return dojo.fromJson(dojo.toJson(this.info));},getTitle:function(){},getContent:function(){},getComponents:function(_2cb){var _2cc=this.info,_2cd=_2cb.getLayer(),_2ce=dojo.clone(_2cb.attributes)||{},_2cf=dojo.clone(_2ce),_2d0=_2cc.fieldInfos,_2d1="",_2d2="",_2d3,_2d4,_2d5,_2d6=_2cd&&_2cd._getDateOpts&&_2cd._getDateOpts().properties,_2d7={dateFormat:{properties:_2d6,formatter:"DateFormat"+this._dateFormats["shortDateShortTime"]}};if(_2d0){dojo.forEach(_2d0,function(_2d8){var _2d9=_2d8.fieldName,val=_2cf[_2d9];_2cf[_2d9]=this._formatValue(val,_2d9,_2d7);if(_2d6&&_2d8.format&&_2d8.format.dateFormat){var pos=dojo.indexOf(_2d6,_2d9);if(pos>-1){_2d6.splice(pos,1);}}},this);}if(_2cd){var _2da=_2cd.types,_2db=_2cd.typeIdField,_2dc=_2db&&_2ce[_2db];for(_2d4 in _2ce){_2d5=_2ce[_2d4];if(esri._isDefined(_2d5)){var _2dd=this._getDomainName(_2cd,_2da,_2dc,_2d4,_2d5);if(esri._isDefined(_2dd)){_2cf[_2d4]=_2dd;}else{if(_2d4===_2db){var _2de=this._getTypeName(_2cd,_2d5);if(esri._isDefined(_2de)){_2cf[_2d4]=_2de;}}}}}}if(_2cc.title){_2d1=dojo.trim(esri.substitute(_2cf,this._fixTokens(_2cc.title),_2d7)||"");}if(_2cc.description){_2d2=dojo.trim(esri.substitute(_2cf,this._fixTokens(_2cc.description),_2d7)||"");}if(_2d0){_2d3=[];dojo.forEach(_2d0,function(_2df){_2d4=_2df.fieldName;if(_2d4&&_2df.visible){_2d3.push([_2df.label||_2d4,esri.substitute(_2cf,"${"+_2d4+"}",_2d7)||""]);}});}var _2e0,_2e1;if(_2cc.mediaInfos){_2e0=[];dojo.forEach(_2cc.mediaInfos,function(_2e2){_2e1=0;_2d5=_2e2.value;switch(_2e2.type){case "image":var url=_2d5.sourceURL;url=url&&dojo.trim(esri.substitute(_2ce,this._fixTokens(url)));_2e1=!!url;break;case "piechart":case "linechart":case "columnchart":case "barchart":_2e1=dojo.some(_2d5.fields,function(_2e3){return esri._isDefined(_2ce[_2e3]);});break;default:return;}if(_2e1){_2e2=dojo.clone(_2e2);_2d5=_2e2.value;_2e2.title=_2e2.title?dojo.trim(esri.substitute(_2cf,this._fixTokens(_2e2.title),_2d7)||""):"";_2e2.caption=_2e2.caption?dojo.trim(esri.substitute(_2cf,this._fixTokens(_2e2.caption),_2d7)||""):"";if(_2e2.type==="image"){_2d5.sourceURL=esri.substitute(_2ce,this._fixTokens(_2d5.sourceURL));if(_2d5.linkURL){_2d5.linkURL=dojo.trim(esri.substitute(_2ce,this._fixTokens(_2d5.linkURL))||"");}}else{var _2e4=_2ce[_2d5.normalizeField]||0;_2d5.fields=dojo.map(_2d5.fields,function(_2e5){var data=_2ce[_2e5];data=(data===undefined)?null:data;if(data&&_2e4){data=data/_2e4;}return {y:data,tooltip:(this._fieldLabels[_2e5]||_2e5)+":<br/>"+this._formatValue(data,_2e5,_2d7)};},this);}_2e0.push(_2e2);}},this);}return {title:_2d1,description:_2d2,fields:(_2d3&&_2d3.length)?_2d3:null,mediaInfos:(_2e0&&_2e0.length)?_2e0:null,formatted:_2cf,editSummary:(_2cd&&_2cd.getEditSummary)?_2cd.getEditSummary(_2cb):""};},getAttachments:function(_2e6){var _2e7=_2e6.getLayer(),_2e8=_2e6.attributes;if(this.info.showAttachments&&_2e7&&_2e7.hasAttachments&&_2e7.objectIdField){var oid=_2e8&&_2e8[_2e7.objectIdField];if(oid){return _2e7.queryAttachmentInfos(oid);}}},_dateFormats:{"shortDate":"(datePattern: 'M/d/y', selector: 'date')","longMonthDayYear":"(datePattern: 'MMMM d, y', selector: 'date')","dayShortMonthYear":"(datePattern: 'd MMM y', selector: 'date')","longDate":"(datePattern: 'EEEE, MMMM d, y', selector: 'date')","shortDateShortTime":"(datePattern: 'M/d/y', timePattern: 'h:mm a', selector: 'date and time')","shortDateShortTime24":"(datePattern: 'M/d/y', timePattern: 'H:mm', selector: 'date and time')","longMonthYear":"(datePattern: 'MMMM y', selector: 'date')","shortMonthYear":"(datePattern: 'MMM y', selector: 'date')","year":"(datePattern: 'y', selector: 'date')"},_fixTokens:function(_2e9){return _2e9.replace(/(\{[^\{\r\n]+\})/g,"$$$1");},_formatValue:function(val,_2ea,_2eb){var _2ec=this._fieldsMap[_2ea],fmt=_2ec&&_2ec.format;if(!esri._isDefined(val)||!_2ec||!esri._isDefined(fmt)){return val;}var _2ed="",_2ee=[],_2ef=fmt.hasOwnProperty("places")||fmt.hasOwnProperty("digitSeparator"),_2f0=fmt.hasOwnProperty("digitSeparator")?fmt.digitSeparator:true;if(_2ef){_2ed="NumberFormat";_2ee.push("places: "+(esri._isDefined(fmt.places)?Number(fmt.places):"Infinity"));if(_2ee.length){_2ed+=("("+_2ee.join(",")+")");}}else{if(fmt.dateFormat){_2ed="DateFormat"+(this._dateFormats[fmt.dateFormat]||this._dateFormats["shortDateShortTime"]);}else{return val;}}var _2f1=esri.substitute({"myKey":val},"${myKey:"+_2ed+"}",_2eb)||"";if(_2ef&&!_2f0){var _2f2=dojo.i18n.getLocalization("dojo.cldr","number");if(_2f2.group){_2f1=_2f1.replace(new RegExp("\\"+_2f2.group,"g"),"");}}return _2f1;},_getDomainName:function(_2f3,_2f4,_2f5,_2f6,_2f7){var _2f8,stop;if(_2f4&&esri._isDefined(_2f5)){dojo.some(_2f4,function(_2f9){if(_2f9.id==_2f5){_2f8=_2f9.domains&&_2f9.domains[_2f6];if(_2f8&&_2f8.type==="inherited"){_2f8=this._getLayerDomain(_2f3,_2f6);stop=true;}return true;}return false;},this);}if(!stop&&!_2f8){_2f8=this._getLayerDomain(_2f3,_2f6);}if(_2f8&&_2f8.codedValues){var _2fa;dojo.some(_2f8.codedValues,function(_2fb){if(_2fb.code==_2f7){_2fa=_2fb.name;return true;}return false;});return _2fa;}},_getLayerDomain:function(_2fc,_2fd){var _2fe=_2fc.fields;if(_2fe){var _2ff;dojo.some(_2fe,function(_300){if(_300.name===_2fd){_2ff=_300.domain;return true;}return false;});return _2ff;}},_getTypeName:function(_301,id){var _302=_301.types;if(_302){var _303;dojo.some(_302,function(_304){if(_304.id==id){_303=_304.name;return true;}return false;});return _303;}}});}if(!dojo._hasResource["dojox.charting.scaler.common"]){dojo._hasResource["dojox.charting.scaler.common"]=true;dojo.provide("dojox.charting.scaler.common");(function(){var eq=function(a,b){return Math.abs(a-b)<=0.000001*(Math.abs(a)+Math.abs(b));};dojo.mixin(dojox.charting.scaler.common,{findString:function(val,text){val=val.toLowerCase();for(var i=0;i<text.length;++i){if(val==text[i]){return true;}}return false;},getNumericLabel:function(_305,_306,_307){var def="";if(dojo.number){def=(_307.fixed?dojo.number.format(_305,{places:_306<0?-_306:0}):dojo.number.format(_305))||"";}else{def=_307.fixed?_305.toFixed(_306<0?-_306:0):_305.toString();}if(_307.labelFunc){var r=_307.labelFunc(def,_305,_306);if(r){return r;}}if(_307.labels){var l=_307.labels,lo=0,hi=l.length;while(lo<hi){var mid=Math.floor((lo+hi)/2),val=l[mid].value;if(val<_305){lo=mid+1;}else{hi=mid;}}if(lo<l.length&&eq(l[lo].value,_305)){return l[lo].text;}--lo;if(lo>=0&&lo<l.length&&eq(l[lo].value,_305)){return l[lo].text;}lo+=2;if(lo<l.length&&eq(l[lo].value,_305)){return l[lo].text;}}return def;}});})();}if(!dojo._hasResource["dojox.charting.scaler.linear"]){dojo._hasResource["dojox.charting.scaler.linear"]=true;dojo.provide("dojox.charting.scaler.linear");(function(){var _308=3,dc=dojox.charting,dcs=dc.scaler,dcsc=dcs.common,_309=dcsc.findString,_30a=dcsc.getNumericLabel;var _30b=function(min,max,_30c,_30d,_30e,_30f,span){_30c=dojo.delegate(_30c);if(!_30d){if(_30c.fixUpper=="major"){_30c.fixUpper="minor";}if(_30c.fixLower=="major"){_30c.fixLower="minor";}}if(!_30e){if(_30c.fixUpper=="minor"){_30c.fixUpper="micro";}if(_30c.fixLower=="minor"){_30c.fixLower="micro";}}if(!_30f){if(_30c.fixUpper=="micro"){_30c.fixUpper="none";}if(_30c.fixLower=="micro"){_30c.fixLower="none";}}var _310=_309(_30c.fixLower,["major"])?Math.floor(_30c.min/_30d)*_30d:_309(_30c.fixLower,["minor"])?Math.floor(_30c.min/_30e)*_30e:_309(_30c.fixLower,["micro"])?Math.floor(_30c.min/_30f)*_30f:_30c.min,_311=_309(_30c.fixUpper,["major"])?Math.ceil(_30c.max/_30d)*_30d:_309(_30c.fixUpper,["minor"])?Math.ceil(_30c.max/_30e)*_30e:_309(_30c.fixUpper,["micro"])?Math.ceil(_30c.max/_30f)*_30f:_30c.max;if(_30c.useMin){min=_310;}if(_30c.useMax){max=_311;}var _312=(!_30d||_30c.useMin&&_309(_30c.fixLower,["major"]))?min:Math.ceil(min/_30d)*_30d,_313=(!_30e||_30c.useMin&&_309(_30c.fixLower,["major","minor"]))?min:Math.ceil(min/_30e)*_30e,_314=(!_30f||_30c.useMin&&_309(_30c.fixLower,["major","minor","micro"]))?min:Math.ceil(min/_30f)*_30f,_315=!_30d?0:(_30c.useMax&&_309(_30c.fixUpper,["major"])?Math.round((max-_312)/_30d):Math.floor((max-_312)/_30d))+1,_316=!_30e?0:(_30c.useMax&&_309(_30c.fixUpper,["major","minor"])?Math.round((max-_313)/_30e):Math.floor((max-_313)/_30e))+1,_317=!_30f?0:(_30c.useMax&&_309(_30c.fixUpper,["major","minor","micro"])?Math.round((max-_314)/_30f):Math.floor((max-_314)/_30f))+1,_318=_30e?Math.round(_30d/_30e):0,_319=_30f?Math.round(_30e/_30f):0,_31a=_30d?Math.floor(Math.log(_30d)/Math.LN10):0,_31b=_30e?Math.floor(Math.log(_30e)/Math.LN10):0,_31c=span/(max-min);if(!isFinite(_31c)){_31c=1;}return {bounds:{lower:_310,upper:_311,from:min,to:max,scale:_31c,span:span},major:{tick:_30d,start:_312,count:_315,prec:_31a},minor:{tick:_30e,start:_313,count:_316,prec:_31b},micro:{tick:_30f,start:_314,count:_317,prec:0},minorPerMajor:_318,microPerMinor:_319,scaler:dcs.linear};};dojo.mixin(dojox.charting.scaler.linear,{buildScaler:function(min,max,span,_31d){var h={fixUpper:"none",fixLower:"none",natural:false};if(_31d){if("fixUpper" in _31d){h.fixUpper=String(_31d.fixUpper);}if("fixLower" in _31d){h.fixLower=String(_31d.fixLower);}if("natural" in _31d){h.natural=Boolean(_31d.natural);}}if("min" in _31d){min=_31d.min;}if("max" in _31d){max=_31d.max;}if(_31d.includeZero){if(min>0){min=0;}if(max<0){max=0;}}h.min=min;h.useMin=true;h.max=max;h.useMax=true;if("from" in _31d){min=_31d.from;h.useMin=false;}if("to" in _31d){max=_31d.to;h.useMax=false;}if(max<=min){return _30b(min,max,h,0,0,0,span);}var mag=Math.floor(Math.log(max-min)/Math.LN10),_31e=_31d&&("majorTickStep" in _31d)?_31d.majorTickStep:Math.pow(10,mag),_31f=0,_320=0,_321;if(_31d&&("minorTickStep" in _31d)){_31f=_31d.minorTickStep;}else{do{_31f=_31e/10;if(!h.natural||_31f>0.9){_321=_30b(min,max,h,_31e,_31f,0,span);if(_321.bounds.scale*_321.minor.tick>_308){break;}}_31f=_31e/5;if(!h.natural||_31f>0.9){_321=_30b(min,max,h,_31e,_31f,0,span);if(_321.bounds.scale*_321.minor.tick>_308){break;}}_31f=_31e/2;if(!h.natural||_31f>0.9){_321=_30b(min,max,h,_31e,_31f,0,span);if(_321.bounds.scale*_321.minor.tick>_308){break;}}return _30b(min,max,h,_31e,0,0,span);}while(false);}if(_31d&&("microTickStep" in _31d)){_320=_31d.microTickStep;_321=_30b(min,max,h,_31e,_31f,_320,span);}else{do{_320=_31f/10;if(!h.natural||_320>0.9){_321=_30b(min,max,h,_31e,_31f,_320,span);if(_321.bounds.scale*_321.micro.tick>_308){break;}}_320=_31f/5;if(!h.natural||_320>0.9){_321=_30b(min,max,h,_31e,_31f,_320,span);if(_321.bounds.scale*_321.micro.tick>_308){break;}}_320=_31f/2;if(!h.natural||_320>0.9){_321=_30b(min,max,h,_31e,_31f,_320,span);if(_321.bounds.scale*_321.micro.tick>_308){break;}}_320=0;}while(false);}return _320?_321:_30b(min,max,h,_31e,_31f,0,span);},buildTicks:function(_322,_323){var step,next,tick,_324=_322.major.start,_325=_322.minor.start,_326=_322.micro.start;if(_323.microTicks&&_322.micro.tick){step=_322.micro.tick,next=_326;}else{if(_323.minorTicks&&_322.minor.tick){step=_322.minor.tick,next=_325;}else{if(_322.major.tick){step=_322.major.tick,next=_324;}else{return null;}}}var _327=1/_322.bounds.scale;if(_322.bounds.to<=_322.bounds.from||isNaN(_327)||!isFinite(_327)||step<=0||isNaN(step)||!isFinite(step)){return null;}var _328=[],_329=[],_32a=[];while(next<=_322.bounds.to+_327){if(Math.abs(_324-next)<step/2){tick={value:_324};if(_323.majorLabels){tick.label=_30a(_324,_322.major.prec,_323);}_328.push(tick);_324+=_322.major.tick;_325+=_322.minor.tick;_326+=_322.micro.tick;}else{if(Math.abs(_325-next)<step/2){if(_323.minorTicks){tick={value:_325};if(_323.minorLabels&&(_322.minMinorStep<=_322.minor.tick*_322.bounds.scale)){tick.label=_30a(_325,_322.minor.prec,_323);}_329.push(tick);}_325+=_322.minor.tick;_326+=_322.micro.tick;}else{if(_323.microTicks){_32a.push({value:_326});}_326+=_322.micro.tick;}}next+=step;}return {major:_328,minor:_329,micro:_32a};},getTransformerFromModel:function(_32b){var _32c=_32b.bounds.from,_32d=_32b.bounds.scale;return function(x){return (x-_32c)*_32d;};},getTransformerFromPlot:function(_32e){var _32f=_32e.bounds.from,_330=_32e.bounds.scale;return function(x){return x/_330+_32f;};}});})();}if(!dojo._hasResource["dojox.charting.axis2d.common"]){dojo._hasResource["dojox.charting.axis2d.common"]=true;dojo.provide("dojox.charting.axis2d.common");(function(){var g=dojox.gfx;var _331=function(s){s.marginLeft="0px";s.marginTop="0px";s.marginRight="0px";s.marginBottom="0px";s.paddingLeft="0px";s.paddingTop="0px";s.paddingRight="0px";s.paddingBottom="0px";s.borderLeftWidth="0px";s.borderTopWidth="0px";s.borderRightWidth="0px";s.borderBottomWidth="0px";};var _332=function(n){if(n["getBoundingClientRect"]){var bcr=n.getBoundingClientRect();return bcr.width||(bcr.right-bcr.left);}else{return dojo.marginBox(n).w;}};dojo.mixin(dojox.charting.axis2d.common,{createText:{gfx:function(_333,_334,x,y,_335,text,font,_336){return _334.createText({x:x,y:y,text:text,align:_335}).setFont(font).setFill(_336);},html:function(_337,_338,x,y,_339,text,font,_33a,_33b){var p=dojo.doc.createElement("div"),s=p.style,_33c;_331(s);s.font=font;p.innerHTML=String(text).replace(/\s/g,"&nbsp;");s.color=_33a;s.position="absolute";s.left="-10000px";dojo.body().appendChild(p);var size=g.normalizedLength(g.splitFontString(font).size);if(!_33b){_33c=_332(p);}dojo.body().removeChild(p);s.position="relative";if(_33b){s.width=_33b+"px";switch(_339){case "middle":s.textAlign="center";s.left=(x-_33b/2)+"px";break;case "end":s.textAlign="right";s.left=(x-_33b)+"px";break;default:s.left=x+"px";s.textAlign="left";break;}}else{switch(_339){case "middle":s.left=Math.floor(x-_33c/2)+"px";break;case "end":s.left=Math.floor(x-_33c)+"px";break;default:s.left=Math.floor(x)+"px";break;}}s.top=Math.floor(y-size)+"px";s.whiteSpace="nowrap";var wrap=dojo.doc.createElement("div"),w=wrap.style;_331(w);w.width="0px";w.height="0px";wrap.appendChild(p);_337.node.insertBefore(wrap,_337.node.firstChild);return wrap;}}});})();}if(!dojo._hasResource["dojox.charting.Element"]){dojo._hasResource["dojox.charting.Element"]=true;dojo.provide("dojox.charting.Element");dojo.declare("dojox.charting.Element",null,{chart:null,group:null,htmlElements:null,dirty:true,constructor:function(_33d){this.chart=_33d;this.group=null;this.htmlElements=[];this.dirty=true;this.trailingSymbol="...";this._events=[];},createGroup:function(_33e){if(!_33e){_33e=this.chart.surface;}if(!this.group){this.group=_33e.createGroup();}return this;},purgeGroup:function(){this.destroyHtmlElements();if(this.group){this.group.clear();this.group.removeShape();this.group=null;}this.dirty=true;if(this._events.length){dojo.forEach(this._events,function(item){item.shape.disconnect(item.handle);});this._events=[];}return this;},cleanGroup:function(_33f){this.destroyHtmlElements();if(!_33f){_33f=this.chart.surface;}if(this.group){this.group.clear();}else{this.group=_33f.createGroup();}this.dirty=true;return this;},destroyHtmlElements:function(){if(this.htmlElements.length){dojo.forEach(this.htmlElements,dojo.destroy);this.htmlElements=[];}},destroy:function(){this.purgeGroup();},getTextWidth:function(s,font){return dojox.gfx._base._getTextBox(s,{font:font}).w||0;},getTextWithLimitLength:function(s,font,_340,_341){if(!s||s.length<=0){return {text:"",truncated:_341||false};}if(!_340||_340<=0){return {text:s,truncated:_341||false};}var _342=2,_343=0.618,_344=s.substring(0,1)+this.trailingSymbol,_345=this.getTextWidth(_344,font);if(_340<=_345){return {text:_344,truncated:true};}var _346=this.getTextWidth(s,font);if(_346<=_340){return {text:s,truncated:_341||false};}else{var _347=0,end=s.length;while(_347<end){if(end-_347<=_342){while(this.getTextWidth(s.substring(0,_347)+this.trailingSymbol,font)>_340){_347-=1;}return {text:(s.substring(0,_347)+this.trailingSymbol),truncated:true};}var _348=_347+Math.round((end-_347)*_343),_349=this.getTextWidth(s.substring(0,_348),font);if(_349<_340){_347=_348;end=end;}else{_347=_347;end=_348;}}}},getTextWithLimitCharCount:function(s,font,_34a,_34b){if(!s||s.length<=0){return {text:"",truncated:_34b||false};}if(!_34a||_34a<=0||s.length<=_34a){return {text:s,truncated:_34b||false};}return {text:s.substring(0,_34a)+this.trailingSymbol,truncated:true};},_plotFill:function(fill,dim,_34c){if(!fill||!fill.type||!fill.space){return fill;}var _34d=fill.space;switch(fill.type){case "linear":if(_34d==="plot"||_34d==="shapeX"||_34d==="shapeY"){fill=dojox.gfx.makeParameters(dojox.gfx.defaultLinearGradient,fill);fill.space=_34d;if(_34d==="plot"||_34d==="shapeX"){var span=dim.height-_34c.t-_34c.b;fill.y1=_34c.t+span*fill.y1/100;fill.y2=_34c.t+span*fill.y2/100;}if(_34d==="plot"||_34d==="shapeY"){var span=dim.width-_34c.l-_34c.r;fill.x1=_34c.l+span*fill.x1/100;fill.x2=_34c.l+span*fill.x2/100;}}break;case "radial":if(_34d==="plot"){fill=dojox.gfx.makeParameters(dojox.gfx.defaultRadialGradient,fill);fill.space=_34d;var _34e=dim.width-_34c.l-_34c.r,_34f=dim.height-_34c.t-_34c.b;fill.cx=_34c.l+_34e*fill.cx/100;fill.cy=_34c.t+_34f*fill.cy/100;fill.r=fill.r*Math.sqrt(_34e*_34e+_34f*_34f)/200;}break;case "pattern":if(_34d==="plot"||_34d==="shapeX"||_34d==="shapeY"){fill=dojox.gfx.makeParameters(dojox.gfx.defaultPattern,fill);fill.space=_34d;if(_34d==="plot"||_34d==="shapeX"){var span=dim.height-_34c.t-_34c.b;fill.y=_34c.t+span*fill.y/100;fill.height=span*fill.height/100;}if(_34d==="plot"||_34d==="shapeY"){var span=dim.width-_34c.l-_34c.r;fill.x=_34c.l+span*fill.x/100;fill.width=span*fill.width/100;}}break;}return fill;},_shapeFill:function(fill,bbox){if(!fill||!fill.space){return fill;}var _350=fill.space;switch(fill.type){case "linear":if(_350==="shape"||_350==="shapeX"||_350==="shapeY"){fill=dojox.gfx.makeParameters(dojox.gfx.defaultLinearGradient,fill);fill.space=_350;if(_350==="shape"||_350==="shapeX"){var span=bbox.width;fill.x1=bbox.x+span*fill.x1/100;fill.x2=bbox.x+span*fill.x2/100;}if(_350==="shape"||_350==="shapeY"){var span=bbox.height;fill.y1=bbox.y+span*fill.y1/100;fill.y2=bbox.y+span*fill.y2/100;}}break;case "radial":if(_350==="shape"){fill=dojox.gfx.makeParameters(dojox.gfx.defaultRadialGradient,fill);fill.space=_350;fill.cx=bbox.x+bbox.width/2;fill.cy=bbox.y+bbox.height/2;fill.r=fill.r*bbox.width/200;}break;case "pattern":if(_350==="shape"||_350==="shapeX"||_350==="shapeY"){fill=dojox.gfx.makeParameters(dojox.gfx.defaultPattern,fill);fill.space=_350;if(_350==="shape"||_350==="shapeX"){var span=bbox.width;fill.x=bbox.x+span*fill.x/100;fill.width=span*fill.width/100;}if(_350==="shape"||_350==="shapeY"){var span=bbox.height;fill.y=bbox.y+span*fill.y/100;fill.height=span*fill.height/100;}}break;}return fill;},_pseudoRadialFill:function(fill,_351,_352,_353,end){if(!fill||fill.type!=="radial"||fill.space!=="shape"){return fill;}var _354=fill.space;fill=dojox.gfx.makeParameters(dojox.gfx.defaultRadialGradient,fill);fill.space=_354;if(arguments.length<4){fill.cx=_351.x;fill.cy=_351.y;fill.r=fill.r*_352/100;return fill;}var _355=arguments.length<5?_353:(end+_353)/2;return {type:"linear",x1:_351.x,y1:_351.y,x2:_351.x+fill.r*_352*Math.cos(_355)/100,y2:_351.y+fill.r*_352*Math.sin(_355)/100,colors:fill.colors};return fill;}});}if(!dojo._hasResource["dojox.charting.axis2d.Base"]){dojo._hasResource["dojox.charting.axis2d.Base"]=true;dojo.provide("dojox.charting.axis2d.Base");dojo.declare("dojox.charting.axis2d.Base",dojox.charting.Element,{constructor:function(_356,_357){this.vertical=_357&&_357.vertical;},clear:function(){return this;},initialized:function(){return false;},calculate:function(min,max,span){return this;},getScaler:function(){return null;},getTicks:function(){return null;},getOffsets:function(){return {l:0,r:0,t:0,b:0};},render:function(dim,_358){this.dirty=false;return this;}});}if(!dojo._hasResource["dojox.lang.functional.lambda"]){dojo._hasResource["dojox.lang.functional.lambda"]=true;dojo.provide("dojox.lang.functional.lambda");(function(){var df=dojox.lang.functional,_359={};var _35a="ab".split(/a*/).length>1?String.prototype.split:function(sep){var r=this.split.call(this,sep),m=sep.exec(this);if(m&&m.index==0){r.unshift("");}return r;};var _35b=function(s){var args=[],_35c=_35a.call(s,/\s*->\s*/m);if(_35c.length>1){while(_35c.length){s=_35c.pop();args=_35c.pop().split(/\s*,\s*|\s+/m);if(_35c.length){_35c.push("(function("+args+"){return ("+s+")})");}}}else{if(s.match(/\b_\b/)){args=["_"];}else{var l=s.match(/^\s*(?:[+*\/%&|\^\.=<>]|!=)/m),r=s.match(/[+\-*\/%&|\^\.=<>!]\s*$/m);if(l||r){if(l){args.push("$1");s="$1"+s;}if(r){args.push("$2");s=s+"$2";}}else{var vars=s.replace(/(?:\b[A-Z]|\.[a-zA-Z_$])[a-zA-Z_$\d]*|[a-zA-Z_$][a-zA-Z_$\d]*:|this|true|false|null|undefined|typeof|instanceof|in|delete|new|void|arguments|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|escape|eval|isFinite|isNaN|parseFloat|parseInt|unescape|dojo|dijit|dojox|window|document|'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/g,"").match(/([a-z_$][a-z_$\d]*)/gi)||[],t={};dojo.forEach(vars,function(v){if(!(v in t)){args.push(v);t[v]=1;}});}}}return {args:args,body:s};};var _35d=function(a){return a.length?function(){var i=a.length-1,x=df.lambda(a[i]).apply(this,arguments);for(--i;i>=0;--i){x=df.lambda(a[i]).call(this,x);}return x;}:function(x){return x;};};dojo.mixin(df,{rawLambda:function(s){return _35b(s);},buildLambda:function(s){s=_35b(s);return "function("+s.args.join(",")+"){return ("+s.body+");}";},lambda:function(s){if(typeof s=="function"){return s;}if(s instanceof Array){return _35d(s);}if(s in _359){return _359[s];}s=_35b(s);return _359[s]=new Function(s.args,"return ("+s.body+");");},clearLambdaCache:function(){_359={};}});})();}if(!dojo._hasResource["dojox.lang.functional.array"]){dojo._hasResource["dojox.lang.functional.array"]=true;dojo.provide("dojox.lang.functional.array");(function(){var d=dojo,df=dojox.lang.functional,_35e={};d.mixin(df,{filter:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var t=[],v,i,n;if(d.isArray(a)){for(i=0,n=a.length;i<n;++i){v=a[i];if(f.call(o,v,i,a)){t.push(v);}}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){for(i=0;a.hasNext();){v=a.next();if(f.call(o,v,i++,a)){t.push(v);}}}else{for(i in a){if(!(i in _35e)){v=a[i];if(f.call(o,v,i,a)){t.push(v);}}}}}return t;},forEach:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var i,n;if(d.isArray(a)){for(i=0,n=a.length;i<n;f.call(o,a[i],i,a),++i){}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){for(i=0;a.hasNext();f.call(o,a.next(),i++,a)){}}else{for(i in a){if(!(i in _35e)){f.call(o,a[i],i,a);}}}}return o;},map:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var t,n,i;if(d.isArray(a)){t=new Array(n=a.length);for(i=0;i<n;t[i]=f.call(o,a[i],i,a),++i){}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){t=[];for(i=0;a.hasNext();t.push(f.call(o,a.next(),i++,a))){}}else{t=[];for(i in a){if(!(i in _35e)){t.push(f.call(o,a[i],i,a));}}}}return t;},every:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var i,n;if(d.isArray(a)){for(i=0,n=a.length;i<n;++i){if(!f.call(o,a[i],i,a)){return false;}}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){for(i=0;a.hasNext();){if(!f.call(o,a.next(),i++,a)){return false;}}}else{for(i in a){if(!(i in _35e)){if(!f.call(o,a[i],i,a)){return false;}}}}}return true;},some:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var i,n;if(d.isArray(a)){for(i=0,n=a.length;i<n;++i){if(f.call(o,a[i],i,a)){return true;}}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){for(i=0;a.hasNext();){if(f.call(o,a.next(),i++,a)){return true;}}}else{for(i in a){if(!(i in _35e)){if(f.call(o,a[i],i,a)){return true;}}}}}return false;}});})();}if(!dojo._hasResource["dojox.lang.functional.object"]){dojo._hasResource["dojox.lang.functional.object"]=true;dojo.provide("dojox.lang.functional.object");(function(){var d=dojo,df=dojox.lang.functional,_35f={};d.mixin(df,{keys:function(obj){var t=[];for(var i in obj){if(!(i in _35f)){t.push(i);}}return t;},values:function(obj){var t=[];for(var i in obj){if(!(i in _35f)){t.push(obj[i]);}}return t;},filterIn:function(obj,f,o){o=o||d.global;f=df.lambda(f);var t={},v,i;for(i in obj){if(!(i in _35f)){v=obj[i];if(f.call(o,v,i,obj)){t[i]=v;}}}return t;},forIn:function(obj,f,o){o=o||d.global;f=df.lambda(f);for(var i in obj){if(!(i in _35f)){f.call(o,obj[i],i,obj);}}return o;},mapIn:function(obj,f,o){o=o||d.global;f=df.lambda(f);var t={},i;for(i in obj){if(!(i in _35f)){t[i]=f.call(o,obj[i],i,obj);}}return t;}});})();}if(!dojo._hasResource["dojox.lang.functional"]){dojo._hasResource["dojox.lang.functional"]=true;dojo.provide("dojox.lang.functional");}if(!dojo._hasResource["dojox.lang.utils"]){dojo._hasResource["dojox.lang.utils"]=true;dojo.provide("dojox.lang.utils");(function(){var _360={},du=dojox.lang.utils,opts=Object.prototype.toString;var _361=function(o){if(o){switch(opts.call(o)){case "[object Array]":return o.slice(0);case "[object Object]":return dojo.delegate(o);}}return o;};dojo.mixin(du,{coerceType:function(_362,_363){switch(typeof _362){case "number":return Number(eval("("+_363+")"));case "string":return String(_363);case "boolean":return Boolean(eval("("+_363+")"));}return eval("("+_363+")");},updateWithObject:function(_364,_365,conv){if(!_365){return _364;}for(var x in _364){if(x in _365&&!(x in _360)){var t=_364[x];if(t&&typeof t=="object"){du.updateWithObject(t,_365[x],conv);}else{_364[x]=conv?du.coerceType(t,_365[x]):_361(_365[x]);}}}return _364;},updateWithPattern:function(_366,_367,_368,conv){if(!_367||!_368){return _366;}for(var x in _368){if(x in _367&&!(x in _360)){_366[x]=conv?du.coerceType(_368[x],_367[x]):_361(_367[x]);}}return _366;},merge:function(_369,_36a){if(_36a){var _36b=opts.call(_369),_36c=opts.call(_36a),t,i,l,m;switch(_36c){case "[object Array]":if(_36c==_36b){t=new Array(Math.max(_369.length,_36a.length));for(i=0,l=t.length;i<l;++i){t[i]=du.merge(_369[i],_36a[i]);}return t;}return _36a.slice(0);case "[object Object]":if(_36c==_36b&&_369){t=dojo.delegate(_369);for(i in _36a){if(i in _369){l=_369[i];m=_36a[i];if(m!==l){t[i]=du.merge(l,m);}}else{t[i]=dojo.clone(_36a[i]);}}return t;}return dojo.clone(_36a);}}return _36a;}});})();}if(!dojo._hasResource["dojox.charting.axis2d.Invisible"]){dojo._hasResource["dojox.charting.axis2d.Invisible"]=true;dojo.provide("dojox.charting.axis2d.Invisible");(function(){var dc=dojox.charting,df=dojox.lang.functional,du=dojox.lang.utils,g=dojox.gfx,lin=dc.scaler.linear,_36d=du.merge,_36e=4,_36f=45;dojo.declare("dojox.charting.axis2d.Invisible",dojox.charting.axis2d.Base,{defaultParams:{vertical:false,fixUpper:"none",fixLower:"none",natural:false,leftBottom:true,includeZero:false,fixed:true,majorLabels:true,minorTicks:true,minorLabels:true,microTicks:false,rotation:0},optionalParams:{min:0,max:1,from:0,to:1,majorTickStep:4,minorTickStep:2,microTickStep:1,labels:[],labelFunc:null,maxLabelSize:0,maxLabelCharCount:0,trailingSymbol:null},constructor:function(_370,_371){this.opt=dojo.clone(this.defaultParams);du.updateWithObject(this.opt,_371);du.updateWithPattern(this.opt,_371,this.optionalParams);},dependOnData:function(){return !("min" in this.opt)||!("max" in this.opt);},clear:function(){delete this.scaler;delete this.ticks;this.dirty=true;return this;},initialized:function(){return "scaler" in this&&!(this.dirty&&this.dependOnData());},setWindow:function(_372,_373){this.scale=_372;this.offset=_373;return this.clear();},getWindowScale:function(){return "scale" in this?this.scale:1;},getWindowOffset:function(){return "offset" in this?this.offset:0;},_groupLabelWidth:function(_374,font,_375){if(!_374.length){return 0;}if(dojo.isObject(_374[0])){_374=df.map(_374,function(_376){return _376.text;});}if(_375){_374=df.map(_374,function(_377){return dojo.trim(_377).length==0?"":_377.substring(0,_375)+this.trailingSymbol;},this);}var s=_374.join("<br>");return dojox.gfx._base._getTextBox(s,{font:font}).w||0;},calculate:function(min,max,span,_378){if(this.initialized()){return this;}var o=this.opt;this.labels="labels" in o?o.labels:_378;this.scaler=lin.buildScaler(min,max,span,o);var tsb=this.scaler.bounds;if("scale" in this){o.from=tsb.lower+this.offset;o.to=(tsb.upper-tsb.lower)/this.scale+o.from;if(!isFinite(o.from)||isNaN(o.from)||!isFinite(o.to)||isNaN(o.to)||o.to-o.from>=tsb.upper-tsb.lower){delete o.from;delete o.to;delete this.scale;delete this.offset;}else{if(o.from<tsb.lower){o.to+=tsb.lower-o.from;o.from=tsb.lower;}else{if(o.to>tsb.upper){o.from+=tsb.upper-o.to;o.to=tsb.upper;}}this.offset=o.from-tsb.lower;}this.scaler=lin.buildScaler(min,max,span,o);tsb=this.scaler.bounds;if(this.scale==1&&this.offset==0){delete this.scale;delete this.offset;}}var ta=this.chart.theme.axis,_379=0,_37a=o.rotation%360,_37b=o.font||(ta.majorTick&&ta.majorTick.font)||(ta.tick&&ta.tick.font),size=_37b?g.normalizedLength(g.splitFontString(_37b).size):0,cosr=Math.abs(Math.cos(_37a*Math.PI/180)),sinr=Math.abs(Math.sin(_37a*Math.PI/180));if(_37a<0){_37a+=360;}if(size){if(this.vertical?_37a!=0&&_37a!=180:_37a!=90&&_37a!=270){if(this.labels){_379=this._groupLabelWidth(this.labels,_37b,o.maxLabelCharCount);}else{var _37c=Math.ceil(Math.log(Math.max(Math.abs(tsb.from),Math.abs(tsb.to)))/Math.LN10),t=[];if(tsb.from<0||tsb.to<0){t.push("-");}t.push(dojo.string.rep("9",_37c));var _37d=Math.floor(Math.log(tsb.to-tsb.from)/Math.LN10);if(_37d>0){t.push(".");t.push(dojo.string.rep("9",_37d));}_379=dojox.gfx._base._getTextBox(t.join(""),{font:_37b}).w;}_379=o.maxLabelSize?Math.min(o.maxLabelSize,_379):_379;}else{_379=size;}switch(_37a){case 0:case 90:case 180:case 270:break;default:var gap1=Math.sqrt(_379*_379+size*size),gap2=this.vertical?size*cosr+_379*sinr:_379*cosr+size*sinr;_379=Math.min(gap1,gap2);break;}}this.scaler.minMinorStep=_379+_36e;this.ticks=lin.buildTicks(this.scaler,o);return this;},getScaler:function(){return this.scaler;},getTicks:function(){return this.ticks;}});})();}if(!dojo._hasResource["dojo.colors"]){dojo._hasResource["dojo.colors"]=true;dojo.provide("dojo.colors");dojo.getObject("colors",true,dojo);(function(){var _37e=function(m1,m2,h){if(h<0){++h;}if(h>1){--h;}var h6=6*h;if(h6<1){return m1+(m2-m1)*h6;}if(2*h<1){return m2;}if(3*h<2){return m1+(m2-m1)*(2/3-h)*6;}return m1;};dojo.colorFromRgb=function(_37f,obj){var m=_37f.toLowerCase().match(/^(rgba?|hsla?)\(([\s\.\-,%0-9]+)\)/);if(m){var c=m[2].split(/\s*,\s*/),l=c.length,t=m[1],a;if((t=="rgb"&&l==3)||(t=="rgba"&&l==4)){var r=c[0];if(r.charAt(r.length-1)=="%"){a=dojo.map(c,function(x){return parseFloat(x)*2.56;});if(l==4){a[3]=c[3];}return dojo.colorFromArray(a,obj);}return dojo.colorFromArray(c,obj);}if((t=="hsl"&&l==3)||(t=="hsla"&&l==4)){var H=((parseFloat(c[0])%360)+360)%360/360,S=parseFloat(c[1])/100,L=parseFloat(c[2])/100,m2=L<=0.5?L*(S+1):L+S-L*S,m1=2*L-m2;a=[_37e(m1,m2,H+1/3)*256,_37e(m1,m2,H)*256,_37e(m1,m2,H-1/3)*256,1];if(l==4){a[3]=c[3];}return dojo.colorFromArray(a,obj);}}return null;};var _380=function(c,low,high){c=Number(c);return isNaN(c)?high:c<low?low:c>high?high:c;};dojo.Color.prototype.sanitize=function(){var t=this;t.r=Math.round(_380(t.r,0,255));t.g=Math.round(_380(t.g,0,255));t.b=Math.round(_380(t.b,0,255));t.a=_380(t.a,0,1);return this;};})();dojo.colors.makeGrey=function(g,a){return dojo.colorFromArray([g,g,g,a]);};dojo.mixin(dojo.Color.named,{aliceblue:[240,248,255],antiquewhite:[250,235,215],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],blanchedalmond:[255,235,205],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],oldlace:[253,245,230],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],thistle:[216,191,216],tomato:[255,99,71],transparent:[0,0,0,0],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],whitesmoke:[245,245,245],yellowgreen:[154,205,50]});}if(!dojo._hasResource["dojox.charting.axis2d.Default"]){dojo._hasResource["dojox.charting.axis2d.Default"]=true;dojo.provide("dojox.charting.axis2d.Default");(function(){var dc=dojox.charting,du=dojox.lang.utils,g=dojox.gfx,lin=dc.scaler.linear,_381=4,_382=45;dojo.declare("dojox.charting.axis2d.Default",dojox.charting.axis2d.Invisible,{defaultParams:{vertical:false,fixUpper:"none",fixLower:"none",natural:false,leftBottom:true,includeZero:false,fixed:true,majorLabels:true,minorTicks:true,minorLabels:true,microTicks:false,rotation:0,htmlLabels:true},optionalParams:{min:0,max:1,from:0,to:1,majorTickStep:4,minorTickStep:2,microTickStep:1,labels:[],labelFunc:null,maxLabelSize:0,maxLabelCharCount:0,trailingSymbol:null,stroke:{},majorTick:{},minorTick:{},microTick:{},tick:{},font:"",fontColor:"",title:"",titleGap:0,titleFont:"",titleFontColor:"",titleOrientation:""},constructor:function(_383,_384){this.opt=dojo.clone(this.defaultParams);du.updateWithObject(this.opt,_384);du.updateWithPattern(this.opt,_384,this.optionalParams);},getOffsets:function(){var s=this.scaler,_385={l:0,r:0,t:0,b:0};if(!s){return _385;}var o=this.opt,_386=0,a,b,c,d,gl=dc.scaler.common.getNumericLabel,_387=0,ma=s.major,mi=s.minor,ta=this.chart.theme.axis,_388=o.font||(ta.majorTick&&ta.majorTick.font)||(ta.tick&&ta.tick.font),_389=o.titleFont||(ta.tick&&ta.tick.titleFont),_38a=(o.titleGap==0)?0:o.titleGap||(ta.tick&&ta.tick.titleGap)||15,_38b=this.chart.theme.getTick("major",o),_38c=this.chart.theme.getTick("minor",o),size=_388?g.normalizedLength(g.splitFontString(_388).size):0,_38d=_389?g.normalizedLength(g.splitFontString(_389).size):0,_38e=o.rotation%360,_38f=o.leftBottom,cosr=Math.abs(Math.cos(_38e*Math.PI/180)),sinr=Math.abs(Math.sin(_38e*Math.PI/180));this.trailingSymbol=(o.trailingSymbol===undefined||o.trailingSymbol===null)?this.trailingSymbol:o.trailingSymbol;if(_38e<0){_38e+=360;}if(size){if(this.labels){_386=this._groupLabelWidth(this.labels,_388,o.maxLabelCharCount);}else{_386=this._groupLabelWidth([gl(ma.start,ma.prec,o),gl(ma.start+ma.count*ma.tick,ma.prec,o),gl(mi.start,mi.prec,o),gl(mi.start+mi.count*mi.tick,mi.prec,o)],_388,o.maxLabelCharCount);}_386=o.maxLabelSize?Math.min(o.maxLabelSize,_386):_386;if(this.vertical){var side=_38f?"l":"r";switch(_38e){case 0:case 180:_385[side]=_386;_385.t=_385.b=size/2;break;case 90:case 270:_385[side]=size;_385.t=_385.b=_386/2;break;default:if(_38e<=_382||(180<_38e&&_38e<=(180+_382))){_385[side]=size*sinr/2+_386*cosr;_385[_38f?"t":"b"]=size*cosr/2+_386*sinr;_385[_38f?"b":"t"]=size*cosr/2;}else{if(_38e>(360-_382)||(180>_38e&&_38e>(180-_382))){_385[side]=size*sinr/2+_386*cosr;_385[_38f?"b":"t"]=size*cosr/2+_386*sinr;_385[_38f?"t":"b"]=size*cosr/2;}else{if(_38e<90||(180<_38e&&_38e<270)){_385[side]=size*sinr+_386*cosr;_385[_38f?"t":"b"]=size*cosr+_386*sinr;}else{_385[side]=size*sinr+_386*cosr;_385[_38f?"b":"t"]=size*cosr+_386*sinr;}}}break;}_385[side]+=_381+Math.max(_38b.length,_38c.length)+(o.title?(_38d+_38a):0);}else{var side=_38f?"b":"t";switch(_38e){case 0:case 180:_385[side]=size;_385.l=_385.r=_386/2;break;case 90:case 270:_385[side]=_386;_385.l=_385.r=size/2;break;default:if((90-_382)<=_38e&&_38e<=90||(270-_382)<=_38e&&_38e<=270){_385[side]=size*sinr/2+_386*cosr;_385[_38f?"r":"l"]=size*cosr/2+_386*sinr;_385[_38f?"l":"r"]=size*cosr/2;}else{if(90<=_38e&&_38e<=(90+_382)||270<=_38e&&_38e<=(270+_382)){_385[side]=size*sinr/2+_386*cosr;_385[_38f?"l":"r"]=size*cosr/2+_386*sinr;_385[_38f?"r":"l"]=size*cosr/2;}else{if(_38e<_382||(180<_38e&&_38e<(180-_382))){_385[side]=size*sinr+_386*cosr;_385[_38f?"r":"l"]=size*cosr+_386*sinr;}else{_385[side]=size*sinr+_386*cosr;_385[_38f?"l":"r"]=size*cosr+_386*sinr;}}}break;}_385[side]+=_381+Math.max(_38b.length,_38c.length)+(o.title?(_38d+_38a):0);}}if(_386){this._cachedLabelWidth=_386;}return _385;},render:function(dim,_390){if(!this.dirty){return this;}var o=this.opt,ta=this.chart.theme.axis,_391=o.leftBottom,_392=o.rotation%360,_393,stop,_394,_395=0,_396,_397,_398,_399,_39a,_39b,_39c=o.font||(ta.majorTick&&ta.majorTick.font)||(ta.tick&&ta.tick.font),_39d=o.titleFont||(ta.tick&&ta.tick.titleFont),_39e=o.fontColor||(ta.majorTick&&ta.majorTick.fontColor)||(ta.tick&&ta.tick.fontColor)||"black",_39f=o.titleFontColor||(ta.tick&&ta.tick.titleFontColor)||"black",_3a0=(o.titleGap==0)?0:o.titleGap||(ta.tick&&ta.tick.titleGap)||15,_3a1=o.titleOrientation||(ta.tick&&ta.tick.titleOrientation)||"axis",_3a2=this.chart.theme.getTick("major",o),_3a3=this.chart.theme.getTick("minor",o),_3a4=this.chart.theme.getTick("micro",o),_3a5=Math.max(_3a2.length,_3a3.length,_3a4.length),_3a6="stroke" in o?o.stroke:ta.stroke,size=_39c?g.normalizedLength(g.splitFontString(_39c).size):0,cosr=Math.abs(Math.cos(_392*Math.PI/180)),sinr=Math.abs(Math.sin(_392*Math.PI/180)),_3a7=_39d?g.normalizedLength(g.splitFontString(_39d).size):0;if(_392<0){_392+=360;}if(this.vertical){_393={y:dim.height-_390.b};stop={y:_390.t};_394={y:(dim.height-_390.b+_390.t)/2};_396=size*sinr+(this._cachedLabelWidth||0)*cosr+_381+Math.max(_3a2.length,_3a3.length)+_3a7+_3a0;_397={x:0,y:-1};_39a={x:0,y:0};_398={x:1,y:0};_399={x:_381,y:0};switch(_392){case 0:_39b="end";_39a.y=size*0.4;break;case 90:_39b="middle";_39a.x=-size;break;case 180:_39b="start";_39a.y=-size*0.4;break;case 270:_39b="middle";break;default:if(_392<_382){_39b="end";_39a.y=size*0.4;}else{if(_392<90){_39b="end";_39a.y=size*0.4;}else{if(_392<(180-_382)){_39b="start";}else{if(_392<(180+_382)){_39b="start";_39a.y=-size*0.4;}else{if(_392<270){_39b="start";_39a.x=_391?0:size*0.4;}else{if(_392<(360-_382)){_39b="end";_39a.x=_391?0:size*0.4;}else{_39b="end";_39a.y=size*0.4;}}}}}}}if(_391){_393.x=stop.x=_390.l;_395=(_3a1&&_3a1=="away")?90:270;_394.x=_390.l-_396+(_395==270?_3a7:0);_398.x=-1;_399.x=-_399.x;}else{_393.x=stop.x=dim.width-_390.r;_395=(_3a1&&_3a1=="axis")?90:270;_394.x=dim.width-_390.r+_396-(_395==270?0:_3a7);switch(_39b){case "start":_39b="end";break;case "end":_39b="start";break;case "middle":_39a.x+=size;break;}}}else{_393={x:_390.l};stop={x:dim.width-_390.r};_394={x:(dim.width-_390.r+_390.l)/2};_396=size*cosr+(this._cachedLabelWidth||0)*sinr+_381+Math.max(_3a2.length,_3a3.length)+_3a7+_3a0;_397={x:1,y:0};_39a={x:0,y:0};_398={x:0,y:1};_399={x:0,y:_381};switch(_392){case 0:_39b="middle";_39a.y=size;break;case 90:_39b="start";_39a.x=-size*0.4;break;case 180:_39b="middle";break;case 270:_39b="end";_39a.x=size*0.4;break;default:if(_392<(90-_382)){_39b="start";_39a.y=_391?size:0;}else{if(_392<(90+_382)){_39b="start";_39a.x=-size*0.4;}else{if(_392<180){_39b="start";_39a.y=_391?0:-size;}else{if(_392<(270-_382)){_39b="end";_39a.y=_391?0:-size;}else{if(_392<(270+_382)){_39b="end";_39a.y=_391?size*0.4:0;}else{_39b="end";_39a.y=_391?size:0;}}}}}}if(_391){_393.y=stop.y=dim.height-_390.b;_395=(_3a1&&_3a1=="axis")?180:0;_394.y=dim.height-_390.b+_396-(_395?_3a7:0);}else{_393.y=stop.y=_390.t;_395=(_3a1&&_3a1=="away")?180:0;_394.y=_390.t-_396+(_395?0:_3a7);_398.y=-1;_399.y=-_399.y;switch(_39b){case "start":_39b="end";break;case "end":_39b="start";break;case "middle":_39a.y-=size;break;}}}this.cleanGroup();try{var s=this.group,c=this.scaler,t=this.ticks,_3a8,f=lin.getTransformerFromModel(this.scaler),_3a9=!_395&&!_392&&this.opt.htmlLabels&&!dojo.isIE&&!dojo.isOpera?"html":"gfx",dx=_398.x*_3a2.length,dy=_398.y*_3a2.length;s.createLine({x1:_393.x,y1:_393.y,x2:stop.x,y2:stop.y}).setStroke(_3a6);if(o.title){var _3aa=dc.axis2d.common.createText[_3a9](this.chart,s,_394.x,_394.y,"middle",o.title,_39d,_39f);if(_3a9=="html"){this.htmlElements.push(_3aa);}else{_3aa.setTransform(g.matrix.rotategAt(_395,_394.x,_394.y));}}dojo.forEach(t.major,function(tick){var _3ab=f(tick.value),elem,x=_393.x+_397.x*_3ab,y=_393.y+_397.y*_3ab;s.createLine({x1:x,y1:y,x2:x+dx,y2:y+dy}).setStroke(_3a2);if(tick.label){var _3ac=o.maxLabelCharCount?this.getTextWithLimitCharCount(tick.label,_39c,o.maxLabelCharCount):{text:tick.label,truncated:false};_3ac=o.maxLabelSize?this.getTextWithLimitLength(_3ac.text,_39c,o.maxLabelSize,_3ac.truncated):_3ac;elem=dc.axis2d.common.createText[_3a9](this.chart,s,x+dx+_399.x+(_392?0:_39a.x),y+dy+_399.y+(_392?0:_39a.y),_39b,_3ac.text,_39c,_39e);_3ac.truncated&&this.labelTooltip(elem,this.chart,tick.label,_3ac.text,_39c,_3a9);if(_3a9=="html"){this.htmlElements.push(elem);}else{if(_392){elem.setTransform([{dx:_39a.x,dy:_39a.y},g.matrix.rotategAt(_392,x+dx+_399.x,y+dy+_399.y)]);}}}},this);dx=_398.x*_3a3.length;dy=_398.y*_3a3.length;_3a8=c.minMinorStep<=c.minor.tick*c.bounds.scale;dojo.forEach(t.minor,function(tick){var _3ad=f(tick.value),elem,x=_393.x+_397.x*_3ad,y=_393.y+_397.y*_3ad;s.createLine({x1:x,y1:y,x2:x+dx,y2:y+dy}).setStroke(_3a3);if(_3a8&&tick.label){var _3ae=o.maxLabelCharCount?this.getTextWithLimitCharCount(tick.label,_39c,o.maxLabelCharCount):{text:tick.label,truncated:false};_3ae=o.maxLabelSize?this.getTextWithLimitLength(_3ae.text,_39c,o.maxLabelSize,_3ae.truncated):_3ae;elem=dc.axis2d.common.createText[_3a9](this.chart,s,x+dx+_399.x+(_392?0:_39a.x),y+dy+_399.y+(_392?0:_39a.y),_39b,_3ae.text,_39c,_39e);_3ae.truncated&&this.labelTooltip(elem,this.chart,tick.label,_3ae.text,_39c,_3a9);if(_3a9=="html"){this.htmlElements.push(elem);}else{if(_392){elem.setTransform([{dx:_39a.x,dy:_39a.y},g.matrix.rotategAt(_392,x+dx+_399.x,y+dy+_399.y)]);}}}},this);dx=_398.x*_3a4.length;dy=_398.y*_3a4.length;dojo.forEach(t.micro,function(tick){var _3af=f(tick.value),elem,x=_393.x+_397.x*_3af,y=_393.y+_397.y*_3af;s.createLine({x1:x,y1:y,x2:x+dx,y2:y+dy}).setStroke(_3a4);},this);}catch(e){}this.dirty=false;return this;},labelTooltip:function(elem,_3b0,_3b1,_3b2,font,_3b3){if(!dijit||!dijit.Tooltip){return;}var _3b4={type:"rect"},_3b5=["above","below"],_3b6=dojox.gfx._base._getTextBox(_3b2,{font:font}).w||0;fontHeight=font?g.normalizedLength(g.splitFontString(font).size):0;if(_3b3=="html"){dojo.mixin(_3b4,dojo.coords(elem.firstChild,true));_3b4.width=Math.ceil(_3b6);_3b4.height=Math.ceil(fontHeight);this._events.push({shape:dojo,handle:dojo.connect(elem.firstChild,"onmouseover",this,function(e){dijit.showTooltip(_3b1,_3b4,_3b5);})});this._events.push({shape:dojo,handle:dojo.connect(elem.firstChild,"onmouseout",this,function(e){dijit.hideTooltip(_3b4);})});}else{var shp=elem.getShape(),lt=dojo.coords(_3b0.node,true);_3b4=dojo.mixin(_3b4,{x:shp.x-_3b6/2,y:shp.y});_3b4.x+=lt.x;_3b4.y+=lt.y;_3b4.x=Math.round(_3b4.x);_3b4.y=Math.round(_3b4.y);_3b4.width=Math.ceil(_3b6);_3b4.height=Math.ceil(fontHeight);this._events.push({shape:elem,handle:elem.connect("onmouseenter",this,function(e){dijit.showTooltip(_3b1,_3b4,_3b5);})});this._events.push({shape:elem,handle:elem.connect("onmouseleave",this,function(e){dijit.hideTooltip(_3b4);})});}}});})();}if(!dojo._hasResource["dojox.charting.plot2d.common"]){dojo._hasResource["dojox.charting.plot2d.common"]=true;dojo.provide("dojox.charting.plot2d.common");(function(){var df=dojox.lang.functional,dc=dojox.charting.plot2d.common;dojo.mixin(dojox.charting.plot2d.common,{makeStroke:function(_3b7){if(!_3b7){return _3b7;}if(typeof _3b7=="string"||_3b7 instanceof dojo.Color){_3b7={color:_3b7};}return dojox.gfx.makeParameters(dojox.gfx.defaultStroke,_3b7);},augmentColor:function(_3b8,_3b9){var t=new dojo.Color(_3b8),c=new dojo.Color(_3b9);c.a=t.a;return c;},augmentStroke:function(_3ba,_3bb){var s=dc.makeStroke(_3ba);if(s){s.color=dc.augmentColor(s.color,_3bb);}return s;},augmentFill:function(fill,_3bc){var fc,c=new dojo.Color(_3bc);if(typeof fill=="string"||fill instanceof dojo.Color){return dc.augmentColor(fill,_3bc);}return fill;},defaultStats:{vmin:Number.POSITIVE_INFINITY,vmax:Number.NEGATIVE_INFINITY,hmin:Number.POSITIVE_INFINITY,hmax:Number.NEGATIVE_INFINITY},collectSimpleStats:function(_3bd){var _3be=dojo.delegate(dc.defaultStats);for(var i=0;i<_3bd.length;++i){var run=_3bd[i];for(var j=0;j<run.data.length;j++){if(run.data[j]!==null){if(typeof run.data[j]=="number"){var _3bf=_3be.vmin,_3c0=_3be.vmax;if(!("ymin" in run)||!("ymax" in run)){dojo.forEach(run.data,function(val,i){if(val!==null){var x=i+1,y=val;if(isNaN(y)){y=0;}_3be.hmin=Math.min(_3be.hmin,x);_3be.hmax=Math.max(_3be.hmax,x);_3be.vmin=Math.min(_3be.vmin,y);_3be.vmax=Math.max(_3be.vmax,y);}});}if("ymin" in run){_3be.vmin=Math.min(_3bf,run.ymin);}if("ymax" in run){_3be.vmax=Math.max(_3c0,run.ymax);}}else{var _3c1=_3be.hmin,_3c2=_3be.hmax,_3bf=_3be.vmin,_3c0=_3be.vmax;if(!("xmin" in run)||!("xmax" in run)||!("ymin" in run)||!("ymax" in run)){dojo.forEach(run.data,function(val,i){if(val!==null){var x="x" in val?val.x:i+1,y=val.y;if(isNaN(x)){x=0;}if(isNaN(y)){y=0;}_3be.hmin=Math.min(_3be.hmin,x);_3be.hmax=Math.max(_3be.hmax,x);_3be.vmin=Math.min(_3be.vmin,y);_3be.vmax=Math.max(_3be.vmax,y);}});}if("xmin" in run){_3be.hmin=Math.min(_3c1,run.xmin);}if("xmax" in run){_3be.hmax=Math.max(_3c2,run.xmax);}if("ymin" in run){_3be.vmin=Math.min(_3bf,run.ymin);}if("ymax" in run){_3be.vmax=Math.max(_3c0,run.ymax);}}break;}}}return _3be;},calculateBarSize:function(_3c3,opt,_3c4){if(!_3c4){_3c4=1;}var gap=opt.gap,size=(_3c3-2*gap)/_3c4;if("minBarSize" in opt){size=Math.max(size,opt.minBarSize);}if("maxBarSize" in opt){size=Math.min(size,opt.maxBarSize);}size=Math.max(size,1);gap=(_3c3-size*_3c4)/2;return {size:size,gap:gap};},collectStackedStats:function(_3c5){var _3c6=dojo.clone(dc.defaultStats);if(_3c5.length){_3c6.hmin=Math.min(_3c6.hmin,1);_3c6.hmax=df.foldl(_3c5,"seed, run -> Math.max(seed, run.data.length)",_3c6.hmax);for(var i=0;i<_3c6.hmax;++i){var v=_3c5[0].data[i];v=v&&(typeof v=="number"?v:v.y);if(isNaN(v)){v=0;}_3c6.vmin=Math.min(_3c6.vmin,v);for(var j=1;j<_3c5.length;++j){var t=_3c5[j].data[i];t=t&&(typeof t=="number"?t:t.y);if(isNaN(t)){t=0;}v+=t;}_3c6.vmax=Math.max(_3c6.vmax,v);}}return _3c6;},curve:function(a,_3c7){var arr=a.slice(0);if(_3c7=="x"){arr[arr.length]=arr[0];}var p=dojo.map(arr,function(item,i){if(i==0){return "M"+item.x+","+item.y;}if(!isNaN(_3c7)){var dx=item.x-arr[i-1].x,dy=arr[i-1].y;return "C"+(item.x-(_3c7-1)*(dx/_3c7))+","+dy+" "+(item.x-(dx/_3c7))+","+item.y+" "+item.x+","+item.y;}else{if(_3c7=="X"||_3c7=="x"||_3c7=="S"){var p0,p1=arr[i-1],p2=arr[i],p3;var bz1x,bz1y,bz2x,bz2y;var f=1/6;if(i==1){if(_3c7=="x"){p0=arr[arr.length-2];}else{p0=p1;}f=1/3;}else{p0=arr[i-2];}if(i==(arr.length-1)){if(_3c7=="x"){p3=arr[1];}else{p3=p2;}f=1/3;}else{p3=arr[i+1];}var p1p2=Math.sqrt((p2.x-p1.x)*(p2.x-p1.x)+(p2.y-p1.y)*(p2.y-p1.y));var p0p2=Math.sqrt((p2.x-p0.x)*(p2.x-p0.x)+(p2.y-p0.y)*(p2.y-p0.y));var p1p3=Math.sqrt((p3.x-p1.x)*(p3.x-p1.x)+(p3.y-p1.y)*(p3.y-p1.y));var _3c8=p0p2*f;var _3c9=p1p3*f;if(_3c8>p1p2/2&&_3c9>p1p2/2){_3c8=p1p2/2;_3c9=p1p2/2;}else{if(_3c8>p1p2/2){_3c8=p1p2/2;_3c9=p1p2/2*p1p3/p0p2;}else{if(_3c9>p1p2/2){_3c9=p1p2/2;_3c8=p1p2/2*p0p2/p1p3;}}}if(_3c7=="S"){if(p0==p1){_3c8=0;}if(p2==p3){_3c9=0;}}bz1x=p1.x+_3c8*(p2.x-p0.x)/p0p2;bz1y=p1.y+_3c8*(p2.y-p0.y)/p0p2;bz2x=p2.x-_3c9*(p3.x-p1.x)/p1p3;bz2y=p2.y-_3c9*(p3.y-p1.y)/p1p3;}}return "C"+(bz1x+","+bz1y+" "+bz2x+","+bz2y+" "+p2.x+","+p2.y);});return p.join(" ");},getLabel:function(_3ca,_3cb,_3cc){if(dojo.number){return (_3cb?dojo.number.format(_3ca,{places:_3cc}):dojo.number.format(_3ca))||"";}return _3cb?_3ca.toFixed(_3cc):_3ca.toString();}});})();}if(!dojo._hasResource["dojox.charting.scaler.primitive"]){dojo._hasResource["dojox.charting.scaler.primitive"]=true;dojo.provide("dojox.charting.scaler.primitive");dojox.charting.scaler.primitive={buildScaler:function(min,max,span,_3cd){if(min==max){min-=0.5;max+=0.5;}return {bounds:{lower:min,upper:max,from:min,to:max,scale:span/(max-min),span:span},scaler:dojox.charting.scaler.primitive};},buildTicks:function(_3ce,_3cf){return {major:[],minor:[],micro:[]};},getTransformerFromModel:function(_3d0){var _3d1=_3d0.bounds.from,_3d2=_3d0.bounds.scale;return function(x){return (x-_3d1)*_3d2;};},getTransformerFromPlot:function(_3d3){var _3d4=_3d3.bounds.from,_3d5=_3d3.bounds.scale;return function(x){return x/_3d5+_3d4;};}};}if(!dojo._hasResource["dojox.charting.plot2d._PlotEvents"]){dojo._hasResource["dojox.charting.plot2d._PlotEvents"]=true;dojo.provide("dojox.charting.plot2d._PlotEvents");dojo.declare("dojox.charting.plot2d._PlotEvents",null,{constructor:function(){this._shapeEvents=[];this._eventSeries={};},destroy:function(){this.resetEvents();this.inherited(arguments);},plotEvent:function(o){},raiseEvent:function(o){this.plotEvent(o);var t=dojo.delegate(o);t.originalEvent=o.type;t.originalPlot=o.plot;t.type="onindirect";dojo.forEach(this.chart.stack,function(plot){if(plot!==this&&plot.plotEvent){t.plot=plot;plot.plotEvent(t);}},this);},connect:function(_3d6,_3d7){this.dirty=true;return dojo.connect(this,"plotEvent",_3d6,_3d7);},events:function(){var ls=this.plotEvent._listeners;if(!ls||!ls.length){return false;}for(var i in ls){if(!(i in Array.prototype)){return true;}}return false;},resetEvents:function(){if(this._shapeEvents.length){dojo.forEach(this._shapeEvents,function(item){item.shape.disconnect(item.handle);});this._shapeEvents=[];}this.raiseEvent({type:"onplotreset",plot:this});},_connectSingleEvent:function(o,_3d8){this._shapeEvents.push({shape:o.eventMask,handle:o.eventMask.connect(_3d8,this,function(e){o.type=_3d8;o.event=e;this.raiseEvent(o);o.event=null;})});},_connectEvents:function(o){if(o){o.chart=this.chart;o.plot=this;o.hAxis=this.hAxis||null;o.vAxis=this.vAxis||null;o.eventMask=o.eventMask||o.shape;this._connectSingleEvent(o,"onmouseover");this._connectSingleEvent(o,"onmouseout");this._connectSingleEvent(o,"onclick");}},_reconnectEvents:function(_3d9){var a=this._eventSeries[_3d9];if(a){dojo.forEach(a,this._connectEvents,this);}},fireEvent:function(_3da,_3db,_3dc,_3dd){var s=this._eventSeries[_3da];if(s&&s.length&&_3dc<s.length){var o=s[_3dc];o.type=_3db;o.event=_3dd||null;this.raiseEvent(o);o.event=null;}}});}if(!dojo._hasResource["dojox.charting.plot2d.Base"]){dojo._hasResource["dojox.charting.plot2d.Base"]=true;dojo.provide("dojox.charting.plot2d.Base");dojo.declare("dojox.charting.plot2d.Base",[dojox.charting.Element,dojox.charting.plot2d._PlotEvents],{constructor:function(_3de,_3df){this.zoom=null,this.zoomQueue=[];this.lastWindow={vscale:1,hscale:1,xoffset:0,yoffset:0};},clear:function(){this.series=[];this._hAxis=null;this._vAxis=null;this.dirty=true;return this;},setAxis:function(axis){if(axis){this[axis.vertical?"_vAxis":"_hAxis"]=axis;}return this;},addSeries:function(run){this.series.push(run);return this;},getSeriesStats:function(){return dojox.charting.plot2d.common.collectSimpleStats(this.series);},calculateAxes:function(dim){this.initializeScalers(dim,this.getSeriesStats());return this;},isDirty:function(){return this.dirty||this._hAxis&&this._hAxis.dirty||this._vAxis&&this._vAxis.dirty;},isDataDirty:function(){return dojo.some(this.series,function(item){return item.dirty;});},performZoom:function(dim,_3e0){var vs=this._vAxis.scale||1,hs=this._hAxis.scale||1,_3e1=dim.height-_3e0.b,_3e2=this._hScaler.bounds,_3e3=(_3e2.from-_3e2.lower)*_3e2.scale,_3e4=this._vScaler.bounds,_3e5=(_3e4.from-_3e4.lower)*_3e4.scale;rVScale=vs/this.lastWindow.vscale,rHScale=hs/this.lastWindow.hscale,rXOffset=(this.lastWindow.xoffset-_3e3)/((this.lastWindow.hscale==1)?hs:this.lastWindow.hscale),rYOffset=(_3e5-this.lastWindow.yoffset)/((this.lastWindow.vscale==1)?vs:this.lastWindow.vscale),shape=this.group,anim=dojox.gfx.fx.animateTransform(dojo.delegate({shape:shape,duration:1200,transform:[{name:"translate",start:[0,0],end:[_3e0.l*(1-rHScale),_3e1*(1-rVScale)]},{name:"scale",start:[1,1],end:[rHScale,rVScale]},{name:"original"},{name:"translate",start:[0,0],end:[rXOffset,rYOffset]}]},this.zoom));dojo.mixin(this.lastWindow,{vscale:vs,hscale:hs,xoffset:_3e3,yoffset:_3e5});this.zoomQueue.push(anim);dojo.connect(anim,"onEnd",this,function(){this.zoom=null;this.zoomQueue.shift();if(this.zoomQueue.length>0){this.zoomQueue[0].play();}});if(this.zoomQueue.length==1){this.zoomQueue[0].play();}return this;},render:function(dim,_3e6){return this;},getRequiredColors:function(){return this.series.length;},initializeScalers:function(dim,_3e7){if(this._hAxis){if(!this._hAxis.initialized()){this._hAxis.calculate(_3e7.hmin,_3e7.hmax,dim.width);}this._hScaler=this._hAxis.getScaler();}else{this._hScaler=dojox.charting.scaler.primitive.buildScaler(_3e7.hmin,_3e7.hmax,dim.width);}if(this._vAxis){if(!this._vAxis.initialized()){this._vAxis.calculate(_3e7.vmin,_3e7.vmax,dim.height);}this._vScaler=this._vAxis.getScaler();}else{this._vScaler=dojox.charting.scaler.primitive.buildScaler(_3e7.vmin,_3e7.vmax,dim.height);}return this;}});}if(!dojo._hasResource["dojox.lang.functional.reversed"]){dojo._hasResource["dojox.lang.functional.reversed"]=true;dojo.provide("dojox.lang.functional.reversed");(function(){var d=dojo,df=dojox.lang.functional;d.mixin(df,{filterRev:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var t=[],v,i=a.length-1;for(;i>=0;--i){v=a[i];if(f.call(o,v,i,a)){t.push(v);}}return t;},forEachRev:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);for(var i=a.length-1;i>=0;f.call(o,a[i],i,a),--i){}},mapRev:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var n=a.length,t=new Array(n),i=n-1,j=0;for(;i>=0;t[j++]=f.call(o,a[i],i,a),--i){}return t;},everyRev:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);for(var i=a.length-1;i>=0;--i){if(!f.call(o,a[i],i,a)){return false;}}return true;},someRev:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);for(var i=a.length-1;i>=0;--i){if(f.call(o,a[i],i,a)){return true;}}return false;}});})();}if(!dojo._hasResource["dojox.gfx.fx"]){dojo._hasResource["dojox.gfx.fx"]=true;dojo.provide("dojox.gfx.fx");(function(){var d=dojo,g=dojox.gfx,m=g.matrix;function _3e8(_3e9,end){this.start=_3e9,this.end=end;};_3e8.prototype.getValue=function(r){return (this.end-this.start)*r+this.start;};function _3ea(_3eb,end,_3ec){this.start=_3eb,this.end=end;this.units=_3ec;};_3ea.prototype.getValue=function(r){return (this.end-this.start)*r+this.start+this.units;};function _3ed(_3ee,end){this.start=_3ee,this.end=end;this.temp=new dojo.Color();};_3ed.prototype.getValue=function(r){return d.blendColors(this.start,this.end,r,this.temp);};function _3ef(_3f0){this.values=_3f0;this.length=_3f0.length;};_3ef.prototype.getValue=function(r){return this.values[Math.min(Math.floor(r*this.length),this.length-1)];};function _3f1(_3f2,def){this.values=_3f2;this.def=def?def:{};};_3f1.prototype.getValue=function(r){var ret=dojo.clone(this.def);for(var i in this.values){ret[i]=this.values[i].getValue(r);}return ret;};function _3f3(_3f4,_3f5){this.stack=_3f4;this.original=_3f5;};_3f3.prototype.getValue=function(r){var ret=[];dojo.forEach(this.stack,function(t){if(t instanceof m.Matrix2D){ret.push(t);return;}if(t.name=="original"&&this.original){ret.push(this.original);return;}if(!(t.name in m)){return;}var f=m[t.name];if(typeof f!="function"){ret.push(f);return;}var val=dojo.map(t.start,function(v,i){return (t.end[i]-v)*r+v;}),_3f6=f.apply(m,val);if(_3f6 instanceof m.Matrix2D){ret.push(_3f6);}},this);return ret;};var _3f7=new d.Color(0,0,0,0);function _3f8(prop,obj,name,def){if(prop.values){return new _3ef(prop.values);}var _3f9,_3fa,end;if(prop.start){_3fa=g.normalizeColor(prop.start);}else{_3fa=_3f9=obj?(name?obj[name]:obj):def;}if(prop.end){end=g.normalizeColor(prop.end);}else{if(!_3f9){_3f9=obj?(name?obj[name]:obj):def;}end=_3f9;}return new _3ed(_3fa,end);};function _3fb(prop,obj,name,def){if(prop.values){return new _3ef(prop.values);}var _3fc,_3fd,end;if(prop.start){_3fd=prop.start;}else{_3fd=_3fc=obj?obj[name]:def;}if(prop.end){end=prop.end;}else{if(typeof _3fc!="number"){_3fc=obj?obj[name]:def;}end=_3fc;}return new _3e8(_3fd,end);};g.fx.animateStroke=function(args){if(!args.easing){args.easing=d._defaultEasing;}var anim=new d.Animation(args),_3fe=args.shape,_3ff;d.connect(anim,"beforeBegin",anim,function(){_3ff=_3fe.getStroke();var prop=args.color,_400={},_401,_402,end;if(prop){_400.color=_3f8(prop,_3ff,"color",_3f7);}prop=args.style;if(prop&&prop.values){_400.style=new _3ef(prop.values);}prop=args.width;if(prop){_400.width=_3fb(prop,_3ff,"width",1);}prop=args.cap;if(prop&&prop.values){_400.cap=new _3ef(prop.values);}prop=args.join;if(prop){if(prop.values){_400.join=new _3ef(prop.values);}else{_402=prop.start?prop.start:(_3ff&&_3ff.join||0);end=prop.end?prop.end:(_3ff&&_3ff.join||0);if(typeof _402=="number"&&typeof end=="number"){_400.join=new _3e8(_402,end);}}}this.curve=new _3f1(_400,_3ff);});d.connect(anim,"onAnimate",_3fe,"setStroke");return anim;};g.fx.animateFill=function(args){if(!args.easing){args.easing=d._defaultEasing;}var anim=new d.Animation(args),_403=args.shape,fill;d.connect(anim,"beforeBegin",anim,function(){fill=_403.getFill();var prop=args.color,_404={};if(prop){this.curve=_3f8(prop,fill,"",_3f7);}});d.connect(anim,"onAnimate",_403,"setFill");return anim;};g.fx.animateFont=function(args){if(!args.easing){args.easing=d._defaultEasing;}var anim=new d.Animation(args),_405=args.shape,font;d.connect(anim,"beforeBegin",anim,function(){font=_405.getFont();var prop=args.style,_406={},_407,_408,end;if(prop&&prop.values){_406.style=new _3ef(prop.values);}prop=args.variant;if(prop&&prop.values){_406.variant=new _3ef(prop.values);}prop=args.weight;if(prop&&prop.values){_406.weight=new _3ef(prop.values);}prop=args.family;if(prop&&prop.values){_406.family=new _3ef(prop.values);}prop=args.size;if(prop&&prop.units){_408=parseFloat(prop.start?prop.start:(_405.font&&_405.font.size||"0"));end=parseFloat(prop.end?prop.end:(_405.font&&_405.font.size||"0"));_406.size=new _3ea(_408,end,prop.units);}this.curve=new _3f1(_406,font);});d.connect(anim,"onAnimate",_405,"setFont");return anim;};g.fx.animateTransform=function(args){if(!args.easing){args.easing=d._defaultEasing;}var anim=new d.Animation(args),_409=args.shape,_40a;d.connect(anim,"beforeBegin",anim,function(){_40a=_409.getTransform();this.curve=new _3f3(args.transform,_40a);});d.connect(anim,"onAnimate",_409,"setTransform");return anim;};})();}if(!dojo._hasResource["dojox.charting.plot2d.Default"]){dojo._hasResource["dojox.charting.plot2d.Default"]=true;dojo.provide("dojox.charting.plot2d.Default");(function(){var df=dojox.lang.functional,du=dojox.lang.utils,dc=dojox.charting.plot2d.common,_40b=df.lambda("item.purgeGroup()");var _40c=1200;dojo.declare("dojox.charting.plot2d.Default",dojox.charting.plot2d.Base,{defaultParams:{hAxis:"x",vAxis:"y",lines:true,areas:false,markers:false,tension:"",animate:false},optionalParams:{stroke:{},outline:{},shadow:{},fill:{},font:"",fontColor:"",markerStroke:{},markerOutline:{},markerShadow:{},markerFill:{},markerFont:"",markerFontColor:""},constructor:function(_40d,_40e){this.opt=dojo.clone(this.defaultParams);du.updateWithObject(this.opt,_40e);du.updateWithPattern(this.opt,_40e,this.optionalParams);this.series=[];this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate;},render:function(dim,_40f){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_40f);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){dojo.forEach(this.series,_40b);this._eventSeries={};this.cleanGroup();this.group.setTransform(null);var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,_410,_411,_412,_413=this.events();for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();if(!run.data.length){run.dirty=false;t.skip();continue;}var _414=t.next(this.opt.areas?"area":"line",[this.opt,run],true),s=run.group,_415=[],_416=[],rseg=null,_417,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_418=this._eventSeries[run.name]=new Array(run.data.length);for(var j=0;j<run.data.length;j++){if(run.data[j]!=null){if(!rseg){rseg=[];_416.push(j);_415.push(rseg);}rseg.push(run.data[j]);}else{rseg=null;}}for(var seg=0;seg<_415.length;seg++){if(typeof _415[seg][0]=="number"){_417=dojo.map(_415[seg],function(v,i){return {x:ht(i+_416[seg]+1)+_40f.l,y:dim.height-_40f.b-vt(v)};},this);}else{_417=dojo.map(_415[seg],function(v,i){return {x:ht(v.x)+_40f.l,y:dim.height-_40f.b-vt(v.y)};},this);}var _419=this.opt.tension?dc.curve(_417,this.opt.tension):"";if(this.opt.areas&&_417.length>1){var fill=_414.series.fill;var _41a=dojo.clone(_417);if(this.opt.tension){var _41b="L"+_41a[_41a.length-1].x+","+(dim.height-_40f.b)+" L"+_41a[0].x+","+(dim.height-_40f.b)+" L"+_41a[0].x+","+_41a[0].y;run.dyn.fill=s.createPath(_419+" "+_41b).setFill(fill).getFill();}else{_41a.push({x:_417[_417.length-1].x,y:dim.height-_40f.b});_41a.push({x:_417[0].x,y:dim.height-_40f.b});_41a.push(_417[0]);run.dyn.fill=s.createPolyline(_41a).setFill(fill).getFill();}}if(this.opt.lines||this.opt.markers){_410=_414.series.stroke;if(_414.series.outline){_411=run.dyn.outline=dc.makeStroke(_414.series.outline);_411.width=2*_411.width+_410.width;}}if(this.opt.markers){run.dyn.marker=_414.symbol;}var _41c=null,_41d=null,_41e=null;if(_410&&_414.series.shadow&&_417.length>1){var _41f=_414.series.shadow,_420=dojo.map(_417,function(c){return {x:c.x+_41f.dx,y:c.y+_41f.dy};});if(this.opt.lines){if(this.opt.tension){run.dyn.shadow=s.createPath(dc.curve(_420,this.opt.tension)).setStroke(_41f).getStroke();}else{run.dyn.shadow=s.createPolyline(_420).setStroke(_41f).getStroke();}}if(this.opt.markers&&_414.marker.shadow){_41f=_414.marker.shadow;_41e=dojo.map(_420,function(c){return s.createPath("M"+c.x+" "+c.y+" "+_414.symbol).setStroke(_41f).setFill(_41f.color);},this);}}if(this.opt.lines&&_417.length>1){if(_411){if(this.opt.tension){run.dyn.outline=s.createPath(_419).setStroke(_411).getStroke();}else{run.dyn.outline=s.createPolyline(_417).setStroke(_411).getStroke();}}if(this.opt.tension){run.dyn.stroke=s.createPath(_419).setStroke(_410).getStroke();}else{run.dyn.stroke=s.createPolyline(_417).setStroke(_410).getStroke();}}if(this.opt.markers){_41c=new Array(_417.length);_41d=new Array(_417.length);_411=null;if(_414.marker.outline){_411=dc.makeStroke(_414.marker.outline);_411.width=2*_411.width+(_414.marker.stroke?_414.marker.stroke.width:0);}dojo.forEach(_417,function(c,i){var path="M"+c.x+" "+c.y+" "+_414.symbol;if(_411){_41d[i]=s.createPath(path).setStroke(_411);}_41c[i]=s.createPath(path).setStroke(_414.marker.stroke).setFill(_414.marker.fill);},this);run.dyn.markerFill=_414.marker.fill;run.dyn.markerStroke=_414.marker.stroke;if(_413){dojo.forEach(_41c,function(s,i){var o={element:"marker",index:i+_416[seg],run:run,shape:s,outline:_41d[i]||null,shadow:_41e&&_41e[i]||null,cx:_417[i].x,cy:_417[i].y};if(typeof _415[seg][0]=="number"){o.x=i+_416[seg]+1;o.y=_415[seg][i];}else{o.x=_415[seg][i].x;o.y=_415[seg][i].y;}this._connectEvents(o);_418[i+_416[seg]]=o;},this);}else{delete this._eventSeries[run.name];}}}run.dirty=false;}if(this.animate){var _421=this.group;dojox.gfx.fx.animateTransform(dojo.delegate({shape:_421,duration:_40c,transform:[{name:"translate",start:[0,dim.height-_40f.b],end:[0,0]},{name:"scale",start:[1,0],end:[1,1]},{name:"original"}]},this.animate)).play();}this.dirty=false;return this;}});})();}if(!dojo._hasResource["dojox.charting.plot2d.Lines"]){dojo._hasResource["dojox.charting.plot2d.Lines"]=true;dojo.provide("dojox.charting.plot2d.Lines");dojo.declare("dojox.charting.plot2d.Lines",dojox.charting.plot2d.Default,{constructor:function(){this.opt.lines=true;}});}if(!dojo._hasResource["dojox.charting.plot2d.Areas"]){dojo._hasResource["dojox.charting.plot2d.Areas"]=true;dojo.provide("dojox.charting.plot2d.Areas");dojo.declare("dojox.charting.plot2d.Areas",dojox.charting.plot2d.Default,{constructor:function(){this.opt.lines=true;this.opt.areas=true;}});}if(!dojo._hasResource["dojox.charting.plot2d.Markers"]){dojo._hasResource["dojox.charting.plot2d.Markers"]=true;dojo.provide("dojox.charting.plot2d.Markers");dojo.declare("dojox.charting.plot2d.Markers",dojox.charting.plot2d.Default,{constructor:function(){this.opt.markers=true;}});}if(!dojo._hasResource["dojox.charting.plot2d.MarkersOnly"]){dojo._hasResource["dojox.charting.plot2d.MarkersOnly"]=true;dojo.provide("dojox.charting.plot2d.MarkersOnly");dojo.declare("dojox.charting.plot2d.MarkersOnly",dojox.charting.plot2d.Default,{constructor:function(){this.opt.lines=false;this.opt.markers=true;}});}if(!dojo._hasResource["dojox.gfx.gradutils"]){dojo._hasResource["dojox.gfx.gradutils"]=true;dojo.provide("dojox.gfx.gradutils");(function(){var d=dojo,m=dojox.gfx.matrix,C=d.Color;function _422(o,c){if(o<=0){return c[0].color;}var len=c.length;if(o>=1){return c[len-1].color;}for(var i=0;i<len;++i){var stop=c[i];if(stop.offset>=o){if(i){var prev=c[i-1];return d.blendColors(new C(prev.color),new C(stop.color),(o-prev.offset)/(stop.offset-prev.offset));}return stop.color;}}return c[len-1].color;};dojox.gfx.gradutils.getColor=function(fill,pt){var o;if(fill){switch(fill.type){case "linear":var _423=Math.atan2(fill.y2-fill.y1,fill.x2-fill.x1),_424=m.rotate(-_423),_425=m.project(fill.x2-fill.x1,fill.y2-fill.y1),p=m.multiplyPoint(_425,pt),pf1=m.multiplyPoint(_425,fill.x1,fill.y1),pf2=m.multiplyPoint(_425,fill.x2,fill.y2),_426=m.multiplyPoint(_424,pf2.x-pf1.x,pf2.y-pf1.y).x,o=m.multiplyPoint(_424,p.x-pf1.x,p.y-pf1.y).x/_426;break;case "radial":var dx=pt.x-fill.cx,dy=pt.y-fill.cy,o=Math.sqrt(dx*dx+dy*dy)/fill.r;break;}return _422(o,fill.colors);}return new C(fill||[0,0,0,0]);};dojox.gfx.gradutils.reverse=function(fill){if(fill){switch(fill.type){case "linear":case "radial":fill=dojo.delegate(fill);if(fill.colors){var c=fill.colors,l=c.length,i=0,stop,n=fill.colors=new Array(c.length);for(;i<l;++i){stop=c[i];n[i]={offset:1-stop.offset,color:stop.color};}n.sort(function(a,b){return a.offset-b.offset;});}break;}}return fill;};})();}if(!dojo._hasResource["dojox.charting.plot2d.Scatter"]){dojo._hasResource["dojox.charting.plot2d.Scatter"]=true;dojo.provide("dojox.charting.plot2d.Scatter");(function(){var df=dojox.lang.functional,du=dojox.lang.utils,dc=dojox.charting.plot2d.common,_427=df.lambda("item.purgeGroup()");dojo.declare("dojox.charting.plot2d.Scatter",dojox.charting.plot2d.Base,{defaultParams:{hAxis:"x",vAxis:"y",shadows:null,animate:null},optionalParams:{markerStroke:{},markerOutline:{},markerShadow:{},markerFill:{},markerFont:"",markerFontColor:""},constructor:function(_428,_429){this.opt=dojo.clone(this.defaultParams);du.updateWithObject(this.opt,_429);du.updateWithPattern(this.opt,_429,this.optionalParams);this.series=[];this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate;},render:function(dim,_42a){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_42a);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){dojo.forEach(this.series,_427);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,_42b=this.events();for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();if(!run.data.length){run.dirty=false;t.skip();continue;}var _42c=t.next("marker",[this.opt,run]),s=run.group,_42d,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler);if(typeof run.data[0]=="number"){_42d=dojo.map(run.data,function(v,i){return {x:ht(i+1)+_42a.l,y:dim.height-_42a.b-vt(v)};},this);}else{_42d=dojo.map(run.data,function(v,i){return {x:ht(v.x)+_42a.l,y:dim.height-_42a.b-vt(v.y)};},this);}var _42e=new Array(_42d.length),_42f=new Array(_42d.length),_430=new Array(_42d.length);dojo.forEach(_42d,function(c,i){var _431=typeof run.data[i]=="number"?t.post(_42c,"marker"):t.addMixin(_42c,"marker",run.data[i],true),path="M"+c.x+" "+c.y+" "+_431.symbol;if(_431.marker.shadow){_42e[i]=s.createPath("M"+(c.x+_431.marker.shadow.dx)+" "+(c.y+_431.marker.shadow.dy)+" "+_431.symbol).setStroke(_431.marker.shadow).setFill(_431.marker.shadow.color);if(this.animate){this._animateScatter(_42e[i],dim.height-_42a.b);}}if(_431.marker.outline){var _432=dc.makeStroke(_431.marker.outline);_432.width=2*_432.width+_431.marker.stroke.width;_430[i]=s.createPath(path).setStroke(_432);if(this.animate){this._animateScatter(_430[i],dim.height-_42a.b);}}var _433=dc.makeStroke(_431.marker.stroke),fill=this._plotFill(_431.marker.fill,dim,_42a);if(fill&&(fill.type==="linear"||fill.type=="radial")){var _434=dojox.gfx.gradutils.getColor(fill,{x:c.x,y:c.y});if(_433){_433.color=_434;}_42f[i]=s.createPath(path).setStroke(_433).setFill(_434);}else{_42f[i]=s.createPath(path).setStroke(_433).setFill(fill);}if(this.animate){this._animateScatter(_42f[i],dim.height-_42a.b);}},this);if(_42f.length){run.dyn.stroke=_42f[_42f.length-1].getStroke();run.dyn.fill=_42f[_42f.length-1].getFill();}if(_42b){var _435=new Array(_42f.length);dojo.forEach(_42f,function(s,i){var o={element:"marker",index:i,run:run,shape:s,outline:_430&&_430[i]||null,shadow:_42e&&_42e[i]||null,cx:_42d[i].x,cy:_42d[i].y};if(typeof run.data[0]=="number"){o.x=i+1;o.y=run.data[i];}else{o.x=run.data[i].x;o.y=run.data[i].y;}this._connectEvents(o);_435[i]=o;},this);this._eventSeries[run.name]=_435;}else{delete this._eventSeries[run.name];}run.dirty=false;}this.dirty=false;return this;},_animateScatter:function(_436,_437){dojox.gfx.fx.animateTransform(dojo.delegate({shape:_436,duration:1200,transform:[{name:"translate",start:[0,_437],end:[0,0]},{name:"scale",start:[0,0],end:[1,1]},{name:"original"}]},this.animate)).play();}});})();}if(!dojo._hasResource["dojox.lang.functional.sequence"]){dojo._hasResource["dojox.lang.functional.sequence"]=true;dojo.provide("dojox.lang.functional.sequence");(function(){var d=dojo,df=dojox.lang.functional;d.mixin(df,{repeat:function(n,f,z,o){o=o||d.global;f=df.lambda(f);var t=new Array(n),i=1;t[0]=z;for(;i<n;t[i]=z=f.call(o,z),++i){}return t;},until:function(pr,f,z,o){o=o||d.global;f=df.lambda(f);pr=df.lambda(pr);var t=[];for(;!pr.call(o,z);t.push(z),z=f.call(o,z)){}return t;}});})();}if(!dojo._hasResource["dojox.charting.plot2d.Stacked"]){dojo._hasResource["dojox.charting.plot2d.Stacked"]=true;dojo.provide("dojox.charting.plot2d.Stacked");(function(){var df=dojox.lang.functional,dc=dojox.charting.plot2d.common,_438=df.lambda("item.purgeGroup()");dojo.declare("dojox.charting.plot2d.Stacked",dojox.charting.plot2d.Default,{getSeriesStats:function(){var _439=dc.collectStackedStats(this.series);this._maxRunLength=_439.hmax;return _439;},render:function(dim,_43a){if(this._maxRunLength<=0){return this;}var acc=df.repeat(this._maxRunLength,"-> 0",0);for(var i=0;i<this.series.length;++i){var run=this.series[i];for(var j=0;j<run.data.length;++j){var v=run.data[j];if(v!==null){if(isNaN(v)){v=0;}acc[j]+=v;}}}if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_43a);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){dojo.forEach(this.series,_438);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,_43b=this.events(),ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler);for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _43c=t.next(this.opt.areas?"area":"line",[this.opt,run],true),s=run.group,_43d,_43e=dojo.map(acc,function(v,i){return {x:ht(i+1)+_43a.l,y:dim.height-_43a.b-vt(v)};},this);var _43f=this.opt.tension?dc.curve(_43e,this.opt.tension):"";if(this.opt.areas){var _440=dojo.clone(_43e);if(this.opt.tension){var p=dc.curve(_440,this.opt.tension);p+=" L"+_43e[_43e.length-1].x+","+(dim.height-_43a.b)+" L"+_43e[0].x+","+(dim.height-_43a.b)+" L"+_43e[0].x+","+_43e[0].y;run.dyn.fill=s.createPath(p).setFill(_43c.series.fill).getFill();}else{_440.push({x:_43e[_43e.length-1].x,y:dim.height-_43a.b});_440.push({x:_43e[0].x,y:dim.height-_43a.b});_440.push(_43e[0]);run.dyn.fill=s.createPolyline(_440).setFill(_43c.series.fill).getFill();}}if(this.opt.lines||this.opt.markers){if(_43c.series.outline){_43d=dc.makeStroke(_43c.series.outline);_43d.width=2*_43d.width+_43c.series.stroke.width;}}if(this.opt.markers){run.dyn.marker=_43c.symbol;}var _441,_442,_443;if(_43c.series.shadow&&_43c.series.stroke){var _444=_43c.series.shadow,_445=dojo.map(_43e,function(c){return {x:c.x+_444.dx,y:c.y+_444.dy};});if(this.opt.lines){if(this.opt.tension){run.dyn.shadow=s.createPath(dc.curve(_445,this.opt.tension)).setStroke(_444).getStroke();}else{run.dyn.shadow=s.createPolyline(_445).setStroke(_444).getStroke();}}if(this.opt.markers){_444=_43c.marker.shadow;_443=dojo.map(_445,function(c){return s.createPath("M"+c.x+" "+c.y+" "+_43c.symbol).setStroke(_444).setFill(_444.color);},this);}}if(this.opt.lines){if(_43d){if(this.opt.tension){run.dyn.outline=s.createPath(_43f).setStroke(_43d).getStroke();}else{run.dyn.outline=s.createPolyline(_43e).setStroke(_43d).getStroke();}}if(this.opt.tension){run.dyn.stroke=s.createPath(_43f).setStroke(_43c.series.stroke).getStroke();}else{run.dyn.stroke=s.createPolyline(_43e).setStroke(_43c.series.stroke).getStroke();}}if(this.opt.markers){_441=new Array(_43e.length);_442=new Array(_43e.length);_43d=null;if(_43c.marker.outline){_43d=dc.makeStroke(_43c.marker.outline);_43d.width=2*_43d.width+(_43c.marker.stroke?_43c.marker.stroke.width:0);}dojo.forEach(_43e,function(c,i){var path="M"+c.x+" "+c.y+" "+_43c.symbol;if(_43d){_442[i]=s.createPath(path).setStroke(_43d);}_441[i]=s.createPath(path).setStroke(_43c.marker.stroke).setFill(_43c.marker.fill);},this);if(_43b){var _446=new Array(_441.length);dojo.forEach(_441,function(s,i){var o={element:"marker",index:i,run:run,shape:s,outline:_442[i]||null,shadow:_443&&_443[i]||null,cx:_43e[i].x,cy:_43e[i].y,x:i+1,y:run.data[i]};this._connectEvents(o);_446[i]=o;},this);this._eventSeries[run.name]=_446;}else{delete this._eventSeries[run.name];}}run.dirty=false;for(var j=0;j<run.data.length;++j){var v=run.data[j];if(v!==null){if(isNaN(v)){v=0;}acc[j]-=v;}}}this.dirty=false;return this;}});})();}if(!dojo._hasResource["dojox.charting.plot2d.StackedLines"]){dojo._hasResource["dojox.charting.plot2d.StackedLines"]=true;dojo.provide("dojox.charting.plot2d.StackedLines");dojo.declare("dojox.charting.plot2d.StackedLines",dojox.charting.plot2d.Stacked,{constructor:function(){this.opt.lines=true;}});}if(!dojo._hasResource["dojox.charting.plot2d.StackedAreas"]){dojo._hasResource["dojox.charting.plot2d.StackedAreas"]=true;dojo.provide("dojox.charting.plot2d.StackedAreas");dojo.declare("dojox.charting.plot2d.StackedAreas",dojox.charting.plot2d.Stacked,{constructor:function(){this.opt.lines=true;this.opt.areas=true;}});}if(!dojo._hasResource["dojox.charting.plot2d.Columns"]){dojo._hasResource["dojox.charting.plot2d.Columns"]=true;dojo.provide("dojox.charting.plot2d.Columns");(function(){var df=dojox.lang.functional,du=dojox.lang.utils,dc=dojox.charting.plot2d.common,_447=df.lambda("item.purgeGroup()");dojo.declare("dojox.charting.plot2d.Columns",dojox.charting.plot2d.Base,{defaultParams:{hAxis:"x",vAxis:"y",gap:0,animate:null},optionalParams:{minBarSize:1,maxBarSize:1,stroke:{},outline:{},shadow:{},fill:{},font:"",fontColor:""},constructor:function(_448,_449){this.opt=dojo.clone(this.defaultParams);du.updateWithObject(this.opt,_449);du.updateWithPattern(this.opt,_449,this.optionalParams);this.series=[];this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate;},getSeriesStats:function(){var _44a=dc.collectSimpleStats(this.series);_44a.hmin-=0.5;_44a.hmax+=0.5;return _44a;},render:function(dim,_44b){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_44b);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){dojo.forEach(this.series,_447);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,f,gap,_44c,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_44d=Math.max(0,this._vScaler.bounds.lower),_44e=vt(_44d),_44f=this.events();f=dc.calculateBarSize(this._hScaler.bounds.scale,this.opt);gap=f.gap;_44c=f.size;for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _450=t.next("column",[this.opt,run]),s=run.group,_451=new Array(run.data.length);for(var j=0;j<run.data.length;++j){var _452=run.data[j];if(_452!==null){var v=typeof _452=="number"?_452:_452.y,vv=vt(v),_453=vv-_44e,h=Math.abs(_453),_454=typeof _452!="number"?t.addMixin(_450,"column",_452,true):t.post(_450,"column");if(_44c>=1&&h>=1){var rect={x:_44b.l+ht(j+0.5)+gap,y:dim.height-_44b.b-(v>_44d?vv:_44e),width:_44c,height:h};var _455=this._plotFill(_454.series.fill,dim,_44b);_455=this._shapeFill(_455,rect);var _456=s.createRect(rect).setFill(_455).setStroke(_454.series.stroke);run.dyn.fill=_456.getFill();run.dyn.stroke=_456.getStroke();if(_44f){var o={element:"column",index:j,run:run,shape:_456,x:j+0.5,y:v};this._connectEvents(o);_451[j]=o;}if(this.animate){this._animateColumn(_456,dim.height-_44b.b-_44e,h);}}}}this._eventSeries[run.name]=_451;run.dirty=false;}this.dirty=false;return this;},_animateColumn:function(_457,_458,_459){dojox.gfx.fx.animateTransform(dojo.delegate({shape:_457,duration:1200,transform:[{name:"translate",start:[0,_458-(_458/_459)],end:[0,0]},{name:"scale",start:[1,1/_459],end:[1,1]},{name:"original"}]},this.animate)).play();}});})();}if(!dojo._hasResource["dojox.charting.plot2d.StackedColumns"]){dojo._hasResource["dojox.charting.plot2d.StackedColumns"]=true;dojo.provide("dojox.charting.plot2d.StackedColumns");(function(){var df=dojox.lang.functional,dc=dojox.charting.plot2d.common,_45a=df.lambda("item.purgeGroup()");dojo.declare("dojox.charting.plot2d.StackedColumns",dojox.charting.plot2d.Columns,{getSeriesStats:function(){var _45b=dc.collectStackedStats(this.series);this._maxRunLength=_45b.hmax;_45b.hmin-=0.5;_45b.hmax+=0.5;return _45b;},render:function(dim,_45c){if(this._maxRunLength<=0){return this;}var acc=df.repeat(this._maxRunLength,"-> 0",0);for(var i=0;i<this.series.length;++i){var run=this.series[i];for(var j=0;j<run.data.length;++j){var _45d=run.data[j];if(_45d!==null){var v=typeof _45d=="number"?_45d:_45d.y;if(isNaN(v)){v=0;}acc[j]+=v;}}}if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_45c);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){dojo.forEach(this.series,_45a);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,f,gap,_45e,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_45f=this.events();f=dc.calculateBarSize(this._hScaler.bounds.scale,this.opt);gap=f.gap;_45e=f.size;for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _460=t.next("column",[this.opt,run]),s=run.group,_461=new Array(acc.length);for(var j=0;j<acc.length;++j){var _45d=run.data[j];if(_45d!==null){var v=acc[j],_462=vt(v),_463=typeof _45d!="number"?t.addMixin(_460,"column",_45d,true):t.post(_460,"column");if(_45e>=1&&_462>=1){var rect={x:_45c.l+ht(j+0.5)+gap,y:dim.height-_45c.b-vt(v),width:_45e,height:_462};var _464=this._plotFill(_463.series.fill,dim,_45c);_464=this._shapeFill(_464,rect);var _465=s.createRect(rect).setFill(_464).setStroke(_463.series.stroke);run.dyn.fill=_465.getFill();run.dyn.stroke=_465.getStroke();if(_45f){var o={element:"column",index:j,run:run,shape:_465,x:j+0.5,y:v};this._connectEvents(o);_461[j]=o;}if(this.animate){this._animateColumn(_465,dim.height-_45c.b,_462);}}}}this._eventSeries[run.name]=_461;run.dirty=false;for(var j=0;j<run.data.length;++j){var _45d=run.data[j];if(_45d!==null){var v=typeof _45d=="number"?_45d:_45d.y;if(isNaN(v)){v=0;}acc[j]-=v;}}}this.dirty=false;return this;}});})();}if(!dojo._hasResource["dojox.charting.plot2d.ClusteredColumns"]){dojo._hasResource["dojox.charting.plot2d.ClusteredColumns"]=true;dojo.provide("dojox.charting.plot2d.ClusteredColumns");(function(){var df=dojox.lang.functional,dc=dojox.charting.plot2d.common,_466=df.lambda("item.purgeGroup()");dojo.declare("dojox.charting.plot2d.ClusteredColumns",dojox.charting.plot2d.Columns,{render:function(dim,_467){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_467);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){dojo.forEach(this.series,_466);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,f,gap,_468,_469,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_46a=Math.max(0,this._vScaler.bounds.lower),_46b=vt(_46a),_46c=this.events();f=dc.calculateBarSize(this._hScaler.bounds.scale,this.opt,this.series.length);gap=f.gap;_468=_469=f.size;for(var i=0;i<this.series.length;++i){var run=this.series[i],_46d=_469*i;if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _46e=t.next("column",[this.opt,run]),s=run.group,_46f=new Array(run.data.length);for(var j=0;j<run.data.length;++j){var _470=run.data[j];if(_470!==null){var v=typeof _470=="number"?_470:_470.y,vv=vt(v),_471=vv-_46b,h=Math.abs(_471),_472=typeof _470!="number"?t.addMixin(_46e,"column",_470,true):t.post(_46e,"column");if(_468>=1&&h>=1){var rect={x:_467.l+ht(j+0.5)+gap+_46d,y:dim.height-_467.b-(v>_46a?vv:_46b),width:_468,height:h};var _473=this._plotFill(_472.series.fill,dim,_467);_473=this._shapeFill(_473,rect);var _474=s.createRect(rect).setFill(_473).setStroke(_472.series.stroke);run.dyn.fill=_474.getFill();run.dyn.stroke=_474.getStroke();if(_46c){var o={element:"column",index:j,run:run,shape:_474,x:j+0.5,y:v};this._connectEvents(o);_46f[j]=o;}if(this.animate){this._animateColumn(_474,dim.height-_467.b-_46b,h);}}}}this._eventSeries[run.name]=_46f;run.dirty=false;}this.dirty=false;return this;}});})();}if(!dojo._hasResource["dojox.charting.plot2d.Bars"]){dojo._hasResource["dojox.charting.plot2d.Bars"]=true;dojo.provide("dojox.charting.plot2d.Bars");(function(){var df=dojox.lang.functional,du=dojox.lang.utils,dc=dojox.charting.plot2d.common,_475=df.lambda("item.purgeGroup()");dojo.declare("dojox.charting.plot2d.Bars",dojox.charting.plot2d.Base,{defaultParams:{hAxis:"x",vAxis:"y",gap:0,animate:null},optionalParams:{minBarSize:1,maxBarSize:1,stroke:{},outline:{},shadow:{},fill:{},font:"",fontColor:""},constructor:function(_476,_477){this.opt=dojo.clone(this.defaultParams);du.updateWithObject(this.opt,_477);du.updateWithPattern(this.opt,_477,this.optionalParams);this.series=[];this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate;},getSeriesStats:function(){var _478=dc.collectSimpleStats(this.series),t;_478.hmin-=0.5;_478.hmax+=0.5;t=_478.hmin,_478.hmin=_478.vmin,_478.vmin=t;t=_478.hmax,_478.hmax=_478.vmax,_478.vmax=t;return _478;},render:function(dim,_479){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_479);}this.dirty=this.isDirty();this.resetEvents();if(this.dirty){dojo.forEach(this.series,_475);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,f,gap,_47a,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_47b=Math.max(0,this._hScaler.bounds.lower),_47c=ht(_47b),_47d=this.events();f=dc.calculateBarSize(this._vScaler.bounds.scale,this.opt);gap=f.gap;_47a=f.size;for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _47e=t.next("bar",[this.opt,run]),s=run.group,_47f=new Array(run.data.length);for(var j=0;j<run.data.length;++j){var _480=run.data[j];if(_480!==null){var v=typeof _480=="number"?_480:_480.y,hv=ht(v),_481=hv-_47c,w=Math.abs(_481),_482=typeof _480!="number"?t.addMixin(_47e,"bar",_480,true):t.post(_47e,"bar");if(w>=1&&_47a>=1){var rect={x:_479.l+(v<_47b?hv:_47c),y:dim.height-_479.b-vt(j+1.5)+gap,width:w,height:_47a};var _483=this._plotFill(_482.series.fill,dim,_479);_483=this._shapeFill(_483,rect);var _484=s.createRect(rect).setFill(_483).setStroke(_482.series.stroke);run.dyn.fill=_484.getFill();run.dyn.stroke=_484.getStroke();if(_47d){var o={element:"bar",index:j,run:run,shape:_484,x:v,y:j+1.5};this._connectEvents(o);_47f[j]=o;}if(this.animate){this._animateBar(_484,_479.l+_47c,-w);}}}}this._eventSeries[run.name]=_47f;run.dirty=false;}this.dirty=false;return this;},_animateBar:function(_485,_486,_487){dojox.gfx.fx.animateTransform(dojo.delegate({shape:_485,duration:1200,transform:[{name:"translate",start:[_486-(_486/_487),0],end:[0,0]},{name:"scale",start:[1/_487,1],end:[1,1]},{name:"original"}]},this.animate)).play();}});})();}if(!dojo._hasResource["dojox.charting.plot2d.StackedBars"]){dojo._hasResource["dojox.charting.plot2d.StackedBars"]=true;dojo.provide("dojox.charting.plot2d.StackedBars");(function(){var df=dojox.lang.functional,dc=dojox.charting.plot2d.common,_488=df.lambda("item.purgeGroup()");dojo.declare("dojox.charting.plot2d.StackedBars",dojox.charting.plot2d.Bars,{getSeriesStats:function(){var _489=dc.collectStackedStats(this.series),t;this._maxRunLength=_489.hmax;_489.hmin-=0.5;_489.hmax+=0.5;t=_489.hmin,_489.hmin=_489.vmin,_489.vmin=t;t=_489.hmax,_489.hmax=_489.vmax,_489.vmax=t;return _489;},render:function(dim,_48a){if(this._maxRunLength<=0){return this;}var acc=df.repeat(this._maxRunLength,"-> 0",0);for(var i=0;i<this.series.length;++i){var run=this.series[i];for(var j=0;j<run.data.length;++j){var _48b=run.data[j];if(_48b!==null){var v=typeof _48b=="number"?_48b:_48b.y;if(isNaN(v)){v=0;}acc[j]+=v;}}}if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_48a);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){dojo.forEach(this.series,_488);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,f,gap,_48c,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_48d=this.events();f=dc.calculateBarSize(this._vScaler.bounds.scale,this.opt);gap=f.gap;_48c=f.size;for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _48e=t.next("bar",[this.opt,run]),s=run.group,_48f=new Array(acc.length);for(var j=0;j<acc.length;++j){var _48b=run.data[j];if(_48b!==null){var v=acc[j],_490=ht(v),_491=typeof _48b!="number"?t.addMixin(_48e,"bar",_48b,true):t.post(_48e,"bar");if(_490>=1&&_48c>=1){var rect={x:_48a.l,y:dim.height-_48a.b-vt(j+1.5)+gap,width:_490,height:_48c};var _492=this._plotFill(_491.series.fill,dim,_48a);_492=this._shapeFill(_492,rect);var _493=s.createRect(rect).setFill(_492).setStroke(_491.series.stroke);run.dyn.fill=_493.getFill();run.dyn.stroke=_493.getStroke();if(_48d){var o={element:"bar",index:j,run:run,shape:_493,x:v,y:j+1.5};this._connectEvents(o);_48f[j]=o;}if(this.animate){this._animateBar(_493,_48a.l,-_490);}}}}this._eventSeries[run.name]=_48f;run.dirty=false;for(var j=0;j<run.data.length;++j){var _48b=run.data[j];if(_48b!==null){var v=typeof _48b=="number"?_48b:_48b.y;if(isNaN(v)){v=0;}acc[j]-=v;}}}this.dirty=false;return this;}});})();}if(!dojo._hasResource["dojox.charting.plot2d.ClusteredBars"]){dojo._hasResource["dojox.charting.plot2d.ClusteredBars"]=true;dojo.provide("dojox.charting.plot2d.ClusteredBars");(function(){var df=dojox.lang.functional,dc=dojox.charting.plot2d.common,_494=df.lambda("item.purgeGroup()");dojo.declare("dojox.charting.plot2d.ClusteredBars",dojox.charting.plot2d.Bars,{render:function(dim,_495){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_495);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){dojo.forEach(this.series,_494);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,f,gap,_496,_497,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_498=Math.max(0,this._hScaler.bounds.lower),_499=ht(_498),_49a=this.events();f=dc.calculateBarSize(this._vScaler.bounds.scale,this.opt,this.series.length);gap=f.gap;_496=_497=f.size;for(var i=this.series.length-1;i>=0;--i){var run=this.series[i],_49b=_497*(this.series.length-i-1);if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _49c=t.next("bar",[this.opt,run]),s=run.group,_49d=new Array(run.data.length);for(var j=0;j<run.data.length;++j){var _49e=run.data[j];if(_49e!==null){var v=typeof _49e=="number"?_49e:_49e.y,hv=ht(v),_49f=hv-_499,w=Math.abs(_49f),_4a0=typeof _49e!="number"?t.addMixin(_49c,"bar",_49e,true):t.post(_49c,"bar");if(w>=1&&_496>=1){var rect={x:_495.l+(v<_498?hv:_499),y:dim.height-_495.b-vt(j+1.5)+gap+_49b,width:w,height:_496};var _4a1=this._plotFill(_4a0.series.fill,dim,_495);_4a1=this._shapeFill(_4a1,rect);var _4a2=s.createRect(rect).setFill(_4a1).setStroke(_4a0.series.stroke);run.dyn.fill=_4a2.getFill();run.dyn.stroke=_4a2.getStroke();if(_49a){var o={element:"bar",index:j,run:run,shape:_4a2,x:v,y:j+1.5};this._connectEvents(o);_49d[j]=o;}if(this.animate){this._animateBar(_4a2,_495.l+_499,-_49f);}}}}this._eventSeries[run.name]=_49d;run.dirty=false;}this.dirty=false;return this;}});})();}if(!dojo._hasResource["dojox.charting.plot2d.Grid"]){dojo._hasResource["dojox.charting.plot2d.Grid"]=true;dojo.provide("dojox.charting.plot2d.Grid");(function(){var du=dojox.lang.utils,dc=dojox.charting.plot2d.common;dojo.declare("dojox.charting.plot2d.Grid",dojox.charting.Element,{defaultParams:{hAxis:"x",vAxis:"y",hMajorLines:true,hMinorLines:false,vMajorLines:true,vMinorLines:false,hStripes:"none",vStripes:"none",animate:null},optionalParams:{},constructor:function(_4a3,_4a4){this.opt=dojo.clone(this.defaultParams);du.updateWithObject(this.opt,_4a4);this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.dirty=true;this.animate=this.opt.animate;this.zoom=null,this.zoomQueue=[];this.lastWindow={vscale:1,hscale:1,xoffset:0,yoffset:0};},clear:function(){this._hAxis=null;this._vAxis=null;this.dirty=true;return this;},setAxis:function(axis){if(axis){this[axis.vertical?"_vAxis":"_hAxis"]=axis;}return this;},addSeries:function(run){return this;},getSeriesStats:function(){return dojo.delegate(dc.defaultStats);},initializeScalers:function(){return this;},isDirty:function(){return this.dirty||this._hAxis&&this._hAxis.dirty||this._vAxis&&this._vAxis.dirty;},performZoom:function(dim,_4a5){var vs=this._vAxis.scale||1,hs=this._hAxis.scale||1,_4a6=dim.height-_4a5.b,_4a7=this._hAxis.getScaler().bounds,_4a8=(_4a7.from-_4a7.lower)*_4a7.scale,_4a9=this._vAxis.getScaler().bounds,_4aa=(_4a9.from-_4a9.lower)*_4a9.scale;rVScale=vs/this.lastWindow.vscale,rHScale=hs/this.lastWindow.hscale,rXOffset=(this.lastWindow.xoffset-_4a8)/((this.lastWindow.hscale==1)?hs:this.lastWindow.hscale),rYOffset=(_4aa-this.lastWindow.yoffset)/((this.lastWindow.vscale==1)?vs:this.lastWindow.vscale),shape=this.group,anim=dojox.gfx.fx.animateTransform(dojo.delegate({shape:shape,duration:1200,transform:[{name:"translate",start:[0,0],end:[_4a5.l*(1-rHScale),_4a6*(1-rVScale)]},{name:"scale",start:[1,1],end:[rHScale,rVScale]},{name:"original"},{name:"translate",start:[0,0],end:[rXOffset,rYOffset]}]},this.zoom));dojo.mixin(this.lastWindow,{vscale:vs,hscale:hs,xoffset:_4a8,yoffset:_4aa});this.zoomQueue.push(anim);dojo.connect(anim,"onEnd",this,function(){this.zoom=null;this.zoomQueue.shift();if(this.zoomQueue.length>0){this.zoomQueue[0].play();}});if(this.zoomQueue.length==1){this.zoomQueue[0].play();}return this;},getRequiredColors:function(){return 0;},render:function(dim,_4ab){if(this.zoom){return this.performZoom(dim,_4ab);}this.dirty=this.isDirty();if(!this.dirty){return this;}this.cleanGroup();var s=this.group,ta=this.chart.theme.axis;try{var _4ac=this._vAxis.getScaler(),vt=_4ac.scaler.getTransformerFromModel(_4ac),_4ad=this._vAxis.getTicks();if(this.opt.hMinorLines){dojo.forEach(_4ad.minor,function(tick){var y=dim.height-_4ab.b-vt(tick.value);var _4ae=s.createLine({x1:_4ab.l,y1:y,x2:dim.width-_4ab.r,y2:y}).setStroke(ta.minorTick);if(this.animate){this._animateGrid(_4ae,"h",_4ab.l,_4ab.r+_4ab.l-dim.width);}},this);}if(this.opt.hMajorLines){dojo.forEach(_4ad.major,function(tick){var y=dim.height-_4ab.b-vt(tick.value);var _4af=s.createLine({x1:_4ab.l,y1:y,x2:dim.width-_4ab.r,y2:y}).setStroke(ta.majorTick);if(this.animate){this._animateGrid(_4af,"h",_4ab.l,_4ab.r+_4ab.l-dim.width);}},this);}}catch(e){}try{var _4b0=this._hAxis.getScaler(),ht=_4b0.scaler.getTransformerFromModel(_4b0),_4ad=this._hAxis.getTicks();if(_4ad&&this.opt.vMinorLines){dojo.forEach(_4ad.minor,function(tick){var x=_4ab.l+ht(tick.value);var _4b1=s.createLine({x1:x,y1:_4ab.t,x2:x,y2:dim.height-_4ab.b}).setStroke(ta.minorTick);if(this.animate){this._animateGrid(_4b1,"v",dim.height-_4ab.b,dim.height-_4ab.b-_4ab.t);}},this);}if(_4ad&&this.opt.vMajorLines){dojo.forEach(_4ad.major,function(tick){var x=_4ab.l+ht(tick.value);var _4b2=s.createLine({x1:x,y1:_4ab.t,x2:x,y2:dim.height-_4ab.b}).setStroke(ta.majorTick);if(this.animate){this._animateGrid(_4b2,"v",dim.height-_4ab.b,dim.height-_4ab.b-_4ab.t);}},this);}}catch(e){}this.dirty=false;return this;},_animateGrid:function(_4b3,type,_4b4,size){var _4b5=type=="h"?[_4b4,0]:[0,_4b4];var _4b6=type=="h"?[1/size,1]:[1,1/size];dojox.gfx.fx.animateTransform(dojo.delegate({shape:_4b3,duration:1200,transform:[{name:"translate",start:_4b5,end:[0,0]},{name:"scale",start:_4b6,end:[1,1]},{name:"original"}]},this.animate)).play();}});})();}if(!dojo._hasResource["dojox.charting.plot2d.Pie"]){dojo._hasResource["dojox.charting.plot2d.Pie"]=true;dojo.provide("dojox.charting.plot2d.Pie");(function(){var df=dojox.lang.functional,du=dojox.lang.utils,dc=dojox.charting.plot2d.common,da=dojox.charting.axis2d.common,g=dojox.gfx,m=g.matrix,_4b7=0.2;dojo.declare("dojox.charting.plot2d.Pie",[dojox.charting.Element,dojox.charting.plot2d._PlotEvents],{defaultParams:{labels:true,ticks:false,fixed:true,precision:1,labelOffset:20,labelStyle:"default",htmlLabels:true,radGrad:"native",fanSize:5,startAngle:0},optionalParams:{radius:0,stroke:{},outline:{},shadow:{},fill:{},font:"",fontColor:"",labelWiring:{}},constructor:function(_4b8,_4b9){this.opt=dojo.clone(this.defaultParams);du.updateWithObject(this.opt,_4b9);du.updateWithPattern(this.opt,_4b9,this.optionalParams);this.run=null;this.dyn=[];},clear:function(){this.dirty=true;this.dyn=[];this.run=null;return this;},setAxis:function(axis){return this;},addSeries:function(run){this.run=run;return this;},getSeriesStats:function(){return dojo.delegate(dc.defaultStats);},initializeScalers:function(){return this;},getRequiredColors:function(){return this.run?this.run.data.length:0;},render:function(dim,_4ba){if(!this.dirty){return this;}this.resetEvents();this.dirty=false;this._eventSeries={};this.cleanGroup();var s=this.group,t=this.chart.theme;if(!this.run||!this.run.data.length){return this;}var rx=(dim.width-_4ba.l-_4ba.r)/2,ry=(dim.height-_4ba.t-_4ba.b)/2,r=Math.min(rx,ry),_4bb="font" in this.opt?this.opt.font:t.axis.font,size=_4bb?g.normalizedLength(g.splitFontString(_4bb).size):0,_4bc="fontColor" in this.opt?this.opt.fontColor:t.axis.fontColor,_4bd=m._degToRad(this.opt.startAngle),_4be=_4bd,step,_4bf,_4c0,_4c1,_4c2,_4c3,run=this.run.data,_4c4=this.events();if(typeof run[0]=="number"){_4bf=df.map(run,"x ? Math.max(x, 0) : 0");if(df.every(_4bf,"<= 0")){return this;}_4c0=df.map(_4bf,"/this",df.foldl(_4bf,"+",0));if(this.opt.labels){_4c1=dojo.map(_4c0,function(x){return x>0?this._getLabel(x*100)+"%":"";},this);}}else{_4bf=df.map(run,"x ? Math.max(x.y, 0) : 0");if(df.every(_4bf,"<= 0")){return this;}_4c0=df.map(_4bf,"/this",df.foldl(_4bf,"+",0));if(this.opt.labels){_4c1=dojo.map(_4c0,function(x,i){if(x<=0){return "";}var v=run[i];return "text" in v?v.text:this._getLabel(x*100)+"%";},this);}}var _4c5=df.map(run,function(v,i){if(v===null||typeof v=="number"){return t.next("slice",[this.opt,this.run],true);}return t.next("slice",[this.opt,this.run,v],true);},this);if(this.opt.labels){_4c2=df.foldl1(df.map(_4c1,function(_4c6,i){var font=_4c5[i].series.font;return dojox.gfx._base._getTextBox(_4c6,{font:font}).w;},this),"Math.max(a, b)")/2;if(this.opt.labelOffset<0){r=Math.min(rx-2*_4c2,ry-size)+this.opt.labelOffset;}_4c3=r-this.opt.labelOffset;}if("radius" in this.opt){r=this.opt.radius;_4c3=r-this.opt.labelOffset;}var _4c7={cx:_4ba.l+rx,cy:_4ba.t+ry,r:r};this.dyn=[];var _4c8=new Array(_4c0.length);dojo.some(_4c0,function(_4c9,i){if(_4c9<0){return false;}if(_4c9==0){this.dyn.push({fill:null,stroke:null});return false;}var v=run[i],_4ca=_4c5[i],_4cb;if(_4c9>=1){_4cb=this._plotFill(_4ca.series.fill,dim,_4ba);_4cb=this._shapeFill(_4cb,{x:_4c7.cx-_4c7.r,y:_4c7.cy-_4c7.r,width:2*_4c7.r,height:2*_4c7.r});_4cb=this._pseudoRadialFill(_4cb,{x:_4c7.cx,y:_4c7.cy},_4c7.r);var _4cc=s.createCircle(_4c7).setFill(_4cb).setStroke(_4ca.series.stroke);this.dyn.push({fill:_4cb,stroke:_4ca.series.stroke});if(_4c4){var o={element:"slice",index:i,run:this.run,shape:_4cc,x:i,y:typeof v=="number"?v:v.y,cx:_4c7.cx,cy:_4c7.cy,cr:r};this._connectEvents(o);_4c8[i]=o;}return true;}var end=_4be+_4c9*2*Math.PI;if(i+1==_4c0.length){end=_4bd+2*Math.PI;}var step=end-_4be,x1=_4c7.cx+r*Math.cos(_4be),y1=_4c7.cy+r*Math.sin(_4be),x2=_4c7.cx+r*Math.cos(end),y2=_4c7.cy+r*Math.sin(end);var _4cd=m._degToRad(this.opt.fanSize);if(_4ca.series.fill&&_4ca.series.fill.type==="radial"&&this.opt.radGrad==="fan"&&step>_4cd){var _4ce=s.createGroup(),_4cf=Math.ceil(step/_4cd),_4d0=step/_4cf;_4cb=this._shapeFill(_4ca.series.fill,{x:_4c7.cx-_4c7.r,y:_4c7.cy-_4c7.r,width:2*_4c7.r,height:2*_4c7.r});for(var j=0;j<_4cf;++j){var _4d1=j==0?x1:_4c7.cx+r*Math.cos(_4be+(j-_4b7)*_4d0),_4d2=j==0?y1:_4c7.cy+r*Math.sin(_4be+(j-_4b7)*_4d0),_4d3=j==_4cf-1?x2:_4c7.cx+r*Math.cos(_4be+(j+1+_4b7)*_4d0),_4d4=j==_4cf-1?y2:_4c7.cy+r*Math.sin(_4be+(j+1+_4b7)*_4d0),fan=_4ce.createPath({}).moveTo(_4c7.cx,_4c7.cy).lineTo(_4d1,_4d2).arcTo(r,r,0,_4d0>Math.PI,true,_4d3,_4d4).lineTo(_4c7.cx,_4c7.cy).closePath().setFill(this._pseudoRadialFill(_4cb,{x:_4c7.cx,y:_4c7.cy},r,_4be+(j+0.5)*_4d0,_4be+(j+0.5)*_4d0));}_4ce.createPath({}).moveTo(_4c7.cx,_4c7.cy).lineTo(x1,y1).arcTo(r,r,0,step>Math.PI,true,x2,y2).lineTo(_4c7.cx,_4c7.cy).closePath().setStroke(_4ca.series.stroke);_4cc=_4ce;}else{_4cc=s.createPath({}).moveTo(_4c7.cx,_4c7.cy).lineTo(x1,y1).arcTo(r,r,0,step>Math.PI,true,x2,y2).lineTo(_4c7.cx,_4c7.cy).closePath().setStroke(_4ca.series.stroke);var _4cb=_4ca.series.fill;if(_4cb&&_4cb.type==="radial"){_4cb=this._shapeFill(_4cb,{x:_4c7.cx-_4c7.r,y:_4c7.cy-_4c7.r,width:2*_4c7.r,height:2*_4c7.r});if(this.opt.radGrad==="linear"){_4cb=this._pseudoRadialFill(_4cb,{x:_4c7.cx,y:_4c7.cy},r,_4be,end);}}else{if(_4cb&&_4cb.type==="linear"){_4cb=this._plotFill(_4cb,dim,_4ba);_4cb=this._shapeFill(_4cb,_4cc.getBoundingBox());}}_4cc.setFill(_4cb);}this.dyn.push({fill:_4cb,stroke:_4ca.series.stroke});if(_4c4){var o={element:"slice",index:i,run:this.run,shape:_4cc,x:i,y:typeof v=="number"?v:v.y,cx:_4c7.cx,cy:_4c7.cy,cr:r};this._connectEvents(o);_4c8[i]=o;}_4be=end;return false;},this);if(this.opt.labels){if(this.opt.labelStyle=="default"){_4be=_4bd;dojo.some(_4c0,function(_4d5,i){if(_4d5<=0){return false;}var _4d6=_4c5[i];if(_4d5>=1){var v=run[i],elem=da.createText[this.opt.htmlLabels&&dojox.gfx.renderer!="vml"?"html":"gfx"](this.chart,s,_4c7.cx,_4c7.cy+size/2,"middle",_4c1[i],_4d6.series.font,_4d6.series.fontColor);if(this.opt.htmlLabels){this.htmlElements.push(elem);}return true;}var end=_4be+_4d5*2*Math.PI,v=run[i];if(i+1==_4c0.length){end=_4bd+2*Math.PI;}var _4d7=(_4be+end)/2,x=_4c7.cx+_4c3*Math.cos(_4d7),y=_4c7.cy+_4c3*Math.sin(_4d7)+size/2;var elem=da.createText[this.opt.htmlLabels&&dojox.gfx.renderer!="vml"?"html":"gfx"](this.chart,s,x,y,"middle",_4c1[i],_4d6.series.font,_4d6.series.fontColor);if(this.opt.htmlLabels){this.htmlElements.push(elem);}_4be=end;return false;},this);}else{if(this.opt.labelStyle=="columns"){_4be=_4bd;var _4d8=[];dojo.forEach(_4c0,function(_4d9,i){var end=_4be+_4d9*2*Math.PI;if(i+1==_4c0.length){end=_4bd+2*Math.PI;}var _4da=(_4be+end)/2;_4d8.push({angle:_4da,left:Math.cos(_4da)<0,theme:_4c5[i],index:i,omit:end-_4be<0.001});_4be=end;});var _4db=dojox.gfx._base._getTextBox("a",{font:_4bb}).h;this._getProperLabelRadius(_4d8,_4db,_4c7.r*1.1);dojo.forEach(_4d8,function(_4dc,i){if(!_4dc.omit){var _4dd=_4c7.cx-_4c7.r*2,_4de=_4c7.cx+_4c7.r*2,_4df=dojox.gfx._base._getTextBox(_4c1[i],{font:_4bb}).w,x=_4c7.cx+_4dc.labelR*Math.cos(_4dc.angle),y=_4c7.cy+_4dc.labelR*Math.sin(_4dc.angle),_4e0=(_4dc.left)?(_4dd+_4df):(_4de-_4df),_4e1=(_4dc.left)?_4dd:_4e0;var _4e2=s.createPath().moveTo(_4c7.cx+_4c7.r*Math.cos(_4dc.angle),_4c7.cy+_4c7.r*Math.sin(_4dc.angle));if(Math.abs(_4dc.labelR*Math.cos(_4dc.angle))<_4c7.r*2-_4df){_4e2.lineTo(x,y);}_4e2.lineTo(_4e0,y).setStroke(_4dc.theme.series.labelWiring);var elem=da.createText[this.opt.htmlLabels&&dojox.gfx.renderer!="vml"?"html":"gfx"](this.chart,s,_4e1,y,"left",_4c1[i],_4dc.theme.series.font,_4dc.theme.series.fontColor);if(this.opt.htmlLabels){this.htmlElements.push(elem);}}},this);}}}var esi=0;this._eventSeries[this.run.name]=df.map(run,function(v){return v<=0?null:_4c8[esi++];});return this;},_getProperLabelRadius:function(_4e3,_4e4,_4e5){var _4e6={},_4e7={},_4e8=1,_4e9=1;if(_4e3.length==1){_4e3[0].labelR=_4e5;return;}for(var i=0;i<_4e3.length;i++){var _4ea=Math.abs(Math.sin(_4e3[i].angle));if(_4e3[i].left){if(_4e8>_4ea){_4e8=_4ea;_4e6=_4e3[i];}}else{if(_4e9>_4ea){_4e9=_4ea;_4e7=_4e3[i];}}}_4e6.labelR=_4e7.labelR=_4e5;this._caculateLabelR(_4e6,_4e3,_4e4);this._caculateLabelR(_4e7,_4e3,_4e4);},_caculateLabelR:function(_4eb,_4ec,_4ed){var i=_4eb.index,_4ee=_4ec.length,_4ef=_4eb.labelR;while(!(_4ec[i%_4ee].left^_4ec[(i+1)%_4ee].left)){if(!_4ec[(i+1)%_4ee].omit){var _4f0=(Math.sin(_4ec[i%_4ee].angle)*_4ef+((_4ec[i%_4ee].left)?(-_4ed):_4ed))/Math.sin(_4ec[(i+1)%_4ee].angle);_4ef=(_4f0<_4eb.labelR)?_4eb.labelR:_4f0;_4ec[(i+1)%_4ee].labelR=_4ef;}i++;}i=_4eb.index,j=(i==0)?_4ee-1:i-1;while(!(_4ec[i].left^_4ec[j].left)){if(!_4ec[j].omit){var _4f0=(Math.sin(_4ec[i].angle)*_4ef+((_4ec[i].left)?_4ed:(-_4ed)))/Math.sin(_4ec[j].angle);_4ef=(_4f0<_4eb.labelR)?_4eb.labelR:_4f0;_4ec[j].labelR=_4ef;}i--;j--;i=(i<0)?i+_4ec.length:i;j=(j<0)?j+_4ec.length:j;}},_getLabel:function(_4f1){return dc.getLabel(_4f1,this.opt.fixed,this.opt.precision);}});})();}if(!dojo._hasResource["dojox.charting.plot2d.Bubble"]){dojo._hasResource["dojox.charting.plot2d.Bubble"]=true;dojo.provide("dojox.charting.plot2d.Bubble");(function(){var df=dojox.lang.functional,du=dojox.lang.utils,dc=dojox.charting.plot2d.common,_4f2=df.lambda("item.purgeGroup()");dojo.declare("dojox.charting.plot2d.Bubble",dojox.charting.plot2d.Base,{defaultParams:{hAxis:"x",vAxis:"y",animate:null},optionalParams:{stroke:{},outline:{},shadow:{},fill:{},font:"",fontColor:""},constructor:function(_4f3,_4f4){this.opt=dojo.clone(this.defaultParams);du.updateWithObject(this.opt,_4f4);du.updateWithPattern(this.opt,_4f4,this.optionalParams);this.series=[];this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate;},render:function(dim,_4f5){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_4f5);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){dojo.forEach(this.series,_4f2);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_4f6=this.events();for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();if(!run.data.length){run.dirty=false;t.skip();continue;}if(typeof run.data[0]=="number"){console.warn("dojox.charting.plot2d.Bubble: the data in the following series cannot be rendered as a bubble chart; ",run);continue;}var _4f7=t.next("circle",[this.opt,run]),s=run.group,_4f8=dojo.map(run.data,function(v,i){return v?{x:ht(v.x)+_4f5.l,y:dim.height-_4f5.b-vt(v.y),radius:this._vScaler.bounds.scale*(v.size/2)}:null;},this);var _4f9=null,_4fa=null,_4fb=null;if(_4f7.series.shadow){_4fb=dojo.map(_4f8,function(item){if(item!==null){var _4fc=t.addMixin(_4f7,"circle",item,true),_4fd=_4fc.series.shadow;var _4fe=s.createCircle({cx:item.x+_4fd.dx,cy:item.y+_4fd.dy,r:item.radius}).setStroke(_4fd).setFill(_4fd.color);if(this.animate){this._animateBubble(_4fe,dim.height-_4f5.b,item.radius);}return _4fe;}return null;},this);if(_4fb.length){run.dyn.shadow=_4fb[_4fb.length-1].getStroke();}}if(_4f7.series.outline){_4fa=dojo.map(_4f8,function(item){if(item!==null){var _4ff=t.addMixin(_4f7,"circle",item,true),_500=dc.makeStroke(_4ff.series.outline);_500.width=2*_500.width+_4f7.series.stroke.width;var _501=s.createCircle({cx:item.x,cy:item.y,r:item.radius}).setStroke(_500);if(this.animate){this._animateBubble(_501,dim.height-_4f5.b,item.radius);}return _501;}return null;},this);if(_4fa.length){run.dyn.outline=_4fa[_4fa.length-1].getStroke();}}_4f9=dojo.map(_4f8,function(item){if(item!==null){var _502=t.addMixin(_4f7,"circle",item,true),rect={x:item.x-item.radius,y:item.y-item.radius,width:2*item.radius,height:2*item.radius};var _503=this._plotFill(_502.series.fill,dim,_4f5);_503=this._shapeFill(_503,rect);var _504=s.createCircle({cx:item.x,cy:item.y,r:item.radius}).setFill(_503).setStroke(_502.series.stroke);if(this.animate){this._animateBubble(_504,dim.height-_4f5.b,item.radius);}return _504;}return null;},this);if(_4f9.length){run.dyn.fill=_4f9[_4f9.length-1].getFill();run.dyn.stroke=_4f9[_4f9.length-1].getStroke();}if(_4f6){var _505=new Array(_4f9.length);dojo.forEach(_4f9,function(s,i){if(s!==null){var o={element:"circle",index:i,run:run,shape:s,outline:_4fa&&_4fa[i]||null,shadow:_4fb&&_4fb[i]||null,x:run.data[i].x,y:run.data[i].y,r:run.data[i].size/2,cx:_4f8[i].x,cy:_4f8[i].y,cr:_4f8[i].radius};this._connectEvents(o);_505[i]=o;}},this);this._eventSeries[run.name]=_505;}else{delete this._eventSeries[run.name];}run.dirty=false;}this.dirty=false;return this;},_animateBubble:function(_506,_507,size){dojox.gfx.fx.animateTransform(dojo.delegate({shape:_506,duration:1200,transform:[{name:"translate",start:[0,_507],end:[0,0]},{name:"scale",start:[0,1/size],end:[1,1]},{name:"original"}]},this.animate)).play();}});})();}if(!dojo._hasResource["dojox.charting.plot2d.Candlesticks"]){dojo._hasResource["dojox.charting.plot2d.Candlesticks"]=true;dojo.provide("dojox.charting.plot2d.Candlesticks");(function(){var df=dojox.lang.functional,du=dojox.lang.utils,dc=dojox.charting.plot2d.common,_508=df.lambda("item.purgeGroup()");dojo.declare("dojox.charting.plot2d.Candlesticks",dojox.charting.plot2d.Base,{defaultParams:{hAxis:"x",vAxis:"y",gap:2,animate:null},optionalParams:{minBarSize:1,maxBarSize:1,stroke:{},outline:{},shadow:{},fill:{},font:"",fontColor:""},constructor:function(_509,_50a){this.opt=dojo.clone(this.defaultParams);du.updateWithObject(this.opt,_50a);du.updateWithPattern(this.opt,_50a,this.optionalParams);this.series=[];this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate;},collectStats:function(_50b){var _50c=dojo.delegate(dc.defaultStats);for(var i=0;i<_50b.length;i++){var run=_50b[i];if(!run.data.length){continue;}var _50d=_50c.vmin,_50e=_50c.vmax;if(!("ymin" in run)||!("ymax" in run)){dojo.forEach(run.data,function(val,idx){if(val!==null){var x=val.x||idx+1;_50c.hmin=Math.min(_50c.hmin,x);_50c.hmax=Math.max(_50c.hmax,x);_50c.vmin=Math.min(_50c.vmin,val.open,val.close,val.high,val.low);_50c.vmax=Math.max(_50c.vmax,val.open,val.close,val.high,val.low);}});}if("ymin" in run){_50c.vmin=Math.min(_50d,run.ymin);}if("ymax" in run){_50c.vmax=Math.max(_50e,run.ymax);}}return _50c;},getSeriesStats:function(){var _50f=this.collectStats(this.series);_50f.hmin-=0.5;_50f.hmax+=0.5;return _50f;},render:function(dim,_510){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_510);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){dojo.forEach(this.series,_508);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,f,gap,_511,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_512=Math.max(0,this._vScaler.bounds.lower),_513=vt(_512),_514=this.events();f=dc.calculateBarSize(this._hScaler.bounds.scale,this.opt);gap=f.gap;_511=f.size;for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _515=t.next("candlestick",[this.opt,run]),s=run.group,_516=new Array(run.data.length);for(var j=0;j<run.data.length;++j){var v=run.data[j];if(v!==null){var _517=t.addMixin(_515,"candlestick",v,true);var x=ht(v.x||(j+0.5))+_510.l+gap,y=dim.height-_510.b,open=vt(v.open),_518=vt(v.close),high=vt(v.high),low=vt(v.low);if("mid" in v){var mid=vt(v.mid);}if(low>high){var tmp=high;high=low;low=tmp;}if(_511>=1){var _519=open>_518;var line={x1:_511/2,x2:_511/2,y1:y-high,y2:y-low},rect={x:0,y:y-Math.max(open,_518),width:_511,height:Math.max(_519?open-_518:_518-open,1)};shape=s.createGroup();shape.setTransform({dx:x,dy:0});var _51a=shape.createGroup();_51a.createLine(line).setStroke(_517.series.stroke);_51a.createRect(rect).setStroke(_517.series.stroke).setFill(_519?_517.series.fill:"white");if("mid" in v){_51a.createLine({x1:(_517.series.stroke.width||1),x2:_511-(_517.series.stroke.width||1),y1:y-mid,y2:y-mid}).setStroke(_519?"white":_517.series.stroke);}run.dyn.fill=_517.series.fill;run.dyn.stroke=_517.series.stroke;if(_514){var o={element:"candlestick",index:j,run:run,shape:_51a,x:x,y:y-Math.max(open,_518),cx:_511/2,cy:(y-Math.max(open,_518))+(Math.max(_519?open-_518:_518-open,1)/2),width:_511,height:Math.max(_519?open-_518:_518-open,1),data:v};this._connectEvents(o);_516[j]=o;}}if(this.animate){this._animateCandlesticks(shape,y-low,high-low);}}}this._eventSeries[run.name]=_516;run.dirty=false;}this.dirty=false;return this;},_animateCandlesticks:function(_51b,_51c,_51d){dojox.gfx.fx.animateTransform(dojo.delegate({shape:_51b,duration:1200,transform:[{name:"translate",start:[0,_51c-(_51c/_51d)],end:[0,0]},{name:"scale",start:[1,1/_51d],end:[1,1]},{name:"original"}]},this.animate)).play();}});})();}if(!dojo._hasResource["dojox.charting.plot2d.OHLC"]){dojo._hasResource["dojox.charting.plot2d.OHLC"]=true;dojo.provide("dojox.charting.plot2d.OHLC");(function(){var df=dojox.lang.functional,du=dojox.lang.utils,dc=dojox.charting.plot2d.common,_51e=df.lambda("item.purgeGroup()");dojo.declare("dojox.charting.plot2d.OHLC",dojox.charting.plot2d.Base,{defaultParams:{hAxis:"x",vAxis:"y",gap:2,animate:null},optionalParams:{minBarSize:1,maxBarSize:1,stroke:{},outline:{},shadow:{},fill:{},font:"",fontColor:""},constructor:function(_51f,_520){this.opt=dojo.clone(this.defaultParams);du.updateWithObject(this.opt,_520);du.updateWithPattern(this.opt,_520,this.optionalParams);this.series=[];this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate;},collectStats:function(_521){var _522=dojo.delegate(dc.defaultStats);for(var i=0;i<_521.length;i++){var run=_521[i];if(!run.data.length){continue;}var _523=_522.vmin,_524=_522.vmax;if(!("ymin" in run)||!("ymax" in run)){dojo.forEach(run.data,function(val,idx){if(val!==null){var x=val.x||idx+1;_522.hmin=Math.min(_522.hmin,x);_522.hmax=Math.max(_522.hmax,x);_522.vmin=Math.min(_522.vmin,val.open,val.close,val.high,val.low);_522.vmax=Math.max(_522.vmax,val.open,val.close,val.high,val.low);}});}if("ymin" in run){_522.vmin=Math.min(_523,run.ymin);}if("ymax" in run){_522.vmax=Math.max(_524,run.ymax);}}return _522;},getSeriesStats:function(){var _525=this.collectStats(this.series);_525.hmin-=0.5;_525.hmax+=0.5;return _525;},render:function(dim,_526){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_526);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){dojo.forEach(this.series,_51e);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,f,gap,_527,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_528=Math.max(0,this._vScaler.bounds.lower),_529=vt(_528),_52a=this.events();f=dc.calculateBarSize(this._hScaler.bounds.scale,this.opt);gap=f.gap;_527=f.size;for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _52b=t.next("candlestick",[this.opt,run]),s=run.group,_52c=new Array(run.data.length);for(var j=0;j<run.data.length;++j){var v=run.data[j];if(v!==null){var _52d=t.addMixin(_52b,"candlestick",v,true);var x=ht(v.x||(j+0.5))+_526.l+gap,y=dim.height-_526.b,open=vt(v.open),_52e=vt(v.close),high=vt(v.high),low=vt(v.low);if(low>high){var tmp=high;high=low;low=tmp;}if(_527>=1){var hl={x1:_527/2,x2:_527/2,y1:y-high,y2:y-low},op={x1:0,x2:((_527/2)+((_52d.series.stroke.width||1)/2)),y1:y-open,y2:y-open},cl={x1:((_527/2)-((_52d.series.stroke.width||1)/2)),x2:_527,y1:y-_52e,y2:y-_52e};shape=s.createGroup();shape.setTransform({dx:x,dy:0});var _52f=shape.createGroup();_52f.createLine(hl).setStroke(_52d.series.stroke);_52f.createLine(op).setStroke(_52d.series.stroke);_52f.createLine(cl).setStroke(_52d.series.stroke);run.dyn.stroke=_52d.series.stroke;if(_52a){var o={element:"candlestick",index:j,run:run,shape:_52f,x:x,y:y-Math.max(open,_52e),cx:_527/2,cy:(y-Math.max(open,_52e))+(Math.max(open>_52e?open-_52e:_52e-open,1)/2),width:_527,height:Math.max(open>_52e?open-_52e:_52e-open,1),data:v};this._connectEvents(o);_52c[j]=o;}}if(this.animate){this._animateOHLC(shape,y-low,high-low);}}}this._eventSeries[run.name]=_52c;run.dirty=false;}this.dirty=false;return this;},_animateOHLC:function(_530,_531,_532){dojox.gfx.fx.animateTransform(dojo.delegate({shape:_530,duration:1200,transform:[{name:"translate",start:[0,_531-(_531/_532)],end:[0,0]},{name:"scale",start:[1,1/_532],end:[1,1]},{name:"original"}]},this.animate)).play();}});})();}if(!dojo._hasResource["dojo.fx.easing"]){dojo._hasResource["dojo.fx.easing"]=true;dojo.provide("dojo.fx.easing");dojo.getObject("fx.easing",true,dojo);dojo.fx.easing={linear:function(n){return n;},quadIn:function(n){return Math.pow(n,2);},quadOut:function(n){return n*(n-2)*-1;},quadInOut:function(n){n=n*2;if(n<1){return Math.pow(n,2)/2;}return -1*((--n)*(n-2)-1)/2;},cubicIn:function(n){return Math.pow(n,3);},cubicOut:function(n){return Math.pow(n-1,3)+1;},cubicInOut:function(n){n=n*2;if(n<1){return Math.pow(n,3)/2;}n-=2;return (Math.pow(n,3)+2)/2;},quartIn:function(n){return Math.pow(n,4);},quartOut:function(n){return -1*(Math.pow(n-1,4)-1);},quartInOut:function(n){n=n*2;if(n<1){return Math.pow(n,4)/2;}n-=2;return -1/2*(Math.pow(n,4)-2);},quintIn:function(n){return Math.pow(n,5);},quintOut:function(n){return Math.pow(n-1,5)+1;},quintInOut:function(n){n=n*2;if(n<1){return Math.pow(n,5)/2;}n-=2;return (Math.pow(n,5)+2)/2;},sineIn:function(n){return -1*Math.cos(n*(Math.PI/2))+1;},sineOut:function(n){return Math.sin(n*(Math.PI/2));},sineInOut:function(n){return -1*(Math.cos(Math.PI*n)-1)/2;},expoIn:function(n){return (n==0)?0:Math.pow(2,10*(n-1));},expoOut:function(n){return (n==1)?1:(-1*Math.pow(2,-10*n)+1);},expoInOut:function(n){if(n==0){return 0;}if(n==1){return 1;}n=n*2;if(n<1){return Math.pow(2,10*(n-1))/2;}--n;return (-1*Math.pow(2,-10*n)+2)/2;},circIn:function(n){return -1*(Math.sqrt(1-Math.pow(n,2))-1);},circOut:function(n){n=n-1;return Math.sqrt(1-Math.pow(n,2));},circInOut:function(n){n=n*2;if(n<1){return -1/2*(Math.sqrt(1-Math.pow(n,2))-1);}n-=2;return 1/2*(Math.sqrt(1-Math.pow(n,2))+1);},backIn:function(n){var s=1.70158;return Math.pow(n,2)*((s+1)*n-s);},backOut:function(n){n=n-1;var s=1.70158;return Math.pow(n,2)*((s+1)*n+s)+1;},backInOut:function(n){var s=1.70158*1.525;n=n*2;if(n<1){return (Math.pow(n,2)*((s+1)*n-s))/2;}n-=2;return (Math.pow(n,2)*((s+1)*n+s)+2)/2;},elasticIn:function(n){if(n==0||n==1){return n;}var p=0.3;var s=p/4;n=n-1;return -1*Math.pow(2,10*n)*Math.sin((n-s)*(2*Math.PI)/p);},elasticOut:function(n){if(n==0||n==1){return n;}var p=0.3;var s=p/4;return Math.pow(2,-10*n)*Math.sin((n-s)*(2*Math.PI)/p)+1;},elasticInOut:function(n){if(n==0){return 0;}n=n*2;if(n==2){return 1;}var p=0.3*1.5;var s=p/4;if(n<1){n-=1;return -0.5*(Math.pow(2,10*n)*Math.sin((n-s)*(2*Math.PI)/p));}n-=1;return 0.5*(Math.pow(2,-10*n)*Math.sin((n-s)*(2*Math.PI)/p))+1;},bounceIn:function(n){return (1-dojo.fx.easing.bounceOut(1-n));},bounceOut:function(n){var s=7.5625;var p=2.75;var l;if(n<(1/p)){l=s*Math.pow(n,2);}else{if(n<(2/p)){n-=(1.5/p);l=s*Math.pow(n,2)+0.75;}else{if(n<(2.5/p)){n-=(2.25/p);l=s*Math.pow(n,2)+0.9375;}else{n-=(2.625/p);l=s*Math.pow(n,2)+0.984375;}}}return l;},bounceInOut:function(n){if(n<0.5){return dojo.fx.easing.bounceIn(n*2)/2;}return (dojo.fx.easing.bounceOut(n*2-1)/2)+0.5;}};}if(!dojo._hasResource["dojox.charting.plot2d.Spider"]){dojo._hasResource["dojox.charting.plot2d.Spider"]=true;dojo.provide("dojox.charting.plot2d.Spider");dojo.experimental("dojox.charting.plot2d.Spider");(function(){var df=dojox.lang.functional,du=dojox.lang.utils,dc=dojox.charting.plot2d.common,da=dojox.charting.axis2d.common,g=dojox.gfx,m=g.matrix,_533=0.2;dojo.declare("dojox.charting.plot2d.Spider",[dojox.charting.Element,dojox.charting.plot2d._PlotEvents],{defaultParams:{labels:true,ticks:false,fixed:true,precision:1,labelOffset:-10,labelStyle:"default",htmlLabels:true,startAngle:-90,divisions:3,axisColor:"",axisWidth:0,spiderColor:"",spiderWidth:0,seriesWidth:0,seriesFillAlpha:0.2,spiderOrigin:0.16,markerSize:3,spiderType:"polygon",animationType:dojo.fx.easing.backOut,axisTickFont:"",axisTickFontColor:"",axisFont:"",axisFontColor:""},optionalParams:{radius:0,font:"",fontColor:""},constructor:function(_534,_535){this.opt=dojo.clone(this.defaultParams);du.updateWithObject(this.opt,_535);du.updateWithPattern(this.opt,_535,this.optionalParams);this.series=[];this.dyn=[];this.datas={};this.labelKey=[];this.oldSeriePoints={};this.animations={};},clear:function(){this.dirty=true;this.dyn=[];this.series=[];this.datas={};this.labelKey=[];this.oldSeriePoints={};this.animations={};return this;},setAxis:function(axis){return this;},addSeries:function(run){var _536=false;this.series.push(run);for(var key in run.data){var val=run.data[key],data=this.datas[key];if(data){data.vlist.push(val);data.min=Math.min(data.min,val);data.max=Math.max(data.max,val);}else{this.datas[key]={min:val,max:val,vlist:[val]};}}if(this.labelKey.length<=0){for(var key in run.data){this.labelKey.push(key);}}return this;},getSeriesStats:function(){return dojox.charting.plot2d.common.collectSimpleStats(this.series);},calculateAxes:function(dim){this.initializeScalers(dim,this.getSeriesStats());return this;},getRequiredColors:function(){return this.series.length;},initializeScalers:function(dim,_537){if(this._hAxis){if(!this._hAxis.initialized()){this._hAxis.calculate(_537.hmin,_537.hmax,dim.width);}this._hScaler=this._hAxis.getScaler();}else{this._hScaler=dojox.charting.scaler.primitive.buildScaler(_537.hmin,_537.hmax,dim.width);}if(this._vAxis){if(!this._vAxis.initialized()){this._vAxis.calculate(_537.vmin,_537.vmax,dim.height);}this._vScaler=this._vAxis.getScaler();}else{this._vScaler=dojox.charting.scaler.primitive.buildScaler(_537.vmin,_537.vmax,dim.height);}return this;},render:function(dim,_538){if(!this.dirty){return this;}this.dirty=false;this.cleanGroup();var s=this.group,t=this.chart.theme;this.resetEvents();if(!this.series||!this.series.length){return this;}var o=this.opt,ta=t.axis,rx=(dim.width-_538.l-_538.r)/2,ry=(dim.height-_538.t-_538.b)/2,r=Math.min(rx,ry),_539=o.font||(ta.majorTick&&ta.majorTick.font)||(ta.tick&&ta.tick.font)||"normal normal normal 7pt Tahoma",_53a=o.axisFont||(ta.tick&&ta.tick.titleFont)||"normal normal normal 11pt Tahoma",_53b=o.axisTickFontColor||(ta.majorTick&&ta.majorTick.fontColor)||(ta.tick&&ta.tick.fontColor)||"silver",_53c=o.axisFontColor||(ta.tick&&ta.tick.titleFontColor)||"black",_53d=o.axisColor||(ta.tick&&ta.tick.axisColor)||"silver",_53e=o.spiderColor||(ta.tick&&ta.tick.spiderColor)||"silver",_53f=o.axisWidth||(ta.stroke&&ta.stroke.width)||2,_540=o.spiderWidth||(ta.stroke&&ta.stroke.width)||2,_541=o.seriesWidth||(ta.stroke&&ta.stroke.width)||2,_542=g.normalizedLength(g.splitFontString(_53a).size),_543=m._degToRad(o.startAngle),_544=_543,step,_545,_546,_547,_548,_549,_54a,_54b,_54c,_54d,_54e,ro=o.spiderOrigin,dv=o.divisions>=3?o.divisions:3,ms=o.markerSize,spt=o.spiderType,at=o.animationType,_54f=o.labelOffset<-10?o.labelOffset:-10,_550=0.2;if(o.labels){_547=dojo.map(this.series,function(s){return s.name;},this);_548=df.foldl1(df.map(_547,function(_551,i){var font=t.series.font;return dojox.gfx._base._getTextBox(_551,{font:font}).w;},this),"Math.max(a, b)")/2;r=Math.min(rx-2*_548,ry-_542)+_54f;_549=r-_54f;}if("radius" in o){r=o.radius;_549=r-_54f;}r/=(1+_550);var _552={cx:_538.l+rx,cy:_538.t+ry,r:r};for(var i=this.series.length-1;i>=0;i--){var _553=this.series[i];if(!this.dirty&&!_553.dirty){t.skip();continue;}_553.cleanGroup();var run=_553.data;if(run!==null){var len=this._getObjectLength(run);if(!_54a||_54a.length<=0){_54a=[],_54b=[],_54e=[];this._buildPoints(_54a,len,_552,r,_544,true);this._buildPoints(_54b,len,_552,r*ro,_544,true);this._buildPoints(_54e,len,_552,_549,_544);if(dv>2){_54c=[],_54d=[];for(var j=0;j<dv-2;j++){_54c[j]=[];this._buildPoints(_54c[j],len,_552,r*(ro+(1-ro)*(j+1)/(dv-1)),_544,true);_54d[j]=r*(ro+(1-ro)*(j+1)/(dv-1));}}}}}var _554=s.createGroup(),_555={color:_53d,width:_53f},_556={color:_53e,width:_540};for(var j=_54a.length-1;j>=0;--j){var _557=_54a[j],st={x:_557.x+(_557.x-_552.cx)*_550,y:_557.y+(_557.y-_552.cy)*_550},nd={x:_557.x+(_557.x-_552.cx)*_550/2,y:_557.y+(_557.y-_552.cy)*_550/2};_554.createLine({x1:_552.cx,y1:_552.cy,x2:st.x,y2:st.y}).setStroke(_555);this._drawArrow(_554,st,nd,_555);}var _558=s.createGroup();for(var j=_54e.length-1;j>=0;--j){var _557=_54e[j],_559=dojox.gfx._base._getTextBox(this.labelKey[j],{font:_53a}).w||0,_55a=this.opt.htmlLabels&&dojox.gfx.renderer!="vml"?"html":"gfx";elem=da.createText[_55a](this.chart,_558,(!dojo._isBodyLtr()&&_55a=="html")?(_557.x+_559-dim.width):_557.x,_557.y,"middle",this.labelKey[j],_53a,_53c);if(this.opt.htmlLabels){this.htmlElements.push(elem);}}var _55b=s.createGroup();if(spt=="polygon"){_55b.createPolyline(_54a).setStroke(_556);_55b.createPolyline(_54b).setStroke(_556);if(_54c.length>0){for(var j=_54c.length-1;j>=0;--j){_55b.createPolyline(_54c[j]).setStroke(_556);}}}else{var _55c=this._getObjectLength(this.datas);_55b.createCircle({cx:_552.cx,cy:_552.cy,r:r}).setStroke(_556);_55b.createCircle({cx:_552.cx,cy:_552.cy,r:r*ro}).setStroke(_556);if(_54d.length>0){for(var j=_54d.length-1;j>=0;--j){_55b.createCircle({cx:_552.cx,cy:_552.cy,r:_54d[j]}).setStroke(_556);}}}var _55d=s.createGroup(),len=this._getObjectLength(this.datas),k=0;for(var key in this.datas){var data=this.datas[key],min=data.min,max=data.max,_55e=max-min,end=_544+2*Math.PI*k/len;for(var i=0;i<dv;i++){var text=min+_55e*i/(dv-1),_557=this._getCoordinate(_552,r*(ro+(1-ro)*i/(dv-1)),end);text=this._getLabel(text);var _559=dojox.gfx._base._getTextBox(text,{font:_539}).w||0,_55a=this.opt.htmlLabels&&dojox.gfx.renderer!="vml"?"html":"gfx";if(this.opt.htmlLabels){this.htmlElements.push(da.createText[_55a](this.chart,_55d,(!dojo._isBodyLtr()&&_55a=="html")?(_557.x+_559-dim.width):_557.x,_557.y,"start",text,_539,_53b));}}k++;}this.chart.seriesShapes={};var _55f=[];for(var i=this.series.length-1;i>=0;i--){var _553=this.series[i],run=_553.data;if(run!==null){var _560=[],k=0,_561=[];for(var key in run){var data=this.datas[key],min=data.min,max=data.max,_55e=max-min,_562=run[key],end=_544+2*Math.PI*k/len,_557=this._getCoordinate(_552,r*(ro+(1-ro)*(_562-min)/_55e),end);_560.push(_557);_561.push({sname:_553.name,key:key,data:_562});k++;}_560[_560.length]=_560[0];_561[_561.length]=_561[0];var _563=this._getBoundary(_560),_564=t.next("spider",[o,_553]),ts=_553.group,f=g.normalizeColor(_564.series.fill),sk={color:_564.series.fill,width:_541};f.a=o.seriesFillAlpha;_553.dyn={fill:f,stroke:sk};var osps=this.oldSeriePoints[_553.name];var cs=this._createSeriesEntry(ts,(osps||_54b),_560,f,sk,r,ro,ms,at);this.chart.seriesShapes[_553.name]=cs;this.oldSeriePoints[_553.name]=_560;var po={element:"spider_poly",index:i,id:"spider_poly_"+_553.name,run:_553,plot:this,shape:cs.poly,parent:ts,brect:_563,cx:_552.cx,cy:_552.cy,cr:r,f:f,s:s};this._connectEvents(po);var so={element:"spider_plot",index:i,id:"spider_plot_"+_553.name,run:_553,plot:this,shape:_553.group};this._connectEvents(so);dojo.forEach(cs.circles,function(c,i){var _565=c.getShape(),co={element:"spider_circle",index:i,id:"spider_circle_"+_553.name+i,run:_553,plot:this,shape:c,parent:ts,tdata:_561[i],cx:_560[i].x,cy:_560[i].y,f:f,s:s};this._connectEvents(co);},this);}}return this;},_createSeriesEntry:function(ts,osps,sps,f,sk,r,ro,ms,at){var _566=ts.createPolyline(osps).setFill(f).setStroke(sk),_567=[];for(var j=0;j<osps.length;j++){var _568=osps[j],cr=ms;var _569=ts.createCircle({cx:_568.x,cy:_568.y,r:cr}).setFill(f).setStroke(sk);_567.push(_569);}var _56a=dojo.map(sps,function(np,j){var sp=osps[j],anim=new dojo._Animation({duration:1000,easing:at,curve:[sp.y,np.y]});var spl=_566,sc=_567[j];dojo.connect(anim,"onAnimate",function(y){var _56b=spl.getShape();_56b.points[j].y=y;spl.setShape(_56b);var _56c=sc.getShape();_56c.cy=y;sc.setShape(_56c);});return anim;});var _56d=dojo.map(sps,function(np,j){var sp=osps[j],anim=new dojo._Animation({duration:1000,easing:at,curve:[sp.x,np.x]});var spl=_566,sc=_567[j];dojo.connect(anim,"onAnimate",function(x){var _56e=spl.getShape();_56e.points[j].x=x;spl.setShape(_56e);var _56f=sc.getShape();_56f.cx=x;sc.setShape(_56f);});return anim;});var _570=dojo.fx.combine(_56a.concat(_56d));_570.play();return {group:ts,poly:_566,circles:_567};},plotEvent:function(o){var _571=o.id?o.id:"default",a;if(_571 in this.animations){a=this.animations[_571];a.anim&&a.anim.stop(true);}else{a=this.animations[_571]={};}if(o.element=="spider_poly"){if(!a.color){var _572=o.shape.getFill();if(!_572||!(_572 instanceof dojo.Color)){return;}a.color={start:_572,end:_573(_572)};}var _574=a.color.start,end=a.color.end;if(o.type=="onmouseout"){var t=_574;_574=end;end=t;}a.anim=dojox.gfx.fx.animateFill({shape:o.shape,duration:800,easing:dojo.fx.easing.backOut,color:{start:_574,end:end}});a.anim.play();}else{if(o.element=="spider_circle"){var init,_575,_576=1.5;if(o.type=="onmouseover"){init=dojox.gfx.matrix.identity;_575=_576;var _577={type:"rect"};_577.x=o.cx;_577.y=o.cy;_577.width=_577.height=1;var lt=dojo.coords(this.chart.node,true);_577.x+=lt.x;_577.y+=lt.y;_577.x=Math.round(_577.x);_577.y=Math.round(_577.y);_577.width=Math.ceil(_577.width);_577.height=Math.ceil(_577.height);this.aroundRect=_577;var _578=["after","before"];if(dijit&&dijit.Tooltip){dijit.showTooltip(o.tdata.sname+"<br/>"+o.tdata.key+"<br/>"+o.tdata.data,this.aroundRect,_578);}}else{init=dojox.gfx.matrix.scaleAt(_576,o.cx,o.cy);_575=1/_576;if(dijit&&dijit.Tooltip){this.aroundRect&&dijit.hideTooltip(this.aroundRect);}}var cs=o.shape.getShape(),init=m.scaleAt(_576,cs.cx,cs.cy),_579={shape:o.shape,duration:200,easing:dojo.fx.easing.backOut,transform:[{name:"scaleAt",start:[1,cs.cx,cs.cy],end:[_575,cs.cx,cs.cy]},init]};a.anim=dojox.gfx.fx.animateTransform(_579);a.anim.play();}else{if(o.element=="spider_plot"){if(o.type=="onmouseover"&&!dojo.isIE){o.shape.moveToFront();}}}}},_getBoundary:function(_57a){var xmax=_57a[0].x,xmin=_57a[0].x,ymax=_57a[0].y,ymin=_57a[0].y;for(var i=0;i<_57a.length;i++){var _57b=_57a[i];xmax=Math.max(_57b.x,xmax);ymax=Math.max(_57b.y,ymax);xmin=Math.min(_57b.x,xmin);ymin=Math.min(_57b.y,ymin);}return {x:xmin,y:ymin,width:xmax-xmin,height:ymax-ymin};},_drawArrow:function(s,_57c,end,_57d){var len=Math.sqrt(Math.pow(end.x-_57c.x,2)+Math.pow(end.y-_57c.y,2)),sin=(end.y-_57c.y)/len,cos=(end.x-_57c.x)/len,_57e={x:end.x+(len/3)*(-sin),y:end.y+(len/3)*cos},_57f={x:end.x+(len/3)*sin,y:end.y+(len/3)*(-cos)};s.createPolyline([_57c,_57e,_57f]).setFill(_57d.color).setStroke(_57d);},_buildPoints:function(_580,_581,_582,_583,_584,_585){for(var i=0;i<_581;i++){var end=_584+2*Math.PI*i/_581;_580.push(this._getCoordinate(_582,_583,end));}if(_585){_580.push(this._getCoordinate(_582,_583,_584+2*Math.PI));}},_getCoordinate:function(_586,_587,_588){return {x:_586.cx+_587*Math.cos(_588),y:_586.cy+_587*Math.sin(_588)};},_getObjectLength:function(obj){var _589=0;if(dojo.isObject(obj)){for(var key in obj){_589++;}}return _589;},_getLabel:function(_58a){return dc.getLabel(_58a,this.opt.fixed,this.opt.precision);}});function _573(_58b){var a=new dojox.color.Color(_58b),x=a.toHsl();if(x.s==0){x.l=x.l<50?100:0;}else{x.s=100;if(x.l<50){x.l=75;}else{if(x.l>75){x.l=50;}else{x.l=x.l-50>75-x.l?50:75;}}}var _58b=dojox.color.fromHsl(x);_58b.a=0.7;return _58b;};})();}if(!dojo._hasResource["dojox.lang.functional.fold"]){dojo._hasResource["dojox.lang.functional.fold"]=true;dojo.provide("dojox.lang.functional.fold");(function(){var d=dojo,df=dojox.lang.functional,_58c={};d.mixin(df,{foldl:function(a,f,z,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var i,n;if(d.isArray(a)){for(i=0,n=a.length;i<n;z=f.call(o,z,a[i],i,a),++i){}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){for(i=0;a.hasNext();z=f.call(o,z,a.next(),i++,a)){}}else{for(i in a){if(!(i in _58c)){z=f.call(o,z,a[i],i,a);}}}}return z;},foldl1:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var z,i,n;if(d.isArray(a)){z=a[0];for(i=1,n=a.length;i<n;z=f.call(o,z,a[i],i,a),++i){}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){if(a.hasNext()){z=a.next();for(i=1;a.hasNext();z=f.call(o,z,a.next(),i++,a)){}}}else{var _58d=true;for(i in a){if(!(i in _58c)){if(_58d){z=a[i];_58d=false;}else{z=f.call(o,z,a[i],i,a);}}}}}return z;},foldr:function(a,f,z,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);for(var i=a.length;i>0;--i,z=f.call(o,z,a[i],i,a)){}return z;},foldr1:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var n=a.length,z=a[n-1],i=n-1;for(;i>0;--i,z=f.call(o,z,a[i],i,a)){}return z;},reduce:function(a,f,z){return arguments.length<3?df.foldl1(a,f):df.foldl(a,f,z);},reduceRight:function(a,f,z){return arguments.length<3?df.foldr1(a,f):df.foldr(a,f,z);},unfold:function(pr,f,g,z,o){o=o||d.global;f=df.lambda(f);g=df.lambda(g);pr=df.lambda(pr);var t=[];for(;!pr.call(o,z);t.push(f.call(o,z)),z=g.call(o,z)){}return t;}});})();}if(!dojo._hasResource["dojox.color._base"]){dojo._hasResource["dojox.color._base"]=true;dojo.provide("dojox.color._base");dojox.color.Color=dojo.Color;dojox.color.blend=dojo.blendColors;dojox.color.fromRgb=dojo.colorFromRgb;dojox.color.fromHex=dojo.colorFromHex;dojox.color.fromArray=dojo.colorFromArray;dojox.color.fromString=dojo.colorFromString;dojox.color.greyscale=dojo.colors.makeGrey;dojo.mixin(dojox.color,{fromCmy:function(cyan,_58e,_58f){if(dojo.isArray(cyan)){_58e=cyan[1],_58f=cyan[2],cyan=cyan[0];}else{if(dojo.isObject(cyan)){_58e=cyan.m,_58f=cyan.y,cyan=cyan.c;}}cyan/=100,_58e/=100,_58f/=100;var r=1-cyan,g=1-_58e,b=1-_58f;return new dojox.color.Color({r:Math.round(r*255),g:Math.round(g*255),b:Math.round(b*255)});},fromCmyk:function(cyan,_590,_591,_592){if(dojo.isArray(cyan)){_590=cyan[1],_591=cyan[2],_592=cyan[3],cyan=cyan[0];}else{if(dojo.isObject(cyan)){_590=cyan.m,_591=cyan.y,_592=cyan.b,cyan=cyan.c;}}cyan/=100,_590/=100,_591/=100,_592/=100;var r,g,b;r=1-Math.min(1,cyan*(1-_592)+_592);g=1-Math.min(1,_590*(1-_592)+_592);b=1-Math.min(1,_591*(1-_592)+_592);return new dojox.color.Color({r:Math.round(r*255),g:Math.round(g*255),b:Math.round(b*255)});},fromHsl:function(hue,_593,_594){if(dojo.isArray(hue)){_593=hue[1],_594=hue[2],hue=hue[0];}else{if(dojo.isObject(hue)){_593=hue.s,_594=hue.l,hue=hue.h;}}_593/=100;_594/=100;while(hue<0){hue+=360;}while(hue>=360){hue-=360;}var r,g,b;if(hue<120){r=(120-hue)/60,g=hue/60,b=0;}else{if(hue<240){r=0,g=(240-hue)/60,b=(hue-120)/60;}else{r=(hue-240)/60,g=0,b=(360-hue)/60;}}r=2*_593*Math.min(r,1)+(1-_593);g=2*_593*Math.min(g,1)+(1-_593);b=2*_593*Math.min(b,1)+(1-_593);if(_594<0.5){r*=_594,g*=_594,b*=_594;}else{r=(1-_594)*r+2*_594-1;g=(1-_594)*g+2*_594-1;b=(1-_594)*b+2*_594-1;}return new dojox.color.Color({r:Math.round(r*255),g:Math.round(g*255),b:Math.round(b*255)});},fromHsv:function(hue,_595,_596){if(dojo.isArray(hue)){_595=hue[1],_596=hue[2],hue=hue[0];}else{if(dojo.isObject(hue)){_595=hue.s,_596=hue.v,hue=hue.h;}}if(hue==360){hue=0;}_595/=100;_596/=100;var r,g,b;if(_595==0){r=_596,b=_596,g=_596;}else{var _597=hue/60,i=Math.floor(_597),f=_597-i;var p=_596*(1-_595);var q=_596*(1-(_595*f));var t=_596*(1-(_595*(1-f)));switch(i){case 0:r=_596,g=t,b=p;break;case 1:r=q,g=_596,b=p;break;case 2:r=p,g=_596,b=t;break;case 3:r=p,g=q,b=_596;break;case 4:r=t,g=p,b=_596;break;case 5:r=_596,g=p,b=q;break;}}return new dojox.color.Color({r:Math.round(r*255),g:Math.round(g*255),b:Math.round(b*255)});}});dojo.extend(dojox.color.Color,{toCmy:function(){var cyan=1-(this.r/255),_598=1-(this.g/255),_599=1-(this.b/255);return {c:Math.round(cyan*100),m:Math.round(_598*100),y:Math.round(_599*100)};},toCmyk:function(){var cyan,_59a,_59b,_59c;var r=this.r/255,g=this.g/255,b=this.b/255;_59c=Math.min(1-r,1-g,1-b);cyan=(1-r-_59c)/(1-_59c);_59a=(1-g-_59c)/(1-_59c);_59b=(1-b-_59c)/(1-_59c);return {c:Math.round(cyan*100),m:Math.round(_59a*100),y:Math.round(_59b*100),b:Math.round(_59c*100)};},toHsl:function(){var r=this.r/255,g=this.g/255,b=this.b/255;var min=Math.min(r,b,g),max=Math.max(r,g,b);var _59d=max-min;var h=0,s=0,l=(min+max)/2;if(l>0&&l<1){s=_59d/((l<0.5)?(2*l):(2-2*l));}if(_59d>0){if(max==r&&max!=g){h+=(g-b)/_59d;}if(max==g&&max!=b){h+=(2+(b-r)/_59d);}if(max==b&&max!=r){h+=(4+(r-g)/_59d);}h*=60;}return {h:h,s:Math.round(s*100),l:Math.round(l*100)};},toHsv:function(){var r=this.r/255,g=this.g/255,b=this.b/255;var min=Math.min(r,b,g),max=Math.max(r,g,b);var _59e=max-min;var h=null,s=(max==0)?0:(_59e/max);if(s==0){h=0;}else{if(r==max){h=60*(g-b)/_59e;}else{if(g==max){h=120+60*(b-r)/_59e;}else{h=240+60*(r-g)/_59e;}}if(h<0){h+=360;}}return {h:h,s:Math.round(s*100),v:Math.round(max*100)};}});}if(!dojo._hasResource["dojox.color"]){dojo._hasResource["dojox.color"]=true;dojo.provide("dojox.color");}if(!dojo._hasResource["dojox.color.Palette"]){dojo._hasResource["dojox.color.Palette"]=true;dojo.provide("dojox.color.Palette");(function(){var dxc=dojox.color;dxc.Palette=function(base){this.colors=[];if(base instanceof dojox.color.Palette){this.colors=base.colors.slice(0);}else{if(base instanceof dojox.color.Color){this.colors=[null,null,base,null,null];}else{if(dojo.isArray(base)){this.colors=dojo.map(base.slice(0),function(item){if(dojo.isString(item)){return new dojox.color.Color(item);}return item;});}else{if(dojo.isString(base)){this.colors=[null,null,new dojox.color.Color(base),null,null];}}}}};function _59f(p,_5a0,val){var ret=new dojox.color.Palette();ret.colors=[];dojo.forEach(p.colors,function(item){var r=(_5a0=="dr")?item.r+val:item.r,g=(_5a0=="dg")?item.g+val:item.g,b=(_5a0=="db")?item.b+val:item.b,a=(_5a0=="da")?item.a+val:item.a;ret.colors.push(new dojox.color.Color({r:Math.min(255,Math.max(0,r)),g:Math.min(255,Math.max(0,g)),b:Math.min(255,Math.max(0,b)),a:Math.min(1,Math.max(0,a))}));});return ret;};function tCMY(p,_5a1,val){var ret=new dojox.color.Palette();ret.colors=[];dojo.forEach(p.colors,function(item){var o=item.toCmy(),c=(_5a1=="dc")?o.c+val:o.c,m=(_5a1=="dm")?o.m+val:o.m,y=(_5a1=="dy")?o.y+val:o.y;ret.colors.push(dojox.color.fromCmy(Math.min(100,Math.max(0,c)),Math.min(100,Math.max(0,m)),Math.min(100,Math.max(0,y))));});return ret;};function _5a2(p,_5a3,val){var ret=new dojox.color.Palette();ret.colors=[];dojo.forEach(p.colors,function(item){var o=item.toCmyk(),c=(_5a3=="dc")?o.c+val:o.c,m=(_5a3=="dm")?o.m+val:o.m,y=(_5a3=="dy")?o.y+val:o.y,k=(_5a3=="dk")?o.b+val:o.b;ret.colors.push(dojox.color.fromCmyk(Math.min(100,Math.max(0,c)),Math.min(100,Math.max(0,m)),Math.min(100,Math.max(0,y)),Math.min(100,Math.max(0,k))));});return ret;};function tHSL(p,_5a4,val){var ret=new dojox.color.Palette();ret.colors=[];dojo.forEach(p.colors,function(item){var o=item.toHsl(),h=(_5a4=="dh")?o.h+val:o.h,s=(_5a4=="ds")?o.s+val:o.s,l=(_5a4=="dl")?o.l+val:o.l;ret.colors.push(dojox.color.fromHsl(h%360,Math.min(100,Math.max(0,s)),Math.min(100,Math.max(0,l))));});return ret;};function tHSV(p,_5a5,val){var ret=new dojox.color.Palette();ret.colors=[];dojo.forEach(p.colors,function(item){var o=item.toHsv(),h=(_5a5=="dh")?o.h+val:o.h,s=(_5a5=="ds")?o.s+val:o.s,v=(_5a5=="dv")?o.v+val:o.v;ret.colors.push(dojox.color.fromHsv(h%360,Math.min(100,Math.max(0,s)),Math.min(100,Math.max(0,v))));});return ret;};function _5a6(val,low,high){return high-((high-val)*((high-low)/high));};dojo.extend(dxc.Palette,{transform:function(_5a7){var fn=_59f;if(_5a7.use){var use=_5a7.use.toLowerCase();if(use.indexOf("hs")==0){if(use.charAt(2)=="l"){fn=tHSL;}else{fn=tHSV;}}else{if(use.indexOf("cmy")==0){if(use.charAt(3)=="k"){fn=_5a2;}else{fn=tCMY;}}}}else{if("dc" in _5a7||"dm" in _5a7||"dy" in _5a7){if("dk" in _5a7){fn=_5a2;}else{fn=tCMY;}}else{if("dh" in _5a7||"ds" in _5a7){if("dv" in _5a7){fn=tHSV;}else{fn=tHSL;}}}}var _5a8=this;for(var p in _5a7){if(p=="use"){continue;}_5a8=fn(_5a8,p,_5a7[p]);}return _5a8;},clone:function(){return new dxc.Palette(this);}});dojo.mixin(dxc.Palette,{generators:{analogous:function(args){var high=args.high||60,low=args.low||18,base=dojo.isString(args.base)?new dojox.color.Color(args.base):args.base,hsv=base.toHsv();var h=[(hsv.h+low+360)%360,(hsv.h+Math.round(low/2)+360)%360,hsv.h,(hsv.h-Math.round(high/2)+360)%360,(hsv.h-high+360)%360];var s1=Math.max(10,(hsv.s<=95)?hsv.s+5:(100-(hsv.s-95))),s2=(hsv.s>1)?hsv.s-1:21-hsv.s,v1=(hsv.v>=92)?hsv.v-9:Math.max(hsv.v+9,20),v2=(hsv.v<=90)?Math.max(hsv.v+5,20):(95+Math.ceil((hsv.v-90)/2)),s=[s1,s2,hsv.s,s1,s1],v=[v1,v2,hsv.v,v1,v2];return new dxc.Palette(dojo.map(h,function(hue,i){return dojox.color.fromHsv(hue,s[i],v[i]);}));},monochromatic:function(args){var base=dojo.isString(args.base)?new dojox.color.Color(args.base):args.base,hsv=base.toHsv();var s1=(hsv.s-30>9)?hsv.s-30:hsv.s+30,s2=hsv.s,v1=_5a6(hsv.v,20,100),v2=(hsv.v-20>20)?hsv.v-20:hsv.v+60,v3=(hsv.v-50>20)?hsv.v-50:hsv.v+30;return new dxc.Palette([dojox.color.fromHsv(hsv.h,s1,v1),dojox.color.fromHsv(hsv.h,s2,v3),base,dojox.color.fromHsv(hsv.h,s1,v3),dojox.color.fromHsv(hsv.h,s2,v2)]);},triadic:function(args){var base=dojo.isString(args.base)?new dojox.color.Color(args.base):args.base,hsv=base.toHsv();var h1=(hsv.h+57+360)%360,h2=(hsv.h-157+360)%360,s1=(hsv.s>20)?hsv.s-10:hsv.s+10,s2=(hsv.s>90)?hsv.s-10:hsv.s+10,s3=(hsv.s>95)?hsv.s-5:hsv.s+5,v1=(hsv.v-20>20)?hsv.v-20:hsv.v+20,v2=(hsv.v-30>20)?hsv.v-30:hsv.v+30,v3=(hsv.v-30>70)?hsv.v-30:hsv.v+30;return new dxc.Palette([dojox.color.fromHsv(h1,s1,hsv.v),dojox.color.fromHsv(hsv.h,s2,v2),base,dojox.color.fromHsv(h2,s2,v1),dojox.color.fromHsv(h2,s3,v3)]);},complementary:function(args){var base=dojo.isString(args.base)?new dojox.color.Color(args.base):args.base,hsv=base.toHsv();var h1=((hsv.h*2)+137<360)?(hsv.h*2)+137:Math.floor(hsv.h/2)-137,s1=Math.max(hsv.s-10,0),s2=_5a6(hsv.s,10,100),s3=Math.min(100,hsv.s+20),v1=Math.min(100,hsv.v+30),v2=(hsv.v>20)?hsv.v-30:hsv.v+30;return new dxc.Palette([dojox.color.fromHsv(hsv.h,s1,v1),dojox.color.fromHsv(hsv.h,s2,v2),base,dojox.color.fromHsv(h1,s3,v2),dojox.color.fromHsv(h1,hsv.s,hsv.v)]);},splitComplementary:function(args){var base=dojo.isString(args.base)?new dojox.color.Color(args.base):args.base,_5a9=args.da||30,hsv=base.toHsv();var _5aa=((hsv.h*2)+137<360)?(hsv.h*2)+137:Math.floor(hsv.h/2)-137,h1=(_5aa-_5a9+360)%360,h2=(_5aa+_5a9)%360,s1=Math.max(hsv.s-10,0),s2=_5a6(hsv.s,10,100),s3=Math.min(100,hsv.s+20),v1=Math.min(100,hsv.v+30),v2=(hsv.v>20)?hsv.v-30:hsv.v+30;return new dxc.Palette([dojox.color.fromHsv(h1,s1,v1),dojox.color.fromHsv(h1,s2,v2),base,dojox.color.fromHsv(h2,s3,v2),dojox.color.fromHsv(h2,hsv.s,hsv.v)]);},compound:function(args){var base=dojo.isString(args.base)?new dojox.color.Color(args.base):args.base,hsv=base.toHsv();var h1=((hsv.h*2)+18<360)?(hsv.h*2)+18:Math.floor(hsv.h/2)-18,h2=((hsv.h*2)+120<360)?(hsv.h*2)+120:Math.floor(hsv.h/2)-120,h3=((hsv.h*2)+99<360)?(hsv.h*2)+99:Math.floor(hsv.h/2)-99,s1=(hsv.s-40>10)?hsv.s-40:hsv.s+40,s2=(hsv.s-10>80)?hsv.s-10:hsv.s+10,s3=(hsv.s-25>10)?hsv.s-25:hsv.s+25,v1=(hsv.v-40>10)?hsv.v-40:hsv.v+40,v2=(hsv.v-20>80)?hsv.v-20:hsv.v+20,v3=Math.max(hsv.v,20);return new dxc.Palette([dojox.color.fromHsv(h1,s1,v1),dojox.color.fromHsv(h1,s2,v2),base,dojox.color.fromHsv(h2,s3,v3),dojox.color.fromHsv(h3,s2,v2)]);},shades:function(args){var base=dojo.isString(args.base)?new dojox.color.Color(args.base):args.base,hsv=base.toHsv();var s=(hsv.s==100&&hsv.v==0)?0:hsv.s,v1=(hsv.v-50>20)?hsv.v-50:hsv.v+30,v2=(hsv.v-25>=20)?hsv.v-25:hsv.v+55,v3=(hsv.v-75>=20)?hsv.v-75:hsv.v+5,v4=Math.max(hsv.v-10,20);return new dxc.Palette([new dojox.color.fromHsv(hsv.h,s,v1),new dojox.color.fromHsv(hsv.h,s,v2),base,new dojox.color.fromHsv(hsv.h,s,v3),new dojox.color.fromHsv(hsv.h,s,v4)]);}},generate:function(base,type){if(dojo.isFunction(type)){return type({base:base});}else{if(dxc.Palette.generators[type]){return dxc.Palette.generators[type]({base:base});}}throw new Error("dojox.color.Palette.generate: the specified generator ('"+type+"') does not exist.");}});})();}if(!dojo._hasResource["dojox.charting.Theme"]){dojo._hasResource["dojox.charting.Theme"]=true;dojo.provide("dojox.charting.Theme");dojo.declare("dojox.charting.Theme",null,{shapeSpaces:{shape:1,shapeX:1,shapeY:1},constructor:function(_5ab){_5ab=_5ab||{};var def=dojox.charting.Theme.defaultTheme;dojo.forEach(["chart","plotarea","axis","series","marker"],function(name){this[name]=dojo.delegate(def[name],_5ab[name]);},this);if(_5ab.seriesThemes&&_5ab.seriesThemes.length){this.colors=null;this.seriesThemes=_5ab.seriesThemes.slice(0);}else{this.seriesThemes=null;this.colors=(_5ab.colors||dojox.charting.Theme.defaultColors).slice(0);}this.markerThemes=null;if(_5ab.markerThemes&&_5ab.markerThemes.length){this.markerThemes=_5ab.markerThemes.slice(0);}this.markers=_5ab.markers?dojo.clone(_5ab.markers):dojo.delegate(dojox.charting.Theme.defaultMarkers);this.noGradConv=_5ab.noGradConv;this.noRadialConv=_5ab.noRadialConv;if(_5ab.reverseFills){this.reverseFills();}this._current=0;this._buildMarkerArray();},clone:function(){var _5ac=new dojox.charting.Theme({chart:this.chart,plotarea:this.plotarea,axis:this.axis,series:this.series,marker:this.marker,colors:this.colors,markers:this.markers,seriesThemes:this.seriesThemes,markerThemes:this.markerThemes,noGradConv:this.noGradConv,noRadialConv:this.noRadialConv});dojo.forEach(["clone","clear","next","skip","addMixin","post","getTick"],function(name){if(this.hasOwnProperty(name)){_5ac[name]=this[name];}},this);return _5ac;},clear:function(){this._current=0;},next:function(_5ad,_5ae,_5af){var _5b0=dojox.lang.utils.merge,_5b1,_5b2;if(this.colors){_5b1=dojo.delegate(this.series);_5b2=dojo.delegate(this.marker);var _5b3=new dojo.Color(this.colors[this._current%this.colors.length]),old;if(_5b1.stroke&&_5b1.stroke.color){_5b1.stroke=dojo.delegate(_5b1.stroke);old=new dojo.Color(_5b1.stroke.color);_5b1.stroke.color=new dojo.Color(_5b3);_5b1.stroke.color.a=old.a;}else{_5b1.stroke={color:_5b3};}if(_5b2.stroke&&_5b2.stroke.color){_5b2.stroke=dojo.delegate(_5b2.stroke);old=new dojo.Color(_5b2.stroke.color);_5b2.stroke.color=new dojo.Color(_5b3);_5b2.stroke.color.a=old.a;}else{_5b2.stroke={color:_5b3};}if(!_5b1.fill||_5b1.fill.type){_5b1.fill=_5b3;}else{old=new dojo.Color(_5b1.fill);_5b1.fill=new dojo.Color(_5b3);_5b1.fill.a=old.a;}if(!_5b2.fill||_5b2.fill.type){_5b2.fill=_5b3;}else{old=new dojo.Color(_5b2.fill);_5b2.fill=new dojo.Color(_5b3);_5b2.fill.a=old.a;}}else{_5b1=this.seriesThemes?_5b0(this.series,this.seriesThemes[this._current%this.seriesThemes.length]):this.series;_5b2=this.markerThemes?_5b0(this.marker,this.markerThemes[this._current%this.markerThemes.length]):_5b1;}var _5b4=_5b2&&_5b2.symbol||this._markers[this._current%this._markers.length];var _5b5={series:_5b1,marker:_5b2,symbol:_5b4};++this._current;if(_5ae){_5b5=this.addMixin(_5b5,_5ad,_5ae);}if(_5af){_5b5=this.post(_5b5,_5ad);}return _5b5;},skip:function(){++this._current;},addMixin:function(_5b6,_5b7,_5b8,_5b9){if(dojo.isArray(_5b8)){dojo.forEach(_5b8,function(m){_5b6=this.addMixin(_5b6,_5b7,m);},this);}else{var t={};if("color" in _5b8){if(_5b7=="line"||_5b7=="area"){dojo.setObject("series.stroke.color",_5b8.color,t);dojo.setObject("marker.stroke.color",_5b8.color,t);}else{dojo.setObject("series.fill",_5b8.color,t);}}dojo.forEach(["stroke","outline","shadow","fill","font","fontColor","labelWiring"],function(name){var _5ba="marker"+name.charAt(0).toUpperCase()+name.substr(1),b=_5ba in _5b8;if(name in _5b8){dojo.setObject("series."+name,_5b8[name],t);if(!b){dojo.setObject("marker."+name,_5b8[name],t);}}if(b){dojo.setObject("marker."+name,_5b8[_5ba],t);}});if("marker" in _5b8){t.symbol=_5b8.marker;}_5b6=dojox.lang.utils.merge(_5b6,t);}if(_5b9){_5b6=this.post(_5b6,_5b7);}return _5b6;},post:function(_5bb,_5bc){var fill=_5bb.series.fill,t;if(!this.noGradConv&&this.shapeSpaces[fill.space]&&fill.type=="linear"){if(_5bc=="bar"){t={x1:fill.y1,y1:fill.x1,x2:fill.y2,y2:fill.x2};}else{if(!this.noRadialConv&&fill.space=="shape"&&(_5bc=="slice"||_5bc=="circle")){t={type:"radial",cx:0,cy:0,r:100};}}if(t){return dojox.lang.utils.merge(_5bb,{series:{fill:t}});}}return _5bb;},getTick:function(name,_5bd){var tick=this.axis.tick,_5be=name+"Tick";merge=dojox.lang.utils.merge;if(tick){if(this.axis[_5be]){tick=merge(tick,this.axis[_5be]);}}else{tick=this.axis[_5be];}if(_5bd){if(tick){if(_5bd[_5be]){tick=merge(tick,_5bd[_5be]);}}else{tick=_5bd[_5be];}}return tick;},inspectObjects:function(f){dojo.forEach(["chart","plotarea","axis","series","marker"],function(name){f(this[name]);},this);if(this.seriesThemes){dojo.forEach(this.seriesThemes,f);}if(this.markerThemes){dojo.forEach(this.markerThemes,f);}},reverseFills:function(){this.inspectObjects(function(o){if(o&&o.fill){o.fill=dojox.gfx.gradutils.reverse(o.fill);}});},addMarker:function(name,_5bf){this.markers[name]=_5bf;this._buildMarkerArray();},setMarkers:function(obj){this.markers=obj;this._buildMarkerArray();},_buildMarkerArray:function(){this._markers=[];for(var p in this.markers){this._markers.push(this.markers[p]);}}});dojo.mixin(dojox.charting.Theme,{defaultMarkers:{CIRCLE:"m-3,0 c0,-4 6,-4 6,0 m-6,0 c0,4 6,4 6,0",SQUARE:"m-3,-3 l0,6 6,0 0,-6 z",DIAMOND:"m0,-3 l3,3 -3,3 -3,-3 z",CROSS:"m0,-3 l0,6 m-3,-3 l6,0",X:"m-3,-3 l6,6 m0,-6 l-6,6",TRIANGLE:"m-3,3 l3,-6 3,6 z",TRIANGLE_INVERTED:"m-3,-3 l3,6 3,-6 z"},defaultColors:["#54544c","#858e94","#6e767a","#948585","#474747"],defaultTheme:{chart:{stroke:null,fill:"white",pageStyle:null,titleGap:20,titlePos:"top",titleFont:"normal normal bold 14pt Tahoma",titleFontColor:"#333"},plotarea:{stroke:null,fill:"white"},axis:{stroke:{color:"#333",width:1},tick:{color:"#666",position:"center",font:"normal normal normal 7pt Tahoma",fontColor:"#333",titleGap:15,titleFont:"normal normal normal 11pt Tahoma",titleFontColor:"#333",titleOrientation:"axis"},majorTick:{width:1,length:6},minorTick:{width:0.8,length:3},microTick:{width:0.5,length:1}},series:{stroke:{width:1.5,color:"#333"},outline:{width:0.1,color:"#ccc"},shadow:null,fill:"#ccc",font:"normal normal normal 8pt Tahoma",fontColor:"#000",labelWiring:{width:1,color:"#ccc"}},marker:{stroke:{width:1.5,color:"#333"},outline:{width:0.1,color:"#ccc"},shadow:null,fill:"#ccc",font:"normal normal normal 8pt Tahoma",fontColor:"#000"}},defineColors:function(_5c0){_5c0=_5c0||{};var c=[],n=_5c0.num||5;if(_5c0.colors){var l=_5c0.colors.length;for(var i=0;i<n;i++){c.push(_5c0.colors[i%l]);}return c;}if(_5c0.hue){var s=_5c0.saturation||100;var st=_5c0.low||30;var end=_5c0.high||90;var l=(end+st)/2;return dojox.color.Palette.generate(dojox.color.fromHsv(_5c0.hue,s,l),"monochromatic").colors;}if(_5c0.generator){return dojox.color.Palette.generate(_5c0.base,_5c0.generator).colors;}return c;},generateGradient:function(_5c1,_5c2,_5c3){var fill=dojo.delegate(_5c1);fill.colors=[{offset:0,color:_5c2},{offset:1,color:_5c3}];return fill;},generateHslColor:function(_5c4,_5c5){_5c4=new dojox.color.Color(_5c4);var hsl=_5c4.toHsl(),_5c6=dojox.color.fromHsl(hsl.h,hsl.s,_5c5);_5c6.a=_5c4.a;return _5c6;},generateHslGradient:function(_5c7,_5c8,_5c9,_5ca){_5c7=new dojox.color.Color(_5c7);var hsl=_5c7.toHsl(),_5cb=dojox.color.fromHsl(hsl.h,hsl.s,_5c9),_5cc=dojox.color.fromHsl(hsl.h,hsl.s,_5ca);_5cb.a=_5cc.a=_5c7.a;return dojox.charting.Theme.generateGradient(_5c8,_5cb,_5cc);}});}if(!dojo._hasResource["dojox.charting.Series"]){dojo._hasResource["dojox.charting.Series"]=true;dojo.provide("dojox.charting.Series");dojo.declare("dojox.charting.Series",dojox.charting.Element,{constructor:function(_5cd,data,_5ce){dojo.mixin(this,_5ce);if(typeof this.plot!="string"){this.plot="default";}this.update(data);},clear:function(){this.dyn={};},update:function(data){if(dojo.isArray(data)){this.data=data;}else{this.source=data;this.data=this.source.data;if(this.source.setSeriesObject){this.source.setSeriesObject(this);}}this.dirty=true;this.clear();}});}if(!dojo._hasResource["dojox.charting.Chart"]){dojo._hasResource["dojox.charting.Chart"]=true;dojo.provide("dojox.charting.Chart");(function(){var df=dojox.lang.functional,dc=dojox.charting,g=dojox.gfx,_5cf=df.lambda("item.clear()"),_5d0=df.lambda("item.purgeGroup()"),_5d1=df.lambda("item.destroy()"),_5d2=df.lambda("item.dirty = false"),_5d3=df.lambda("item.dirty = true"),_5d4=df.lambda("item.name");dojo.declare("dojox.charting.Chart",null,{constructor:function(node,_5d5){if(!_5d5){_5d5={};}this.margins=_5d5.margins?_5d5.margins:{l:10,t:10,r:10,b:10};this.stroke=_5d5.stroke;this.fill=_5d5.fill;this.delayInMs=_5d5.delayInMs||200;this.title=_5d5.title;this.titleGap=_5d5.titleGap;this.titlePos=_5d5.titlePos;this.titleFont=_5d5.titleFont;this.titleFontColor=_5d5.titleFontColor;this.chartTitle=null;this.theme=null;this.axes={};this.stack=[];this.plots={};this.series=[];this.runs={};this.dirty=true;this.coords=null;this.node=dojo.byId(node);var box=dojo.marginBox(node);this.surface=g.createSurface(this.node,box.w||400,box.h||300);},destroy:function(){dojo.forEach(this.series,_5d1);dojo.forEach(this.stack,_5d1);df.forIn(this.axes,_5d1);if(this.chartTitle&&this.chartTitle.tagName){dojo.destroy(this.chartTitle);}this.surface.destroy();},getCoords:function(){if(!this.coords){this.coords=dojo.coords(this.node,true);}return this.coords;},setTheme:function(_5d6){this.theme=_5d6.clone();this.dirty=true;return this;},addAxis:function(name,_5d7){var axis,_5d8=_5d7&&_5d7.type||"Default";if(typeof _5d8=="string"){if(!dc.axis2d||!dc.axis2d[_5d8]){throw Error("Can't find axis: "+_5d8+" - didn't you forget to dojo"+".require() it?");}axis=new dc.axis2d[_5d8](this,_5d7);}else{axis=new _5d8(this,_5d7);}axis.name=name;axis.dirty=true;if(name in this.axes){this.axes[name].destroy();}this.axes[name]=axis;this.dirty=true;return this;},getAxis:function(name){return this.axes[name];},removeAxis:function(name){if(name in this.axes){this.axes[name].destroy();delete this.axes[name];this.dirty=true;}return this;},addPlot:function(name,_5d9){var plot,_5da=_5d9&&_5d9.type||"Default";if(typeof _5da=="string"){if(!dc.plot2d||!dc.plot2d[_5da]){throw Error("Can't find plot: "+_5da+" - didn't you forget to dojo"+".require() it?");}plot=new dc.plot2d[_5da](this,_5d9);}else{plot=new _5da(this,_5d9);}plot.name=name;plot.dirty=true;if(name in this.plots){this.stack[this.plots[name]].destroy();this.stack[this.plots[name]]=plot;}else{this.plots[name]=this.stack.length;this.stack.push(plot);}this.dirty=true;return this;},removePlot:function(name){if(name in this.plots){var _5db=this.plots[name];delete this.plots[name];this.stack[_5db].destroy();this.stack.splice(_5db,1);df.forIn(this.plots,function(idx,name,_5dc){if(idx>_5db){_5dc[name]=idx-1;}});var ns=dojo.filter(this.series,function(run){return run.plot!=name;});if(ns.length<this.series.length){dojo.forEach(this.series,function(run){if(run.plot==name){run.destroy();}});this.runs={};dojo.forEach(ns,function(run,_5dd){this.runs[run.plot]=_5dd;},this);this.series=ns;}this.dirty=true;}return this;},getPlotOrder:function(){return df.map(this.stack,_5d4);},setPlotOrder:function(_5de){var _5df={},_5e0=df.filter(_5de,function(name){if(!(name in this.plots)||(name in _5df)){return false;}_5df[name]=1;return true;},this);if(_5e0.length<this.stack.length){df.forEach(this.stack,function(plot){var name=plot.name;if(!(name in _5df)){_5e0.push(name);}});}var _5e1=df.map(_5e0,function(name){return this.stack[this.plots[name]];},this);df.forEach(_5e1,function(plot,i){this.plots[plot.name]=i;},this);this.stack=_5e1;this.dirty=true;return this;},movePlotToFront:function(name){if(name in this.plots){var _5e2=this.plots[name];if(_5e2){var _5e3=this.getPlotOrder();_5e3.splice(_5e2,1);_5e3.unshift(name);return this.setPlotOrder(_5e3);}}return this;},movePlotToBack:function(name){if(name in this.plots){var _5e4=this.plots[name];if(_5e4<this.stack.length-1){var _5e5=this.getPlotOrder();_5e5.splice(_5e4,1);_5e5.push(name);return this.setPlotOrder(_5e5);}}return this;},addSeries:function(name,data,_5e6){var run=new dc.Series(this,data,_5e6);run.name=name;if(name in this.runs){this.series[this.runs[name]].destroy();this.series[this.runs[name]]=run;}else{this.runs[name]=this.series.length;this.series.push(run);}this.dirty=true;if(!("ymin" in run)&&"min" in run){run.ymin=run.min;}if(!("ymax" in run)&&"max" in run){run.ymax=run.max;}return this;},removeSeries:function(name){if(name in this.runs){var _5e7=this.runs[name];delete this.runs[name];this.series[_5e7].destroy();this.series.splice(_5e7,1);df.forIn(this.runs,function(idx,name,runs){if(idx>_5e7){runs[name]=idx-1;}});this.dirty=true;}return this;},updateSeries:function(name,data){if(name in this.runs){var run=this.series[this.runs[name]];run.update(data);this._invalidateDependentPlots(run.plot,false);this._invalidateDependentPlots(run.plot,true);}return this;},getSeriesOrder:function(_5e8){return df.map(df.filter(this.series,function(run){return run.plot==_5e8;}),_5d4);},setSeriesOrder:function(_5e9){var _5ea,_5eb={},_5ec=df.filter(_5e9,function(name){if(!(name in this.runs)||(name in _5eb)){return false;}var run=this.series[this.runs[name]];if(_5ea){if(run.plot!=_5ea){return false;}}else{_5ea=run.plot;}_5eb[name]=1;return true;},this);df.forEach(this.series,function(run){var name=run.name;if(!(name in _5eb)&&run.plot==_5ea){_5ec.push(name);}});var _5ed=df.map(_5ec,function(name){return this.series[this.runs[name]];},this);this.series=_5ed.concat(df.filter(this.series,function(run){return run.plot!=_5ea;}));df.forEach(this.series,function(run,i){this.runs[run.name]=i;},this);this.dirty=true;return this;},moveSeriesToFront:function(name){if(name in this.runs){var _5ee=this.runs[name],_5ef=this.getSeriesOrder(this.series[_5ee].plot);if(name!=_5ef[0]){_5ef.splice(_5ee,1);_5ef.unshift(name);return this.setSeriesOrder(_5ef);}}return this;},moveSeriesToBack:function(name){if(name in this.runs){var _5f0=this.runs[name],_5f1=this.getSeriesOrder(this.series[_5f0].plot);if(name!=_5f1[_5f1.length-1]){_5f1.splice(_5f0,1);_5f1.push(name);return this.setSeriesOrder(_5f1);}}return this;},resize:function(_5f2,_5f3){var box;switch(arguments.length){case 1:box=dojo.mixin({},_5f2);dojo.marginBox(this.node,box);break;case 2:box={w:_5f2,h:_5f3};dojo.marginBox(this.node,box);break;}box=dojo.marginBox(this.node);this.surface.setDimensions(box.w,box.h);this.dirty=true;this.coords=null;return this.render();},getGeometry:function(){var ret={};df.forIn(this.axes,function(axis){if(axis.initialized()){ret[axis.name]={name:axis.name,vertical:axis.vertical,scaler:axis.scaler,ticks:axis.ticks};}});return ret;},setAxisWindow:function(name,_5f4,_5f5,zoom){var axis=this.axes[name];if(axis){axis.setWindow(_5f4,_5f5);dojo.forEach(this.stack,function(plot){if(plot.hAxis==name||plot.vAxis==name){plot.zoom=zoom;}});}return this;},setWindow:function(sx,sy,dx,dy,zoom){if(!("plotArea" in this)){this.calculateGeometry();}df.forIn(this.axes,function(axis){var _5f6,_5f7,_5f8=axis.getScaler().bounds,s=_5f8.span/(_5f8.upper-_5f8.lower);if(axis.vertical){_5f6=sy;_5f7=dy/s/_5f6;}else{_5f6=sx;_5f7=dx/s/_5f6;}axis.setWindow(_5f6,_5f7);});dojo.forEach(this.stack,function(plot){plot.zoom=zoom;});return this;},zoomIn:function(name,_5f9){var axis=this.axes[name];if(axis){var _5fa,_5fb,_5fc=axis.getScaler().bounds;var _5fd=Math.min(_5f9[0],_5f9[1]);var _5fe=Math.max(_5f9[0],_5f9[1]);_5fd=_5f9[0]<_5fc.lower?_5fc.lower:_5fd;_5fe=_5f9[1]>_5fc.upper?_5fc.upper:_5fe;_5fa=(_5fc.upper-_5fc.lower)/(_5fe-_5fd);_5fb=_5fd-_5fc.lower;this.setAxisWindow(name,_5fa,_5fb);this.render();}},calculateGeometry:function(){if(this.dirty){return this.fullGeometry();}var _5ff=dojo.filter(this.stack,function(plot){return plot.dirty||(plot.hAxis&&this.axes[plot.hAxis].dirty)||(plot.vAxis&&this.axes[plot.vAxis].dirty);},this);_600(_5ff,this.plotArea);return this;},fullGeometry:function(){this._makeDirty();dojo.forEach(this.stack,_5cf);if(!this.theme){this.setTheme(new dojox.charting.Theme(dojox.charting._def));}dojo.forEach(this.series,function(run){if(!(run.plot in this.plots)){if(!dc.plot2d||!dc.plot2d.Default){throw Error("Can't find plot: Default - didn't you forget to dojo"+".require() it?");}var plot=new dc.plot2d.Default(this,{});plot.name=run.plot;this.plots[run.plot]=this.stack.length;this.stack.push(plot);}this.stack[this.plots[run.plot]].addSeries(run);},this);dojo.forEach(this.stack,function(plot){if(plot.hAxis){plot.setAxis(this.axes[plot.hAxis]);}if(plot.vAxis){plot.setAxis(this.axes[plot.vAxis]);}},this);var dim=this.dim=this.surface.getDimensions();dim.width=g.normalizedLength(dim.width);dim.height=g.normalizedLength(dim.height);df.forIn(this.axes,_5cf);_600(this.stack,dim);var _601=this.offsets={l:0,r:0,t:0,b:0};df.forIn(this.axes,function(axis){df.forIn(axis.getOffsets(),function(o,i){_601[i]+=o;});});if(this.title){this.titleGap=(this.titleGap==0)?0:this.titleGap||this.theme.chart.titleGap||20;this.titlePos=this.titlePos||this.theme.chart.titlePos||"top";this.titleFont=this.titleFont||this.theme.chart.titleFont;this.titleFontColor=this.titleFontColor||this.theme.chart.titleFontColor||"black";var _602=g.normalizedLength(g.splitFontString(this.titleFont).size);_601[this.titlePos=="top"?"t":"b"]+=(_602+this.titleGap);}df.forIn(this.margins,function(o,i){_601[i]+=o;});this.plotArea={width:dim.width-_601.l-_601.r,height:dim.height-_601.t-_601.b};df.forIn(this.axes,_5cf);_600(this.stack,this.plotArea);return this;},render:function(){if(this.theme){this.theme.clear();}if(this.dirty){return this.fullRender();}this.calculateGeometry();df.forEachRev(this.stack,function(plot){plot.render(this.dim,this.offsets);},this);df.forIn(this.axes,function(axis){axis.render(this.dim,this.offsets);},this);this._makeClean();if(this.surface.render){this.surface.render();}return this;},fullRender:function(){this.fullGeometry();var _603=this.offsets,dim=this.dim,rect;dojo.forEach(this.series,_5d0);df.forIn(this.axes,_5d0);dojo.forEach(this.stack,_5d0);if(this.chartTitle&&this.chartTitle.tagName){dojo.destroy(this.chartTitle);}this.surface.clear();this.chartTitle=null;var t=this.theme,fill=t.plotarea&&t.plotarea.fill,_604=t.plotarea&&t.plotarea.stroke,rect={x:_603.l-1,y:_603.t-1,width:dim.width-_603.l-_603.r+2,height:dim.height-_603.t-_603.b+2};if(fill){fill=dc.Element.prototype._shapeFill(dc.Element.prototype._plotFill(fill,dim,_603),rect);this.surface.createRect(rect).setFill(fill);}if(_604){this.surface.createRect({x:_603.l,y:_603.t,width:dim.width-_603.l-_603.r+1,height:dim.height-_603.t-_603.b+1}).setStroke(_604);}df.foldr(this.stack,function(z,plot){return plot.render(dim,_603),0;},0);fill=this.fill!==undefined?this.fill:(t.chart&&t.chart.fill);_604=this.stroke!==undefined?this.stroke:(t.chart&&t.chart.stroke);if(fill=="inherit"){var node=this.node,fill=new dojo.Color(dojo.style(node,"backgroundColor"));while(fill.a==0&&node!=document.documentElement){fill=new dojo.Color(dojo.style(node,"backgroundColor"));node=node.parentNode;}}if(fill){fill=dc.Element.prototype._plotFill(fill,dim,_603);if(_603.l){rect={width:_603.l,height:dim.height+1};this.surface.createRect(rect).setFill(dc.Element.prototype._shapeFill(fill,rect));}if(_603.r){rect={x:dim.width-_603.r,width:_603.r+1,height:dim.height+2};this.surface.createRect(rect).setFill(dc.Element.prototype._shapeFill(fill,rect));}if(_603.t){rect={width:dim.width+1,height:_603.t};this.surface.createRect(rect).setFill(dc.Element.prototype._shapeFill(fill,rect));}if(_603.b){rect={y:dim.height-_603.b,width:dim.width+1,height:_603.b+2};this.surface.createRect(rect).setFill(dc.Element.prototype._shapeFill(fill,rect));}}if(_604){this.surface.createRect({width:dim.width-1,height:dim.height-1}).setStroke(_604);}if(this.title){var _605=(g.renderer=="canvas"),_606=_605||!dojo.isIE&&!dojo.isOpera?"html":"gfx",_607=g.normalizedLength(g.splitFontString(this.titleFont).size);this.chartTitle=dc.axis2d.common.createText[_606](this,this.surface,dim.width/2,this.titlePos=="top"?_607+this.margins.t:dim.height-this.margins.b,"middle",this.title,this.titleFont,this.titleFontColor);}df.forIn(this.axes,function(axis){axis.render(dim,_603);});this._makeClean();if(this.surface.render){this.surface.render();}return this;},delayedRender:function(){if(!this._delayedRenderHandle){this._delayedRenderHandle=setTimeout(dojo.hitch(this,function(){clearTimeout(this._delayedRenderHandle);this._delayedRenderHandle=null;this.render();}),this.delayInMs);}return this;},connectToPlot:function(name,_608,_609){return name in this.plots?this.stack[this.plots[name]].connect(_608,_609):null;},fireEvent:function(_60a,_60b,_60c){if(_60a in this.runs){var _60d=this.series[this.runs[_60a]].plot;if(_60d in this.plots){var plot=this.stack[this.plots[_60d]];if(plot){plot.fireEvent(_60a,_60b,_60c);}}}return this;},_makeClean:function(){dojo.forEach(this.axes,_5d2);dojo.forEach(this.stack,_5d2);dojo.forEach(this.series,_5d2);this.dirty=false;},_makeDirty:function(){dojo.forEach(this.axes,_5d3);dojo.forEach(this.stack,_5d3);dojo.forEach(this.series,_5d3);this.dirty=true;},_invalidateDependentPlots:function(_60e,_60f){if(_60e in this.plots){var plot=this.stack[this.plots[_60e]],axis,_610=_60f?"vAxis":"hAxis";if(plot[_610]){axis=this.axes[plot[_610]];if(axis&&axis.dependOnData()){axis.dirty=true;dojo.forEach(this.stack,function(p){if(p[_610]&&p[_610]==plot[_610]){p.dirty=true;}});}}else{plot.dirty=true;}}}});function _611(_612){return {min:_612.hmin,max:_612.hmax};};function _613(_614){return {min:_614.vmin,max:_614.vmax};};function _615(_616,h){_616.hmin=h.min;_616.hmax=h.max;};function _617(_618,v){_618.vmin=v.min;_618.vmax=v.max;};function _619(_61a,_61b){if(_61a&&_61b){_61a.min=Math.min(_61a.min,_61b.min);_61a.max=Math.max(_61a.max,_61b.max);}return _61a||_61b;};function _600(_61c,_61d){var _61e={},axes={};dojo.forEach(_61c,function(plot){var _61f=_61e[plot.name]=plot.getSeriesStats();if(plot.hAxis){axes[plot.hAxis]=_619(axes[plot.hAxis],_611(_61f));}if(plot.vAxis){axes[plot.vAxis]=_619(axes[plot.vAxis],_613(_61f));}});dojo.forEach(_61c,function(plot){var _620=_61e[plot.name];if(plot.hAxis){_615(_620,axes[plot.hAxis]);}if(plot.vAxis){_617(_620,axes[plot.vAxis]);}plot.initializeScalers(_61d,_620);});};})();}if(!dojo._hasResource["dojox.charting.Chart2D"]){dojo._hasResource["dojox.charting.Chart2D"]=true;dojo.provide("dojox.charting.Chart2D");dojo.deprecated("dojox.charting.Chart2D","Use dojo.charting.Chart instead and require all other components explicitly","2.0");dojox.charting.Chart2D=dojox.charting.Chart;}if(!dojo._hasResource["dojox.charting.themes.PlotKit.base"]){dojo._hasResource["dojox.charting.themes.PlotKit.base"]=true;dojo.provide("dojox.charting.themes.PlotKit.base");(function(){var dc=dojox.charting,pk=dc.themes.PlotKit;pk.base=new dc.Theme({chart:{stroke:null,fill:"yellow"},plotarea:{stroke:null,fill:"yellow"},axis:{stroke:{color:"#fff",width:1},line:{color:"#fff",width:0.5},majorTick:{color:"#fff",width:0.5,length:6},minorTick:{color:"#fff",width:0.5,length:3},tick:{font:"normal normal normal 7pt Helvetica,Arial,sans-serif",fontColor:"#999"}},series:{stroke:{width:2.5,color:"#fff"},fill:"#666",font:"normal normal normal 7.5pt Helvetica,Arial,sans-serif",fontColor:"#666"},marker:{stroke:{width:2},fill:"#333",font:"normal normal normal 7pt Helvetica,Arial,sans-serif",fontColor:"#666"},colors:["red","green","blue"]});pk.base.next=function(_621,_622,_623){var _624=dc.Theme.prototype.next.apply(this,arguments);if(_621=="line"){_624.marker.outline={width:2,color:"#fff"};_624.series.stroke.width=3.5;_624.marker.stroke.width=2;}else{if(_621=="candlestick"){_624.series.stroke.width=1;}else{_624.series.stroke.color="#fff";}}return _624;};})();}if(!dojo._hasResource["dijit.Tooltip"]){dojo._hasResource["dijit.Tooltip"]=true;dojo.provide("dijit.Tooltip");dojo.declare("dijit._MasterTooltip",[dijit._Widget,dijit._Templated],{duration:dijit.defaultDuration,templateString:dojo.cache("dijit","templates/Tooltip.html","<div class=\"dijitTooltip dijitTooltipLeft\" id=\"dojoTooltip\"\r\n\t><div class=\"dijitTooltipContainer dijitTooltipContents\" dojoAttachPoint=\"containerNode\" role='alert'></div\r\n\t><div class=\"dijitTooltipConnector\" dojoAttachPoint=\"connectorNode\"></div\r\n></div>\r\n"),postCreate:function(){dojo.body().appendChild(this.domNode);this.bgIframe=new dijit.BackgroundIframe(this.domNode);this.fadeIn=dojo.fadeIn({node:this.domNode,duration:this.duration,onEnd:dojo.hitch(this,"_onShow")});this.fadeOut=dojo.fadeOut({node:this.domNode,duration:this.duration,onEnd:dojo.hitch(this,"_onHide")});},show:function(_625,_626,_627,rtl){if(this.aroundNode&&this.aroundNode===_626){return;}this.domNode.width="auto";if(this.fadeOut.status()=="playing"){this._onDeck=arguments;return;}this.containerNode.innerHTML=_625;var pos=dijit.placeOnScreenAroundElement(this.domNode,_626,dijit.getPopupAroundAlignment((_627&&_627.length)?_627:dijit.Tooltip.defaultPosition,!rtl),dojo.hitch(this,"orient"));dojo.style(this.domNode,"opacity",0);this.fadeIn.play();this.isShowingNow=true;this.aroundNode=_626;},orient:function(node,_628,_629,_62a,_62b){this.connectorNode.style.top="";var _62c=_62a.w-this.connectorNode.offsetWidth;node.className="dijitTooltip "+{"BL-TL":"dijitTooltipBelow dijitTooltipABLeft","TL-BL":"dijitTooltipAbove dijitTooltipABLeft","BR-TR":"dijitTooltipBelow dijitTooltipABRight","TR-BR":"dijitTooltipAbove dijitTooltipABRight","BR-BL":"dijitTooltipRight","BL-BR":"dijitTooltipLeft"}[_628+"-"+_629];this.domNode.style.width="auto";var size=dojo.contentBox(this.domNode);var _62d=Math.min((Math.max(_62c,1)),size.w);var _62e=_62d<size.w;this.domNode.style.width=_62d+"px";if(_62e){this.containerNode.style.overflow="auto";var _62f=this.containerNode.scrollWidth;this.containerNode.style.overflow="visible";if(_62f>_62d){_62f=_62f+dojo.style(this.domNode,"paddingLeft")+dojo.style(this.domNode,"paddingRight");this.domNode.style.width=_62f+"px";}}if(_629.charAt(0)=="B"&&_628.charAt(0)=="B"){var mb=dojo.marginBox(node);var _630=this.connectorNode.offsetHeight;if(mb.h>_62a.h){var _631=_62a.h-(_62b.h/2)-(_630/2);this.connectorNode.style.top=_631+"px";this.connectorNode.style.bottom="";}else{this.connectorNode.style.bottom=Math.min(Math.max(_62b.h/2-_630/2,0),mb.h-_630)+"px";this.connectorNode.style.top="";}}else{this.connectorNode.style.top="";this.connectorNode.style.bottom="";}return Math.max(0,size.w-_62c);},_onShow:function(){if(dojo.isIE){this.domNode.style.filter="";}},hide:function(_632){if(this._onDeck&&this._onDeck[1]==_632){this._onDeck=null;}else{if(this.aroundNode===_632){this.fadeIn.stop();this.isShowingNow=false;this.aroundNode=null;this.fadeOut.play();}else{}}},_onHide:function(){this.domNode.style.cssText="";this.containerNode.innerHTML="";if(this._onDeck){this.show.apply(this,this._onDeck);this._onDeck=null;}}});dijit.showTooltip=function(_633,_634,_635,rtl){if(!dijit._masterTT){dijit._masterTT=new dijit._MasterTooltip();}return dijit._masterTT.show(_633,_634,_635,rtl);};dijit.hideTooltip=function(_636){if(!dijit._masterTT){dijit._masterTT=new dijit._MasterTooltip();}return dijit._masterTT.hide(_636);};dojo.declare("dijit.Tooltip",dijit._Widget,{label:"",showDelay:400,connectId:[],position:[],_setConnectIdAttr:function(_637){dojo.forEach(this._connections||[],function(_638){dojo.forEach(_638,dojo.hitch(this,"disconnect"));},this);var ary=dojo.isArrayLike(_637)?_637:(_637?[_637]:[]);this._connections=dojo.map(ary,function(id){var node=dojo.byId(id);return node?[this.connect(node,"onmouseenter","_onTargetMouseEnter"),this.connect(node,"onmouseleave","_onTargetMouseLeave"),this.connect(node,"onfocus","_onTargetFocus"),this.connect(node,"onblur","_onTargetBlur")]:[];},this);this._set("connectId",_637);this._connectIds=ary;},addTarget:function(node){var id=node.id||node;if(dojo.indexOf(this._connectIds,id)==-1){this.set("connectId",this._connectIds.concat(id));}},removeTarget:function(node){var id=node.id||node,idx=dojo.indexOf(this._connectIds,id);if(idx>=0){this._connectIds.splice(idx,1);this.set("connectId",this._connectIds);}},buildRendering:function(){this.inherited(arguments);dojo.addClass(this.domNode,"dijitTooltipData");},startup:function(){this.inherited(arguments);var ids=this.connectId;dojo.forEach(dojo.isArrayLike(ids)?ids:[ids],this.addTarget,this);},_onTargetMouseEnter:function(e){this._onHover(e);},_onTargetMouseLeave:function(e){this._onUnHover(e);},_onTargetFocus:function(e){this._focus=true;this._onHover(e);},_onTargetBlur:function(e){this._focus=false;this._onUnHover(e);},_onHover:function(e){if(!this._showTimer){var _639=e.target;this._showTimer=setTimeout(dojo.hitch(this,function(){this.open(_639);}),this.showDelay);}},_onUnHover:function(e){if(this._focus){return;}if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer;}this.close();},open:function(_63a){if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer;}dijit.showTooltip(this.label||this.domNode.innerHTML,_63a,this.position,!this.isLeftToRight());this._connectNode=_63a;this.onShow(_63a,this.position);},close:function(){if(this._connectNode){dijit.hideTooltip(this._connectNode);delete this._connectNode;this.onHide();}if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer;}},onShow:function(_63b,_63c){},onHide:function(){},uninitialize:function(){this.close();this.inherited(arguments);}});dijit.Tooltip.defaultPosition=["after","before"];}if(!dojo._hasResource["dojox.charting.action2d.Base"]){dojo._hasResource["dojox.charting.action2d.Base"]=true;dojo.provide("dojox.charting.action2d.Base");(function(){var _63d=400,_63e=dojo.fx.easing.backOut,df=dojox.lang.functional;dojo.declare("dojox.charting.action2d.Base",null,{overOutEvents:{onmouseover:1,onmouseout:1},constructor:function(_63f,plot,_640){this.chart=_63f;this.plot=plot||"default";this.anim={};if(!_640){_640={};}this.duration=_640.duration?_640.duration:_63d;this.easing=_640.easing?_640.easing:_63e;},connect:function(){this.handle=this.chart.connectToPlot(this.plot,this,"process");},disconnect:function(){if(this.handle){dojo.disconnect(this.handle);this.handle=null;}},reset:function(){},destroy:function(){this.disconnect();df.forIn(this.anim,function(o){df.forIn(o,function(anim){anim.action.stop(true);});});this.anim={};}});})();}if(!dojo._hasResource["dojox.lang.functional.scan"]){dojo._hasResource["dojox.lang.functional.scan"]=true;dojo.provide("dojox.lang.functional.scan");(function(){var d=dojo,df=dojox.lang.functional,_641={};d.mixin(df,{scanl:function(a,f,z,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var t,n,i;if(d.isArray(a)){t=new Array((n=a.length)+1);t[0]=z;for(i=0;i<n;z=f.call(o,z,a[i],i,a),t[++i]=z){}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){t=[z];for(i=0;a.hasNext();t.push(z=f.call(o,z,a.next(),i++,a))){}}else{t=[z];for(i in a){if(!(i in _641)){t.push(z=f.call(o,z,a[i],i,a));}}}}return t;},scanl1:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var t,n,z,_642=true;if(d.isArray(a)){t=new Array(n=a.length);t[0]=z=a[0];for(var i=1;i<n;t[i]=z=f.call(o,z,a[i],i,a),++i){}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){if(a.hasNext()){t=[z=a.next()];for(var i=1;a.hasNext();t.push(z=f.call(o,z,a.next(),i++,a))){}}}else{for(var i in a){if(!(i in _641)){if(_642){t=[z=a[i]];_642=false;}else{t.push(z=f.call(o,z,a[i],i,a));}}}}}return t;},scanr:function(a,f,z,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var n=a.length,t=new Array(n+1),i=n;t[n]=z;for(;i>0;--i,z=f.call(o,z,a[i],i,a),t[i]=z){}return t;},scanr1:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var n=a.length,t=new Array(n),z=a[n-1],i=n-1;t[i]=z;for(;i>0;--i,z=f.call(o,z,a[i],i,a),t[i]=z){}return t;}});})();}if(!dojo._hasResource["dojox.charting.action2d.Tooltip"]){dojo._hasResource["dojox.charting.action2d.Tooltip"]=true;dojo.provide("dojox.charting.action2d.Tooltip");(function(){var _643=function(o){var t=o.run&&o.run.data&&o.run.data[o.index];if(t&&typeof t!="number"&&(t.tooltip||t.text)){return t.tooltip||t.text;}if(o.element=="candlestick"){return "<table cellpadding=\"1\" cellspacing=\"0\" border=\"0\" style=\"font-size:0.9em;\">"+"<tr><td>Open:</td><td align=\"right\"><strong>"+o.data.open+"</strong></td></tr>"+"<tr><td>High:</td><td align=\"right\"><strong>"+o.data.high+"</strong></td></tr>"+"<tr><td>Low:</td><td align=\"right\"><strong>"+o.data.low+"</strong></td></tr>"+"<tr><td>Close:</td><td align=\"right\"><strong>"+o.data.close+"</strong></td></tr>"+(o.data.mid!==undefined?"<tr><td>Mid:</td><td align=\"right\"><strong>"+o.data.mid+"</strong></td></tr>":"")+"</table>";}return o.element=="bar"?o.x:o.y;};var df=dojox.lang.functional,m=dojox.gfx.matrix,pi4=Math.PI/4,pi2=Math.PI/2;dojo.declare("dojox.charting.action2d.Tooltip",dojox.charting.action2d.Base,{defaultParams:{text:_643},optionalParams:{},constructor:function(_644,plot,_645){this.text=_645&&_645.text?_645.text:_643;this.connect();},process:function(o){if(o.type==="onplotreset"||o.type==="onmouseout"){dijit.hideTooltip(this.aroundRect);this.aroundRect=null;if(o.type==="onplotreset"){delete this.angles;}return;}if(!o.shape||o.type!=="onmouseover"){return;}var _646={type:"rect"},_647=["after","before"];switch(o.element){case "marker":_646.x=o.cx;_646.y=o.cy;_646.width=_646.height=1;break;case "circle":_646.x=o.cx-o.cr;_646.y=o.cy-o.cr;_646.width=_646.height=2*o.cr;break;case "column":_647=["above","below"];case "bar":_646=dojo.clone(o.shape.getShape());break;case "candlestick":_646.x=o.x;_646.y=o.y;_646.width=o.width;_646.height=o.height;break;default:if(!this.angles){if(typeof o.run.data[0]=="number"){this.angles=df.map(df.scanl(o.run.data,"+",0),"* 2 * Math.PI / this",df.foldl(o.run.data,"+",0));}else{this.angles=df.map(df.scanl(o.run.data,"a + b.y",0),"* 2 * Math.PI / this",df.foldl(o.run.data,"a + b.y",0));}}var _648=m._degToRad(o.plot.opt.startAngle),_649=(this.angles[o.index]+this.angles[o.index+1])/2+_648;_646.x=o.cx+o.cr*Math.cos(_649);_646.y=o.cy+o.cr*Math.sin(_649);_646.width=_646.height=1;if(_649<pi4){}else{if(_649<pi2+pi4){_647=["below","above"];}else{if(_649<Math.PI+pi4){_647=["before","after"];}else{if(_649<2*Math.PI-pi4){_647=["above","below"];}}}}break;}var lt=dojo.coords(this.chart.node,true);_646.x+=lt.x;_646.y+=lt.y;_646.x=Math.round(_646.x);_646.y=Math.round(_646.y);_646.width=Math.ceil(_646.width);_646.height=Math.ceil(_646.height);this.aroundRect=_646;var _64a=this.text(o);if(_64a){dijit.showTooltip(_64a,this.aroundRect,_647);}}});})();}if(!dojo._hasResource["esri.dijit.Popup"]){dojo._hasResource["esri.dijit.Popup"]=true;dojo.provide("esri.dijit.Popup");(function(){var dc=dojox.charting,pk=dc.themes.PlotKit;pk.popup=pk.base.clone();pk.popup.chart.fill=pk.popup.plotarea.fill="#e7eef6";pk.popup.colors=["#284B70","#702828","#5F7143","#F6BC0C","#382C6C","#50224F","#1D7554","#4C4C4C","#0271AE","#706E41","#446A73","#0C3E69","#757575","#B7B7B7","#A3A3A3"];pk.popup.series.stroke.width=1;pk.popup.marker.stroke.width=1;}());dojo.declare("esri.dijit.Popup",[esri.InfoWindowBase,esri.PopupBase],{offsetX:3,offsetY:3,zoomFactor:4,marginLeft:10,marginTop:10,highlight:true,constructor:function(_64b,_64c){this.initialize();dojo.mixin(this,_64b);this.domNode=dojo.byId(_64c);var nls=this._nls=dojo.mixin({},esri.bundle.widgets.popup);var _64d=this.domNode;dojo.addClass(_64d,"esriPopup");var _64e="<div class='esriPopupWrapper' style='position: absolute;'>"+"<div class='sizer'>"+"<div class='titlePane'>"+"<div class='spinner hidden' title='"+nls.NLS_searching+"...'></div>"+"<div class='title'></div>"+"<div class='titleButton prev hidden' title='"+nls.NLS_prevFeature+"'></div>"+"<div class='titleButton next hidden' title='"+nls.NLS_nextFeature+"'></div>"+"<div class='titleButton maximize' title='"+nls.NLS_maximize+"'></div>"+"<div class='titleButton close' title='"+nls.NLS_close+"'></div>"+"</div>"+"</div>"+"<div class='sizer content'>"+"<div class='contentPane'>"+"</div>"+"</div>"+"<div class='sizer'>"+"<div class='actionsPane'>"+"<div class='actionList hidden'>"+"<a class='action zoomTo' href='javascript:void(0);'>"+nls.NLS_zoomTo+"</a>"+"</div>"+"</div>"+"</div>"+"<div class='pointer hidden'></div>"+"</div>"+"<div class='outerPointer hidden'></div>";dojo.attr(_64d,"innerHTML",_64e);this._sizers=dojo.query(".sizer",_64d);var _64f=dojo.query(".titlePane",_64d)[0];dojo.setSelectable(_64f,false);this._title=dojo.query(".title",_64f)[0];this._prevFeatureButton=dojo.query(".prev",_64f)[0];this._nextFeatureButton=dojo.query(".next",_64f)[0];this._maxButton=dojo.query(".maximize",_64f)[0];this._spinner=dojo.query(".spinner",_64f)[0];this._contentPane=dojo.query(".contentPane",_64d)[0];this._positioner=dojo.query(".esriPopupWrapper",_64d)[0];this._pointer=dojo.query(".pointer",_64d)[0];this._outerPointer=dojo.query(".outerPointer",_64d)[0];this._actionList=dojo.query(".actionsPane .actionList",_64d)[0];this._eventConnections=[dojo.connect(dojo.query(".close",_64f)[0],"onclick",this,this.hide),dojo.connect(this._prevFeatureButton,"onclick",this,this.selectPrevious),dojo.connect(this._nextFeatureButton,"onclick",this,this.selectNext),dojo.connect(this._maxButton,"onclick",this,this._toggleSize),dojo.connect(dojo.query(".zoomTo",this._actionList)[0],"onclick",this,this._zoomToFeature)];if(esri.isTouchEnabled){var _650=esri.setScrollable(this._contentPane);this._eventConnections.push(_650[0],_650[1]);}this._setVisibility(false);this.isShowing=false;},setMap:function(map){this.inherited(arguments);dojo.place(this.domNode,map.root);if(this.highlight){this.enableHighlight(map);}this._maxHeight=dojo.style(this._contentPane,"maxHeight");},unsetMap:function(){this.disableHighlight(this.map);this.inherited(arguments);},setTitle:function(_651){if(!esri._isDefined(_651)||_651===""){_651="&nbsp;";}this.destroyDijits(this._title);this.place(_651,this._title);if(this.isShowing){this.startupDijits(this._title);this.reposition();}},setContent:function(_652){if(!esri._isDefined(_652)||_652===""){_652="&nbsp;";}this.destroyDijits(this._contentPane);this.place(_652,this._contentPane);if(this.isShowing){this.startupDijits(this._contentPane);this.reposition();}},show:function(_653){if(!_653){this._setVisibility(true);this.isShowing=true;return;}var map=this.map,_654;if(_653.spatialReference){this._location=_653;_654=map.toScreen(_653);}else{this._location=map.toMap(_653);_654=_653;}var _655=map._getFrameWidth();if(_655!==-1){_654.x=_654.x%_655;if(_654.x<0){_654.x+=_655;}if(map.width>_655){var _656=(map.width-_655)/2;while(_654.x<_656){_654.x+=_655;}}}if(this._maximized){this.restore();}else{this._setPosition(_654);}if(!this.isShowing){this._setVisibility(true);this.isShowing=true;this.onShow();}},hide:function(){if(this.isShowing){this._setVisibility(false);this.isShowing=false;this.onHide();}},resize:function(_657,_658){this._sizers.style({width:_657+"px"});dojo.style(this._contentPane,"maxHeight",_658+"px");this._maxHeight=_658;if(this.isShowing){this.reposition();}},reposition:function(){if(this.map&&this._location&&!this._maximized&&this.isShowing){this._setPosition(this.map.toScreen(this._location));}},onShow:function(){this._followMap();this.startupDijits(this._title);this.startupDijits(this._contentPane);this.reposition();this.showHighlight();},onHide:function(){this._unfollowMap();this.hideHighlight();},maximize:function(){var map=this.map;if(!map||this._maximized){return;}this._maximized=true;var max=this._maxButton;dojo.removeClass(max,"maximize");dojo.addClass(max,"restore");dojo.attr(max,"title",this._nls.NLS_restore);var _659=this.marginLeft,_65a=this.marginTop,_65b=map.width-(2*_659),_65c=map.height-(2*_65a),_65d=this.domNode;dojo.style(_65d,{left:_659+"px",right:null,top:_65a+"px",bottom:null});dojo.style(this._positioner,{left:null,right:null,top:null,bottom:null});this._savedWidth=dojo.style(this._sizers[0],"width");this._savedHeight=dojo.style(this._contentPane,"maxHeight");this._sizers.style({width:_65b+"px"});dojo.style(this._contentPane,{maxHeight:(_65c-65)+"px",height:(_65c-65)+"px"});this._showPointer("");this._unfollowMap();dojo.addClass(this.domNode,"esriPopupMaximized");this.onMaximize();},restore:function(){var map=this.map;if(!map||!this._maximized){return;}this._maximized=false;var max=this._maxButton;dojo.removeClass(max,"restore");dojo.addClass(max,"maximize");dojo.attr(max,"title",this._nls.NLS_maximize);dojo.style(this._contentPane,"height",null);this.resize(this._savedWidth,this._savedHeight);this._savedWidth=this._savedHeight=null;this.show(this._location);this._followMap();dojo.removeClass(this.domNode,"esriPopupMaximized");this.onRestore();},destroy:function(){if(this.map){this.unsetMap();}this.cleanup();if(this.isShowing){this.hide();}this.destroyDijits(this._title);this.destroyDijits(this._content);dojo.forEach(this._eventConnections,dojo.disconnect);dojo.destroy(this.domNode);this._sizers=this._contentPane=this._actionList=this._positioner=this._pointer=this._outerPointer=this._title=this._prevFeatureButton=this._nextFeatureButton=this._spinner=this._eventConnections=this._pagerScope=this._targetLocation=this._nls=this._maxButton=null;},selectNext:function(){this.select(this.selectedIndex+1);},selectPrevious:function(){this.select(this.selectedIndex-1);},setFeatures:function(){this.inherited(arguments);this._updateUI();},onSetFeatures:function(){},onClearFeatures:function(){this.setTitle("&nbsp;");this.setContent("&nbsp;");this._setPagerCallbacks(this);this._updateUI();this.hideHighlight();},onSelectionChange:function(){var ptr=this.selectedIndex;this._updateUI();if(ptr>=0){this.setContent(this.features[ptr].getContent());this.updateHighlight(this.map,this.features[ptr]);if(this.isShowing){this.showHighlight();}}},onDfdComplete:function(){this._updateUI();},onMaximize:function(){},onRestore:function(){},_setVisibility:function(_65e){dojo.style(this.domNode,"visibility",_65e?"visible":"hidden");},_followMap:function(){this._unfollowMap();var map=this.map;this._handles=[dojo.connect(map,"onPanStart",this,this._onPanStart),dojo.connect(map,"onPan",this,this._onPan),dojo.connect(map,"onZoomStart",this,this._onZoomStart),dojo.connect(map,"onExtentChange",this,this._onExtentChange)];},_unfollowMap:function(){var _65f=this._handles;if(_65f){dojo.forEach(_65f,dojo.disconnect,dojo);this._handles=null;}},_onPanStart:function(){var _660=this.domNode.style;this._panOrigin={left:_660.left,top:_660.top,right:_660.right,bottom:_660.bottom};},_onPan:function(_661,_662){var _663=this._panOrigin,dx=_662.x,dy=_662.y,left=_663.left,top=_663.top,_664=_663.right,_665=_663.bottom;if(left){left=(parseFloat(left)+dx)+"px";}if(top){top=(parseFloat(top)+dy)+"px";}if(_664){_664=(parseFloat(_664)-dx)+"px";}if(_665){_665=(parseFloat(_665)-dy)+"px";}dojo.style(this.domNode,{left:left,top:top,right:_664,bottom:_665});},_onZoomStart:function(){this._setVisibility(false);},_onExtentChange:function(_666,_667,_668){if(_668){this._setVisibility(true);this.show(this._targetLocation||this._location);}this._targetLocation=null;},_toggleSize:function(){if(this._maximized){this.restore();}else{this.maximize();}},_setPosition:function(_669){var posX=_669.x,posY=_669.y,offX=this.offsetX||0,offY=this.offsetY||0,_66a=0,_66b=0,_66c=dojo.position(this.map.container,true),_66d=_66c.w,_66e=_66c.h,_66f="Left",_670="bottom",_671=dojo.contentBox(this._positioner),_672=_671.w/2,_673=_671.h/2,maxH=dojo.style(this._sizers[0],"height")+this._maxHeight+dojo.style(this._sizers[2],"height"),_674=maxH/2,xmin=0,ymin=0,xmax=_66d,ymax=_66e,_675=posX,_676=posY;var _677=dojo.getObject("dojo.window.getBox");if(_677){_677=_677();xmin=Math.max(_677.l,_66c.x);xmax=Math.min(_677.l+_677.w,_66c.x+_66c.w);ymin=Math.max(_677.t,_66c.y);ymax=Math.min(_677.t+_677.h,_66c.y+_66c.h);_675+=_66c.x;_676+=_66c.y;}if(((_676-ymin)>_674)&&((ymax-_676)>=_674)){if((xmax-_675)>=_671.w){_670="";_66f="Left";}else{if((_675-xmin)>=_671.w){_670="";_66f="Right";}}}if(_66f&&_670){if(((_675-xmin)>_672)&&((xmax-_675)>=_672)){if((_676-ymin)>=maxH){_66f="";_670="bottom";}else{if((ymax-_676)>=maxH){_66f="";_670="top";}}}}if(_66f&&_670){if(_675<=xmax/2){_66f="Left";}else{if(_675<=xmax){_66f="Right";}}if(_676<=ymax/2){_670="top";}else{if(_676<=ymax){_670="bottom";}}}var _678=_670+_66f;switch(_678){case "top":case "bottom":_66b=14;break;case "Left":case "Right":_66a=13;break;case "topLeft":case "topRight":case "bottomLeft":case "bottomRight":_66b=45;break;}dojo.style(this.domNode,{left:posX+"px",top:posY+"px",right:null,bottom:null});var _679={left:null,right:null,top:null,bottom:null};if(_66f){_679[_66f.toLowerCase()]=(_66a+offX)+"px";}else{_679.left=(-_672)+"px";}if(_670){_679[_670]=(_66b+offY)+"px";}else{_679.top=(-_673)+"px";}dojo.style(this._positioner,_679);this._showPointer(_678);},_showPointer:function(_67a){dojo.removeClass(this._pointer,["top","bottom","right","left","topLeft","topRight","bottomRight","bottomLeft","hidden"]);dojo.removeClass(this._outerPointer,["right","left","hidden"]);if(_67a==="Right"||_67a==="Left"){_67a=_67a.toLowerCase();dojo.addClass(this._outerPointer,_67a);}else{dojo.addClass(this._pointer,_67a);}},_setPagerCallbacks:function(_67b,_67c,_67d){if(_67b===this&&(!this._pagerScope||this._pagerScope===this)){return;}if(_67b===this._pagerScope){return;}this._pagerScope=_67b;if(_67b===this){_67c=this.selectPrevious;_67d=this.selectNext;}var _67e=this._eventConnections;dojo.disconnect(_67e[1]);dojo.disconnect(_67e[2]);if(_67c){_67e[1]=dojo.connect(this._prevFeatureButton,"onclick",_67b,_67c);}if(_67d){_67e[2]=dojo.connect(this._nextFeatureButton,"onclick",_67b,_67d);}},_zoomToFeature:function(){var _67f=this.features,ptr=this.selectedIndex,map=this.map;if(_67f){var _680=_67f[ptr].geometry,_681,_682,_683=0,_684;if(_680){switch(_680.type){case "point":_681=_680;break;case "multipoint":_681=_680.getPoint(0);_682=_680.getExtent();break;case "polyline":_681=_680.getPoint(0,0);_682=_680.getExtent();if(map._getFrameWidth()!==-1){dojo.forEach(_680.paths,function(path){var _685={"paths":[path,map.spatialReference]},_686=new esri.geometry.Polyline(_685),_687=_686.getExtent(),_688=Math.abs(_687.ymax-_687.ymin),_689=Math.abs(_687.xmax-_687.xmin),_68a=(_689>_688)?_689:_688;if(_68a>_683){_683=_68a;_684=_687;}});_684.spatialReference=_682.spatialReference;_682=_684;}break;case "polygon":_681=_680.getPoint(0,0);_682=_680.getExtent();if(map._getFrameWidth()!==-1){dojo.forEach(_680.rings,function(ring){var _68b={"rings":[ring,map.spatialReference]},_68c=new esri.geometry.Polygon(_68b),_68d=_68c.getExtent(),_68e=Math.abs(_68d.ymax-_68d.ymin),_68f=Math.abs(_68d.xmax-_68d.xmin),_690=(_68f>_68e)?_68f:_68e;if(_690>_683){_683=_690;_684=_68d;}});_684.spatialReference=_682.spatialReference;_682=_684;}break;}}if(!_681){_681=this._location;}if(!_682||!_682.intersects(this._location)){this._location=_681;}if(_682){map.setExtent(_682,true);}else{var _691=map.getNumLevels(),_692=map.getLevel(),last=_691-1,_693=this.zoomFactor||1;if(_691>0){if(_692===last){return;}var _694=_692+_693;if(_694>last){_694=last;}map._scrollZoomHandler({value:(_694-_692),mapPoint:_681},true);}else{map._scrollZoomHandler({value:(1/Math.pow(2,_693))*2,mapPoint:_681},true);}}}},_updateUI:function(){var _695="&nbsp;",ptr=this.selectedIndex,_696=this.features,_697=this.deferreds,prev=this._prevFeatureButton,next=this._nextFeatureButton,_698=this._spinner,_699=this._actionList,nls=this._nls;if(_696&&_696.length>1){if(nls.NLS_pagingInfo){_695=esri.substitute({index:(ptr+1),total:_696.length},nls.NLS_pagingInfo);}if(ptr===0){dojo.addClass(prev,"hidden");}else{dojo.removeClass(prev,"hidden");}if(ptr===_696.length-1){dojo.addClass(next,"hidden");}else{dojo.removeClass(next,"hidden");}}else{dojo.addClass(prev,"hidden");dojo.addClass(next,"hidden");}this.setTitle(_695);if(_697&&_697.length){if(_696){dojo.removeClass(_698,"hidden");}else{this.setContent("<div style='text-align: center;'>"+nls.NLS_searching+"...</div>");}}else{dojo.addClass(_698,"hidden");if(!_696||!_696.length){this.setContent("<div style='text-align: center;'>"+nls.NLS_noInfo+".</div>");}}if(_696&&_696.length){dojo.removeClass(_699,"hidden");}else{dojo.addClass(_699,"hidden");}}});dojo.declare("esri.dijit.PopupTemplate",[esri.PopupInfoTemplate],{chartTheme:"dojox.charting.themes.PlotKit.popup",constructor:function(json,_69a){dojo.mixin(this,_69a);this.initialize(json);this._nls=dojo.mixin({},esri.bundle.widgets.popup);},getTitle:function(_69b){return this.info?this.getComponents(_69b).title:"";},getContent:function(_69c){return this.info?new esri.dijit._PopupRenderer({template:this,graphic:_69c,chartTheme:this.chartTheme,_nls:this._nls},dojo.create("div")).domNode:"";}});dojo.declare("esri.dijit._PopupRenderer",[dijit._Widget,dijit._Templated],{templateString:"<div class='esriViewPopup'>"+"<div class='mainSection'>"+"<div class='header' dojoAttachPoint='_title'></div>"+"<div class='hzLine'></div>"+"<div dojoAttachPoint='_description'></div>"+"<div class='break'></div>"+"</div>"+"<div class='attachmentsSection hidden'>"+"<div>${_nls.NLS_attach}:</div>"+"<ul dojoAttachPoint='_attachmentsList'>"+"</ul>"+"<div class='break'></div>"+"</div>"+"<div class='mediaSection hidden'>"+"<div class='header' dojoAttachPoint='_mediaTitle'></div>"+"<div class='hzLine'></div>"+"<div class='caption' dojoAttachPoint='_mediaCaption'></div>"+"<div class='gallery' dojoAttachPoint='_gallery'>"+"<div class='mediaHandle prev' dojoAttachPoint='_prevMedia' dojoAttachEvent='onclick: _goToPrevMedia'></div>"+"<div class='mediaHandle next' dojoAttachPoint='_nextMedia' dojoAttachEvent='onclick: _goToNextMedia'></div>"+"<ul class='summary'>"+"<li class='image mediaCount hidden' dojoAttachPoint='_imageCount'>0</li>"+"<li class='image mediaIcon hidden'></li>"+"<li class='chart mediaCount hidden' dojoAttachPoint='_chartCount'>0</li>"+"<li class='chart mediaIcon hidden'></li>"+"</ul>"+"<div class='frame' dojoAttachPoint='_mediaFrame'></div>"+"</div>"+"</div>"+"<div class='editSummarySection hidden' dojoAttachPoint='_editSummarySection'>"+"<div class='break'></div>"+"<div class='break hidden' dojoAttachPoint='_mediaBreak'></div>"+"<div class='editSummary' dojoAttachPoint='_editSummary'></div>"+"</div>"+"</div>",startup:function(){this.inherited(arguments);var _69d=this.template,_69e=this.graphic,_69f=_69d.getComponents(_69e),_6a0=_69f.title,_6a1=_69f.description,_6a2=_69f.fields,_6a3=_69f.mediaInfos,_6a4=this.domNode,nls=this._nls;this._prevMedia.title=nls.NLS_prevMedia;this._nextMedia.title=nls.NLS_nextMedia;dojo.attr(this._title,"innerHTML",_6a0);if(!_6a0){dojo.addClass(this._title,"hidden");}if(!_6a1&&_6a2){_6a1="";dojo.forEach(_6a2,function(row){_6a1+=("<tr valign='top'>");_6a1+=("<td class='attrName'>"+row[0]+"</td>");_6a1+=("<td class='attrValue'>"+row[1].replace(/^\s*(https?:\/\/[^\s]+)\s*$/i,"<a target='_blank' href='$1' title='$1'>More info</a>")+"</td>");_6a1+=("</tr>");});if(_6a1){_6a1="<table class='attrTable' cellpadding='0px' cellspacing='0px'>"+_6a1+"</table>";}}dojo.attr(this._description,"innerHTML",_6a1);if(!_6a1){dojo.addClass(this._description,"hidden");}dojo.query("a",this._description).forEach(function(node){dojo.attr(node,"target","_blank");});if(_6a0&&_6a1){dojo.query(".mainSection .hzLine",_6a4).removeClass("hidden");}else{if(_6a0||_6a1){dojo.query(".mainSection .hzLine",_6a4).addClass("hidden");}else{dojo.query(".mainSection",_6a4).addClass("hidden");}}var dfd=(this._dfd=_69d.getAttachments(_69e));if(dfd){dfd.addBoth(dojo.hitch(this,this._attListHandler,dfd));dojo.attr(this._attachmentsList,"innerHTML","<li>"+nls.NLS_searching+"...</li>");dojo.query(".attachmentsSection",_6a4).removeClass("hidden");}if(_6a3&&_6a3.length){dojo.query(".mediaSection",_6a4).removeClass("hidden");dojo.setSelectable(this._mediaFrame,false);this._mediaInfos=_6a3;this._mediaPtr=0;this._updateUI();this._displayMedia();}if(_69f.editSummary){dojo.attr(this._editSummary,"innerHTML",_69f.editSummary);if(_6a3&&_6a3.length){dojo.removeClass(this._mediaBreak,"hidden");}dojo.removeClass(this._editSummarySection,"hidden");}},destroy:function(){if(this._dfd){this._dfd.cancel();}this._destroyFrame();this.template=this.graphic=this._nls=this._mediaInfos=this._mediaPtr=this._dfd=null;this.inherited(arguments);},_goToPrevMedia:function(){var ptr=this._mediaPtr-1;if(ptr<0){return;}this._mediaPtr--;this._updateUI();this._displayMedia();},_goToNextMedia:function(){var ptr=this._mediaPtr+1;if(ptr===this._mediaInfos.length){return;}this._mediaPtr++;this._updateUI();this._displayMedia();},_updateUI:function(){var _6a5=this._mediaInfos,_6a6=_6a5.length,_6a7=this.domNode,_6a8=this._prevMedia,_6a9=this._nextMedia;if(_6a6>1){var _6aa=0,_6ab=0;dojo.forEach(_6a5,function(info){if(info.type==="image"){_6aa++;}else{if(info.type.indexOf("chart")!==-1){_6ab++;}}});if(_6aa){dojo.attr(this._imageCount,"innerHTML",_6aa);dojo.query(".summary .image",_6a7).removeClass("hidden");}if(_6ab){dojo.attr(this._chartCount,"innerHTML",_6ab);dojo.query(".summary .chart",_6a7).removeClass("hidden");}}else{dojo.query(".summary",_6a7).addClass("hidden");dojo.addClass(_6a8,"hidden");dojo.addClass(_6a9,"hidden");}var ptr=this._mediaPtr;if(ptr===0){dojo.addClass(_6a8,"hidden");}else{dojo.removeClass(_6a8,"hidden");}if(ptr===_6a6-1){dojo.addClass(_6a9,"hidden");}else{dojo.removeClass(_6a9,"hidden");}this._destroyFrame();},_displayMedia:function(){var info=this._mediaInfos[this._mediaPtr],_6ac=info.title,_6ad=info.caption,_6ae=dojo.query(".mediaSection .hzLine",this.domNode)[0];dojo.attr(this._mediaTitle,"innerHTML",_6ac);dojo[_6ac?"removeClass":"addClass"](this._mediaTitle,"hidden");dojo.attr(this._mediaCaption,"innerHTML",_6ad);dojo[_6ad?"removeClass":"addClass"](this._mediaCaption,"hidden");dojo[(_6ac&&_6ad)?"removeClass":"addClass"](_6ae,"hidden");if(info.type==="image"){this._showImage(info.value);}else{this._showChart(info.type,info.value);}},_showImage:function(_6af){dojo.addClass(this._mediaFrame,"image");var _6b0=dojo.style(this._gallery,"height"),html="<img src='"+_6af.sourceURL+"' onload='esri.dijit._PopupRenderer.prototype._imageLoaded(this,"+_6b0+");' />";if(_6af.linkURL){html="<a target='_blank' href='"+_6af.linkURL+"'>"+html+"</a>";}dojo.attr(this._mediaFrame,"innerHTML",html);},_showChart:function(type,_6b1){dojo.removeClass(this._mediaFrame,"image");var _6b2=this._chart=new dojox.charting.Chart2D(dojo.create("div",{"class":"chart"},this._mediaFrame),{margins:{l:4,t:4,r:4,b:4}});var _6b3=_6b1.theme||this.chartTheme||"PlotKit.popup";_6b2.setTheme(dojo.getObject(_6b3)||dojo.getObject("dojox.charting.themes."+_6b3));switch(type){case "piechart":_6b2.addPlot("default",{type:"Pie",labels:false});_6b2.addSeries("Series A",_6b1.fields);break;case "linechart":_6b2.addPlot("default",{type:"Markers"});_6b2.addAxis("x",{min:0,majorTicks:false,minorTicks:false,majorLabels:false,minorLabels:false});_6b2.addAxis("y",{includeZero:true,vertical:true,fixUpper:"minor"});dojo.forEach(_6b1.fields,function(info,idx){info.x=idx+1;});_6b2.addSeries("Series A",_6b1.fields);break;case "columnchart":_6b2.addPlot("default",{type:"Columns",gap:3});_6b2.addAxis("y",{includeZero:true,vertical:true,fixUpper:"minor"});_6b2.addSeries("Series A",_6b1.fields);break;case "barchart":_6b2.addPlot("default",{type:"Bars",gap:3});_6b2.addAxis("x",{includeZero:true,fixUpper:"minor",minorLabels:false});_6b2.addAxis("y",{vertical:true,majorTicks:false,minorTicks:false,majorLabels:false,minorLabels:false});_6b2.addSeries("Series A",_6b1.fields);break;}this._action=new dojox.charting.action2d.Tooltip(_6b2);_6b2.render();},_destroyFrame:function(){if(this._chart){this._chart.destroy();this._chart=null;}if(this._action){this._action.destroy();this._action=null;}dojo.attr(this._mediaFrame,"innerHTML","");},_imageLoaded:function(img,_6b4){var _6b5=img.height;if(_6b5<_6b4){var diff=Math.round((_6b4-_6b5)/2);dojo.style(img,"marginTop",diff+"px");}},_attListHandler:function(dfd,_6b6){if(dfd===this._dfd){this._dfd=null;var html="";if(!(_6b6 instanceof Error)&&_6b6&&_6b6.length){dojo.forEach(_6b6,function(info){html+=("<li>");html+=("<a href='"+info.url+"' target='_blank'>"+(info.name||"[No name]")+"</a>");html+=("</li>");});}dojo.attr(this._attachmentsList,"innerHTML",html||"<li>"+this._nls.NLS_noAttach+"</li>");}}});}if(!dojo._hasResource["esri.layers.KMLLayer"]){dojo._hasResource["esri.layers.KMLLayer"]=true;dojo.provide("esri.layers.KMLLayer");dojo.declare("esri.layers.KMLLayer",[esri.layers.Layer],{serviceUrl:"http://utility.arcgis.com/sharing/kml",constructor:function(url,_6b7){if(!url){console.log("KMLLayer:constructor - please provide url for the KML file");}this._outSR=(_6b7&&_6b7.outSR)||new esri.SpatialReference({wkid:4326});this._options=_6b7;if(esri.config.defaults.kmlService){this.serviceUrl=esri.config.defaults.kmlService;}var link=(this.linkInfo=_6b7&&_6b7.linkInfo);if(link){this.visible=!!link.visibility;this._waitingForMap=!!link.viewFormat;}if(!link||(link&&link.visibility&&!this._waitingForMap)){this._parseKml();}this.refresh=dojo.hitch(this,this.refresh);},getFeature:function(_6b8){if(!_6b8){return;}var type=_6b8.type,id=_6b8.id,_6b9,i,len;switch(type){case "esriGeometryPoint":case "esriGeometryPolyline":case "esriGeometryPolygon":var _6ba=this["_"+type];if(_6ba){_6b9=dojo.getObject("_mode._featureMap."+id,false,_6ba);}break;case "GroundOverlay":var _6bb=this._groundLyr;if(_6bb){var _6bc=_6bb.getImages();len=_6bc.length;for(i=0;i<len;i++){if(_6bc[i].id===id){_6b9=_6bc[i];break;}}}break;case "ScreenOverlay":break;case "NetworkLink":dojo.some(this._links,function(link){if(link.linkInfo&&link.linkInfo.id===id){_6b9=link;return true;}else{return false;}});break;case "Folder":var _6bd=this.folders;len=_6bd?_6bd.length:0;for(i=0;i<len;i++){if(_6bd[i].id===id){_6b9=_6bd[i];break;}}break;default:console.log("KMLLayer:getFeature - unknown feature type");break;}return _6b9;},getLayers:function(){var _6be=[];if(this._groundLyr){_6be.push(this._groundLyr);}if(this._fLayers){_6be=_6be.concat(this._fLayers);}if(this._links){dojo.forEach(this._links,function(link){if(link.declaredClass){_6be.push(link);}});}return _6be;},setFolderVisibility:function(_6bf,_6c0){if(!_6bf){return;}this._fireUpdateStart();_6bf.visible=_6c0;if(_6c0){_6c0=this._areLocalAncestorsVisible(_6bf);}this._setState(_6bf,_6c0);this._fireUpdateEnd();},onRefresh:function(){},_parseKml:function(map){var self=this;this._fireUpdateStart();this._io=esri.request({url:this.serviceUrl,content:{url:this._url.path+this._getQueryParameters(map),model:"simple",folders:"",refresh:this.loaded?true:undefined,outSR:dojo.toJson(this._outSR.toJson())},callbackParamName:"callback",load:function(_6c1){self._io=null;self._initLayer(_6c1);},error:function(err){self._io=null;err=dojo.mixin(new Error(),err);err.message="Unable to load KML: "+self.url+" "+(err.message||"");self._fireUpdateEnd(err);self.onError(err);}});},_initLayer:function(json){if(this.loaded){this._removeInternalLayers();}this.name=json.name;this.description=json.description;this.snippet=json.snippet;this.visibility=json.visibility;this.featureInfos=json.featureInfos;var i,len;var _6c2=(this.folders=json.folders),_6c3=[],fldr;if(_6c2){len=_6c2.length;for(i=0;i<len;i++){fldr=(_6c2[i]=new esri.layers.KMLFolder(_6c2[i]));if(fldr.parentFolderId===-1){_6c3.push(fldr);}}}var _6c4=(this._links=json.networkLinks),_6c5;len=_6c4?_6c4.length:0;for(i=0;i<len;i++){if(_6c4[i].viewRefreshMode&&_6c4[i].viewRefreshMode.toLowerCase().indexOf("onregion")!==-1){continue;}_6c5=dojo.mixin({},this._options);_6c5.linkInfo=_6c4[i];if(_6c5.id){_6c5.id=_6c5.id+"_"+i;}_6c4[i]=new esri.layers.KMLLayer(_6c4[i].href,_6c5);_6c4[i]._parentLayer=this;_6c4[i]._parentFolderId=this._getLinkParentId(_6c4[i].linkInfo.id);}var _6c6=json.groundOverlays;if(_6c6&&_6c6.length>0){_6c5=dojo.mixin({},this._options);if(_6c5.id){_6c5.id=_6c5.id+"_"+"mapImage";}var _6c7=(this._groundLyr=new esri.layers.MapImageLayer(_6c5));len=_6c6.length;for(i=0;i<len;i++){_6c7.addImage(new esri.layers.KMLGroundOverlay(_6c6[i]));}}var _6c8=dojo.getObject("featureCollection.layers",false,json);if(_6c8&&_6c8.length>0){this._fLayers=[];dojo.forEach(_6c8,function(_6c9,i){var _6ca=dojo.getObject("featureSet.features",false,_6c9),_6cb;if(_6ca&&_6ca.length>0){_6c5=dojo.mixin({outFields:["*"],infoTemplate:_6c9.popupInfo?new esri.dijit.PopupTemplate(_6c9.popupInfo):null,editable:false},this._options);if(_6c5.id){_6c5.id=_6c5.id+"_"+i;}_6c9.layerDefinition.capabilities="Query,Data";_6cb=new esri.layers.FeatureLayer(_6c9,_6c5);if(_6cb.geometryType){this["_"+_6cb.geometryType]=_6cb;}this._fLayers.push(_6cb);}},this);if(this._fLayers.length===0){delete this._fLayers;}}len=_6c3.length;for(i=0;i<len;i++){fldr=_6c3[i];this._setState(fldr,fldr.visible);}this._fireUpdateEnd();if(this.loaded){this._addInternalLayers();this.onRefresh();}else{this.loaded=true;this.onLoad(this);}},_addInternalLayers:function(){var map=this._map;this._fireUpdateStart();if(this._links){dojo.forEach(this._links,function(link){if(link.declaredClass){map.addLayer(link);if(link._waitingForMap){link._waitingForMap=null;if(link.visible){link._parseKml(map);}else{link._wMap=map;}}}});}var _6cc=map.spatialReference,_6cd=this._outSR,_6ce,_6cf;if(_6cc.wkid){_6ce=(_6cc._isWebMercator()&&_6cd._isWebMercator())||(_6cc.wkid===_6cd.wkid);}else{if(_6cc.wkt){_6ce=(_6cc.wkt===_6cd.wkt);}else{console.log("KMLLayer:_setMap - map has invalid spatial reference");return;}}if(!_6ce){if(_6cc._isWebMercator()&&_6cd.wkid===4326){_6cf=esri.geometry.geographicToWebMercator;}else{if(_6cd._isWebMercator()&&_6cc.wkid===4326){_6cf=esri.geometry.webMercatorToGeographic;}else{console.log("KMLLayer:_setMap - unsupported workflow. Spatial reference of the map and kml layer do not match, and the conversion cannot be done on the client.");return;}}}if(this._groundLyr){if(_6cf){dojo.forEach(this._groundLyr.getImages(),function(_6d0){_6d0.extent=_6cf(_6d0.extent);});}map.addLayer(this._groundLyr);}var _6d1=this._fLayers;if(_6d1&&_6d1.length>0){dojo.forEach(_6d1,function(_6d2){if(_6cf){var _6d3=_6d2.graphics,i,geom,len=_6d3?_6d3.length:0;for(i=0;i<len;i++){geom=_6d3[i].geometry;if(geom){_6d3[i].setGeometry(_6cf(geom));}}}map.addLayer(_6d2);});}this.onVisibilityChange(this.visible);},_removeInternalLayers:function(){var map=this._map;if(this._links){dojo.forEach(this._links,function(link){if(link.declaredClass&&link._io){link._io.cancel();}});}if(map){dojo.forEach(this.getLayers(),map.removeLayer,map);}},_setState:function(_6d4,_6d5){var _6d6=_6d4.featureInfos,info,_6d7,i,len=_6d6?_6d6.length:0,_6d8=_6d5?"show":"hide";for(i=0;i<len;i++){info=_6d6[i];_6d7=this.getFeature(info);if(!_6d7){continue;}if(info.type==="Folder"){this._setState(_6d7,_6d5&&_6d7.visible);}else{if(info.type==="NetworkLink"){this._setInternalVisibility(_6d7,_6d5);}else{_6d7[_6d8]();}}}},_areLocalAncestorsVisible:function(_6d9){var _6da=_6d9.parentFolderId,_6db=_6d9.visible;while(_6db&&_6da!==-1){var _6dc=this.getFeature({type:"Folder",id:_6da});_6db=_6db&&_6dc.visible;_6da=_6dc.parentFolderId;}return _6db;},_setInternalVisibility:function(_6dd,_6de){var _6df=_6dd._parentLayer,_6e0=_6dd._parentFolderId;_6de=_6de&&_6dd.visible;while(_6de&&_6df){_6de=_6de&&_6df.visible;if(_6e0>-1){_6de=_6de&&_6df._areLocalAncestorsVisible(_6df.getFeature({type:"Folder",id:_6e0}));}_6e0=_6df._parentFolderId;_6df=_6df._parentLayer;}this._setIntState(_6dd,_6de);},_setIntState:function(link,_6e1){if(!link){return;}dojo.forEach(link.getLayers(),function(_6e2){if(_6e2.linkInfo){link._setIntState(_6e2,_6e1&&_6e2.visible&&link._areLocalAncestorsVisible(link.getFeature({type:"Folder",id:_6e2._parentFolderId})));}else{_6e2.setVisibility(_6e1);}});},_getLinkParentId:function(id){var _6e3=-1;if(this.folders){dojo.some(this.folders,function(_6e4){if(_6e4.networkLinkIds&&dojo.indexOf(_6e4.networkLinkIds,id)!==-1){_6e3=_6e4.id;return true;}return false;});}return _6e3;},_checkAutoRefresh:function(){var _6e5=this.linkInfo;if(_6e5){if(this.visible){if(this.loaded&&this._map){var _6e6=_6e5.refreshMode,_6e7=_6e5.refreshInterval,_6e8=_6e5.viewRefreshMode,_6e9=_6e5.viewRefreshTime;if(_6e6&&_6e6.toLowerCase().indexOf("oninterval")!==-1&&_6e7>0){this._stopAutoRefresh();this._timeoutHandle=setTimeout(this.refresh,_6e7*1000);}if(_6e8&&_6e8.toLowerCase().indexOf("onstop")!==-1&&_6e9>0){if(!this._extChgHandle){this._extChgHandle=dojo.connect(this._map,"onExtentChange",this,this._extentChanged);}}}}else{this._stopAutoRefresh();dojo.disconnect(this._extChgHandle);delete this._extChgHandle;}}},_stopAutoRefresh:function(){clearTimeout(this._timeoutHandle);this._timeoutHandle=null;},_getQueryParameters:function(map){map=map||this._map;var _6ea={},_6eb=this.linkInfo,_6ec=map&&map.extent;if(this._url.query){dojo.mixin(_6ea,this._url.query);}if(_6eb){var _6ed=_6eb.viewFormat,_6ee=_6eb.httpQuery,_6ef=_6eb.viewBoundScale;if(_6ec&&_6ed){var _6f0=_6ec,_6f1=_6ec,sr=_6ec.spatialReference;if(sr){if(sr._isWebMercator()){_6f0=esri.geometry.webMercatorToGeographic(_6ec);}else{if(sr.wkid===4326){_6f1=esri.geometry.geographicToWebMercator(_6ec);}}}var _6f2=_6f0.getCenter(),_6f3=Math.max(_6f1.getWidth(),_6f1.getHeight());if(_6ef){_6f0=_6f0.expand(_6ef);}_6ed=_6ed.replace(/\[bboxWest\]/ig,_6f0.xmin).replace(/\[bboxEast\]/ig,_6f0.xmax).replace(/\[bboxSouth\]/ig,_6f0.ymin).replace(/\[bboxNorth\]/ig,_6f0.ymax).replace(/\[lookatLon\]/ig,_6f2.x).replace(/\[lookatLat\]/ig,_6f2.y).replace(/\[lookatRange\]/ig,_6f3).replace(/\[lookatTilt\]/ig,0).replace(/\[lookatHeading\]/ig,0).replace(/\[lookatTerrainLon\]/ig,_6f2.x).replace(/\[lookatTerrainLat\]/ig,_6f2.y).replace(/\[lookatTerrainAlt\]/ig,0).replace(/\[cameraLon\]/ig,_6f2.x).replace(/\[cameraLat\]/ig,_6f2.y).replace(/\[cameraAlt\]/ig,_6f3).replace(/\[horizFov\]/ig,60).replace(/\[vertFov\]/ig,60).replace(/\[horizPixels\]/ig,map.width).replace(/\[vertPixels\]/ig,map.height).replace(/\[terrainEnabled\]/ig,0);dojo.mixin(_6ea,dojo.queryToObject(_6ed));}if(_6ee){_6ee=_6ee.replace(/\[clientVersion\]/ig,esri.version).replace(/\[kmlVersion\]/ig,2.2).replace(/\[clientName\]/ig,"ArcGIS API for JavaScript").replace(/\[language\]/ig,dojo.locale);dojo.mixin(_6ea,dojo.queryToObject(_6ee));}}var _6f4=[],_6f5;for(_6f5 in _6ea){if(esri._isDefined(_6ea[_6f5])){_6f4.push(_6f5+"="+_6ea[_6f5]);}}_6f4=_6f4.join("&");return _6f4?("?"+_6f4):"";},_setMap:function(map,_6f6){this._map=map;var div=this._div=dojo.create("div",null,_6f6);dojo.style(div,"position","absolute");this._addInternalLayers();return div;},_unsetMap:function(map,_6f7){if(this._io){this._io.cancel();}this._stopAutoRefresh();dojo.disconnect(this._extChgHandle);delete this._extChgHandle;this._removeInternalLayers();var div=this._div;if(div){_6f7.removeChild(div);dojo.destroy(div);}this._map=this._wMap=this._div=null;},onVisibilityChange:function(_6f8){if(!this.loaded){if(this.linkInfo&&_6f8){if(!this._waitingForMap){this._parseKml(this._wMap);}}return;}this._fireUpdateStart();this._setInternalVisibility(this,_6f8);this._checkAutoRefresh();this._fireUpdateEnd();},refresh:function(){if(!this.loaded||!this._map||this._io){return;}this._parseKml();},_extentChanged:function(){this._stopAutoRefresh();this._timeoutHandle=setTimeout(this.refresh,this.linkInfo.viewRefreshTime*1000);}});dojo.declare("esri.layers.KMLGroundOverlay",[esri.layers.MapImage],{constructor:function(json){if(esri._isDefined(this.visibility)){this.visible=!!this.visibility;}}});dojo.declare("esri.layers.KMLFolder",null,{constructor:function(json){dojo.mixin(this,json);if(esri._isDefined(this.visibility)){this.visible=!!this.visibility;}}});}if(!dojo._hasResource["esri.layers.wms"]){dojo._hasResource["esri.layers.wms"]=true;dojo.provide("esri.layers.wms");dojo.declare("esri.layers.WMSLayer",[esri.layers.DynamicMapServiceLayer],{_CRS_TO_EPSG:{84:4326,83:4269,27:4267},_REVERSED_LAT_LONG_RANGES:[[4001,4999],[2044,2045],[2081,2083],[2085,2086],[2093,2093],[2096,2098],[2105,2132],[2169,2170],[2176,2180],[2193,2193],[2200,2200],[2206,2212],[2319,2319],[2320,2462],[2523,2549],[2551,2735],[2738,2758],[2935,2941],[2953,2953],[3006,3030],[3034,3035],[3058,3059],[3068,3068],[3114,3118],[3126,3138],[3300,3301],[3328,3335],[3346,3346],[3350,3352],[3366,3366],[3416,3416],[20004,20032],[20064,20092],[21413,21423],[21473,21483],[21896,21899],[22171,22177],[22181,22187],[22191,22197],[25884,25884],[27205,27232],[27391,27398],[27492,27492],[28402,28432],[28462,28492],[30161,30179],[30800,30800],[31251,31259],[31275,31279],[31281,31290],[31466,31700]],_WEB_MERCATOR:[102100,3857,102113,900913],_WORLD_MERCATOR:[3395,54004],allExtents:[],constructor:function(url,_6f9){url=this._stripParameters(url,["version","service","request","bbox","format","height","width","layers","srs","crs","styles","transparent","bgcolor","exceptions","time","elevation","sld","wfs"]);this.url=url;this._url=esri.urlToObject(url);this._getCapabilitiesURL=url;this._initLayer=dojo.hitch(this,this._initLayer);this._parseCapabilities=dojo.hitch(this,this._parseCapabilities);this._getCapabilitiesError=dojo.hitch(this,this._getCapabilitiesError);if(_6f9){this.imageFormat=this._getImageFormat(_6f9.format);this.imageTransparency=(_6f9.transparent===false)?false:true;this.visibleLayers=_6f9.visibleLayers?_6f9.visibleLayers:[];if(_6f9.resourceInfo){this._readResourceInfo(_6f9.resourceInfo);}else{this._getCapabilities();}}else{this.imageFormat="image/png";this.imageTransparency=true;this.visibleLayers=[];this._getCapabilities();}this._blankImageURL=dojo.moduleUrl("esri","../../images/pixel.png").uri;},setVisibleLayers:function(_6fa){_6fa=this._checkVisibleLayersList(_6fa);this.visibleLayers=(_6fa)?_6fa:[];this.refresh(true);},setImageFormat:function(_6fb){this.imageFormat=this._getImageFormat(_6fb);this.refresh(true);},setImageTransparency:function(_6fc){this.imageTransparency=_6fc;this.refresh(true);},getImageUrl:function(_6fd,_6fe,_6ff,_700){if(!this.visibleLayers||this.visibleLayers.length===0){_700(this._blankImageURL);return;}var wkid=_6fd.spatialReference.wkid;if(dojo.some(this._WEB_MERCATOR,function(el){return el==wkid;})){var _701=dojo.filter(this.spatialReferences,function(el){return (dojo.some(this._WEB_MERCATOR,function(el2){return el2==el;}));},this);if(_701.length==0){_701=dojo.filter(this.spatialReferences,function(el){return (dojo.some(this._WORLD_MERCATOR,function(el2){return el2==el;}));},this);}if(_701.length>0){wkid=_701[0];}else{wkid=this._WEB_MERCATOR[0];}}var list=dojo.filter(this.spatialReferences,function(el){return el!==wkid;});this.spatialReferences=list;this.spatialReferences.unshift(wkid);var xmin=_6fd.xmin;var xmax=_6fd.xmax;var ymin=_6fd.ymin;var ymax=_6fd.ymax;var _702={};_702.SERVICE="WMS";_702.REQUEST="GetMap";_702.FORMAT=this.imageFormat;_702.TRANSPARENT=this.imageTransparency?"TRUE":"FALSE";_702.STYLES="";_702.VERSION=this.version;_702.LAYERS=this.visibleLayers?this.visibleLayers.toString():null;_702.WIDTH=_6fe;_702.HEIGHT=_6ff;if(this.maxWidth<_6fe){_702.WIDTH=this.maxWidth;}if(this.maxHeight<_6ff){_702.HEIGHT=this.maxHeight;}var _703=wkid?wkid:NaN;if(!isNaN(_703)){if(this.version=="1.3.0"){_702.CRS="EPSG:"+_703;}else{_702.SRS="EPSG:"+_703;}}if(this.version=="1.3.0"&&this._useLatLong(_703)){_702.BBOX=ymin+","+xmin+","+ymax+","+xmax;}else{_702.BBOX=xmin+","+ymin+","+xmax+","+ymax;}var _704=this.getMapURL;_704+=(_704.indexOf("?")==-1)?"?":"";for(var key in _702){_704+=(_704.substring(_704.length-1,_704.length)=="?")?"":"&";_704+=key+"="+_702[key];}_700(_704);},_initLayer:function(_705,io){this.spatialReference=new esri.SpatialReference(this.extent.spatialReference);this.initialExtent=new esri.geometry.Extent(this.extent);this.fullExtent=new esri.geometry.Extent(this.extent);this.visibleLayers=this._checkVisibleLayersList(this.visibleLayers);this.loaded=true;this.onLoad(this);var _706=this._loadCallback;if(_706){delete this._loadCallback;_706(this);}},_readResourceInfo:function(_707){if(!_707.extent){console.error("esri.layers.WMSLayer: unable to find the 'extent' property in resourceInfo");return;}if(!_707.layerInfos){console.error("esri.layers.WMSLayer: unable to find the 'layerInfos' property in resourceInfo");return;}this.extent=_707.extent;this.allExtents[0]=_707.extent;this.layerInfos=_707.layerInfos;this.description=_707.description?_707.description:"";this.copyright=_707.copyright?_707.copyright:"";this.title=_707.title?_707.title:"";this.getMapURL=_707.getMapURL?_707.getMapURL:this._getCapabilitiesURL;this.version=_707.version?_707.version:"1.3.0";this.maxWidth=_707.maxWidth?_707.maxWidth:5000;this.maxHeight=_707.maxHeight?_707.maxHeight:5000;this.spatialReferences=_707.spatialReferences?_707.spatialReferences:[];this.imageFormat=this._getImageFormat(_707.format);this._initLayer();},_getCapabilities:function(){var _708=this._url.query?this._url.query:{};_708.SERVICE="WMS";_708.REQUEST="GetCapabilities";var uri=this._url.path+"?";for(var key in _708){uri+=(uri.substring(uri.length-1,uri.length)=="?")?"":"&";uri+=key+"="+_708[key];}var _709=esri.request({url:uri,handleAs:"xml",load:this._parseCapabilities,error:this._getCapabilitiesError},{usePost:false});},_parseCapabilities:function(xml){if(!xml){this.onError("GetCapabilities request for "+this._getCapabilitiesURL+" failed. (Response is null.)");return;}this.version=this._getAttributeValue("WMS_Capabilities","version",xml,null);if(!this.version){this.version=this._getAttributeValue("WMT_MS_Capabilities","version",xml,"1.3.0");}var _70a=this._getTag("Service",xml);this.title=this._getTagValue("Title",_70a,"");if(!this.title||this.title.length==0){this.title=this._getTagValue("Name",_70a,"");}this.copyright=this._getTagValue("AccessConstraints",_70a,"");this.description=this._getTagValue("Abstract",_70a,"");this.maxWidth=parseInt(this._getTagValue("MaxWidth",_70a,5000));this.maxHeight=parseInt(this._getTagValue("MaxHeight",_70a,5000));var _70b=this._getTag("Layer",xml);if(!_70b){this._getCapabilitiesError({"error":{"message":"Response does not contain any layers."}});return;}var _70c=this._getLayerInfo(_70b);if(_70c){this.layerInfos=_70c.subLayers;if(!this.layerInfos||this.layerInfos.length==0){this.layerInfos=[_70c];}this.extent=_70c.extent;this.allExtents=_70c.allExtents;this.spatialReferences=_70c.spatialReferences;if(this.spatialReferences.length==0&&this.layerInfos.length>0){this.spatialReferences=this.layerInfos[0].spatialReferences;}}this.getMapURL=this._getCapabilitiesURL;var _70d=dojo.query("DCPType",this._getTag("GetMap",xml));if(_70d&&_70d.length>0){var _70e=dojo.query("HTTP",_70d[0]);if(_70e&&_70e.length>0){var _70f=dojo.query("Get",_70e[0]);if(_70f&&_70f.length>0){var _710=this._getAttributeValue("OnlineResource","xlink:href",_70f[0],null);if(_710){if(_710.indexOf("&")==(_710.length-1)){_710=_710.substring(0,_710.length-1);}this.getMapURL=_710;}}}}this.getMapFormats=[];if(dojo.query("Operation",xml).length==0){dojo.forEach(dojo.query("Format",this._getTag("GetMap",xml)),function(_711){this.getMapFormats.push(_711.text?_711.text:_711.textContent);},this);}else{dojo.forEach(dojo.query("Operation",xml),function(_712){if(_712.getAttribute("name")=="GetMap"){dojo.forEach(dojo.query("Format",_712),function(_713){this.getMapFormats.push(_713.text?_713.text:_713.textContent);},this);}},this);}if(!dojo.some(this.getMapFormats,function(el){return el.indexOf(this.imageFormat)>-1;},this)){this.imageFormat=this.getMapFormats[0];}this._initLayer();},_getCapabilitiesError:function(_714,io){this.onError("GetCapabilities request for "+this._getCapabilitiesURL+" failed. ("+dojo.toJson(_714)+")");},_getLayerInfo:function(_715){if(!_715){return null;}var _716=new esri.layers.WMSLayerInfo();_716.name="";_716.title="";_716.description="";_716.allExtents=[];_716.spatialReferences=[];_716.subLayers=[];var _717=this._getTag("LatLonBoundingBox",_715);if(_717){_716.allExtents[0]=this._getExtent(_717,4326);}var _718=this._getTag("EX_GeographicBoundingBox",_715);if(_718){var _719=new esri.geometry.Extent(0,0,0,0,new esri.SpatialReference({wkid:4326}));_719.xmin=parseFloat(this._getTagValue("westBoundLongitude",_718,0));_719.ymin=parseFloat(this._getTagValue("southBoundLatitude",_718,0));_719.xmax=parseFloat(this._getTagValue("eastBoundLongitude",_718,0));_719.ymax=parseFloat(this._getTagValue("northBoundLatitude",_718,0));_716.allExtents[0]=_719;}_716.extent=_716.allExtents[0];var _71a=(dojo.indexOf(["1.0.0","1.1.0","1.1.1"],this.version)>-1)?"SRS":"CRS";dojo.forEach(_715.childNodes,function(_71b){if(_71b.nodeName=="Name"){_716.name=(_71b.text?_71b.text:_71b.textContent)||"";}else{if(_71b.nodeName=="Title"){_716.title=(_71b.text?_71b.text:_71b.textContent)||"";}else{if(_71b.nodeName=="Abstract"){_716.description=(_71b.text?_71b.text:_71b.textContent)||"";}else{if(_71b.nodeName=="BoundingBox"){srAttr=_71b.getAttribute(_71a);if(srAttr&&srAttr.indexOf("EPSG:")===0){wkid=parseInt(srAttr.substring(5));if(wkid!==0&&!isNaN(wkid)){var _71c;if(this.version=="1.3.0"){_71c=this._getExtent(_71b,wkid,this._useLatLong(wkid));}else{_71c=this._getExtent(_71b,wkid);}_716.allExtents[wkid]=_71c;if(!_716.extent){_716.extent=_71c;}}}else{if(srAttr&&srAttr.indexOf("CRS:")===0){wkid=parseInt(srAttr.substring(4));if(wkid!==0&&!isNaN(wkid)){if(this._CRS_TO_EPSG[wkid]){wkid=this._CRS_TO_EPSG[wkid];}_716.allExtents[wkid]=this._getExtent(_71b,wkid);}}else{wkid=parseInt(srAttr);if(wkid!==0&&!isNaN(wkid)){_716.allExtents[wkid]=this._getExtent(_71b,wkid);}}}}else{if(_71b.nodeName==_71a){var _71d=_71b.text?_71b.text:_71b.textContent;var arr=_71d.split(" ");dojo.forEach(arr,function(val){if(val.indexOf(":")>-1){val=parseInt(val.split(":")[1]);}else{val=parseInt(val);}if(val!==84&&val!==0&&!isNaN(val)){if(!dojo.some(_716.spatialReferences,function(el){return (el==val);})){_716.spatialReferences.push(val);}}},this);}else{if(_71b.nodeName=="Style"){var _71e=this._getTag("LegendURL",_71b);if(_71e){var _71f=this._getTag("OnlineResource",_71e);if(_71f){_716.legendURL=_71f.getAttribute("xlink:href");}}}else{if(_71b.nodeName==="Layer"){_716.subLayers.push(this._getLayerInfo(_71b));}}}}}}}},this);return _716;},_getImageFormat:function(_720){var _721=_720?_720.toLowerCase():"";switch(_721){case "jpg":return "image/jpeg";case "bmp":return "image/bmp";case "gif":return "image/gif";case "svg":return "image/svg+xml";default:return "image/png";}},getImageFormat:function(){var _722=this.imageFormat?this.imageFormat.toLowerCase():"";switch(_722){case "image/jpeg":return "jpg";case "image/bmp":return "bmp";case "image/gif":return "gif";case "image/svg+xml":return "svg";default:return "png";}},_getExtent:function(_723,wkid,_724){var _725;if(_723){_725=new esri.geometry.Extent();var minx=parseFloat(_723.getAttribute("minx"));var miny=parseFloat(_723.getAttribute("miny"));var maxx=parseFloat(_723.getAttribute("maxx"));var maxy=parseFloat(_723.getAttribute("maxy"));if(_724){_725.xmin=isNaN(miny)?((-1)*Number.MAX_VALUE):miny;_725.ymin=isNaN(minx)?((-1)*Number.MAX_VALUE):minx;_725.xmax=isNaN(maxy)?Number.MAX_VALUE:maxy;_725.ymax=isNaN(maxx)?Number.MAX_VALUE:maxx;}else{_725.xmin=isNaN(minx)?((-1)*Number.MAX_VALUE):minx;_725.ymin=isNaN(miny)?((-1)*Number.MAX_VALUE):miny;_725.xmax=isNaN(maxx)?Number.MAX_VALUE:maxx;_725.ymax=isNaN(maxy)?Number.MAX_VALUE:maxy;}_725.spatialReference=new esri.SpatialReference({wkid:wkid});}return _725;},_useLatLong:function(wkid){var _726;for(var i=0;i<this._REVERSED_LAT_LONG_RANGES.length;i++){var _727=this._REVERSED_LAT_LONG_RANGES[i];if(wkid>=_727[0]&&wkid<=_727[1]){_726=true;break;}}return _726;},_getTag:function(_728,xml){var tags=dojo.query(_728,xml);if(tags&&tags.length>0){return tags[0];}else{return null;}},_getTagValue:function(_729,xml,_72a){var _72b=dojo.query(_729,xml);if(_72b&&_72b.length>0){if(_72b[0].text){return _72b[0].text;}else{return _72b[0].textContent;}}else{return _72a;}},_getAttributeValue:function(_72c,_72d,xml,_72e){var _72f=dojo.query(_72c,xml);if(_72f&&_72f.length>0){return _72f[0].getAttribute(_72d);}else{return _72e;}},_checkVisibleLayersList:function(_730){if(_730&&_730.length>0&&this.layerInfos&&this.layerInfos.length>0){if((typeof _730[0])=="number"){var list=[];dojo.forEach(_730,function(pos){if(pos<this.layerInfos.length){list.push(this.layerInfos[pos].name);}},this);_730=list;}}return _730;},_stripParameters:function(url,_731){var obj=esri.urlToObject(url);qs=[];for(var prop in obj.query){if(dojo.indexOf(_731,prop.toLowerCase())===-1){qs.push(prop+"="+obj.query[prop]);}}return obj.path+(qs.length?("?"+qs.join("&")):"");}});dojo.declare("esri.layers.WMSLayerInfo",null,{name:null,title:null,description:null,extent:null,legendURL:null,subLayers:[],allExtents:[],spatialReferences:[],constructor:function(_732){if(_732){this.name=_732.name;this.title=_732.title;this.description=_732.description;this.extent=_732.extent;this.legendURL=_732.legendURL;this.subLayers=_732.subLayers?_732.subLayers:[];this.allExtents=_732.allExtents?_732.allExtents:[];this.spatialReferences=_732.spatialReferences?_732.spatialReferences:[];}},clone:function(){var info={name:this.name,title:this.title,description:this.description,legendURL:this.legendURL};if(this.extent){info.extent=this.extent.getExtent();}info.subLayers=[];dojo.forEach(this.subLayers,function(_733){info.subLayers.push(_733.clone());});info.allExtents=[];for(var wkid in this.allExtents){wkid=parseInt(wkid);if(!isNaN(wkid)){info.allExtents[wkid]=this.allExtents[wkid].getExtent();}}info.spatialReferences=[];dojo.forEach(this.spatialReferences,function(wkid){info.spatialReferences.push(wkid);});return info;}});}if(!dojo._hasResource["dojo.DeferredList"]){dojo._hasResource["dojo.DeferredList"]=true;dojo.provide("dojo.DeferredList");dojo.DeferredList=function(list,_734,_735,_736,_737){var _738=[];dojo.Deferred.call(this);var self=this;if(list.length===0&&!_734){this.resolve([0,[]]);}var _739=0;dojo.forEach(list,function(item,i){item.then(function(_73a){if(_734){self.resolve([i,_73a]);}else{_73b(true,_73a);}},function(_73c){if(_735){self.reject(_73c);}else{_73b(false,_73c);}if(_736){return null;}throw _73c;});function _73b(_73d,_73e){_738[i]=[_73d,_73e];_739++;if(_739===list.length){self.resolve(_738);}};});};dojo.DeferredList.prototype=new dojo.Deferred();dojo.DeferredList.prototype.gatherResults=function(_73f){var d=new dojo.DeferredList(_73f,false,true,false);d.addCallback(function(_740){var ret=[];dojo.forEach(_740,function(_741){ret.push(_741[1]);});return ret;});return d;};}if(!dojo._hasResource["dojo.data.util.filter"]){dojo._hasResource["dojo.data.util.filter"]=true;dojo.provide("dojo.data.util.filter");dojo.getObject("data.util.filter",true,dojo);dojo.data.util.filter.patternToRegExp=function(_742,_743){var rxp="^";var c=null;for(var i=0;i<_742.length;i++){c=_742.charAt(i);switch(c){case "\\":rxp+=c;i++;rxp+=_742.charAt(i);break;case "*":rxp+=".*";break;case "?":rxp+=".";break;case "$":case "^":case "/":case "+":case ".":case "|":case "(":case ")":case "{":case "}":case "[":case "]":rxp+="\\";default:rxp+=c;}}rxp+="$";if(_743){return new RegExp(rxp,"mi");}else{return new RegExp(rxp,"m");}};}if(!dojo._hasResource["dojo.data.util.sorter"]){dojo._hasResource["dojo.data.util.sorter"]=true;dojo.provide("dojo.data.util.sorter");dojo.getObject("data.util.sorter",true,dojo);dojo.data.util.sorter.basicComparator=function(a,b){var r=-1;if(a===null){a=undefined;}if(b===null){b=undefined;}if(a==b){r=0;}else{if(a>b||a==null){r=1;}}return r;};dojo.data.util.sorter.createSortFunction=function(_744,_745){var _746=[];function _747(attr,dir,comp,s){return function(_748,_749){var a=s.getValue(_748,attr);var b=s.getValue(_749,attr);return dir*comp(a,b);};};var _74a;var map=_745.comparatorMap;var bc=dojo.data.util.sorter.basicComparator;for(var i=0;i<_744.length;i++){_74a=_744[i];var attr=_74a.attribute;if(attr){var dir=(_74a.descending)?-1:1;var comp=bc;if(map){if(typeof attr!=="string"&&("toString" in attr)){attr=attr.toString();}comp=map[attr]||bc;}_746.push(_747(attr,dir,comp,_745));}}return function(rowA,rowB){var i=0;while(i<_746.length){var ret=_746[i++](rowA,rowB);if(ret!==0){return ret;}}return 0;};};}if(!dojo._hasResource["dojo.data.util.simpleFetch"]){dojo._hasResource["dojo.data.util.simpleFetch"]=true;dojo.provide("dojo.data.util.simpleFetch");dojo.getObject("data.util.simpleFetch",true,dojo);dojo.data.util.simpleFetch.fetch=function(_74b){_74b=_74b||{};if(!_74b.store){_74b.store=this;}var self=this;var _74c=function(_74d,_74e){if(_74e.onError){var _74f=_74e.scope||dojo.global;_74e.onError.call(_74f,_74d,_74e);}};var _750=function(_751,_752){var _753=_752.abort||null;var _754=false;var _755=_752.start?_752.start:0;var _756=(_752.count&&(_752.count!==Infinity))?(_755+_752.count):_751.length;_752.abort=function(){_754=true;if(_753){_753.call(_752);}};var _757=_752.scope||dojo.global;if(!_752.store){_752.store=self;}if(_752.onBegin){_752.onBegin.call(_757,_751.length,_752);}if(_752.sort){_751.sort(dojo.data.util.sorter.createSortFunction(_752.sort,self));}if(_752.onItem){for(var i=_755;(i<_751.length)&&(i<_756);++i){var item=_751[i];if(!_754){_752.onItem.call(_757,item,_752);}}}if(_752.onComplete&&!_754){var _758=null;if(!_752.onItem){_758=_751.slice(_755,_756);}_752.onComplete.call(_757,_758,_752);}};this._fetchItems(_74b,_750,_74c);return _74b;};}if(!dojo._hasResource["dojox.data.CsvStore"]){dojo._hasResource["dojox.data.CsvStore"]=true;dojo.provide("dojox.data.CsvStore");dojo.declare("dojox.data.CsvStore",null,{constructor:function(_759){this._attributes=[];this._attributeIndexes={};this._dataArray=[];this._arrayOfAllItems=[];this._loadFinished=false;if(_759.url){this.url=_759.url;}this._csvData=_759.data;if(_759.label){this.label=_759.label;}else{if(this.label===""){this.label=undefined;}}this._storeProp="_csvStore";this._idProp="_csvId";this._features={"dojo.data.api.Read":true,"dojo.data.api.Identity":true};this._loadInProgress=false;this._queuedFetches=[];this.identifier=_759.identifier;if(this.identifier===""){delete this.identifier;}else{this._idMap={};}if("separator" in _759){this.separator=_759.separator;}if("urlPreventCache" in _759){this.urlPreventCache=_759.urlPreventCache?true:false;}},url:"",label:"",identifier:"",separator:",",urlPreventCache:false,_assertIsItem:function(item){if(!this.isItem(item)){throw new Error(this.declaredClass+": a function was passed an item argument that was not an item");}},_getIndex:function(item){var idx=this.getIdentity(item);if(this.identifier){idx=this._idMap[idx];}return idx;},getValue:function(item,_75a,_75b){this._assertIsItem(item);var _75c=_75b;if(typeof _75a==="string"){var ai=this._attributeIndexes[_75a];if(ai!=null){var _75d=this._dataArray[this._getIndex(item)];_75c=_75d[ai]||_75b;}}else{throw new Error(this.declaredClass+": a function was passed an attribute argument that was not a string");}return _75c;},getValues:function(item,_75e){var _75f=this.getValue(item,_75e);return (_75f?[_75f]:[]);},getAttributes:function(item){this._assertIsItem(item);var _760=[];var _761=this._dataArray[this._getIndex(item)];for(var i=0;i<_761.length;i++){if(_761[i]!==""){_760.push(this._attributes[i]);}}return _760;},hasAttribute:function(item,_762){this._assertIsItem(item);if(typeof _762==="string"){var _763=this._attributeIndexes[_762];var _764=this._dataArray[this._getIndex(item)];return (typeof _763!=="undefined"&&_763<_764.length&&_764[_763]!=="");}else{throw new Error(this.declaredClass+": a function was passed an attribute argument that was not a string");}},containsValue:function(item,_765,_766){var _767=undefined;if(typeof _766==="string"){_767=dojo.data.util.filter.patternToRegExp(_766,false);}return this._containsValue(item,_765,_766,_767);},_containsValue:function(item,_768,_769,_76a){var _76b=this.getValues(item,_768);for(var i=0;i<_76b.length;++i){var _76c=_76b[i];if(typeof _76c==="string"&&_76a){return (_76c.match(_76a)!==null);}else{if(_769===_76c){return true;}}}return false;},isItem:function(_76d){if(_76d&&_76d[this._storeProp]===this){var _76e=_76d[this._idProp];if(this.identifier){var data=this._dataArray[this._idMap[_76e]];if(data){return true;}}else{if(_76e>=0&&_76e<this._dataArray.length){return true;}}}return false;},isItemLoaded:function(_76f){return this.isItem(_76f);},loadItem:function(item){},getFeatures:function(){return this._features;},getLabel:function(item){if(this.label&&this.isItem(item)){return this.getValue(item,this.label);}return undefined;},getLabelAttributes:function(item){if(this.label){return [this.label];}return null;},_fetchItems:function(_770,_771,_772){var self=this;var _773=function(_774,_775){var _776=null;if(_774.query){var key,_777;_776=[];var _778=_774.queryOptions?_774.queryOptions.ignoreCase:false;var _779={};for(key in _774.query){_777=_774.query[key];if(typeof _777==="string"){_779[key]=dojo.data.util.filter.patternToRegExp(_777,_778);}}for(var i=0;i<_775.length;++i){var _77a=true;var _77b=_775[i];for(key in _774.query){_777=_774.query[key];if(!self._containsValue(_77b,key,_777,_779[key])){_77a=false;}}if(_77a){_776.push(_77b);}}}else{_776=_775.slice(0,_775.length);}_771(_776,_774);};if(this._loadFinished){_773(_770,this._arrayOfAllItems);}else{if(this.url!==""){if(this._loadInProgress){this._queuedFetches.push({args:_770,filter:_773});}else{this._loadInProgress=true;var _77c={url:self.url,handleAs:"text",preventCache:self.urlPreventCache};var _77d=dojo.xhrGet(_77c);_77d.addCallback(function(data){try{self._processData(data);_773(_770,self._arrayOfAllItems);self._handleQueuedFetches();}catch(e){_772(e,_770);}});_77d.addErrback(function(_77e){self._loadInProgress=false;if(_772){_772(_77e,_770);}else{throw _77e;}});var _77f=null;if(_770.abort){_77f=_770.abort;}_770.abort=function(){var df=_77d;if(df&&df.fired===-1){df.cancel();df=null;}if(_77f){_77f.call(_770);}};}}else{if(this._csvData){try{this._processData(this._csvData);this._csvData=null;_773(_770,this._arrayOfAllItems);}catch(e){_772(e,_770);}}else{var _780=new Error(this.declaredClass+": No CSV source data was provided as either URL or String data input.");if(_772){_772(_780,_770);}else{throw _780;}}}}},close:function(_781){},_getArrayOfArraysFromCsvFileContents:function(_782){if(dojo.isString(_782)){var _783=new RegExp("^\\s+","g");var _784=new RegExp("\\s+$","g");var _785=new RegExp("\"\"","g");var _786=[];var i;var _787=this._splitLines(_782);for(i=0;i<_787.length;++i){var _788=_787[i];if(_788.length>0){var _789=_788.split(this.separator);var j=0;while(j<_789.length){var _78a=_789[j];var _78b=_78a.replace(_783,"");var _78c=_78b.replace(_784,"");var _78d=_78c.charAt(0);var _78e=_78c.charAt(_78c.length-1);var _78f=_78c.charAt(_78c.length-2);var _790=_78c.charAt(_78c.length-3);if(_78c.length===2&&_78c=="\"\""){_789[j]="";}else{if((_78d=="\"")&&((_78e!="\"")||((_78e=="\"")&&(_78f=="\"")&&(_790!="\"")))){if(j+1===_789.length){return;}var _791=_789[j+1];_789[j]=_78b+this.separator+_791;_789.splice(j+1,1);}else{if((_78d=="\"")&&(_78e=="\"")){_78c=_78c.slice(1,(_78c.length-1));_78c=_78c.replace(_785,"\"");}_789[j]=_78c;j+=1;}}}_786.push(_789);}}this._attributes=_786.shift();for(i=0;i<this._attributes.length;i++){this._attributeIndexes[this._attributes[i]]=i;}this._dataArray=_786;}},_splitLines:function(_792){var _793=[];var i;var line="";var _794=false;for(i=0;i<_792.length;i++){var c=_792.charAt(i);switch(c){case "\"":_794=!_794;line+=c;break;case "\r":if(_794){line+=c;}else{_793.push(line);line="";if(i<(_792.length-1)&&_792.charAt(i+1)=="\n"){i++;}}break;case "\n":if(_794){line+=c;}else{_793.push(line);line="";}break;default:line+=c;}}if(line!==""){_793.push(line);}return _793;},_processData:function(data){this._getArrayOfArraysFromCsvFileContents(data);this._arrayOfAllItems=[];if(this.identifier){if(this._attributeIndexes[this.identifier]===undefined){throw new Error(this.declaredClass+": Identity specified is not a column header in the data set.");}}for(var i=0;i<this._dataArray.length;i++){var id=i;if(this.identifier){var _795=this._dataArray[i];id=_795[this._attributeIndexes[this.identifier]];this._idMap[id]=i;}this._arrayOfAllItems.push(this._createItemFromIdentity(id));}this._loadFinished=true;this._loadInProgress=false;},_createItemFromIdentity:function(_796){var item={};item[this._storeProp]=this;item[this._idProp]=_796;return item;},getIdentity:function(item){if(this.isItem(item)){return item[this._idProp];}return null;},fetchItemByIdentity:function(_797){var item;var _798=_797.scope?_797.scope:dojo.global;if(!this._loadFinished){var self=this;if(this.url!==""){if(this._loadInProgress){this._queuedFetches.push({args:_797});}else{this._loadInProgress=true;var _799={url:self.url,handleAs:"text"};var _79a=dojo.xhrGet(_799);_79a.addCallback(function(data){try{self._processData(data);var item=self._createItemFromIdentity(_797.identity);if(!self.isItem(item)){item=null;}if(_797.onItem){_797.onItem.call(_798,item);}self._handleQueuedFetches();}catch(error){if(_797.onError){_797.onError.call(_798,error);}}});_79a.addErrback(function(_79b){this._loadInProgress=false;if(_797.onError){_797.onError.call(_798,_79b);}});}}else{if(this._csvData){try{self._processData(self._csvData);self._csvData=null;item=self._createItemFromIdentity(_797.identity);if(!self.isItem(item)){item=null;}if(_797.onItem){_797.onItem.call(_798,item);}}catch(e){if(_797.onError){_797.onError.call(_798,e);}}}}}else{item=this._createItemFromIdentity(_797.identity);if(!this.isItem(item)){item=null;}if(_797.onItem){_797.onItem.call(_798,item);}}},getIdentityAttributes:function(item){if(this.identifier){return [this.identifier];}else{return null;}},_handleQueuedFetches:function(){if(this._queuedFetches.length>0){for(var i=0;i<this._queuedFetches.length;i++){var _79c=this._queuedFetches[i];var _79d=_79c.filter;var _79e=_79c.args;if(_79d){_79d(_79e,this._arrayOfAllItems);}else{this.fetchItemByIdentity(_79c.args);}}this._queuedFetches=[];}}});dojo.extend(dojox.data.CsvStore,dojo.data.util.simpleFetch);}if(!dojo._hasResource["esri.arcgis.csv"]){dojo._hasResource["esri.arcgis.csv"]=true;dojo.provide("esri.arcgis.csv");(function(){var EAC=esri.arcgis.csv;EAC.latFieldStrings=["lat","latitude","y","ycenter","latitude83","latdecdeg","POINT-Y"];EAC.longFieldStrings=["lon","lng","long","longitude","x","xcenter","longitude83","longdecdeg","POINT-X"];EAC.buildCSVFeatureCollection=function(_79f){var _7a0=new dojo.Deferred();var _7a1=function(_7a2){_7a0.callback(_7a2);};var _7a3=esri.request({url:_79f.url,handleAs:"text",load:function(_7a4){EAC._processCsvData(_7a4,_79f,dojo.hitch(this,_7a1));},error:function(_7a5){console.error("error: "+_7a5);}},{usePost:false});return _7a0;};EAC.projectFeatureCollection=function(_7a6,_7a7){var _7a8=new dojo.Deferred();var _7a9=function(_7aa){_7a8.callback(_7aa);};EAC._projectFeatureSet(_7a6,new esri.SpatialReference({wkid:4326}),_7a7,dojo.hitch(this,_7a9));return _7a8;};EAC.generateDefaultPopupInfo=function(_7ab){var _7ac=_7ab.layerDefinition.fields;var _7ad={"esriFieldTypeDouble":1,"esriFieldTypeSingle":1};var _7ae={"esriFieldTypeInteger":1,"esriFieldTypeSmallInteger":1};var dt={"esriFieldTypeDate":1};var _7af=null;var _7b0=dojo.map(_7ac,dojo.hitch(this,function(item){if(item.name.toUpperCase()==="NAME"){_7af=item.name;}var _7b1=(item.type!=="esriFieldTypeOID"&&item.type!=="esriFieldTypeGlobalID"&&item.type!=="esriFieldTypeGeometry");var _7b2=null;if(_7b1){var f=item.name.toLowerCase();var _7b3=",stretched value,fnode_,tnode_,lpoly_,rpoly_,poly_,subclass,subclass_,rings_ok,rings_nok,";if(_7b3.indexOf(","+f+",")>-1||f.indexOf("area")>-1||f.indexOf("length")>-1||f.indexOf("shape")>-1||f.indexOf("perimeter")>-1||f.indexOf("objectid")>-1||f.indexOf("_")===f.length-1||(f.indexOf("_i")===f.length-2&&f.length>1)){_7b1=false;}if(item.type in _7ae){_7b2={places:0,digitSeparator:true};}else{if(item.type in _7ad){_7b2={places:2,digitSeparator:true};}else{if(item.type in dt){_7b2={dateFormat:"shortDateShortTime"};}}}}return dojo.mixin({},{fieldName:item.name,label:item.alias,isEditable:true,tooltip:"",visible:_7b1,format:_7b2,stringFieldOption:"textbox"});}));var _7b4={title:_7af?"{"+_7af+"}":"",fieldInfos:_7b0,description:null,showAttachments:false,mediaInfos:[]};return _7b4;};EAC._processCsvData=function(data,_7b5,_7b6){var _7b7=data.indexOf("\n");var _7b8=dojo.trim(data.substr(0,_7b7));var _7b9=_7b5.columnDelimiter;if(!_7b9){_7b9=EAC._getSeparator(_7b8);}var _7ba=new dojox.data.CsvStore({data:data,separator:_7b9});var _7bb=(dojo.isIE<9)?750:1001;_7ba.fetch({start:0,count:_7bb,onComplete:function(_7bc,_7bd){var _7be=0;var _7bf={"layerDefinition":_7b5.layerDefinition,"featureSet":{"features":[],"geometryType":"esriGeometryPoint"}};var _7c0=_7bf.layerDefinition.objectIdField;if(!_7c0){if(!dojo.some(_7bf.layerDefinition.fields,function(_7c1){if(_7c1.type=="esriFieldTypeOID"){_7c0=_7c1.name;return true;}return false;})){_7bf.layerDefinition.fields.push({"name":"__OBJECTID","alias":"__OBJECTID","type":"esriFieldTypeOID","editable":false,"domain":null});_7c0="__OBJECTID";}}var _7c2,_7c3;var _7c4=_7ba._attributes;var _7c5=[];var _7c6=[];dojo.forEach(_7bf.layerDefinition.fields,function(_7c7,_7c8){if(_7c7.type==="esriFieldTypeDate"){_7c5.push(_7c7.name);}else{if(_7c7.type==="esriFieldTypeDouble"||_7c7.type==="esriFieldTypeInteger"){_7c6.push(_7c7.name);}}});if(_7b5.locationInfo&&_7b5.locationInfo.locationType==="coordinates"){_7c2=_7b5.locationInfo.latitudeFieldName;_7c3=_7b5.locationInfo.longitudeFieldName;}else{dojo.forEach(_7c4,function(_7c9){var _7ca;_7ca=dojo.indexOf(EAC.latFieldStrings,_7c9.toLowerCase());if(_7ca!==-1){_7c2=_7c9;}_7ca=dojo.indexOf(EAC.longFieldStrings,_7c9.toLowerCase());if(_7ca!==-1){_7c3=_7c9;}},this);}if(!_7c2||!_7c3){setTimeout(function(){console.error("File does not seem to contain fields with point coordinates.");},1);return;}var i=0,il=_7bc.length;for(i;i<il;i++){if(_7bf.featureSet.features.length>=1000){setTimeout(function(){console.error("1000 feature limit reached. Unable to load any more data.");},1);break;}var item=_7bc[i];var _7cb=_7ba.getAttributes(item),_7cc={};dojo.forEach(_7cb,function(attr,_7cd){if(dojo.some(_7c5,function(a){return a===attr;})){var val=_7ba.getValue(item,attr),date=new Date(val);_7cc[attr]=EAC._isValidDate(date,val)?date.getTime():null;}else{if(dojo.some(_7c6,function(a){return a===attr;})){var _7ce=dojo.number.parse(_7ba.getValue(item,attr));if((attr==_7c2||attr==_7c3)&&(isNaN(_7ce)||Math.abs(_7ce)>181)){_7ce=parseFloat(_7ba.getValue(item,attr));if(isNaN(_7ce)){_7cc[attr]=null;}else{_7cc[attr]=_7ce;}}else{if(isNaN(_7ce)){_7cc[attr]=null;}else{_7cc[attr]=_7ce;}}}else{_7cc[attr]=_7ba.getValue(item,attr);}}});_7cc[_7c0]=_7be;_7be++;var _7cf=_7cc[_7c2];var _7d0=_7cc[_7c3];if(_7d0==null||_7cf==null||isNaN(_7cf)||isNaN(_7d0)){continue;}var _7d1=new esri.geometry.Point(_7d0,_7cf,new esri.SpatialReference({wkid:4326}));var _7d2={"geometry":_7d1.toJson(),"attributes":_7cc};_7bf.featureSet.features.push(_7d2);}_7bf.layerDefinition.name="csv";if(_7b6){_7b6(_7bf);}},onError:function(_7d3){console.error("Error fetching items from CSV store: ",_7d3);}});return true;};EAC._getSeparator=function(_7d4){var _7d5=[","," ",";","|","\t"];var _7d6=0;var _7d7="";dojo.forEach(_7d5,function(_7d8){var _7d9=_7d4.split(_7d8).length;if(_7d9>_7d6){_7d6=_7d9;_7d7=_7d8;}});return _7d7;};EAC._isValidDate=function(d,_7da){if(!d||Object.prototype.toString.call(d)!=="[object Date]"||isNaN(d.getTime())){return false;}var _7db=true;if(dojo.isChrome&&/\d+\W*$/.test(_7da)){var _7dc=_7da.match(/[a-zA-Z]{2,}/);if(_7dc){var _7dd=false,i=0,len=_7dc.length,_7de=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i;while(!_7dd&&(i<=len)&&!(_7dd=!_7de.test(_7dc[i]))){i++;}_7db=!_7dd;}}return _7db;};EAC._projectFeatureSet=function(_7df,_7e0,_7e1,_7e2){if(!_7df.featureSet||_7df.featureSet.length===0){return;}if(EAC._sameSpatialReference(_7e1,_7e0)){_7e2(_7df);return;}var _7e3=function(_7e4){var _7e5=[];dojo.forEach(_7df.featureSet.features,function(_7e6,i){if(_7e4[i]){_7e6.geometry=_7e4[i];_7e5.push(_7e6);}},this);_7e2(_7df);};var _7e7=function(_7e8,args){console.error("error projecting featureSet ("+_7df.layerDefinition.name+"). Try one more time.");EAC._projectGeometries(_7e9,_7df.featureSet.geometryType,_7e0,_7e1,dojo.hitch(this,_7e3),dojo.hitch(this,_7ea));};var _7ea=function(_7eb,args){console.error("error projecting featureSet ("+_7df.layerDefinition.name+"). Final try.");_7e2(_7df);};if(_7df.featureSet.features&&_7df.featureSet.features.length>0){var _7e9=[];dojo.forEach(_7df.featureSet.features,function(_7ec){_7e9.push(_7ec.geometry);});EAC._projectGeometries(_7e9,_7df.featureSet.geometryType,_7e0,_7e1,dojo.hitch(this,_7e3),dojo.hitch(this,_7e7));}else{_7e2(_7df);}};EAC._projectGeometries=function(_7ed,_7ee,inSR,_7ef,_7f0,_7f1){if(_7ed.length===0){_7f0(null);}var _7f2=esri.geometry.getGeometryType(_7ee);var _7f3=[];dojo.forEach(_7ed,function(_7f4){var _7f5=new _7f2(_7f4);_7f5.spatialReference=inSR;_7f3.push(_7f5);},this);var _7f6=[102113,102100,3857];if(inSR.wkid&&inSR.wkid===4326&&_7ef.wkid&&dojo.indexOf(_7f6,_7ef.wkid)>-1){dojo.forEach(_7f3,function(_7f7){if(_7f7.xmin){_7f7.xmin=Math.max(_7f7.xmin,-180);_7f7.xmax=Math.min(_7f7.xmax,180);_7f7.ymin=Math.max(_7f7.ymin,-89.99);_7f7.ymax=Math.min(_7f7.ymax,89.99);}else{if(_7f7.rings){dojo.forEach(_7f7.rings,function(ring){dojo.forEach(ring,function(_7f8){_7f8[0]=Math.min(Math.max(_7f8[0],-180),180);_7f8[1]=Math.min(Math.max(_7f8[1],-89.99),89.99);},this);},this);}else{if(_7f7.paths){dojo.forEach(_7f7.paths,function(path){dojo.forEach(path,function(_7f9){_7f9[0]=Math.min(Math.max(_7f9[0],-180),180);_7f9[1]=Math.min(Math.max(_7f9[1],-89.99),89.99);},this);},this);}else{if(_7f7.x){_7f7.x=Math.min(Math.max(_7f7.x,-180),180);_7f7.y=Math.min(Math.max(_7f7.y,-89.99),89.99);}}}}},this);_7ed=[];dojo.forEach(_7f3,function(_7fa){var _7fb=esri.geometry.geographicToWebMercator(_7fa);if(_7ef.wkid!==102100){_7fb.spatialReference=_7ef;}_7ed.push(_7fb.toJson());},this);_7f0(_7ed);}else{if(inSR.wkid!==null&&dojo.indexOf(_7f6,inSR.wkid)>-1&&_7ef.wkid!==null&&_7ef.wkid===4326){_7ed=[];dojo.forEach(_7f3,function(_7fc){_7ed.push(esri.geometry.webMercatorToGeographic(_7fc).toJson());},this);_7f0(_7ed);}else{var _7fd=function(_7fe,args){if(_7fe&&_7fe.length===_7ed.length){_7ed=[];dojo.forEach(_7fe,function(_7ff){if(_7ff&&((_7ff.rings&&_7ff.rings.length>0&&_7ff.rings[0].length>0&&_7ff.rings[0][0].length>0&&!isNaN(_7ff.rings[0][0][0])&&!isNaN(_7ff.rings[0][0][1]))||(_7ff.paths&&_7ff.paths.length>0&&_7ff.paths[0].length>0&&_7ff.paths[0][0].length>0&&!isNaN(_7ff.paths[0][0][0])&&!isNaN(_7ff.paths[0][0][1]))||(_7ff.xmin&&!isNaN(_7ff.xmin)&&_7ff.ymin&&!isNaN(_7ff.ymin))||(_7ff.x&&!isNaN(_7ff.x)&&_7ff.y&&!isNaN(_7ff.y)))){_7ed.push(_7ff.toJson());}else{_7ed.push(null);}},this);_7f0(_7ed);}else{_7f1(_7fe,args);}};if(esri.config.defaults.geometryService){esri.config.defaults.geometryService.project(_7f3,_7ef,dojo.hitch(this,_7fd),_7f1);}else{_7f0(null);}}}};EAC._sameSpatialReference=function(sp1,sp2){var _800=[102113,102100,3857];if(sp1&&sp2&&sp1.wkid===sp2.wkid&&sp1.wkt===sp2.wkt){return true;}else{if(sp1&&sp2&&sp1.wkid&&sp2.wkid&&dojo.indexOf(_800,sp1.wkid)>-1&&dojo.indexOf(_800,sp2.wkid)>-1){return true;}}return false;};}());}if(!dojo._hasResource["esri.arcgis.utils"]){dojo._hasResource["esri.arcgis.utils"]=true;dojo.provide("esri.arcgis.utils");(function(){var EAU=esri.arcgis.utils;EAU.arcgisUrl=location.protocol+"//www.arcgis.com/sharing/content/items";String.prototype.endsWith=function(str){return (this.match(str+"$")==str);};EAU.getItem=function(_801){if(EAU._arcgisUrl&&EAU._arcgisUrl.length>0){EAU.arcgisUrl=EAU._arcgisUrl;}var url=EAU.arcgisUrl+"/"+_801;var _802={},_803=new dojo.Deferred();esri.request({url:url,content:{f:"json"},callbackParamName:"callback",load:function(_804){_802.item=_804;esri.request({url:url+"/data",content:{f:"json"},callbackParamName:"callback",load:function(_805){_802.itemData=_805;_803.callback(_802);},error:function(_806){_803.errback(_806);}});},error:function(_807){_803.errback(_807);}});return _803;};EAU.createMap=function(arg1,_808,_809){var _80a=new dojo.Deferred();_809=_809||{};var _80b=_809.infoTemplateClass;_809._clazz=(_80b&&dojo.getObject(_80b))||esri.dijit.PopupTemplate;if(dojo.isString(arg1)){EAU.getItem(arg1).addCallback(function(_80c){EAU._getItemProps(_80c,_809).addCallback(function(_80d){EAU._getLayers(_80d.itemData,_809).addCallback(dojo.hitch(null,EAU._preCreateMap,_80d,_808,_809,_80a));});}).addErrback(dojo.hitch(_80a,_80a.errback));}else{EAU._getItemProps(arg1,_809).addCallback(function(_80e){EAU._getLayers(_80e.itemData,_809).addCallback(dojo.hitch(null,EAU._preCreateMap,_80e,_808,_809,_80a));});}return _80a;};EAU._arcgisUrl=null;EAU._getItemProps=function(_80f,_810){var _811=new dojo.Deferred();var _812=_80f.itemData;var _813=[];var _814=[];dojo.forEach(_812.operationalLayers,function(_815){if(_815.itemId&&!_815.type){if(_815.url.indexOf("/FeatureServer")>-1){_814.push(_815);_813.push(EAU._getItemData(_815));}else{if(!_815.layers&&_815.url.indexOf("/MapServer")>-1&&_815.url.indexOf("/MapServer/")===-1){_814.push(_815);_813.push(EAU._getItemData(_815));}}}});if(_813.length>0){var _816=new dojo.DeferredList(_813);_816.addCallback(function(_817){dojo.forEach(_814,function(_818,i){var _819=_817[i][1];if(_819&&_819.layers){if(_818.url.indexOf("/FeatureServer")>-1){dojo.forEach(_819.layers,function(_81a){if(_818.url.endsWith("/FeatureServer/"+_81a.id)){_818.itemProperties=_81a;EAU._processFSItemProperties(_818);}});}else{_818.layers=_819.layers;}}});_811.callback(_80f);});}else{_811.callback(_80f);}return _811;};EAU._getItemData=function(_81b){var url=EAU.arcgisUrl+"/"+_81b.itemId+"/data";var _81c=esri.request({url:url,content:{f:"json"},callbackParamName:"callback"});return _81c;};EAU._processFSItemProperties=function(_81d){if(_81d.itemProperties.layerDefinition){if(_81d.layerDefinition){if(!_81d.layerDefinition.drawingInfo){_81d.layerDefinition.drawingInfo=_81d.itemProperties.layerDefinition.drawingInfo;}if(!_81d.layerDefinition.definitionExpression){_81d.layerDefinition.definitionExpression=_81d.itemProperties.layerDefinition.definitionExpression;}if(_81d.layerDefinition.minScale===null){_81d.layerDefinition.minScale=_81d.itemProperties.layerDefinition.minScale;}if(_81d.layerDefinition.maxScale===null){_81d.layerDefinition.maxScale=_81d.itemProperties.layerDefinition.maxScale;}}else{_81d.layerDefinition=_81d.itemProperties.layerDefinition;}}if(_81d.itemProperties.popupInfo&&!_81d.popupInfo&&!_81d.disablePopup){_81d.popupInfo=_81d.itemProperties.popupInfo;}};EAU._getLayers=function(_81e,_81f){var _820=[];var _821=[];var _822=[];var _823=new dojo.Deferred();dojo.forEach(_81e.operationalLayers,function(_824,_825){if(_824.featureCollection){dojo.forEach(_824.featureCollection.layers,function(_826,idx){var _827=true;if(_824.visibleLayers){if(dojo.indexOf(_824.visibleLayers,idx)==-1){_827=false;}}_826.visibility=(_824.visibility&&_827);_826.opacity=_824.opacity;_826.id=(_824.id||("operational"+_825))+"_"+idx;_822.push(_826);},this);}else{_822.push(_824);}});dojo.forEach(_81e.baseMap.baseMapLayers,function(_828,_829){_828.baseMapLayer=true;_828.id=_828.id||("base"+_829);_820.push(_828);});dojo.forEach(_822,function(_82a,_82b){_82a.id=_82a.id||("operational"+_82b);_820.push(_82a);});dojo.forEach(_820,function(_82c){if(_82c.url&&!_82c.type){_82c.deferredsPos=_821.length;_82c.errors=[];_821.push(EAU._getServiceInfo(_82c.url,_82c.errors));}else{if(_82c.url&&_82c.type=="CSV"){_82c.deferredsPos=_821.length;_821.push(esri.arcgis.csv.buildCSVFeatureCollection(_82c));}}});if(_821.length==0){var _82d=EAU._getMapSR(_820);_820=EAU._buildLayerObjects(_820,_81f,_82d);_823.callback(_820);}else{var _82e=new dojo.DeferredList(_821);_82e.addCallback(function(_82f){EAU._preBuildLayerObjects(_82f,_820,_81f,_821,_823);});}return _823;};EAU._preBuildLayerObjects=function(_830,_831,_832,_833,_834){dojo.forEach(_831,function(_835,_836){if(_835.url&&!_835.type){_835.resourceInfo=_830[_835.deferredsPos][1];delete _835.deferredsPos;}else{if(_835.url&&_835.type=="CSV"){_835.featureCollection=_833[_835.deferredsPos].results[0];delete _835.deferredsPos;}}});var _837=EAU._getMapSR(_831);var _838=[];var _839=new dojo.Deferred();dojo.forEach(_831,function(_83a){if(_83a.url&&_83a.type=="CSV"){_83a.deferredsPos=_838.length;_838.push(esri.arcgis.csv.projectFeatureCollection(_83a.featureCollection,_837));}});if(_838.length==0){_831=EAU._buildLayerObjects(_831,_832,_837);_834.callback(_831);}else{var _83b=new dojo.DeferredList(_838);_83b.addCallback(function(){dojo.forEach(_831,function(_83c){if(_83c.url&&_83c.type=="CSV"){_83c.featureCollection=_838[_83c.deferredsPos].results[0];delete _83c.deferredsPos;}});_831=EAU._buildLayerObjects(_831,_832,_837);_834.callback(_831);});}};EAU._buildLayerObjects=function(_83d,_83e,_83f){dojo.forEach(_83d,function(_840,_841){if(_840.url&&!_840.type){if(_841===0||_83d[0].layerObject){_840.layerObject=EAU._initLayer(_840,_83d,_83e,_83f);}}else{if(_840.url&&_840.type=="CSV"){_840.layerObject=EAU._initLayer(_840,_83d,_83e,_83f);}else{_840.layerObject=EAU._initLayer(_840,_83d,_83e,_83f);}}});var _842=dojo.filter(_83d,function(lyr){return !lyr.isReference;});var _843=dojo.filter(_83d,function(lyr){return !!lyr.isReference;});_83d=_842.concat(_843);return _83d;};EAU._preCreateMap=function(_844,_845,_846,_847,_848){try{var _849=_846.mapOptions||{};_846.mapOptions=_849;var card=_844.item;var _84a=[];dojo.forEach(_848,function(_84b){if(dojo.isArray(_84b.layerObject)){dojo.forEach(_84b.layerObject,function(l){_84a.push(l);});}else{_84a.push(_84b.layerObject);}});if(!_84a[0]){_847.errback(new Error(esri.bundle.arcgis.utils.baseLayerError));return;}_84a=dojo.filter(_84a,esri._isDefined);if(card){if(card.extent){if(!_849.extent){var _84c=new esri.geometry.Extent(card.extent[0][0],card.extent[0][1],card.extent[1][0],card.extent[1][1],new esri.SpatialReference({wkid:4326}));var _84d=_84a[0].spatialReference;if(_84d.wkid===4326){_849.extent=_84c;EAU._createMap(_84a,_848,_844,_845,_846,_847);}else{if(_84d.wkid===102100||_84d.wkid===102113||_84d.wkid===3857){_84c.xmin=Math.max(_84c.xmin,-180);_84c.xmax=Math.min(_84c.xmax,180);_84c.ymin=Math.max(_84c.ymin,-89.99);_84c.ymax=Math.min(_84c.ymax,89.99);_849.extent=esri.geometry.geographicToWebMercator(_84c);EAU._createMap(_84a,_848,_844,_845,_846,_847);}else{if(_846.geometryServiceURL||esri.config.defaults.geometryService){var gs;if(_846.geometryServiceURL){gs=new esri.tasks.GeometryService(_846.geometryServiceURL);}else{gs=esri.config.defaults.geometryService;}gs.project([_84c],_84d,function(_84e){var _84f=_84e[0];_849.extent=_849.extent||_84f;EAU._createMap(_84a,_848,_844,_845,_846,_847);});}else{_847.errback(new Error(esri.bundle.arcgis.utils.geometryServiceError));}}}}else{EAU._createMap(_84a,_848,_844,_845,_846,_847);}}else{EAU._createMap(_84a,_848,_844,_845,_846,_847);}}else{EAU._createMap(_84a,_848,_844,_845,_846,_847);}}catch(err){_847.errback(err);}};EAU._getMapSR=function(_850){var _851=null;var _852=_850[0];if(_852.url&&!_852.type){if(_852.resourceInfo.spatialReference){_851=new esri.SpatialReference();if(_852.resourceInfo.spatialReference.wkid){_851.wkid=_852.resourceInfo.spatialReference.wkid;}if(_852.resourceInfo.spatialReference.wkt){_851.wkt=_852.resourceInfo.spatialReference.wkt;}}}else{if(_852.type.indexOf("BingMaps")>-1||_852.type=="OpenStreetMap"){_851=new esri.SpatialReference({wkid:102100});}else{if(_852.type=="WMS"){_851=new esri.SpatialReference({wkid:_852.spatialReferences[0]});}}}return _851;};EAU._createMap=function(_853,_854,_855,_856,_857,_858){var _859=(_857.mapOptions||{}),_85a,_85b;if(!_859.infoWindow){_85a=new esri.dijit.Popup(null,dojo.create("div"));_859.infoWindow=_85a;}if(!esri._isDefined(_859.showInfoWindowOnClick)){_859.showInfoWindowOnClick=false;}var map=new esri.Map(_856,_859);if(_857.ignorePopups){dojo.forEach(_853,function(_85c){delete _85c.infoTemplate;});}if(!(_857.ignorePopups||_857.disableClickBehavior)){_85b=dojo.connect(map,"onClick",EAU._showPopup);}dojo.connect(map,"onLayersAddResult",EAU._onLayersAddResult);map.addLayers(_853);if(!_857.ignorePopups){EAU._addSelectionLayers(_853,map,_857._clazz);}var _85d=[];dojo.forEach(_854,function(_85e){_85d=_85d.concat(_85e.errors);},this);_858.callback({map:map,itemInfo:_855,errors:_85d,clickEventHandle:_85b,clickEventListener:EAU._showPopup});};EAU._addSelectionLayers=function(_85f,map,_860){var _861=[];dojo.forEach(_85f,function(_862){var _863=_862.__popups;if(_863&&_863.length>1&&_862.version>=10){_862.__deferredsPos=_861.length;_861.push(EAU._getLayersInfo(_862));}});var _864=[];if(_861.length>0){var _865=new dojo.DeferredList(_861);_865.addCallback(function(_866){dojo.forEach(_85f,function(_867){if(_867.__popups&&_867.__popups.length>0){if(_867.__deferredsPos||_867.__deferredsPos===0){var _868=_866[_867.__deferredsPos][1];_864=_864.concat(EAU._createSelectionFeatureLayers(_867,_868.layers,_860,map));delete _867.__deferredsPos;}else{_864=_864.concat(EAU._createSelectionFeatureLayers(_867,null,_860,map));}}});map.addLayers(_864);});}else{dojo.forEach(_85f,function(_869){if(_869.__popups&&_869.__popups.length>0){_864=_864.concat(EAU._createSelectionFeatureLayers(_869,null,_860,map));}});map.addLayers(_864);}};EAU._createSelectionFeatureLayers=function(_86a,_86b,_86c,map){var url=_86a.url;var _86d=_86a.__popups;var ids=_86a.__popupIds;var _86e=_86a.__resourceInfo;var _86f=[];dojo.forEach(_86d,function(_870,_871){var i,_872=null;if(_86b){for(i=0;i<_86b.length;i++){if(_86b[i].id===ids[_871]){_872=_86b[i];break;}}}var _873=new esri.layers.FeatureLayer(EAU._checkUrl(url+"/"+ids[_871]),{id:_86a.id+"_"+ids[_871],outFields:["*"],mode:esri.layers.FeatureLayer.MODE_SELECTION,infoTemplate:_870&&new _86c(_870),drawMode:false,visible:_86a.visible,resourceInfo:_872,autoGeneralize:true});if(_873.loaded){EAU._updateLayerScaleInfo(_86e.layers,_873);}else{dojo.connect(_873,"onLoad",function(_874){EAU._updateLayerScaleInfo(_86e.layers,_874);});}_86f.push(_873);});if(_86f.length>0){var _875=function(_876,_877){dojo.forEach(_876,function(_878){if(_877){_878.show();}else{_878.hide();}});};dojo.connect(_86a,"onVisibilityChange",dojo.hitch(this,_875,_86f));var _879=function(_87a,_87b,_87c){if(_87a.id===_87c.id){dojo.forEach(_87b,function(_87d){map.removeLayer(_87d);});}};dojo.connect(map,"onLayerRemove",dojo.hitch(this,_879,_86a,_86f));}delete _86a.__popups;delete _86a.__popupIds;delete _86a.__resourceInfo;return _86f;};EAU._getServiceInfo=function(url,_87e){var url2=EAU._checkUrl(url);return esri.request({url:url2,content:{f:"json"},callbackParamName:"callback",error:function(_87f,io){if(_87f.message){_87f.message+=" [url:"+url2+"]";}else{_87f.message="[url:"+url2+"]";}_87e.push(_87f);esri.config.defaults.io.errorHandler(_87f,io);}});};EAU._getLayersInfo=function(_880){return esri.request({url:EAU._checkUrl(_880.url+"/layers"),content:{f:"json"},callbackParamName:"callback",error:function(){}});};EAU._initLayer=function(_881,_882,_883,_884){var _885,_886=_883._clazz;if(_881.type==="OpenStreetMap"){_885=new esri.layers.OpenStreetMapLayer({id:_881.id});}else{if(_881.type==="WMS"){var _887=[];var _888=[];dojo.forEach(_881.layers,function(_889){_888.push(new esri.layers.WMSLayerInfo({name:_889.name,title:_889.title,legendURL:_889.legendURL}));_887.push(_889.name);},this);if(_881.visibleLayers){_887=_881.visibleLayers;}var _88a=new esri.geometry.Extent(_881.extent[0][0],_881.extent[0][1],_881.extent[1][0],_881.extent[1][1],new esri.SpatialReference({wkid:4326}));var _88b={extent:_88a,layerInfos:_888,version:_881.version,maxWidth:_881.maxWidth,maxHeight:_881.maxHeight,getMapUrl:_881.mapUrl,spatialReferences:_881.spatialReferences,title:_881.title,copyright:_881.copyright};_885=new esri.layers.WMSLayer(_881.url,{id:_881.id,visibleLayers:_887,format:"png",transparent:_881.baseMapLayer?false:true,opacity:_881.opacity,resourceInfo:_88b});_885.spatialReference.wkid=_88b.spatialReferences[0];}else{if(_881.type==="KML"){_885=new esri.layers.KMLLayer(_881.url,{id:_881.id,outSR:_884});dojo.connect(_885,"onLoad",function(){var _88c=function(_88d){dojo.forEach(_88d,function(_88e){if(_88e.declaredClass==="esri.layers.FeatureLayer"||_88e.declaredClass==="esri.layers.MapImageLayer"){_88e.setOpacity(_881.opacity);}else{if(_88e.declaredClass==="esri.layers.KMLLayer"){if(_88e.loaded){_88c(_88e.getLayers());}else{dojo.connect(_88e,"onLoad",dojo.hitch(this,function(lyr){_88c(lyr.getLayers());}));}}}});};if(_881.opacity!==null){_88c(_885.getLayers());}if(_881.visibleFolders){dojo.forEach(_885.folders,function(_88f){if(dojo.indexOf(_881.visibleFolders,_88f.id)>-1){_885.setFolderVisibility(_88f,true);}else{_885.setFolderVisibility(_88f,false);}},this);}});}else{if(_881.type=="CSV"&&_881.url){_885=new esri.layers.FeatureLayer(_881.featureCollection,{infoTemplate:new esri.dijit.PopupTemplate(_881.popupInfo?_881.popupInfo:esri.arcgis.csv.generateDefaultPopupInfo(_881.featureCollection)),id:_881.id?_881.id:null,outFields:["*"],visible:(_881.visibility!==null)?_881.visibility:true,opacity:_881.opacity?_881.opacity:1,autoGeneralize:true});}else{if(_881.layerDefinition&&!_881.url){var _890=dojo.fromJson(dojo.toJson(_881));delete _890.id;delete _890.opacity;delete _890.visibility;_885=new esri.layers.FeatureLayer(_890,{id:_881.id,opacity:_881.opacity,visible:_881.visibility,outFields:["*"],infoTemplate:_890.popupInfo&&new _886(_890.popupInfo),autoGeneralize:true});}else{if(_881.type==="BingMapsAerial"||_881.type==="BingMapsRoad"||_881.type==="BingMapsHybrid"){var _891=esri.virtualearth.VETiledLayer.MAP_STYLE_AERIAL_WITH_LABELS;if(_881.type==="BingMapsAerial"){_891=esri.virtualearth.VETiledLayer.MAP_STYLE_AERIAL;}else{if(_881.type==="BingMapsRoad"){_891=esri.virtualearth.VETiledLayer.MAP_STYLE_ROAD;}}_885=new esri.virtualearth.VETiledLayer({bingMapsKey:_883.bingMapsKey,mapStyle:_891,id:_881.id});}else{if(_881.resourceInfo&&_881.resourceInfo.mapName){if(_881.resourceInfo.singleFusedMapCache===true){if(!_881.baseMapLayer){if(EAU._sameSpatialReferenceAsBasemap(_881,_882)){if(EAU._sameTilingSchemeAsBasemap(_881,_882)){_885=EAU._loadAsCached(_881);}else{_885=EAU._loadAsDynamic(_881);}}else{_885=EAU._loadAsDynamic(_881);}}else{_885=EAU._loadAsCached(_881);}}else{_885=EAU._loadAsDynamic(_881);}}else{if(_881.resourceInfo&&_881.resourceInfo.pixelSizeX){var _892=new esri.layers.ImageServiceParameters();_892.bandIds=_881.bandIds;if(!_881.bandIds&&_881.resourceInfo.bandCount&&parseInt(_881.resourceInfo.bandCount,10)>3){_892.bandIds=[0,1,2];}_885=new esri.layers.ArcGISImageServiceLayer(EAU._checkUrl(_881.url),{resourceInfo:_881.resourceInfo,opacity:_881.opacity,visible:_881.visibility,id:_881.id,imageServiceParameters:_892});}else{if(_881.resourceInfo&&_881.resourceInfo.type==="Feature Layer"){_885=new esri.layers.FeatureLayer(EAU._checkUrl(_881.url),{resourceInfo:_881.resourceInfo,opacity:_881.opacity,visible:_881.visibility,id:_881.id,mode:esri._isDefined(_881.mode)?_881.mode:esri.layers.FeatureLayer.MODE_ONDEMAND,outFields:["*"],infoTemplate:_881.popupInfo&&new _886(_881.popupInfo),autoGeneralize:true});if(_881.layerDefinition){if(_881.layerDefinition.drawingInfo&&_881.layerDefinition.drawingInfo.renderer){var _893=esri.renderer.fromJson(_881.layerDefinition.drawingInfo.renderer);_885.setRenderer(_893);}if(_881.layerDefinition.definitionExpression){_885.setDefinitionExpression(_881.layerDefinition.definitionExpression);}if(esri._isDefined(_881.layerDefinition.minScale)){_885.minScale=_881.layerDefinition.minScale;}if(esri._isDefined(_881.layerDefinition.maxScale)){_885.maxScale=_881.layerDefinition.maxScale;}}}}}}}}}}}_885.arcgisProps={title:_881.title};return _885;};EAU._loadAsCached=function(_894){var _895=[];if(!_894.displayLevels){_895=dojo.map(_894.resourceInfo.tileInfo.lods,function(lod){return lod.level;});}var _896=new esri.layers.ArcGISTiledMapServiceLayer(EAU._checkUrl(_894.url),{resourceInfo:_894.resourceInfo,opacity:_894.opacity,visible:_894.visibility,displayLevels:_894.displayLevels||_895,id:_894.id});EAU._processPopups(_896,_894);return _896;};EAU._loadAsDynamic=function(_897){var _898=new esri.layers.ImageParameters();_898.format="png24";if(_897.resourceInfo&&_897.resourceInfo.supportedImageFormatTypes&&_897.resourceInfo.supportedImageFormatTypes.indexOf("PNG32")>-1){_898.format="png32";}var _899=new esri.layers.ArcGISDynamicMapServiceLayer(EAU._checkUrl(_897.url),{resourceInfo:_897.resourceInfo,opacity:_897.opacity,visible:_897.visibility,id:_897.id,imageParameters:_898});if(!_897.visibleLayers){var _89a="";var _89b=_899.layerInfos;dojo.forEach(_89b,function(_89c){if(_89c.defaultVisibility){_89a+=(_89a.length>0?",":"")+_89c.id;}});_897.visibleLayers=_89a;}var _89d=EAU._getVisibleFeatureLayers(_899.layerInfos,_897.visibleLayers);_899.setVisibleLayers(_89d);if(_897.layers&&_897.layers.length>0){var _89e=[];dojo.forEach(_897.layers,function(_89f){if(_89f.layerDefinition&&_89f.layerDefinition.definitionExpression){_89e[_89f.id]=_89f.layerDefinition.definitionExpression;}},this);if(_89e.length>0){_899.setLayerDefinitions(_89e);}}EAU._processPopups(_899,_897);return _899;};EAU._processPopups=function(_8a0,_8a1){var _8a2=_8a0.layerInfos;var _8a3=_8a1.layers;if(_8a3&&_8a2){var _8a4=[],ids=[];dojo.forEach(_8a2,function(_8a5){var id=_8a5.id,i;if(!_8a5.subLayerIds&&dojo.indexOf(_8a0.visibleLayers,id)!==-1){for(i=0;i<_8a3.length;i++){var _8a6=_8a3[i];if(_8a6.id===id){ids.push(id);_8a4.push(_8a6.popupInfo);break;}}}});if(_8a4.length){_8a0.__popups=_8a4;_8a0.__popupIds=ids;_8a0.__resourceInfo=_8a1.resourceInfo;}}};EAU._onLayersAddResult=function(_8a7){dojo.forEach(_8a7,function(_8a8){var _8a9=_8a8.layer;if(_8a9.toJson){var json=_8a9.toJson();if(json.featureSet&&_8a9.name.indexOf("Text")>-1){dojo.forEach(json.featureSet.features,function(_8aa,idx){if(_8aa.attributes.TEXT){var _8ab=_8a9.graphics[idx];_8ab.symbol.setText(_8aa.attributes.TEXT);if(_8aa.symbol.horizontalAlignment){_8ab.symbol.align=_8aa.symbol.horizontalAlignment;}_8ab.setSymbol(_8ab.symbol);_8ab.setAttributes(_8aa.attributes);}},this);}}});};EAU._sameSpatialReferenceAsBasemap=function(_8ac,_8ad){var _8ae=[102113,102100,3857];var sp1=_8ad[0].layerObject.fullExtent.spatialReference;var sp2=new esri.SpatialReference(_8ac.resourceInfo.fullExtent.spatialReference);if(dojo.toJson(sp1.toJson())===dojo.toJson(sp2.toJson())){return true;}else{if(dojo.some(_8ae,function(wkid){return wkid===sp2.wkid;})&&dojo.some(_8ae,function(wkid){return wkid===sp1.wkid;})){return true;}}return false;};EAU._sameTilingSchemeAsBasemap=function(_8af,_8b0){if(!_8b0[0].layerObject.tileInfo){return false;}var _8b1=[];dojo.forEach(_8b0,function(_8b2){if(_8b2.baseMapLayer){if(_8b2.layerObject.tileInfo){_8b1=_8b1.concat(dojo.map(_8b2.layerObject.tileInfo.lods,function(lod){return lod.scale;}));}}});var _8b3=dojo.some(_8af.resourceInfo.tileInfo.lods,function(lod){return dojo.some(_8b1,function(_8b4){return _8b4===lod.scale;});});return _8b3;};EAU._showPopup=function(evt){var map=this,_8b5=map.infoWindow,_8b6=evt.graphic;if(!map.loaded){return;}_8b5.hide();_8b5.clearFeatures();var _8b7=[];dojo.forEach(map.graphicsLayerIds,function(_8b8){var _8b9=map.getLayer(_8b8);if(_8b9&&_8b9.declaredClass.indexOf("FeatureLayer")!==-1&&_8b9.loaded&&_8b9.visible){_8b9.clearSelection();if(_8b9.infoTemplate&&!_8b9._suspended){_8b7.push(_8b9);}}});_8b6=(_8b6&&_8b6._getEffInfoTemplate())?_8b6:null;if(!_8b7.length&&!_8b6){return;}var _8ba=EAU._calculateClickTolerance(_8b7);var _8bb=evt.screenPoint,_8bc=map.toMap(new esri.geometry.Point(_8bb.x-_8ba,_8bb.y+_8ba)),_8bd=map.toMap(new esri.geometry.Point(_8bb.x+_8ba,_8bb.y-_8ba)),_8be=new esri.geometry.Extent(_8bc.x,_8bc.y,_8bd.x,_8bd.y,map.spatialReference);var _8bf=new esri.tasks.Query();_8bf.geometry=_8be;_8bf.timeExtent=map.timeExtent;var _8c0=dojo.map(_8b7,function(_8c1){var dfd=_8c1.selectFeatures(_8bf);dfd.addCallback(function(){var _8c2=_8c1.getSelectedFeatures();return _8c2;});return dfd;});if(_8b6){var dfd=new dojo.Deferred();dfd.callback([_8b6]);_8c0.splice(0,0,dfd);}var _8c3=dojo.some(_8c0,function(dfd){return dfd.fired===-1;});if(!_8c3){var _8c4=_8b6?1:0;dojo.forEach(_8b7,function(_8c5){_8c4=_8c4+_8c5.getSelectedFeatures().length;});if(!_8c4){return;}}_8b5.setFeatures(_8c0);_8b5.show(evt.mapPoint);};EAU._calculateClickTolerance=function(_8c6){var _8c7=6;dojo.forEach(_8c6,function(_8c8){var _8c9=_8c8.renderer;if(_8c9.declaredClass==="esri.renderer.SimpleRenderer"){var _8ca=_8c9.symbol;if(_8ca&&_8ca.xoffset){_8c7=Math.max(_8c7,Math.abs(_8ca.xoffset));}if(_8ca&&_8ca.yoffset){_8c7=Math.max(_8c7,Math.abs(_8ca.yoffset));}}else{if(_8c9.declaredClass==="esri.renderer.UniqueValueRenderer"||_8c9.declaredClass==="esri.renderer.ClassBreaksRenderer"){dojo.forEach(_8c9.infos,function(info){var _8cb=info.symbol;if(_8cb&&_8cb.xoffset){_8c7=Math.max(_8c7,Math.abs(_8cb.xoffset));}if(_8cb&&_8cb.yoffset){_8c7=Math.max(_8c7,Math.abs(_8cb.yoffset));}});}}});return _8c7;};EAU._getVisibleFeatureLayers=function(_8cc,_8cd){if(!_8cc||!_8cd||_8cd.length===0){return [];}var _8ce=","+_8cd+",";var _8cf=[];var _8d0="";var k,_8d1=",";for(k=0;k<_8cc.length;k++){if(_8cc[k].subLayerIds!==null){if(_8ce.indexOf(","+_8cc[k].id+",")===-1||_8d1.indexOf(","+_8cc[k].id+",")>-1){_8d1+=_8cc[k].subLayerIds.toString()+",";}}else{if(_8ce.indexOf(","+_8cc[k].id+",")>-1&&_8d1.indexOf(","+_8cc[k].id+",")===-1){_8cf.push(_8cc[k].id);_8d0=",";}}}return _8cf;};EAU._updateLayerScaleInfo=function(_8d2,_8d3){if(_8d3.version<=10.1&&_8d2){var i,id=parseInt(_8d3.url.substring(_8d3.url.lastIndexOf("/")+1,_8d3.url.length));for(i=_8d2.length-1;i>=0;i--){if(_8d2[i].id==id){if(_8d3.minScale==0&&_8d2[i].minScale>0){_8d3.minScale=_8d2[i].minScale;}else{if(_8d3.minScale>0&&_8d2[i].minScale==0){_8d3.minScale=_8d3.minScale;}else{if(_8d3.minScale>0&&_8d2[i].minScale>0){_8d3.minScale=Math.min(_8d3.minScale,_8d2[i].minScale);}}}_8d3.maxScale=Math.max(_8d3.maxScale||0,_8d2[i].maxScale||0);if(_8d2[i].parentLayerId>-1){id=_8d2[i].parentLayerId;}else{break;}}}}};EAU._checkUrl=function(url){if(location.protocol==="https:"&&(EAU._isHostedService(url)||EAU._isAgolService(url))){url=url.replace("http:","https:");}return url;};EAU._isHostedService=function(url){if(!url){return false;}var _8d4=".arcgis.com/";var _8d5=(new dojo._Url(EAU.arcgisUrl)).authority;return (url.indexOf(_8d4)!==-1||url.indexOf(_8d5)!==-1);};EAU._isAgolService=function(url){if(!url){return false;}return (url.indexOf("/services.arcgisonline.com/")!==-1||url.indexOf("/server.arcgisonline.com/")!==-1);};}());}
