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

window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","esri.tasks._task"],["provide","esri.tasks.query"],["provide","dojo.io.iframe"],["provide","dojo.cldr.supplemental"],["provide","dojo.regexp"],["provide","dojo.string"],["provide","dojo.date.locale"],["provide","esri.layers.FeatureLayer"],["provide","esri.toolbars._toolbar"],["provide","esri.toolbars.draw"],["provide","dojox.gfx.Mover"],["provide","dojox.gfx.Moveable"],["provide","dojox.gfx.move"],["provide","esri.toolbars._GraphicMover"],["provide","dojo.window"],["provide","dojo.Stateful"],["provide","dijit._WidgetBase"],["provide","dijit._base.focus"],["provide","dojo.AdapterRegistry"],["provide","dijit._base.place"],["provide","dijit._base.window"],["provide","dijit._base.popup"],["provide","dijit._base.scroll"],["provide","dojo.uacss"],["provide","dijit._base.sniff"],["provide","dijit._base.typematic"],["provide","dijit._base.wai"],["provide","dijit._base"],["provide","dijit._Widget"],["provide","dijit._Container"],["provide","dijit._KeyNavContainer"],["provide","dojo.date.stamp"],["provide","dojo.parser"],["provide","dojo.cache"],["provide","dijit._Templated"],["provide","dijit._Contained"],["provide","dijit._CssStateMixin"],["provide","dijit.MenuItem"],["provide","dijit.PopupMenuItem"],["provide","dijit.CheckedMenuItem"],["provide","dijit.MenuSeparator"],["provide","dijit.Menu"],["provide","esri.toolbars._VertexMover"],["provide","esri.toolbars._VertexEditor"],["provide","esri.toolbars._Box"],["provide","esri.toolbars.edit"],["provide","dojo.data.util.filter"],["provide","dojo.data.util.sorter"],["provide","dojo.data.util.simpleFetch"],["provide","dojo.data.ItemFileReadStore"],["provide","dijit.layout._LayoutWidget"],["provide","dijit.form._FormWidget"],["provide","dijit.dijit"],["provide","dojox.html.metrics"],["provide","dojox.grid.util"],["provide","dojox.grid._Scroller"],["provide","dojox.grid.cells._base"],["provide","dojox.grid.cells"],["provide","dojo.dnd.common"],["provide","dojo.dnd.autoscroll"],["provide","dojo.dnd.Mover"],["provide","dojo.dnd.Moveable"],["provide","dojox.grid._Builder"],["provide","dojo.dnd.Container"],["provide","dojo.dnd.Selector"],["provide","dojo.dnd.Avatar"],["provide","dojo.dnd.Manager"],["provide","dojo.dnd.Source"],["provide","dojox.grid._View"],["provide","dojox.grid._RowSelector"],["provide","dojox.grid._Layout"],["provide","dojox.grid._ViewManager"],["provide","dojox.grid._RowManager"],["provide","dojox.grid._FocusManager"],["provide","dojox.grid._EditManager"],["provide","dojox.grid.Selection"],["provide","dojox.grid._Events"],["provide","dojox.grid._Grid"],["provide","dojox.grid.DataSelection"],["provide","dojox.grid.DataGrid"],["provide","esri.dijit.editing.TemplatePicker"],["provide","esri.dijit.editing.TemplatePicker-all"],["i18n._preloadLocalizations","esri.dijit.editing.nls.TemplatePicker-all",["ROOT","ar","ca","cs","da","de","de-de","el","en","en-gb","en-us","es","es-es","fi","fi-fi","fr","fr-fr","he","he-il","hu","it","it-it","ja","ja-jp","ko","ko-kr","nb","nl","nl-nl","pl","pt","pt-br","pt-pt","ru","sk","sl","sv","th","tr","xx","zh","zh-cn","zh-tw"]]],defineResource:function(_4,_5,_6){if(!_4._hasResource["esri.tasks._task"]){_4._hasResource["esri.tasks._task"]=true;_4.provide("esri.tasks._task");_4.declare("esri.tasks._Task",null,{constructor:function(_7){if(_7&&_4.isString(_7)){this._url=esri.urlToObject(this.url=_7);}this.normalization=true;this._errorHandler=_4.hitch(this,this._errorHandler);},_encode:function(_8,_9,_a){var _b,_c,_d={},i,p,pl;for(i in _8){if(i==="declaredClass"){continue;}_b=_8[i];_c=typeof (_b);if(_b!==null&&_b!==undefined&&_c!=="function"){if(_4.isArray(_b)){_d[i]=[];pl=_b.length;for(p=0;p<pl;p++){_d[i][p]=this._encode(_b[p]);}}else{if(_c==="object"){if(_b.toJson){var _e=_b.toJson(_a&&_a[i]);if(_b instanceof esri.tasks.FeatureSet){if(_e.spatialReference){_e.sr=_e.spatialReference;delete _e.spatialReference;}}_d[i]=_9?_e:_4.toJson(_e);}}else{_d[i]=_b;}}}}return _d;},_successHandler:function(_f,_10,_11,dfd){if(_10){this[_10].apply(this,_f);}if(_11){_11.apply(null,_f);}if(dfd){esri._resDfd(dfd,_f);}},_errorHandler:function(err,_12,dfd){this.onError(err);if(_12){_12(err);}if(dfd){dfd.errback(err);}},setNormalization:function(_13){this.normalization=_13;},onError:function(){}});_4.declare("esri.tasks.FeatureSet",null,{constructor:function(_14){if(_14){_4.mixin(this,_14);var _15=this.features,sr=_14.spatialReference,_16=esri.Graphic,_17=esri.geometry.getGeometryType(_14.geometryType);sr=(this.spatialReference=new esri.SpatialReference(sr));this.geometryType=_14.geometryType;if(_14.fields){this.fields=_14.fields;}_4.forEach(_15,function(_18,i){var _19=_18.geometry&&_18.geometry.spatialReference;_15[i]=new _16((_17&&_18.geometry)?new _17(_18.geometry):null,_18.symbol&&esri.symbol.fromJson(_18.symbol),_18.attributes);if(_15[i].geometry&&!_19){_15[i].geometry.setSpatialReference(sr);}});}else{this.features=[];}},displayFieldName:null,geometryType:null,spatialReference:null,fields:[],features:[],fieldAliases:null,toJson:function(_1a){var _1b={};if(this.displayFieldName){_1b.displayFieldName=this.displayFieldName;}if(this.fields){_1b.fields=this.fields;}if(this.spatialReference){_1b.spatialReference=this.spatialReference.toJson();}else{if(this.features[0]&&this.features[0].geometry){_1b.spatialReference=this.features[0].geometry.spatialReference.toJson();}}if(this.features[0]){if(this.features[0].geometry){_1b.geometryType=esri.geometry.getJsonType(this.features[0].geometry);}_1b.features=esri._encodeGraphics(this.features,_1a);}_1b.exceededTransferLimit=this.exceededTransferLimit;return esri._sanitize(_1b);}});esri.tasks._SpatialRelationship={SPATIAL_REL_INTERSECTS:"esriSpatialRelIntersects",SPATIAL_REL_CONTAINS:"esriSpatialRelContains",SPATIAL_REL_CROSSES:"esriSpatialRelCrosses",SPATIAL_REL_ENVELOPEINTERSECTS:"esriSpatialRelEnvelopeIntersects",SPATIAL_REL_INDEXINTERSECTS:"esriSpatialRelIndexIntersects",SPATIAL_REL_OVERLAPS:"esriSpatialRelOverlaps",SPATIAL_REL_TOUCHES:"esriSpatialRelTouches",SPATIAL_REL_WITHIN:"esriSpatialRelWithin",SPATIAL_REL_RELATION:"esriSpatialRelRelation"};}if(!_4._hasResource["esri.tasks.query"]){_4._hasResource["esri.tasks.query"]=true;_4.provide("esri.tasks.query");_4.declare("esri.tasks.QueryTask",esri.tasks._Task,{constructor:function(url,_1c){this._handler=_4.hitch(this,this._handler);this._relationshipQueryHandler=_4.hitch(this,this._relationshipQueryHandler);this._executeForIdsHandler=_4.hitch(this,this._executeForIdsHandler);this._countHandler=_4.hitch(this,this._countHandler);this.source=_1c&&_1c.source;this.gdbVersion=_1c&&_1c.gdbVersion;},__msigns:[{n:"execute",c:4,a:[{i:0,p:["geometry"]}],e:2},{n:"executeForIds",c:3,a:[{i:0,p:["geometry"]}],e:2},{n:"executeForCount",c:3,a:[{i:0,p:["geometry"]}],e:2}],onComplete:function(){},onExecuteRelationshipQueryComplete:function(){},onExecuteForIdsComplete:function(){},onExecuteForCountComplete:function(){},execute:function(_1d,_1e,_1f,_20,_21){var _22=_21.assembly,_23=this._encode(_4.mixin({},this._url.query,{f:"json"},_1d.toJson(_22&&_22[0]))),_24=this._handler,_25=this._errorHandler;if(this.source){var _26={source:this.source.toJson()};_23.layer=_4.toJson(_26);}if(this.gdbVersion){_23.gdbVersion=this.gdbVersion;}return esri.request({url:this._url.path+"/query",content:_23,callbackParamName:"callback",load:function(r,i){_24(r,i,_1e,_1f,_21.dfd);},error:function(r){_25(r,_1f,_21.dfd);},callbackSuffix:_20});},executeRelationshipQuery:function(_27,_28,_29){var _2a=this._encode(_4.mixin({},this._url.query,{f:"json"},_27.toJson())),_2b=this._relationshipQueryHandler,_2c=this._errorHandler;if(this.gdbVersion){_2a.gdbVersion=this.gdbVersion;}var dfd=new _4.Deferred(esri._dfdCanceller);dfd._pendingDfd=esri.request({url:this._url.path+"/queryRelatedRecords",content:_2a,callbackParamName:"callback",load:function(r,i){_2b(r,i,_28,_29,dfd);},error:function(r){_2c(r,_29,dfd);}});return dfd;},executeForIds:function(_2d,_2e,_2f,_30){var _31=_30.assembly,_32=this._encode(_4.mixin({},this._url.query,{f:"json",returnIdsOnly:true},_2d.toJson(_31&&_31[0]))),_33=this._executeForIdsHandler,_34=this._errorHandler;if(this.source){var _35={source:this.source.toJson()};_32.layer=_4.toJson(_35);}if(this.gdbVersion){_32.gdbVersion=this.gdbVersion;}return esri.request({url:this._url.path+"/query",content:_32,callbackParamName:"callback",load:function(r,i){_33(r,i,_2e,_2f,_30.dfd);},error:function(r){_34(r,_2f,_30.dfd);}});},executeForCount:function(_36,_37,_38,_39){var _3a=_39.assembly,_3b=this._encode(_4.mixin({},this._url.query,{f:"json",returnIdsOnly:true,returnCountOnly:true},_36.toJson(_3a&&_3a[0]))),_3c=this._countHandler,_3d=this._errorHandler;if(this.source){var _3e={source:this.source.toJson()};_3b.layer=_4.toJson(_3e);}if(this.gdbVersion){_3b.gdbVersion=this.gdbVersion;}return esri.request({url:this._url.path+"/query",content:_3b,callbackParamName:"callback",load:function(r,i){_3c(r,i,_37,_38,_39.dfd);},error:function(r){_3d(r,_38,_39.dfd);}});},_handler:function(_3f,io,_40,_41,dfd){try{var _42=new esri.tasks.FeatureSet(_3f);this._successHandler([_42],"onComplete",_40,dfd);}catch(err){this._errorHandler(err,_41,dfd);}},_relationshipQueryHandler:function(_43,io,_44,_45,dfd){try{var gt=_43.geometryType,sr=_43.spatialReference,_46={};_4.forEach(_43.relatedRecordGroups,function(gr){var _47={};_47.geometryType=gt;_47.spatialReference=sr;_47.features=gr.relatedRecords;var _48=new esri.tasks.FeatureSet(_47);_46[gr.objectId]=_48;});this._successHandler([_46],"onExecuteRelationshipQueryComplete",_44,dfd);}catch(err){this._errorHandler(err,_45,dfd);}},_executeForIdsHandler:function(_49,io,_4a,_4b,dfd){try{this._successHandler([_49.objectIds],"onExecuteForIdsComplete",_4a,dfd);}catch(err){this._errorHandler(err,_4b,dfd);}},_countHandler:function(_4c,io,_4d,_4e,dfd){try{var _4f,_50=_4c.features,ids=_4c.objectIds;if(ids){_4f=ids.length;}else{if(_50){throw new Error(esri.bundle.tasks.query.invalid);}else{_4f=_4c.count;}}this._successHandler([_4f],"onExecuteForCountComplete",_4d,dfd);}catch(err){this._errorHandler(err,_4e,dfd);}}});esri._createWrappers("esri.tasks.QueryTask");_4.declare("esri.tasks.Query",null,{constructor:function(){this.spatialRelationship=esri.tasks.Query.SPATIAL_REL_INTERSECTS;},text:null,where:"",geometry:null,groupByFieldsForStatistics:null,objectIds:null,returnGeometry:false,orderByFields:null,outSpatialReference:null,outFields:null,outStatistics:null,timeExtent:null,relationParam:null,toJson:function(_51){var _52={text:this.text,where:this.where,returnGeometry:this.returnGeometry,spatialRel:this.spatialRelationship,maxAllowableOffset:this.maxAllowableOffset},g=_51&&_51["geometry"]||this.geometry,ids=this.objectIds,_53=this.outFields,_54=this.outSpatialReference,_55=this.groupByFieldsForStatistics,_56=this.orderByFields,_57=this.outStatistics;if(g){_52.geometry=g;_52.geometryType=esri.geometry.getJsonType(g);_52.inSR=g.spatialReference.wkid||_4.toJson(g.spatialReference.toJson());}if(ids){_52.objectIds=ids.join(",");}if(_53){_52.outFields=_53.join(",");}if(_55){_52.groupByFieldsForStatistics=_55.join(",");}if(_56){_52.orderByFields=_56.join(",");}if(_57){var _58=[];_4.forEach(_57,function(_59,idx){_58.push(_59.toJson());});_52.outStatistics=_4.toJson(_58);}if(_54!==null){_52.outSR=_54.wkid||_4.toJson(_54.toJson());}else{if(g){_52.outSR=g.spatialReference.wkid||_4.toJson(g.spatialReference.toJson());}}var _5a=this.timeExtent;_52.time=_5a?_5a.toJson().join(","):null;var _5b=this.relationParam;if(_5b&&this.spatialRelationship===esri.tasks.Query.SPATIAL_REL_RELATION){_52.relationParam=_5b;}_52._ts=this._ts;return _52;}});_4.mixin(esri.tasks.Query,esri.tasks._SpatialRelationship);_4.declare("esri.tasks.RelationshipQuery",null,{definitionExpression:"",relationshipId:null,returnGeometry:false,objectIds:null,outSpatialReference:null,outFields:null,toJson:function(){var _5c={definitionExpression:this.definitionExpression,relationshipId:this.relationshipId,returnGeometry:this.returnGeometry,maxAllowableOffset:this.maxAllowableOffset},_5d=this.objectIds,_5e=this.outFields,_5f=this.outSpatialReference;if(_5d){_5c.objectIds=_5d.join(",");}if(_5e){_5c.outFields=_5e.join(",");}if(_5f){_5c.outSR=_5f.toJson();}_5c._ts=this._ts;return _5c;}});_4.declare("esri.tasks.StatisticDefinition",null,{statisticType:null,onStatisticField:null,outStatisticFieldName:null,toJson:function(){var _60={statisticType:this.statisticType,onStatisticField:this.onStatisticField};if(this.outStatisticFieldName){_60.outStatisticFieldName=this.outStatisticFieldName;}return _60;}});}if(!_4._hasResource["dojo.io.iframe"]){_4._hasResource["dojo.io.iframe"]=true;_4.provide("dojo.io.iframe");_4.getObject("io",true,_4);_4.io.iframe={create:function(_61,_62,uri){if(window[_61]){return window[_61];}if(window.frames[_61]){return window.frames[_61];}var _63=null;var _64=uri;if(!_64){if(_4.config["useXDomain"]&&!_4.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");}_64=(_4.config["dojoBlankHtmlUrl"]||_4.moduleUrl("dojo","resources/blank.html"));}var _63=_4.place("<iframe id=\""+_61+"\" name=\""+_61+"\" src=\""+_64+"\" onload=\""+_62+"\" style=\"position: absolute; left: 1px; top: 1px; height: 1px; width: 1px; visibility: hidden\">",_4.body());window[_61]=_63;return _63;},setSrc:function(_65,src,_66){try{if(!_66){if(_4.isWebKit){_65.location=src;}else{frames[_65.name].location=src;}}else{var _67;if(_4.isIE||_4.isWebKit){_67=_65.contentWindow.document;}else{_67=_65.contentWindow;}if(!_67){_65.location=src;return;}else{_67.location.replace(src);}}}catch(e){console.log("dojo.io.iframe.setSrc: ",e);}},doc:function(_68){var doc=_68.contentDocument||(((_68.name)&&(_68.document)&&(_4.doc.getElementsByTagName("iframe")[_68.name].contentWindow)&&(_4.doc.getElementsByTagName("iframe")[_68.name].contentWindow.document)))||((_68.name)&&(_4.doc.frames[_68.name])&&(_4.doc.frames[_68.name].document))||null;return doc;},send:function(_69){if(!this["_frame"]){this._frame=this.create(this._iframeName,_4._scopeName+".io.iframe._iframeOnload();");}var dfd=_4._ioSetArgs(_69,function(dfd){dfd.canceled=true;dfd.ioArgs._callNext();},function(dfd){var _6a=null;try{var _6b=dfd.ioArgs;var dii=_4.io.iframe;var ifd=dii.doc(dii._frame);var _6c=_6b.handleAs;_6a=ifd;if(_6c!="html"){if(_6c=="xml"){if(_4.isIE<9||(_4.isIE&&_4.isQuirks)){_4.query("a",dii._frame.contentWindow.document.documentElement).orphan();var _6d=(dii._frame.contentWindow.document).documentElement.innerText;_6d=_6d.replace(/>\s+</g,"><");_6d=_4.trim(_6d);var _6e={responseText:_6d};_6a=_4._contentHandlers["xml"](_6e);}}else{_6a=ifd.getElementsByTagName("textarea")[0].value;if(_6c=="json"){_6a=_4.fromJson(_6a);}else{if(_6c=="javascript"){_6a=_4.eval(_6a);}}}}}catch(e){_6a=e;}finally{_6b._callNext();}return _6a;},function(_6f,dfd){dfd.ioArgs._hasError=true;dfd.ioArgs._callNext();return _6f;});dfd.ioArgs._callNext=function(){if(!this["_calledNext"]){this._calledNext=true;_4.io.iframe._currentDfd=null;_4.io.iframe._fireNextRequest();}};this._dfdQueue.push(dfd);this._fireNextRequest();_4._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:_4._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 _70=dfd.ioArgs;var _71=_70.args;_70._contentToClean=[];var fn=_4.byId(_71["form"]);var _72=_71["content"]||{};if(fn){if(_72){var _73=function(_74,_75){_4.create("input",{type:"hidden",name:_74,value:_75},fn);_70._contentToClean.push(_74);};for(var x in _72){var val=_72[x];if(_4.isArray(val)&&val.length>1){var i;for(i=0;i<val.length;i++){_73(x,val[i]);}}else{if(!fn[x]){_73(x,val);}else{fn[x].value=val;}}}}var _76=fn.getAttributeNode("action");var _77=fn.getAttributeNode("method");var _78=fn.getAttributeNode("target");if(_71["url"]){_70._originalAction=_76?_76.value:null;if(_76){_76.value=_71.url;}else{fn.setAttribute("action",_71.url);}}if(!_77||!_77.value){if(_77){_77.value=(_71["method"])?_71["method"]:"post";}else{fn.setAttribute("method",(_71["method"])?_71["method"]:"post");}}_70._originalTarget=_78?_78.value:null;if(_78){_78.value=this._iframeName;}else{fn.setAttribute("target",this._iframeName);}fn.target=this._iframeName;_4._ioNotifyStart(dfd);fn.submit();}else{var _79=_71.url+(_71.url.indexOf("?")>-1?"&":"?")+_70.query;_4._ioNotifyStart(dfd);this.setSrc(this._frame,_79,true);}}catch(e){dfd.errback(e);}},_iframeOnload:function(){var dfd=this._currentDfd;if(!dfd){this._fireNextRequest();return;}var _7a=dfd.ioArgs;var _7b=_7a.args;var _7c=_4.byId(_7b.form);if(_7c){var _7d=_7a._contentToClean;for(var i=0;i<_7d.length;i++){var key=_7d[i];for(var j=0;j<_7c.childNodes.length;j++){var _7e=_7c.childNodes[j];if(_7e.name==key){_4.destroy(_7e);break;}}}if(_7a["_originalAction"]){_7c.setAttribute("action",_7a._originalAction);}if(_7a["_originalTarget"]){_7c.setAttribute("target",_7a._originalTarget);_7c.target=_7a._originalTarget;}}_7a._finished=true;}};}if(!_4._hasResource["dojo.cldr.supplemental"]){_4._hasResource["dojo.cldr.supplemental"]=true;_4.provide("dojo.cldr.supplemental");_4.getObject("cldr.supplemental",true,_4);_4.cldr.supplemental.getFirstDayOfWeek=function(_7f){var _80={mv:5,ae:6,af:6,bh:6,dj:6,dz:6,eg:6,er:6,et:6,iq:6,ir:6,jo:6,ke:6,kw:6,ly:6,ma:6,om:6,qa:6,sa:6,sd:6,so:6,sy:6,tn:6,ye:6,ar:0,as:0,az:0,bw:0,ca:0,cn:0,fo:0,ge:0,gl:0,gu:0,hk:0,il:0,"in":0,jm:0,jp:0,kg:0,kr:0,la:0,mh:0,mn:0,mo:0,mp:0,mt:0,nz:0,ph:0,pk:0,sg:0,th:0,tt:0,tw:0,um:0,us:0,uz:0,vi:0,zw:0};var _81=_4.cldr.supplemental._region(_7f);var dow=_80[_81];return (dow===undefined)?1:dow;};_4.cldr.supplemental._region=function(_82){_82=_4.i18n.normalizeLocale(_82);var _83=_82.split("-");var _84=_83[1];if(!_84){_84={de:"de",en:"us",es:"es",fi:"fi",fr:"fr",he:"il",hu:"hu",it:"it",ja:"jp",ko:"kr",nl:"nl",pt:"br",sv:"se",zh:"cn"}[_83[0]];}else{if(_84.length==4){_84=_83[2];}}return _84;};_4.cldr.supplemental.getWeekend=function(_85){var _86={"in":0,af:4,dz:4,ir:4,om:4,sa:4,ye:4,ae:5,bh:5,eg:5,il:5,iq:5,jo:5,kw:5,ly:5,ma:5,qa:5,sd:5,sy:5,tn:5};var _87={af:5,dz:5,ir:5,om:5,sa:5,ye:5,ae:6,bh:5,eg:6,il:6,iq:6,jo:6,kw:6,ly:6,ma:6,qa:6,sd:6,sy:6,tn:6};var _88=_4.cldr.supplemental._region(_85);var _89=_86[_88];var end=_87[_88];if(_89===undefined){_89=6;}if(end===undefined){end=0;}return {start:_89,end:end};};}if(!_4._hasResource["dojo.regexp"]){_4._hasResource["dojo.regexp"]=true;_4.provide("dojo.regexp");_4.getObject("regexp",true,_4);_4.regexp.escapeString=function(str,_8a){return str.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,function(ch){if(_8a&&_8a.indexOf(ch)!=-1){return ch;}return "\\"+ch;});};_4.regexp.buildGroupRE=function(arr,re,_8b){if(!(arr instanceof Array)){return re(arr);}var b=[];for(var i=0;i<arr.length;i++){b.push(re(arr[i]));}return _4.regexp.group(b.join("|"),_8b);};_4.regexp.group=function(_8c,_8d){return "("+(_8d?"?:":"")+_8c+")";};}if(!_4._hasResource["dojo.string"]){_4._hasResource["dojo.string"]=true;_4.provide("dojo.string");_4.getObject("string",true,_4);_4.string.rep=function(str,num){if(num<=0||!str){return "";}var buf=[];for(;;){if(num&1){buf.push(str);}if(!(num>>=1)){break;}str+=str;}return buf.join("");};_4.string.pad=function(_8e,_8f,ch,end){if(!ch){ch="0";}var out=String(_8e),pad=_4.string.rep(ch,Math.ceil((_8f-out.length)/ch.length));return end?out+pad:pad+out;};_4.string.substitute=function(_90,map,_91,_92){_92=_92||_4.global;_91=_91?_4.hitch(_92,_91):function(v){return v;};return _90.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,function(_93,key,_94){var _95=_4.getObject(key,false,map);if(_94){_95=_4.getObject(_94,false,_92).call(_92,_95,key);}return _91(_95,key).toString();});};_4.string.trim=String.prototype.trim?_4.trim:function(str){str=str.replace(/^\s+/,"");for(var i=str.length-1;i>=0;i--){if(/\S/.test(str.charAt(i))){str=str.substring(0,i+1);break;}}return str;};}if(!_4._hasResource["dojo.date.locale"]){_4._hasResource["dojo.date.locale"]=true;_4.provide("dojo.date.locale");_4.getObject("date.locale",true,_4);(function(){function _96(_97,_98,_99,_9a){return _9a.replace(/([a-z])\1*/ig,function(_9b){var s,pad,c=_9b.charAt(0),l=_9b.length,_9c=["abbr","wide","narrow"];switch(c){case "G":s=_98[(l<4)?"eraAbbr":"eraNames"][_97.getFullYear()<0?0:1];break;case "y":s=_97.getFullYear();switch(l){case 1:break;case 2:if(!_99.fullYear){s=String(s);s=s.substr(s.length-2);break;}default:pad=true;}break;case "Q":case "q":s=Math.ceil((_97.getMonth()+1)/3);pad=true;break;case "M":var m=_97.getMonth();if(l<3){s=m+1;pad=true;}else{var _9d=["months","format",_9c[l-3]].join("-");s=_98[_9d][m];}break;case "w":var _9e=0;s=_4.date.locale._getWeekOfYear(_97,_9e);pad=true;break;case "d":s=_97.getDate();pad=true;break;case "D":s=_4.date.locale._getDayOfYear(_97);pad=true;break;case "E":var d=_97.getDay();if(l<3){s=d+1;pad=true;}else{var _9f=["days","format",_9c[l-3]].join("-");s=_98[_9f][d];}break;case "a":var _a0=(_97.getHours()<12)?"am":"pm";s=_99[_a0]||_98["dayPeriods-format-wide-"+_a0];break;case "h":case "H":case "K":case "k":var h=_97.getHours();switch(c){case "h":s=(h%12)||12;break;case "H":s=h;break;case "K":s=(h%12);break;case "k":s=h||24;break;}pad=true;break;case "m":s=_97.getMinutes();pad=true;break;case "s":s=_97.getSeconds();pad=true;break;case "S":s=Math.round(_97.getMilliseconds()*Math.pow(10,l-3));pad=true;break;case "v":case "z":s=_4.date.locale._getZone(_97,true,_99);if(s){break;}l=4;case "Z":var _a1=_4.date.locale._getZone(_97,false,_99);var tz=[(_a1<=0?"+":"-"),_4.string.pad(Math.floor(Math.abs(_a1)/60),2),_4.string.pad(Math.abs(_a1)%60,2)];if(l==4){tz.splice(0,0,"GMT");tz.splice(3,0,":");}s=tz.join("");break;default:throw new Error("dojo.date.locale.format: invalid pattern char: "+_9a);}if(pad){s=_4.string.pad(s,l);}return s;});};_4.date.locale._getZone=function(_a2,_a3,_a4){if(_a3){return _4.date.getTimezoneName(_a2);}else{return _a2.getTimezoneOffset();}};_4.date.locale.format=function(_a5,_a6){_a6=_a6||{};var _a7=_4.i18n.normalizeLocale(_a6.locale),_a8=_a6.formatLength||"short",_a9=_4.date.locale._getGregorianBundle(_a7),str=[],_aa=_4.hitch(this,_96,_a5,_a9,_a6);if(_a6.selector=="year"){return _ab(_a9["dateFormatItem-yyyy"]||"yyyy",_aa);}var _ac;if(_a6.selector!="date"){_ac=_a6.timePattern||_a9["timeFormat-"+_a8];if(_ac){str.push(_ab(_ac,_aa));}}if(_a6.selector!="time"){_ac=_a6.datePattern||_a9["dateFormat-"+_a8];if(_ac){str.push(_ab(_ac,_aa));}}return str.length==1?str[0]:_a9["dateTimeFormat-"+_a8].replace(/\{(\d+)\}/g,function(_ad,key){return str[key];});};_4.date.locale.regexp=function(_ae){return _4.date.locale._parseInfo(_ae).regexp;};_4.date.locale._parseInfo=function(_af){_af=_af||{};var _b0=_4.i18n.normalizeLocale(_af.locale),_b1=_4.date.locale._getGregorianBundle(_b0),_b2=_af.formatLength||"short",_b3=_af.datePattern||_b1["dateFormat-"+_b2],_b4=_af.timePattern||_b1["timeFormat-"+_b2],_b5;if(_af.selector=="date"){_b5=_b3;}else{if(_af.selector=="time"){_b5=_b4;}else{_b5=_b1["dateTimeFormat-"+_b2].replace(/\{(\d+)\}/g,function(_b6,key){return [_b4,_b3][key];});}}var _b7=[],re=_ab(_b5,_4.hitch(this,_b8,_b7,_b1,_af));return {regexp:re,tokens:_b7,bundle:_b1};};_4.date.locale.parse=function(_b9,_ba){var _bb=/[\u200E\u200F\u202A\u202E]/g,_bc=_4.date.locale._parseInfo(_ba),_bd=_bc.tokens,_be=_bc.bundle,re=new RegExp("^"+_bc.regexp.replace(_bb,"")+"$",_bc.strict?"":"i"),_bf=re.exec(_b9&&_b9.replace(_bb,""));if(!_bf){return null;}var _c0=["abbr","wide","narrow"],_c1=[1970,0,1,0,0,0,0],_c2="",_c3=_4.every(_bf,function(v,i){if(!i){return true;}var _c4=_bd[i-1];var l=_c4.length;switch(_c4.charAt(0)){case "y":if(l!=2&&_ba.strict){_c1[0]=v;}else{if(v<100){v=Number(v);var _c5=""+new Date().getFullYear(),_c6=_c5.substring(0,2)*100,_c7=Math.min(Number(_c5.substring(2,4))+20,99),num=(v<_c7)?_c6+v:_c6-100+v;_c1[0]=num;}else{if(_ba.strict){return false;}_c1[0]=v;}}break;case "M":if(l>2){var _c8=_be["months-format-"+_c0[l-3]].concat();if(!_ba.strict){v=v.replace(".","").toLowerCase();_c8=_4.map(_c8,function(s){return s.replace(".","").toLowerCase();});}v=_4.indexOf(_c8,v);if(v==-1){return false;}}else{v--;}_c1[1]=v;break;case "E":case "e":var _c9=_be["days-format-"+_c0[l-3]].concat();if(!_ba.strict){v=v.toLowerCase();_c9=_4.map(_c9,function(d){return d.toLowerCase();});}v=_4.indexOf(_c9,v);if(v==-1){return false;}break;case "D":_c1[1]=0;case "d":_c1[2]=v;break;case "a":var am=_ba.am||_be["dayPeriods-format-wide-am"],pm=_ba.pm||_be["dayPeriods-format-wide-pm"];if(!_ba.strict){var _ca=/\./g;v=v.replace(_ca,"").toLowerCase();am=am.replace(_ca,"").toLowerCase();pm=pm.replace(_ca,"").toLowerCase();}if(_ba.strict&&v!=am&&v!=pm){return false;}_c2=(v==pm)?"p":(v==am)?"a":"";break;case "K":if(v==24){v=0;}case "h":case "H":case "k":if(v>23){return false;}_c1[3]=v;break;case "m":_c1[4]=v;break;case "s":_c1[5]=v;break;case "S":_c1[6]=v;}return true;});var _cb=+_c1[3];if(_c2==="p"&&_cb<12){_c1[3]=_cb+12;}else{if(_c2==="a"&&_cb==12){_c1[3]=0;}}var _cc=new Date(_c1[0],_c1[1],_c1[2],_c1[3],_c1[4],_c1[5],_c1[6]);if(_ba.strict){_cc.setFullYear(_c1[0]);}var _cd=_bd.join(""),_ce=_cd.indexOf("d")!=-1,_cf=_cd.indexOf("M")!=-1;if(!_c3||(_cf&&_cc.getMonth()>_c1[1])||(_ce&&_cc.getDate()>_c1[2])){return null;}if((_cf&&_cc.getMonth()<_c1[1])||(_ce&&_cc.getDate()<_c1[2])){_cc=_4.date.add(_cc,"hour",1);}return _cc;};function _ab(_d0,_d1,_d2,_d3){var _d4=function(x){return x;};_d1=_d1||_d4;_d2=_d2||_d4;_d3=_d3||_d4;var _d5=_d0.match(/(''|[^'])+/g),_d6=_d0.charAt(0)=="'";_4.forEach(_d5,function(_d7,i){if(!_d7){_d5[i]="";}else{_d5[i]=(_d6?_d2:_d1)(_d7.replace(/''/g,"'"));_d6=!_d6;}});return _d3(_d5.join(""));};function _b8(_d8,_d9,_da,_db){_db=_4.regexp.escapeString(_db);if(!_da.strict){_db=_db.replace(" a"," ?a");}return _db.replace(/([a-z])\1*/ig,function(_dc){var s,c=_dc.charAt(0),l=_dc.length,p2="",p3="";if(_da.strict){if(l>1){p2="0"+"{"+(l-1)+"}";}if(l>2){p3="0"+"{"+(l-2)+"}";}}else{p2="0?";p3="0{0,2}";}switch(c){case "y":s="\\d{2,4}";break;case "M":s=(l>2)?"\\S+?":"1[0-2]|"+p2+"[1-9]";break;case "D":s="[12][0-9][0-9]|3[0-5][0-9]|36[0-6]|"+p3+"[1-9][0-9]|"+p2+"[1-9]";break;case "d":s="3[01]|[12]\\d|"+p2+"[1-9]";break;case "w":s="[1-4][0-9]|5[0-3]|"+p2+"[1-9]";break;case "E":s="\\S+";break;case "h":s="1[0-2]|"+p2+"[1-9]";break;case "k":s="1[01]|"+p2+"\\d";break;case "H":s="1\\d|2[0-3]|"+p2+"\\d";break;case "K":s="1\\d|2[0-4]|"+p2+"[1-9]";break;case "m":case "s":s="[0-5]\\d";break;case "S":s="\\d{"+l+"}";break;case "a":var am=_da.am||_d9["dayPeriods-format-wide-am"],pm=_da.pm||_d9["dayPeriods-format-wide-pm"];s=am+"|"+pm;if(!_da.strict){if(am!=am.toLowerCase()){s+="|"+am.toLowerCase();}if(pm!=pm.toLowerCase()){s+="|"+pm.toLowerCase();}if(s.indexOf(".")!=-1){s+="|"+s.replace(/\./g,"");}}s=s.replace(/\./g,"\\.");break;default:s=".*";}if(_d8){_d8.push(_dc);}return "("+s+")";}).replace(/[\xa0 ]/g,"[\\s\\xa0]");};})();(function(){var _dd=[];_4.date.locale.addCustomFormats=function(_de,_df){_dd.push({pkg:_de,name:_df});};_4.date.locale._getGregorianBundle=function(_e0){var _e1={};_4.forEach(_dd,function(_e2){var _e3=_4.i18n.getLocalization(_e2.pkg,_e2.name,_e0);_e1=_4.mixin(_e1,_e3);},this);return _e1;};})();_4.date.locale.addCustomFormats("dojo.cldr","gregorian");_4.date.locale.getNames=function(_e4,_e5,_e6,_e7){var _e8,_e9=_4.date.locale._getGregorianBundle(_e7),_ea=[_e4,_e6,_e5];if(_e6=="standAlone"){var key=_ea.join("-");_e8=_e9[key];if(_e8[0]==1){_e8=undefined;}}_ea[1]="format";return (_e8||_e9[_ea.join("-")]).concat();};_4.date.locale.isWeekend=function(_eb,_ec){var _ed=_4.cldr.supplemental.getWeekend(_ec),day=(_eb||new Date()).getDay();if(_ed.end<_ed.start){_ed.end+=7;if(day<_ed.start){day+=7;}}return day>=_ed.start&&day<=_ed.end;};_4.date.locale._getDayOfYear=function(_ee){return _4.date.difference(new Date(_ee.getFullYear(),0,1,_ee.getHours()),_ee)+1;};_4.date.locale._getWeekOfYear=function(_ef,_f0){if(arguments.length==1){_f0=0;}var _f1=new Date(_ef.getFullYear(),0,1).getDay(),adj=(_f1-_f0+7)%7,_f2=Math.floor((_4.date.locale._getDayOfYear(_ef)+adj-1)/7);if(_f1==_f0){_f2++;}return _f2;};}if(!_4._hasResource["esri.layers.FeatureLayer"]){_4._hasResource["esri.layers.FeatureLayer"]=true;_4.provide("esri.layers.FeatureLayer");_4.declare("esri.layers.FeatureLayer",esri.layers.GraphicsLayer,{constructor:function(url,_f3){this._outFields=_f3&&_f3.outFields;this._loadCallback=_f3&&_f3.loadCallback;var _f4=_f3&&_f3._usePatch;this._usePatch=(_f4===null||_f4===undefined)?true:_f4;this._trackIdField=_f3&&_f3.trackIdField;this.objectIdField=_f3&&_f3.objectIdField;this._maxOffset=_f3&&_f3.maxAllowableOffset;this._optEditable=_f3&&_f3.editable;this._optAutoGen=_f3&&_f3.autoGeneralize;this.editSummaryCallback=_f3&&_f3.editSummaryCallback;this.userId=_f3&&_f3.userId;this.userIsAdmin=_f3&&_f3.userIsAdmin;this.useMapTime=(_f3&&_f3.hasOwnProperty("useMapTime"))?(!!_f3.useMapTime):true;this.source=_f3&&_f3.source;this.gdbVersion=_f3&&_f3.gdbVersion;this._selectedFeatures={};this._selectedFeaturesArr=[];this._newFeatures=[];this._deletedFeatures={};this._ulid=this._getUniqueId();var _f5=this.constructor,_f6=this.mode=(esri._isDefined(_f3&&_f3.mode)?_f3.mode:_f5.MODE_ONDEMAND);switch(_f6){case _f5.MODE_SNAPSHOT:this._mode=new esri.layers._SnapshotMode(this);this._isSnapshot=true;break;case _f5.MODE_ONDEMAND:this._tileWidth=(_f3&&_f3.tileWidth)||512;this._tileHeight=(_f3&&_f3.tileHeight)||512;this._mode=new esri.layers._OnDemandMode(this);var _f7=_f3&&_f3.latticeTiling;this.latticeTiling=_f7;break;case _f5.MODE_SELECTION:this._mode=new esri.layers._SelectionMode(this);this._isSelOnly=true;break;}this._initLayer=_4.hitch(this,this._initLayer);this._selectHandler=_4.hitch(this,this._selectHandler);this._editable=false;if(_4.isObject(url)&&url.layerDefinition){var _f8=url;this._collection=true;this.mode=_f5.MODE_SNAPSHOT;this._initLayer(_f8);return this;}this._task=new esri.tasks.QueryTask(this.url,{source:this.source,gdbVersion:this.gdbVersion});var _f9=this._url.path;this._fserver=false;if(_f9.search(/\/FeatureServer\//i)!==-1){this._fserver=true;}var _fa=_f3&&_f3.resourceInfo;if(_fa){this._initLayer(_fa);}else{if(this.source){var _fb={source:this.source.toJson()};this._url.query=_4.mixin(this._url.query,{layer:_4.toJson(_fb)});}if(this.gdbVersion){this._url.query=_4.mixin(this._url.query,{gdbVersion:this.gdbVersion});}esri.request({url:_f9,content:_4.mixin({f:"json"},this._url.query),callbackParamName:"callback",load:this._initLayer,error:this._errorHandler});}},_initLayer:function(_fc,io){if(_fc||io){this._json=_fc;this._findCredential();if(this._collection){this._mode=new esri.layers._SnapshotMode(this);this._isSnapshot=true;this._featureSet=_fc.featureSet;this._nextId=_fc.nextObjectId;_fc=_fc.layerDefinition;}if(_fc.hasOwnProperty("capabilities")){var _fd=(this.capabilities=_fc.capabilities);if(_fd&&_fd.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=_4.toJson(this._json);if(this._editable){delete this._maxOffset;}else{if(this.mode!==this.constructor.MODE_SNAPSHOT&&((_fc.geometryType==="esriGeometryPolyline")||(_fc.geometryType==="esriGeometryPolygon"))){this._autoGeneralize=esri._isDefined(this._optAutoGen)?this._optAutoGen:(this.mode===this.constructor.MODE_ONDEMAND);delete this._optAutoGen;}}this.minScale=_fc.minScale||0;this.maxScale=_fc.maxScale||0;this.layerId=_fc.id;this.name=_fc.name;this.description=_fc.description;this.copyright=_fc.copyrightText;this.type=_fc.type;this.geometryType=_fc.geometryType;this.displayField=_fc.displayField;this.defaultDefinitionExpression=_fc.definitionExpression;this.fullExtent=new esri.geometry.Extent(_fc.extent);if((this.geometryType==="esriGeometryPoint")||(this.geometryType==="esriGeometryMultipoint")){this.latticeTiling=false;}this.indexedFields=_fc.indexedFields;this.maxRecordCount=_fc.maxRecordCount;this.canModifyLayer=_fc.canModifyLayer;this.supportsStatistics=_fc.supportsStatistics;this.supportsAdvancedQueries=_fc.supportsAdvancedQueries;this.hasLabels=_fc.hasLabels;this.canScaleSymbols=_fc.canScaleSymbols;this.supportsRollbackOnFailure=_fc.supportsRollbackOnFailure;this.syncCanReturnChanges=_fc.syncCanReturnChanges;this.isDataVersioned=_fc.isDataVersioned;this.editFieldsInfo=_fc.editFieldsInfo;this.ownershipBasedAccessControlForFeatures=_fc.ownershipBasedAccessControlForFeatures;if(this.editFieldsInfo&&this.ownershipBasedAccessControlForFeatures){this.creatorField=this.editFieldsInfo.creatorField;}this.relationships=_fc.relationships;this.allowGeometryUpdates=esri._isDefined(_fc.allowGeometryUpdates)?_fc.allowGeometryUpdates:true;this._isTable=(this.type==="Table");var _fe=(this.fields=[]),_ff=_fc.fields,i;for(i=0;i<_ff.length;i++){_fe.push(new esri.layers.Field(_ff[i]));}if(!this.objectIdField){this.objectIdField=_fc.objectIdField;if(!this.objectIdField){_ff=_fc.fields;for(i=0;i<_ff.length;i++){var _100=_ff[i];if(_100.type==="esriFieldTypeOID"){this.objectIdField=_100.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 _101=this.objectIdField,_102=-1;if(this._collection&&_101){var fset=this._featureSet,_103=fset&&fset.features,il=_103?_103.length:0,oid,attr;for(i=0;i<il;i++){attr=_103[i].attributes;oid=attr&&attr[_101];if(oid>_102){_102=oid;}}}this._nextId=(_102+1);}this.globalIdField=_fc.globalIdField;this.typeIdField=_fc.typeIdField;this.visibilityField=_fc.visibilityField;var _104=_fc.defaultSymbol;if(_104){this.defaultSymbol=esri.symbol.fromJson(_104);}var _105=this.types=[],_106=_fc.types,_107,_108,_109,_10a=this.editFieldsInfo,_10b=_10a&&_10a.creatorField,_10c=_10a&&_10a.editorField,fix=(_10b||_10c),_10d=[];if(_106){for(i=0;i<_106.length;i++){_107=new esri.layers.FeatureType(_106[i]);_108=_107.templates;if(fix&&_108&&_108.length){_10d=_10d.concat(_108);}_105.push(_107);}}var _10e=_fc.templates,_10f,_110=this.templates=[];if(_10e){for(i=0;i<_10e.length;i++){_10f=new esri.layers.FeatureTemplate(_10e[i]);if(fix){_10d.push(_10f);}_110.push(_10f);}}for(i=0;i<_10d.length;i++){_109=_4.getObject("prototype.attributes",false,_10d[i]);if(_109){if(_10b){delete _109[_10b];}if(_10c){delete _109[_10c];}}}var _111=_fc.timeInfo;if(_111){this.timeInfo=new esri.layers.TimeInfo(_111);this._startTimeField=_111.startTimeField;this._endTimeField=_111.endTimeField;if(this._startTimeField&&this._endTimeField){this._twoTimeFields=true;}if(this._trackIdField){_111.trackIdField=this._trackIdField;}else{this._trackIdField=_111.trackIdField;}}this.hasAttachments=(!this._collection&&_fc.hasAttachments)?true:false;this.htmlPopupType=_fc.htmlPopupType;var _112=_fc.drawingInfo,_113;if(!this.renderer){if(_112&&_112.renderer){_113=_112.renderer;this.setRenderer(esri.renderer.fromJson(_113));if(_113.type==="classBreaks"){this.renderer._setMaxInclusiveness(true);}if(!this._collection){var _114=_113.type,_115=[];_113=this.renderer;switch(_114){case "simple":_115.push(_113.symbol);break;case "uniqueValue":case "classBreaks":_115.push(_113.defaultSymbol);_115=_115.concat(_4.map(_113.infos,function(info){return info.symbol;}));break;}_115=_4.filter(_115,esri._isDefined);var _116=this._url.path+"/images/",_117=this._getToken();_4.forEach(_115,function(sym){var url=sym.url;if(url){if((url.search(/https?\:/)===-1)&&(url.indexOf("data:")===-1)){sym.url=_116+url;}if(_117&&sym.url.search(/https?\:/)!==-1){sym.url+=("?token="+_117);}}});}}else{if(_104){_106=this.types;if(_106.length>0){_113=new esri.renderer.UniqueValueRenderer(this.defaultSymbol,this.typeIdField);_4.forEach(_106,function(type){_113.addValue(type.id,type.symbol);});}else{_113=new esri.renderer.SimpleRenderer(this.defaultSymbol);}this.setRenderer(_113);}else{if(!this._isTable){var _118;switch(this.geometryType){case "esriGeometryPoint":case "esriGeometryMultipoint":_118=new esri.symbol.SimpleMarkerSymbol();break;case "esriGeometryPolyline":_118=new esri.symbol.SimpleLineSymbol();break;case "esriGeometryPolygon":_118=new esri.symbol.SimpleFillSymbol();break;}this.setRenderer(_118?new esri.renderer.SimpleRenderer(_118):null);}}}}var _119=(_112&&_112.transparency)||0;if(!esri._isDefined(this.opacity)&&_119>0){this.opacity=1-(_119/100);}this.version=_fc.currentVersion;if(!this.version){var ver;if("capabilities" in _fc||"drawingInfo" in _fc||"hasAttachments" in _fc||"htmlPopupType" in _fc||"relationships" in _fc||"timeInfo" in _fc||"typeIdField" in _fc||"types" in _fc){ver=10;}else{ver=9.3;}this.version=ver;}if((_4.isIE||_4.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 _11a=this._featureSet;delete this._featureSet;this._mode._drawFeatures(new esri.tasks.FeatureSet(_11a));this._fcAdded=true;}this.onLoad(this);var _11b=this._loadCallback;if(_11b){delete this._loadCallback;_11b(this);}}},setRenderer:function(ren){this.inherited("setRenderer",arguments);var _11c=this.renderer;if(_11c){this._ager=(_11c.declaredClass.indexOf("TemporalRenderer")!==-1&&_11c.observationAger&&_11c.observationRenderer);var _11d=_4.filter([_11c,_11c.observationRenderer,_11c.latestObservationRenderer,_11c.trackRenderer],esri._isDefined);var _11e=[];_4.forEach(_11d,function(rnd){_11e.push(rnd.attributeField);_11e.push(rnd.attributeField2);_11e.push(rnd.attributeField3);},this);this._rendererFields=_4.filter(_11e,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,_11f){this._map=map;this._toggleTime(true);var div=this.inherited("_setMap",arguments);this.clearSelection();var _120=this.renderer;if(this.timeInfo){if(this._trackIdField||(_120&&(_120.latestObservationRenderer||_120.trackRenderer))){this._trackManager=new esri.layers._TrackManager(this);this._trackManager.initialize(map);}}this._zoomConnect=_4.connect(map,"onZoomEnd",this,this._zoomHandler);this._zoomHandler();var mode=this._mode;if(mode){mode.initialize(map);}return div;},_unsetMap:function(map,_121){var mode=this._mode;if(mode){mode.destroy();this._mode=null;}if(this._trackManager){this._trackManager.destroy();this._trackManager=null;}_4.disconnect(this._zoomConnect);this._zoomConnect=null;this._toggleTime(false);this.inherited("_unsetMap",arguments);},refresh:function(){var mode=this._mode;if(mode){mode.refresh();}},setEditable:function(_122){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=_122;return this;}var _123=this._editable;this._editable=_122;this._updateCaps();if(_123!==_122){this.onCapabilitiesChange();}return this;},getEditCapabilities:function(_124){var _125={"canCreate":false,"canUpdate":false,"canDelete":false};if(!this.loaded||!this._editable){return _125;}var _126=_124&&_124.feature,_127=_124&&_124.userId,caps=_4.map((this.capabilities?this.capabilities.toLowerCase().split(","):[]),_4.trim),_128=_4.indexOf(caps,"editing")>-1,_129=_128&&(_4.indexOf(caps,"create")>-1),_12a=_128&&(_4.indexOf(caps,"update")>-1),_12b=_128&&(_4.indexOf(caps,"delete")>-1),_12c=this.ownershipBasedAccessControlForFeatures,_12d=this.editFieldsInfo,_12e=_12d&&_12d.creatorField,_12f=_12d&&_12d.realm,_130=_126&&_126.attributes,_131=(_130&&_12e)?_130[_12e]:undefined,_132,_133=!!this.userIsAdmin,_134=!_12c||_133||!!(_12c.allowOthersToUpdate||_12c.allowUpdateToOthers),_135=!_12c||_133||!!(_12c.allowOthersToDelete||_12c.allowDeleteToOthers);if(_128&&(!(_129||_12a||_12b)||_133)){_129=_12a=_12b=true;}_132={"canCreate":_129,"canUpdate":_12a,"canDelete":_12b};if(_131===null){_132.canUpdate=_12a&&_134;_132.canDelete=_12b&&_135;}else{if(_131===""){return _132;}else{if(_131){_127=_127||this.getUserId();if(_127&&_12f){_127=_127+"@"+_12f;}if(_127.toLowerCase()===_131.toLowerCase()){return _132;}else{_132.canUpdate=_12a&&_134;_132.canDelete=_12b&&_135;}}}}return _132;},getUserId:function(){var _136;if(this.loaded){_136=(this.credential&&this.credential.userId)||this.userId||"";}return _136;},setUserIsAdmin:function(_137){this.userIsAdmin=_137;},setEditSummaryCallback:function(_138){this.editSummaryCallback=_138;},getEditSummary:function(_139,_13a,_13b){_13b=esri._isDefined(_13b)?_13b:(new Date()).getTime();var _13c="",info=this.getEditInfo(_139,_13a,_13b),_13d=(_13a&&_13a.callback)||this.editSummaryCallback;if(_13d){info=_13d(_139,info)||"";}if(_4.isString(info)){_13c=info;}else{if(info){var _13e=info.action,_13f=info.userId,_140=info.timeValue,_141=0;if(_13e){_141++;}if(_13f){_141++;}if(esri._isDefined(_140)){_141++;}if(_141>1){_13c=(_13e==="edit"?"edit":"create")+(_13f?"User":"")+(esri._isDefined(_140)?info.displayPattern:"");}}_13c=_13c&&esri.substitute(info,esri.bundle.layers.FeatureLayer[_13c]);}return _13c;},getEditInfo:function(_142,_143,_144){if(!this.loaded){return;}_144=esri._isDefined(_144)?_144:(new Date()).getTime();var _145=(_143&&_143.action)||"last",_146=this.editFieldsInfo,_147=_146&&_146.creatorField,_148=_146&&_146.creationDateField,_149=_146&&_146.editorField,_14a=_146&&_146.editDateField,_14b=_146&&_146.realm,_14c=_142&&_142.attributes,_14d=(_14c&&_147)?_14c[_147]:undefined,_14e=(_14c&&_148)?_14c[_148]:null,_14f=(_14c&&_149)?_14c[_149]:undefined,_150=(_14c&&_14a)?_14c[_14a]:null,_151=this._getEditData(_14d,_14e,_144),_152=this._getEditData(_14f,_150,_144),_153;switch(_145){case "creation":_153=_151;break;case "edit":_153=_152;break;case "last":_153=_152||_151;break;}if(_153){_153.action=(_153===_152)?"edit":"creation";}return _153;},_getEditData:function(_154,_155,_156){var data,_157,_158,_159=60000,_15a=3600000,_15b=2*_15a,_15c=24*_15a,_15d=7*_15c;if(esri._isDefined(_155)){_157=_156-_155;if(_157<0){_158="Full";}else{if(_157<_159){_158="Seconds";}else{if(_157<(2*_159)){_158="Minute";}else{if(_157<_15a){_158="Minutes";}else{if(_157<_15b){_158="Hour";}else{if(_157<_15c){_158="Hours";}else{if(_157<_15d){_158="WeekDay";}else{_158="Full";}}}}}}}}if((_154!==undefined)||_158){data=data||{};data.userId=_154;if(_158){var _15e=_4.date.locale.format,_15f=new Date(_155);data.minutes=Math.floor(_157/_159);data.hours=Math.floor(_157/_15a);data.weekDay=_15e(_15f,{datePattern:"EEEE",selector:"date"});data.formattedDate=_15e(_15f,{selector:"date"});data.formattedTime=_15e(_15f,{selector:"time"});data.displayPattern=_158;data.timeValue=_155;}}return data;},isEditable:function(){return this._editable;},setMaxAllowableOffset:function(_160){if(!this._editable){this._maxOffset=_160;}return this;},getMaxAllowableOffset:function(){return this._maxOffset;},setAutoGeneralize:function(_161){if(!this.loaded){this._optAutoGen=_161;}else{if(!this._editable&&(this.mode!==this.constructor.MODE_SNAPSHOT)&&((this.geometryType==="esriGeometryPolyline")||(this.geometryType==="esriGeometryPolygon"))){this._autoGeneralize=_161;if(_161){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(_162,_163){this.minScale=_162||0;this.maxScale=_163||0;if(this._map&&this._map.loaded){this._updateStatus();}},setGDBVersion:function(_164){if(!this._collection&&(_164!==this.gdbVersion)&&(_164||this.gdbVersion)){this.gdbVersion=_164;this._task.gdbVersion=_164;this._url.query=_4.mixin(this._url.query,{gdbVersion:_164});if(this.loaded){this.clearSelection();if(this._map){this.refresh();}}this.onGDBVersionChange();}return this;},setDefinitionExpression:function(expr){this._defnExpr=expr;var mode=this._mode;if(mode){mode.propertyChangeHandler(1);}return this;},getDefinitionExpression:function(){return this._defnExpr;},setTimeDefinition:function(_165){if(this._isSnapshot){this._timeDefn=_165;var mode=this._mode;if(mode){mode.propertyChangeHandler(2);}}return this;},getTimeDefinition:function(){return this._timeDefn;},setTimeOffset:function(_166,_167){this._timeOffset=_166;this._timeOffsetUnits=_167;var mode=this._mode;if(mode){mode.propertyChangeHandler(0);}return this;},setUseMapTime:function(use){this.useMapTime=use;this._toggleTime(!this._suspended);var mode=this._mode;if(mode){mode.propertyChangeHandler(0);}},selectFeatures:function(_168,_169,_16a,_16b){_169=_169||this.constructor.SELECTION_NEW;var _16c=this._getShallowClone(_168),map=this._map,_16d,dfd=esri._fixDfd(new _4.Deferred(esri._dfdCanceller));_16c.outFields=this._getOutFields();_16c.returnGeometry=true;if(map){_16c.outSpatialReference=new esri.SpatialReference(map.spatialReference.toJson());}if(!this._applyQueryFilters(_16c)){_16d={features:[]};this._selectHandler(_16d,_169,_16a,_16b,dfd);return dfd;}var _16e=this._canDoClientSideQuery(_16c);if(_16e){_16d={features:this._doQuery(_16c,_16e)};this._selectHandler(_16d,_169,_16a,_16b,dfd);return dfd;}else{if(this._collection){var err=new Error("FeatureLayer::selectFeatures - "+esri.bundle.layers.FeatureLayer.invalidParams);this._resolve([err],null,_16b,dfd,true);return dfd;}var self=this;if(this._ts){_16c._ts=(new Date()).getTime();}var temp=dfd._pendingDfd=this._task.execute(_16c);temp.addCallbacks(function(_16f){self._selectHandler(_16f,_169,_16a,_16b,dfd);},function(err){self._resolve([err],null,_16b,dfd,true);});return dfd;}},getSelectedFeatures:function(){var _170=this._selectedFeatures,_171=[],item;for(item in _170){if(_170.hasOwnProperty(item)){_171.push(_170[item]);}}return _171;},clearSelection:function(_172){var _173=this._selectedFeatures,mode=this._mode,item;for(item in _173){if(_173.hasOwnProperty(item)){this._unSelectFeatureIIf(item,mode);mode._removeFeatureIIf(item);}}this._selectedFeatures={};if(this._isSelOnly){mode._applyTimeFilter(true);}if(!_172){this.onSelectionClear();}return this;},setSelectionSymbol:function(_174){this._selectionSymbol=_174;if(_174){var _175=this._selectedFeatures,item;for(item in _175){if(_175.hasOwnProperty(item)){_175[item].setSymbol(_174);}}}return this;},getSelectionSymbol:function(){return this._selectionSymbol;},__msigns:[{n:"applyEdits",c:5,a:[{i:0},{i:1}],e:4,f:1}],applyEdits:function(adds,_176,_177,_178,_179,_17a){var _17b=_17a.assembly,dfd=_17a.dfd;this._applyNormalized(adds,_17b&&_17b[0]);this._applyNormalized(_176,_17b&&_17b[1]);this.onBeforeApplyEdits(adds,_176,_177);var i,_17c={},_17d=this.objectIdField,_17e={f:"json"},_17f=false;if(this._collection){var _180={};_180.addResults=adds?_4.map(adds,function(){_17f=true;return {objectId:this._nextId++,success:true};},this):null;_180.updateResults=_176?_4.map(_176,function(_181){_17f=true;var oid=_181.attributes[_17d];_17c[oid]=_181;return {objectId:oid,success:true};},this):null;_180.deleteResults=_177?_4.map(_177,function(_182){_17f=true;return {objectId:_182.attributes[_17d],success:true};},this):null;if(_17f){this._editHandler(_180,adds,_17c,_178,_179,dfd);}return;}if(adds&&adds.length>0){_17e.adds=this._convertFeaturesToJson(adds,0,1);_17f=true;}if(_176&&_176.length>0){for(i=0;i<_176.length;i++){var _183=_176[i];_17c[_183.attributes[_17d]]=_183;}_17e.updates=this._convertFeaturesToJson(_176,0,0,1);_17f=true;}if(_177&&_177.length>0){var ids=[];for(i=0;i<_177.length;i++){ids.push(_177[i].attributes[_17d]);}_17e.deletes=ids.join(",");_17f=true;}if(_17f){var self=this;return esri.request({url:this._url.path+"/applyEdits",content:_4.mixin(_17e,this._url.query),callbackParamName:"callback",load:function(_184){self._editHandler(_184,adds,_17c,_178,_179,dfd);},error:function(err){self._resolve([err],null,_179,dfd,true);}},{usePost:true});}},queryFeatures:function(_185,_186,_187){return this._query("execute","onQueryFeaturesComplete",_185,_186,_187);},queryRelatedFeatures:function(_188,_189,_18a){return this._query("executeRelationshipQuery","onQueryRelatedFeaturesComplete",_188,_189,_18a);},queryIds:function(_18b,_18c,_18d){return this._query("executeForIds","onQueryIdsComplete",_18b,_18c,_18d);},queryCount:function(_18e,_18f,_190){return this._query("executeForCount","onQueryCountComplete",_18e,_18f,_190);},queryAttachmentInfos:function(_191,_192,_193){var url=this._url.path+"/"+_191+"/attachments",dfd=new _4.Deferred(esri._dfdCanceller),self=this;dfd._pendingDfd=esri.request({url:url,content:_4.mixin({f:"json"},this._url.query),callbackParamName:"callback",load:function(_194){var _195=_194.attachmentInfos,_196;_4.forEach(_195,function(info){_196=_4.objectToQuery({gdbVersion:self._url.query&&self._url.query.gdbVersion,layer:self._url.query&&self._url.query.layer,token:self._getToken()});info.url=url+"/"+info.id+(_196?("?"+_196):"");info.objectId=_191;});self._resolve([_195],"onQueryAttachmentInfosComplete",_192,dfd);},error:function(err){self._resolve([err],null,_193,dfd,true);}});return dfd;},addAttachment:function(_197,_198,_199,_19a){return this._sendAttachment("add",_197,_198,_199,_19a);},updateAttachment:function(_19b,_19c,_19d,_19e,_19f){_19d.appendChild(_4.create("input",{type:"hidden",name:"attachmentId",value:_19c}));return this._sendAttachment("update",_19b,_19d,_19e,_19f);},deleteAttachments:function(_1a0,_1a1,_1a2,_1a3){var url=this._url.path+"/"+_1a0+"/deleteAttachments",dfd=new _4.Deferred(esri._dfdCanceller),self=this,_1a4={f:"json",attachmentIds:_1a1.join(",")};dfd._pendingDfd=esri.request({url:url,content:_4.mixin(_1a4,this._url.query),callbackParamName:"callback",load:_4.hitch(this,function(_1a5){var _1a6=_1a5.deleteAttachmentResults;_1a6=_4.map(_1a6,function(_1a7){var res=new esri.layers.FeatureEditResult(_1a7);res.attachmentId=res.objectId;res.objectId=_1a0;return res;});self._resolve([_1a6],"onDeleteAttachmentsComplete",_1a2,dfd);}),error:function(err){self._resolve([err],null,_1a3,dfd,true);}},{usePost:true});return dfd;},addType:function(_1a8){if(!this._collection){return false;}var _1a9=this.types;if(_1a9){var _1aa=_4.some(_1a9,function(type){if(type.id==_1a8.id){return true;}return false;});if(_1aa){return false;}else{_1a9.push(_1a8);}}else{this.types=[_1a8];}this._typesDirty=true;return true;},deleteType:function(_1ab){if(!this._collection){return;}var _1ac=this.types;if(_1ac){var _1ad=-1;_4.some(_1ac,function(type,_1ae){if(type.id==_1ab){_1ad=_1ae;return true;}return false;});if(_1ad>-1){this._typesDirty=true;return _1ac.splice(_1ad,1)[0];}}},toJson:function(){var _1af=this._json,json=_4.isString(_1af)?_4.fromJson(_1af):_4.clone(_1af);if(!json){return;}json=json.layerDefinition?json:{layerDefinition:json};var _1b0=json.layerDefinition,_1b1=this._collection;if(_1b1&&this._typesDirty){_1b0.types=_4.map(this.types||[],function(type){return type.toJson();});var _1b2=this.renderer,_1b3=_1b0.drawingInfo;if(_1b3&&_1b2&&_1b2.declaredClass.indexOf("TemporalRenderer")===-1){_1b3.renderer=_1b2.toJson();}}var _1b4=null;if(!(_1b1&&!this._fcAdded)){_1b4={geometryType:_1b0.geometryType,features:this._convertFeaturesToJson(this.graphics,true)};}json.featureSet=_4.mixin({},json.featureSet||{},_1b4);if(_1b1){json.nextObjectId=this._nextId;_1b0.capabilities=this.capabilities;}return json;},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 _1b5=this._editable,_1b6=_4.trim(this.capabilities||""),_1b7=_4.map((_1b6?_1b6.split(","):[]),_4.trim),caps=_4.map((_1b6?_1b6.toLowerCase().split(","):[]),_4.trim),_1b8=_4.indexOf(caps,"editing"),cap,i,_1b9,_1ba={"Create":_4.indexOf(caps,"create"),"Update":_4.indexOf(caps,"update"),"Delete":_4.indexOf(caps,"delete")};if(_1b5&&_1b8===-1){_1b7.push("Editing");}else{if(!_1b5&&_1b8>-1){_1b9=[_1b8];for(cap in _1ba){if(_1ba[cap]>-1){_1b9.push(_1ba[cap]);}}_1b9.sort();for(i=_1b9.length-1;i>=0;i--){_1b7.splice(_1b9[i],1);}}}this.capabilities=_1b7.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 _1bb=esri.geometry.getScale(this._map);var _1bc=this.minScale,_1bd=this.maxScale,_1be=!_1bc,_1bf=!_1bd;if(!_1be&&_1bb<=_1bc){_1be=true;}if(!_1bf&&_1bb>=_1bd){_1bf=true;}return (_1be&&_1bf)?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(_1c0){var map=this._map;if(_1c0&&this.timeInfo&&this.useMapTime&&map){this._mapTimeExtent=map.timeExtent;if(!this._timeConnect){this._timeConnect=_4.connect(map,"onTimeExtentChange",this,this._timeChangeHandler);}}else{this._mapTimeExtent=null;_4.disconnect(this._timeConnect);this._timeConnect=null;}},_timeChangeHandler:function(_1c1){this._mapTimeExtent=_1c1;var mode=this._mode;if(mode){mode.propertyChangeHandler(0);}},_getOffsettedTE:function(_1c2){var _1c3=this._timeOffset,_1c4=this._timeOffsetUnits;return (_1c2&&_1c3&&_1c4)?_1c2.offset(-1*_1c3,_1c4):_1c2;},_getTimeOverlap:function(_1c5,_1c6){if(_1c5&&_1c6){return _1c5.intersection(_1c6);}else{return _1c5||_1c6;}},_getTimeFilter:function(_1c7){var _1c8=this.getTimeDefinition(),_1c9=null,_1ca;if(_1c8||_1c9){_1ca=this._getTimeOverlap(_1c8,_1c9);if(!_1ca){return [false];}}if(_1c7){_1c7=_1ca?this._getTimeOverlap(_1c7,_1ca):_1c7;if(!_1c7){return [false];}}else{_1c7=_1ca;}return [true,_1c7];},_getAttributeFilter:function(_1cb){var _1cc=this.getDefinitionExpression();if(_1cb){_1cb=_1cc?"("+_1cc+") AND ("+_1cb+")":_1cb;}else{_1cb=_1cc;}return _1cb;},_applyQueryFilters:function(_1cd){_1cd.where=this._getAttributeFilter(_1cd.where);_1cd.maxAllowableOffset=this._maxOffset;if(this.timeInfo){var _1ce=this._getTimeFilter(_1cd.timeExtent);if(!_1ce[0]){return false;}else{_1cd.timeExtent=_1ce[1];}}return true;},_add:function(_1cf){var _1d0=this._selectionSymbol,attr=_1cf.attributes,_1d1=this.visibilityField;if(_1d0&&this._isSelOnly){_1cf.setSymbol(_1d0);}if(_1d1&&attr&&attr.hasOwnProperty(_1d1)){_1cf[attr[_1d1]?"show":"hide"]();}return this.add.apply(this,arguments);},_remove:function(){return this.remove.apply(this,arguments);},_canDoClientSideQuery:function(_1d2){var _1d3=[],map=this._map;if(this._isTable||!map){return;}if(_1d2.text||(_1d2.where&&_1d2.where!==this.getDefinitionExpression())){return;}var _1d4=this._isSnapshot,_1d5=this._isSelOnly;var _1d6=_1d2.geometry;if(_1d6){if(!_1d5&&_1d2.spatialRelationship===esri.tasks.Query.SPATIAL_REL_INTERSECTS&&(_1d6.type==="extent"&&(_1d4||map.extent.contains(_1d6)))){_1d3.push(1);}else{return;}}var ids=_1d2.objectIds;if(ids){if(_1d4){_1d3.push(2);}else{var len=ids.length,mode=this._mode,_1d7=0,i;for(i=0;i<len;i++){if(mode._getFeature(ids[i])){_1d7++;}}if(_1d7===len){_1d3.push(2);}else{return;}}}if(this.timeInfo){var _1d8=_1d2.timeExtent,_1d9=this._mapTimeExtent;if(_1d4){if(_1d8){_1d3.push(3);}}else{if(_1d5){if(_1d8){return;}}else{if(_1d9){if(_4.indexOf(_1d3,2)!==-1){if(_1d8){_1d3.push(3);}}else{return;}}else{if(_1d3.length>0){if(_1d8){_1d3.push(3);}}else{if(_1d8){return;}}}}}}return _1d3.length>0?_1d3:null;},_doQuery:function(_1da,_1db,_1dc){var _1dd=[],mode=this._mode,_1de=this.objectIdField,i,len,_1df;if(_4.indexOf(_1db,2)!==-1){_1dd=[];var ids=_1da.objectIds;len=ids.length;for(i=0;i<len;i++){var obj=mode._getFeature(ids[i]);if(obj){_1dd.push(obj);}}if(_1dd.length===0){return [];}}if(_4.indexOf(_1db,1)!==-1){_1df=_1dd.length>0?_1dd:this.graphics;len=_1df.length;var _1e0=_1da.geometry._normalize(null,true);_1dd=[];for(i=0;i<len;i++){var _1e1=_1df[i],_1e2=_1e1.geometry;if(_1e2){if(this.normalization&&_1e0.length){if(_1e0[0].intersects(_1e2)||_1e0[1].intersects(_1e2)){_1dd.push(_1e1);}}else{if(_1e0.intersects(_1e2)){_1dd.push(_1e1);}}}}if(_1dd.length===0){return [];}}if(_4.indexOf(_1db,3)!==-1){if(this.timeInfo){_1df=_1dd.length>0?_1dd:this.graphics;var time=_1da.timeExtent,_1e3=this._filterByTime(_1df,time.startTime,time.endTime);_1dd=_1e3.match;}}if(_1dc){return _4.map(_1dd,function(obj){return obj.attributes[_1de];},this);}else{return _1dd;}},_filterByTime:function(_1e4,_1e5,_1e6){var _1e7=this._startTimeField,_1e8=this._endTimeField,_1e9;if(!this._twoTimeFields){_1e9=_1e7||_1e8;}var _1ea=esri._isDefined,yea=[],nay=[],i,len=_1e4.length,_1eb,_1ec;_1e5=_1e5?_1e5.getTime():-Infinity;_1e6=_1e6?_1e6.getTime():Infinity;if(_1e9){for(i=0;i<len;i++){_1eb=_1e4[i];_1ec=_1eb.attributes;var time=_1ec[_1e9];if(time>=_1e5&&time<=_1e6){yea.push(_1eb);}else{nay.push(_1eb);}}}else{for(i=0;i<len;i++){_1eb=_1e4[i];_1ec=_1eb.attributes;var _1ed=_1ec[_1e7],end=_1ec[_1e8];_1ed=_1ea(_1ed)?_1ed:-Infinity;end=_1ea(end)?end:Infinity;if((_1ed>=_1e5&&_1ed<=_1e6)||(end>=_1e5&&end<=_1e6)||(_1e5>=_1ed&&_1e6<=end)){yea.push(_1eb);}else{nay.push(_1eb);}}}return {match:yea,noMatch:nay};},_resolve:function(args,_1ee,_1ef,dfd,_1f0){if(_1ee){this[_1ee].apply(this,args);}if(_1ef){_1ef.apply(null,args);}if(dfd){esri._resDfd(dfd,args,_1f0);}},_getShallowClone:function(_1f1){var _1f2=new esri.tasks.Query(),prop;for(prop in _1f1){if(_1f1.hasOwnProperty(prop)){_1f2[prop]=_1f1[prop];}}return _1f2;},_query:function(type,_1f3,_1f4,_1f5,_1f6){var that=this,dfd=new _4.Deferred(esri._dfdCanceller);var _1f7=function(_1f8,_1f9){if(!_1f9&&type==="execute"&&!that._isTable){var _1fa=_1f8.features,mode=that._mode,_1fb=that.objectIdField,il=_1fa.length,i;for(i=il-1;i>=0;i--){var oid=_1fa[i].attributes[_1fb];var _1fc=mode._getFeature(oid);if(_1fc){_1fa.splice(i,1,_1fc);}}}that._resolve([_1f8],_1f3,_1f5,dfd);};if(type!=="executeRelationshipQuery"){_1f4=this._getShallowClone(_1f4);_1f4.outFields=this._getOutFields();_1f4.returnGeometry=true;var map=this._map,_1fd;if(map){_1f4.outSpatialReference=new esri.SpatialReference(map.spatialReference.toJson());}if(!this._applyQueryFilters(_1f4)){switch(type){case "execute":_1fd=new esri.tasks.FeatureSet({features:[]});break;case "executeForIds":_1fd=[];break;case "executeForCount":_1fd=0;break;}_1f7(_1fd,true);return dfd;}var _1fe=this._canDoClientSideQuery(_1f4);if(_1fe){var _1ff=this._doQuery(_1f4,_1fe,(type==="executeForIds"||type==="executeForCount"));switch(type){case "execute":_1fd=new esri.tasks.FeatureSet();_1fd.features=_1ff;break;case "executeForIds":_1fd=_1ff;break;case "executeForCount":_1fd=_1ff.length;break;}_1f7(_1fd,true);return dfd;}}if(this._collection){var err=new Error("FeatureLayer::_query - "+esri.bundle.layers.FeatureLayer.invalidParams);this._resolve([err],null,_1f6,dfd,true);return dfd;}if(this._ts){_1f4._ts=(new Date()).getTime();}var temp=dfd._pendingDfd=this._task[type](_1f4);temp.addCallbacks(_1f7,function(err){that._resolve([err],null,_1f6,dfd,true);});return dfd;},_convertFeaturesToJson:function(_200,_201,_202,_203){var json=[],_204=this._selectionSymbol,_205=this.visibilityField,i,_206,_207=this.objectIdField;if(_202||_203){_206=_4.filter(this.fields,function(_208){return (_208.editable===false)&&(!_203||(_208.name!==_207));});}for(i=0;i<_200.length;i++){var _209=_200[i],_20a={},_20b=_209.geometry,attr=_209.attributes,_20c=_209.symbol;if(_20b&&(!_203||this.allowGeometryUpdates)){_20a.geometry=_20b.toJson();}if(_205){_20a.attributes=attr=_4.mixin({},attr);attr[_205]=_209.visible?1:0;}else{if(attr){_20a.attributes=_4.mixin({},attr);}}if(_20a.attributes&&_206&&_206.length){_4.forEach(_206,function(_20d){delete _20a.attributes[_20d.name];});}if(_20c&&(_20c!==_204)){_20a.symbol=_20c.toJson();}json.push(_20a);}return _201?json:_4.toJson(json);},_selectHandler:function(_20e,_20f,_210,_211,dfd){var _212,ctor=this.constructor;switch(_20f){case ctor.SELECTION_NEW:this.clearSelection(true);_212=true;break;case ctor.SELECTION_ADD:_212=true;break;case ctor.SELECTION_SUBTRACT:_212=false;break;}var i,_213=_20e.features,mode=this._mode,_214=[],_215=this.objectIdField,_216,oid;if(_212){for(i=0;i<_213.length;i++){_216=_213[i];oid=_216.attributes[_215];var _217=mode._addFeatureIIf(oid,_216);_214.push(_217);this._selectFeatureIIf(oid,_217,mode);}}else{for(i=0;i<_213.length;i++){_216=_213[i];oid=_216.attributes[_215];this._unSelectFeatureIIf(oid,mode);var _218=mode._removeFeatureIIf(oid);_214.push(_218||_216);}}if(this._isSelOnly){mode._applyTimeFilter(true);}this._resolve([_214,_20f,_20e.exceededTransferLimit?{queryLimitExceeded:true}:null],"onSelectionComplete",_210,dfd);if(_20e.exceededTransferLimit){this.onQueryLimitExceeded();}},_selectFeatureIIf:function(oid,_219,mode){var _21a=this._selectedFeatures,_21b=_21a[oid];if(!_21b){mode._incRefCount(oid);_21a[oid]=_219;if(!this._isTable){this._setSelectSymbol(_219);}}return _21b||_219;},_unSelectFeatureIIf:function(oid,mode){var _21c=this._selectedFeatures[oid];if(_21c){mode._decRefCount(oid);delete this._selectedFeatures[oid];if(!this._isTable){this._setUnSelectSymbol(_21c);}}return _21c;},_isSelected:function(_21d){},_setSelectSymbol:function(_21e){var _21f=this._selectionSymbol;if(_21f&&!this._isSelOnly){_21e.setSymbol(_21f);}},_setUnSelectSymbol:function(_220){var _221=this._selectionSymbol;if(_221&&!this._isSelOnly){if(_221===_220.symbol){_220.setSymbol(null,true);}}},_getOutFields:function(){var _222=_4.filter([this.objectIdField,this.typeIdField,this.creatorField,this._startTimeField,this._endTimeField,this._trackIdField].concat(this._rendererFields),function(_223,_224,arr){return !!_223&&(_4.indexOf(arr,_223)===_224);});var _225=_4.clone(this._outFields);if(_225){if(_4.indexOf(_225,"*")!==-1){return _225;}_4.forEach(_222,function(_226){if(_4.indexOf(_225,_226)===-1){_225.push(_226);}});return _225;}else{return _222;}},_checkFields:function(_227){var _228=_227||this._getOutFields();_4.forEach(_228,function(_229){if(_229==="*"){return;}if(!this._getField(_229)){console.debug("esri.layers.FeatureLayer: "+esri.substitute({url:this.url,field:_229},esri.bundle.layers.FeatureLayer.fieldNotFound));}},this);if(!_227&&!this._isTable&&!this._fserver&&!this._collection){var _22a=_4.some(this.fields,function(_22b){return (_22b&&_22b.type==="esriFieldTypeGeometry")?true:false;});if(!_22a){console.debug("esri.layers.FeatureLayer: "+esri.substitute({url:this.url},esri.bundle.layers.FeatureLayer.noGeometryField));}}},_fixRendererFields:function(){var _22c=this.renderer;if(_22c&&this.fields.length>0){var _22d=_4.filter([_22c,_22c.observationRenderer,_22c.latestObservationRenderer,_22c.trackRenderer],esri._isDefined);var _22e=[];_4.forEach(_22d,function(rnd){var _22f,_230;_230=rnd.attributeField;if(_230){_22f=!this._getField(_230)&&this._getField(_230,true);if(_22f){rnd.attributeField=_22f.name;}}_230=rnd.attributeField2;if(_230){_22f=!this._getField(_230)&&this._getField(_230,true);if(_22f){rnd.attributeField2=_22f.name;}}_230=rnd.attributeField3;if(_230){_22f=!this._getField(_230)&&this._getField(_230,true);if(_22f){rnd.attributeField3=_22f.name;}}_22e.push(rnd.attributeField);_22e.push(rnd.attributeField2);_22e.push(rnd.attributeField3);},this);this._rendererFields=_4.filter(_22e,esri._isDefined);}},_getField:function(_231,_232){var _233=this.fields;if(_233.length===0){return null;}var _234;if(_232){_231=_231.toLowerCase();}_4.some(_233,function(_235){var _236=false;if(_232){_236=(_235&&_235.name.toLowerCase()===_231)?true:false;}else{_236=(_235&&_235.name===_231)?true:false;}if(_236){_234=_235;}return _236;});return _234;},_getDateOpts:function(){if(!this._dtOpts){var _237=_4.map(_4.filter(this.fields,function(_238){return !!(_238&&_238.type==="esriFieldTypeDate");}),function(_239){return _239.name;});this._dtOpts={properties:_237};}return this._dtOpts;},_applyNormalized:function(_23a,_23b){if(_23a&&_23b){_4.forEach(_23a,function(_23c,_23d){if(_23c&&_23b[_23d]){_23c.setGeometry(_23b[_23d]);}});}},_editHandler:function(_23e,adds,_23f,_240,_241,dfd){var _242=_23e.addResults,_243=_23e.updateResults,_244=_23e.deleteResults,i,_245,oid,_246,attr,_247=this.objectIdField,mode=this._mode,_248=this._isTable;var _249=this.editFieldsInfo,_24a=this._getOutFields()||[],_24b=_249&&_249.creatorField,_24c=_249&&_249.creationDateField,_24d=_249&&_249.editorField,_24e=_249&&_249.editDateField,_24f=_249&&_249.realm;if(_4.indexOf(_24a,"*")===-1){if(_24b&&_4.indexOf(_24a,_24b)===-1){_24b=null;}if(_24c&&_4.indexOf(_24a,_24c)===-1){_24c=null;}if(_24d&&_4.indexOf(_24a,_24d)===-1){_24d=null;}if(_24e&&_4.indexOf(_24a,_24e)===-1){_24e=null;}}var _250=(_24c||_24e)?(new Date()).getTime():null,_251=(_24b||_24d)?this.getUserId():undefined;if(_251&&_24f){_251=_251+"@"+_24f;}if(_242){for(i=0;i<_242.length;i++){_242[i]=new esri.layers.FeatureEditResult(_242[i]);if(_248){continue;}_245=_242[i];if(_245.success){oid=_245.objectId;_246=adds[i];var gl=_246._graphicsLayer;if(gl&&gl!==this){gl.remove(_246);}attr=_246.attributes||{};attr[_247]=oid;if(_24b){attr[_24b]=_251;}if(_24d){attr[_24d]=_251;}if(_24c){attr[_24c]=_250;}if(_24e){attr[_24e]=_250;}_246.setAttributes(attr);mode.drawFeature(_246);}}}if(_243){for(i=0;i<_243.length;i++){_243[i]=new esri.layers.FeatureEditResult(_243[i]);if(_248){continue;}_245=_243[i];if(_245.success){oid=_245.objectId;_246=_23f[oid];var _252=mode._getFeature(oid);if(_252){if(_252.geometry!==_246.geometry){_252.setGeometry(esri.geometry.fromJson(_246.geometry.toJson()));}this._repaint(_252,oid);}_246=_252||_246;attr=_246.attributes||{};if(_24d){attr[_24d]=_251;}if(_24e){attr[_24e]=_250;}_246.setAttributes(attr);}}}if(_244){var _253=[];for(i=0;i<_244.length;i++){_244[i]=new esri.layers.FeatureEditResult(_244[i]);if(_248){continue;}_245=_244[i];if(_245.success){oid=_245.objectId;_246=mode._getFeature(oid);if(_246){if(this._unSelectFeatureIIf(oid,mode)){_253.push(_246);}_246._count=0;mode._removeFeatureIIf(oid);}}}if(_253.length>0){this.onSelectionComplete(_253,this.constructor.SELECTION_SUBTRACT);}}this._resolve([_242,_243,_244],"onEditsComplete",_240,dfd);},_sendAttachment:function(type,_254,_255,_256,_257){var _258=(type==="add")?"addAttachment":"updateAttachment",url=this._url.path+"/"+_254+"/"+_258,self=this;var dfd=esri.request({url:url,form:_255,content:_4.mixin(this._url.query,{f:"json",token:this._getToken()||undefined}),callbackParamName:"callback.html",handleAs:"json"}).addCallback(function(_259){var _25a=(type==="add")?"addAttachmentResult":"updateAttachmentResult",_25b=(type==="add")?"onAddAttachmentComplete":"onUpdateAttachmentComplete",_25c=new esri.layers.FeatureEditResult(_259[_25a]);_25c.attachmentId=_25c.objectId;_25c.objectId=_254;self._resolve([_25c],_25b,_256);return _25c;}).addErrback(function(_25d){self._resolve([_25d],null,_257,null,true);});return dfd;},_repaint:function(_25e,oid,_25f){oid=esri._isDefined(oid)?oid:_25e.attributes[this.objectIdField];if(!(oid in this._selectedFeatures)||!this._selectionSymbol){_25e.setSymbol(_25e.symbol,_25f);}},_getKind:function(_260){var _261=this._trackManager;if(_261){return _261.isLatestObservation(_260)?1:0;}return 0;}});_4.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");_4.declare("esri.layers.FeatureType",null,{constructor:function(json){if(json&&_4.isObject(json)){this.id=json.id;this.name=json.name;var _262=json.symbol;if(_262){this.symbol=esri.symbol.fromJson(_262);}var _263=json.domains,_264,i;var _265=this.domains={};for(_264 in _263){if(_263.hasOwnProperty(_264)){var _266=_263[_264];switch(_266.type){case "range":_265[_264]=new esri.layers.RangeDomain(_266);break;case "codedValue":_265[_264]=new esri.layers.CodedValueDomain(_266);break;case "inherited":_265[_264]=new esri.layers.InheritedDomain(_266);break;}}}var _267=json.templates;if(_267){var _268=this.templates=[];for(i=0;i<_267.length;i++){_268.push(new esri.layers.FeatureTemplate(_267[i]));}}}},toJson:function(){var json={id:this.id,name:this.name,symbol:this.symbol&&this.symbol.toJson()};var _269,_26a=this.domains,_26b=this.templates,_26c=esri._sanitize;if(_26a){var _26d=json.domains={};for(_269 in _26a){if(_26a.hasOwnProperty(_269)){_26d[_269]=_26a[_269]&&_26a[_269].toJson();}}_26c(_26d);}if(_26b){json.templates=_4.map(_26b,function(_26e){return _26e.toJson();});}return _26c(json);}});_4.declare("esri.layers.FeatureTemplate",null,{constructor:function(json){if(json&&_4.isObject(json)){this.name=json.name;this.description=json.description;this.drawingTool=json.drawingTool;var _26f=json.prototype;this.prototype=new esri.Graphic(_26f.geometry,null,_26f.attributes);}},toJson:function(){return esri._sanitize({name:this.name,description:this.description,drawingTool:this.drawingTool,prototype:this.prototype&&this.prototype.toJson()});}});_4.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"});_4.declare("esri.layers.FeatureEditResult",null,{constructor:function(json){if(json&&_4.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;}}}});_4.declare("esri.layers._RenderMode",null,{constructor:function(){this._prefix="jsonp_"+(_4._scopeName||"dojo")+"IoScript";},initialize:function(map){},propertyChangeHandler:function(type){},destroy:function(){},drawFeature:function(_270){},suspend:function(){},resume:function(){},refresh:function(){},_incRefCount:function(oid){var _271=this._featureMap[oid];if(_271){_271._count++;}},_decRefCount:function(oid){var _272=this._featureMap[oid];if(_272){_272._count--;}},_getFeature:function(oid){return this._featureMap[oid];},_addFeatureIIf:function(oid,_273){var fmap=this._featureMap,_274=fmap[oid],_275=this.featureLayer;if(!_274){fmap[oid]=_273;_275._add(_273);_273._count=0;}return _274||_273;},_removeFeatureIIf:function(oid){var _276=this._featureMap[oid],_277=this.featureLayer;if(_276){if(_276._count){return;}delete this._featureMap[oid];_277._remove(_276);}return _276;},_clearIIf:function(){var i,_278=this.featureLayer,_279=_278.graphics,_27a=_278._selectedFeatures,_27b=_278.objectIdField;for(i=_279.length-1;i>=0;i--){var _27c=_279[i];var oid=_27c.attributes[_27b];if(oid in _27a){_27c._count=1;continue;}_27c._count=0;this._removeFeatureIIf(oid);}},_isPending:function(id){var dfd=_4.io.script[this._prefix+id];return dfd?true:false;},_cancelPendingRequest:function(dfd,id){dfd=dfd||_4.io.script[this._prefix+id];if(dfd){try{dfd.cancel();_4.io.script._validCheck(dfd);}catch(e){}}},_purgeRequests:function(){_4.io.script._validCheck(null);},_toggleVisibility:function(show){var _27d=this.featureLayer,_27e=_27d.graphics,_27f=show?"show":"hide",i,len=_27e.length;show=show&&_27d._ager;for(i=0;i<len;i++){var _280=_27e[i];_280[_27f]();if(show){_27d._repaint(_280);}}},_applyTimeFilter:function(_281){var _282=this.featureLayer;if(!_282.timeInfo||_282._suspended){return;}if(!_281){_282._fireUpdateStart();}var _283=_282._trackManager;if(_283){_283.clearTracks();}var defn=_282.getTimeDefinition(),_284=_282._getOffsettedTE(_282._mapTimeExtent);if(_284){_284=_282._getTimeOverlap(defn,_284);if(_284){var _285=_282._filterByTime(_282.graphics,_284.startTime,_284.endTime);if(_283){_283.addFeatures(_285.match);}_4.forEach(_285.match,function(_286){var _287=_286._shape;if(!_286.visible){_286.show();_287=_286._shape;_287&&_287._moveToFront();}if(_282._ager&&_287){_282._repaint(_286);}});_4.forEach(_285.noMatch,function(_288){if(_288.visible){_288.hide();}});}else{this._toggleVisibility(false);}}else{if(_283){_283.addFeatures(_282.graphics);}this._toggleVisibility(true);}if(_283){_283.moveLatestToFront();_283.drawTracks();}if(!_281){_282._fireUpdateEnd();}}});_4.declare("esri.layers._SelectionMode",[esri.layers._RenderMode],{constructor:function(_289){this.featureLayer=_289;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);}});_4.declare("esri.layers._SnapshotMode",[esri.layers._RenderMode],{constructor:function(_28a){this.featureLayer=_28a;this._featureMap={};this._drawFeatures=_4.hitch(this,this._drawFeatures);this._queryErrorHandler=_4.hitch(this,this._queryErrorHandler);},initialize:function(map){this.map=map;var _28b=this.featureLayer;if(_28b._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(_28c){var _28d=this.featureLayer,_28e=_28d.objectIdField,oid=_28c.attributes[_28e];this._addFeatureIIf(oid,_28c);this._incRefCount(oid);},resume:function(){this.propertyChangeHandler(0);},refresh:function(){var _28f=this.featureLayer;if(_28f._collection){_28f._fireUpdateStart();_28f._refresh(true);_28f._fireUpdateEnd();}else{this._fetchAll();}},_getRequestId:function(_290){var id="_"+_290.name+_290.layerId+_290._ulid;return id.replace(/[^a-zA-Z0-9\_]+/g,"_");},_fetchAll:function(){var _291=this.featureLayer;if(_291._collection){return;}_291._fireUpdateStart();this._clearIIf();this._sendRequest();},_sendRequest:function(){var map=this.map,_292=this.featureLayer,_293=_292.getDefinitionExpression();var _294=new esri.tasks.Query();_294.outFields=_292._getOutFields();_294.where=_293||"1=1";_294.returnGeometry=true;_294.outSpatialReference=new esri.SpatialReference(map.spatialReference.toJson());_294.timeExtent=_292.getTimeDefinition();_294.maxAllowableOffset=_292._maxOffset;if(_292._ts){_294._ts=(new Date()).getTime();}var _295;if(_292._usePatch){_295=this._getRequestId(_292);this._cancelPendingRequest(null,_295);}_292._task.execute(_294,this._drawFeatures,this._queryErrorHandler,_295);},_drawFeatures:function(_296){this._purgeRequests();var _297=_296.features,_298=this.featureLayer,_299=_298.objectIdField,i,len=_297.length,_29a,oid;for(i=0;i<len;i++){_29a=_297[i];oid=_29a.attributes[_299];this._addFeatureIIf(oid,_29a);this._incRefCount(oid);}this._applyTimeFilter(true);_298._fireUpdateEnd(null,_296.exceededTransferLimit?{queryLimitExceeded:true}:null);if(_296.exceededTransferLimit){_298.onQueryLimitExceeded();}},_queryErrorHandler:function(err){this._purgeRequests();var _29b=this.featureLayer;_29b._errorHandler(err);_29b._fireUpdateEnd(err);}});_4.declare("esri.layers._OnDemandMode",[esri.layers._RenderMode],{constructor:function(_29c){this.featureLayer=_29c;this._featureMap={};this._queryErrorHandler=_4.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(_29d){var _29e=this._gridLayer,geom=_29d.geometry,_29f=[];if(!geom){return;}_29f=_29e.getCellsInExtent((geom.type==="point")?{xmin:geom.x,ymin:geom.y,xmax:geom.x,ymax:geom.y}:geom.getExtent(),false).cells;var _2a0=this._cellMap,i,cell,oid=_29d.attributes[this.featureLayer.objectIdField],_2a1,row,col;for(i=0;i<_29f.length;i++){cell=_29f[i];_2a1=cell.latticeID;row=cell.row;col=cell.col;if(_2a1){cell=(_2a0[_2a1]=(_2a0[_2a1]||cell));}else{_2a0[row]=_2a0[row]||{};cell=(_2a0[row][col]=(_2a0[row][col]||cell));}cell.features=cell.features||[];cell.features.push(_29d);this._addFeatureIIf(oid,_29d);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,_2a2=this.featureLayer;var _2a3=_2a2._srInfo;this._gridLayer=new esri.layers._GridLayout(new esri.geometry.Point(_2a3?_2a3.valid[0]:map.extent.xmin,map.extent.ymax,map.spatialReference),{width:_2a2._tileWidth,height:_2a2._tileHeight},{width:map.width,height:map.height},_2a3);this._ioQueue=[];if(!_2a2._suspended){this._zoomHandler();this._enableConnectors();}},_enableConnectors:function(){var map=this.map;this._zoomConnect=_4.connect(map,"onZoomEnd",this,this._zoomHandler);this._panConnect=_4.connect(map,"onPanEnd",this,this._panHandler);this._resizeConnect=_4.connect(map,"onResize",this,this._panHandler);},_disableConnectors:function(){_4.disconnect(this._zoomConnect);_4.disconnect(this._panConnect);_4.disconnect(this._resizeConnect);},_zoomHandler:function(){this._processIOQueue(true);var _2a4=this.featureLayer,map=this.map;if(_2a4._suspended){return;}_2a4._fireUpdateStart();this._clearIIf();var _2a5=_2a4._trackManager;if(_2a5){_2a5.clearTracks();}this._cellMap={};this._gridLayer.setResolution(map.extent);this._sendRequest();},_panHandler:function(){this.featureLayer._fireUpdateStart();this._sendRequest(this.featureLayer._resized&&arguments[0]);},_getRequestId:function(_2a6,cell){var id="_"+_2a6.name+_2a6.layerId+_2a6._ulid+"_"+cell.resolution+"_"+(cell.latticeID||(cell.row+"_"+cell.col));return id.replace(/[^a-zA-Z0-9\_]+/g,"_");},_sendRequest:function(_2a7){this._exceeds=false;var _2a8=this.featureLayer,map=this.map,_2a9=_2a7||map.extent,_2aa=this._gridLayer.getCellsInExtent(_2a9,_2a8.latticeTiling),_2ab=_2aa.cells;if(!_2a8._editable){var _2ac=this._cellMap;_2ab=_4.filter(_2ab,function(cell){if(cell.lattice){if(_2ac[cell.latticeID]){return false;}}else{if(_2ac[cell.row]&&_2ac[cell.row][cell.col]){return false;}}return true;});}var _2ad=_2a8._getOutFields(),_2ae=_2a8.getDefinitionExpression(),time=_2a8._getOffsettedTE(_2a8._mapTimeExtent),_2af=_2a8._usePatch,_2b0=this._ioQueue,i,self=this,func=this._drawFeatures,cell,_2b1,_2b2;this._pending=this._pending||0;for(i=0;i<_2ab.length;i++){cell=_2ab[i];_2b1=new esri.tasks.Query();_2b1.geometry=cell.extent||cell.lattice;_2b1.outFields=_2ad;_2b1.where=_2ae;if(_2a8.latticeTiling&&cell.extent){_2b1.spatialRelationship=esri.tasks.Query.SPATIAL_REL_CONTAINS;}_2b1.returnGeometry=true;_2b1.timeExtent=time;_2b1.maxAllowableOffset=_2a8._maxOffset;if(_2a8._ts){_2b1._ts=(new Date()).getTime();}_2b2=null;if(_2af){_2b2=this._getRequestId(_2a8,cell);if(this._isPending(_2b2)){continue;}}this._pending++;_2b0.push(_2a8._task.execute(_2b1,function(){var _2b3=cell;return function(_2b4){func.apply(self,[_2b4,_2b3]);};}.call(this),this._queryErrorHandler,_2b2));}this._removeOldCells(_2a9);this._endCheck();},_drawFeatures:function(_2b5,cell){this._exceeds=this._exceeds||_2b5.exceededTransferLimit;this._finalizeIO();var _2b6=this.featureLayer,map=this.map,_2b7=map.extent,_2b8=cell.extent,row=cell.row,col=cell.col,_2b9=_2b6.objectIdField,_2ba=_2b5.features,_2bb=this._gridLayer,_2bc=this._cellMap,i,len,_2bd=cell.latticeID,_2be=_2bd?_2bc[_2bd]:(_2bc[row]&&_2bc[row][col]);if((cell.resolution!=_2bb._resolution)||(_2bd?(_2bd!==_2bb.getLatticeID(_2b7)):(!_2bb.intersects(_2b8,_2b7)))){if(_2be){this._removeCell(row,col,_2bd);}}else{if(_2be){this._updateCell(_2be,_2ba);}else{cell.features=_2ba;if(_2bd){_2bc[_2bd]=cell;}else{_2bc[row]=_2bc[row]||{};_2bc[row][col]=cell;}len=_2ba.length;for(i=0;i<len;i++){var _2bf=_2ba[i];var oid=_2bf.attributes[_2b9];this._addFeatureIIf(oid,_2bf);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(_2c0){if(this._pending===0){this._processIOQueue();var _2c1=this.featureLayer,_2c2=_2c1._trackManager;if(_2c2){_2c2.clearTracks();_2c2.addFeatures(_2c1.graphics);if(_2c1._ager){_4.forEach(_2c1.graphics,function(_2c3){if(_2c3._shape){_2c1._repaint(_2c3);}});}_2c2.moveLatestToFront();_2c2.drawTracks();}this.featureLayer._fireUpdateEnd(_2c0&&new Error("FeatureLayer: "+esri.bundle.layers.FeatureLayer.updateError),this._exceeds?{queryLimitExceeded:true}:null);if(this._exceeds){_2c1.onQueryLimitExceeded();}}},_processIOQueue:function(_2c4){this._ioQueue=_4.filter(this._ioQueue,function(dfd){var keep=dfd.fired>-1?false:true;return keep;});if(_2c4){_4.forEach(this._ioQueue,this._cancelPendingRequest);}},_removeOldCells:function(_2c5){var _2c6=this._cellMap,_2c7=this._gridLayer,_2c8,_2c9;for(_2c8 in _2c6){if(_2c6[_2c8]){var row=_2c6[_2c8],_2ca=row.latticeID,_2cb=0,_2cc=0;if(_2ca){_2cb++;if(_2ca!==_2c7.getLatticeID(_2c5)){this._removeCell(null,null,_2ca);_2cc++;}}else{for(_2c9 in row){if(row[_2c9]){_2cb++;var _2cd=row[_2c9].extent;if(!_2c7.intersects(_2cd,_2c5)){this._removeCell(_2c8,_2c9);_2cc++;}}}}if(_2cc===_2cb){delete _2c6[_2c8];}}}},_updateCell:function(cell,_2ce){var _2cf=this.featureLayer,_2d0=_2cf.objectIdField,_2d1=_2cf._selectedFeatures,i,len=_2ce.length;cell.features=cell.features||[];for(i=0;i<len;i++){var _2d2=_2ce[i];var oid=_2d2.attributes[_2d0];var _2d3=this._addFeatureIIf(oid,_2d2);if(_2d3===_2d2){this._incRefCount(oid);cell.features.push(_2d3);}else{if(!(oid in _2d1)){_2d3.setGeometry(_2d2.geometry);_2d3.setAttributes(_2d2.attributes);}}}},_removeCell:function(row,col,_2d4){var _2d5=this._cellMap,_2d6=this.featureLayer,_2d7=_2d6.objectIdField;var cell=_2d4?_2d5[_2d4]:(_2d5[row]&&_2d5[row][col]);if(cell){if(_2d4){delete _2d5[_2d4];}else{delete _2d5[row][col];}var _2d8=cell.features,i;for(i=0;i<_2d8.length;i++){var _2d9=_2d8[i];var oid=_2d9.attributes[_2d7];this._decRefCount(oid);if(oid in _2d6._selectedFeatures){continue;}this._removeFeatureIIf(oid);}}}});_4.declare("esri.layers._GridLayout",null,{constructor:function(_2da,_2db,_2dc,_2dd){this.origin=_2da;this.cellWidth=_2db.width;this.cellHeight=_2db.height;this.mapWidth=_2dc.width;this.mapHeight=_2dc.height;this.srInfo=_2dd;},setResolution:function(_2de){this._resolution=(_2de.xmax-_2de.xmin)/this.mapWidth;if(this.srInfo){var _2df=Math.round((2*this.srInfo.valid[1])/this._resolution),_2e0=Math.round(_2df/this.cellWidth);this._frameStats=[_2e0,0,_2e0-1];}},getCellCoordinates:function(_2e1){var res=this._resolution,_2e2=this.origin;return {row:Math.floor((_2e2.y-_2e1.y)/(this.cellHeight*res)),col:Math.floor((_2e1.x-_2e2.x)/(this.cellWidth*res))};},normalize:function(col){var _2e3=this._frameStats;if(_2e3){var _2e4=_2e3[0],m180=_2e3[1],p180=_2e3[2];if(col<m180){col=col%_2e4;col=col<m180?col+_2e4:col;}else{if(col>p180){col=col%_2e4;}}}return col;},intersects:function(_2e5,_2e6){var _2e7=this.srInfo;if(_2e7){return _4.some(_2e6._getParts(_2e7),function(_2e8){return _2e5.intersects(_2e8.extent);});}else{return _2e5.intersects(_2e6);}},getCellExtent:function(row,col){var res=this._resolution,_2e9=this.origin,_2ea=this.cellWidth,_2eb=this.cellHeight;return new esri.geometry.Extent((col*_2ea*res)+_2e9.x,_2e9.y-((row+1)*_2eb*res),((col+1)*_2ea*res)+_2e9.x,_2e9.y-(row*_2eb*res),new esri.SpatialReference(_2e9.spatialReference.toJson()));},getLatticeID:function(_2ec){var _2ed=this.getCellCoordinates({x:_2ec.xmin,y:_2ec.ymax}),_2ee=this.getCellCoordinates({x:_2ec.xmax,y:_2ec.ymin}),_2ef=_2ed.row,_2f0=_2ee.row,_2f1=this.normalize(_2ed.col),_2f2=this.normalize(_2ee.col);return _2ef+"_"+_2f0+"_"+_2f1+"_"+_2f2;},sorter:function(a,b){return (a<b)?-1:1;},getCellsInExtent:function(_2f3,_2f4){var _2f5=this.getCellCoordinates({x:_2f3.xmin,y:_2f3.ymax}),_2f6=this.getCellCoordinates({x:_2f3.xmax,y:_2f3.ymin}),_2f7=_2f5.row,_2f8=_2f6.row,_2f9=_2f5.col,_2fa=_2f6.col,_2fb=[],i,j,nj,_2fc=[],_2fd=[],len,xmin,xmax,ymin,ymax,_2fe=[],_2ff,_300;for(i=_2f7;i<=_2f8;i++){for(j=_2f9;j<=_2fa;j++){nj=this.normalize(j);_2f3=this.getCellExtent(i,nj);_2fb.push({row:i,col:nj,extent:_2f3,resolution:this._resolution});if(_2f4){_2fc.push(_2f3.xmin,_2f3.xmax);_2fd.push(_2f3.ymin,_2f3.ymax);}}}_2f9=this.normalize(_2f9);_2fa=this.normalize(_2fa);_2fc.sort(this.sorter);_2fd.sort(this.sorter);len=_2fc.length;for(i=len-1;i>=0;i--){if(i<(len-1)){if(_2fc[i]===_2fc[i+1]){_2fc.splice(i,1);}}}len=_2fd.length;for(i=len-1;i>=0;i--){if(i<(len-1)){if(_2fd[i]===_2fd[i+1]){_2fd.splice(i,1);}}}if(_2fc.length&&_2fd.length){xmin=_2fc[0];xmax=_2fc[_2fc.length-1];ymin=_2fd[0];ymax=_2fd[_2fd.length-1];len=_2fc.length;for(i=0;i<len;i++){_2fe.push([[_2fc[i],ymax],[_2fc[i],ymin]]);}len=_2fd.length;for(i=0;i<len;i++){_2fe.push([[xmin,_2fd[i]],[xmax,_2fd[i]]]);}_2ff=new esri.geometry.Polyline({paths:_2fe,spatialReference:this.origin.spatialReference.toJson()});_300=_2f7+"_"+_2f8+"_"+_2f9+"_"+_2fa;_2fb.push({latticeID:_300,lattice:_2ff,resolution:this._resolution});}return {minRow:_2f7,maxRow:_2f8,minCol:_2f9,maxCol:_2fa,cells:_2fb};}});_4.declare("esri.layers._TrackManager",null,{constructor:function(_301){this.layer=_301;this.trackMap={};},initialize:function(map){this.map=map;var _302=this.layer,_303=_302.renderer.trackRenderer;if(_303&&(_302.geometryType==="esriGeometryPoint")){var _304=(this.container=new esri.layers._GraphicsLayer({id:_302.id+"_tracks",_child:true}));_304._setMap(map,_302._div);_304.setRenderer(_303);}},addFeatures:function(_305){var tkid,_306=this.trackMap,_307=this.layer,_308=_307._trackIdField;_4.forEach(_305,function(_309){var _30a=_309.attributes;tkid=_30a[_308];var ary=(_306[tkid]=(_306[tkid]||[]));ary.push(_309);});var _30b=_307._startTimeField,_30c=_307.objectIdField;var _30d=function(a,b){var _30e=a.attributes[_30b],_30f=b.attributes[_30b];if(_30e===_30f){return (a.attributes[_30c]<b.attributes[_30c])?-1:1;}else{return (_30e<_30f)?-1:1;}};for(tkid in _306){_306[tkid].sort(_30d);}},drawTracks:function(){var _310=this.container;if(!_310){return;}var _311=this.trackMap,sr=this.map.spatialReference,tkid,ary,path,i,_312;for(tkid in _311){ary=_311[tkid];path=[];for(i=ary.length-1;i>=0;i--){_312=ary[i].geometry;if(_312){path.push([_312.x,_312.y]);}}if(path.length>0){_310.add(new esri.Graphic(new esri.geometry.Polyline({paths:[path],spatialReference:sr})));}}},moveLatestToFront:function(){_4.forEach(this.getLatestObservations(),function(_313){var _314=_313._shape;_314&&_314._moveToFront();this._repaint(_313,null,true);},this.layer);},getLatestObservations:function(){var _315=[];if(!this.layer.renderer.latestObservationRenderer){return _315;}var _316=this.trackMap,tkid;for(tkid in _316){var ary=_316[tkid];_315.push(ary[ary.length-1]);}return _315;},clearTracks:function(){var _317=this.getLatestObservations();this.trackMap={};var _318=this.container;if(_318){_318.clear();}_4.forEach(_317,function(_319){this._repaint(_319,null,true);},this.layer);},isLatestObservation:function(_31a){var _31b=this.layer._trackIdField;var _31c=this.trackMap[_31a.attributes[_31b]];if(_31c){return (_31c[_31c.length-1]===_31a);}return false;},destroy:function(){var _31d=this.container;if(_31d){_31d.clear();_31d._unsetMap(this.map,this.layer._div);this.container=null;}this.map=null;this.layer=null;this.trackMap=null;}});}if(!_4._hasResource["esri.toolbars._toolbar"]){_4._hasResource["esri.toolbars._toolbar"]=true;_4.provide("esri.toolbars._toolbar");_4.declare("esri.toolbars._Toolbar",null,{constructor:function(map){this.map=map;},_cursors:{"move":"pointer","move-v":"pointer","move-gv":"pointer","box0":"nw-resize","box1":"n-resize","box2":"ne-resize","box3":"e-resize","box4":"se-resize","box5":"s-resize","box6":"sw-resize","box7":"w-resize","box8":"pointer"},_deactivateMapTools:function(nav,_31e,_31f,_320){var map=this.map;if(nav){this._mapNavState={isDoubleClickZoom:map.isDoubleClickZoom,isClickRecenter:map.isClickRecenter,isPan:map.isPan,isRubberBandZoom:map.isRubberBandZoom,isKeyboardNavigation:map.isKeyboardNavigation,isScrollWheelZoom:map.isScrollWheelZoom};map.disableDoubleClickZoom();map.disableClickRecenter();map.disablePan();map.disableRubberBandZoom();map.disableKeyboardNavigation();}if(_31e){map.hideZoomSlider();}if(_31f){map.hidePanArrows();}if(_320){map.graphics.disableMouseEvents();}},_activateMapTools:function(nav,_321,_322,_323){var map=this.map,_324=this._mapNavState;if(nav&&_324){if(_324.isDoubleClickZoom){map.enableDoubleClickZoom();}if(_324.isClickRecenter){map.enableClickRecenter();}if(_324.isPan){map.enablePan();}if(_324.isRubberBandZoom){map.enableRubberBandZoom();}if(_324.isKeyboardNavigation){map.enableKeyboardNavigation();}if(_324.isScrollWheelZoom){map.enableScrollWheelZoom();}}if(_321){map.showZoomSlider();}if(_322){map.showPanArrows();}if(_323){map.graphics.enableMouseEvents();}}});}if(!_4._hasResource["esri.toolbars.draw"]){_4._hasResource["esri.toolbars.draw"]=true;_4.provide("esri.toolbars.draw");_4.declare("esri.toolbars.Draw",esri.toolbars._Toolbar,{constructor:function(map,_325){this.markerSymbol=new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SOLID,10,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new _4.Color([255,0,0]),2),new _4.Color([0,0,0,0.25]));this.lineSymbol=new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new _4.Color([255,0,0]),2);this.fillSymbol=new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new _4.Color([255,0,0]),2),new _4.Color([0,0,0,0.25]));this._points=[];this._defaultOptions={showTooltips:true,drawTime:75,tolerance:8,tooltipOffset:15};this._options=_4.mixin(_4.mixin({},this._defaultOptions),_325||{});if(esri.isTouchEnabled){this._options.showTooltips=false;}this._onKeyDownHandler=_4.hitch(this,this._onKeyDownHandler);this._onMouseDownHandler=_4.hitch(this,this._onMouseDownHandler);this._onMouseUpHandler=_4.hitch(this,this._onMouseUpHandler);this._onClickHandler=_4.hitch(this,this._onClickHandler);this._onMouseMoveHandler=_4.hitch(this,this._onMouseMoveHandler);this._onMouseDragHandler=_4.hitch(this,this._onMouseDragHandler);this._onDblClickHandler=_4.hitch(this,this._onDblClickHandler);this._updateTooltip=_4.hitch(this,this._updateTooltip);this._hideTooltip=_4.hitch(this,this._hideTooltip);this._redrawGraphic=_4.hitch(this,this._redrawGraphic);},_geometryType:null,respectDrawingVertexOrder:false,setRespectDrawingVertexOrder:function(set){this.respectDrawingVertexOrder=set;},setMarkerSymbol:function(_326){this.markerSymbol=_326;},setLineSymbol:function(_327){this.lineSymbol=_327;},setFillSymbol:function(_328){this.fillSymbol=_328;},activate:function(_329,_32a){if(this._geometryType){this.deactivate();}var map=this.map,dc=_4.connect,Draw=esri.toolbars.Draw;this._options=_4.mixin(_4.mixin({},this._options),_32a||{});map.__resetClickDuration();switch(_329){case Draw.POINT:case Draw.ARROW:case Draw.LEFT_ARROW:case Draw.RIGHT_ARROW:case Draw.UP_ARROW:case Draw.DOWN_ARROW:case Draw.TRIANGLE:case Draw.CIRCLE:case Draw.ELLIPSE:case Draw.RECTANGLE:this._onClickHandler_connect=dc(map,"onClick",this._onClickHandler);break;case Draw.LINE:case Draw.EXTENT:case Draw.FREEHAND_POLYLINE:case Draw.FREEHAND_POLYGON:this._deactivateMapTools(true,false,false,true);this._onMouseDownHandler_connect=dc(map,esri.isTouchEnabled?"onTouchStart":"onMouseDown",this._onMouseDownHandler);this._onMouseDragHandler_connect=dc(map,esri.isTouchEnabled?"onTouchMove":"onMouseDrag",this._onMouseDragHandler);this._onMouseUpHandler_connect=dc(map,esri.isTouchEnabled?"onTouchEnd":"onMouseUp",this._onMouseUpHandler);break;case Draw.POLYLINE:case Draw.POLYGON:case Draw.MULTI_POINT:map.__setClickDuration(0);this._onClickHandler_connect=dc(map,"onClick",this._onClickHandler);this._onDblClickHandler_connect=dc(map,"onDblClick",this._onDblClickHandler);map.disableDoubleClickZoom();break;default:console.error(esri.bundle.toolbars.draw.invalidType+": "+_329);return;}this._onKeyDown_connect=dc(map,"onKeyDown",this._onKeyDownHandler);this._redrawConnect=dc(map,"onExtentChange",this._redrawGraphic);this._geometryType=_329;this._toggleTooltip(true);if(map.snappingManager&&this._geometryType!=="freehandpolyline"&&this._geometryType!=="freehandpolygon"&&!esri.isTouchEnabled){map.snappingManager._startSelectionLayerQuery();map.snappingManager._setUpSnapping();}this.onActivate(this._geometryType);},deactivate:function(){var map=this.map;this._clear();var ddc=_4.disconnect;ddc(this._onMouseDownHandler_connect);ddc(this._onMouseMoveHandler_connect);ddc(this._onMouseDragHandler_connect);ddc(this._onMouseUpHandler_connect);ddc(this._onClickHandler_connect);ddc(this._onDblClickHandler_connect);ddc(this._onKeyDown_connect);ddc(this._redrawConnect);if(map.snappingManager){map.snappingManager._stopSelectionLayerQuery();map.snappingManager._killOffSnapping();}switch(this._geometryType){case esri.toolbars.Draw.LINE:case esri.toolbars.Draw.EXTENT:case esri.toolbars.Draw.FREEHAND_POLYLINE:case esri.toolbars.Draw.FREEHAND_POLYGON:this._activateMapTools(true,false,false,true);break;case esri.toolbars.Draw.POLYLINE:case esri.toolbars.Draw.POLYGON:case esri.toolbars.Draw.MULTI_POINT:map.enableDoubleClickZoom();break;}var _32b=this._geometryType;this._geometryType=null;map.__resetClickDuration();this._toggleTooltip(false);this.onDeactivate(_32b);},_clear:function(){if(this._graphic){this.map.graphics.remove(this._graphic,true);}if(this._tGraphic){this.map.graphics.remove(this._tGraphic,true);}this._graphic=this._tGraphic=null;if(this.map.snappingManager){this.map.snappingManager._setGraphic(null);}this._points=[];},finishDrawing:function(){var _32c,_32d=this._points,map=this.map,_32e=map.spatialReference,Draw=esri.toolbars.Draw;_32d=_32d.slice(0,_32d.length);switch(this._geometryType){case Draw.POLYLINE:if(!this._graphic||_32d.length<2){return;}_32c=new esri.geometry.Polyline(_32e);_32c.addPath([].concat(_32d));break;case Draw.POLYGON:if(!this._graphic||_32d.length<3){return;}_32c=new esri.geometry.Polygon(_32e);var ring=[].concat(_32d,[_32d[0].offset(0,0)]);if(!esri.geometry.isClockwise(ring)&&!this.respectDrawingVertexOrder){console.debug(this.declaredClass+" : "+esri.bundle.toolbars.draw.convertAntiClockwisePolygon);ring.reverse();}_32c.addRing(ring);break;case Draw.MULTI_POINT:_32c=new esri.geometry.Multipoint(_32e);_4.forEach(_32d,function(pt){_32c.addPoint(pt);});break;}_4.disconnect(this._onMouseMoveHandler_connect);this._clear();this._setTooltipMessage(0);if(_32c){this.onDrawEnd(_32c);}},_normalizeRect:function(_32f,end,_330){var sx=_32f.x,sy=_32f.y,ex=end.x,ey=end.y,_331=Math.abs(sx-ex),_332=Math.abs(sy-ey);return {x:Math.min(sx,ex),y:Math.max(sy,ey),width:_331,height:_332,spatialReference:_330};},_onMouseDownHandler:function(evt){this._dragged=false;var _333;if(this.map.snappingManager){_333=this.map.snappingManager._snappingPoint;}var _334=_333||evt.mapPoint,Draw=esri.toolbars.Draw,map=this.map,_335=map.spatialReference;this._points.push(_334.offset(0,0));switch(this._geometryType){case Draw.LINE:this._graphic=map.graphics.add(new esri.Graphic(new esri.geometry.Polyline({paths:[[[_334.x,_334.y],[_334.x,_334.y]]]}),this.lineSymbol),true);if(map.snappingManager){map.snappingManager._setGraphic(this._graphic);}break;case Draw.EXTENT:break;case Draw.FREEHAND_POLYLINE:this._oldPoint=evt.screenPoint;var _336=new esri.geometry.Polyline(_335);_336.addPath(this._points);this._graphic=map.graphics.add(new esri.Graphic(_336,this.lineSymbol),true);if(map.snappingManager){map.snappingManager._setGraphic(this._graphic);}break;case Draw.FREEHAND_POLYGON:this._oldPoint=evt.screenPoint;var _337=new esri.geometry.Polygon(_335);_337.addRing(this._points);this._graphic=map.graphics.add(new esri.Graphic(_337,this.fillSymbol),true);if(map.snappingManager){map.snappingManager._setGraphic(this._graphic);}break;}if(esri.isTouchEnabled){evt.preventDefault();}},_onMouseMoveHandler:function(evt){var _338;if(this.map.snappingManager){_338=this.map.snappingManager._snappingPoint;}var _339=this._points[this._points.length-1],end=_338||evt.mapPoint,_33a=this._tGraphic,geom=_33a.geometry;switch(this._geometryType){case esri.toolbars.Draw.POLYLINE:case esri.toolbars.Draw.POLYGON:geom.setPoint(0,0,{x:_339.x,y:_339.y});geom.setPoint(0,1,{x:end.x,y:end.y});_33a.setGeometry(geom);break;}},_onMouseDragHandler:function(evt){if(esri.isTouchEnabled&&!this._points.length){evt.preventDefault();return;}this._dragged=true;var _33b;if(this.map.snappingManager){_33b=this.map.snappingManager._snappingPoint;}var _33c=this._points[0],end=_33b||evt.mapPoint,map=this.map,_33d=map.spatialReference,_33e=this._graphic,Draw=esri.toolbars.Draw;switch(this._geometryType){case Draw.LINE:_33e.setGeometry(_4.mixin(_33e.geometry,{paths:[[[_33c.x,_33c.y],[end.x,end.y]]]}));break;case Draw.EXTENT:if(_33e){map.graphics.remove(_33e,true);}var rect=new esri.geometry.Rect(this._normalizeRect(_33c,end,_33d));rect._originOnly=true;this._graphic=map.graphics.add(new esri.Graphic(rect,this.fillSymbol),true);if(map.snappingManager){map.snappingManager._setGraphic(this._graphic);}break;case Draw.FREEHAND_POLYLINE:this._hideTooltip();if(this._canDrawFreehandPoint(evt)===false){if(esri.isTouchEnabled){evt.preventDefault();}return;}this._points.push(evt.mapPoint.offset(0,0));_33e.geometry._insertPoints([end.offset(0,0)],0);_33e.setGeometry(_33e.geometry);break;case Draw.FREEHAND_POLYGON:this._hideTooltip();if(this._canDrawFreehandPoint(evt)===false){if(esri.isTouchEnabled){evt.preventDefault();}return;}this._points.push(evt.mapPoint.offset(0,0));_33e.geometry._insertPoints([end.offset(0,0)],0);_33e.setGeometry(_33e.geometry);break;}if(esri.isTouchEnabled){evt.preventDefault();}},_canDrawFreehandPoint:function(evt){if(!this._oldPoint){return false;}var dx=this._oldPoint.x-evt.screenPoint.x;dx=(dx<0)?dx*-1:dx;var dy=this._oldPoint.y-evt.screenPoint.y;dy=(dy<0)?dy*-1:dy;var _33f=this._options.tolerance;if(dx<_33f&&dy<_33f){return false;}var now=new Date();var _340=now-this._startTime;if(_340<this._options.drawTime){return false;}this._startTime=now;this._oldPoint=evt.screenPoint;return true;},_onMouseUpHandler:function(evt){if(!this._dragged){this._clear();return;}if(this._points.length===0){this._points.push(evt.mapPoint.offset(0,0));}var _341;if(this.map.snappingManager){_341=this.map.snappingManager._snappingPoint;}var _342=this._points[0],end=_341||evt.mapPoint,map=this.map,_343=map.spatialReference,Draw=esri.toolbars.Draw,_344;switch(this._geometryType){case Draw.LINE:_344=new esri.geometry.Polyline({paths:[[[_342.x,_342.y],[end.x,end.y]]],spatialReference:_343});break;case Draw.EXTENT:_344=esri.geometry._rectToExtent(new esri.geometry.Rect(this._normalizeRect(_342,end,_343)));break;case Draw.FREEHAND_POLYLINE:_344=new esri.geometry.Polyline(_343);_344.addPath([].concat(this._points,[end.offset(0,0)]));break;case Draw.FREEHAND_POLYGON:_344=new esri.geometry.Polygon(_343);var ring=[].concat(this._points,[end.offset(0,0),this._points[0].offset(0,0)]);if(!esri.geometry.isClockwise(ring)&&!this.respectDrawingVertexOrder){console.debug(this.declaredClass+" : "+esri.bundle.toolbars.draw.convertAntiClockwisePolygon);ring.reverse();}_344.addRing(ring);break;}if(esri.isTouchEnabled){evt.preventDefault();}this._clear();this.onDrawEnd(_344);},_onClickHandler:function(evt){var _345;if(this.map.snappingManager){_345=this.map.snappingManager._snappingPoint;}var _346=_345||evt.mapPoint,map=this.map,_347=map.toScreen(_346),Draw=esri.toolbars.Draw,pts,dx,dy,_348,i,_349,geom;this._points.push(_346.offset(0,0));switch(this._geometryType){case Draw.POINT:this.onDrawEnd(_346.offset(0,0));this._setTooltipMessage(0);break;case Draw.POLYLINE:if(this._points.length===1){var _34a=new esri.geometry.Polyline(map.spatialReference);_34a.addPath(this._points);this._graphic=map.graphics.add(new esri.Graphic(_34a,this.lineSymbol),true);if(map.snappingManager){map.snappingManager._setGraphic(this._graphic);}this._onMouseMoveHandler_connect=_4.connect(map,"onMouseMove",this._onMouseMoveHandler);this._tGraphic=map.graphics.add(new esri.Graphic(new esri.geometry.Polyline({paths:[[[_346.x,_346.y],[_346.x,_346.y]]]}),this.lineSymbol),true);}else{this._graphic.geometry._insertPoints([_346.offset(0,0)],0);this._graphic.setGeometry(this._graphic.geometry).setSymbol(this.lineSymbol);_349=this._tGraphic;geom=_349.geometry;geom.setPoint(0,0,_346.offset(0,0));geom.setPoint(0,1,_346.offset(0,0));_349.setGeometry(geom);}break;case Draw.POLYGON:if(this._points.length===1){var _34b=new esri.geometry.Polygon(map.spatialReference);_34b.addRing(this._points);this._graphic=map.graphics.add(new esri.Graphic(_34b,this.fillSymbol),true);if(map.snappingManager){map.snappingManager._setGraphic(this._graphic);}this._onMouseMoveHandler_connect=_4.connect(map,"onMouseMove",this._onMouseMoveHandler);this._tGraphic=map.graphics.add(new esri.Graphic(new esri.geometry.Polyline({paths:[[[_346.x,_346.y],[_346.x,_346.y]]]}),this.fillSymbol),true);}else{this._graphic.geometry._insertPoints([_346.offset(0,0)],0);this._graphic.setGeometry(this._graphic.geometry).setSymbol(this.fillSymbol);_349=this._tGraphic;geom=_349.geometry;geom.setPoint(0,0,_346.offset(0,0));geom.setPoint(0,1,_346.offset(0,0));_349.setGeometry(geom);}break;case Draw.MULTI_POINT:var tps=this._points;if(tps.length===1){var _34c=new esri.geometry.Multipoint(map.spatialReference);_34c.addPoint(tps[tps.length-1]);this._graphic=map.graphics.add(new esri.Graphic(_34c,this.markerSymbol),true);if(map.snappingManager){map.snappingManager._setGraphic(this._graphic);}}else{this._graphic.geometry.addPoint(tps[tps.length-1]);this._graphic.setGeometry(this._graphic.geometry).setSymbol(this.markerSymbol);}break;case Draw.ARROW:pts=[[96,24],[72,52],[72,40],[0,40],[0,12],[72,12],[72,0],[96,24]];dx=_347.x-36;dy=_347.y-24;this._addShape(pts,dx,dy);break;case Draw.LEFT_ARROW:pts=[[0,24],[24,52],[24,40],[96,40],[96,12],[24,12],[24,0],[0,24]];dx=_347.x-60;dy=_347.y-24;this._addShape(pts,dx,dy);break;case Draw.RIGHT_ARROW:pts=[[96,24],[72,52],[72,40],[0,40],[0,12],[72,12],[72,0],[96,24]];dx=_347.x-36;dy=_347.y-24;this._addShape(pts,dx,dy);break;case Draw.UP_ARROW:pts=[[24,0],[52,24],[40,24],[40,96],[12,96],[12,24],[0,24],[24,0]];dx=_347.x-24;dy=_347.y-60;this._addShape(pts,dx,dy);break;case Draw.DOWN_ARROW:pts=[[24,96],[52,72],[40,72],[40,0],[12,0],[12,72],[0,72],[24,96]];dx=_347.x-24;dy=_347.y-36;this._addShape(pts,dx,dy);break;case Draw.TRIANGLE:pts=[[0,96],[48,0],[96,96],[0,96]];dx=_347.x-48;dy=_347.y-48;this._addShape(pts,dx,dy);break;case Draw.RECTANGLE:pts=[[0,-96],[96,-96],[96,0],[0,0],[0,-96]];dx=_347.x-48;dy=_347.y+48;this._addShape(pts,dx,dy);break;case Draw.CIRCLE:_348=360;var _34d=(2*Math.PI)/_348;pts=[];for(i=0;i<_348;i++){pts.push([48*Math.cos(_34d*i),48*Math.sin(_34d*i)]);}pts.push(pts[0]);this._addShape(pts,_347.x,_347.y);break;case Draw.ELLIPSE:var rad=Math.PI/180;var beta=-rad;var _34e=Math.sin(beta);var _34f=Math.cos(beta);_348=360;pts=[];for(i=0;i<_348;i++){var _350=i*(rad);var _351=Math.sin(_350);var _352=Math.cos(_350);var x=(48*_352*_34f-24*_351*_34e);var y=(48*_352*_34e+24*_351*_34f);pts.push([x,y]);}pts.push(pts[0]);this._addShape(pts,_347.x,_347.y);break;}this._setTooltipMessage(this._points.length);},_addShape:function(path,dx,dy){var _353=this.map.graphics.add(new esri.Graphic(this._toPolygon(path,dx,dy),this.fillSymbol),true);this._setTooltipMessage(0);var geom;if(_353){geom=esri.geometry.fromJson(_353.geometry.toJson());this.map.graphics.remove(_353,true);}this.onDrawEnd(geom);_353=geom=null;},_toPolygon:function(path,dx,dy){var map=this.map;var _354=new esri.geometry.Polygon(map.spatialReference);_354.addRing(_4.map(path,function(pt){return map.toMap({x:pt[0]+dx,y:pt[1]+dy});}));return _354;},_onDblClickHandler:function(evt){var _355,_356=this._points,map=this.map,_357=map.spatialReference,Draw=esri.toolbars.Draw;if(esri.isTouchEnabled){_356.push(evt.mapPoint);}_356=_356.slice(0,_356.length);switch(this._geometryType){case Draw.POLYLINE:if(!this._graphic||_356.length<2){_4.disconnect(this._onMouseMoveHandler_connect);this._clear();this._onClickHandler(evt);return;}_355=new esri.geometry.Polyline(_357);_355.addPath([].concat(_356));break;case Draw.POLYGON:if(!this._graphic||_356.length<2){_4.disconnect(this._onMouseMoveHandler_connect);this._clear();this._onClickHandler(evt);return;}_355=new esri.geometry.Polygon(_357);var ring=[].concat(_356,[_356[0].offset(0,0)]);if(!esri.geometry.isClockwise(ring)&&!this.respectDrawingVertexOrder){console.debug(this.declaredClass+" : "+esri.bundle.toolbars.draw.convertAntiClockwisePolygon);ring.reverse();}_355.addRing(ring);break;case Draw.MULTI_POINT:_355=new esri.geometry.Multipoint(_357);_4.forEach(_356,function(pt){_355.addPoint(pt);});break;}_4.disconnect(this._onMouseMoveHandler_connect);this._clear();this._setTooltipMessage(0);this.onDrawEnd(_355);},_onKeyDownHandler:function(evt){if(evt.keyCode===_4.keys.ESCAPE){_4.disconnect(this._onMouseMoveHandler_connect);this._clear();this._setTooltipMessage(0);}},_toggleTooltip:function(show){if(!this._options.showTooltips){return;}if(show){if(this._tooltip){return;}var _358=this.map.container;this._tooltip=_4.create("div",{"class":"tooltip"},_358);this._tooltip.style.display="none";this._tooltip.style.position="fixed";this._setTooltipMessage(0);this._onTooltipMouseEnterHandler_connect=_4.connect(this.map,"onMouseOver",this._updateTooltip);this._onTooltipMouseLeaveHandler_connect=_4.connect(this.map,"onMouseOut",this._hideTooltip);this._onTooltipMouseMoveHandler_connect=_4.connect(this.map,"onMouseMove",this._updateTooltip);}else{if(this._tooltip){_4.disconnect(this._onTooltipMouseEnterHandler_connect);_4.disconnect(this._onTooltipMouseLeaveHandler_connect);_4.disconnect(this._onTooltipMouseMoveHandler_connect);_4.destroy(this._tooltip);this._tooltip=null;}}},_hideTooltip:function(){var _359=this._tooltip;if(!_359){return;}_359.style.display="none";},_setTooltipMessage:function(_35a){var _35b=this._tooltip;if(!_35b){return;}var _35c=_35a;var _35d="";switch(this._geometryType){case esri.toolbars.Draw.POINT:_35d=esri.bundle.toolbars.draw.addPoint;break;case esri.toolbars.Draw.ARROW:case esri.toolbars.Draw.LEFT_ARROW:case esri.toolbars.Draw.RIGHT_ARROW:case esri.toolbars.Draw.UP_ARROW:case esri.toolbars.Draw.DOWN_ARROW:case esri.toolbars.Draw.TRIANGLE:case esri.toolbars.Draw.RECTANGLE:case esri.toolbars.Draw.CIRCLE:case esri.toolbars.Draw.ELLIPSE:_35d=esri.bundle.toolbars.draw.addShape;break;case esri.toolbars.Draw.LINE:case esri.toolbars.Draw.EXTENT:case esri.toolbars.Draw.FREEHAND_POLYLINE:case esri.toolbars.Draw.FREEHAND_POLYGON:_35d=esri.bundle.toolbars.draw.freehand;break;case esri.toolbars.Draw.POLYLINE:case esri.toolbars.Draw.POLYGON:_35d=esri.bundle.toolbars.draw.start;if(_35c===1){_35d=esri.bundle.toolbars.draw.resume;}else{if(_35c>=2){_35d=esri.bundle.toolbars.draw.complete;}}break;case esri.toolbars.Draw.MULTI_POINT:_35d=esri.bundle.toolbars.draw.addMultipoint;if(_35c>=1){_35d=esri.bundle.toolbars.draw.finish;}break;}_35b.innerHTML=_35d;},_updateTooltip:function(evt){var _35e=this._tooltip;if(!_35e){return;}var px,py;if(evt.clientX||evt.pageY){px=evt.clientX;py=evt.clientY;}else{px=evt.clientX+_4.body().scrollLeft-_4.body().clientLeft;py=evt.clientY+_4.body().scrollTop-_4.body().clientTop;}_35e.style.display="none";_4.style(_35e,{left:(px+this._options.tooltipOffset)+"px",top:(py)+"px"});_35e.style.display="";},_redrawGraphic:function(_35f,_360,_361,lod){if(_361||this.map.wrapAround180){var g=this._graphic;if(g){g.setGeometry(g.geometry);}g=this._tGraphic;if(g){g.setGeometry(g.geometry);}}},onActivate:function(){},onDeactivate:function(){},onDrawEnd:function(){}});_4.mixin(esri.toolbars.Draw,{POINT:"point",MULTI_POINT:"multipoint",LINE:"line",EXTENT:"extent",POLYLINE:"polyline",POLYGON:"polygon",FREEHAND_POLYLINE:"freehandpolyline",FREEHAND_POLYGON:"freehandpolygon",ARROW:"arrow",LEFT_ARROW:"leftarrow",RIGHT_ARROW:"rightarrow",UP_ARROW:"uparrow",DOWN_ARROW:"downarrow",TRIANGLE:"triangle",CIRCLE:"circle",ELLIPSE:"ellipse",RECTANGLE:"rectangle"});}if(!_4._hasResource["dojox.gfx.Mover"]){_4._hasResource["dojox.gfx.Mover"]=true;_4.provide("dojox.gfx.Mover");_4.declare("dojox.gfx.Mover",null,{constructor:function(_362,e,host){this.shape=_362;this.lastX=e.clientX;this.lastY=e.clientY;var h=this.host=host,d=document;this.events=[_4.connect(d,"onmousemove",this,"onFirstMove"),_4.connect(d,"ontouchmove",this,"onFirstMove"),_4.connect(d,"onmousemove",this,"onMouseMove"),_4.connect(d,"ontouchmove",this,"onMouseMove"),_4.connect(d,"onmouseup",this,"destroy"),_4.connect(d,"ontouchend",this,"destroy"),_4.connect(d,"ondragstart",_4,"stopEvent"),_4.connect(d,"onselectstart",_4,"stopEvent")];if(h&&h.onMoveStart){h.onMoveStart(this);}},onMouseMove:function(e){var pos=e.touches?e.touches[0]:e;var x=pos.clientX;var y=pos.clientY;this.host.onMove(this,{dx:x-this.lastX,dy:y-this.lastY});this.lastX=x;this.lastY=y;_4.stopEvent(e);},onFirstMove:function(){this.host.onFirstMove(this);_4.disconnect(this.events.shift());_4.disconnect(this.events.shift());},destroy:function(){_4.forEach(this.events,_4.disconnect);var h=this.host;if(h&&h.onMoveStop){h.onMoveStop(this);}this.events=this.shape=null;}});}if(!_4._hasResource["dojox.gfx.Moveable"]){_4._hasResource["dojox.gfx.Moveable"]=true;_4.provide("dojox.gfx.Moveable");_4.declare("dojox.gfx.Moveable",null,{constructor:function(_363,_364){this.shape=_363;this.delay=(_364&&_364.delay>0)?_364.delay:0;this.mover=(_364&&_364.mover)?_364.mover:_6.gfx.Mover;this.leftButtonOnly=_364&&_364.leftButtonOnly;this.events=[this.shape.connect("onmousedown",this,"onMouseDown"),this.shape.connect("ontouchstart",this,"onMouseDown")];},destroy:function(){_4.forEach(this.events,this.shape.disconnect,this.shape);this.events=this.shape=null;},onMouseDown:function(e){var pos=e.touches?e.touches[0]:e;if(this.delay){this.events.push(this.shape.connect("onmousemove",this,"onMouseMove"));this.events.push(this.shape.connect("ontouchmove",this,"onMouseMove"));this.events.push(this.shape.connect("onmouseup",this,"onMouseUp"));this.events.push(this.shape.connect("ontouchend",this,"onMouseUp"));this._lastX=pos.clientX;this._lastY=pos.clientY;}else{if(!this.leftButtonOnly||(pos.button===_4.mouseButtons.LEFT)){new this.mover(this.shape,pos,this);}}_4.stopEvent(e);},onMouseMove:function(e){var pos=e.touches?e.touches[0]:e;if(Math.abs(pos.clientX-this._lastX)>this.delay||Math.abs(pos.clientY-this._lastY)>this.delay){this.onMouseUp(e);new this.mover(this.shape,pos,this);}_4.stopEvent(e);},onMouseUp:function(e){this.shape.disconnect(this.events.shift());this.shape.disconnect(this.events.shift());},onMoveStart:function(_365){_4.publish("/gfx/move/start",[_365]);_4.addClass(_4.body(),"dojoMove");},onMoveStop:function(_366){_4.publish("/gfx/move/stop",[_366]);_4.removeClass(_4.body(),"dojoMove");},onFirstMove:function(_367){},onMove:function(_368,_369){this.onMoving(_368,_369);this.shape.applyLeftTransform(_369);this.onMoved(_368,_369);},onMoving:function(_36a,_36b){},onMoved:function(_36c,_36d){}});}if(!_4._hasResource["dojox.gfx.move"]){_4._hasResource["dojox.gfx.move"]=true;_4.provide("dojox.gfx.move");}if(!_4._hasResource["esri.toolbars._GraphicMover"]){_4._hasResource["esri.toolbars._GraphicMover"]=true;_4.provide("esri.toolbars._GraphicMover");_4.declare("esri.toolbars._Mover",_6.gfx.Mover,{constructor:function(_36e,e,host){this.__e=e;}});_4.declare("esri.toolbars._GraphicMover",null,{constructor:function(_36f,map,_370){this.graphic=_36f;this.map=map;this.toolbar=_370;this._enableGraphicMover();this._moved=false;},refresh:function(_371){var _372=this.graphic.getDojoShape();if(_372&&(_371||!_372._hostGraphic)){this._disableGraphicMover();this._enableGraphicMover();}},destroy:function(){this._disableGraphicMover();},hasMoved:function(){return this._moved;},_enableGraphicMover:function(){var _373=this.graphic;var _374=_373.getDojoShape();if(_374){_374._hostGraphic=_373;this._moveable=new _6.gfx.Moveable(_374,{mover:esri.toolbars._Mover});this._moveStartHandle=_4.connect(this._moveable,"onMoveStart",this,this._moveStartHandler);this._firstMoveHandle=_4.connect(this._moveable,"onFirstMove",this,this._firstMoveHandler);this._movingHandle=_4.connect(this._moveable,"onMoving",this,this._movingHandler);this._moveStopHandle=_4.connect(this._moveable,"onMoveStop",this,this._moveStopHandler);var node=_374.getEventSource();if(node){_4.style(node,"cursor",this.toolbar._cursors.move);}}},_disableGraphicMover:function(){var _375=this._moveable;if(_375){_4.disconnect(this._moveStartHandle);_4.disconnect(this._firstMoveHandle);_4.disconnect(this._movingHandle);_4.disconnect(this._moveStopHandle);var _376=_375.shape;if(_376){_376._hostGraphic=null;var node=_376.getEventSource();if(node){_4.style(node,"cursor",null);}}_375.destroy();}this._moveable=null;},_moveStartHandler:function(){var _377=this.graphic;this._startTx=_377.getDojoShape().getTransform();if(this.graphic.geometry.type==="point"){var map=this.map;if(map.snappingManager){map.snappingManager._setUpSnapping();}}this.toolbar.onGraphicMoveStart(_377);},_firstMoveHandler:function(){this.toolbar._beginOperation("MOVE");this.toolbar.onGraphicFirstMove(this.graphic);},_movingHandler:function(_378){this.toolbar.onGraphicMove(this.graphic,_378.shape.getTransform());},_moveStopHandler:function(_379){var _37a=this.graphic,map=this.map,mx=_6.gfx.matrix,_37b=_37a.geometry,type=_37b.type,_37c=_37a.getDojoShape(),tx=_37c.getTransform();if(_4.toJson(tx)!==_4.toJson(this._startTx)){this._moved=true;switch(type){case "point":var _37d=[tx,mx.invert(this._startTx)];var _37e;if(map.snappingManager){_37e=map.snappingManager._snappingPoint;}_37b=_37e||map.toMap(mx.multiplyPoint(_37d,map.toScreen(_37b,true)));if(map.snappingManager){map.snappingManager._killOffSnapping();}break;case "polyline":_37b=this._updatePolyGeometry(_37b,_37b.paths,tx);break;case "polygon":_37b=this._updatePolyGeometry(_37b,_37b.rings,tx);break;}_37c.setTransform(null);_37a.setGeometry(_37b);}else{this._moved=false;}this.toolbar._endOperation("MOVE");this.toolbar.onGraphicMoveStop(_37a,tx);if(!this._moved){var e=_379.__e,_37f=this.map.position,pt=new esri.geometry.Point(e.pageX-_37f.x,e.pageY-_37f.y);this.toolbar.onGraphicClick(_37a,{screenPoint:pt,mapPoint:this.map.toMap(pt)});}},_updatePolyGeometry:function(_380,_381,_382){var map=this.map;var _383=_380.getPoint(0,0);var _384=map.toMap(map.toScreen(_383).offset(_382.dx,_382.dy));var _385=_384.x-_383.x;var _386=_384.y-_383.y;for(var i=0;i<_381.length;i++){var seg=_381[i];for(var j=0;j<seg.length;j++){var _387=_380.getPoint(i,j);_380.setPoint(i,j,_387.offset(_385,_386));}}return _380;}});}if(!_4._hasResource["dojo.window"]){_4._hasResource["dojo.window"]=true;_4.provide("dojo.window");_4.getObject("window",true,_4);_4.window.getBox=function(){var _388=(_4.doc.compatMode=="BackCompat")?_4.body():_4.doc.documentElement;var _389=_4._docScroll();return {w:_388.clientWidth,h:_388.clientHeight,l:_389.x,t:_389.y};};_4.window.get=function(doc){if(_4.isIE&&window!==document.parentWindow){doc.parentWindow.execScript("document._parentWindow = window;","Javascript");var win=doc._parentWindow;doc._parentWindow=null;return win;}return doc.parentWindow||doc.defaultView;};_4.window.scrollIntoView=function(node,pos){try{node=_4.byId(node);var doc=node.ownerDocument||_4.doc,body=doc.body||_4.body(),html=doc.documentElement||body.parentNode,isIE=_4.isIE,isWK=_4.isWebKit;if((!(_4.isMoz||isIE||isWK||_4.isOpera)||node==body||node==html)&&(typeof node.scrollIntoView!="undefined")){node.scrollIntoView(false);return;}var _38a=doc.compatMode=="BackCompat",_38b=(isIE>=9&&node.ownerDocument.parentWindow.frameElement)?((html.clientHeight>0&&html.clientWidth>0&&(body.clientHeight==0||body.clientWidth==0||body.clientHeight>html.clientHeight||body.clientWidth>html.clientWidth))?html:body):(_38a?body:html),_38c=isWK?body:_38b,_38d=_38b.clientWidth,_38e=_38b.clientHeight,rtl=!_4._isBodyLtr(),_38f=pos||_4.position(node),el=node.parentNode,_390=function(el){return ((isIE<=6||(isIE&&_38a))?false:(_4.style(el,"position").toLowerCase()=="fixed"));};if(_390(node)){return;}while(el){if(el==body){el=_38c;}var _391=_4.position(el),_392=_390(el);if(el==_38c){_391.w=_38d;_391.h=_38e;if(_38c==html&&isIE&&rtl){_391.x+=_38c.offsetWidth-_391.w;}if(_391.x<0||!isIE){_391.x=0;}if(_391.y<0||!isIE){_391.y=0;}}else{var pb=_4._getPadBorderExtents(el);_391.w-=pb.w;_391.h-=pb.h;_391.x+=pb.l;_391.y+=pb.t;var _393=el.clientWidth,_394=_391.w-_393;if(_393>0&&_394>0){_391.w=_393;_391.x+=(rtl&&(isIE||el.clientLeft>pb.l))?_394:0;}_393=el.clientHeight;_394=_391.h-_393;if(_393>0&&_394>0){_391.h=_393;}}if(_392){if(_391.y<0){_391.h+=_391.y;_391.y=0;}if(_391.x<0){_391.w+=_391.x;_391.x=0;}if(_391.y+_391.h>_38e){_391.h=_38e-_391.y;}if(_391.x+_391.w>_38d){_391.w=_38d-_391.x;}}var l=_38f.x-_391.x,t=_38f.y-Math.max(_391.y,0),r=l+_38f.w-_391.w,bot=t+_38f.h-_391.h;if(r*l>0){var s=Math[l<0?"max":"min"](l,r);if(rtl&&((isIE==8&&!_38a)||isIE>=9)){s=-s;}_38f.x+=el.scrollLeft;el.scrollLeft+=s;_38f.x-=el.scrollLeft;}if(bot*t>0){_38f.y+=el.scrollTop;el.scrollTop+=Math[t<0?"max":"min"](t,bot);_38f.y-=el.scrollTop;}el=(el!=_38c)&&!_392&&el.parentNode;}}catch(error){console.error("scrollIntoView: "+error);node.scrollIntoView(false);}};}if(!_4._hasResource["dojo.Stateful"]){_4._hasResource["dojo.Stateful"]=true;_4.provide("dojo.Stateful");_4.declare("dojo.Stateful",null,{postscript:function(_395){if(_395){_4.mixin(this,_395);}},get:function(name){return this[name];},set:function(name,_396){if(typeof name==="object"){for(var x in name){this.set(x,name[x]);}return this;}var _397=this[name];this[name]=_396;if(this._watchCallbacks){this._watchCallbacks(name,_397,_396);}return this;},watch:function(name,_398){var _399=this._watchCallbacks;if(!_399){var self=this;_399=this._watchCallbacks=function(name,_39a,_39b,_39c){var _39d=function(_39e){if(_39e){_39e=_39e.slice();for(var i=0,l=_39e.length;i<l;i++){try{_39e[i].call(self,name,_39a,_39b);}catch(e){console.error(e);}}}};_39d(_399["_"+name]);if(!_39c){_39d(_399["*"]);}};}if(!_398&&typeof name==="function"){_398=name;name="*";}else{name="_"+name;}var _39f=_399[name];if(typeof _39f!=="object"){_39f=_399[name]=[];}_39f.push(_398);return {unwatch:function(){_39f.splice(_4.indexOf(_39f,_398),1);}};}});}if(!_4._hasResource["dijit._WidgetBase"]){_4._hasResource["dijit._WidgetBase"]=true;_4.provide("dijit._WidgetBase");(function(){_4.declare("dijit._WidgetBase",_4.Stateful,{id:"",lang:"",dir:"","class":"",style:"",title:"",tooltip:"",baseClass:"",srcNodeRef:null,domNode:null,containerNode:null,attributeMap:{id:"",dir:"",lang:"","class":"",style:"",title:""},_blankGif:(_4.config.blankGif||_4.moduleUrl("dojo","resources/blank.gif")).toString(),postscript:function(_3a0,_3a1){this.create(_3a0,_3a1);},create:function(_3a2,_3a3){this.srcNodeRef=_4.byId(_3a3);this._connects=[];this._subscribes=[];if(this.srcNodeRef&&(typeof this.srcNodeRef.id=="string")){this.id=this.srcNodeRef.id;}if(_3a2){this.params=_3a2;_4._mixin(this,_3a2);}this.postMixInProperties();if(!this.id){this.id=_5.getUniqueId(this.declaredClass.replace(/\./g,"_"));}_5.registry.add(this);this.buildRendering();if(this.domNode){this._applyAttributes();var _3a4=this.srcNodeRef;if(_3a4&&_3a4.parentNode&&this.domNode!==_3a4){_3a4.parentNode.replaceChild(this.domNode,_3a4);}}if(this.domNode){this.domNode.setAttribute("widgetId",this.id);}this.postCreate();if(this.srcNodeRef&&!this.srcNodeRef.parentNode){delete this.srcNodeRef;}this._created=true;},_applyAttributes:function(){var _3a5=function(attr,_3a6){if((_3a6.params&&attr in _3a6.params)||_3a6[attr]){_3a6.set(attr,_3a6[attr]);}};for(var attr in this.attributeMap){_3a5(attr,this);}_4.forEach(this._getSetterAttributes(),function(a){if(!(a in this.attributeMap)){_3a5(a,this);}},this);},_getSetterAttributes:function(){var ctor=this.constructor;if(!ctor._setterAttrs){var r=(ctor._setterAttrs=[]),_3a7,_3a8=ctor.prototype;for(var _3a9 in _3a8){if(_4.isFunction(_3a8[_3a9])&&(_3a7=_3a9.match(/^_set([a-zA-Z]*)Attr$/))&&_3a7[1]){r.push(_3a7[1].charAt(0).toLowerCase()+_3a7[1].substr(1));}}}return ctor._setterAttrs;},postMixInProperties:function(){},buildRendering:function(){if(!this.domNode){this.domNode=this.srcNodeRef||_4.create("div");}if(this.baseClass){var _3aa=this.baseClass.split(" ");if(!this.isLeftToRight()){_3aa=_3aa.concat(_4.map(_3aa,function(name){return name+"Rtl";}));}_4.addClass(this.domNode,_3aa);}},postCreate:function(){},startup:function(){this._started=true;},destroyRecursive:function(_3ab){this._beingDestroyed=true;this.destroyDescendants(_3ab);this.destroy(_3ab);},destroy:function(_3ac){this._beingDestroyed=true;this.uninitialize();var d=_4,dfe=d.forEach,dun=d.unsubscribe;dfe(this._connects,function(_3ad){dfe(_3ad,d.disconnect);});dfe(this._subscribes,function(_3ae){dun(_3ae);});dfe(this._supportingWidgets||[],function(w){if(w.destroyRecursive){w.destroyRecursive();}else{if(w.destroy){w.destroy();}}});this.destroyRendering(_3ac);_5.registry.remove(this.id);this._destroyed=true;},destroyRendering:function(_3af){if(this.bgIframe){this.bgIframe.destroy(_3af);delete this.bgIframe;}if(this.domNode){if(_3af){_4.removeAttr(this.domNode,"widgetId");}else{_4.destroy(this.domNode);}delete this.domNode;}if(this.srcNodeRef){if(!_3af){_4.destroy(this.srcNodeRef);}delete this.srcNodeRef;}},destroyDescendants:function(_3b0){_4.forEach(this.getChildren(),function(_3b1){if(_3b1.destroyRecursive){_3b1.destroyRecursive(_3b0);}});},uninitialize:function(){return false;},_setClassAttr:function(_3b2){var _3b3=this[this.attributeMap["class"]||"domNode"];_4.replaceClass(_3b3,_3b2,this["class"]);this._set("class",_3b2);},_setStyleAttr:function(_3b4){var _3b5=this[this.attributeMap.style||"domNode"];if(_4.isObject(_3b4)){_4.style(_3b5,_3b4);}else{if(_3b5.style.cssText){_3b5.style.cssText+="; "+_3b4;}else{_3b5.style.cssText=_3b4;}}this._set("style",_3b4);},_attrToDom:function(attr,_3b6){var _3b7=this.attributeMap[attr];_4.forEach(_4.isArray(_3b7)?_3b7:[_3b7],function(_3b8){var _3b9=this[_3b8.node||_3b8||"domNode"];var type=_3b8.type||"attribute";switch(type){case "attribute":if(_4.isFunction(_3b6)){_3b6=_4.hitch(this,_3b6);}var _3ba=_3b8.attribute?_3b8.attribute:(/^on[A-Z][a-zA-Z]*$/.test(attr)?attr.toLowerCase():attr);_4.attr(_3b9,_3ba,_3b6);break;case "innerText":_3b9.innerHTML="";_3b9.appendChild(_4.doc.createTextNode(_3b6));break;case "innerHTML":_3b9.innerHTML=_3b6;break;case "class":_4.replaceClass(_3b9,_3b6,this[attr]);break;}},this);},get:function(name){var _3bb=this._getAttrNames(name);return this[_3bb.g]?this[_3bb.g]():this[name];},set:function(name,_3bc){if(typeof name==="object"){for(var x in name){this.set(x,name[x]);}return this;}var _3bd=this._getAttrNames(name);if(this[_3bd.s]){var _3be=this[_3bd.s].apply(this,Array.prototype.slice.call(arguments,1));}else{if(name in this.attributeMap){this._attrToDom(name,_3bc);}this._set(name,_3bc);}return _3be||this;},_attrPairNames:{},_getAttrNames:function(name){var apn=this._attrPairNames;if(apn[name]){return apn[name];}var uc=name.charAt(0).toUpperCase()+name.substr(1);return (apn[name]={n:name+"Node",s:"_set"+uc+"Attr",g:"_get"+uc+"Attr"});},_set:function(name,_3bf){var _3c0=this[name];this[name]=_3bf;if(this._watchCallbacks&&this._created&&_3bf!==_3c0){this._watchCallbacks(name,_3c0,_3bf);}},toString:function(){return "[Widget "+this.declaredClass+", "+(this.id||"NO ID")+"]";},getDescendants:function(){return this.containerNode?_4.query("[widgetId]",this.containerNode).map(_5.byNode):[];},getChildren:function(){return this.containerNode?_5.findWidgets(this.containerNode):[];},connect:function(obj,_3c1,_3c2){var _3c3=[_4._connect(obj,_3c1,this,_3c2)];this._connects.push(_3c3);return _3c3;},disconnect:function(_3c4){for(var i=0;i<this._connects.length;i++){if(this._connects[i]==_3c4){_4.forEach(_3c4,_4.disconnect);this._connects.splice(i,1);return;}}},subscribe:function(_3c5,_3c6){var _3c7=_4.subscribe(_3c5,this,_3c6);this._subscribes.push(_3c7);return _3c7;},unsubscribe:function(_3c8){for(var i=0;i<this._subscribes.length;i++){if(this._subscribes[i]==_3c8){_4.unsubscribe(_3c8);this._subscribes.splice(i,1);return;}}},isLeftToRight:function(){return this.dir?(this.dir=="ltr"):_4._isBodyLtr();},placeAt:function(_3c9,_3ca){if(_3c9.declaredClass&&_3c9.addChild){_3c9.addChild(this,_3ca);}else{_4.place(this.domNode,_3c9,_3ca);}return this;}});})();}if(!_4._hasResource["dijit._base.focus"]){_4._hasResource["dijit._base.focus"]=true;_4.provide("dijit._base.focus");_4.mixin(_5,{_curFocus:null,_prevFocus:null,isCollapsed:function(){return _5.getBookmark().isCollapsed;},getBookmark:function(){var bm,rg,tg,sel=_4.doc.selection,cf=_5._curFocus;if(_4.global.getSelection){sel=_4.global.getSelection();if(sel){if(sel.isCollapsed){tg=cf?cf.tagName:"";if(tg){tg=tg.toLowerCase();if(tg=="textarea"||(tg=="input"&&(!cf.type||cf.type.toLowerCase()=="text"))){sel={start:cf.selectionStart,end:cf.selectionEnd,node:cf,pRange:true};return {isCollapsed:(sel.end<=sel.start),mark:sel};}}bm={isCollapsed:true};if(sel.rangeCount){bm.mark=sel.getRangeAt(0).cloneRange();}}else{rg=sel.getRangeAt(0);bm={isCollapsed:false,mark:rg.cloneRange()};}}}else{if(sel){tg=cf?cf.tagName:"";tg=tg.toLowerCase();if(cf&&tg&&(tg=="button"||tg=="textarea"||tg=="input")){if(sel.type&&sel.type.toLowerCase()=="none"){return {isCollapsed:true,mark:null};}else{rg=sel.createRange();return {isCollapsed:rg.text&&rg.text.length?false:true,mark:{range:rg,pRange:true}};}}bm={};try{rg=sel.createRange();bm.isCollapsed=!(sel.type=="Text"?rg.htmlText.length:rg.length);}catch(e){bm.isCollapsed=true;return bm;}if(sel.type.toUpperCase()=="CONTROL"){if(rg.length){bm.mark=[];var i=0,len=rg.length;while(i<len){bm.mark.push(rg.item(i++));}}else{bm.isCollapsed=true;bm.mark=null;}}else{bm.mark=rg.getBookmark();}}else{console.warn("No idea how to store the current selection for this browser!");}}return bm;},moveToBookmark:function(_3cb){var _3cc=_4.doc,mark=_3cb.mark;if(mark){if(_4.global.getSelection){var sel=_4.global.getSelection();if(sel&&sel.removeAllRanges){if(mark.pRange){var r=mark;var n=r.node;n.selectionStart=r.start;n.selectionEnd=r.end;}else{sel.removeAllRanges();sel.addRange(mark);}}else{console.warn("No idea how to restore selection for this browser!");}}else{if(_3cc.selection&&mark){var rg;if(mark.pRange){rg=mark.range;}else{if(_4.isArray(mark)){rg=_3cc.body.createControlRange();_4.forEach(mark,function(n){rg.addElement(n);});}else{rg=_3cc.body.createTextRange();rg.moveToBookmark(mark);}}rg.select();}}}},getFocus:function(menu,_3cd){var node=!_5._curFocus||(menu&&_4.isDescendant(_5._curFocus,menu.domNode))?_5._prevFocus:_5._curFocus;return {node:node,bookmark:(node==_5._curFocus)&&_4.withGlobal(_3cd||_4.global,_5.getBookmark),openedForWindow:_3cd};},focus:function(_3ce){if(!_3ce){return;}var node="node" in _3ce?_3ce.node:_3ce,_3cf=_3ce.bookmark,_3d0=_3ce.openedForWindow,_3d1=_3cf?_3cf.isCollapsed:false;if(node){var _3d2=(node.tagName.toLowerCase()=="iframe")?node.contentWindow:node;if(_3d2&&_3d2.focus){try{_3d2.focus();}catch(e){}}_5._onFocusNode(node);}if(_3cf&&_4.withGlobal(_3d0||_4.global,_5.isCollapsed)&&!_3d1){if(_3d0){_3d0.focus();}try{_4.withGlobal(_3d0||_4.global,_5.moveToBookmark,null,[_3cf]);}catch(e2){}}},_activeStack:[],registerIframe:function(_3d3){return _5.registerWin(_3d3.contentWindow,_3d3);},unregisterIframe:function(_3d4){_5.unregisterWin(_3d4);},registerWin:function(_3d5,_3d6){var _3d7=function(evt){_5._justMouseDowned=true;setTimeout(function(){_5._justMouseDowned=false;},0);if(_4.isIE&&evt&&evt.srcElement&&evt.srcElement.parentNode==null){return;}_5._onTouchNode(_3d6||evt.target||evt.srcElement,"mouse");};var doc=_4.isIE?_3d5.document.documentElement:_3d5.document;if(doc){if(_4.isIE){_3d5.document.body.attachEvent("onmousedown",_3d7);var _3d8=function(evt){if(evt.srcElement.tagName.toLowerCase()!="#document"&&_5.isTabNavigable(evt.srcElement)){_5._onFocusNode(_3d6||evt.srcElement);}else{_5._onTouchNode(_3d6||evt.srcElement);}};doc.attachEvent("onactivate",_3d8);var _3d9=function(evt){_5._onBlurNode(_3d6||evt.srcElement);};doc.attachEvent("ondeactivate",_3d9);return function(){_3d5.document.detachEvent("onmousedown",_3d7);doc.detachEvent("onactivate",_3d8);doc.detachEvent("ondeactivate",_3d9);doc=null;};}else{doc.body.addEventListener("mousedown",_3d7,true);var _3da=function(evt){_5._onFocusNode(_3d6||evt.target);};doc.addEventListener("focus",_3da,true);var _3db=function(evt){_5._onBlurNode(_3d6||evt.target);};doc.addEventListener("blur",_3db,true);return function(){doc.body.removeEventListener("mousedown",_3d7,true);doc.removeEventListener("focus",_3da,true);doc.removeEventListener("blur",_3db,true);doc=null;};}}},unregisterWin:function(_3dc){_3dc&&_3dc();},_onBlurNode:function(node){_5._prevFocus=_5._curFocus;_5._curFocus=null;if(_5._justMouseDowned){return;}if(_5._clearActiveWidgetsTimer){clearTimeout(_5._clearActiveWidgetsTimer);}_5._clearActiveWidgetsTimer=setTimeout(function(){delete _5._clearActiveWidgetsTimer;_5._setStack([]);_5._prevFocus=null;},100);},_onTouchNode:function(node,by){if(_5._clearActiveWidgetsTimer){clearTimeout(_5._clearActiveWidgetsTimer);delete _5._clearActiveWidgetsTimer;}var _3dd=[];try{while(node){var _3de=_4.attr(node,"dijitPopupParent");if(_3de){node=_5.byId(_3de).domNode;}else{if(node.tagName&&node.tagName.toLowerCase()=="body"){if(node===_4.body()){break;}node=_4.window.get(node.ownerDocument).frameElement;}else{var id=node.getAttribute&&node.getAttribute("widgetId"),_3df=id&&_5.byId(id);if(_3df&&!(by=="mouse"&&_3df.get("disabled"))){_3dd.unshift(id);}node=node.parentNode;}}}}catch(e){}_5._setStack(_3dd,by);},_onFocusNode:function(node){if(!node){return;}if(node.nodeType==9){return;}_5._onTouchNode(node);if(node==_5._curFocus){return;}if(_5._curFocus){_5._prevFocus=_5._curFocus;}_5._curFocus=node;_4.publish("focusNode",[node]);},_setStack:function(_3e0,by){var _3e1=_5._activeStack;_5._activeStack=_3e0;for(var _3e2=0;_3e2<Math.min(_3e1.length,_3e0.length);_3e2++){if(_3e1[_3e2]!=_3e0[_3e2]){break;}}var _3e3;for(var i=_3e1.length-1;i>=_3e2;i--){_3e3=_5.byId(_3e1[i]);if(_3e3){_3e3._focused=false;_3e3.set("focused",false);_3e3._hasBeenBlurred=true;if(_3e3._onBlur){_3e3._onBlur(by);}_4.publish("widgetBlur",[_3e3,by]);}}for(i=_3e2;i<_3e0.length;i++){_3e3=_5.byId(_3e0[i]);if(_3e3){_3e3._focused=true;_3e3.set("focused",true);if(_3e3._onFocus){_3e3._onFocus(by);}_4.publish("widgetFocus",[_3e3,by]);}}}});_4.addOnLoad(function(){var _3e4=_5.registerWin(window);if(_4.isIE){_4.addOnWindowUnload(function(){_5.unregisterWin(_3e4);_3e4=null;});}});}if(!_4._hasResource["dojo.AdapterRegistry"]){_4._hasResource["dojo.AdapterRegistry"]=true;_4.provide("dojo.AdapterRegistry");_4.AdapterRegistry=function(_3e5){this.pairs=[];this.returnWrappers=_3e5||false;};_4.extend(_4.AdapterRegistry,{register:function(name,_3e6,wrap,_3e7,_3e8){this.pairs[((_3e8)?"unshift":"push")]([name,_3e6,wrap,_3e7]);},match:function(){for(var i=0;i<this.pairs.length;i++){var pair=this.pairs[i];if(pair[1].apply(this,arguments)){if((pair[3])||(this.returnWrappers)){return pair[2];}else{return pair[2].apply(this,arguments);}}}throw new Error("No match found");},unregister:function(name){for(var i=0;i<this.pairs.length;i++){var pair=this.pairs[i];if(pair[0]==name){this.pairs.splice(i,1);return true;}}return false;}});}if(!_4._hasResource["dijit._base.place"]){_4._hasResource["dijit._base.place"]=true;_4.provide("dijit._base.place");_5.getViewport=function(){return _4.window.getBox();};_5.placeOnScreen=function(node,pos,_3e9,_3ea){var _3eb=_4.map(_3e9,function(_3ec){var c={corner:_3ec,pos:{x:pos.x,y:pos.y}};if(_3ea){c.pos.x+=_3ec.charAt(1)=="L"?_3ea.x:-_3ea.x;c.pos.y+=_3ec.charAt(0)=="T"?_3ea.y:-_3ea.y;}return c;});return _5._place(node,_3eb);};_5._place=function(node,_3ed,_3ee,_3ef){var view=_4.window.getBox();if(!node.parentNode||String(node.parentNode.tagName).toLowerCase()!="body"){_4.body().appendChild(node);}var best=null;_4.some(_3ed,function(_3f0){var _3f1=_3f0.corner;var pos=_3f0.pos;var _3f2=0;var _3f3={w:_3f1.charAt(1)=="L"?(view.l+view.w)-pos.x:pos.x-view.l,h:_3f1.charAt(1)=="T"?(view.t+view.h)-pos.y:pos.y-view.t};if(_3ee){var res=_3ee(node,_3f0.aroundCorner,_3f1,_3f3,_3ef);_3f2=typeof res=="undefined"?0:res;}var _3f4=node.style;var _3f5=_3f4.display;var _3f6=_3f4.visibility;_3f4.visibility="hidden";_3f4.display="";var mb=_4.marginBox(node);_3f4.display=_3f5;_3f4.visibility=_3f6;var _3f7=Math.max(view.l,_3f1.charAt(1)=="L"?pos.x:(pos.x-mb.w)),_3f8=Math.max(view.t,_3f1.charAt(0)=="T"?pos.y:(pos.y-mb.h)),endX=Math.min(view.l+view.w,_3f1.charAt(1)=="L"?(_3f7+mb.w):pos.x),endY=Math.min(view.t+view.h,_3f1.charAt(0)=="T"?(_3f8+mb.h):pos.y),_3f9=endX-_3f7,_3fa=endY-_3f8;_3f2+=(mb.w-_3f9)+(mb.h-_3fa);if(best==null||_3f2<best.overflow){best={corner:_3f1,aroundCorner:_3f0.aroundCorner,x:_3f7,y:_3f8,w:_3f9,h:_3fa,overflow:_3f2,spaceAvailable:_3f3};}return !_3f2;});if(best.overflow&&_3ee){_3ee(node,best.aroundCorner,best.corner,best.spaceAvailable,_3ef);}var l=_4._isBodyLtr(),s=node.style;s.top=best.y+"px";s[l?"left":"right"]=(l?best.x:view.w-best.x-best.w)+"px";return best;};_5.placeOnScreenAroundNode=function(node,_3fb,_3fc,_3fd){_3fb=_4.byId(_3fb);var _3fe=_4.position(_3fb,true);return _5._placeOnScreenAroundRect(node,_3fe.x,_3fe.y,_3fe.w,_3fe.h,_3fc,_3fd);};_5.placeOnScreenAroundRectangle=function(node,_3ff,_400,_401){return _5._placeOnScreenAroundRect(node,_3ff.x,_3ff.y,_3ff.width,_3ff.height,_400,_401);};_5._placeOnScreenAroundRect=function(node,x,y,_402,_403,_404,_405){var _406=[];for(var _407 in _404){_406.push({aroundCorner:_407,corner:_404[_407],pos:{x:x+(_407.charAt(1)=="L"?0:_402),y:y+(_407.charAt(0)=="T"?0:_403)}});}return _5._place(node,_406,_405,{w:_402,h:_403});};_5.placementRegistry=new _4.AdapterRegistry();_5.placementRegistry.register("node",function(n,x){return typeof x=="object"&&typeof x.offsetWidth!="undefined"&&typeof x.offsetHeight!="undefined";},_5.placeOnScreenAroundNode);_5.placementRegistry.register("rect",function(n,x){return typeof x=="object"&&"x" in x&&"y" in x&&"width" in x&&"height" in x;},_5.placeOnScreenAroundRectangle);_5.placeOnScreenAroundElement=function(node,_408,_409,_40a){return _5.placementRegistry.match.apply(_5.placementRegistry,arguments);};_5.getPopupAroundAlignment=function(_40b,_40c){var _40d={};_4.forEach(_40b,function(pos){switch(pos){case "after":_40d[_40c?"BR":"BL"]=_40c?"BL":"BR";break;case "before":_40d[_40c?"BL":"BR"]=_40c?"BR":"BL";break;case "below-alt":_40c=!_40c;case "below":_40d[_40c?"BL":"BR"]=_40c?"TL":"TR";_40d[_40c?"BR":"BL"]=_40c?"TR":"TL";break;case "above-alt":_40c=!_40c;case "above":default:_40d[_40c?"TL":"TR"]=_40c?"BL":"BR";_40d[_40c?"TR":"TL"]=_40c?"BR":"BL";break;}});return _40d;};}if(!_4._hasResource["dijit._base.window"]){_4._hasResource["dijit._base.window"]=true;_4.provide("dijit._base.window");_5.getDocumentWindow=function(doc){return _4.window.get(doc);};}if(!_4._hasResource["dijit._base.popup"]){_4._hasResource["dijit._base.popup"]=true;_4.provide("dijit._base.popup");_5.popup={_stack:[],_beginZIndex:1000,_idGen:1,_createWrapper:function(_40e){var _40f=_40e.declaredClass?_40e._popupWrapper:(_40e.parentNode&&_4.hasClass(_40e.parentNode,"dijitPopup")),node=_40e.domNode||_40e;if(!_40f){_40f=_4.create("div",{"class":"dijitPopup",style:{display:"none"},role:"presentation"},_4.body());_40f.appendChild(node);var s=node.style;s.display="";s.visibility="";s.position="";s.top="0px";if(_40e.declaredClass){_40e._popupWrapper=_40f;_4.connect(_40e,"destroy",function(){_4.destroy(_40f);delete _40e._popupWrapper;});}}return _40f;},moveOffScreen:function(_410){var _411=this._createWrapper(_410);_4.style(_411,{visibility:"hidden",top:"-9999px",display:""});},hide:function(_412){var _413=this._createWrapper(_412);_4.style(_413,"display","none");},getTopPopup:function(){var _414=this._stack;for(var pi=_414.length-1;pi>0&&_414[pi].parent===_414[pi-1].widget;pi--){}return _414[pi];},open:function(args){var _415=this._stack,_416=args.popup,_417=args.orient||((args.parent?args.parent.isLeftToRight():_4._isBodyLtr())?{"BL":"TL","BR":"TR","TL":"BL","TR":"BR"}:{"BR":"TR","BL":"TL","TR":"BR","TL":"BL"}),_418=args.around,id=(args.around&&args.around.id)?(args.around.id+"_dropdown"):("popup_"+this._idGen++);while(_415.length&&(!args.parent||!_4.isDescendant(args.parent.domNode,_415[_415.length-1].widget.domNode))){_5.popup.close(_415[_415.length-1].widget);}var _419=this._createWrapper(_416);_4.attr(_419,{id:id,style:{zIndex:this._beginZIndex+_415.length},"class":"dijitPopup "+(_416.baseClass||_416["class"]||"").split(" ")[0]+"Popup",dijitPopupParent:args.parent?args.parent.id:""});if(_4.isIE||_4.isMoz){if(!_416.bgIframe){_416.bgIframe=new _5.BackgroundIframe(_419);}}var best=_418?_5.placeOnScreenAroundElement(_419,_418,_417,_416.orient?_4.hitch(_416,"orient"):null):_5.placeOnScreen(_419,args,_417=="R"?["TR","BR","TL","BL"]:["TL","BL","TR","BR"],args.padding);_419.style.display="";_419.style.visibility="visible";_416.domNode.style.visibility="visible";var _41a=[];_41a.push(_4.connect(_419,"onkeypress",this,function(evt){if(evt.charOrCode==_4.keys.ESCAPE&&args.onCancel){_4.stopEvent(evt);args.onCancel();}else{if(evt.charOrCode===_4.keys.TAB){_4.stopEvent(evt);var _41b=this.getTopPopup();if(_41b&&_41b.onCancel){_41b.onCancel();}}}}));if(_416.onCancel){_41a.push(_4.connect(_416,"onCancel",args.onCancel));}_41a.push(_4.connect(_416,_416.onExecute?"onExecute":"onChange",this,function(){var _41c=this.getTopPopup();if(_41c&&_41c.onExecute){_41c.onExecute();}}));_415.push({widget:_416,parent:args.parent,onExecute:args.onExecute,onCancel:args.onCancel,onClose:args.onClose,handlers:_41a});if(_416.onOpen){_416.onOpen(best);}return best;},close:function(_41d){var _41e=this._stack;while((_41d&&_4.some(_41e,function(elem){return elem.widget==_41d;}))||(!_41d&&_41e.length)){var top=_41e.pop(),_41f=top.widget,_420=top.onClose;if(_41f.onClose){_41f.onClose();}_4.forEach(top.handlers,_4.disconnect);if(_41f&&_41f.domNode){this.hide(_41f);}if(_420){_420();}}}};_5._frames=new function(){var _421=[];this.pop=function(){var _422;if(_421.length){_422=_421.pop();_422.style.display="";}else{if(_4.isIE<9){var burl=_4.config["dojoBlankHtmlUrl"]||(_4.moduleUrl("dojo","resources/blank.html")+"")||"javascript:\"\"";var html="<iframe src='"+burl+"'"+" style='position: absolute; left: 0px; top: 0px;"+"z-index: -1; filter:Alpha(Opacity=\"0\");'>";_422=_4.doc.createElement(html);}else{_422=_4.create("iframe");_422.src="javascript:\"\"";_422.className="dijitBackgroundIframe";_4.style(_422,"opacity",0.1);}_422.tabIndex=-1;_5.setWaiRole(_422,"presentation");}return _422;};this.push=function(_423){_423.style.display="none";_421.push(_423);};}();_5.BackgroundIframe=function(node){if(!node.id){throw new Error("no id");}if(_4.isIE||_4.isMoz){var _424=(this.iframe=_5._frames.pop());node.appendChild(_424);if(_4.isIE<7||_4.isQuirks){this.resize(node);this._conn=_4.connect(node,"onresize",this,function(){this.resize(node);});}else{_4.style(_424,{width:"100%",height:"100%"});}}};_4.extend(_5.BackgroundIframe,{resize:function(node){if(this.iframe){_4.style(this.iframe,{width:node.offsetWidth+"px",height:node.offsetHeight+"px"});}},destroy:function(){if(this._conn){_4.disconnect(this._conn);this._conn=null;}if(this.iframe){_5._frames.push(this.iframe);delete this.iframe;}}});}if(!_4._hasResource["dijit._base.scroll"]){_4._hasResource["dijit._base.scroll"]=true;_4.provide("dijit._base.scroll");_5.scrollIntoView=function(node,pos){_4.window.scrollIntoView(node,pos);};}if(!_4._hasResource["dojo.uacss"]){_4._hasResource["dojo.uacss"]=true;_4.provide("dojo.uacss");(function(){var d=_4,html=d.doc.documentElement,ie=d.isIE,_425=d.isOpera,maj=Math.floor,ff=d.isFF,_426=d.boxModel.replace(/-/,""),_427={dj_ie:ie,dj_ie6:maj(ie)==6,dj_ie7:maj(ie)==7,dj_ie8:maj(ie)==8,dj_ie9:maj(ie)==9,dj_quirks:d.isQuirks,dj_iequirks:ie&&d.isQuirks,dj_opera:_425,dj_khtml:d.isKhtml,dj_webkit:d.isWebKit,dj_safari:d.isSafari,dj_chrome:d.isChrome,dj_gecko:d.isMozilla,dj_ff3:maj(ff)==3};_427["dj_"+_426]=true;var _428="";for(var clz in _427){if(_427[clz]){_428+=clz+" ";}}html.className=d.trim(html.className+" "+_428);_4._loaders.unshift(function(){if(!_4._isBodyLtr()){var _429="dj_rtl dijitRtl "+_428.replace(/ /g,"-rtl ");html.className=d.trim(html.className+" "+_429);}});})();}if(!_4._hasResource["dijit._base.sniff"]){_4._hasResource["dijit._base.sniff"]=true;_4.provide("dijit._base.sniff");}if(!_4._hasResource["dijit._base.typematic"]){_4._hasResource["dijit._base.typematic"]=true;_4.provide("dijit._base.typematic");_5.typematic={_fireEventAndReload:function(){this._timer=null;this._callback(++this._count,this._node,this._evt);this._currentTimeout=Math.max(this._currentTimeout<0?this._initialDelay:(this._subsequentDelay>1?this._subsequentDelay:Math.round(this._currentTimeout*this._subsequentDelay)),this._minDelay);this._timer=setTimeout(_4.hitch(this,"_fireEventAndReload"),this._currentTimeout);},trigger:function(evt,_42a,node,_42b,obj,_42c,_42d,_42e){if(obj!=this._obj){this.stop();this._initialDelay=_42d||500;this._subsequentDelay=_42c||0.9;this._minDelay=_42e||10;this._obj=obj;this._evt=evt;this._node=node;this._currentTimeout=-1;this._count=-1;this._callback=_4.hitch(_42a,_42b);this._fireEventAndReload();this._evt=_4.mixin({faux:true},evt);}},stop:function(){if(this._timer){clearTimeout(this._timer);this._timer=null;}if(this._obj){this._callback(-1,this._node,this._evt);this._obj=null;}},addKeyListener:function(node,_42f,_430,_431,_432,_433,_434){if(_42f.keyCode){_42f.charOrCode=_42f.keyCode;_4.deprecated("keyCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0");}else{if(_42f.charCode){_42f.charOrCode=String.fromCharCode(_42f.charCode);_4.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0");}}return [_4.connect(node,"onkeypress",this,function(evt){if(evt.charOrCode==_42f.charOrCode&&(_42f.ctrlKey===undefined||_42f.ctrlKey==evt.ctrlKey)&&(_42f.altKey===undefined||_42f.altKey==evt.altKey)&&(_42f.metaKey===undefined||_42f.metaKey==(evt.metaKey||false))&&(_42f.shiftKey===undefined||_42f.shiftKey==evt.shiftKey)){_4.stopEvent(evt);_5.typematic.trigger(evt,_430,node,_431,_42f,_432,_433,_434);}else{if(_5.typematic._obj==_42f){_5.typematic.stop();}}}),_4.connect(node,"onkeyup",this,function(evt){if(_5.typematic._obj==_42f){_5.typematic.stop();}})];},addMouseListener:function(node,_435,_436,_437,_438,_439){var dc=_4.connect;return [dc(node,"mousedown",this,function(evt){_4.stopEvent(evt);_5.typematic.trigger(evt,_435,node,_436,node,_437,_438,_439);}),dc(node,"mouseup",this,function(evt){_4.stopEvent(evt);_5.typematic.stop();}),dc(node,"mouseout",this,function(evt){_4.stopEvent(evt);_5.typematic.stop();}),dc(node,"mousemove",this,function(evt){evt.preventDefault();}),dc(node,"dblclick",this,function(evt){_4.stopEvent(evt);if(_4.isIE){_5.typematic.trigger(evt,_435,node,_436,node,_437,_438,_439);setTimeout(_4.hitch(this,_5.typematic.stop),50);}})];},addListener:function(_43a,_43b,_43c,_43d,_43e,_43f,_440,_441){return this.addKeyListener(_43b,_43c,_43d,_43e,_43f,_440,_441).concat(this.addMouseListener(_43a,_43d,_43e,_43f,_440,_441));}};}if(!_4._hasResource["dijit._base.wai"]){_4._hasResource["dijit._base.wai"]=true;_4.provide("dijit._base.wai");_5.wai={onload:function(){var div=_4.create("div",{id:"a11yTestNode",style:{cssText:"border: 1px solid;"+"border-color:red green;"+"position: absolute;"+"height: 5px;"+"top: -999px;"+"background-image: url(\""+(_4.config.blankGif||_4.moduleUrl("dojo","resources/blank.gif"))+"\");"}},_4.body());var cs=_4.getComputedStyle(div);if(cs){var _442=cs.backgroundImage;var _443=(cs.borderTopColor==cs.borderRightColor)||(_442!=null&&(_442=="none"||_442=="url(invalid-url:)"));_4[_443?"addClass":"removeClass"](_4.body(),"dijit_a11y");if(_4.isIE){div.outerHTML="";}else{_4.body().removeChild(div);}}}};if(_4.isIE||_4.isMoz){_4._loaders.unshift(_5.wai.onload);}_4.mixin(_5,{hasWaiRole:function(elem,role){var _444=this.getWaiRole(elem);return role?(_444.indexOf(role)>-1):(_444.length>0);},getWaiRole:function(elem){return _4.trim((_4.attr(elem,"role")||"").replace("wairole:",""));},setWaiRole:function(elem,role){_4.attr(elem,"role",role);},removeWaiRole:function(elem,role){var _445=_4.attr(elem,"role");if(!_445){return;}if(role){var t=_4.trim((" "+_445+" ").replace(" "+role+" "," "));_4.attr(elem,"role",t);}else{elem.removeAttribute("role");}},hasWaiState:function(elem,_446){return elem.hasAttribute?elem.hasAttribute("aria-"+_446):!!elem.getAttribute("aria-"+_446);},getWaiState:function(elem,_447){return elem.getAttribute("aria-"+_447)||"";},setWaiState:function(elem,_448,_449){elem.setAttribute("aria-"+_448,_449);},removeWaiState:function(elem,_44a){elem.removeAttribute("aria-"+_44a);}});}if(!_4._hasResource["dijit._base"]){_4._hasResource["dijit._base"]=true;_4.provide("dijit._base");}if(!_4._hasResource["dijit._Widget"]){_4._hasResource["dijit._Widget"]=true;_4.provide("dijit._Widget");_4.connect(_4,"_connect",function(_44b,_44c){if(_44b&&_4.isFunction(_44b._onConnect)){_44b._onConnect(_44c);}});_5._connectOnUseEventHandler=function(_44d){};_5._lastKeyDownNode=null;if(_4.isIE){(function(){var _44e=function(evt){_5._lastKeyDownNode=evt.srcElement;};_4.doc.attachEvent("onkeydown",_44e);_4.addOnWindowUnload(function(){_4.doc.detachEvent("onkeydown",_44e);});})();}else{_4.doc.addEventListener("keydown",function(evt){_5._lastKeyDownNode=evt.target;},true);}(function(){_4.declare("dijit._Widget",_5._WidgetBase,{_deferredConnects:{onClick:"",onDblClick:"",onKeyDown:"",onKeyPress:"",onKeyUp:"",onMouseMove:"",onMouseDown:"",onMouseOut:"",onMouseOver:"",onMouseLeave:"",onMouseEnter:"",onMouseUp:""},onClick:_5._connectOnUseEventHandler,onDblClick:_5._connectOnUseEventHandler,onKeyDown:_5._connectOnUseEventHandler,onKeyPress:_5._connectOnUseEventHandler,onKeyUp:_5._connectOnUseEventHandler,onMouseDown:_5._connectOnUseEventHandler,onMouseMove:_5._connectOnUseEventHandler,onMouseOut:_5._connectOnUseEventHandler,onMouseOver:_5._connectOnUseEventHandler,onMouseLeave:_5._connectOnUseEventHandler,onMouseEnter:_5._connectOnUseEventHandler,onMouseUp:_5._connectOnUseEventHandler,create:function(_44f,_450){this._deferredConnects=_4.clone(this._deferredConnects);for(var attr in this.attributeMap){delete this._deferredConnects[attr];}for(attr in this._deferredConnects){if(this[attr]!==_5._connectOnUseEventHandler){delete this._deferredConnects[attr];}}this.inherited(arguments);if(this.domNode){for(attr in this.params){this._onConnect(attr);}}},_onConnect:function(_451){if(_451 in this._deferredConnects){var _452=this[this._deferredConnects[_451]||"domNode"];this.connect(_452,_451.toLowerCase(),_451);delete this._deferredConnects[_451];}},focused:false,isFocusable:function(){return this.focus&&(_4.style(this.domNode,"display")!="none");},onFocus:function(){},onBlur:function(){},_onFocus:function(e){this.onFocus();},_onBlur:function(){this.onBlur();},setAttribute:function(attr,_453){_4.deprecated(this.declaredClass+"::setAttribute(attr, value) is deprecated. Use set() instead.","","2.0");this.set(attr,_453);},attr:function(name,_454){if(_4.config.isDebug){var _455=arguments.callee._ach||(arguments.callee._ach={}),_456=(arguments.callee.caller||"unknown caller").toString();if(!_455[_456]){_4.deprecated(this.declaredClass+"::attr() is deprecated. Use get() or set() instead, called from "+_456,"","2.0");_455[_456]=true;}}var args=arguments.length;if(args>=2||typeof name==="object"){return this.set.apply(this,arguments);}else{return this.get(name);}},nodesWithKeyClick:["input","button"],connect:function(obj,_457,_458){var d=_4,dc=d._connect,_459=this.inherited(arguments,[obj,_457=="ondijitclick"?"onclick":_457,_458]);if(_457=="ondijitclick"){if(d.indexOf(this.nodesWithKeyClick,obj.nodeName.toLowerCase())==-1){var m=d.hitch(this,_458);_459.push(dc(obj,"onkeydown",this,function(e){if((e.keyCode==d.keys.ENTER||e.keyCode==d.keys.SPACE)&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey){_5._lastKeyDownNode=e.target;if(!("openDropDown" in this&&obj==this._buttonNode)){e.preventDefault();}}}),dc(obj,"onkeyup",this,function(e){if((e.keyCode==d.keys.ENTER||e.keyCode==d.keys.SPACE)&&e.target==_5._lastKeyDownNode&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey){_5._lastKeyDownNode=null;return m(e);}}));}}return _459;},_onShow:function(){this.onShow();},onShow:function(){},onHide:function(){},onClose:function(){return true;}});})();}if(!_4._hasResource["dijit._Container"]){_4._hasResource["dijit._Container"]=true;_4.provide("dijit._Container");_4.declare("dijit._Container",null,{isContainer:true,buildRendering:function(){this.inherited(arguments);if(!this.containerNode){this.containerNode=this.domNode;}},addChild:function(_45a,_45b){var _45c=this.containerNode;if(_45b&&typeof _45b=="number"){var _45d=this.getChildren();if(_45d&&_45d.length>=_45b){_45c=_45d[_45b-1].domNode;_45b="after";}}_4.place(_45a.domNode,_45c,_45b);if(this._started&&!_45a._started){_45a.startup();}},removeChild:function(_45e){if(typeof _45e=="number"){_45e=this.getChildren()[_45e];}if(_45e){var node=_45e.domNode;if(node&&node.parentNode){node.parentNode.removeChild(node);}}},hasChildren:function(){return this.getChildren().length>0;},destroyDescendants:function(_45f){_4.forEach(this.getChildren(),function(_460){_460.destroyRecursive(_45f);});},_getSiblingOfChild:function(_461,dir){var node=_461.domNode,_462=(dir>0?"nextSibling":"previousSibling");do{node=node[_462];}while(node&&(node.nodeType!=1||!_5.byNode(node)));return node&&_5.byNode(node);},getIndexOfChild:function(_463){return _4.indexOf(this.getChildren(),_463);},startup:function(){if(this._started){return;}_4.forEach(this.getChildren(),function(_464){_464.startup();});this.inherited(arguments);}});}if(!_4._hasResource["dijit._KeyNavContainer"]){_4._hasResource["dijit._KeyNavContainer"]=true;_4.provide("dijit._KeyNavContainer");_4.declare("dijit._KeyNavContainer",_5._Container,{tabIndex:"0",_keyNavCodes:{},connectKeyNavHandlers:function(_465,_466){var _467=(this._keyNavCodes={});var prev=_4.hitch(this,this.focusPrev);var next=_4.hitch(this,this.focusNext);_4.forEach(_465,function(code){_467[code]=prev;});_4.forEach(_466,function(code){_467[code]=next;});_467[_4.keys.HOME]=_4.hitch(this,"focusFirstChild");_467[_4.keys.END]=_4.hitch(this,"focusLastChild");this.connect(this.domNode,"onkeypress","_onContainerKeypress");this.connect(this.domNode,"onfocus","_onContainerFocus");},startupKeyNavChildren:function(){_4.forEach(this.getChildren(),_4.hitch(this,"_startupChild"));},addChild:function(_468,_469){_5._KeyNavContainer.superclass.addChild.apply(this,arguments);this._startupChild(_468);},focus:function(){this.focusFirstChild();},focusFirstChild:function(){var _46a=this._getFirstFocusableChild();if(_46a){this.focusChild(_46a);}},focusLastChild:function(){var _46b=this._getLastFocusableChild();if(_46b){this.focusChild(_46b);}},focusNext:function(){var _46c=this._getNextFocusableChild(this.focusedChild,1);this.focusChild(_46c);},focusPrev:function(){var _46d=this._getNextFocusableChild(this.focusedChild,-1);this.focusChild(_46d,true);},focusChild:function(_46e,last){if(this.focusedChild&&_46e!==this.focusedChild){this._onChildBlur(this.focusedChild);}_46e.set("tabIndex",this.tabIndex);_46e.focus(last?"end":"start");this._set("focusedChild",_46e);},_startupChild:function(_46f){_46f.set("tabIndex","-1");this.connect(_46f,"_onFocus",function(){_46f.set("tabIndex",this.tabIndex);});this.connect(_46f,"_onBlur",function(){_46f.set("tabIndex","-1");});},_onContainerFocus:function(evt){if(evt.target!==this.domNode){return;}this.focusFirstChild();_4.attr(this.domNode,"tabIndex","-1");},_onBlur:function(evt){if(this.tabIndex){_4.attr(this.domNode,"tabIndex",this.tabIndex);}this.inherited(arguments);},_onContainerKeypress:function(evt){if(evt.ctrlKey||evt.altKey){return;}var func=this._keyNavCodes[evt.charOrCode];if(func){func();_4.stopEvent(evt);}},_onChildBlur:function(_470){},_getFirstFocusableChild:function(){return this._getNextFocusableChild(null,1);},_getLastFocusableChild:function(){return this._getNextFocusableChild(null,-1);},_getNextFocusableChild:function(_471,dir){if(_471){_471=this._getSiblingOfChild(_471,dir);}var _472=this.getChildren();for(var i=0;i<_472.length;i++){if(!_471){_471=_472[(dir>0)?0:(_472.length-1)];}if(_471.isFocusable()){return _471;}_471=this._getSiblingOfChild(_471,dir);}return null;}});}if(!_4._hasResource["dojo.date.stamp"]){_4._hasResource["dojo.date.stamp"]=true;_4.provide("dojo.date.stamp");_4.getObject("date.stamp",true,_4);_4.date.stamp.fromISOString=function(_473,_474){if(!_4.date.stamp._isoRegExp){_4.date.stamp._isoRegExp=/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;}var _475=_4.date.stamp._isoRegExp.exec(_473),_476=null;if(_475){_475.shift();if(_475[1]){_475[1]--;}if(_475[6]){_475[6]*=1000;}if(_474){_474=new Date(_474);_4.forEach(_4.map(["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds"],function(prop){return _474["get"+prop]();}),function(_477,_478){_475[_478]=_475[_478]||_477;});}_476=new Date(_475[0]||1970,_475[1]||0,_475[2]||1,_475[3]||0,_475[4]||0,_475[5]||0,_475[6]||0);if(_475[0]<100){_476.setFullYear(_475[0]||1970);}var _479=0,_47a=_475[7]&&_475[7].charAt(0);if(_47a!="Z"){_479=((_475[8]||0)*60)+(Number(_475[9])||0);if(_47a!="-"){_479*=-1;}}if(_47a){_479-=_476.getTimezoneOffset();}if(_479){_476.setTime(_476.getTime()+_479*60000);}}return _476;};_4.date.stamp.toISOString=function(_47b,_47c){var _47d=function(n){return (n<10)?"0"+n:n;};_47c=_47c||{};var _47e=[],_47f=_47c.zulu?"getUTC":"get",date="";if(_47c.selector!="time"){var year=_47b[_47f+"FullYear"]();date=["0000".substr((year+"").length)+year,_47d(_47b[_47f+"Month"]()+1),_47d(_47b[_47f+"Date"]())].join("-");}_47e.push(date);if(_47c.selector!="date"){var time=[_47d(_47b[_47f+"Hours"]()),_47d(_47b[_47f+"Minutes"]()),_47d(_47b[_47f+"Seconds"]())].join(":");var _480=_47b[_47f+"Milliseconds"]();if(_47c.milliseconds){time+="."+(_480<100?"0":"")+_47d(_480);}if(_47c.zulu){time+="Z";}else{if(_47c.selector!="time"){var _481=_47b.getTimezoneOffset();var _482=Math.abs(_481);time+=(_481>0?"-":"+")+_47d(Math.floor(_482/60))+":"+_47d(_482%60);}}_47e.push(time);}return _47e.join("T");};}if(!_4._hasResource["dojo.parser"]){_4._hasResource["dojo.parser"]=true;_4.provide("dojo.parser");new Date("X");_4.parser=new function(){var d=_4;function _483(_484){if(d.isString(_484)){return "string";}if(typeof _484=="number"){return "number";}if(typeof _484=="boolean"){return "boolean";}if(d.isFunction(_484)){return "function";}if(d.isArray(_484)){return "array";}if(_484 instanceof Date){return "date";}if(_484 instanceof d._Url){return "url";}return "object";};function _485(_486,type){switch(type){case "string":return _486;case "number":return _486.length?Number(_486):NaN;case "boolean":return typeof _486=="boolean"?_486:!(_486.toLowerCase()=="false");case "function":if(d.isFunction(_486)){_486=_486.toString();_486=d.trim(_486.substring(_486.indexOf("{")+1,_486.length-1));}try{if(_486===""||_486.search(/[^\w\.]+/i)!=-1){return new Function(_486);}else{return d.getObject(_486,false)||new Function(_486);}}catch(e){return new Function();}case "array":return _486?_486.split(/\s*,\s*/):[];case "date":switch(_486){case "":return new Date("");case "now":return new Date();default:return d.date.stamp.fromISOString(_486);}case "url":return d.baseUrl+_486;default:return d.fromJson(_486);}};var _487={},_488={};d.connect(d,"extend",function(){_488={};});function _489(cls,_48a){for(var name in cls){if(name.charAt(0)=="_"){continue;}if(name in _487){continue;}_48a[name]=_483(cls[name]);}return _48a;};function _48b(_48c,_48d){var c=_488[_48c];if(!c){var cls=d.getObject(_48c),_48e=null;if(!cls){return null;}if(!_48d){_48e=_489(cls.prototype,{});}c={cls:cls,params:_48e};}else{if(!_48d&&!c.params){c.params=_489(c.cls.prototype,{});}}return c;};this._functionFromScript=function(_48f,_490){var _491="";var _492="";var _493=(_48f.getAttribute(_490+"args")||_48f.getAttribute("args"));if(_493){d.forEach(_493.split(/\s*,\s*/),function(part,idx){_491+="var "+part+" = arguments["+idx+"]; ";});}var _494=_48f.getAttribute("with");if(_494&&_494.length){d.forEach(_494.split(/\s*,\s*/),function(part){_491+="with("+part+"){";_492+="}";});}return new Function(_491+_48f.innerHTML+_492);};this.instantiate=function(_495,_496,args){var _497=[],_496=_496||{};args=args||{};var _498=(args.scope||d._scopeName)+"Type",_499="data-"+(args.scope||d._scopeName)+"-";d.forEach(_495,function(obj){if(!obj){return;}var node,type,_49a,_49b,_49c,_49d;if(obj.node){node=obj.node;type=obj.type;_49d=obj.fastpath;_49a=obj.clsInfo||(type&&_48b(type,_49d));_49b=_49a&&_49a.cls;_49c=obj.scripts;}else{node=obj;type=_498 in _496?_496[_498]:node.getAttribute(_498);_49a=type&&_48b(type);_49b=_49a&&_49a.cls;_49c=(_49b&&(_49b._noScript||_49b.prototype._noScript)?[]:d.query("> script[type^='dojo/']",node));}if(!_49a){throw new Error("Could not load class '"+type);}var _49e={};if(args.defaults){d._mixin(_49e,args.defaults);}if(obj.inherited){d._mixin(_49e,obj.inherited);}if(_49d){var _49f=node.getAttribute(_499+"props");if(_49f&&_49f.length){try{_49f=d.fromJson.call(args.propsThis,"{"+_49f+"}");d._mixin(_49e,_49f);}catch(e){throw new Error(e.toString()+" in data-dojo-props='"+_49f+"'");}}var _4a0=node.getAttribute(_499+"attach-point");if(_4a0){_49e.dojoAttachPoint=_4a0;}var _4a1=node.getAttribute(_499+"attach-event");if(_4a1){_49e.dojoAttachEvent=_4a1;}_4.mixin(_49e,_496);}else{var _4a2=node.attributes;for(var name in _49a.params){var item=name in _496?{value:_496[name],specified:true}:_4a2.getNamedItem(name);if(!item||(!item.specified&&(!_4.isIE||name.toLowerCase()!="value"))){continue;}var _4a3=item.value;switch(name){case "class":_4a3="className" in _496?_496.className:node.className;break;case "style":_4a3="style" in _496?_496.style:(node.style&&node.style.cssText);}var _4a4=_49a.params[name];if(typeof _4a3=="string"){_49e[name]=_485(_4a3,_4a4);}else{_49e[name]=_4a3;}}}var _4a5=[],_4a6=[];d.forEach(_49c,function(_4a7){node.removeChild(_4a7);var _4a8=(_4a7.getAttribute(_499+"event")||_4a7.getAttribute("event")),type=_4a7.getAttribute("type"),nf=d.parser._functionFromScript(_4a7,_499);if(_4a8){if(type=="dojo/connect"){_4a5.push({event:_4a8,func:nf});}else{_49e[_4a8]=nf;}}else{_4a6.push(nf);}});var _4a9=_49b.markupFactory||_49b.prototype&&_49b.prototype.markupFactory;var _4aa=_4a9?_4a9(_49e,node,_49b):new _49b(_49e,node);_497.push(_4aa);var _4ab=(node.getAttribute(_499+"id")||node.getAttribute("jsId"));if(_4ab){d.setObject(_4ab,_4aa);}d.forEach(_4a5,function(_4ac){d.connect(_4aa,_4ac.event,null,_4ac.func);});d.forEach(_4a6,function(func){func.call(_4aa);});});if(!_496._started){d.forEach(_497,function(_4ad){if(!args.noStart&&_4ad&&_4.isFunction(_4ad.startup)&&!_4ad._started&&(!_4ad.getParent||!_4ad.getParent())){_4ad.startup();}});}return _497;};this.parse=function(_4ae,args){var root;if(!args&&_4ae&&_4ae.rootNode){args=_4ae;root=args.rootNode;}else{root=_4ae;}root=root?_4.byId(root):_4.body();args=args||{};var _4af=(args.scope||d._scopeName)+"Type",_4b0="data-"+(args.scope||d._scopeName)+"-";function scan(_4b1,list){var _4b2=_4.clone(_4b1.inherited);_4.forEach(["dir","lang"],function(name){var val=_4b1.node.getAttribute(name);if(val){_4b2[name]=val;}});var _4b3=_4b1.clsInfo&&!_4b1.clsInfo.cls.prototype._noScript?_4b1.scripts:null;var _4b4=(!_4b1.clsInfo||!_4b1.clsInfo.cls.prototype.stopParser)||(args&&args.template);for(var _4b5=_4b1.node.firstChild;_4b5;_4b5=_4b5.nextSibling){if(_4b5.nodeType==1){var type,_4b6=_4b4&&_4b5.getAttribute(_4b0+"type");if(_4b6){type=_4b6;}else{type=_4b4&&_4b5.getAttribute(_4af);}var _4b7=_4b6==type;if(type){var _4b8={"type":type,fastpath:_4b7,clsInfo:_48b(type,_4b7),node:_4b5,scripts:[],inherited:_4b2};list.push(_4b8);scan(_4b8,list);}else{if(_4b3&&_4b5.nodeName.toLowerCase()=="script"){type=_4b5.getAttribute("type");if(type&&/^dojo\/\w/i.test(type)){_4b3.push(_4b5);}}else{if(_4b4){scan({node:_4b5,inherited:_4b2},list);}}}}}};var _4b9={};if(args&&args.inherited){for(var key in args.inherited){if(args.inherited[key]){_4b9[key]=args.inherited[key];}}}var list=[];scan({node:root,inherited:_4b9},list);var _4ba=args&&args.template?{template:true}:null;return this.instantiate(list,_4ba,args);};}();(function(){var _4bb=function(){if(_4.config.parseOnLoad){_4.parser.parse();}};if(_4.getObject("dijit.wai.onload")===_4._loaders[0]){_4._loaders.splice(1,0,_4bb);}else{_4._loaders.unshift(_4bb);}})();}if(!_4._hasResource["dojo.cache"]){_4._hasResource["dojo.cache"]=true;_4.provide("dojo.cache");var _4bc={};_4.cache=function(_4bd,url,_4be){if(typeof _4bd=="string"){var _4bf=_4.moduleUrl(_4bd,url);}else{_4bf=_4bd;_4be=url;}var key=_4bf.toString();var val=_4be;if(_4be!=undefined&&!_4.isString(_4be)){val=("value" in _4be?_4be.value:undefined);}var _4c0=_4be&&_4be.sanitize?true:false;if(typeof val=="string"){val=_4bc[key]=_4c0?_4.cache._sanitize(val):val;}else{if(val===null){delete _4bc[key];}else{if(!(key in _4bc)){val=_4._getText(key);_4bc[key]=_4c0?_4.cache._sanitize(val):val;}val=_4bc[key];}}return val;};_4.cache._sanitize=function(val){if(val){val=val.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,"");var _4c1=val.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(_4c1){val=_4c1[1];}}else{val="";}return val;};}if(!_4._hasResource["dijit._Templated"]){_4._hasResource["dijit._Templated"]=true;_4.provide("dijit._Templated");_4.declare("dijit._Templated",null,{templateString:null,templatePath:null,widgetsInTemplate:false,_skipNodeCache:false,_earlyTemplatedStartup:false,constructor:function(){this._attachPoints=[];this._attachEvents=[];},_stringRepl:function(tmpl){var _4c2=this.declaredClass,_4c3=this;return _4.string.substitute(tmpl,this,function(_4c4,key){if(key.charAt(0)=="!"){_4c4=_4.getObject(key.substr(1),false,_4c3);}if(typeof _4c4=="undefined"){throw new Error(_4c2+" template:"+key);}if(_4c4==null){return "";}return key.charAt(0)=="!"?_4c4:_4c4.toString().replace(/"/g,"&quot;");},this);},buildRendering:function(){var _4c5=_5._Templated.getCachedTemplate(this.templatePath,this.templateString,this._skipNodeCache);var node;if(_4.isString(_4c5)){node=_4._toDom(this._stringRepl(_4c5));if(node.nodeType!=1){throw new Error("Invalid template: "+_4c5);}}else{node=_4c5.cloneNode(true);}this.domNode=node;this.inherited(arguments);this._attachTemplateNodes(node);if(this.widgetsInTemplate){var cw=(this._startupWidgets=_4.parser.parse(node,{noStart:!this._earlyTemplatedStartup,template:true,inherited:{dir:this.dir,lang:this.lang},propsThis:this,scope:"dojo"}));this._supportingWidgets=_5.findWidgets(node);this._attachTemplateNodes(cw,function(n,p){return n[p];});}this._fillContent(this.srcNodeRef);},_fillContent:function(_4c6){var dest=this.containerNode;if(_4c6&&dest){while(_4c6.hasChildNodes()){dest.appendChild(_4c6.firstChild);}}},_attachTemplateNodes:function(_4c7,_4c8){_4c8=_4c8||function(n,p){return n.getAttribute(p);};var _4c9=_4.isArray(_4c7)?_4c7:(_4c7.all||_4c7.getElementsByTagName("*"));var x=_4.isArray(_4c7)?0:-1;for(;x<_4c9.length;x++){var _4ca=(x==-1)?_4c7:_4c9[x];if(this.widgetsInTemplate&&(_4c8(_4ca,"dojoType")||_4c8(_4ca,"data-dojo-type"))){continue;}var _4cb=_4c8(_4ca,"dojoAttachPoint")||_4c8(_4ca,"data-dojo-attach-point");if(_4cb){var _4cc,_4cd=_4cb.split(/\s*,\s*/);while((_4cc=_4cd.shift())){if(_4.isArray(this[_4cc])){this[_4cc].push(_4ca);}else{this[_4cc]=_4ca;}this._attachPoints.push(_4cc);}}var _4ce=_4c8(_4ca,"dojoAttachEvent")||_4c8(_4ca,"data-dojo-attach-event");if(_4ce){var _4cf,_4d0=_4ce.split(/\s*,\s*/);var trim=_4.trim;while((_4cf=_4d0.shift())){if(_4cf){var _4d1=null;if(_4cf.indexOf(":")!=-1){var _4d2=_4cf.split(":");_4cf=trim(_4d2[0]);_4d1=trim(_4d2[1]);}else{_4cf=trim(_4cf);}if(!_4d1){_4d1=_4cf;}this._attachEvents.push(this.connect(_4ca,_4cf,_4d1));}}}var role=_4c8(_4ca,"waiRole");if(role){_5.setWaiRole(_4ca,role);}var _4d3=_4c8(_4ca,"waiState");if(_4d3){_4.forEach(_4d3.split(/\s*,\s*/),function(_4d4){if(_4d4.indexOf("-")!=-1){var pair=_4d4.split("-");_5.setWaiState(_4ca,pair[0],pair[1]);}});}}},startup:function(){_4.forEach(this._startupWidgets,function(w){if(w&&!w._started&&w.startup){w.startup();}});this.inherited(arguments);},destroyRendering:function(){_4.forEach(this._attachPoints,function(_4d5){delete this[_4d5];},this);this._attachPoints=[];_4.forEach(this._attachEvents,this.disconnect,this);this._attachEvents=[];this.inherited(arguments);}});_5._Templated._templateCache={};_5._Templated.getCachedTemplate=function(_4d6,_4d7,_4d8){var _4d9=_5._Templated._templateCache;var key=_4d7||_4d6;var _4da=_4d9[key];if(_4da){try{if(!_4da.ownerDocument||_4da.ownerDocument==_4.doc){return _4da;}}catch(e){}_4.destroy(_4da);}if(!_4d7){_4d7=_4.cache(_4d6,{sanitize:true});}_4d7=_4.string.trim(_4d7);if(_4d8||_4d7.match(/\$\{([^\}]+)\}/g)){return (_4d9[key]=_4d7);}else{var node=_4._toDom(_4d7);if(node.nodeType!=1){throw new Error("Invalid template: "+_4d7);}return (_4d9[key]=node);}};if(_4.isIE){_4.addOnWindowUnload(function(){var _4db=_5._Templated._templateCache;for(var key in _4db){var _4dc=_4db[key];if(typeof _4dc=="object"){_4.destroy(_4dc);}delete _4db[key];}});}_4.extend(_5._Widget,{dojoAttachEvent:"",dojoAttachPoint:"",waiRole:"",waiState:""});}if(!_4._hasResource["dijit._Contained"]){_4._hasResource["dijit._Contained"]=true;_4.provide("dijit._Contained");_4.declare("dijit._Contained",null,{getParent:function(){var _4dd=_5.getEnclosingWidget(this.domNode.parentNode);return _4dd&&_4dd.isContainer?_4dd:null;},_getSibling:function(_4de){var node=this.domNode;do{node=node[_4de+"Sibling"];}while(node&&node.nodeType!=1);return node&&_5.byNode(node);},getPreviousSibling:function(){return this._getSibling("previous");},getNextSibling:function(){return this._getSibling("next");},getIndexInParent:function(){var p=this.getParent();if(!p||!p.getIndexOfChild){return -1;}return p.getIndexOfChild(this);}});}if(!_4._hasResource["dijit._CssStateMixin"]){_4._hasResource["dijit._CssStateMixin"]=true;_4.provide("dijit._CssStateMixin");_4.declare("dijit._CssStateMixin",[],{cssStateNodes:{},hovering:false,active:false,_applyAttributes:function(){this.inherited(arguments);_4.forEach(["onmouseenter","onmouseleave","onmousedown"],function(e){this.connect(this.domNode,e,"_cssMouseEvent");},this);_4.forEach(["disabled","readOnly","checked","selected","focused","state","hovering","active"],function(attr){this.watch(attr,_4.hitch(this,"_setStateClass"));},this);for(var ap in this.cssStateNodes){this._trackMouseState(this[ap],this.cssStateNodes[ap]);}this._setStateClass();},_cssMouseEvent:function(_4df){if(!this.disabled){switch(_4df.type){case "mouseenter":case "mouseover":this._set("hovering",true);this._set("active",this._mouseDown);break;case "mouseleave":case "mouseout":this._set("hovering",false);this._set("active",false);break;case "mousedown":this._set("active",true);this._mouseDown=true;var _4e0=this.connect(_4.body(),"onmouseup",function(){this._mouseDown=false;this._set("active",false);this.disconnect(_4e0);});break;}}},_setStateClass:function(){var _4e1=this.baseClass.split(" ");function _4e2(_4e3){_4e1=_4e1.concat(_4.map(_4e1,function(c){return c+_4e3;}),"dijit"+_4e3);};if(!this.isLeftToRight()){_4e2("Rtl");}if(this.checked){_4e2("Checked");}if(this.state){_4e2(this.state);}if(this.selected){_4e2("Selected");}if(this.disabled){_4e2("Disabled");}else{if(this.readOnly){_4e2("ReadOnly");}else{if(this.active){_4e2("Active");}else{if(this.hovering){_4e2("Hover");}}}}if(this._focused){_4e2("Focused");}var tn=this.stateNode||this.domNode,_4e4={};_4.forEach(tn.className.split(" "),function(c){_4e4[c]=true;});if("_stateClasses" in this){_4.forEach(this._stateClasses,function(c){delete _4e4[c];});}_4.forEach(_4e1,function(c){_4e4[c]=true;});var _4e5=[];for(var c in _4e4){_4e5.push(c);}tn.className=_4e5.join(" ");this._stateClasses=_4e1;},_trackMouseState:function(node,_4e6){var _4e7=false,_4e8=false,_4e9=false;var self=this,cn=_4.hitch(this,"connect",node);function _4ea(){var _4eb=("disabled" in self&&self.disabled)||("readonly" in self&&self.readonly);_4.toggleClass(node,_4e6+"Hover",_4e7&&!_4e8&&!_4eb);_4.toggleClass(node,_4e6+"Active",_4e8&&!_4eb);_4.toggleClass(node,_4e6+"Focused",_4e9&&!_4eb);};cn("onmouseenter",function(){_4e7=true;_4ea();});cn("onmouseleave",function(){_4e7=false;_4e8=false;_4ea();});cn("onmousedown",function(){_4e8=true;_4ea();});cn("onmouseup",function(){_4e8=false;_4ea();});cn("onfocus",function(){_4e9=true;_4ea();});cn("onblur",function(){_4e9=false;_4ea();});this.watch("disabled",_4ea);this.watch("readOnly",_4ea);}});}if(!_4._hasResource["dijit.MenuItem"]){_4._hasResource["dijit.MenuItem"]=true;_4.provide("dijit.MenuItem");_4.declare("dijit.MenuItem",[_5._Widget,_5._Templated,_5._Contained,_5._CssStateMixin],{templateString:_4.cache("dijit","templates/MenuItem.html","<tr class=\"dijitReset dijitMenuItem\" dojoAttachPoint=\"focusNode\" role=\"menuitem\" tabIndex=\"-1\"\r\n\t\tdojoAttachEvent=\"onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick\">\r\n\t<td class=\"dijitReset dijitMenuItemIconCell\" role=\"presentation\">\r\n\t\t<img src=\"${_blankGif}\" alt=\"\" class=\"dijitIcon dijitMenuItemIcon\" dojoAttachPoint=\"iconNode\"/>\r\n\t</td>\r\n\t<td class=\"dijitReset dijitMenuItemLabel\" colspan=\"2\" dojoAttachPoint=\"containerNode\"></td>\r\n\t<td class=\"dijitReset dijitMenuItemAccelKey\" style=\"display: none\" dojoAttachPoint=\"accelKeyNode\"></td>\r\n\t<td class=\"dijitReset dijitMenuArrowCell\" role=\"presentation\">\r\n\t\t<div dojoAttachPoint=\"arrowWrapper\" style=\"visibility: hidden\">\r\n\t\t\t<img src=\"${_blankGif}\" alt=\"\" class=\"dijitMenuExpand\"/>\r\n\t\t\t<span class=\"dijitMenuExpandA11y\">+</span>\r\n\t\t</div>\r\n\t</td>\r\n</tr>\r\n"),attributeMap:_4.delegate(_5._Widget.prototype.attributeMap,{label:{node:"containerNode",type:"innerHTML"},iconClass:{node:"iconNode",type:"class"}}),baseClass:"dijitMenuItem",label:"",iconClass:"",accelKey:"",disabled:false,_fillContent:function(_4ec){if(_4ec&&!("label" in this.params)){this.set("label",_4ec.innerHTML);}},buildRendering:function(){this.inherited(arguments);var _4ed=this.id+"_text";_4.attr(this.containerNode,"id",_4ed);if(this.accelKeyNode){_4.attr(this.accelKeyNode,"id",this.id+"_accel");_4ed+=" "+this.id+"_accel";}_5.setWaiState(this.domNode,"labelledby",_4ed);_4.setSelectable(this.domNode,false);},_onHover:function(){this.getParent().onItemHover(this);},_onUnhover:function(){this.getParent().onItemUnhover(this);this._set("hovering",false);},_onClick:function(evt){this.getParent().onItemClick(this,evt);_4.stopEvent(evt);},onClick:function(evt){},focus:function(){try{if(_4.isIE==8){this.containerNode.focus();}_5.focus(this.focusNode);}catch(e){}},_onFocus:function(){this._setSelected(true);this.getParent()._onItemFocus(this);this.inherited(arguments);},_setSelected:function(_4ee){_4.toggleClass(this.domNode,"dijitMenuItemSelected",_4ee);},setLabel:function(_4ef){_4.deprecated("dijit.MenuItem.setLabel() is deprecated.  Use set('label', ...) instead.","","2.0");this.set("label",_4ef);},setDisabled:function(_4f0){_4.deprecated("dijit.Menu.setDisabled() is deprecated.  Use set('disabled', bool) instead.","","2.0");this.set("disabled",_4f0);},_setDisabledAttr:function(_4f1){_5.setWaiState(this.focusNode,"disabled",_4f1?"true":"false");this._set("disabled",_4f1);},_setAccelKeyAttr:function(_4f2){this.accelKeyNode.style.display=_4f2?"":"none";this.accelKeyNode.innerHTML=_4f2;_4.attr(this.containerNode,"colSpan",_4f2?"1":"2");this._set("accelKey",_4f2);}});}if(!_4._hasResource["dijit.PopupMenuItem"]){_4._hasResource["dijit.PopupMenuItem"]=true;_4.provide("dijit.PopupMenuItem");_4.declare("dijit.PopupMenuItem",_5.MenuItem,{_fillContent:function(){if(this.srcNodeRef){var _4f3=_4.query("*",this.srcNodeRef);_5.PopupMenuItem.superclass._fillContent.call(this,_4f3[0]);this.dropDownContainer=this.srcNodeRef;}},startup:function(){if(this._started){return;}this.inherited(arguments);if(!this.popup){var node=_4.query("[widgetId]",this.dropDownContainer)[0];this.popup=_5.byNode(node);}_4.body().appendChild(this.popup.domNode);this.popup.startup();this.popup.domNode.style.display="none";if(this.arrowWrapper){_4.style(this.arrowWrapper,"visibility","");}_5.setWaiState(this.focusNode,"haspopup","true");},destroyDescendants:function(){if(this.popup){if(!this.popup._destroyed){this.popup.destroyRecursive();}delete this.popup;}this.inherited(arguments);}});}if(!_4._hasResource["dijit.CheckedMenuItem"]){_4._hasResource["dijit.CheckedMenuItem"]=true;_4.provide("dijit.CheckedMenuItem");_4.declare("dijit.CheckedMenuItem",_5.MenuItem,{templateString:_4.cache("dijit","templates/CheckedMenuItem.html","<tr class=\"dijitReset dijitMenuItem\" dojoAttachPoint=\"focusNode\" role=\"menuitemcheckbox\" tabIndex=\"-1\"\r\n\t\tdojoAttachEvent=\"onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick\">\r\n\t<td class=\"dijitReset dijitMenuItemIconCell\" role=\"presentation\">\r\n\t\t<img src=\"${_blankGif}\" alt=\"\" class=\"dijitMenuItemIcon dijitCheckedMenuItemIcon\" dojoAttachPoint=\"iconNode\"/>\r\n\t\t<span class=\"dijitCheckedMenuItemIconChar\">&#10003;</span>\r\n\t</td>\r\n\t<td class=\"dijitReset dijitMenuItemLabel\" colspan=\"2\" dojoAttachPoint=\"containerNode,labelNode\"></td>\r\n\t<td class=\"dijitReset dijitMenuItemAccelKey\" style=\"display: none\" dojoAttachPoint=\"accelKeyNode\"></td>\r\n\t<td class=\"dijitReset dijitMenuArrowCell\" role=\"presentation\">&nbsp;</td>\r\n</tr>\r\n"),checked:false,_setCheckedAttr:function(_4f4){_4.toggleClass(this.domNode,"dijitCheckedMenuItemChecked",_4f4);_5.setWaiState(this.domNode,"checked",_4f4);this._set("checked",_4f4);},onChange:function(_4f5){},_onClick:function(e){if(!this.disabled){this.set("checked",!this.checked);this.onChange(this.checked);}this.inherited(arguments);}});}if(!_4._hasResource["dijit.MenuSeparator"]){_4._hasResource["dijit.MenuSeparator"]=true;_4.provide("dijit.MenuSeparator");_4.declare("dijit.MenuSeparator",[_5._Widget,_5._Templated,_5._Contained],{templateString:_4.cache("dijit","templates/MenuSeparator.html","<tr class=\"dijitMenuSeparator\">\r\n\t<td class=\"dijitMenuSeparatorIconCell\">\r\n\t\t<div class=\"dijitMenuSeparatorTop\"></div>\r\n\t\t<div class=\"dijitMenuSeparatorBottom\"></div>\r\n\t</td>\r\n\t<td colspan=\"3\" class=\"dijitMenuSeparatorLabelCell\">\r\n\t\t<div class=\"dijitMenuSeparatorTop dijitMenuSeparatorLabel\"></div>\r\n\t\t<div class=\"dijitMenuSeparatorBottom\"></div>\r\n\t</td>\r\n</tr>\r\n"),buildRendering:function(){this.inherited(arguments);_4.setSelectable(this.domNode,false);},isFocusable:function(){return false;}});}if(!_4._hasResource["dijit.Menu"]){_4._hasResource["dijit.Menu"]=true;_4.provide("dijit.Menu");_4.declare("dijit._MenuBase",[_5._Widget,_5._Templated,_5._KeyNavContainer],{parentMenu:null,popupDelay:500,startup:function(){if(this._started){return;}_4.forEach(this.getChildren(),function(_4f6){_4f6.startup();});this.startupKeyNavChildren();this.inherited(arguments);},onExecute:function(){},onCancel:function(_4f7){},_moveToPopup:function(evt){if(this.focusedChild&&this.focusedChild.popup&&!this.focusedChild.disabled){this.focusedChild._onClick(evt);}else{var _4f8=this._getTopMenu();if(_4f8&&_4f8._isMenuBar){_4f8.focusNext();}}},_onPopupHover:function(evt){if(this.currentPopup&&this.currentPopup._pendingClose_timer){var _4f9=this.currentPopup.parentMenu;if(_4f9.focusedChild){_4f9.focusedChild._setSelected(false);}_4f9.focusedChild=this.currentPopup.from_item;_4f9.focusedChild._setSelected(true);this._stopPendingCloseTimer(this.currentPopup);}},onItemHover:function(item){if(this.isActive){this.focusChild(item);if(this.focusedChild.popup&&!this.focusedChild.disabled&&!this.hover_timer){this.hover_timer=setTimeout(_4.hitch(this,"_openPopup"),this.popupDelay);}}if(this.focusedChild){this.focusChild(item);}this._hoveredChild=item;},_onChildBlur:function(item){this._stopPopupTimer();item._setSelected(false);var _4fa=item.popup;if(_4fa){this._stopPendingCloseTimer(_4fa);_4fa._pendingClose_timer=setTimeout(function(){_4fa._pendingClose_timer=null;if(_4fa.parentMenu){_4fa.parentMenu.currentPopup=null;}_5.popup.close(_4fa);},this.popupDelay);}},onItemUnhover:function(item){if(this.isActive){this._stopPopupTimer();}if(this._hoveredChild==item){this._hoveredChild=null;}},_stopPopupTimer:function(){if(this.hover_timer){clearTimeout(this.hover_timer);this.hover_timer=null;}},_stopPendingCloseTimer:function(_4fb){if(_4fb._pendingClose_timer){clearTimeout(_4fb._pendingClose_timer);_4fb._pendingClose_timer=null;}},_stopFocusTimer:function(){if(this._focus_timer){clearTimeout(this._focus_timer);this._focus_timer=null;}},_getTopMenu:function(){for(var top=this;top.parentMenu;top=top.parentMenu){}return top;},onItemClick:function(item,evt){if(typeof this.isShowingNow=="undefined"){this._markActive();}this.focusChild(item);if(item.disabled){return false;}if(item.popup){this._openPopup();}else{this.onExecute();item.onClick(evt);}},_openPopup:function(){this._stopPopupTimer();var _4fc=this.focusedChild;if(!_4fc){return;}var _4fd=_4fc.popup;if(_4fd.isShowingNow){return;}if(this.currentPopup){this._stopPendingCloseTimer(this.currentPopup);_5.popup.close(this.currentPopup);}_4fd.parentMenu=this;_4fd.from_item=_4fc;var self=this;_5.popup.open({parent:this,popup:_4fd,around:_4fc.domNode,orient:this._orient||(this.isLeftToRight()?{"TR":"TL","TL":"TR","BR":"BL","BL":"BR"}:{"TL":"TR","TR":"TL","BL":"BR","BR":"BL"}),onCancel:function(){self.focusChild(_4fc);self._cleanUp();_4fc._setSelected(true);self.focusedChild=_4fc;},onExecute:_4.hitch(this,"_cleanUp")});this.currentPopup=_4fd;_4fd.connect(_4fd.domNode,"onmouseenter",_4.hitch(self,"_onPopupHover"));if(_4fd.focus){_4fd._focus_timer=setTimeout(_4.hitch(_4fd,function(){this._focus_timer=null;this.focus();}),0);}},_markActive:function(){this.isActive=true;_4.replaceClass(this.domNode,"dijitMenuActive","dijitMenuPassive");},onOpen:function(e){this.isShowingNow=true;this._markActive();},_markInactive:function(){this.isActive=false;_4.replaceClass(this.domNode,"dijitMenuPassive","dijitMenuActive");},onClose:function(){this._stopFocusTimer();this._markInactive();this.isShowingNow=false;this.parentMenu=null;},_closeChild:function(){this._stopPopupTimer();var _4fe=this.focusedChild&&this.focusedChild.from_item;if(this.currentPopup){if(_5._curFocus&&_4.isDescendant(_5._curFocus,this.currentPopup.domNode)){this.focusedChild.focusNode.focus();}_5.popup.close(this.currentPopup);this.currentPopup=null;}if(this.focusedChild){this.focusedChild._setSelected(false);this.focusedChild._onUnhover();this.focusedChild=null;}},_onItemFocus:function(item){if(this._hoveredChild&&this._hoveredChild!=item){this._hoveredChild._onUnhover();}},_onBlur:function(){this._cleanUp();this.inherited(arguments);},_cleanUp:function(){this._closeChild();if(typeof this.isShowingNow=="undefined"){this._markInactive();}}});_4.declare("dijit.Menu",_5._MenuBase,{constructor:function(){this._bindings=[];},templateString:_4.cache("dijit","templates/Menu.html","<table class=\"dijit dijitMenu dijitMenuPassive dijitReset dijitMenuTable\" role=\"menu\" tabIndex=\"${tabIndex}\" dojoAttachEvent=\"onkeypress:_onKeyPress\" cellspacing=\"0\">\r\n\t<tbody class=\"dijitReset\" dojoAttachPoint=\"containerNode\"></tbody>\r\n</table>\r\n"),baseClass:"dijitMenu",targetNodeIds:[],contextMenuForWindow:false,leftClickToOpen:false,refocus:true,postCreate:function(){if(this.contextMenuForWindow){this.bindDomNode(_4.body());}else{_4.forEach(this.targetNodeIds,this.bindDomNode,this);}var k=_4.keys,l=this.isLeftToRight();this._openSubMenuKey=l?k.RIGHT_ARROW:k.LEFT_ARROW;this._closeSubMenuKey=l?k.LEFT_ARROW:k.RIGHT_ARROW;this.connectKeyNavHandlers([k.UP_ARROW],[k.DOWN_ARROW]);},_onKeyPress:function(evt){if(evt.ctrlKey||evt.altKey){return;}switch(evt.charOrCode){case this._openSubMenuKey:this._moveToPopup(evt);_4.stopEvent(evt);break;case this._closeSubMenuKey:if(this.parentMenu){if(this.parentMenu._isMenuBar){this.parentMenu.focusPrev();}else{this.onCancel(false);}}else{_4.stopEvent(evt);}break;}},_iframeContentWindow:function(_4ff){var win=_4.window.get(this._iframeContentDocument(_4ff))||this._iframeContentDocument(_4ff)["__parent__"]||(_4ff.name&&_4.doc.frames[_4ff.name])||null;return win;},_iframeContentDocument:function(_500){var doc=_500.contentDocument||(_500.contentWindow&&_500.contentWindow.document)||(_500.name&&_4.doc.frames[_500.name]&&_4.doc.frames[_500.name].document)||null;return doc;},bindDomNode:function(node){node=_4.byId(node);var cn;if(node.tagName.toLowerCase()=="iframe"){var _501=node,win=this._iframeContentWindow(_501);cn=_4.withGlobal(win,_4.body);}else{cn=(node==_4.body()?_4.doc.documentElement:node);}var _502={node:node,iframe:_501};_4.attr(node,"_dijitMenu"+this.id,this._bindings.push(_502));var _503=_4.hitch(this,function(cn){return [_4.connect(cn,this.leftClickToOpen?"onclick":"oncontextmenu",this,function(evt){_4.stopEvent(evt);this._scheduleOpen(evt.target,_501,{x:evt.pageX,y:evt.pageY});}),_4.connect(cn,"onkeydown",this,function(evt){if(evt.shiftKey&&evt.keyCode==_4.keys.F10){_4.stopEvent(evt);this._scheduleOpen(evt.target,_501);}})];});_502.connects=cn?_503(cn):[];if(_501){_502.onloadHandler=_4.hitch(this,function(){var win=this._iframeContentWindow(_501);cn=_4.withGlobal(win,_4.body);_502.connects=_503(cn);});if(_501.addEventListener){_501.addEventListener("load",_502.onloadHandler,false);}else{_501.attachEvent("onload",_502.onloadHandler);}}},unBindDomNode:function(_504){var node;try{node=_4.byId(_504);}catch(e){return;}var _505="_dijitMenu"+this.id;if(node&&_4.hasAttr(node,_505)){var bid=_4.attr(node,_505)-1,b=this._bindings[bid];_4.forEach(b.connects,_4.disconnect);var _506=b.iframe;if(_506){if(_506.removeEventListener){_506.removeEventListener("load",b.onloadHandler,false);}else{_506.detachEvent("onload",b.onloadHandler);}}_4.removeAttr(node,_505);delete this._bindings[bid];}},_scheduleOpen:function(_507,_508,_509){if(!this._openTimer){this._openTimer=setTimeout(_4.hitch(this,function(){delete this._openTimer;this._openMyself({target:_507,iframe:_508,coords:_509});}),1);}},_openMyself:function(args){var _50a=args.target,_50b=args.iframe,_50c=args.coords;if(_50c){if(_50b){var od=_50a.ownerDocument,ifc=_4.position(_50b,true),win=this._iframeContentWindow(_50b),_50d=_4.withGlobal(win,"_docScroll",_4);var cs=_4.getComputedStyle(_50b),tp=_4._toPixelValue,left=(_4.isIE&&_4.isQuirks?0:tp(_50b,cs.paddingLeft))+(_4.isIE&&_4.isQuirks?tp(_50b,cs.borderLeftWidth):0),top=(_4.isIE&&_4.isQuirks?0:tp(_50b,cs.paddingTop))+(_4.isIE&&_4.isQuirks?tp(_50b,cs.borderTopWidth):0);_50c.x+=ifc.x+left-_50d.x;_50c.y+=ifc.y+top-_50d.y;}}else{_50c=_4.position(_50a,true);_50c.x+=10;_50c.y+=10;}var self=this;var _50e=_5.getFocus(this);function _50f(){if(self.refocus){_5.focus(_50e);}_5.popup.close(self);};_5.popup.open({popup:this,x:_50c.x,y:_50c.y,onExecute:_50f,onCancel:_50f,orient:this.isLeftToRight()?"L":"R"});this.focus();this._onBlur=function(){this.inherited("_onBlur",arguments);_5.popup.close(this);};},uninitialize:function(){_4.forEach(this._bindings,function(b){if(b){this.unBindDomNode(b.node);}},this);this.inherited(arguments);}});}if(!_4._hasResource["esri.toolbars._VertexMover"]){_4._hasResource["esri.toolbars._VertexMover"]=true;_4.provide("esri.toolbars._VertexMover");_4.declare("esri.toolbars.VertexMover",null,{constructor:function(_510,_511,_512,_513,_514,_515,_516,_517){this.point=_510;this.symbol=_511;this.relatedGraphic=_512;this.segIndex=_513;this.ptIndex=_514;this.segLength=_515;this.editor=_516;this.map=_516.map;this._scratchGL=_516.toolbar._scratchGL;this._placeholder=_517||false;this._type=_512.geometry.type;this._init();this._enable();},refresh:function(_518){if(_518||this._needRefresh()){this._disable();this._enable();}},destroy:function(){this._disable();if(this.graphic){this._scratchGL.remove(this.graphic);}this.point=this.symbol=this.graphic=this.relatedGraphic=this.segIndex=this.ptIndex=this.segLength=this.editor=this.map=this._scratchGL=null;},_init:function(){var _519=new esri.geometry.Point(this.point.toJson());var _51a=new esri.Graphic(_519,this.symbol);switch(this._type){case "multipoint":_51a._shape=this.relatedGraphic.getDojoShape().children[this.ptIndex];break;case "polyline":case "polygon":this._scratchGL.add(_51a);break;}this.graphic=_51a;},_enable:function(){var _51b=this.graphic.getDojoShape();if(_51b){_51b._hasMover=true;this._moveable=this._getMoveable(_51b);var node=_51b.getEventSource();if(node){_4.style(node,"cursor",this.editor.toolbar._cursors[this._placeholder?"move-gv":"move-v"]);}}},_disable:function(){var _51c=this._moveable;if(_51c){_4.disconnect(this._startHandle);_4.disconnect(this._firstHandle);_4.disconnect(this._movingHandle);_4.disconnect(this._stopHandle);var _51d=_51c.shape;if(_51d){var node=_51d.getEventSource();if(node){_4.style(node,"cursor",null);}}_51c.destroy();this._moveable=null;}},_needRefresh:function(){var _51e=this.graphic.getDojoShape(),need=false;if(_51e){switch(this._type){case "multipoint":var _51f=this.relatedGraphic.getDojoShape();if(_51f){var _520=_51f.children[this.ptIndex];if(_51e!==_520){_51e=_520;this.graphic._shape=_51e;need=true;}}break;case "polyline":case "polygon":need=!_51e._hasMover;break;}}return need;},_getMoveable:function(_521){var _522=new _6.gfx.Moveable(_521,_4.isMac&&_4.isFF&&!esri.isTouchEnabled&&{leftButtonOnly:true});this._startHandle=_4.connect(_522,"onMoveStart",this,this._moveStartHandler);this._firstHandle=_4.connect(_522,"onFirstMove",this,this._firstMoveHandler);this._movingHandle=_4.connect(_522,"onMoving",this,this._movingHandler);this._stopHandle=_4.connect(_522,"onMoveStop",this,this._moveStopHandler);return _522;},_getPtIndex:function(){return this.ptIndex+(this._placeholder?1:0);},_getInfo:function(){return {graphic:this.graphic,isGhost:this._placeholder,segmentIndex:this.segIndex,pointIndex:this._getPtIndex()};},_moveStartHandler:function(_523){var map=this.map;if(map.snappingManager){map.snappingManager._setUpSnapping();}_523.shape.moveToFront();this.constructor.onMoveStart(this);this.editor.toolbar.onVertexMoveStart(this.relatedGraphic,this._getInfo());},_firstMoveHandler:function(_524){var _525=_524.shape;var _526=this._getControlEdges();var _527=this._scratchGL._div;var i,_528=[],_529=_524.host.shape._wrapOffsets[0]||0;for(i=0;i<_526.length;i++){var edge=_526[i];edge.x1+=_529;edge.x2+=_529;_528.push([_527.createLine({x1:edge.x1,y1:edge.y1,x2:edge.x2,y2:edge.y2}).setStroke(this.editor._lineStroke),edge.x1,edge.y1,edge.x2,edge.y2]);}_525._lines=_528;_524.shape.moveToFront();this.constructor.onFirstMove(this);this.editor.toolbar.onVertexFirstMove(this.relatedGraphic,this._getInfo());},_movingHandler:function(_52a){var _52b=_52a.shape,tx=_52b.getTransform();var i,_52c=_52b._lines;for(i=0;i<_52c.length;i++){var line=_52c[i];line[0].setShape({x1:line[1]+tx.dx,y1:line[2]+tx.dy,x2:line[3],y2:line[4]});}this.editor.toolbar.onVertexMove(this.relatedGraphic,this._getInfo(),tx);},_moveStopHandler:function(_52d){var _52e=_52d.shape,tx=_52e.getTransform(),map=this.map;var host=this.graphic;var i,_52f=_52e._lines;if(_52f){for(i=0;i<_52f.length;i++){_52f[i][0].removeShape();}_52e._lines=null;}var ph=false,_530=true,info=this._getInfo();if(tx&&(tx.dx||tx.dy)){if(this._placeholder){this._placeholder=false;ph=true;}}else{_530=false;}var _531;if(this.map.snappingManager){_531=this.map.snappingManager._snappingPoint;}var _532=_531||map.toMap(map.toScreen(host.geometry).offset(tx.dx,tx.dy));if(this.map.snappingManager){this.map.snappingManager._killOffSnapping();}_52e.setTransform(null);host.setGeometry(_532);this.constructor.onMoveStop(this,tx);this.editor.toolbar.onVertexMoveStop(this.relatedGraphic,info,tx);if(!_530){this.editor.toolbar.onVertexClick(this.relatedGraphic,info);}if(ph){this.editor.toolbar.onVertexAdd(this.relatedGraphic,this._getInfo());}},_getControlEdges:function(){var map=this.map;var _533=this.relatedGraphic.geometry;var _534=this.segIndex,_535=this.ptIndex,_536=this.segLength;var _537=this._scratchGL._div;var _538=_537.getTransform();var sdx=_538.dx,sdy=_538.dy;var pt=map.toScreen(this.graphic.geometry);var x=pt.x-sdx,y=pt.y-sdy;var _539=[];var _53a=this.editor._getControlPoints(this,_533,_534,_535,_536);if(_53a[0]){_539.push({x1:x,y1:y,x2:_53a[0].x-sdx,y2:_53a[0].y-sdy});}if(_53a[1]){_539.push({x1:x,y1:y,x2:_53a[1].x-sdx,y2:_53a[1].y-sdy});}return _539;}});_4.mixin(esri.toolbars.VertexMover,{onMoveStart:function(){},onFirstMove:function(){},onMoveStop:function(){}});}if(!_4._hasResource["esri.toolbars._VertexEditor"]){_4._hasResource["esri.toolbars._VertexEditor"]=true;_4.provide("esri.toolbars._VertexEditor");_4.declare("esri.toolbars._GraphicVertexEditor",null,{constructor:function(_53b,map,_53c){this.graphic=_53b;this.map=map;this.toolbar=_53c;var _53d=_53c._options;this._symbol1=_53d.vertexSymbol;this._symbol2=_53d.ghostVertexSymbol;var _53e=_53d.ghostLineSymbol;this._lineStroke={style:_53e.style,width:_53e.width,color:_53e.color};this._canDel=_53d.allowDeleteVertices;this._canAdd=_53d.allowAddVertices;this._addControllers();},destroy:function(){this._removeControllers();},refresh:function(_53f){if(_53f){this._removeControllers();this._addControllers();}else{this._refresh(this._vertexMovers);this._refresh(this._mpVertexMovers);}},suspend:function(){if(!this._suspended){this._removeControllers();}this._suspended=true;},resume:function(){if(this._suspended){this._addControllers();}this._suspended=false;},_addControllers:function(){this._firstMoveHandle=_4.connect(esri.toolbars.VertexMover,"onFirstMove",this,this._firstMoveHandler);this._moveStopHandle=_4.connect(esri.toolbars.VertexMover,"onMoveStop",this,this._moveStopHandler);this._vertexMovers=this._add(this._getSegments(this.graphic.geometry),this._symbol1);if(this._canAdd){this._mpVertexMovers=this._add(this._getMidpointSegments(this.graphic.geometry),this._symbol2,true);}var _540=this._getGraphicsLayer();this._mouseOverHandle=_4.connect(_540,"onMouseOver",this,this._mouseOverHandler);this._mouseOutHandle=_4.connect(_540,"onMouseOut",this,this._mouseOutHandler);if(this._canDel){this._ctxMenu=new _5.Menu({style:"font-size: 12px; margin-left: 5px; margin-top: 5px;"});var _541=(this._ctxDelete=new _5.MenuItem({label:esri.bundle.toolbars.edit.deleteLabel,iconClass:"vertexDeleteIcon",style:"outline: none;"}));this._deleteHandle=_4.connect(_541,"onClick",this,this._deleteHandler);this._ctxMenu.addChild(_541);this._ctxMenu.startup();}},_removeControllers:function(){_4.disconnect(this._firstMoveHandle);_4.disconnect(this._moveStopHandle);_4.disconnect(this._mouseOverHandle);_4.disconnect(this._mouseOutHandle);_4.disconnect(this._deleteHandle);if(this._ctxMenu){this._ctxDelete=null;this._unbindCtxNode();this._ctxMenu.destroyRecursive();}this._remove(this._vertexMovers);this._remove(this._mpVertexMovers);this._vertexMovers=this._mpVertexMovers=null;},_add:function(_542,_543,_544){var i,j,_545=this.graphic,_546=[];for(i=0;i<_542.length;i++){var _547=_542[i],_548=[];for(j=0;j<_547.length;j++){_548.push(new esri.toolbars.VertexMover(_547[j],_543,_545,i,j,_547.length,this,_544));}_546.push(_548);}return _546;},_remove:function(_549){if(_549){_4.forEach(_549,function(_54a){_4.forEach(_54a,function(_54b){_54b.destroy();});});}},_refresh:function(_54c){if(_54c){_4.forEach(_54c,function(_54d){_4.forEach(_54d,function(_54e){_54e.refresh();});});}},_isNew:function(_54f){return (_4.indexOf(this._vertexMovers[_54f.segIndex],_54f)===-1)?true:false;},_getGraphicsLayer:function(){return this.toolbar._scratchGL;},_deleteHandler:function(evt){var _550=this._selectedMover,_551=_550.ptIndex;this._updateRelatedGraphic(_550,_550.relatedGraphic,_550.graphic.geometry,_550.segIndex,_550.ptIndex,_550.segLength,false,true);if(this._canAdd){this._deleteMidpoints(_550);}this._deleteVertex(_550);this.toolbar._endOperation("VERTICES");},_mouseOverHandler:function(evt){var _552=evt.graphic,_553=this._findMover(_552);if(_553){this.toolbar.onVertexMouseOver(this.graphic,_553._getInfo());if(!_553._placeholder){this._selectedMover=_553;if(this._canDel){this._bindCtxNode(_552.getDojoShape().getNode());}}}},_mouseOutHandler:function(evt){var _554=evt.graphic,_555=this._findMover(_554);if(_555){this.toolbar.onVertexMouseOut(this.graphic,_555._getInfo());}},_bindCtxNode:function(node){this._unbindCtxNode();this._ctxDelete.set("disabled",(this._selectedMover.segLength<=this.minLength)?true:false);this._ctxMenu.bindDomNode(node);this._bindNode=node;},_unbindCtxNode:function(){var node=this._bindNode;if(node){this._ctxMenu.unBindDomNode(node);}},_findMover:function(_556){var i,_557=[],_558=this._mpVertexMovers;_4.forEach(this._vertexMovers,function(_559){_557=_557.concat(_559);});if(_558){_4.forEach(_558,function(_55a){_557=_557.concat(_55a);});}for(i=0;i<_557.length;i++){var _55b=_557[i];if(_55b.graphic===_556){return _55b;}}},_firstMoveHandler:function(_55c){if(!this._isNew(_55c)&&this._canAdd){this._hideRelatedMidpoints(_55c);}this.toolbar._beginOperation("VERTICES");},_moveStopHandler:function(_55d,tx){var add=this._isNew(_55d);if(!tx||!tx.dx&&!tx.dy){if(!add&&this._canAdd){this._showRelatedMidpoints(_55d);}return;}this._updateRelatedGraphic(_55d,_55d.relatedGraphic,_55d.graphic.geometry,_55d.segIndex,_55d.ptIndex,_55d.segLength,add);if(this._canAdd){if(add){this._addMidpoints(_55d);}else{this._repositionRelatedMidpoints(_55d);this._showRelatedMidpoints(_55d);}}this.toolbar._endOperation("VERTICES");},_showRelatedMidpoints:function(_55e){var i,_55f=this._getAdjacentMidpoints(_55e.ptIndex,_55e.segLength),_560=this._mpVertexMovers[_55e.segIndex];for(i=0;i<_55f.length;i++){var mvr=_560[_55f[i]];mvr.graphic.show();mvr.refresh();}},_hideRelatedMidpoints:function(_561){var i,_562=this._getAdjacentMidpoints(_561.ptIndex,_561.segLength),_563=this._mpVertexMovers[_561.segIndex];for(i=0;i<_562.length;i++){_563[_562[i]].graphic.hide();}},_repositionRelatedMidpoints:function(_564){var i,_565=this._getAdjacentMidpoints(_564.ptIndex,_564.segLength),_566=this._mpVertexMovers[_564.segIndex];for(i=0;i<_565.length;i++){var _567=this._getAdjacentVertices(_565[i],_564.segLength);var _568=_564.relatedGraphic.geometry.getPoint(_564.segIndex,_567[0]),_569=_564.relatedGraphic.geometry.getPoint(_564.segIndex,_567[1]);var _56a=new esri.geometry.Point({x:(_568.x+_569.x)/2,y:(_568.y+_569.y)/2,spatialReference:_568.spatialReference.toJson()});_566[_565[i]].graphic.setGeometry(_56a);}},_addMidpoints:function(_56b){var _56c=_56b.segIndex,_56d=_56b.ptIndex,_56e=_56b.segLength;var _56f=_56d+1;var i,_570=_56e+1;this._mpVertexMovers[_56c].splice(_56d,1);var _571=this._vertexMovers[_56c];for(i=0;i<_56f;i++){_571[i].segLength+=1;}for(i=_56f;i<_571.length;i++){_571[i].ptIndex+=1;_571[i].segLength+=1;}_56b.ptIndex=_56f;_56b.segLength=_571.length+1;_571.splice(_56f,0,_56b);_56b.graphic.setSymbol(this._symbol1);_571=this._mpVertexMovers[_56c];for(i=0;i<_56d;i++){_571[i].segLength+=1;}for(i=_56d;i<_56e-1;i++){_571[i].ptIndex+=1;_571[i].segLength+=1;}var _572=this._getAdjacentVertices(_56d,_570);var _573=this._getAdjacentVertices(_56d+1,_570);var _574,_575;_574=_56b.relatedGraphic.geometry.getPoint(_56b.segIndex,_572[0]);_575=_56b.relatedGraphic.geometry.getPoint(_56b.segIndex,_572[1]);var _576=new esri.geometry.Point({x:(_574.x+_575.x)/2,y:(_574.y+_575.y)/2,spatialReference:_574.spatialReference.toJson()});_574=_56b.relatedGraphic.geometry.getPoint(_56b.segIndex,_573[0]);_575=_56b.relatedGraphic.geometry.getPoint(_56b.segIndex,_573[1]);var _577=new esri.geometry.Point({x:(_574.x+_575.x)/2,y:(_574.y+_575.y)/2,spatialReference:_574.spatialReference.toJson()});var mvr1=new esri.toolbars.VertexMover(_576,this._symbol2,this.graphic,_56b.segIndex,_56d,_570,this,true);var mvr2=new esri.toolbars.VertexMover(_577,this._symbol2,this.graphic,_56b.segIndex,_56d+1,_570,this,true);_571.splice(_56d,0,mvr1,mvr2);},_deleteVertex:function(_578){var i,_579=_578.segIndex,_57a=_578.ptIndex;var _57b=this._vertexMovers[_579];for(i=0;i<_57a;i++){_57b[i].segLength-=1;}for(i=_57a+1;i<_57b.length;i++){var mvr=_57b[i];mvr.ptIndex-=1;mvr.segLength-=1;}_57b.splice(_57a,1);var info=_578._getInfo();_578.destroy();this.toolbar.onVertexDelete(this.graphic,info);}});_4.mixin(esri.toolbars._GraphicVertexEditor,{create:function(_57c,map,_57d){var type=_57c.geometry.type;switch(type){case "multipoint":return new esri.toolbars._MultipointVertexEditor(_57c,map,_57d);break;case "polyline":return new esri.toolbars._PolylineVertexEditor(_57c,map,_57d);break;case "polygon":return new esri.toolbars._PolygonVertexEditor(_57c,map,_57d);break;}}});_4.declare("esri.toolbars._MultipointVertexEditor",esri.toolbars._GraphicVertexEditor,{minLength:1,constructor:function(){this._moveStartHandle=_4.connect(esri.toolbars.VertexMover,"onMoveStart",this,this._moveStartHandler);_4.disconnect(this._firstMoveHandle);},destroy:function(){this.inherited(arguments);_4.disconnect(this._moveStartHandle);},_getSegments:function(_57e){var i,_57f=_57e.points,_580=[],sr=_57e.spatialReference;for(i=0;i<_57f.length;i++){var _581=_57f[i];_580.push(new esri.geometry.Point({x:_581[0],y:_581[1],spatialReference:sr.toJson()}));}return [_580];},_getMidpointSegments:function(_582){return [];},_getControlPoints:function(_583,_584,_585,_586,_587){return [];},_getGraphicsLayer:function(){return this.graphic._graphicsLayer;},_mouseOverHandler:function(evt){var _588=evt.graphic,_589=this._findMover(evt);if(_589){this.toolbar.onVertexMouseOver(_588,_589._getInfo());this._selectedMover=_589;if(this._canDel){this._bindCtxNode(_589.graphic.getDojoShape().getNode());}}},_mouseOutHandler:function(evt){var _58a=evt.graphic,_58b=this._findMover(evt);if(_58b){this.toolbar.onVertexMouseOut(_58a,_58b._getInfo());}},_findMover:function(evt){var i,_58c=[].concat(this._vertexMovers[0]),_58d=evt.target;for(i=0;i<_58c.length;i++){var _58e=_58c[i];if(_58e.graphic.getDojoShape().getNode()===_58d){return _58e;}}},_moveStartHandler:function(_58f){var geom=_58f.relatedGraphic.geometry,_590=_58f.ptIndex;var _591=_58f.segLength-1;var _592=geom.points;var _593=_592.splice(_590,1);_592.push(_593[0]);var j,_594=this._vertexMovers[0];for(j=_591;j>_590;j--){_594[j].ptIndex-=1;}_593=_594.splice(_590,1);_594.push(_593[0]);_593[0].ptIndex=_591;},_moveStopHandler:function(_595){this._updateRelatedGraphic(_595,_595.relatedGraphic,_595.graphic.geometry,_595.segIndex,_595.ptIndex,_595.segLength);this.toolbar._endOperation("VERTICES");},_updateRelatedGraphic:function(_596,_597,_598,_599,_59a,_59b,add,del){var geom=_597.geometry;if(del){geom.removePoint(_59a);}else{geom.setPoint(_59a,_598);}_597.setGeometry(geom);},_deleteMidpoints:function(_59c){}});_4.declare("esri.toolbars._PolylineVertexEditor",esri.toolbars._GraphicVertexEditor,{minLength:2,_getSegments:function(_59d){var i,j,_59e=_59d.paths,_59f=[];for(i=0;i<_59e.length;i++){var path=_59e[i],_5a0=[];for(j=0;j<path.length;j++){_5a0.push(_59d.getPoint(i,j));}_59f.push(_5a0);}return _59f;},_getMidpointSegments:function(_5a1){var i,j,_5a2=_5a1.paths,_5a3=[],sr=_5a1.spatialReference;for(i=0;i<_5a2.length;i++){var path=_5a2[i],_5a4=[];for(j=0;j<path.length-1;j++){var _5a5=_5a1.getPoint(i,j),_5a6=_5a1.getPoint(i,j+1);var midX=(_5a5.x+_5a6.x)/2,midY=(_5a5.y+_5a6.y)/2;var _5a7=new esri.geometry.Point({x:midX,y:midY,spatialReference:sr.toJson()});_5a4.push(_5a7);}_5a3.push(_5a4);}return _5a3;},_getControlPoints:function(_5a8,_5a9,_5aa,_5ab,_5ac){var map=this.map,idx1,idx2,pt1,pt2;if(this._isNew(_5a8)){idx1=_5ab;idx2=_5ab+1;if(idx1>=0){pt1=map.toScreen(_5a9.getPoint(_5aa,idx1));}if(idx2<=_5ac){pt2=map.toScreen(_5a9.getPoint(_5aa,idx2));}}else{idx1=_5ab-1;idx2=_5ab+1;if(idx1>=0){pt1=map.toScreen(_5a9.getPoint(_5aa,idx1));}if(idx2<_5ac){pt2=map.toScreen(_5a9.getPoint(_5aa,idx2));}}return [pt1,pt2];},_getAdjacentMidpoints:function(_5ad,_5ae){var _5af=[];var idx1=_5ad-1;if(idx1>=0){_5af.push(idx1);}var idx2=_5ad;if(idx2<_5ae-1){_5af.push(idx2);}return _5af;},_getAdjacentVertices:function(_5b0,_5b1){return [_5b0,_5b0+1];},_deleteMidpoints:function(_5b2){var _5b3=_5b2.segIndex,_5b4=_5b2.ptIndex,_5b5=_5b2.segLength;var _5b6=this._mpVertexMovers[_5b3],_5b7=_5b6.length-1;var _5b8=this._getAdjacentMidpoints(_5b4,_5b5).sort();var i,min=_5b8[0];for(i=0;i<min;i++){_5b6[i].segLength-=1;}for(i=min+1;i<_5b6.length;i++){var mvr=_5b6[i];mvr.ptIndex-=1;mvr.segLength-=1;}if(_5b8.length===1){_5b6.splice(min,1)[0].destroy();}else{var _5b9=this._getAdjacentVertices(min,_5b7);var _5ba=_5b2.relatedGraphic.geometry.getPoint(_5b2.segIndex,_5b9[0]);var _5bb=_5b2.relatedGraphic.geometry.getPoint(_5b2.segIndex,_5b9[1]);var _5bc=new esri.geometry.Point({x:(_5ba.x+_5bb.x)/2,y:(_5ba.y+_5bb.y)/2,spatialReference:_5ba.spatialReference.toJson()});var mvr1=new esri.toolbars.VertexMover(_5bc,this._symbol2,this.graphic,_5b2.segIndex,min,_5b7,this,true);var _5bd=_5b6.splice(min,_5b8.length,mvr1);for(i=0;i<_5bd.length;i++){_5bd[i].destroy();}}},_updateRelatedGraphic:function(_5be,_5bf,_5c0,_5c1,_5c2,_5c3,add,del){var geom=_5bf.geometry;if(add){geom.insertPoint(_5c1,_5c2+1,esri.geometry.fromJson(_5c0.toJson()));}else{if(del){geom.removePoint(_5c1,_5c2);}else{geom.setPoint(_5c1,_5c2,esri.geometry.fromJson(_5c0.toJson()));}}_5bf.setGeometry(geom);}});_4.declare("esri.toolbars._PolygonVertexEditor",esri.toolbars._GraphicVertexEditor,{minLength:3,_getSegments:function(_5c4){var i,j,_5c5=_5c4.rings,_5c6=[];for(i=0;i<_5c5.length;i++){var ring=_5c5[i],_5c7=[];for(j=0;j<ring.length-1;j++){_5c7.push(_5c4.getPoint(i,j));}_5c6.push(_5c7);}return _5c6;},_getMidpointSegments:function(_5c8){var i,j,_5c9=_5c8.rings,_5ca=[],sr=_5c8.spatialReference;for(i=0;i<_5c9.length;i++){var ring=_5c9[i],_5cb=[];for(j=0;j<ring.length-1;j++){var _5cc=_5c8.getPoint(i,j),_5cd=_5c8.getPoint(i,j+1);var midX=(_5cc.x+_5cd.x)/2,midY=(_5cc.y+_5cd.y)/2;var _5ce=new esri.geometry.Point({x:midX,y:midY,spatialReference:sr.toJson()});_5cb.push(_5ce);}_5ca.push(_5cb);}return _5ca;},_getControlPoints:function(_5cf,_5d0,_5d1,_5d2,_5d3){var map=this.map,idx1,idx2,pt1,pt2;if(this._isNew(_5cf)){idx1=_5d2;idx2=(_5d2+1)%_5d3;}else{idx1=_5d2-1;idx1=idx1<0?(_5d3+idx1)%_5d3:idx1;idx2=(_5d2+1)%_5d3;}pt1=map.toScreen(_5d0.getPoint(_5d1,idx1));pt2=map.toScreen(_5d0.getPoint(_5d1,idx2));return [pt1,pt2];},_getAdjacentMidpoints:function(_5d4,_5d5){var idx1=_5d4-1;idx1=idx1<0?(_5d5+idx1)%_5d5:idx1;var idx2=_5d4;return [idx1,idx2];},_getAdjacentVertices:function(_5d6,_5d7){return [_5d6,(_5d6+1)%_5d7];},_deleteMidpoints:function(_5d8){var _5d9=_5d8.segIndex,_5da=_5d8.ptIndex,_5db=_5d8.segLength;var _5dc=this._mpVertexMovers[_5d9],_5dd=_5dc.length-1,_5de=this._getAdjacentMidpoints(_5da,_5db).sort(),_5df,_5e0,_5e1,_5e2,i,mvr1,mvr,min=_5de[0],max=_5de[_5de.length-1];if(_5da===0){_5df=this._getAdjacentVertices(_5dd-1,_5dd);_5e0=_5d8.relatedGraphic.geometry.getPoint(_5d8.segIndex,_5df[0]);_5e1=_5d8.relatedGraphic.geometry.getPoint(_5d8.segIndex,_5df[1]);_5e2=new esri.geometry.Point({x:(_5e0.x+_5e1.x)/2,y:(_5e0.y+_5e1.y)/2,spatialReference:_5e0.spatialReference.toJson()});mvr1=new esri.toolbars.VertexMover(_5e2,this._symbol2,this.graphic,_5d8.segIndex,_5dd-1,_5dd,this,true);_5dc.splice(max,1,mvr1)[0].destroy();_5dc.splice(min,1)[0].destroy();for(i=0;i<_5dc.length-1;i++){mvr=_5dc[i];mvr.ptIndex-=1;mvr.segLength-=1;}}else{_5df=this._getAdjacentVertices(min,_5dd);_5e0=_5d8.relatedGraphic.geometry.getPoint(_5d8.segIndex,_5df[0]);_5e1=_5d8.relatedGraphic.geometry.getPoint(_5d8.segIndex,_5df[1]);_5e2=new esri.geometry.Point({x:(_5e0.x+_5e1.x)/2,y:(_5e0.y+_5e1.y)/2,spatialReference:_5e0.spatialReference.toJson()});mvr1=new esri.toolbars.VertexMover(_5e2,this._symbol2,this.graphic,_5d8.segIndex,min,_5dd,this,true);var _5e3=_5dc.splice(min,_5de.length,mvr1);for(i=0;i<_5e3.length;i++){_5e3[i].destroy();}for(i=0;i<min;i++){_5dc[i].segLength-=1;}for(i=min+1;i<_5dc.length;i++){mvr=_5dc[i];mvr.ptIndex-=1;mvr.segLength-=1;}}},_updateRelatedGraphic:function(_5e4,_5e5,_5e6,_5e7,_5e8,_5e9,add,del){var geom=_5e5.geometry;if(add){geom.insertPoint(_5e7,_5e8+1,esri.geometry.fromJson(_5e6.toJson()));}else{if(del){geom.removePoint(_5e7,_5e8);if(_5e8===0){geom.setPoint(_5e7,_5e9-1,esri.geometry.fromJson(geom.getPoint(_5e7,0).toJson()));}}else{geom.setPoint(_5e7,_5e8,esri.geometry.fromJson(_5e6.toJson()));if(_5e8===0){geom.setPoint(_5e7,_5e9,esri.geometry.fromJson(_5e6.toJson()));}}}_5e5.setGeometry(geom);}});}if(!_4._hasResource["esri.toolbars._Box"]){_4._hasResource["esri.toolbars._Box"]=true;_4.provide("esri.toolbars._Box");_4.declare("esri.toolbars._Box",null,{constructor:function(_5ea,map,_5eb,_5ec,_5ed){this._graphic=_5ea;this._map=map;this._toolbar=_5eb;this._scale=_5ec;this._rotate=_5ed;this._defaultEventArgs={};this._scaleEvent="Scale";this._rotateEvent="Rotate";var _5ee=_5eb._options;this._markerSymbol=_5ee.boxHandleSymbol;this._lineSymbol=_5ee.boxLineSymbol;this._moveStartHandler=_4.hitch(this,this._moveStartHandler);this._firstMoveHandler=_4.hitch(this,this._firstMoveHandler);this._moveStopHandler=_4.hitch(this,this._moveStopHandler);this._moveHandler=_4.hitch(this,this._moveHandler);this._init();},destroy:function(){this._cleanUp();this._graphic=this._map=this._toolbar=this._markerSymbol=this._lineSymbol=null;},refresh:function(){this._draw();},suspend:function(){_4.forEach(this._getAllGraphics(),function(g){g.hide();});},resume:function(){_4.forEach(this._getAllGraphics(),function(g){g.show();});this._draw();},_init:function(){this._draw();},_cleanUp:function(){if(this._connects){_4.forEach(this._connects,_4.disconnect,_4);}var _5ef=this._toolbar._scratchGL;if(this._anchors){_4.forEach(this._anchors,function(info){_5ef.remove(info.graphic);var mov=info.moveable;if(mov){mov.destroy();}});}if(this._box){_5ef.remove(this._box);}this._box=this._anchors=this._connects=null;},_draw:function(){if(!this._graphic.getDojoShape()){this._cleanUp();return;}var map=this._map,_5f0=this._toolbar._scratchGL;var _5f1=this._getBoxCoords();var _5f2=new esri.geometry.Polyline(map.spatialReference);var path=_4.clone(_4.filter(_5f1,function(pt,_5f3){return (_5f3!==8&&_5f3%2===0);}));if(path[0]){path.push([path[0][0],path[0][1]]);}_5f2.addPath(path);if(this._rotate){_5f2.addPath([_5f1[1],_5f1[8]]);}if(this._box){this._box.setGeometry(_5f2);}else{this._box=new esri.Graphic(_5f2,this._lineSymbol);_5f0.add(this._box);}if(this._anchors){_4.forEach(this._anchors,function(info,_5f4){if(!this._scale){_5f4=8;}var _5f5=new esri.geometry.Point(_5f1[_5f4],map.spatialReference);info.graphic.setGeometry(_5f5);var mov=info.moveable,_5f6=info.graphic.getDojoShape();if(_5f6){if(!mov){info.moveable=this._getMoveable(info.graphic,_5f4);}else{if(_5f6!==mov.shape){mov.destroy();info.moveable=this._getMoveable(info.graphic,_5f4);}}}},this);}else{this._anchors=[];this._connects=[];_4.forEach(_5f1,function(_5f7,_5f8){if(!this._scale&&_5f8<8){return;}_5f7=new esri.geometry.Point(_5f7,map.spatialReference);var _5f9=new esri.Graphic(_5f7,this._markerSymbol);_5f0.add(_5f9);this._anchors.push({graphic:_5f9,moveable:this._getMoveable(_5f9,_5f8)});},this);}},_getBoxCoords:function(_5fa){var _5fb=this._graphic,map=this._map,bbox=this._getTransformedBoundingBox(_5fb),_5fc=[],pt,next,_5fd;_4.forEach(bbox,function(_5fe,_5ff,arr){pt=_5fe;next=arr[_5ff+1];if(!next){next=arr[0];}_5fd={x:(pt.x+next.x)/2,y:(pt.y+next.y)/2};if(!_5fa){pt=map.toMap(pt);_5fd=map.toMap(_5fd);}_5fc.push([pt.x,pt.y]);_5fc.push([_5fd.x,_5fd.y]);});if(this._rotate){var _600=_4.clone(_5fc[1]);_600=_5fa?{x:_600[0],y:_600[1]}:map.toScreen({x:_600[0],y:_600[1]});_600.y-=this._toolbar._options.rotateHandleOffset;if(!_5fa){_600=map.toMap(_600);}_5fc.push([_600.x,_600.y]);}return _5fc;},_getTransformedBoundingBox:function(_601){var map=this._map;var _602=_601.geometry.getExtent();var _603=new esri.geometry.Point(_602.xmin,_602.ymax);var _604=new esri.geometry.Point(_602.xmax,_602.ymin);_603=map.toScreen(_603);_604=map.toScreen(_604);return [{x:_603.x,y:_603.y},{x:_604.x,y:_603.y},{x:_604.x,y:_604.y},{x:_603.x,y:_604.y}];},_getAllGraphics:function(){var _605=[this._box];if(this._anchors){_4.forEach(this._anchors,function(_606){_605.push(_606.graphic);});}_605=_4.filter(_605,esri._isDefined);return _605;},_getMoveable:function(_607,_608){var _609=_607.getDojoShape();if(!_609){return;}var _60a=new _6.gfx.Moveable(_609);_60a._index=_608;this._connects.push(_4.connect(_60a,"onMoveStart",this._moveStartHandler));this._connects.push(_4.connect(_60a,"onFirstMove",this._firstMoveHandler));this._connects.push(_4.connect(_60a,"onMoveStop",this._moveStopHandler));_60a.onMove=this._moveHandler;var node=_609.getEventSource();if(node){_4.style(node,"cursor",this._toolbar._cursors["box"+_608]);}return _60a;},_moveStartHandler:function(_60b){this._toolbar["on"+(_60b.host._index===8?this._rotateEvent:this._scaleEvent)+"Start"](this._graphic);},_firstMoveHandler:function(_60c){var _60d=_60c.host._index,_60e=(this._wrapOffset=_60c.host.shape._wrapOffsets[0]||0),_60f=this._graphic.getLayer()._div.getTransform(),mx=_6.gfx.matrix,_610,_611,_612,_613=_4.map(this._getBoxCoords(true),function(arr){return {x:arr[0]+_60e,y:arr[1]};});if(_60d===8){_610=mx.multiplyPoint(mx.invert(_60f),_613[1]);_612={x:_613[1].x,y:_613[3].y};_611=mx.multiplyPoint(mx.invert(_60f),_612);this._startLine=[_611,_610];this._moveLine=_4.clone(this._startLine);}else{_610=mx.multiplyPoint(mx.invert(_60f),_613[_60d]);_611=mx.multiplyPoint(mx.invert(_60f),_613[(_60d+4)%8]);this._startBox=_611;this._startBox.width=(_613[4].x-_613[0].x);this._startBox.height=(_613[4].y-_613[0].y);this._moveBox=_4.clone(this._startBox);this._xfactor=_610.x>_611.x?1:-1;this._yfactor=_610.y>_611.y?1:-1;if(_60d===1||_60d===5){this._xfactor=0;}else{if(_60d===3||_60d===7){this._yfactor=0;}}}this._toolbar._beginOperation("BOX");this._toolbar["on"+(_60d===8?this._rotateEvent:this._scaleEvent)+"FirstMove"](this._graphic);},_moveHandler:function(_614,_615){var _616=_614.host._index,args=this._defaultEventArgs,_617,move,tx,pt,_618,_619,_61a;args.angle=0;args.scaleX=1;args.scaleY=1;if(_616===8){_617=this._startLine;move=this._moveLine;pt=move[1];pt.x+=_615.dx;pt.y+=_615.dy;_618=this._getAngle(_617,move);tx=_6.gfx.matrix.rotategAt(_618,_617[0]);this._graphic.getDojoShape().setTransform(tx);args.transform=tx;args.angle=_618;args.around=_617[0];}else{_617=this._startBox;move=this._moveBox;move.width+=(_615.dx*this._xfactor);move.height+=(_615.dy*this._yfactor);_619=move.width/_617.width;_61a=move.height/_617.height;if(isNaN(_619)||_619===Infinity||_619===-Infinity){_619=1;}if(isNaN(_61a)||_61a===Infinity||_61a===-Infinity){_61a=1;}tx=_6.gfx.matrix.scaleAt(_619,_61a,_617);this._graphic.getDojoShape().setTransform(tx);args.transform=tx;args.scaleX=_619;args.scaleY=_61a;args.around=_617;}this._toolbar["on"+(_616===8?this._rotateEvent:this._scaleEvent)](this._graphic,args);},_moveStopHandler:function(_61b){var _61c=this._graphic,_61d=_61c.geometry.toJson(),_61e=_61c.getDojoShape(),_61f=_61e.getTransform(),_620=_61c.getLayer()._div.getTransform();this._updateSegments(_61d.paths||_61d.rings,_61f,_620);_61e.setTransform(null);_61c.setGeometry(esri.geometry.fromJson(_61d));this._draw();this._startBox=this._moveBox=this._xfactor=this._yfactor=null;this._startLine=this._moveLine=null;this._toolbar._endOperation("BOX");this._defaultEventArgs.transform=_61f;this._toolbar["on"+(_61b.host._index===8?this._rotateEvent:this._scaleEvent)+"Stop"](this._graphic,this._defaultEventArgs);},_updateSegments:function(_621,_622,_623){var mx=_6.gfx.matrix,map=this._map,_624=this._wrapOffset||0;_4.forEach(_621,function(_625){_4.forEach(_625,function(_626){var _627=map.toScreen({x:_626[0],y:_626[1]},true);_627.x+=_624;_627=mx.multiplyPoint([_623,_622,mx.invert(_623)],_627);_627.x-=_624;var _628=map.toMap(_627);_626[0]=_628.x;_626[1]=_628.y;});});},_getAngle:function(_629,_62a){var _62b=Math.atan2(_629[0].y-_629[1].y,_629[0].x-_629[1].x)*180/Math.PI,_62c=Math.atan2(_62a[0].y-_62a[1].y,_62a[0].x-_62a[1].x)*180/Math.PI;return _62c-_62b;}});}if(!_4._hasResource["esri.toolbars.edit"]){_4._hasResource["esri.toolbars.edit"]=true;_4.provide("esri.toolbars.edit");(function(){var link=document.createElement("link");link.type="text/css";link.rel="stylesheet";link.href=_4.moduleUrl("esri","toolbars/css/edit.css").toString();document.getElementsByTagName("head").item(0).appendChild(link);}());_4.declare("esri.toolbars.Edit",esri.toolbars._Toolbar,{constructor:function(map,_62d){this._map=map;this._tool=0;this._scratchGL=map.graphics;var _62e=esri.isTouchEnabled;this._defaultOptions=_4.mixin({vertexSymbol:new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE,_62e?20:12,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new _4.Color([0,0,0,0.5]),1),new _4.Color([128,128,128])),ghostVertexSymbol:new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE,_62e?18:10,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new _4.Color([0,0,0,0.5]),1),new _4.Color([255,255,255,0.75])),ghostLineSymbol:new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DOT,new _4.Color([128,128,128]),2),allowDeleteVertices:true,allowAddVertices:true,rotateHandleOffset:_62e?24:16,boxLineSymbol:new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASH,new _4.Color([64,64,64]),1),boxHandleSymbol:new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE,_62e?16:9,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new _4.Color([0,0,0,0.5]),1),new _4.Color([255,255,255,0.75]))},_62d||{});},activate:function(tool,_62f,_630){this.deactivate();this._graphic=_62f;this._options=_4.mixin(_4.mixin({},this._defaultOptions),_630||{});var MOVE=esri.toolbars.Edit.MOVE,EDIT=esri.toolbars.Edit.EDIT_VERTICES;var _631=esri.toolbars.Edit.SCALE,_632=esri.toolbars.Edit.ROTATE;var move=false,edit=false,box=false;if((tool&MOVE)===MOVE){move=this._enableMove(_62f);}var _633=((tool&_631)===_631),_634=((tool&_632)===_632);if(_633||_634){box=this._enableBoxEditing(_62f,_633,_634);}if((tool&EDIT)===EDIT){edit=this._enableVertexEditing(_62f);}if(!(move||edit||box)){throw new Error("[esri.toolbars.Edit::activate] "+esri.bundle.toolbars.edit.invalidType);}this._tool=tool;var map=this._map;if(this._tool){this._mapPanEndHandle=_4.connect(map,"onPanEnd",this,this._mapPanEndHandler);this._mapExtChgHandle=_4.connect(map,"onExtentChange",this,this._mapExtentChangeHandler);this.onActivate(this._tool,_62f);}if(map.snappingManager&&(move||edit)){map.snappingManager._startSelectionLayerQuery();}},deactivate:function(){var tool=this._tool,_635=this._graphic;if(!tool){return;}var _636=!!this._modified;this._clear();_4.disconnect(this._mapPanEndHandle);_4.disconnect(this._mapExtChgHandle);this._graphic=null;this.onDeactivate(tool,_635,{isModified:_636});if(this._map.snappingManager){this._map.snappingManager._stopSelectionLayerQuery();}},refresh:function(){this._refreshMoveables(true);},getCurrentState:function(){return {tool:this._tool,graphic:this._graphic,isModified:!!this._modified};},onActivate:function(tool,_637){},onDeactivate:function(tool,_638,info){},onGraphicMoveStart:function(_639){},onGraphicFirstMove:function(_63a){this._modified=true;},onGraphicMove:function(_63b,_63c){},onGraphicMoveStop:function(_63d,_63e){},onGraphicClick:function(_63f,info){},onVertexMoveStart:function(_640,_641){},onVertexFirstMove:function(_642,_643){this._modified=true;},onVertexMove:function(_644,_645,_646){},onVertexMoveStop:function(_647,_648,_649){},onVertexAdd:function(_64a,_64b){this._modified=true;},onVertexClick:function(_64c,_64d){},onVertexMouseOver:function(_64e,_64f){},onVertexMouseOut:function(_650,_651){},onVertexDelete:function(_652,_653){this._modified=true;},onScaleStart:function(_654){},onScaleFirstMove:function(_655){this._modified=true;},onScale:function(_656,info){},onScaleStop:function(_657,info){},onRotateStart:function(_658){},onRotateFirstMove:function(_659){this._modified=true;},onRotate:function(_65a,info){},onRotateStop:function(_65b,info){},_enableMove:function(_65c){var map=this._map,type=_65c.geometry.type;switch(type){case "point":case "polyline":case "polygon":this._graphicMover=new esri.toolbars._GraphicMover(_65c,map,this);return true;case "multipoint":break;}return false;},_enableVertexEditing:function(_65d){var map=this._map,type=_65d.geometry.type;switch(type){case "point":break;case "multipoint":case "polyline":case "polygon":this._vertexEditor=esri.toolbars._GraphicVertexEditor.create(_65d,map,this);return true;}return false;},_enableBoxEditing:function(_65e,_65f,_660){var map=this._map,type=_65e.geometry.type;switch(type){case "point":case "multipoint":break;case "polyline":case "polygon":this._boxEditor=new esri.toolbars._Box(_65e,map,this,_65f,_660);return true;}return false;},_disableMove:function(){var _661=this._graphicMover;if(_661){_661.destroy();this._graphicMover=null;}},_disableVertexEditing:function(){var _662=this._vertexEditor;if(_662){_662.destroy();this._vertexEditor=null;}},_disableBoxEditing:function(){var box=this._boxEditor;if(box){box.destroy();this._boxEditor=null;}},_clear:function(){this._disableMove();this._disableVertexEditing();this._disableBoxEditing();this._tool=0;this._modified=false;},_mapPanEndHandler:function(){this._refreshMoveables();},_mapExtentChangeHandler:function(e,d,_663){if(_663){this._refreshMoveables();}},_refreshMoveables:function(_664){var _665=_4.filter([this._graphicMover,this._vertexEditor,this._boxEditor],esri._isDefined);_4.forEach(_665,function(mov){mov.refresh(_664);});},_beginOperation:function(_666){_4.forEach(this._getAffectedTools(_666),function(tool){tool.suspend();});},_endOperation:function(_667){_4.forEach(this._getAffectedTools(_667),function(tool){tool.resume();});},_getAffectedTools:function(_668){var _669=[];switch(_668){case "MOVE":_669=[this._vertexEditor,this._boxEditor];break;case "VERTICES":_669=[this._boxEditor];break;case "BOX":_669=[this._vertexEditor];break;}_669=_4.filter(_669,esri._isDefined);return _669;}});_4.mixin(esri.toolbars.Edit,{MOVE:1,EDIT_VERTICES:2,SCALE:4,ROTATE:8});}if(!_4._hasResource["dojo.data.util.filter"]){_4._hasResource["dojo.data.util.filter"]=true;_4.provide("dojo.data.util.filter");_4.getObject("data.util.filter",true,_4);_4.data.util.filter.patternToRegExp=function(_66a,_66b){var rxp="^";var c=null;for(var i=0;i<_66a.length;i++){c=_66a.charAt(i);switch(c){case "\\":rxp+=c;i++;rxp+=_66a.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(_66b){return new RegExp(rxp,"mi");}else{return new RegExp(rxp,"m");}};}if(!_4._hasResource["dojo.data.util.sorter"]){_4._hasResource["dojo.data.util.sorter"]=true;_4.provide("dojo.data.util.sorter");_4.getObject("data.util.sorter",true,_4);_4.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;};_4.data.util.sorter.createSortFunction=function(_66c,_66d){var _66e=[];function _66f(attr,dir,comp,s){return function(_670,_671){var a=s.getValue(_670,attr);var b=s.getValue(_671,attr);return dir*comp(a,b);};};var _672;var map=_66d.comparatorMap;var bc=_4.data.util.sorter.basicComparator;for(var i=0;i<_66c.length;i++){_672=_66c[i];var attr=_672.attribute;if(attr){var dir=(_672.descending)?-1:1;var comp=bc;if(map){if(typeof attr!=="string"&&("toString" in attr)){attr=attr.toString();}comp=map[attr]||bc;}_66e.push(_66f(attr,dir,comp,_66d));}}return function(rowA,rowB){var i=0;while(i<_66e.length){var ret=_66e[i++](rowA,rowB);if(ret!==0){return ret;}}return 0;};};}if(!_4._hasResource["dojo.data.util.simpleFetch"]){_4._hasResource["dojo.data.util.simpleFetch"]=true;_4.provide("dojo.data.util.simpleFetch");_4.getObject("data.util.simpleFetch",true,_4);_4.data.util.simpleFetch.fetch=function(_673){_673=_673||{};if(!_673.store){_673.store=this;}var self=this;var _674=function(_675,_676){if(_676.onError){var _677=_676.scope||_4.global;_676.onError.call(_677,_675,_676);}};var _678=function(_679,_67a){var _67b=_67a.abort||null;var _67c=false;var _67d=_67a.start?_67a.start:0;var _67e=(_67a.count&&(_67a.count!==Infinity))?(_67d+_67a.count):_679.length;_67a.abort=function(){_67c=true;if(_67b){_67b.call(_67a);}};var _67f=_67a.scope||_4.global;if(!_67a.store){_67a.store=self;}if(_67a.onBegin){_67a.onBegin.call(_67f,_679.length,_67a);}if(_67a.sort){_679.sort(_4.data.util.sorter.createSortFunction(_67a.sort,self));}if(_67a.onItem){for(var i=_67d;(i<_679.length)&&(i<_67e);++i){var item=_679[i];if(!_67c){_67a.onItem.call(_67f,item,_67a);}}}if(_67a.onComplete&&!_67c){var _680=null;if(!_67a.onItem){_680=_679.slice(_67d,_67e);}_67a.onComplete.call(_67f,_680,_67a);}};this._fetchItems(_673,_678,_674);return _673;};}if(!_4._hasResource["dojo.data.ItemFileReadStore"]){_4._hasResource["dojo.data.ItemFileReadStore"]=true;_4.provide("dojo.data.ItemFileReadStore");_4.declare("dojo.data.ItemFileReadStore",null,{constructor:function(_681){this._arrayOfAllItems=[];this._arrayOfTopLevelItems=[];this._loadFinished=false;this._jsonFileUrl=_681.url;this._ccUrl=_681.url;this.url=_681.url;this._jsonData=_681.data;this.data=null;this._datatypeMap=_681.typeMap||{};if(!this._datatypeMap["Date"]){this._datatypeMap["Date"]={type:Date,deserialize:function(_682){return _4.date.stamp.fromISOString(_682);}};}this._features={"dojo.data.api.Read":true,"dojo.data.api.Identity":true};this._itemsByIdentity=null;this._storeRefPropName="_S";this._itemNumPropName="_0";this._rootItemPropName="_RI";this._reverseRefMap="_RRM";this._loadInProgress=false;this._queuedFetches=[];if(_681.urlPreventCache!==undefined){this.urlPreventCache=_681.urlPreventCache?true:false;}if(_681.hierarchical!==undefined){this.hierarchical=_681.hierarchical?true:false;}if(_681.clearOnClose){this.clearOnClose=true;}if("failOk" in _681){this.failOk=_681.failOk?true:false;}},url:"",_ccUrl:"",data:null,typeMap:null,clearOnClose:false,urlPreventCache:false,failOk:false,hierarchical:true,_assertIsItem:function(item){if(!this.isItem(item)){throw new Error("dojo.data.ItemFileReadStore: Invalid item argument.");}},_assertIsAttribute:function(_683){if(typeof _683!=="string"){throw new Error("dojo.data.ItemFileReadStore: Invalid attribute argument.");}},getValue:function(item,_684,_685){var _686=this.getValues(item,_684);return (_686.length>0)?_686[0]:_685;},getValues:function(item,_687){this._assertIsItem(item);this._assertIsAttribute(_687);return (item[_687]||[]).slice(0);},getAttributes:function(item){this._assertIsItem(item);var _688=[];for(var key in item){if((key!==this._storeRefPropName)&&(key!==this._itemNumPropName)&&(key!==this._rootItemPropName)&&(key!==this._reverseRefMap)){_688.push(key);}}return _688;},hasAttribute:function(item,_689){this._assertIsItem(item);this._assertIsAttribute(_689);return (_689 in item);},containsValue:function(item,_68a,_68b){var _68c=undefined;if(typeof _68b==="string"){_68c=_4.data.util.filter.patternToRegExp(_68b,false);}return this._containsValue(item,_68a,_68b,_68c);},_containsValue:function(item,_68d,_68e,_68f){return _4.some(this.getValues(item,_68d),function(_690){if(_690!==null&&!_4.isObject(_690)&&_68f){if(_690.toString().match(_68f)){return true;}}else{if(_68e===_690){return true;}}});},isItem:function(_691){if(_691&&_691[this._storeRefPropName]===this){if(this._arrayOfAllItems[_691[this._itemNumPropName]]===_691){return true;}}return false;},isItemLoaded:function(_692){return this.isItem(_692);},loadItem:function(_693){this._assertIsItem(_693.item);},getFeatures:function(){return this._features;},getLabel:function(item){if(this._labelAttr&&this.isItem(item)){return this.getValue(item,this._labelAttr);}return undefined;},getLabelAttributes:function(item){if(this._labelAttr){return [this._labelAttr];}return null;},_fetchItems:function(_694,_695,_696){var self=this,_697=function(_698,_699){var _69a=[],i,key;if(_698.query){var _69b,_69c=_698.queryOptions?_698.queryOptions.ignoreCase:false;var _69d={};for(key in _698.query){_69b=_698.query[key];if(typeof _69b==="string"){_69d[key]=_4.data.util.filter.patternToRegExp(_69b,_69c);}else{if(_69b instanceof RegExp){_69d[key]=_69b;}}}for(i=0;i<_699.length;++i){var _69e=true;var _69f=_699[i];if(_69f===null){_69e=false;}else{for(key in _698.query){_69b=_698.query[key];if(!self._containsValue(_69f,key,_69b,_69d[key])){_69e=false;}}}if(_69e){_69a.push(_69f);}}_695(_69a,_698);}else{for(i=0;i<_699.length;++i){var item=_699[i];if(item!==null){_69a.push(item);}}_695(_69a,_698);}};if(this._loadFinished){_697(_694,this._getItemsArray(_694.queryOptions));}else{if(this._jsonFileUrl!==this._ccUrl){_4.deprecated("dojo.data.ItemFileReadStore: ","To change the url, set the url property of the store,"+" not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0");this._ccUrl=this._jsonFileUrl;this.url=this._jsonFileUrl;}else{if(this.url!==this._ccUrl){this._jsonFileUrl=this.url;this._ccUrl=this.url;}}if(this.data!=null){this._jsonData=this.data;this.data=null;}if(this._jsonFileUrl){if(this._loadInProgress){this._queuedFetches.push({args:_694,filter:_697});}else{this._loadInProgress=true;var _6a0={url:self._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk};var _6a1=_4.xhrGet(_6a0);_6a1.addCallback(function(data){try{self._getItemsFromLoadedData(data);self._loadFinished=true;self._loadInProgress=false;_697(_694,self._getItemsArray(_694.queryOptions));self._handleQueuedFetches();}catch(e){self._loadFinished=true;self._loadInProgress=false;_696(e,_694);}});_6a1.addErrback(function(_6a2){self._loadInProgress=false;_696(_6a2,_694);});var _6a3=null;if(_694.abort){_6a3=_694.abort;}_694.abort=function(){var df=_6a1;if(df&&df.fired===-1){df.cancel();df=null;}if(_6a3){_6a3.call(_694);}};}}else{if(this._jsonData){try{this._loadFinished=true;this._getItemsFromLoadedData(this._jsonData);this._jsonData=null;_697(_694,this._getItemsArray(_694.queryOptions));}catch(e){_696(e,_694);}}else{_696(new Error("dojo.data.ItemFileReadStore: No JSON source data was provided as either URL or a nested Javascript object."),_694);}}}},_handleQueuedFetches:function(){if(this._queuedFetches.length>0){for(var i=0;i<this._queuedFetches.length;i++){var _6a4=this._queuedFetches[i],_6a5=_6a4.args,_6a6=_6a4.filter;if(_6a6){_6a6(_6a5,this._getItemsArray(_6a5.queryOptions));}else{this.fetchItemByIdentity(_6a5);}}this._queuedFetches=[];}},_getItemsArray:function(_6a7){if(_6a7&&_6a7.deep){return this._arrayOfAllItems;}return this._arrayOfTopLevelItems;},close:function(_6a8){if(this.clearOnClose&&this._loadFinished&&!this._loadInProgress){if(((this._jsonFileUrl==""||this._jsonFileUrl==null)&&(this.url==""||this.url==null))&&this.data==null){console.debug("dojo.data.ItemFileReadStore: WARNING!  Data reload "+" information has not been provided."+"  Please set 'url' or 'data' to the appropriate value before"+" the next fetch");}this._arrayOfAllItems=[];this._arrayOfTopLevelItems=[];this._loadFinished=false;this._itemsByIdentity=null;this._loadInProgress=false;this._queuedFetches=[];}},_getItemsFromLoadedData:function(_6a9){var _6aa=false,self=this;function _6ab(_6ac){var _6ad=((_6ac!==null)&&(typeof _6ac==="object")&&(!_4.isArray(_6ac)||_6aa)&&(!_4.isFunction(_6ac))&&(_6ac.constructor==Object||_4.isArray(_6ac))&&(typeof _6ac._reference==="undefined")&&(typeof _6ac._type==="undefined")&&(typeof _6ac._value==="undefined")&&self.hierarchical);return _6ad;};function _6ae(_6af){self._arrayOfAllItems.push(_6af);for(var _6b0 in _6af){var _6b1=_6af[_6b0];if(_6b1){if(_4.isArray(_6b1)){var _6b2=_6b1;for(var k=0;k<_6b2.length;++k){var _6b3=_6b2[k];if(_6ab(_6b3)){_6ae(_6b3);}}}else{if(_6ab(_6b1)){_6ae(_6b1);}}}}};this._labelAttr=_6a9.label;var i,item;this._arrayOfAllItems=[];this._arrayOfTopLevelItems=_6a9.items;for(i=0;i<this._arrayOfTopLevelItems.length;++i){item=this._arrayOfTopLevelItems[i];if(_4.isArray(item)){_6aa=true;}_6ae(item);item[this._rootItemPropName]=true;}var _6b4={},key;for(i=0;i<this._arrayOfAllItems.length;++i){item=this._arrayOfAllItems[i];for(key in item){if(key!==this._rootItemPropName){var _6b5=item[key];if(_6b5!==null){if(!_4.isArray(_6b5)){item[key]=[_6b5];}}else{item[key]=[null];}}_6b4[key]=key;}}while(_6b4[this._storeRefPropName]){this._storeRefPropName+="_";}while(_6b4[this._itemNumPropName]){this._itemNumPropName+="_";}while(_6b4[this._reverseRefMap]){this._reverseRefMap+="_";}var _6b6;var _6b7=_6a9.identifier;if(_6b7){this._itemsByIdentity={};this._features["dojo.data.api.Identity"]=_6b7;for(i=0;i<this._arrayOfAllItems.length;++i){item=this._arrayOfAllItems[i];_6b6=item[_6b7];var _6b8=_6b6[0];if(!Object.hasOwnProperty.call(this._itemsByIdentity,_6b8)){this._itemsByIdentity[_6b8]=item;}else{if(this._jsonFileUrl){throw new Error("dojo.data.ItemFileReadStore:  The json data as specified by: ["+this._jsonFileUrl+"] is malformed.  Items within the list have identifier: ["+_6b7+"].  Value collided: ["+_6b8+"]");}else{if(this._jsonData){throw new Error("dojo.data.ItemFileReadStore:  The json data provided by the creation arguments is malformed.  Items within the list have identifier: ["+_6b7+"].  Value collided: ["+_6b8+"]");}}}}}else{this._features["dojo.data.api.Identity"]=Number;}for(i=0;i<this._arrayOfAllItems.length;++i){item=this._arrayOfAllItems[i];item[this._storeRefPropName]=this;item[this._itemNumPropName]=i;}for(i=0;i<this._arrayOfAllItems.length;++i){item=this._arrayOfAllItems[i];for(key in item){_6b6=item[key];for(var j=0;j<_6b6.length;++j){_6b5=_6b6[j];if(_6b5!==null&&typeof _6b5=="object"){if(("_type" in _6b5)&&("_value" in _6b5)){var type=_6b5._type;var _6b9=this._datatypeMap[type];if(!_6b9){throw new Error("dojo.data.ItemFileReadStore: in the typeMap constructor arg, no object class was specified for the datatype '"+type+"'");}else{if(_4.isFunction(_6b9)){_6b6[j]=new _6b9(_6b5._value);}else{if(_4.isFunction(_6b9.deserialize)){_6b6[j]=_6b9.deserialize(_6b5._value);}else{throw new Error("dojo.data.ItemFileReadStore: Value provided in typeMap was neither a constructor, nor a an object with a deserialize function");}}}}if(_6b5._reference){var _6ba=_6b5._reference;if(!_4.isObject(_6ba)){_6b6[j]=this._getItemByIdentity(_6ba);}else{for(var k=0;k<this._arrayOfAllItems.length;++k){var _6bb=this._arrayOfAllItems[k],_6bc=true;for(var _6bd in _6ba){if(_6bb[_6bd]!=_6ba[_6bd]){_6bc=false;}}if(_6bc){_6b6[j]=_6bb;}}}if(this.referenceIntegrity){var _6be=_6b6[j];if(this.isItem(_6be)){this._addReferenceToMap(_6be,item,key);}}}else{if(this.isItem(_6b5)){if(this.referenceIntegrity){this._addReferenceToMap(_6b5,item,key);}}}}}}}},_addReferenceToMap:function(_6bf,_6c0,_6c1){},getIdentity:function(item){var _6c2=this._features["dojo.data.api.Identity"];if(_6c2===Number){return item[this._itemNumPropName];}else{var _6c3=item[_6c2];if(_6c3){return _6c3[0];}}return null;},fetchItemByIdentity:function(_6c4){var item,_6c5;if(!this._loadFinished){var self=this;if(this._jsonFileUrl!==this._ccUrl){_4.deprecated("dojo.data.ItemFileReadStore: ","To change the url, set the url property of the store,"+" not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0");this._ccUrl=this._jsonFileUrl;this.url=this._jsonFileUrl;}else{if(this.url!==this._ccUrl){this._jsonFileUrl=this.url;this._ccUrl=this.url;}}if(this.data!=null&&this._jsonData==null){this._jsonData=this.data;this.data=null;}if(this._jsonFileUrl){if(this._loadInProgress){this._queuedFetches.push({args:_6c4});}else{this._loadInProgress=true;var _6c6={url:self._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk};var _6c7=_4.xhrGet(_6c6);_6c7.addCallback(function(data){var _6c8=_6c4.scope?_6c4.scope:_4.global;try{self._getItemsFromLoadedData(data);self._loadFinished=true;self._loadInProgress=false;item=self._getItemByIdentity(_6c4.identity);if(_6c4.onItem){_6c4.onItem.call(_6c8,item);}self._handleQueuedFetches();}catch(error){self._loadInProgress=false;if(_6c4.onError){_6c4.onError.call(_6c8,error);}}});_6c7.addErrback(function(_6c9){self._loadInProgress=false;if(_6c4.onError){var _6ca=_6c4.scope?_6c4.scope:_4.global;_6c4.onError.call(_6ca,_6c9);}});}}else{if(this._jsonData){self._getItemsFromLoadedData(self._jsonData);self._jsonData=null;self._loadFinished=true;item=self._getItemByIdentity(_6c4.identity);if(_6c4.onItem){_6c5=_6c4.scope?_6c4.scope:_4.global;_6c4.onItem.call(_6c5,item);}}}}else{item=this._getItemByIdentity(_6c4.identity);if(_6c4.onItem){_6c5=_6c4.scope?_6c4.scope:_4.global;_6c4.onItem.call(_6c5,item);}}},_getItemByIdentity:function(_6cb){var item=null;if(this._itemsByIdentity&&Object.hasOwnProperty.call(this._itemsByIdentity,_6cb)){item=this._itemsByIdentity[_6cb];}else{if(Object.hasOwnProperty.call(this._arrayOfAllItems,_6cb)){item=this._arrayOfAllItems[_6cb];}}if(item===undefined){item=null;}return item;},getIdentityAttributes:function(item){var _6cc=this._features["dojo.data.api.Identity"];if(_6cc===Number){return null;}else{return [_6cc];}},_forceLoad:function(){var self=this;if(this._jsonFileUrl!==this._ccUrl){_4.deprecated("dojo.data.ItemFileReadStore: ","To change the url, set the url property of the store,"+" not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0");this._ccUrl=this._jsonFileUrl;this.url=this._jsonFileUrl;}else{if(this.url!==this._ccUrl){this._jsonFileUrl=this.url;this._ccUrl=this.url;}}if(this.data!=null){this._jsonData=this.data;this.data=null;}if(this._jsonFileUrl){var _6cd={url:this._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk,sync:true};var _6ce=_4.xhrGet(_6cd);_6ce.addCallback(function(data){try{if(self._loadInProgress!==true&&!self._loadFinished){self._getItemsFromLoadedData(data);self._loadFinished=true;}else{if(self._loadInProgress){throw new Error("dojo.data.ItemFileReadStore:  Unable to perform a synchronous load, an async load is in progress.");}}}catch(e){console.log(e);throw e;}});_6ce.addErrback(function(_6cf){throw _6cf;});}else{if(this._jsonData){self._getItemsFromLoadedData(self._jsonData);self._jsonData=null;self._loadFinished=true;}}}});_4.extend(_4.data.ItemFileReadStore,_4.data.util.simpleFetch);}if(!_4._hasResource["dijit.layout._LayoutWidget"]){_4._hasResource["dijit.layout._LayoutWidget"]=true;_4.provide("dijit.layout._LayoutWidget");_4.declare("dijit.layout._LayoutWidget",[_5._Widget,_5._Container,_5._Contained],{baseClass:"dijitLayoutContainer",isLayoutContainer:true,buildRendering:function(){this.inherited(arguments);_4.addClass(this.domNode,"dijitContainer");},startup:function(){if(this._started){return;}this.inherited(arguments);var _6d0=this.getParent&&this.getParent();if(!(_6d0&&_6d0.isLayoutContainer)){this.resize();this.connect(_4.isIE?this.domNode:_4.global,"onresize",function(){this.resize();});}},resize:function(_6d1,_6d2){var node=this.domNode;if(_6d1){_4.marginBox(node,_6d1);if(_6d1.t){node.style.top=_6d1.t+"px";}if(_6d1.l){node.style.left=_6d1.l+"px";}}var mb=_6d2||{};_4.mixin(mb,_6d1||{});if(!("h" in mb)||!("w" in mb)){mb=_4.mixin(_4.marginBox(node),mb);}var cs=_4.getComputedStyle(node);var me=_4._getMarginExtents(node,cs);var be=_4._getBorderExtents(node,cs);var bb=(this._borderBox={w:mb.w-(me.w+be.w),h:mb.h-(me.h+be.h)});var pe=_4._getPadExtents(node,cs);this._contentBox={l:_4._toPixelValue(node,cs.paddingLeft),t:_4._toPixelValue(node,cs.paddingTop),w:bb.w-pe.w,h:bb.h-pe.h};this.layout();},layout:function(){},_setupChild:function(_6d3){var cls=this.baseClass+"-child "+(_6d3.baseClass?this.baseClass+"-"+_6d3.baseClass:"");_4.addClass(_6d3.domNode,cls);},addChild:function(_6d4,_6d5){this.inherited(arguments);if(this._started){this._setupChild(_6d4);}},removeChild:function(_6d6){var cls=this.baseClass+"-child"+(_6d6.baseClass?" "+this.baseClass+"-"+_6d6.baseClass:"");_4.removeClass(_6d6.domNode,cls);this.inherited(arguments);}});_5.layout.marginBox2contentBox=function(node,mb){var cs=_4.getComputedStyle(node);var me=_4._getMarginExtents(node,cs);var pb=_4._getPadBorderExtents(node,cs);return {l:_4._toPixelValue(node,cs.paddingLeft),t:_4._toPixelValue(node,cs.paddingTop),w:mb.w-(me.w+pb.w),h:mb.h-(me.h+pb.h)};};(function(){var _6d7=function(word){return word.substring(0,1).toUpperCase()+word.substring(1);};var size=function(_6d8,dim){var _6d9=_6d8.resize?_6d8.resize(dim):_4.marginBox(_6d8.domNode,dim);if(_6d9){_4.mixin(_6d8,_6d9);}else{_4.mixin(_6d8,_4.marginBox(_6d8.domNode));_4.mixin(_6d8,dim);}};_5.layout.layoutChildren=function(_6da,dim,_6db,_6dc,_6dd){dim=_4.mixin({},dim);_4.addClass(_6da,"dijitLayoutContainer");_6db=_4.filter(_6db,function(item){return item.region!="center"&&item.layoutAlign!="client";}).concat(_4.filter(_6db,function(item){return item.region=="center"||item.layoutAlign=="client";}));_4.forEach(_6db,function(_6de){var elm=_6de.domNode,pos=(_6de.region||_6de.layoutAlign);var _6df=elm.style;_6df.left=dim.l+"px";_6df.top=dim.t+"px";_6df.position="absolute";_4.addClass(elm,"dijitAlign"+_6d7(pos));var _6e0={};if(_6dc&&_6dc==_6de.id){_6e0[_6de.region=="top"||_6de.region=="bottom"?"h":"w"]=_6dd;}if(pos=="top"||pos=="bottom"){_6e0.w=dim.w;size(_6de,_6e0);dim.h-=_6de.h;if(pos=="top"){dim.t+=_6de.h;}else{_6df.top=dim.t+dim.h+"px";}}else{if(pos=="left"||pos=="right"){_6e0.h=dim.h;size(_6de,_6e0);dim.w-=_6de.w;if(pos=="left"){dim.l+=_6de.w;}else{_6df.left=dim.l+dim.w+"px";}}else{if(pos=="client"||pos=="center"){size(_6de,dim);}}}});};})();}if(!_4._hasResource["dijit.form._FormWidget"]){_4._hasResource["dijit.form._FormWidget"]=true;_4.provide("dijit.form._FormWidget");_4.declare("dijit.form._FormWidget",[_5._Widget,_5._Templated,_5._CssStateMixin],{name:"",alt:"",value:"",type:"text",tabIndex:"0",disabled:false,intermediateChanges:false,scrollOnFocus:true,attributeMap:_4.delegate(_5._Widget.prototype.attributeMap,{value:"focusNode",id:"focusNode",tabIndex:"focusNode",alt:"focusNode",title:"focusNode"}),postMixInProperties:function(){this.nameAttrSetting=this.name?("name=\""+this.name.replace(/'/g,"&quot;")+"\""):"";this.inherited(arguments);},postCreate:function(){this.inherited(arguments);this.connect(this.domNode,"onmousedown","_onMouseDown");},_setDisabledAttr:function(_6e1){this._set("disabled",_6e1);_4.attr(this.focusNode,"disabled",_6e1);if(this.valueNode){_4.attr(this.valueNode,"disabled",_6e1);}_5.setWaiState(this.focusNode,"disabled",_6e1);if(_6e1){this._set("hovering",false);this._set("active",false);var _6e2="tabIndex" in this.attributeMap?this.attributeMap.tabIndex:"focusNode";_4.forEach(_4.isArray(_6e2)?_6e2:[_6e2],function(_6e3){var node=this[_6e3];if(_4.isWebKit||_5.hasDefaultTabStop(node)){node.setAttribute("tabIndex","-1");}else{node.removeAttribute("tabIndex");}},this);}else{if(this.tabIndex!=""){this.focusNode.setAttribute("tabIndex",this.tabIndex);}}},setDisabled:function(_6e4){_4.deprecated("setDisabled("+_6e4+") is deprecated. Use set('disabled',"+_6e4+") instead.","","2.0");this.set("disabled",_6e4);},_onFocus:function(e){if(this.scrollOnFocus){_4.window.scrollIntoView(this.domNode);}this.inherited(arguments);},isFocusable:function(){return !this.disabled&&this.focusNode&&(_4.style(this.domNode,"display")!="none");},focus:function(){if(!this.disabled){_5.focus(this.focusNode);}},compare:function(val1,val2){if(typeof val1=="number"&&typeof val2=="number"){return (isNaN(val1)&&isNaN(val2))?0:val1-val2;}else{if(val1>val2){return 1;}else{if(val1<val2){return -1;}else{return 0;}}}},onChange:function(_6e5){},_onChangeActive:false,_handleOnChange:function(_6e6,_6e7){if(this._lastValueReported==undefined&&(_6e7===null||!this._onChangeActive)){this._resetValue=this._lastValueReported=_6e6;}this._pendingOnChange=this._pendingOnChange||(typeof _6e6!=typeof this._lastValueReported)||(this.compare(_6e6,this._lastValueReported)!=0);if((this.intermediateChanges||_6e7||_6e7===undefined)&&this._pendingOnChange){this._lastValueReported=_6e6;this._pendingOnChange=false;if(this._onChangeActive){if(this._onChangeHandle){clearTimeout(this._onChangeHandle);}this._onChangeHandle=setTimeout(_4.hitch(this,function(){this._onChangeHandle=null;this.onChange(_6e6);}),0);}}},create:function(){this.inherited(arguments);this._onChangeActive=true;},destroy:function(){if(this._onChangeHandle){clearTimeout(this._onChangeHandle);this.onChange(this._lastValueReported);}this.inherited(arguments);},setValue:function(_6e8){_4.deprecated("dijit.form._FormWidget:setValue("+_6e8+") is deprecated.  Use set('value',"+_6e8+") instead.","","2.0");this.set("value",_6e8);},getValue:function(){_4.deprecated(this.declaredClass+"::getValue() is deprecated. Use get('value') instead.","","2.0");return this.get("value");},_onMouseDown:function(e){if(!e.ctrlKey&&_4.mouseButtons.isLeft(e)&&this.isFocusable()){var _6e9=this.connect(_4.body(),"onmouseup",function(){if(this.isFocusable()){this.focus();}this.disconnect(_6e9);});}}});_4.declare("dijit.form._FormValueWidget",_5.form._FormWidget,{readOnly:false,attributeMap:_4.delegate(_5.form._FormWidget.prototype.attributeMap,{value:"",readOnly:"focusNode"}),_setReadOnlyAttr:function(_6ea){_4.attr(this.focusNode,"readOnly",_6ea);_5.setWaiState(this.focusNode,"readonly",_6ea);this._set("readOnly",_6ea);},postCreate:function(){this.inherited(arguments);if(_4.isIE<9||(_4.isIE&&_4.isQuirks)){this.connect(this.focusNode||this.domNode,"onkeydown",this._onKeyDown);}if(this._resetValue===undefined){this._lastValueReported=this._resetValue=this.value;}},_setValueAttr:function(_6eb,_6ec){this._handleOnChange(_6eb,_6ec);},_handleOnChange:function(_6ed,_6ee){this._set("value",_6ed);this.inherited(arguments);},undo:function(){this._setValueAttr(this._lastValueReported,false);},reset:function(){this._hasBeenBlurred=false;this._setValueAttr(this._resetValue,true);},_onKeyDown:function(e){if(e.keyCode==_4.keys.ESCAPE&&!(e.ctrlKey||e.altKey||e.metaKey)){var te;if(_4.isIE){e.preventDefault();te=document.createEventObject();te.keyCode=_4.keys.ESCAPE;te.shiftKey=e.shiftKey;e.srcElement.fireEvent("onkeypress",te);}}},_layoutHackIE7:function(){if(_4.isIE==7){var _6ef=this.domNode;var _6f0=_6ef.parentNode;var _6f1=_6ef.firstChild||_6ef;var _6f2=_6f1.style.filter;var _6f3=this;while(_6f0&&_6f0.clientHeight==0){(function ping(){var _6f4=_6f3.connect(_6f0,"onscroll",function(e){_6f3.disconnect(_6f4);_6f1.style.filter=(new Date()).getMilliseconds();setTimeout(function(){_6f1.style.filter=_6f2;},0);});})();_6f0=_6f0.parentNode;}}}});}if(!_4._hasResource["dijit.dijit"]){_4._hasResource["dijit.dijit"]=true;_4.provide("dijit.dijit");}if(!_4._hasResource["dojox.html.metrics"]){_4._hasResource["dojox.html.metrics"]=true;_4.provide("dojox.html.metrics");(function(){var dhm=_6.html.metrics;dhm.getFontMeasurements=function(){var _6f5={"1em":0,"1ex":0,"100%":0,"12pt":0,"16px":0,"xx-small":0,"x-small":0,"small":0,"medium":0,"large":0,"x-large":0,"xx-large":0};if(_4.isIE){_4.doc.documentElement.style.fontSize="100%";}var div=_4.doc.createElement("div");var ds=div.style;ds.position="absolute";ds.left="-100px";ds.top="0";ds.width="30px";ds.height="1000em";ds.borderWidth="0";ds.margin="0";ds.padding="0";ds.outline="0";ds.lineHeight="1";ds.overflow="hidden";_4.body().appendChild(div);for(var p in _6f5){ds.fontSize=p;_6f5[p]=Math.round(div.offsetHeight*12/16)*16/12/1000;}_4.body().removeChild(div);div=null;return _6f5;};var _6f6=null;dhm.getCachedFontMeasurements=function(_6f7){if(_6f7||!_6f6){_6f6=dhm.getFontMeasurements();}return _6f6;};var _6f8=null,_6f9={};dhm.getTextBox=function(text,_6fa,_6fb){var m,s;if(!_6f8){m=_6f8=_4.doc.createElement("div");var c=_4.doc.createElement("div");c.appendChild(m);s=c.style;s.overflow="scroll";s.position="absolute";s.left="0px";s.top="-10000px";s.width="1px";s.height="1px";s.visibility="hidden";s.borderWidth="0";s.margin="0";s.padding="0";s.outline="0";_4.body().appendChild(c);}else{m=_6f8;}m.className="";s=m.style;s.borderWidth="0";s.margin="0";s.padding="0";s.outline="0";if(arguments.length>1&&_6fa){for(var i in _6fa){if(i in _6f9){continue;}s[i]=_6fa[i];}}if(arguments.length>2&&_6fb){m.className=_6fb;}m.innerHTML=text;var box=_4.position(m);box.w=m.parentNode.scrollWidth;return box;};var _6fc={w:16,h:16};dhm.getScrollbar=function(){return {w:_6fc.w,h:_6fc.h};};dhm._fontResizeNode=null;dhm.initOnFontResize=function(_6fd){var f=dhm._fontResizeNode=_4.doc.createElement("iframe");var fs=f.style;fs.position="absolute";fs.width="5em";fs.height="10em";fs.top="-10000px";if(_4.isIE){f.onreadystatechange=function(){if(f.contentWindow.document.readyState=="complete"){f.onresize=f.contentWindow.parent[_6._scopeName].html.metrics._fontresize;}};}else{f.onload=function(){f.contentWindow.onresize=f.contentWindow.parent[_6._scopeName].html.metrics._fontresize;};}f.setAttribute("src","javascript:'<html><head><script>if(\"loadFirebugConsole\" in window){window.loadFirebugConsole();}</script></head><body></body></html>'");_4.body().appendChild(f);dhm.initOnFontResize=function(){};};dhm.onFontResize=function(){};dhm._fontresize=function(){dhm.onFontResize();};_4.addOnUnload(function(){var f=dhm._fontResizeNode;if(f){if(_4.isIE&&f.onresize){f.onresize=null;}else{if(f.contentWindow&&f.contentWindow.onresize){f.contentWindow.onresize=null;}}dhm._fontResizeNode=null;}});_4.addOnLoad(function(){try{var n=_4.doc.createElement("div");n.style.cssText="top:0;left:0;width:100px;height:100px;overflow:scroll;position:absolute;visibility:hidden;";_4.body().appendChild(n);_6fc.w=n.offsetWidth-n.clientWidth;_6fc.h=n.offsetHeight-n.clientHeight;_4.body().removeChild(n);delete n;}catch(e){}if("fontSizeWatch" in _4.config&&!!_4.config.fontSizeWatch){dhm.initOnFontResize();}});})();}if(!_4._hasResource["dojox.grid.util"]){_4._hasResource["dojox.grid.util"]=true;_4.provide("dojox.grid.util");(function(){var dgu=_6.grid.util;dgu.na="...";dgu.rowIndexTag="gridRowIndex";dgu.gridViewTag="gridView";dgu.fire=function(ob,ev,args){var fn=ob&&ev&&ob[ev];return fn&&(args?fn.apply(ob,args):ob[ev]());};dgu.setStyleHeightPx=function(_6fe,_6ff){if(_6ff>=0){var s=_6fe.style;var v=_6ff+"px";if(_6fe&&s["height"]!=v){s["height"]=v;}}};dgu.mouseEvents=["mouseover","mouseout","mousedown","mouseup","click","dblclick","contextmenu"];dgu.keyEvents=["keyup","keydown","keypress"];dgu.funnelEvents=function(_700,_701,_702,_703){var evts=(_703?_703:dgu.mouseEvents.concat(dgu.keyEvents));for(var i=0,l=evts.length;i<l;i++){_701.connect(_700,"on"+evts[i],_702);}};dgu.removeNode=function(_704){_704=_4.byId(_704);_704&&_704.parentNode&&_704.parentNode.removeChild(_704);return _704;};dgu.arrayCompare=function(inA,inB){for(var i=0,l=inA.length;i<l;i++){if(inA[i]!=inB[i]){return false;}}return (inA.length==inB.length);};dgu.arrayInsert=function(_705,_706,_707){if(_705.length<=_706){_705[_706]=_707;}else{_705.splice(_706,0,_707);}};dgu.arrayRemove=function(_708,_709){_708.splice(_709,1);};dgu.arraySwap=function(_70a,inI,inJ){var _70b=_70a[inI];_70a[inI]=_70a[inJ];_70a[inJ]=_70b;};})();}if(!_4._hasResource["dojox.grid._Scroller"]){_4._hasResource["dojox.grid._Scroller"]=true;_4.provide("dojox.grid._Scroller");(function(){var _70c=function(_70d){var i=0,n,p=_70d.parentNode;while((n=p.childNodes[i++])){if(n==_70d){return i-1;}}return -1;};var _70e=function(_70f){if(!_70f){return;}var _710=function(inW){return inW.domNode&&_4.isDescendant(inW.domNode,_70f,true);};var ws=_5.registry.filter(_710);for(var i=0,w;(w=ws[i]);i++){w.destroy();}delete ws;};var _711=function(_712){var node=_4.byId(_712);return (node&&node.tagName?node.tagName.toLowerCase():"");};var _713=function(_714,_715){var _716=[];var i=0,n;while((n=_714.childNodes[i])){i++;if(_711(n)==_715){_716.push(n);}}return _716;};var _717=function(_718){return _713(_718,"div");};_4.declare("dojox.grid._Scroller",null,{constructor:function(_719){this.setContentNodes(_719);this.pageHeights=[];this.pageNodes=[];this.stack=[];},rowCount:0,defaultRowHeight:32,keepRows:100,contentNode:null,scrollboxNode:null,defaultPageHeight:0,keepPages:10,pageCount:0,windowHeight:0,firstVisibleRow:0,lastVisibleRow:0,averageRowHeight:0,page:0,pageTop:0,init:function(_71a,_71b,_71c){switch(arguments.length){case 3:this.rowsPerPage=_71c;case 2:this.keepRows=_71b;case 1:this.rowCount=_71a;default:break;}this.defaultPageHeight=this.defaultRowHeight*this.rowsPerPage;this.pageCount=this._getPageCount(this.rowCount,this.rowsPerPage);this.setKeepInfo(this.keepRows);this.invalidate();if(this.scrollboxNode){this.scrollboxNode.scrollTop=0;this.scroll(0);this.scrollboxNode.onscroll=_4.hitch(this,"onscroll");}},_getPageCount:function(_71d,_71e){return _71d?(Math.ceil(_71d/_71e)||1):0;},destroy:function(){this.invalidateNodes();delete this.contentNodes;delete this.contentNode;delete this.scrollboxNode;},setKeepInfo:function(_71f){this.keepRows=_71f;this.keepPages=!this.keepRows?this.keepPages:Math.max(Math.ceil(this.keepRows/this.rowsPerPage),2);},setContentNodes:function(_720){this.contentNodes=_720;this.colCount=(this.contentNodes?this.contentNodes.length:0);this.pageNodes=[];for(var i=0;i<this.colCount;i++){this.pageNodes[i]=[];}},getDefaultNodes:function(){return this.pageNodes[0]||[];},invalidate:function(){this._invalidating=true;this.invalidateNodes();this.pageHeights=[];this.height=(this.pageCount?(this.pageCount-1)*this.defaultPageHeight+this.calcLastPageHeight():0);this.resize();this._invalidating=false;},updateRowCount:function(_721){this.invalidateNodes();this.rowCount=_721;var _722=this.pageCount;if(_722===0){this.height=1;}this.pageCount=this._getPageCount(this.rowCount,this.rowsPerPage);if(this.pageCount<_722){for(var i=_722-1;i>=this.pageCount;i--){this.height-=this.getPageHeight(i);delete this.pageHeights[i];}}else{if(this.pageCount>_722){this.height+=this.defaultPageHeight*(this.pageCount-_722-1)+this.calcLastPageHeight();}}this.resize();},pageExists:function(_723){return Boolean(this.getDefaultPageNode(_723));},measurePage:function(_724){if(this.grid.rowHeight){var _725=this.grid.rowHeight+1;return ((_724+1)*this.rowsPerPage>this.rowCount?this.rowCount-_724*this.rowsPerPage:this.rowsPerPage)*_725;}var n=this.getDefaultPageNode(_724);return (n&&n.innerHTML)?n.offsetHeight:undefined;},positionPage:function(_726,_727){for(var i=0;i<this.colCount;i++){this.pageNodes[i][_726].style.top=_727+"px";}},repositionPages:function(_728){var _729=this.getDefaultNodes();var last=0;for(var i=0;i<this.stack.length;i++){last=Math.max(this.stack[i],last);}var n=_729[_728];var y=(n?this.getPageNodePosition(n)+this.getPageHeight(_728):0);for(var p=_728+1;p<=last;p++){n=_729[p];if(n){if(this.getPageNodePosition(n)==y){return;}this.positionPage(p,y);}y+=this.getPageHeight(p);}},installPage:function(_72a){for(var i=0;i<this.colCount;i++){this.contentNodes[i].appendChild(this.pageNodes[i][_72a]);}},preparePage:function(_72b,_72c){var p=(_72c?this.popPage():null);for(var i=0;i<this.colCount;i++){var _72d=this.pageNodes[i];var _72e=(p===null?this.createPageNode():this.invalidatePageNode(p,_72d));_72e.pageIndex=_72b;_72d[_72b]=_72e;}},renderPage:function(_72f){var _730=[];var i,j;for(i=0;i<this.colCount;i++){_730[i]=this.pageNodes[i][_72f];}for(i=0,j=_72f*this.rowsPerPage;(i<this.rowsPerPage)&&(j<this.rowCount);i++,j++){this.renderRow(j,_730);}},removePage:function(_731){for(var i=0,j=_731*this.rowsPerPage;i<this.rowsPerPage;i++,j++){this.removeRow(j);}},destroyPage:function(_732){for(var i=0;i<this.colCount;i++){var n=this.invalidatePageNode(_732,this.pageNodes[i]);if(n){_4.destroy(n);}}},pacify:function(_733){},pacifying:false,pacifyTicks:200,setPacifying:function(_734){if(this.pacifying!=_734){this.pacifying=_734;this.pacify(this.pacifying);}},startPacify:function(){this.startPacifyTicks=new Date().getTime();},doPacify:function(){var _735=(new Date().getTime()-this.startPacifyTicks)>this.pacifyTicks;this.setPacifying(true);this.startPacify();return _735;},endPacify:function(){this.setPacifying(false);},resize:function(){if(this.scrollboxNode){this.windowHeight=this.scrollboxNode.clientHeight;}for(var i=0;i<this.colCount;i++){_6.grid.util.setStyleHeightPx(this.contentNodes[i],Math.max(1,this.height));}var _736=(!this._invalidating);if(!_736){var ah=this.grid.get("autoHeight");if(typeof ah=="number"&&ah<=Math.min(this.rowsPerPage,this.rowCount)){_736=true;}}if(_736){this.needPage(this.page,this.pageTop);}var _737=(this.page<this.pageCount-1)?this.rowsPerPage:((this.rowCount%this.rowsPerPage)||this.rowsPerPage);var _738=this.getPageHeight(this.page);this.averageRowHeight=(_738>0&&_737>0)?(_738/_737):0;},calcLastPageHeight:function(){if(!this.pageCount){return 0;}var _739=this.pageCount-1;var _73a=((this.rowCount%this.rowsPerPage)||(this.rowsPerPage))*this.defaultRowHeight;this.pageHeights[_739]=_73a;return _73a;},updateContentHeight:function(inDh){this.height+=inDh;this.resize();},updatePageHeight:function(_73b,_73c,_73d){if(this.pageExists(_73b)){var oh=this.getPageHeight(_73b);var h=(this.measurePage(_73b));if(h===undefined){h=oh;}this.pageHeights[_73b]=h;if(oh!=h){this.updateContentHeight(h-oh);var ah=this.grid.get("autoHeight");if((typeof ah=="number"&&ah>this.rowCount)||(ah===true&&!_73c)){if(!_73d){this.grid.sizeChange();}else{var ns=this.grid.viewsNode.style;ns.height=parseInt(ns.height)+h-oh+"px";this.repositionPages(_73b);}}else{this.repositionPages(_73b);}}return h;}return 0;},rowHeightChanged:function(_73e,_73f){this.updatePageHeight(Math.floor(_73e/this.rowsPerPage),false,_73f);},invalidateNodes:function(){while(this.stack.length){this.destroyPage(this.popPage());}},createPageNode:function(){var p=document.createElement("div");_4.attr(p,"role","presentation");p.style.position="absolute";p.style[_4._isBodyLtr()?"left":"right"]="0";return p;},getPageHeight:function(_740){var ph=this.pageHeights[_740];return (ph!==undefined?ph:this.defaultPageHeight);},pushPage:function(_741){return this.stack.push(_741);},popPage:function(){return this.stack.shift();},findPage:function(_742){var i=0,h=0;for(var ph=0;i<this.pageCount;i++,h+=ph){ph=this.getPageHeight(i);if(h+ph>=_742){break;}}this.page=i;this.pageTop=h;},buildPage:function(_743,_744,_745){this.preparePage(_743,_744);this.positionPage(_743,_745);this.installPage(_743);this.renderPage(_743);this.pushPage(_743);},needPage:function(_746,_747){var h=this.getPageHeight(_746),oh=h;if(!this.pageExists(_746)){this.buildPage(_746,(!this.grid._autoHeight&&this.keepPages&&(this.stack.length>=this.keepPages)),_747);h=this.updatePageHeight(_746,true);}else{this.positionPage(_746,_747);}return h;},onscroll:function(){this.scroll(this.scrollboxNode.scrollTop);},scroll:function(_748){this.grid.scrollTop=_748;if(this.colCount){this.startPacify();this.findPage(_748);var h=this.height;var b=this.getScrollBottom(_748);for(var p=this.page,y=this.pageTop;(p<this.pageCount)&&((b<0)||(y<b));p++){y+=this.needPage(p,y);}this.firstVisibleRow=this.getFirstVisibleRow(this.page,this.pageTop,_748);this.lastVisibleRow=this.getLastVisibleRow(p-1,y,b);if(h!=this.height){this.repositionPages(p-1);}this.endPacify();}},getScrollBottom:function(_749){return (this.windowHeight>=0?_749+this.windowHeight:-1);},processNodeEvent:function(e,_74a){var t=e.target;while(t&&(t!=_74a)&&t.parentNode&&(t.parentNode.parentNode!=_74a)){t=t.parentNode;}if(!t||!t.parentNode||(t.parentNode.parentNode!=_74a)){return false;}var page=t.parentNode;e.topRowIndex=page.pageIndex*this.rowsPerPage;e.rowIndex=e.topRowIndex+_70c(t);e.rowTarget=t;return true;},processEvent:function(e){return this.processNodeEvent(e,this.contentNode);},renderRow:function(_74b,_74c){},removeRow:function(_74d){},getDefaultPageNode:function(_74e){return this.getDefaultNodes()[_74e];},positionPageNode:function(_74f,_750){},getPageNodePosition:function(_751){return _751.offsetTop;},invalidatePageNode:function(_752,_753){var p=_753[_752];if(p){delete _753[_752];this.removePage(_752,p);_70e(p);p.innerHTML="";}return p;},getPageRow:function(_754){return _754*this.rowsPerPage;},getLastPageRow:function(_755){return Math.min(this.rowCount,this.getPageRow(_755+1))-1;},getFirstVisibleRow:function(_756,_757,_758){if(!this.pageExists(_756)){return 0;}var row=this.getPageRow(_756);var _759=this.getDefaultNodes();var rows=_717(_759[_756]);for(var i=0,l=rows.length;i<l&&_757<_758;i++,row++){_757+=rows[i].offsetHeight;}return (row?row-1:row);},getLastVisibleRow:function(_75a,_75b,_75c){if(!this.pageExists(_75a)){return 0;}var _75d=this.getDefaultNodes();var row=this.getLastPageRow(_75a);var rows=_717(_75d[_75a]);for(var i=rows.length-1;i>=0&&_75b>_75c;i--,row--){_75b-=rows[i].offsetHeight;}return row+1;},findTopRow:function(_75e){var _75f=this.getDefaultNodes();var rows=_717(_75f[this.page]);for(var i=0,l=rows.length,t=this.pageTop,h;i<l;i++){h=rows[i].offsetHeight;t+=h;if(t>=_75e){this.offset=h-(t-_75e);return i+this.page*this.rowsPerPage;}}return -1;},findScrollTop:function(_760){var _761=Math.floor(_760/this.rowsPerPage);var t=0;var i,l;for(i=0;i<_761;i++){t+=this.getPageHeight(i);}this.pageTop=t;this.page=_761;this.needPage(_761,this.pageTop);var _762=this.getDefaultNodes();var rows=_717(_762[_761]);var r=_760-this.rowsPerPage*_761;for(i=0,l=rows.length;i<l&&i<r;i++){t+=rows[i].offsetHeight;}return t;},dummy:0});})();}if(!_4._hasResource["dojox.grid.cells._base"]){_4._hasResource["dojox.grid.cells._base"]=true;_4.provide("dojox.grid.cells._base");_4.declare("dojox.grid._DeferredTextWidget",_5._Widget,{deferred:null,_destroyOnRemove:true,postCreate:function(){if(this.deferred){this.deferred.addBoth(_4.hitch(this,function(text){if(this.domNode){this.domNode.innerHTML=text;}}));}}});(function(){var _763=function(_764){try{_6.grid.util.fire(_764,"focus");_6.grid.util.fire(_764,"select");}catch(e){}};var _765=function(){setTimeout(_4.hitch.apply(_4,arguments),0);};var dgc=_6.grid.cells;_4.declare("dojox.grid.cells._Base",null,{styles:"",classes:"",editable:false,alwaysEditing:false,formatter:null,defaultValue:"...",value:null,hidden:false,noresize:false,draggable:true,_valueProp:"value",_formatPending:false,constructor:function(_766){this._props=_766||{};_4.mixin(this,_766);if(this.draggable===undefined){this.draggable=true;}},_defaultFormat:function(_767,_768){var s=this.grid.formatterScope||this;var f=this.formatter;if(f&&s&&typeof f=="string"){f=this.formatter=s[f];}var v=(_767!=this.defaultValue&&f)?f.apply(s,_768):_767;if(typeof v=="undefined"){return this.defaultValue;}if(v&&v.addBoth){v=new _6.grid._DeferredTextWidget({deferred:v},_4.create("span",{innerHTML:this.defaultValue}));}if(v&&v.declaredClass&&v.startup){return "<div class='dojoxGridStubNode' linkWidget='"+v.id+"' cellIdx='"+this.index+"'>"+this.defaultValue+"</div>";}return v;},format:function(_769,_76a){var f,i=this.grid.edit.info,d=this.get?this.get(_769,_76a):(this.value||this.defaultValue);d=(d&&d.replace&&this.grid.escapeHTMLInData)?d.replace(/&(?![a-z0-9]{1,8}\;)/ig,"&amp;").replace(/</g,"&lt;"):d;if(this.editable&&(this.alwaysEditing||(i.rowIndex==_769&&i.cell==this))){return this.formatEditing(d,_769);}else{return this._defaultFormat(d,[d,_769,this]);}},formatEditing:function(_76b,_76c){},getNode:function(_76d){return this.view.getCellNode(_76d,this.index);},getHeaderNode:function(){return this.view.getHeaderCellNode(this.index);},getEditNode:function(_76e){return (this.getNode(_76e)||0).firstChild||0;},canResize:function(){var uw=this.unitWidth;return uw&&(uw!=="auto");},isFlex:function(){var uw=this.unitWidth;return uw&&_4.isString(uw)&&(uw=="auto"||uw.slice(-1)=="%");},applyEdit:function(_76f,_770){this.grid.edit.applyCellEdit(_76f,this,_770);},cancelEdit:function(_771){this.grid.doCancelEdit(_771);},_onEditBlur:function(_772){if(this.grid.edit.isEditCell(_772,this.index)){this.grid.edit.apply();}},registerOnBlur:function(_773,_774){if(this.commitOnBlur){_4.connect(_773,"onblur",function(e){setTimeout(_4.hitch(this,"_onEditBlur",_774),250);});}},needFormatNode:function(_775,_776){this._formatPending=true;_765(this,"_formatNode",_775,_776);},cancelFormatNode:function(){this._formatPending=false;},_formatNode:function(_777,_778){if(this._formatPending){this._formatPending=false;_4.setSelectable(this.grid.domNode,true);this.formatNode(this.getEditNode(_778),_777,_778);}},formatNode:function(_779,_77a,_77b){if(_4.isIE){_765(this,"focus",_77b,_779);}else{this.focus(_77b,_779);}},dispatchEvent:function(m,e){if(m in this){return this[m](e);}},getValue:function(_77c){return this.getEditNode(_77c)[this._valueProp];},setValue:function(_77d,_77e){var n=this.getEditNode(_77d);if(n){n[this._valueProp]=_77e;}},focus:function(_77f,_780){_763(_780||this.getEditNode(_77f));},save:function(_781){this.value=this.value||this.getValue(_781);},restore:function(_782){this.setValue(_782,this.value);},_finish:function(_783){_4.setSelectable(this.grid.domNode,false);this.cancelFormatNode();},apply:function(_784){this.applyEdit(this.getValue(_784),_784);this._finish(_784);},cancel:function(_785){this.cancelEdit(_785);this._finish(_785);}});dgc._Base.markupFactory=function(node,_786){var d=_4;var _787=d.trim(d.attr(node,"formatter")||"");if(_787){_786.formatter=_4.getObject(_787)||_787;}var get=d.trim(d.attr(node,"get")||"");if(get){_786.get=_4.getObject(get);}var _788=function(attr,cell,_789){var _78a=d.trim(d.attr(node,attr)||"");if(_78a){cell[_789||attr]=!(_78a.toLowerCase()=="false");}};_788("sortDesc",_786);_788("editable",_786);_788("alwaysEditing",_786);_788("noresize",_786);_788("draggable",_786);var _78b=d.trim(d.attr(node,"loadingText")||d.attr(node,"defaultValue")||"");if(_78b){_786.defaultValue=_78b;}var _78c=function(attr,cell,_78d){var _78e=d.trim(d.attr(node,attr)||"")||undefined;if(_78e){cell[_78d||attr]=_78e;}};_78c("styles",_786);_78c("headerStyles",_786);_78c("cellStyles",_786);_78c("classes",_786);_78c("headerClasses",_786);_78c("cellClasses",_786);};_4.declare("dojox.grid.cells.Cell",dgc._Base,{constructor:function(){this.keyFilter=this.keyFilter;},keyFilter:null,formatEditing:function(_78f,_790){this.needFormatNode(_78f,_790);return "<input class=\"dojoxGridInput\" type=\"text\" value=\""+_78f+"\">";},formatNode:function(_791,_792,_793){this.inherited(arguments);this.registerOnBlur(_791,_793);},doKey:function(e){if(this.keyFilter){var key=String.fromCharCode(e.charCode);if(key.search(this.keyFilter)==-1){_4.stopEvent(e);}}},_finish:function(_794){this.inherited(arguments);var n=this.getEditNode(_794);try{_6.grid.util.fire(n,"blur");}catch(e){}}});dgc.Cell.markupFactory=function(node,_795){dgc._Base.markupFactory(node,_795);var d=_4;var _796=d.trim(d.attr(node,"keyFilter")||"");if(_796){_795.keyFilter=new RegExp(_796);}};_4.declare("dojox.grid.cells.RowIndex",dgc.Cell,{name:"Row",postscript:function(){this.editable=false;},get:function(_797){return _797+1;}});dgc.RowIndex.markupFactory=function(node,_798){dgc.Cell.markupFactory(node,_798);};_4.declare("dojox.grid.cells.Select",dgc.Cell,{options:null,values:null,returnIndex:-1,constructor:function(_799){this.values=this.values||this.options;},formatEditing:function(_79a,_79b){this.needFormatNode(_79a,_79b);var h=["<select class=\"dojoxGridSelect\">"];for(var i=0,o,v;((o=this.options[i])!==undefined)&&((v=this.values[i])!==undefined);i++){h.push("<option",(_79a==v?" selected":"")," value=\""+v+"\"",">",o,"</option>");}h.push("</select>");return h.join("");},getValue:function(_79c){var n=this.getEditNode(_79c);if(n){var i=n.selectedIndex,o=n.options[i];return this.returnIndex>-1?i:o.value||o.innerHTML;}}});dgc.Select.markupFactory=function(node,cell){dgc.Cell.markupFactory(node,cell);var d=_4;var _79d=d.trim(d.attr(node,"options")||"");if(_79d){var o=_79d.split(",");if(o[0]!=_79d){cell.options=o;}}var _79e=d.trim(d.attr(node,"values")||"");if(_79e){var v=_79e.split(",");if(v[0]!=_79e){cell.values=v;}}};_4.declare("dojox.grid.cells.AlwaysEdit",dgc.Cell,{alwaysEditing:true,_formatNode:function(_79f,_7a0){this.formatNode(this.getEditNode(_7a0),_79f,_7a0);},applyStaticValue:function(_7a1){var e=this.grid.edit;e.applyCellEdit(this.getValue(_7a1),this,_7a1);e.start(this,_7a1,true);}});dgc.AlwaysEdit.markupFactory=function(node,cell){dgc.Cell.markupFactory(node,cell);};_4.declare("dojox.grid.cells.Bool",dgc.AlwaysEdit,{_valueProp:"checked",formatEditing:function(_7a2,_7a3){return "<input class=\"dojoxGridInput\" type=\"checkbox\""+(_7a2?" checked=\"checked\"":"")+" style=\"width: auto\" />";},doclick:function(e){if(e.target.tagName=="INPUT"){this.applyStaticValue(e.rowIndex);}}});dgc.Bool.markupFactory=function(node,cell){dgc.AlwaysEdit.markupFactory(node,cell);};})();}if(!_4._hasResource["dojox.grid.cells"]){_4._hasResource["dojox.grid.cells"]=true;_4.provide("dojox.grid.cells");}if(!_4._hasResource["dojo.dnd.common"]){_4._hasResource["dojo.dnd.common"]=true;_4.provide("dojo.dnd.common");_4.getObject("dnd",true,_4);_4.dnd.getCopyKeyState=_4.isCopyKey;_4.dnd._uniqueId=0;_4.dnd.getUniqueId=function(){var id;do{id=_4._scopeName+"Unique"+(++_4.dnd._uniqueId);}while(_4.byId(id));return id;};_4.dnd._empty={};_4.dnd.isFormElement=function(e){var t=e.target;if(t.nodeType==3){t=t.parentNode;}return " button textarea input select option ".indexOf(" "+t.tagName.toLowerCase()+" ")>=0;};}if(!_4._hasResource["dojo.dnd.autoscroll"]){_4._hasResource["dojo.dnd.autoscroll"]=true;_4.provide("dojo.dnd.autoscroll");_4.getObject("dnd",true,_4);_4.dnd.getViewport=_4.window.getBox;_4.dnd.V_TRIGGER_AUTOSCROLL=32;_4.dnd.H_TRIGGER_AUTOSCROLL=32;_4.dnd.V_AUTOSCROLL_VALUE=16;_4.dnd.H_AUTOSCROLL_VALUE=16;_4.dnd.autoScroll=function(e){var v=_4.window.getBox(),dx=0,dy=0;if(e.clientX<_4.dnd.H_TRIGGER_AUTOSCROLL){dx=-_4.dnd.H_AUTOSCROLL_VALUE;}else{if(e.clientX>v.w-_4.dnd.H_TRIGGER_AUTOSCROLL){dx=_4.dnd.H_AUTOSCROLL_VALUE;}}if(e.clientY<_4.dnd.V_TRIGGER_AUTOSCROLL){dy=-_4.dnd.V_AUTOSCROLL_VALUE;}else{if(e.clientY>v.h-_4.dnd.V_TRIGGER_AUTOSCROLL){dy=_4.dnd.V_AUTOSCROLL_VALUE;}}window.scrollBy(dx,dy);};_4.dnd._validNodes={"div":1,"p":1,"td":1};_4.dnd._validOverflow={"auto":1,"scroll":1};_4.dnd.autoScrollNodes=function(e){for(var n=e.target;n;){if(n.nodeType==1&&(n.tagName.toLowerCase() in _4.dnd._validNodes)){var s=_4.getComputedStyle(n);if(s.overflow.toLowerCase() in _4.dnd._validOverflow){var b=_4._getContentBox(n,s),t=_4.position(n,true);var w=Math.min(_4.dnd.H_TRIGGER_AUTOSCROLL,b.w/2),h=Math.min(_4.dnd.V_TRIGGER_AUTOSCROLL,b.h/2),rx=e.pageX-t.x,ry=e.pageY-t.y,dx=0,dy=0;if(_4.isWebKit||_4.isOpera){rx+=_4.body().scrollLeft;ry+=_4.body().scrollTop;}if(rx>0&&rx<b.w){if(rx<w){dx=-w;}else{if(rx>b.w-w){dx=w;}}}if(ry>0&&ry<b.h){if(ry<h){dy=-h;}else{if(ry>b.h-h){dy=h;}}}var _7a4=n.scrollLeft,_7a5=n.scrollTop;n.scrollLeft=n.scrollLeft+dx;n.scrollTop=n.scrollTop+dy;if(_7a4!=n.scrollLeft||_7a5!=n.scrollTop){return;}}}try{n=n.parentNode;}catch(x){n=null;}}_4.dnd.autoScroll(e);};}if(!_4._hasResource["dojo.dnd.Mover"]){_4._hasResource["dojo.dnd.Mover"]=true;_4.provide("dojo.dnd.Mover");_4.declare("dojo.dnd.Mover",null,{constructor:function(node,e,host){this.node=_4.byId(node);var pos=e.touches?e.touches[0]:e;this.marginBox={l:pos.pageX,t:pos.pageY};this.mouseButton=e.button;var h=(this.host=host),d=node.ownerDocument;this.events=[_4.connect(d,"onmousemove",this,"onFirstMove"),_4.connect(d,"ontouchmove",this,"onFirstMove"),_4.connect(d,"onmousemove",this,"onMouseMove"),_4.connect(d,"ontouchmove",this,"onMouseMove"),_4.connect(d,"onmouseup",this,"onMouseUp"),_4.connect(d,"ontouchend",this,"onMouseUp"),_4.connect(d,"ondragstart",_4.stopEvent),_4.connect(d.body,"onselectstart",_4.stopEvent)];if(h&&h.onMoveStart){h.onMoveStart(this);}},onMouseMove:function(e){_4.dnd.autoScroll(e);var m=this.marginBox,pos=e.touches?e.touches[0]:e;this.host.onMove(this,{l:m.l+pos.pageX,t:m.t+pos.pageY},e);_4.stopEvent(e);},onMouseUp:function(e){if(_4.isWebKit&&_4.isMac&&this.mouseButton==2?e.button==0:this.mouseButton==e.button){this.destroy();}_4.stopEvent(e);},onFirstMove:function(e){var s=this.node.style,l,t,h=this.host;switch(s.position){case "relative":case "absolute":l=Math.round(parseFloat(s.left))||0;t=Math.round(parseFloat(s.top))||0;break;default:s.position="absolute";var m=_4.marginBox(this.node);var b=_4.doc.body;var bs=_4.getComputedStyle(b);var bm=_4._getMarginBox(b,bs);var bc=_4._getContentBox(b,bs);l=m.l-(bc.l-bm.l);t=m.t-(bc.t-bm.t);break;}this.marginBox.l=l-this.marginBox.l;this.marginBox.t=t-this.marginBox.t;if(h&&h.onFirstMove){h.onFirstMove(this,e);}_4.disconnect(this.events.shift());_4.disconnect(this.events.shift());},destroy:function(){_4.forEach(this.events,_4.disconnect);var h=this.host;if(h&&h.onMoveStop){h.onMoveStop(this);}this.events=this.node=this.host=null;}});}if(!_4._hasResource["dojo.dnd.Moveable"]){_4._hasResource["dojo.dnd.Moveable"]=true;_4.provide("dojo.dnd.Moveable");_4.declare("dojo.dnd.Moveable",null,{handle:"",delay:0,skip:false,constructor:function(node,_7a6){this.node=_4.byId(node);if(!_7a6){_7a6={};}this.handle=_7a6.handle?_4.byId(_7a6.handle):null;if(!this.handle){this.handle=this.node;}this.delay=_7a6.delay>0?_7a6.delay:0;this.skip=_7a6.skip;this.mover=_7a6.mover?_7a6.mover:_4.dnd.Mover;this.events=[_4.connect(this.handle,"onmousedown",this,"onMouseDown"),_4.connect(this.handle,"ontouchstart",this,"onMouseDown"),_4.connect(this.handle,"ondragstart",this,"onSelectStart"),_4.connect(this.handle,"onselectstart",this,"onSelectStart")];},markupFactory:function(_7a7,node){return new _4.dnd.Moveable(node,_7a7);},destroy:function(){_4.forEach(this.events,_4.disconnect);this.events=this.node=this.handle=null;},onMouseDown:function(e){if(this.skip&&_4.dnd.isFormElement(e)){return;}if(this.delay){this.events.push(_4.connect(this.handle,"onmousemove",this,"onMouseMove"),_4.connect(this.handle,"ontouchmove",this,"onMouseMove"),_4.connect(this.handle,"onmouseup",this,"onMouseUp"),_4.connect(this.handle,"ontouchend",this,"onMouseUp"));var pos=e.touches?e.touches[0]:e;this._lastX=pos.pageX;this._lastY=pos.pageY;}else{this.onDragDetected(e);}_4.stopEvent(e);},onMouseMove:function(e){var pos=e.touches?e.touches[0]:e;if(Math.abs(pos.pageX-this._lastX)>this.delay||Math.abs(pos.pageY-this._lastY)>this.delay){this.onMouseUp(e);this.onDragDetected(e);}_4.stopEvent(e);},onMouseUp:function(e){for(var i=0;i<2;++i){_4.disconnect(this.events.pop());}_4.stopEvent(e);},onSelectStart:function(e){if(!this.skip||!_4.dnd.isFormElement(e)){_4.stopEvent(e);}},onDragDetected:function(e){new this.mover(this.node,e,this);},onMoveStart:function(_7a8){_4.publish("/dnd/move/start",[_7a8]);_4.addClass(_4.body(),"dojoMove");_4.addClass(this.node,"dojoMoveItem");},onMoveStop:function(_7a9){_4.publish("/dnd/move/stop",[_7a9]);_4.removeClass(_4.body(),"dojoMove");_4.removeClass(this.node,"dojoMoveItem");},onFirstMove:function(_7aa,e){},onMove:function(_7ab,_7ac,e){this.onMoving(_7ab,_7ac);var s=_7ab.node.style;s.left=_7ac.l+"px";s.top=_7ac.t+"px";this.onMoved(_7ab,_7ac);},onMoving:function(_7ad,_7ae){},onMoved:function(_7af,_7b0){}});}if(!_4._hasResource["dojox.grid._Builder"]){_4._hasResource["dojox.grid._Builder"]=true;_4.provide("dojox.grid._Builder");(function(){var dg=_6.grid;var _7b1=function(td){return td.cellIndex>=0?td.cellIndex:_4.indexOf(td.parentNode.cells,td);};var _7b2=function(tr){return tr.rowIndex>=0?tr.rowIndex:_4.indexOf(tr.parentNode.childNodes,tr);};var _7b3=function(_7b4,_7b5){return _7b4&&((_7b4.rows||0)[_7b5]||_7b4.childNodes[_7b5]);};var _7b6=function(node){for(var n=node;n&&n.tagName!="TABLE";n=n.parentNode){}return n;};var _7b7=function(_7b8,_7b9){for(var n=_7b8;n&&_7b9(n);n=n.parentNode){}return n;};var _7ba=function(_7bb){var name=_7bb.toUpperCase();return function(node){return node.tagName!=name;};};var _7bc=_6.grid.util.rowIndexTag;var _7bd=_6.grid.util.gridViewTag;dg._Builder=_4.extend(function(view){if(view){this.view=view;this.grid=view.grid;}},{view:null,_table:"<table class=\"dojoxGridRowTable\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" role=\"presentation\"",getTableArray:function(){var html=[this._table];if(this.view.viewWidth){html.push([" style=\"width:",this.view.viewWidth,";\""].join(""));}html.push(">");return html;},generateCellMarkup:function(_7be,_7bf,_7c0,_7c1){var _7c2=[],html;if(_7c1){var _7c3=_7be.index!=_7be.grid.getSortIndex()?"":_7be.grid.sortInfo>0?"aria-sort=\"ascending\"":"aria-sort=\"descending\"";if(!_7be.id){_7be.id=this.grid.id+"Hdr"+_7be.index;}html=["<th tabIndex=\"-1\" aria-readonly=\"true\" role=\"columnheader\"",_7c3,"id=\"",_7be.id,"\""];}else{var _7c4=this.grid.editable&&!_7be.editable?"aria-readonly=\"true\"":"";html=["<td tabIndex=\"-1\" role=\"gridcell\"",_7c4];}if(_7be.colSpan){html.push(" colspan=\"",_7be.colSpan,"\"");}if(_7be.rowSpan){html.push(" rowspan=\"",_7be.rowSpan,"\"");}html.push(" class=\"dojoxGridCell ");if(_7be.classes){html.push(_7be.classes," ");}if(_7c0){html.push(_7c0," ");}_7c2.push(html.join(""));_7c2.push("");html=["\" idx=\"",_7be.index,"\" style=\""];if(_7bf&&_7bf[_7bf.length-1]!=";"){_7bf+=";";}html.push(_7be.styles,_7bf||"",_7be.hidden?"display:none;":"");if(_7be.unitWidth){html.push("width:",_7be.unitWidth,";");}_7c2.push(html.join(""));_7c2.push("");html=["\""];if(_7be.attrs){html.push(" ",_7be.attrs);}html.push(">");_7c2.push(html.join(""));_7c2.push("");_7c2.push(_7c1?"</th>":"</td>");return _7c2;},isCellNode:function(_7c5){return Boolean(_7c5&&_7c5!=_4.doc&&_4.attr(_7c5,"idx"));},getCellNodeIndex:function(_7c6){return _7c6?Number(_4.attr(_7c6,"idx")):-1;},getCellNode:function(_7c7,_7c8){for(var i=0,row;((row=_7b3(_7c7.firstChild,i))&&row.cells);i++){for(var j=0,cell;(cell=row.cells[j]);j++){if(this.getCellNodeIndex(cell)==_7c8){return cell;}}}return null;},findCellTarget:function(_7c9,_7ca){var n=_7c9;while(n&&(!this.isCellNode(n)||(n.offsetParent&&_7bd in n.offsetParent.parentNode&&n.offsetParent.parentNode[_7bd]!=this.view.id))&&(n!=_7ca)){n=n.parentNode;}return n!=_7ca?n:null;},baseDecorateEvent:function(e){e.dispatch="do"+e.type;e.grid=this.grid;e.sourceView=this.view;e.cellNode=this.findCellTarget(e.target,e.rowNode);e.cellIndex=this.getCellNodeIndex(e.cellNode);e.cell=(e.cellIndex>=0?this.grid.getCell(e.cellIndex):null);},findTarget:function(_7cb,_7cc){var n=_7cb;while(n&&(n!=this.domNode)&&(!(_7cc in n)||(_7bd in n&&n[_7bd]!=this.view.id))){n=n.parentNode;}return (n!=this.domNode)?n:null;},findRowTarget:function(_7cd){return this.findTarget(_7cd,_7bc);},isIntraNodeEvent:function(e){try{return (e.cellNode&&e.relatedTarget&&_4.isDescendant(e.relatedTarget,e.cellNode));}catch(x){return false;}},isIntraRowEvent:function(e){try{var row=e.relatedTarget&&this.findRowTarget(e.relatedTarget);return !row&&(e.rowIndex==-1)||row&&(e.rowIndex==row.gridRowIndex);}catch(x){return false;}},dispatchEvent:function(e){if(e.dispatch in this){return this[e.dispatch](e);}return false;},domouseover:function(e){if(e.cellNode&&(e.cellNode!=this.lastOverCellNode)){this.lastOverCellNode=e.cellNode;this.grid.onMouseOver(e);}this.grid.onMouseOverRow(e);},domouseout:function(e){if(e.cellNode&&(e.cellNode==this.lastOverCellNode)&&!this.isIntraNodeEvent(e,this.lastOverCellNode)){this.lastOverCellNode=null;this.grid.onMouseOut(e);if(!this.isIntraRowEvent(e)){this.grid.onMouseOutRow(e);}}},domousedown:function(e){if(e.cellNode){this.grid.onMouseDown(e);}this.grid.onMouseDownRow(e);}});dg._ContentBuilder=_4.extend(function(view){dg._Builder.call(this,view);},dg._Builder.prototype,{update:function(){this.prepareHtml();},prepareHtml:function(){var _7ce=this.grid.get,_7cf=this.view.structure.cells;for(var j=0,row;(row=_7cf[j]);j++){for(var i=0,cell;(cell=row[i]);i++){cell.get=cell.get||(cell.value==undefined)&&_7ce;cell.markup=this.generateCellMarkup(cell,cell.cellStyles,cell.cellClasses,false);if(!this.grid.editable&&cell.editable){this.grid.editable=true;}}}},generateHtml:function(_7d0,_7d1){var html=this.getTableArray(),v=this.view,_7d2=v.structure.cells,item=this.grid.getItem(_7d1);_6.grid.util.fire(this.view,"onBeforeRow",[_7d1,_7d2]);for(var j=0,row;(row=_7d2[j]);j++){if(row.hidden||row.header){continue;}html.push(!row.invisible?"<tr>":"<tr class=\"dojoxGridInvisible\">");for(var i=0,cell,m,cc,cs;(cell=row[i]);i++){m=cell.markup;cc=cell.customClasses=[];cs=cell.customStyles=[];m[5]=cell.format(_7d1,item);m[1]=cc.join(" ");m[3]=cs.join(";");html.push.apply(html,m);}html.push("</tr>");}html.push("</table>");return html.join("");},decorateEvent:function(e){e.rowNode=this.findRowTarget(e.target);if(!e.rowNode){return false;}e.rowIndex=e.rowNode[_7bc];this.baseDecorateEvent(e);e.cell=this.grid.getCell(e.cellIndex);return true;}});dg._HeaderBuilder=_4.extend(function(view){this.moveable=null;dg._Builder.call(this,view);},dg._Builder.prototype,{_skipBogusClicks:false,overResizeWidth:4,minColWidth:1,update:function(){if(this.tableMap){this.tableMap.mapRows(this.view.structure.cells);}else{this.tableMap=new dg._TableMap(this.view.structure.cells);}},generateHtml:function(_7d3,_7d4){var html=this.getTableArray(),_7d5=this.view.structure.cells;_6.grid.util.fire(this.view,"onBeforeRow",[-1,_7d5]);for(var j=0,row;(row=_7d5[j]);j++){if(row.hidden){continue;}html.push(!row.invisible?"<tr>":"<tr class=\"dojoxGridInvisible\">");for(var i=0,cell,_7d6;(cell=row[i]);i++){cell.customClasses=[];cell.customStyles=[];if(this.view.simpleStructure){if(cell.draggable){if(cell.headerClasses){if(cell.headerClasses.indexOf("dojoDndItem")==-1){cell.headerClasses+=" dojoDndItem";}}else{cell.headerClasses="dojoDndItem";}}if(cell.attrs){if(cell.attrs.indexOf("dndType='gridColumn_")==-1){cell.attrs+=" dndType='gridColumn_"+this.grid.id+"'";}}else{cell.attrs="dndType='gridColumn_"+this.grid.id+"'";}}_7d6=this.generateCellMarkup(cell,cell.headerStyles,cell.headerClasses,true);_7d6[5]=(_7d4!=undefined?_7d4:_7d3(cell));_7d6[3]=cell.customStyles.join(";");_7d6[1]=cell.customClasses.join(" ");html.push(_7d6.join(""));}html.push("</tr>");}html.push("</table>");return html.join("");},getCellX:function(e){var n,x=e.layerX;if(_4.isMoz||_4.isIE>=9){n=_7b7(e.target,_7ba("th"));x-=(n&&n.offsetLeft)||0;var t=e.sourceView.getScrollbarWidth();if(!_4._isBodyLtr()){table=_7b7(n,_7ba("table"));x-=(table&&table.offsetLeft)||0;}}n=_7b7(e.target,function(){if(!n||n==e.cellNode){return false;}x+=(n.offsetLeft<0?0:n.offsetLeft);return true;});return x;},decorateEvent:function(e){this.baseDecorateEvent(e);e.rowIndex=-1;e.cellX=this.getCellX(e);return true;},prepareResize:function(e,mod){do{var i=_7b1(e.cellNode);e.cellNode=(i?e.cellNode.parentNode.cells[i+mod]:null);e.cellIndex=(e.cellNode?this.getCellNodeIndex(e.cellNode):-1);}while(e.cellNode&&e.cellNode.style.display=="none");return Boolean(e.cellNode);},canResize:function(e){if(!e.cellNode||e.cellNode.colSpan>1){return false;}var cell=this.grid.getCell(e.cellIndex);return !cell.noresize&&cell.canResize();},overLeftResizeArea:function(e){if(_4.hasClass(_4.body(),"dojoDndMove")){return false;}if(_4.isIE){var tN=e.target;if(_4.hasClass(tN,"dojoxGridArrowButtonNode")||_4.hasClass(tN,"dojoxGridArrowButtonChar")){return false;}}if(_4._isBodyLtr()){return (e.cellIndex>0)&&(e.cellX>0&&e.cellX<this.overResizeWidth)&&this.prepareResize(e,-1);}var t=e.cellNode&&(e.cellX>0&&e.cellX<this.overResizeWidth);return t;},overRightResizeArea:function(e){if(_4.hasClass(_4.body(),"dojoDndMove")){return false;}if(_4.isIE){var tN=e.target;if(_4.hasClass(tN,"dojoxGridArrowButtonNode")||_4.hasClass(tN,"dojoxGridArrowButtonChar")){return false;}}if(_4._isBodyLtr()){return e.cellNode&&(e.cellX>=e.cellNode.offsetWidth-this.overResizeWidth);}return (e.cellIndex>0)&&(e.cellX>=e.cellNode.offsetWidth-this.overResizeWidth)&&this.prepareResize(e,-1);},domousemove:function(e){if(!this.moveable){var c=(this.overRightResizeArea(e)?"dojoxGridColResize":(this.overLeftResizeArea(e)?"dojoxGridColResize":""));if(c&&!this.canResize(e)){c="dojoxGridColNoResize";}_4.toggleClass(e.sourceView.headerNode,"dojoxGridColNoResize",(c=="dojoxGridColNoResize"));_4.toggleClass(e.sourceView.headerNode,"dojoxGridColResize",(c=="dojoxGridColResize"));if(_4.isIE){var t=e.sourceView.headerNode.scrollLeft;e.sourceView.headerNode.scrollLeft=t;}if(c){_4.stopEvent(e);}}},domousedown:function(e){if(!this.moveable){if((this.overRightResizeArea(e)||this.overLeftResizeArea(e))&&this.canResize(e)){this.beginColumnResize(e);}else{this.grid.onMouseDown(e);this.grid.onMouseOverRow(e);}}},doclick:function(e){if(this._skipBogusClicks){_4.stopEvent(e);return true;}return false;},colResizeSetup:function(e,_7d7){var _7d8=_4.contentBox(e.sourceView.headerNode);if(_7d7){this.lineDiv=document.createElement("div");var vw=(_4.position||_4._abs)(e.sourceView.headerNode,true);var _7d9=_4.contentBox(e.sourceView.domNode);var l=e.pageX;if(!_4._isBodyLtr()&&_4.isIE<8){l-=_6.html.metrics.getScrollbar().w;}_4.style(this.lineDiv,{top:vw.y+"px",left:l+"px",height:(_7d9.h+_7d8.h)+"px"});_4.addClass(this.lineDiv,"dojoxGridResizeColLine");this.lineDiv._origLeft=l;_4.body().appendChild(this.lineDiv);}var _7da=[],_7db=this.tableMap.findOverlappingNodes(e.cellNode);for(var i=0,cell;(cell=_7db[i]);i++){_7da.push({node:cell,index:this.getCellNodeIndex(cell),width:cell.offsetWidth});}var view=e.sourceView;var adj=_4._isBodyLtr()?1:-1;var _7dc=e.grid.views.views;var _7dd=[];for(var j=view.idx+adj,_7de;(_7de=_7dc[j]);j=j+adj){_7dd.push({node:_7de.headerNode,left:window.parseInt(_7de.headerNode.style.left)});}var _7df=view.headerContentNode.firstChild;var drag={scrollLeft:e.sourceView.headerNode.scrollLeft,view:view,node:e.cellNode,index:e.cellIndex,w:_4.contentBox(e.cellNode).w,vw:_7d8.w,table:_7df,tw:_4.contentBox(_7df).w,spanners:_7da,followers:_7dd};return drag;},beginColumnResize:function(e){this.moverDiv=document.createElement("div");_4.style(this.moverDiv,{position:"absolute",left:0});_4.body().appendChild(this.moverDiv);_4.addClass(this.grid.domNode,"dojoxGridColumnResizing");var m=(this.moveable=new _4.dnd.Moveable(this.moverDiv));var drag=this.colResizeSetup(e,true);m.onMove=_4.hitch(this,"doResizeColumn",drag);_4.connect(m,"onMoveStop",_4.hitch(this,function(){this.endResizeColumn(drag);if(drag.node.releaseCapture){drag.node.releaseCapture();}this.moveable.destroy();delete this.moveable;this.moveable=null;_4.removeClass(this.grid.domNode,"dojoxGridColumnResizing");}));if(e.cellNode.setCapture){e.cellNode.setCapture();}m.onMouseDown(e);},doResizeColumn:function(_7e0,_7e1,_7e2){var _7e3=_7e2.l;var data={deltaX:_7e3,w:_7e0.w+(_4._isBodyLtr()?_7e3:-_7e3),vw:_7e0.vw+_7e3,tw:_7e0.tw+_7e3};this.dragRecord={inDrag:_7e0,mover:_7e1,leftTop:_7e2};if(data.w>=this.minColWidth){if(!_7e1){this.doResizeNow(_7e0,data);}else{_4.style(this.lineDiv,"left",(this.lineDiv._origLeft+data.deltaX)+"px");}}},endResizeColumn:function(_7e4){if(this.dragRecord){var _7e5=this.dragRecord.leftTop;var _7e6=_4._isBodyLtr()?_7e5.l:-_7e5.l;_7e6+=Math.max(_7e4.w+_7e6,this.minColWidth)-(_7e4.w+_7e6);if(_4.isWebKit&&_7e4.spanners.length){_7e6+=_4._getPadBorderExtents(_7e4.spanners[0].node).w;}var data={deltaX:_7e6,w:_7e4.w+_7e6,vw:_7e4.vw+_7e6,tw:_7e4.tw+_7e6};this.doResizeNow(_7e4,data);delete this.dragRecord;}_4.destroy(this.lineDiv);_4.destroy(this.moverDiv);_4.destroy(this.moverDiv);delete this.moverDiv;this._skipBogusClicks=true;_7e4.view.update();this._skipBogusClicks=false;this.grid.onResizeColumn(_7e4.index);},doResizeNow:function(_7e7,data){_7e7.view.convertColPctToFixed();if(_7e7.view.flexCells&&!_7e7.view.testFlexCells()){var t=_7b6(_7e7.node);if(t){(t.style.width="");}}var i,s,sw,f,fl;for(i=0;(s=_7e7.spanners[i]);i++){sw=s.width+data.deltaX;if(sw>0){s.node.style.width=sw+"px";_7e7.view.setColWidth(s.index,sw);}}if(_4._isBodyLtr()||!_4.isIE){for(i=0;(f=_7e7.followers[i]);i++){fl=f.left+data.deltaX;f.node.style.left=fl+"px";}}_7e7.node.style.width=data.w+"px";_7e7.view.setColWidth(_7e7.index,data.w);_7e7.view.headerNode.style.width=data.vw+"px";_7e7.view.setColumnsWidth(data.tw);if(!_4._isBodyLtr()){_7e7.view.headerNode.scrollLeft=_7e7.scrollLeft+data.deltaX;}}});dg._TableMap=_4.extend(function(rows){this.mapRows(rows);},{map:null,mapRows:function(_7e8){var _7e9=_7e8.length;if(!_7e9){return;}this.map=[];var row;for(var k=0;(row=_7e8[k]);k++){this.map[k]=[];}for(var j=0;(row=_7e8[j]);j++){for(var i=0,x=0,cell,_7ea,_7eb;(cell=row[i]);i++){while(this.map[j][x]){x++;}this.map[j][x]={c:i,r:j};_7eb=cell.rowSpan||1;_7ea=cell.colSpan||1;for(var y=0;y<_7eb;y++){for(var s=0;s<_7ea;s++){this.map[j+y][x+s]=this.map[j][x];}}x+=_7ea;}}},dumpMap:function(){for(var j=0,row,h="";(row=this.map[j]);j++,h=""){for(var i=0,cell;(cell=row[i]);i++){h+=cell.r+","+cell.c+"   ";}}},getMapCoords:function(_7ec,_7ed){for(var j=0,row;(row=this.map[j]);j++){for(var i=0,cell;(cell=row[i]);i++){if(cell.c==_7ed&&cell.r==_7ec){return {j:j,i:i};}}}return {j:-1,i:-1};},getNode:function(_7ee,_7ef,_7f0){var row=_7ee&&_7ee.rows[_7ef];return row&&row.cells[_7f0];},_findOverlappingNodes:function(_7f1,_7f2,_7f3){var _7f4=[];var m=this.getMapCoords(_7f2,_7f3);for(var j=0,row;(row=this.map[j]);j++){if(j==m.j){continue;}var rw=row[m.i];var n=(rw?this.getNode(_7f1,rw.r,rw.c):null);if(n){_7f4.push(n);}}return _7f4;},findOverlappingNodes:function(_7f5){return this._findOverlappingNodes(_7b6(_7f5),_7b2(_7f5.parentNode),_7b1(_7f5));}});})();}if(!_4._hasResource["dojo.dnd.Container"]){_4._hasResource["dojo.dnd.Container"]=true;_4.provide("dojo.dnd.Container");_4.declare("dojo.dnd.Container",null,{skipForm:false,constructor:function(node,_7f6){this.node=_4.byId(node);if(!_7f6){_7f6={};}this.creator=_7f6.creator||null;this.skipForm=_7f6.skipForm;this.parent=_7f6.dropParent&&_4.byId(_7f6.dropParent);this.map={};this.current=null;this.containerState="";_4.addClass(this.node,"dojoDndContainer");if(!(_7f6&&_7f6._skipStartup)){this.startup();}this.events=[_4.connect(this.node,"onmouseover",this,"onMouseOver"),_4.connect(this.node,"onmouseout",this,"onMouseOut"),_4.connect(this.node,"ondragstart",this,"onSelectStart"),_4.connect(this.node,"onselectstart",this,"onSelectStart")];},creator:function(){},getItem:function(key){return this.map[key];},setItem:function(key,data){this.map[key]=data;},delItem:function(key){delete this.map[key];},forInItems:function(f,o){o=o||_4.global;var m=this.map,e=_4.dnd._empty;for(var i in m){if(i in e){continue;}f.call(o,m[i],i,this);}return o;},clearItems:function(){this.map={};},getAllNodes:function(){return _4.query("> .dojoDndItem",this.parent);},sync:function(){var map={};this.getAllNodes().forEach(function(node){if(node.id){var item=this.getItem(node.id);if(item){map[node.id]=item;return;}}else{node.id=_4.dnd.getUniqueId();}var type=node.getAttribute("dndType"),data=node.getAttribute("dndData");map[node.id]={data:data||node.innerHTML,type:type?type.split(/\s*,\s*/):["text"]};},this);this.map=map;return this;},insertNodes:function(data,_7f7,_7f8){if(!this.parent.firstChild){_7f8=null;}else{if(_7f7){if(!_7f8){_7f8=this.parent.firstChild;}}else{if(_7f8){_7f8=_7f8.nextSibling;}}}if(_7f8){for(var i=0;i<data.length;++i){var t=this._normalizedCreator(data[i]);this.setItem(t.node.id,{data:t.data,type:t.type});this.parent.insertBefore(t.node,_7f8);}}else{for(var i=0;i<data.length;++i){var t=this._normalizedCreator(data[i]);this.setItem(t.node.id,{data:t.data,type:t.type});this.parent.appendChild(t.node);}}return this;},destroy:function(){_4.forEach(this.events,_4.disconnect);this.clearItems();this.node=this.parent=this.current=null;},markupFactory:function(_7f9,node){_7f9._skipStartup=true;return new _4.dnd.Container(node,_7f9);},startup:function(){if(!this.parent){this.parent=this.node;if(this.parent.tagName.toLowerCase()=="table"){var c=this.parent.getElementsByTagName("tbody");if(c&&c.length){this.parent=c[0];}}}this.defaultCreator=_4.dnd._defaultCreator(this.parent);this.sync();},onMouseOver:function(e){var n=e.relatedTarget;while(n){if(n==this.node){break;}try{n=n.parentNode;}catch(x){n=null;}}if(!n){this._changeState("Container","Over");this.onOverEvent();}n=this._getChildByEvent(e);if(this.current==n){return;}if(this.current){this._removeItemClass(this.current,"Over");}if(n){this._addItemClass(n,"Over");}this.current=n;},onMouseOut:function(e){for(var n=e.relatedTarget;n;){if(n==this.node){return;}try{n=n.parentNode;}catch(x){n=null;}}if(this.current){this._removeItemClass(this.current,"Over");this.current=null;}this._changeState("Container","");this.onOutEvent();},onSelectStart:function(e){if(!this.skipForm||!_4.dnd.isFormElement(e)){_4.stopEvent(e);}},onOverEvent:function(){},onOutEvent:function(){},_changeState:function(type,_7fa){var _7fb="dojoDnd"+type;var _7fc=type.toLowerCase()+"State";_4.replaceClass(this.node,_7fb+_7fa,_7fb+this[_7fc]);this[_7fc]=_7fa;},_addItemClass:function(node,type){_4.addClass(node,"dojoDndItem"+type);},_removeItemClass:function(node,type){_4.removeClass(node,"dojoDndItem"+type);},_getChildByEvent:function(e){var node=e.target;if(node){for(var _7fd=node.parentNode;_7fd;node=_7fd,_7fd=node.parentNode){if(_7fd==this.parent&&_4.hasClass(node,"dojoDndItem")){return node;}}}return null;},_normalizedCreator:function(item,hint){var t=(this.creator||this.defaultCreator).call(this,item,hint);if(!_4.isArray(t.type)){t.type=["text"];}if(!t.node.id){t.node.id=_4.dnd.getUniqueId();}_4.addClass(t.node,"dojoDndItem");return t;}});_4.dnd._createNode=function(tag){if(!tag){return _4.dnd._createSpan;}return function(text){return _4.create(tag,{innerHTML:text});};};_4.dnd._createTrTd=function(text){var tr=_4.create("tr");_4.create("td",{innerHTML:text},tr);return tr;};_4.dnd._createSpan=function(text){return _4.create("span",{innerHTML:text});};_4.dnd._defaultCreatorNodes={ul:"li",ol:"li",div:"div",p:"div"};_4.dnd._defaultCreator=function(node){var tag=node.tagName.toLowerCase();var c=tag=="tbody"||tag=="thead"?_4.dnd._createTrTd:_4.dnd._createNode(_4.dnd._defaultCreatorNodes[tag]);return function(item,hint){var _7fe=item&&_4.isObject(item),data,type,n;if(_7fe&&item.tagName&&item.nodeType&&item.getAttribute){data=item.getAttribute("dndData")||item.innerHTML;type=item.getAttribute("dndType");type=type?type.split(/\s*,\s*/):["text"];n=item;}else{data=(_7fe&&item.data)?item.data:item;type=(_7fe&&item.type)?item.type:["text"];n=(hint=="avatar"?_4.dnd._createSpan:c)(String(data));}if(!n.id){n.id=_4.dnd.getUniqueId();}return {node:n,data:data,type:type};};};}if(!_4._hasResource["dojo.dnd.Selector"]){_4._hasResource["dojo.dnd.Selector"]=true;_4.provide("dojo.dnd.Selector");_4.declare("dojo.dnd.Selector",_4.dnd.Container,{constructor:function(node,_7ff){if(!_7ff){_7ff={};}this.singular=_7ff.singular;this.autoSync=_7ff.autoSync;this.selection={};this.anchor=null;this.simpleSelection=false;this.events.push(_4.connect(this.node,"onmousedown",this,"onMouseDown"),_4.connect(this.node,"onmouseup",this,"onMouseUp"));},singular:false,getSelectedNodes:function(){var t=new _4.NodeList();var e=_4.dnd._empty;for(var i in this.selection){if(i in e){continue;}t.push(_4.byId(i));}return t;},selectNone:function(){return this._removeSelection()._removeAnchor();},selectAll:function(){this.forInItems(function(data,id){this._addItemClass(_4.byId(id),"Selected");this.selection[id]=1;},this);return this._removeAnchor();},deleteSelectedNodes:function(){var e=_4.dnd._empty;for(var i in this.selection){if(i in e){continue;}var n=_4.byId(i);this.delItem(i);_4.destroy(n);}this.anchor=null;this.selection={};return this;},forInSelectedItems:function(f,o){o=o||_4.global;var s=this.selection,e=_4.dnd._empty;for(var i in s){if(i in e){continue;}f.call(o,this.getItem(i),i,this);}},sync:function(){_4.dnd.Selector.superclass.sync.call(this);if(this.anchor){if(!this.getItem(this.anchor.id)){this.anchor=null;}}var t=[],e=_4.dnd._empty;for(var i in this.selection){if(i in e){continue;}if(!this.getItem(i)){t.push(i);}}_4.forEach(t,function(i){delete this.selection[i];},this);return this;},insertNodes:function(_800,data,_801,_802){var _803=this._normalizedCreator;this._normalizedCreator=function(item,hint){var t=_803.call(this,item,hint);if(_800){if(!this.anchor){this.anchor=t.node;this._removeItemClass(t.node,"Selected");this._addItemClass(this.anchor,"Anchor");}else{if(this.anchor!=t.node){this._removeItemClass(t.node,"Anchor");this._addItemClass(t.node,"Selected");}}this.selection[t.node.id]=1;}else{this._removeItemClass(t.node,"Selected");this._removeItemClass(t.node,"Anchor");}return t;};_4.dnd.Selector.superclass.insertNodes.call(this,data,_801,_802);this._normalizedCreator=_803;return this;},destroy:function(){_4.dnd.Selector.superclass.destroy.call(this);this.selection=this.anchor=null;},markupFactory:function(_804,node){_804._skipStartup=true;return new _4.dnd.Selector(node,_804);},onMouseDown:function(e){if(this.autoSync){this.sync();}if(!this.current){return;}if(!this.singular&&!_4.isCopyKey(e)&&!e.shiftKey&&(this.current.id in this.selection)){this.simpleSelection=true;if(e.button===_4.mouseButtons.LEFT){_4.stopEvent(e);}return;}if(!this.singular&&e.shiftKey){if(!_4.isCopyKey(e)){this._removeSelection();}var c=this.getAllNodes();if(c.length){if(!this.anchor){this.anchor=c[0];this._addItemClass(this.anchor,"Anchor");}this.selection[this.anchor.id]=1;if(this.anchor!=this.current){var i=0;for(;i<c.length;++i){var node=c[i];if(node==this.anchor||node==this.current){break;}}for(++i;i<c.length;++i){var node=c[i];if(node==this.anchor||node==this.current){break;}this._addItemClass(node,"Selected");this.selection[node.id]=1;}this._addItemClass(this.current,"Selected");this.selection[this.current.id]=1;}}}else{if(this.singular){if(this.anchor==this.current){if(_4.isCopyKey(e)){this.selectNone();}}else{this.selectNone();this.anchor=this.current;this._addItemClass(this.anchor,"Anchor");this.selection[this.current.id]=1;}}else{if(_4.isCopyKey(e)){if(this.anchor==this.current){delete this.selection[this.anchor.id];this._removeAnchor();}else{if(this.current.id in this.selection){this._removeItemClass(this.current,"Selected");delete this.selection[this.current.id];}else{if(this.anchor){this._removeItemClass(this.anchor,"Anchor");this._addItemClass(this.anchor,"Selected");}this.anchor=this.current;this._addItemClass(this.current,"Anchor");this.selection[this.current.id]=1;}}}else{if(!(this.current.id in this.selection)){this.selectNone();this.anchor=this.current;this._addItemClass(this.current,"Anchor");this.selection[this.current.id]=1;}}}}_4.stopEvent(e);},onMouseUp:function(e){if(!this.simpleSelection){return;}this.simpleSelection=false;this.selectNone();if(this.current){this.anchor=this.current;this._addItemClass(this.anchor,"Anchor");this.selection[this.current.id]=1;}},onMouseMove:function(e){this.simpleSelection=false;},onOverEvent:function(){this.onmousemoveEvent=_4.connect(this.node,"onmousemove",this,"onMouseMove");},onOutEvent:function(){_4.disconnect(this.onmousemoveEvent);delete this.onmousemoveEvent;},_removeSelection:function(){var e=_4.dnd._empty;for(var i in this.selection){if(i in e){continue;}var node=_4.byId(i);if(node){this._removeItemClass(node,"Selected");}}this.selection={};return this;},_removeAnchor:function(){if(this.anchor){this._removeItemClass(this.anchor,"Anchor");this.anchor=null;}return this;}});}if(!_4._hasResource["dojo.dnd.Avatar"]){_4._hasResource["dojo.dnd.Avatar"]=true;_4.provide("dojo.dnd.Avatar");_4.declare("dojo.dnd.Avatar",null,{constructor:function(_805){this.manager=_805;this.construct();},construct:function(){this.isA11y=_4.hasClass(_4.body(),"dijit_a11y");var a=_4.create("table",{"class":"dojoDndAvatar",style:{position:"absolute",zIndex:"1999",margin:"0px"}}),_806=this.manager.source,node,b=_4.create("tbody",null,a),tr=_4.create("tr",null,b),td=_4.create("td",null,tr),icon=this.isA11y?_4.create("span",{id:"a11yIcon",innerHTML:this.manager.copy?"+":"<"},td):null,span=_4.create("span",{innerHTML:_806.generateText?this._generateText():""},td),k=Math.min(5,this.manager.nodes.length),i=0;_4.attr(tr,{"class":"dojoDndAvatarHeader",style:{opacity:0.9}});for(;i<k;++i){if(_806.creator){node=_806._normalizedCreator(_806.getItem(this.manager.nodes[i].id).data,"avatar").node;}else{node=this.manager.nodes[i].cloneNode(true);if(node.tagName.toLowerCase()=="tr"){var _807=_4.create("table"),_808=_4.create("tbody",null,_807);_808.appendChild(node);node=_807;}}node.id="";tr=_4.create("tr",null,b);td=_4.create("td",null,tr);td.appendChild(node);_4.attr(tr,{"class":"dojoDndAvatarItem",style:{opacity:(9-i)/10}});}this.node=a;},destroy:function(){_4.destroy(this.node);this.node=false;},update:function(){_4[(this.manager.canDropFlag?"add":"remove")+"Class"](this.node,"dojoDndAvatarCanDrop");if(this.isA11y){var icon=_4.byId("a11yIcon");var text="+";if(this.manager.canDropFlag&&!this.manager.copy){text="< ";}else{if(!this.manager.canDropFlag&&!this.manager.copy){text="o";}else{if(!this.manager.canDropFlag){text="x";}}}icon.innerHTML=text;}_4.query(("tr.dojoDndAvatarHeader td span"+(this.isA11y?" span":"")),this.node).forEach(function(node){node.innerHTML=this._generateText();},this);},_generateText:function(){return this.manager.nodes.length.toString();}});}if(!_4._hasResource["dojo.dnd.Manager"]){_4._hasResource["dojo.dnd.Manager"]=true;_4.provide("dojo.dnd.Manager");_4.declare("dojo.dnd.Manager",null,{constructor:function(){this.avatar=null;this.source=null;this.nodes=[];this.copy=true;this.target=null;this.canDropFlag=false;this.events=[];},OFFSET_X:16,OFFSET_Y:16,overSource:function(_809){if(this.avatar){this.target=(_809&&_809.targetState!="Disabled")?_809:null;this.canDropFlag=Boolean(this.target);this.avatar.update();}_4.publish("/dnd/source/over",[_809]);},outSource:function(_80a){if(this.avatar){if(this.target==_80a){this.target=null;this.canDropFlag=false;this.avatar.update();_4.publish("/dnd/source/over",[null]);}}else{_4.publish("/dnd/source/over",[null]);}},startDrag:function(_80b,_80c,copy){this.source=_80b;this.nodes=_80c;this.copy=Boolean(copy);this.avatar=this.makeAvatar();_4.body().appendChild(this.avatar.node);_4.publish("/dnd/start",[_80b,_80c,this.copy]);this.events=[_4.connect(_4.doc,"onmousemove",this,"onMouseMove"),_4.connect(_4.doc,"onmouseup",this,"onMouseUp"),_4.connect(_4.doc,"onkeydown",this,"onKeyDown"),_4.connect(_4.doc,"onkeyup",this,"onKeyUp"),_4.connect(_4.doc,"ondragstart",_4.stopEvent),_4.connect(_4.body(),"onselectstart",_4.stopEvent)];var c="dojoDnd"+(copy?"Copy":"Move");_4.addClass(_4.body(),c);},canDrop:function(flag){var _80d=Boolean(this.target&&flag);if(this.canDropFlag!=_80d){this.canDropFlag=_80d;this.avatar.update();}},stopDrag:function(){_4.removeClass(_4.body(),["dojoDndCopy","dojoDndMove"]);_4.forEach(this.events,_4.disconnect);this.events=[];this.avatar.destroy();this.avatar=null;this.source=this.target=null;this.nodes=[];},makeAvatar:function(){return new _4.dnd.Avatar(this);},updateAvatar:function(){this.avatar.update();},onMouseMove:function(e){var a=this.avatar;if(a){_4.dnd.autoScrollNodes(e);var s=a.node.style;s.left=(e.pageX+this.OFFSET_X)+"px";s.top=(e.pageY+this.OFFSET_Y)+"px";var copy=Boolean(this.source.copyState(_4.isCopyKey(e)));if(this.copy!=copy){this._setCopyStatus(copy);}}},onMouseUp:function(e){if(this.avatar){if(this.target&&this.canDropFlag){var copy=Boolean(this.source.copyState(_4.isCopyKey(e))),_80e=[this.source,this.nodes,copy,this.target,e];_4.publish("/dnd/drop/before",_80e);_4.publish("/dnd/drop",_80e);}else{_4.publish("/dnd/cancel");}this.stopDrag();}},onKeyDown:function(e){if(this.avatar){switch(e.keyCode){case _4.keys.CTRL:var copy=Boolean(this.source.copyState(true));if(this.copy!=copy){this._setCopyStatus(copy);}break;case _4.keys.ESCAPE:_4.publish("/dnd/cancel");this.stopDrag();break;}}},onKeyUp:function(e){if(this.avatar&&e.keyCode==_4.keys.CTRL){var copy=Boolean(this.source.copyState(false));if(this.copy!=copy){this._setCopyStatus(copy);}}},_setCopyStatus:function(copy){this.copy=copy;this.source._markDndStatus(this.copy);this.updateAvatar();_4.replaceClass(_4.body(),"dojoDnd"+(this.copy?"Copy":"Move"),"dojoDnd"+(this.copy?"Move":"Copy"));}});_4.dnd._manager=null;_4.dnd.manager=function(){if(!_4.dnd._manager){_4.dnd._manager=new _4.dnd.Manager();}return _4.dnd._manager;};}if(!_4._hasResource["dojo.dnd.Source"]){_4._hasResource["dojo.dnd.Source"]=true;_4.provide("dojo.dnd.Source");_4.declare("dojo.dnd.Source",_4.dnd.Selector,{isSource:true,horizontal:false,copyOnly:false,selfCopy:false,selfAccept:true,skipForm:false,withHandles:false,autoSync:false,delay:0,accept:["text"],generateText:true,constructor:function(node,_80f){_4.mixin(this,_4.mixin({},_80f));var type=this.accept;if(type.length){this.accept={};for(var i=0;i<type.length;++i){this.accept[type[i]]=1;}}this.isDragging=false;this.mouseDown=false;this.targetAnchor=null;this.targetBox=null;this.before=true;this._lastX=0;this._lastY=0;this.sourceState="";if(this.isSource){_4.addClass(this.node,"dojoDndSource");}this.targetState="";if(this.accept){_4.addClass(this.node,"dojoDndTarget");}if(this.horizontal){_4.addClass(this.node,"dojoDndHorizontal");}this.topics=[_4.subscribe("/dnd/source/over",this,"onDndSourceOver"),_4.subscribe("/dnd/start",this,"onDndStart"),_4.subscribe("/dnd/drop",this,"onDndDrop"),_4.subscribe("/dnd/cancel",this,"onDndCancel")];},checkAcceptance:function(_810,_811){if(this==_810){return !this.copyOnly||this.selfAccept;}for(var i=0;i<_811.length;++i){var type=_810.getItem(_811[i].id).type;var flag=false;for(var j=0;j<type.length;++j){if(type[j] in this.accept){flag=true;break;}}if(!flag){return false;}}return true;},copyState:function(_812,self){if(_812){return true;}if(arguments.length<2){self=this==_4.dnd.manager().target;}if(self){if(this.copyOnly){return this.selfCopy;}}else{return this.copyOnly;}return false;},destroy:function(){_4.dnd.Source.superclass.destroy.call(this);_4.forEach(this.topics,_4.unsubscribe);this.targetAnchor=null;},markupFactory:function(_813,node){_813._skipStartup=true;return new _4.dnd.Source(node,_813);},onMouseMove:function(e){if(this.isDragging&&this.targetState=="Disabled"){return;}_4.dnd.Source.superclass.onMouseMove.call(this,e);var m=_4.dnd.manager();if(!this.isDragging){if(this.mouseDown&&this.isSource&&(Math.abs(e.pageX-this._lastX)>this.delay||Math.abs(e.pageY-this._lastY)>this.delay)){var _814=this.getSelectedNodes();if(_814.length){m.startDrag(this,_814,this.copyState(_4.isCopyKey(e),true));}}}if(this.isDragging){var _815=false;if(this.current){if(!this.targetBox||this.targetAnchor!=this.current){this.targetBox=_4.position(this.current,true);}if(this.horizontal){_815=(e.pageX-this.targetBox.x)<(this.targetBox.w/2);}else{_815=(e.pageY-this.targetBox.y)<(this.targetBox.h/2);}}if(this.current!=this.targetAnchor||_815!=this.before){this._markTargetAnchor(_815);m.canDrop(!this.current||m.source!=this||!(this.current.id in this.selection));}}},onMouseDown:function(e){if(!this.mouseDown&&this._legalMouseDown(e)&&(!this.skipForm||!_4.dnd.isFormElement(e))){this.mouseDown=true;this._lastX=e.pageX;this._lastY=e.pageY;_4.dnd.Source.superclass.onMouseDown.call(this,e);}},onMouseUp:function(e){if(this.mouseDown){this.mouseDown=false;_4.dnd.Source.superclass.onMouseUp.call(this,e);}},onDndSourceOver:function(_816){if(this!=_816){this.mouseDown=false;if(this.targetAnchor){this._unmarkTargetAnchor();}}else{if(this.isDragging){var m=_4.dnd.manager();m.canDrop(this.targetState!="Disabled"&&(!this.current||m.source!=this||!(this.current.id in this.selection)));}}},onDndStart:function(_817,_818,copy){if(this.autoSync){this.sync();}if(this.isSource){this._changeState("Source",this==_817?(copy?"Copied":"Moved"):"");}var _819=this.accept&&this.checkAcceptance(_817,_818);this._changeState("Target",_819?"":"Disabled");if(this==_817){_4.dnd.manager().overSource(this);}this.isDragging=true;},onDndDrop:function(_81a,_81b,copy,_81c){if(this==_81c){this.onDrop(_81a,_81b,copy);}this.onDndCancel();},onDndCancel:function(){if(this.targetAnchor){this._unmarkTargetAnchor();this.targetAnchor=null;}this.before=true;this.isDragging=false;this.mouseDown=false;this._changeState("Source","");this._changeState("Target","");},onDrop:function(_81d,_81e,copy){if(this!=_81d){this.onDropExternal(_81d,_81e,copy);}else{this.onDropInternal(_81e,copy);}},onDropExternal:function(_81f,_820,copy){var _821=this._normalizedCreator;if(this.creator){this._normalizedCreator=function(node,hint){return _821.call(this,_81f.getItem(node.id).data,hint);};}else{if(copy){this._normalizedCreator=function(node,hint){var t=_81f.getItem(node.id);var n=node.cloneNode(true);n.id=_4.dnd.getUniqueId();return {node:n,data:t.data,type:t.type};};}else{this._normalizedCreator=function(node,hint){var t=_81f.getItem(node.id);_81f.delItem(node.id);return {node:node,data:t.data,type:t.type};};}}this.selectNone();if(!copy&&!this.creator){_81f.selectNone();}this.insertNodes(true,_820,this.before,this.current);if(!copy&&this.creator){_81f.deleteSelectedNodes();}this._normalizedCreator=_821;},onDropInternal:function(_822,copy){var _823=this._normalizedCreator;if(this.current&&this.current.id in this.selection){return;}if(copy){if(this.creator){this._normalizedCreator=function(node,hint){return _823.call(this,this.getItem(node.id).data,hint);};}else{this._normalizedCreator=function(node,hint){var t=this.getItem(node.id);var n=node.cloneNode(true);n.id=_4.dnd.getUniqueId();return {node:n,data:t.data,type:t.type};};}}else{if(!this.current){return;}this._normalizedCreator=function(node,hint){var t=this.getItem(node.id);return {node:node,data:t.data,type:t.type};};}this._removeSelection();this.insertNodes(true,_822,this.before,this.current);this._normalizedCreator=_823;},onDraggingOver:function(){},onDraggingOut:function(){},onOverEvent:function(){_4.dnd.Source.superclass.onOverEvent.call(this);_4.dnd.manager().overSource(this);if(this.isDragging&&this.targetState!="Disabled"){this.onDraggingOver();}},onOutEvent:function(){_4.dnd.Source.superclass.onOutEvent.call(this);_4.dnd.manager().outSource(this);if(this.isDragging&&this.targetState!="Disabled"){this.onDraggingOut();}},_markTargetAnchor:function(_824){if(this.current==this.targetAnchor&&this.before==_824){return;}if(this.targetAnchor){this._removeItemClass(this.targetAnchor,this.before?"Before":"After");}this.targetAnchor=this.current;this.targetBox=null;this.before=_824;if(this.targetAnchor){this._addItemClass(this.targetAnchor,this.before?"Before":"After");}},_unmarkTargetAnchor:function(){if(!this.targetAnchor){return;}this._removeItemClass(this.targetAnchor,this.before?"Before":"After");this.targetAnchor=null;this.targetBox=null;this.before=true;},_markDndStatus:function(copy){this._changeState("Source",copy?"Copied":"Moved");},_legalMouseDown:function(e){if(!_4.mouseButtons.isLeft(e)){return false;}if(!this.withHandles){return true;}for(var node=e.target;node&&node!==this.node;node=node.parentNode){if(_4.hasClass(node,"dojoDndHandle")){return true;}if(_4.hasClass(node,"dojoDndItem")||_4.hasClass(node,"dojoDndIgnore")){break;}}return false;}});_4.declare("dojo.dnd.Target",_4.dnd.Source,{constructor:function(node,_825){this.isSource=false;_4.removeClass(this.node,"dojoDndSource");},markupFactory:function(_826,node){_826._skipStartup=true;return new _4.dnd.Target(node,_826);}});_4.declare("dojo.dnd.AutoSource",_4.dnd.Source,{constructor:function(node,_827){this.autoSync=true;},markupFactory:function(_828,node){_828._skipStartup=true;return new _4.dnd.AutoSource(node,_828);}});}if(!_4._hasResource["dojox.grid._View"]){_4._hasResource["dojox.grid._View"]=true;_4.provide("dojox.grid._View");(function(){var _829=function(_82a,_82b){return _82a.style.cssText==undefined?_82a.getAttribute("style"):_82a.style.cssText;};_4.declare("dojox.grid._View",[_5._Widget,_5._Templated],{defaultWidth:"18em",viewWidth:"",templateString:"<div class=\"dojoxGridView\" role=\"presentation\">\r\n\t<div class=\"dojoxGridHeader\" dojoAttachPoint=\"headerNode\" role=\"presentation\">\r\n\t\t<div dojoAttachPoint=\"headerNodeContainer\" style=\"width:9000em\" role=\"presentation\">\r\n\t\t\t<div dojoAttachPoint=\"headerContentNode\" role=\"row\"></div>\r\n\t\t</div>\r\n\t</div>\r\n\t<input type=\"checkbox\" class=\"dojoxGridHiddenFocus\" dojoAttachPoint=\"hiddenFocusNode\" role=\"presentation\" />\r\n\t<input type=\"checkbox\" class=\"dojoxGridHiddenFocus\" role=\"presentation\" />\r\n\t<div class=\"dojoxGridScrollbox\" dojoAttachPoint=\"scrollboxNode\" role=\"presentation\">\r\n\t\t<div class=\"dojoxGridContent\" dojoAttachPoint=\"contentNode\" hidefocus=\"hidefocus\" role=\"presentation\"></div>\r\n\t</div>\r\n</div>\r\n",themeable:false,classTag:"dojoxGrid",marginBottom:0,rowPad:2,_togglingColumn:-1,_headerBuilderClass:_6.grid._HeaderBuilder,_contentBuilderClass:_6.grid._ContentBuilder,postMixInProperties:function(){this.rowNodes={};},postCreate:function(){this.connect(this.scrollboxNode,"onscroll","doscroll");_6.grid.util.funnelEvents(this.contentNode,this,"doContentEvent",["mouseover","mouseout","click","dblclick","contextmenu","mousedown"]);_6.grid.util.funnelEvents(this.headerNode,this,"doHeaderEvent",["dblclick","mouseover","mouseout","mousemove","mousedown","click","contextmenu"]);this.content=new this._contentBuilderClass(this);this.header=new this._headerBuilderClass(this);if(!_4._isBodyLtr()){this.headerNodeContainer.style.width="";}},destroy:function(){_4.destroy(this.headerNode);delete this.headerNode;for(var i in this.rowNodes){_4.destroy(this.rowNodes[i]);}this.rowNodes={};if(this.source){this.source.destroy();}this.inherited(arguments);},focus:function(){if(_4.isIE||_4.isWebKit||_4.isOpera){this.hiddenFocusNode.focus();}else{this.scrollboxNode.focus();}},setStructure:function(_82c){var vs=(this.structure=_82c);if(vs.width&&!isNaN(vs.width)){this.viewWidth=vs.width+"em";}else{this.viewWidth=vs.width||(vs.noscroll?"auto":this.viewWidth);}this._onBeforeRow=vs.onBeforeRow||function(){};this._onAfterRow=vs.onAfterRow||function(){};this.noscroll=vs.noscroll;if(this.noscroll){this.scrollboxNode.style.overflow="hidden";}this.simpleStructure=Boolean(vs.cells.length==1);this.testFlexCells();this.updateStructure();},_cleanupRowWidgets:function(_82d){if(_82d){_4.forEach(_4.query("[widgetId]",_82d).map(_5.byNode),function(w){if(w._destroyOnRemove){w.destroy();delete w;}else{if(w.domNode&&w.domNode.parentNode){w.domNode.parentNode.removeChild(w.domNode);}}});}},onBeforeRow:function(_82e,_82f){this._onBeforeRow(_82e,_82f);if(_82e>=0){this._cleanupRowWidgets(this.getRowNode(_82e));}},onAfterRow:function(_830,_831,_832){this._onAfterRow(_830,_831,_832);var g=this.grid;_4.forEach(_4.query(".dojoxGridStubNode",_832),function(n){if(n&&n.parentNode){var lw=n.getAttribute("linkWidget");var _833=window.parseInt(_4.attr(n,"cellIdx"),10);var _834=g.getCell(_833);var w=_5.byId(lw);if(w){n.parentNode.replaceChild(w.domNode,n);if(!w._started){w.startup();}}else{n.innerHTML="";}}},this);},testFlexCells:function(){this.flexCells=false;for(var j=0,row;(row=this.structure.cells[j]);j++){for(var i=0,cell;(cell=row[i]);i++){cell.view=this;this.flexCells=this.flexCells||cell.isFlex();}}return this.flexCells;},updateStructure:function(){this.header.update();this.content.update();},getScrollbarWidth:function(){var _835=this.hasVScrollbar();var _836=_4.style(this.scrollboxNode,"overflow");if(this.noscroll||!_836||_836=="hidden"){_835=false;}else{if(_836=="scroll"){_835=true;}}return (_835?_6.html.metrics.getScrollbar().w:0);},getColumnsWidth:function(){var h=this.headerContentNode;return h&&h.firstChild?h.firstChild.offsetWidth:0;},setColumnsWidth:function(_837){this.headerContentNode.firstChild.style.width=_837+"px";if(this.viewWidth){this.viewWidth=_837+"px";}},getWidth:function(){return this.viewWidth||(this.getColumnsWidth()+this.getScrollbarWidth())+"px";},getContentWidth:function(){return Math.max(0,_4._getContentBox(this.domNode).w-this.getScrollbarWidth())+"px";},render:function(){this.scrollboxNode.style.height="";this.renderHeader();if(this._togglingColumn>=0){this.setColumnsWidth(this.getColumnsWidth()-this._togglingColumn);this._togglingColumn=-1;}var _838=this.grid.layout.cells;var _839=_4.hitch(this,function(node,_83a){!_4._isBodyLtr()&&(_83a=!_83a);var inc=_83a?-1:1;var idx=this.header.getCellNodeIndex(node)+inc;var cell=_838[idx];while(cell&&cell.getHeaderNode()&&cell.getHeaderNode().style.display=="none"){idx+=inc;cell=_838[idx];}if(cell){return cell.getHeaderNode();}return null;});if(this.grid.columnReordering&&this.simpleStructure){if(this.source){this.source.destroy();}var _83b="dojoxGrid_bottomMarker";var _83c="dojoxGrid_topMarker";if(this.bottomMarker){_4.destroy(this.bottomMarker);}this.bottomMarker=_4.byId(_83b);if(this.topMarker){_4.destroy(this.topMarker);}this.topMarker=_4.byId(_83c);if(!this.bottomMarker){this.bottomMarker=_4.create("div",{"id":_83b,"class":"dojoxGridColPlaceBottom"},_4.body());this._hide(this.bottomMarker);this.topMarker=_4.create("div",{"id":_83c,"class":"dojoxGridColPlaceTop"},_4.body());this._hide(this.topMarker);}this.arrowDim=_4.contentBox(this.bottomMarker);var _83d=_4.contentBox(this.headerContentNode.firstChild.rows[0]).h;this.source=new _4.dnd.Source(this.headerContentNode.firstChild.rows[0],{horizontal:true,accept:["gridColumn_"+this.grid.id],viewIndex:this.index,generateText:false,onMouseDown:_4.hitch(this,function(e){this.header.decorateEvent(e);if((this.header.overRightResizeArea(e)||this.header.overLeftResizeArea(e))&&this.header.canResize(e)&&!this.header.moveable){this.header.beginColumnResize(e);}else{if(this.grid.headerMenu){this.grid.headerMenu.onCancel(true);}if(e.button===(_4.isIE?1:0)){_4.dnd.Source.prototype.onMouseDown.call(this.source,e);}}}),onMouseOver:_4.hitch(this,function(e){var src=this.source;if(src._getChildByEvent(e)){_4.dnd.Source.prototype.onMouseOver.apply(src,arguments);}}),_markTargetAnchor:_4.hitch(this,function(_83e){var src=this.source;if(src.current==src.targetAnchor&&src.before==_83e){return;}if(src.targetAnchor&&_839(src.targetAnchor,src.before)){src._removeItemClass(_839(src.targetAnchor,src.before),src.before?"After":"Before");}_4.dnd.Source.prototype._markTargetAnchor.call(src,_83e);var _83f=_83e?src.targetAnchor:_839(src.targetAnchor,src.before);var _840=0;if(!_83f){_83f=src.targetAnchor;_840=_4.contentBox(_83f).w+this.arrowDim.w/2+2;}var pos=(_4.position||_4._abs)(_83f,true);var left=Math.floor(pos.x-this.arrowDim.w/2+_840);_4.style(this.bottomMarker,"visibility","visible");_4.style(this.topMarker,"visibility","visible");_4.style(this.bottomMarker,{"left":left+"px","top":(_83d+pos.y)+"px"});_4.style(this.topMarker,{"left":left+"px","top":(pos.y-this.arrowDim.h)+"px"});if(src.targetAnchor&&_839(src.targetAnchor,src.before)){src._addItemClass(_839(src.targetAnchor,src.before),src.before?"After":"Before");}}),_unmarkTargetAnchor:_4.hitch(this,function(){var src=this.source;if(!src.targetAnchor){return;}if(src.targetAnchor&&_839(src.targetAnchor,src.before)){src._removeItemClass(_839(src.targetAnchor,src.before),src.before?"After":"Before");}this._hide(this.bottomMarker);this._hide(this.topMarker);_4.dnd.Source.prototype._unmarkTargetAnchor.call(src);}),destroy:_4.hitch(this,function(){_4.disconnect(this._source_conn);_4.unsubscribe(this._source_sub);_4.dnd.Source.prototype.destroy.call(this.source);if(this.bottomMarker){_4.destroy(this.bottomMarker);delete this.bottomMarker;}if(this.topMarker){_4.destroy(this.topMarker);delete this.topMarker;}}),onDndCancel:_4.hitch(this,function(){_4.dnd.Source.prototype.onDndCancel.call(this.source);this._hide(this.bottomMarker);this._hide(this.topMarker);})});this._source_conn=_4.connect(this.source,"onDndDrop",this,"_onDndDrop");this._source_sub=_4.subscribe("/dnd/drop/before",this,"_onDndDropBefore");this.source.startup();}},_hide:function(node){_4.style(node,{left:"-10000px",top:"-10000px","visibility":"hidden"});},_onDndDropBefore:function(_841,_842,copy){if(_4.dnd.manager().target!==this.source){return;}this.source._targetNode=this.source.targetAnchor;this.source._beforeTarget=this.source.before;var _843=this.grid.views.views;var _844=_843[_841.viewIndex];var _845=_843[this.index];if(_845!=_844){_844.convertColPctToFixed();_845.convertColPctToFixed();}},_onDndDrop:function(_846,_847,copy){if(_4.dnd.manager().target!==this.source){if(_4.dnd.manager().source===this.source){this._removingColumn=true;}return;}this._hide(this.bottomMarker);this._hide(this.topMarker);var _848=function(n){return n?_4.attr(n,"idx"):null;};var w=_4.marginBox(_847[0]).w;if(_846.viewIndex!==this.index){var _849=this.grid.views.views;var _84a=_849[_846.viewIndex];var _84b=_849[this.index];if(_84a.viewWidth&&_84a.viewWidth!="auto"){_84a.setColumnsWidth(_84a.getColumnsWidth()-w);}if(_84b.viewWidth&&_84b.viewWidth!="auto"){_84b.setColumnsWidth(_84b.getColumnsWidth());}}var stn=this.source._targetNode;var stb=this.source._beforeTarget;!_4._isBodyLtr()&&(stb=!stb);var _84c=this.grid.layout;var idx=this.index;delete this.source._targetNode;delete this.source._beforeTarget;_84c.moveColumn(_846.viewIndex,idx,_848(_847[0]),_848(stn),stb);},renderHeader:function(){this.headerContentNode.innerHTML=this.header.generateHtml(this._getHeaderContent);if(this.flexCells){this.contentWidth=this.getContentWidth();this.headerContentNode.firstChild.style.width=this.contentWidth;}_6.grid.util.fire(this,"onAfterRow",[-1,this.structure.cells,this.headerContentNode]);},_getHeaderContent:function(_84d){var n=_84d.name||_84d.grid.getCellName(_84d);var ret=["<div class=\"dojoxGridSortNode"];if(_84d.index!=_84d.grid.getSortIndex()){ret.push("\">");}else{ret=ret.concat([" ",_84d.grid.sortInfo>0?"dojoxGridSortUp":"dojoxGridSortDown","\"><div class=\"dojoxGridArrowButtonChar\">",_84d.grid.sortInfo>0?"&#9650;":"&#9660;","</div><div class=\"dojoxGridArrowButtonNode\" role=\"presentation\"></div>","<div class=\"dojoxGridColCaption\">"]);}ret=ret.concat([n,"</div></div>"]);return ret.join("");},resize:function(){this.adaptHeight();this.adaptWidth();},hasHScrollbar:function(_84e){var _84f=this._hasHScroll||false;if(this._hasHScroll==undefined||_84e){if(this.noscroll){this._hasHScroll=false;}else{var _850=_4.style(this.scrollboxNode,"overflow");if(_850=="hidden"){this._hasHScroll=false;}else{if(_850=="scroll"){this._hasHScroll=true;}else{this._hasHScroll=(this.scrollboxNode.offsetWidth-this.getScrollbarWidth()<this.contentNode.offsetWidth);}}}}if(_84f!==this._hasHScroll){this.grid.update();}return this._hasHScroll;},hasVScrollbar:function(_851){var _852=this._hasVScroll||false;if(this._hasVScroll==undefined||_851){if(this.noscroll){this._hasVScroll=false;}else{var _853=_4.style(this.scrollboxNode,"overflow");if(_853=="hidden"){this._hasVScroll=false;}else{if(_853=="scroll"){this._hasVScroll=true;}else{this._hasVScroll=(this.scrollboxNode.scrollHeight>this.scrollboxNode.clientHeight);}}}}if(_852!==this._hasVScroll){this.grid.update();}return this._hasVScroll;},convertColPctToFixed:function(){var _854=false;this.grid.initialWidth="";var _855=_4.query("th",this.headerContentNode);var _856=_4.map(_855,function(c,vIdx){var w=c.style.width;_4.attr(c,"vIdx",vIdx);if(w&&w.slice(-1)=="%"){_854=true;}else{if(w&&w.slice(-2)=="px"){return window.parseInt(w,10);}}return _4.contentBox(c).w;});if(_854){_4.forEach(this.grid.layout.cells,function(cell,idx){if(cell.view==this){var _857=cell.view.getHeaderCellNode(cell.index);if(_857&&_4.hasAttr(_857,"vIdx")){var vIdx=window.parseInt(_4.attr(_857,"vIdx"));this.setColWidth(idx,_856[vIdx]);_4.removeAttr(_857,"vIdx");}}},this);return true;}return false;},adaptHeight:function(_858){if(!this.grid._autoHeight){var h=(this.domNode.style.height&&parseInt(this.domNode.style.height.replace(/px/,""),10))||this.domNode.clientHeight;var self=this;var _859=function(){var v;for(var i in self.grid.views.views){v=self.grid.views.views[i];if(v!==self&&v.hasHScrollbar()){return true;}}return false;};if(_858||(this.noscroll&&_859())){h-=_6.html.metrics.getScrollbar().h;}_6.grid.util.setStyleHeightPx(this.scrollboxNode,h);}this.hasVScrollbar(true);},adaptWidth:function(){if(this.flexCells){this.contentWidth=this.getContentWidth();this.headerContentNode.firstChild.style.width=this.contentWidth;}var w=this.scrollboxNode.offsetWidth-this.getScrollbarWidth();if(!this._removingColumn){w=Math.max(w,this.getColumnsWidth())+"px";}else{w=Math.min(w,this.getColumnsWidth())+"px";this._removingColumn=false;}var cn=this.contentNode;cn.style.width=w;this.hasHScrollbar(true);},setSize:function(w,h){var ds=this.domNode.style;var hs=this.headerNode.style;if(w){ds.width=w;hs.width=w;}ds.height=(h>=0?h+"px":"");},renderRow:function(_85a){var _85b=this.createRowNode(_85a);this.buildRow(_85a,_85b);this.grid.edit.restore(this,_85a);return _85b;},createRowNode:function(_85c){var node=document.createElement("div");node.className=this.classTag+"Row";if(this instanceof _6.grid._RowSelector){_4.attr(node,"role","presentation");}else{_4.attr(node,"role","row");if(this.grid.selectionMode!="none"){_4.attr(node,"aria-selected","false");}}node[_6.grid.util.gridViewTag]=this.id;node[_6.grid.util.rowIndexTag]=_85c;this.rowNodes[_85c]=node;return node;},buildRow:function(_85d,_85e){this.buildRowContent(_85d,_85e);this.styleRow(_85d,_85e);},buildRowContent:function(_85f,_860){_860.innerHTML=this.content.generateHtml(_85f,_85f);if(this.flexCells&&this.contentWidth){_860.firstChild.style.width=this.contentWidth;}_6.grid.util.fire(this,"onAfterRow",[_85f,this.structure.cells,_860]);},rowRemoved:function(_861){if(_861>=0){this._cleanupRowWidgets(this.getRowNode(_861));}this.grid.edit.save(this,_861);delete this.rowNodes[_861];},getRowNode:function(_862){return this.rowNodes[_862];},getCellNode:function(_863,_864){var row=this.getRowNode(_863);if(row){return this.content.getCellNode(row,_864);}},getHeaderCellNode:function(_865){if(this.headerContentNode){return this.header.getCellNode(this.headerContentNode,_865);}},styleRow:function(_866,_867){_867._style=_829(_867);this.styleRowNode(_866,_867);},styleRowNode:function(_868,_869){if(_869){this.doStyleRowNode(_868,_869);}},doStyleRowNode:function(_86a,_86b){this.grid.styleRowNode(_86a,_86b);},updateRow:function(_86c){var _86d=this.getRowNode(_86c);if(_86d){_86d.style.height="";this.buildRow(_86c,_86d);}return _86d;},updateRowStyles:function(_86e){this.styleRowNode(_86e,this.getRowNode(_86e));},lastTop:0,firstScroll:0,doscroll:function(_86f){var _870=_4._isBodyLtr();if(this.firstScroll<2){if((!_870&&this.firstScroll==1)||(_870&&this.firstScroll===0)){var s=_4.marginBox(this.headerNodeContainer);if(_4.isIE){this.headerNodeContainer.style.width=s.w+this.getScrollbarWidth()+"px";}else{if(_4.isMoz){this.headerNodeContainer.style.width=s.w-this.getScrollbarWidth()+"px";this.scrollboxNode.scrollLeft=_870?this.scrollboxNode.clientWidth-this.scrollboxNode.scrollWidth:this.scrollboxNode.scrollWidth-this.scrollboxNode.clientWidth;}}}this.firstScroll++;}this.headerNode.scrollLeft=this.scrollboxNode.scrollLeft;var top=this.scrollboxNode.scrollTop;if(top!==this.lastTop){this.grid.scrollTo(top);}},setScrollTop:function(_871){this.lastTop=_871;this.scrollboxNode.scrollTop=_871;return this.scrollboxNode.scrollTop;},doContentEvent:function(e){if(this.content.decorateEvent(e)){this.grid.onContentEvent(e);}},doHeaderEvent:function(e){if(this.header.decorateEvent(e)){this.grid.onHeaderEvent(e);}},dispatchContentEvent:function(e){return this.content.dispatchEvent(e);},dispatchHeaderEvent:function(e){return this.header.dispatchEvent(e);},setColWidth:function(_872,_873){this.grid.setCellWidth(_872,_873+"px");},update:function(){if(!this.domNode){return;}this.content.update();this.grid.update();var left=this.scrollboxNode.scrollLeft;this.scrollboxNode.scrollLeft=left;this.headerNode.scrollLeft=left;}});_4.declare("dojox.grid._GridAvatar",_4.dnd.Avatar,{construct:function(){var dd=_4.doc;var a=dd.createElement("table");a.cellPadding=a.cellSpacing="0";a.className="dojoxGridDndAvatar";a.style.position="absolute";a.style.zIndex=1999;a.style.margin="0px";var b=dd.createElement("tbody");var tr=dd.createElement("tr");var td=dd.createElement("td");var img=dd.createElement("td");tr.className="dojoxGridDndAvatarItem";img.className="dojoxGridDndAvatarItemImage";img.style.width="16px";var _874=this.manager.source,node;if(_874.creator){node=_874._normalizedCreator(_874.getItem(this.manager.nodes[0].id).data,"avatar").node;}else{node=this.manager.nodes[0].cloneNode(true);var _875,_876;if(node.tagName.toLowerCase()=="tr"){_875=dd.createElement("table");_876=dd.createElement("tbody");_876.appendChild(node);_875.appendChild(_876);node=_875;}else{if(node.tagName.toLowerCase()=="th"){_875=dd.createElement("table");_876=dd.createElement("tbody");var r=dd.createElement("tr");_875.cellPadding=_875.cellSpacing="0";r.appendChild(node);_876.appendChild(r);_875.appendChild(_876);node=_875;}}}node.id="";td.appendChild(node);tr.appendChild(img);tr.appendChild(td);_4.style(tr,"opacity",0.9);b.appendChild(tr);a.appendChild(b);this.node=a;var m=_4.dnd.manager();this.oldOffsetY=m.OFFSET_Y;m.OFFSET_Y=1;},destroy:function(){_4.dnd.manager().OFFSET_Y=this.oldOffsetY;this.inherited(arguments);}});var _877=_4.dnd.manager().makeAvatar;_4.dnd.manager().makeAvatar=function(){var src=this.source;if(src.viewIndex!==undefined&&!_4.hasClass(_4.body(),"dijit_a11y")){return new _6.grid._GridAvatar(this);}return _877.call(_4.dnd.manager());};})();}if(!_4._hasResource["dojox.grid._RowSelector"]){_4._hasResource["dojox.grid._RowSelector"]=true;_4.provide("dojox.grid._RowSelector");_4.declare("dojox.grid._RowSelector",_6.grid._View,{defaultWidth:"2em",noscroll:true,padBorderWidth:2,buildRendering:function(){this.inherited("buildRendering",arguments);this.scrollboxNode.style.overflow="hidden";this.headerNode.style.visibility="hidden";},getWidth:function(){return this.viewWidth||this.defaultWidth;},buildRowContent:function(_878,_879){var w=this.contentWidth||0;_879.innerHTML="<table class=\"dojoxGridRowbarTable\" style=\"width:"+w+"px;height:1px;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" role=\"presentation\"><tr><td class=\"dojoxGridRowbarInner\">&nbsp;</td></tr></table>";},renderHeader:function(){},updateRow:function(){},resize:function(){this.adaptHeight();},adaptWidth:function(){if(!("contentWidth" in this)&&this.contentNode){this.contentWidth=this.contentNode.offsetWidth-this.padBorderWidth;}},doStyleRowNode:function(_87a,_87b){var n=["dojoxGridRowbar dojoxGridNonNormalizedCell"];if(this.grid.rows.isOver(_87a)){n.push("dojoxGridRowbarOver");}if(this.grid.selection.isSelected(_87a)){n.push("dojoxGridRowbarSelected");}_87b.className=n.join(" ");},domouseover:function(e){this.grid.onMouseOverRow(e);},domouseout:function(e){if(!this.isIntraRowEvent(e)){this.grid.onMouseOutRow(e);}}});}if(!_4._hasResource["dojox.grid._Layout"]){_4._hasResource["dojox.grid._Layout"]=true;_4.provide("dojox.grid._Layout");_4.declare("dojox.grid._Layout",null,{constructor:function(_87c){this.grid=_87c;},cells:[],structure:null,defaultWidth:"6em",moveColumn:function(_87d,_87e,_87f,_880,_881){var _882=this.structure[_87d].cells[0];var _883=this.structure[_87e].cells[0];var cell=null;var _884=0;var _885=0;for(var i=0,c;c=_882[i];i++){if(c.index==_87f){_884=i;break;}}cell=_882.splice(_884,1)[0];cell.view=this.grid.views.views[_87e];for(i=0,c=null;c=_883[i];i++){if(c.index==_880){_885=i;break;}}if(!_881){_885+=1;}_883.splice(_885,0,cell);var _886=this.grid.getCell(this.grid.getSortIndex());if(_886){_886._currentlySorted=this.grid.getSortAsc();}this.cells=[];_87f=0;var v;for(i=0;v=this.structure[i];i++){for(var j=0,cs;cs=v.cells[j];j++){for(var k=0;c=cs[k];k++){c.index=_87f;this.cells.push(c);if("_currentlySorted" in c){var si=_87f+1;si*=c._currentlySorted?1:-1;this.grid.sortInfo=si;delete c._currentlySorted;}_87f++;}}}_4.forEach(this.cells,function(c){var _887=c.markup[2].split(" ");var _888=parseInt(_887[1].substring(5));if(_888!=c.index){_887[1]="idx=\""+c.index+"\"";c.markup[2]=_887.join(" ");}});this.grid.setupHeaderMenu();},setColumnVisibility:function(_889,_88a){var cell=this.cells[_889];if(cell.hidden==_88a){cell.hidden=!_88a;var v=cell.view,w=v.viewWidth;if(w&&w!="auto"){v._togglingColumn=_4.marginBox(cell.getHeaderNode()).w||0;}v.update();return true;}else{return false;}},addCellDef:function(_88b,_88c,_88d){var self=this;var _88e=function(_88f){var w=0;if(_88f.colSpan>1){w=0;}else{w=_88f.width||self._defaultCellProps.width||self.defaultWidth;if(!isNaN(w)){w=w+"em";}}return w;};var _890={grid:this.grid,subrow:_88b,layoutIndex:_88c,index:this.cells.length};if(_88d&&_88d instanceof _6.grid.cells._Base){var _891=_4.clone(_88d);_890.unitWidth=_88e(_891._props);_891=_4.mixin(_891,this._defaultCellProps,_88d._props,_890);return _891;}var _892=_88d.type||_88d.cellType||this._defaultCellProps.type||this._defaultCellProps.cellType||_6.grid.cells.Cell;_890.unitWidth=_88e(_88d);return new _892(_4.mixin({},this._defaultCellProps,_88d,_890));},addRowDef:function(_893,_894){var _895=[];var _896=0,_897=0,_898=true;for(var i=0,def,cell;(def=_894[i]);i++){cell=this.addCellDef(_893,i,def);_895.push(cell);this.cells.push(cell);if(_898&&cell.relWidth){_896+=cell.relWidth;}else{if(cell.width){var w=cell.width;if(typeof w=="string"&&w.slice(-1)=="%"){_897+=window.parseInt(w,10);}else{if(w=="auto"){_898=false;}}}}}if(_896&&_898){_4.forEach(_895,function(cell){if(cell.relWidth){cell.width=cell.unitWidth=((cell.relWidth/_896)*(100-_897))+"%";}});}return _895;},addRowsDef:function(_899){var _89a=[];if(_4.isArray(_899)){if(_4.isArray(_899[0])){for(var i=0,row;_899&&(row=_899[i]);i++){_89a.push(this.addRowDef(i,row));}}else{_89a.push(this.addRowDef(0,_899));}}return _89a;},addViewDef:function(_89b){this._defaultCellProps=_89b.defaultCell||{};if(_89b.width&&_89b.width=="auto"){delete _89b.width;}return _4.mixin({},_89b,{cells:this.addRowsDef(_89b.rows||_89b.cells)});},setStructure:function(_89c){this.fieldIndex=0;this.cells=[];var s=this.structure=[];if(this.grid.rowSelector){var sel={type:_6._scopeName+".grid._RowSelector"};if(_4.isString(this.grid.rowSelector)){var _89d=this.grid.rowSelector;if(_89d=="false"){sel=null;}else{if(_89d!="true"){sel["width"]=_89d;}}}else{if(!this.grid.rowSelector){sel=null;}}if(sel){s.push(this.addViewDef(sel));}}var _89e=function(def){return ("name" in def||"field" in def||"get" in def);};var _89f=function(def){if(_4.isArray(def)){if(_4.isArray(def[0])||_89e(def[0])){return true;}}return false;};var _8a0=function(def){return (def!==null&&_4.isObject(def)&&("cells" in def||"rows" in def||("type" in def&&!_89e(def))));};if(_4.isArray(_89c)){var _8a1=false;for(var i=0,st;(st=_89c[i]);i++){if(_8a0(st)){_8a1=true;break;}}if(!_8a1){s.push(this.addViewDef({cells:_89c}));}else{for(i=0;(st=_89c[i]);i++){if(_89f(st)){s.push(this.addViewDef({cells:st}));}else{if(_8a0(st)){s.push(this.addViewDef(st));}}}}}else{if(_8a0(_89c)){s.push(this.addViewDef(_89c));}}this.cellCount=this.cells.length;this.grid.setupHeaderMenu();}});}if(!_4._hasResource["dojox.grid._ViewManager"]){_4._hasResource["dojox.grid._ViewManager"]=true;_4.provide("dojox.grid._ViewManager");_4.declare("dojox.grid._ViewManager",null,{constructor:function(_8a2){this.grid=_8a2;},defaultWidth:200,views:[],resize:function(){this.onEach("resize");},render:function(){this.onEach("render");},addView:function(_8a3){_8a3.idx=this.views.length;this.views.push(_8a3);},destroyViews:function(){for(var i=0,v;v=this.views[i];i++){v.destroy();}this.views=[];},getContentNodes:function(){var _8a4=[];for(var i=0,v;v=this.views[i];i++){_8a4.push(v.contentNode);}return _8a4;},forEach:function(_8a5){for(var i=0,v;v=this.views[i];i++){_8a5(v,i);}},onEach:function(_8a6,_8a7){_8a7=_8a7||[];for(var i=0,v;v=this.views[i];i++){if(_8a6 in v){v[_8a6].apply(v,_8a7);}}},normalizeHeaderNodeHeight:function(){var _8a8=[];for(var i=0,v;(v=this.views[i]);i++){if(v.headerContentNode.firstChild){_8a8.push(v.headerContentNode);}}this.normalizeRowNodeHeights(_8a8);},normalizeRowNodeHeights:function(_8a9){var h=0;var _8aa=[];if(this.grid.rowHeight){h=this.grid.rowHeight;}else{if(_8a9.length<=1){return;}for(var i=0,n;(n=_8a9[i]);i++){if(!_4.hasClass(n,"dojoxGridNonNormalizedCell")){_8aa[i]=n.firstChild.offsetHeight;h=Math.max(h,_8aa[i]);}}h=(h>=0?h:0);if(_4.isMoz&&h){h++;}}for(i=0;(n=_8a9[i]);i++){if(_8aa[i]!=h){n.firstChild.style.height=h+"px";}}},resetHeaderNodeHeight:function(){for(var i=0,v,n;(v=this.views[i]);i++){n=v.headerContentNode.firstChild;if(n){n.style.height="";}}},renormalizeRow:function(_8ab){var _8ac=[];for(var i=0,v,n;(v=this.views[i])&&(n=v.getRowNode(_8ab));i++){n.firstChild.style.height="";_8ac.push(n);}this.normalizeRowNodeHeights(_8ac);},getViewWidth:function(_8ad){return this.views[_8ad].getWidth()||this.defaultWidth;},measureHeader:function(){this.resetHeaderNodeHeight();this.forEach(function(_8ae){_8ae.headerContentNode.style.height="";});var h=0;this.forEach(function(_8af){h=Math.max(_8af.headerNode.offsetHeight,h);});return h;},measureContent:function(){var h=0;this.forEach(function(_8b0){h=Math.max(_8b0.domNode.offsetHeight,h);});return h;},findClient:function(_8b1){var c=this.grid.elasticView||-1;if(c<0){for(var i=1,v;(v=this.views[i]);i++){if(v.viewWidth){for(i=1;(v=this.views[i]);i++){if(!v.viewWidth){c=i;break;}}break;}}}if(c<0){c=Math.floor(this.views.length/2);}return c;},arrange:function(l,w){var i,v,vw,len=this.views.length;var c=(w<=0?len:this.findClient());var _8b2=function(v,l){var ds=v.domNode.style;var hs=v.headerNode.style;if(!_4._isBodyLtr()){ds.right=l+"px";if(_4.isMoz){hs.right=l+v.getScrollbarWidth()+"px";hs.width=parseInt(hs.width,10)-v.getScrollbarWidth()+"px";}else{hs.right=l+"px";}}else{ds.left=l+"px";hs.left=l+"px";}ds.top=0+"px";hs.top=0;};for(i=0;(v=this.views[i])&&(i<c);i++){vw=this.getViewWidth(i);v.setSize(vw,0);_8b2(v,l);if(v.headerContentNode&&v.headerContentNode.firstChild){vw=v.getColumnsWidth()+v.getScrollbarWidth();}else{vw=v.domNode.offsetWidth;}l+=vw;}i++;var r=w;for(var j=len-1;(v=this.views[j])&&(i<=j);j--){vw=this.getViewWidth(j);v.setSize(vw,0);vw=v.domNode.offsetWidth;r-=vw;_8b2(v,r);}if(c<len){v=this.views[c];vw=Math.max(1,r-l);v.setSize(vw+"px",0);_8b2(v,l);}return l;},renderRow:function(_8b3,_8b4,_8b5){var _8b6=[];for(var i=0,v,n,_8b7;(v=this.views[i])&&(n=_8b4[i]);i++){_8b7=v.renderRow(_8b3);n.appendChild(_8b7);_8b6.push(_8b7);}if(!_8b5){this.normalizeRowNodeHeights(_8b6);}},rowRemoved:function(_8b8){this.onEach("rowRemoved",[_8b8]);},updateRow:function(_8b9,_8ba){for(var i=0,v;v=this.views[i];i++){v.updateRow(_8b9);}if(!_8ba){this.renormalizeRow(_8b9);}},updateRowStyles:function(_8bb){this.onEach("updateRowStyles",[_8bb]);},setScrollTop:function(_8bc){var top=_8bc;for(var i=0,v;v=this.views[i];i++){top=v.setScrollTop(_8bc);if(_4.isIE&&v.headerNode&&v.scrollboxNode){v.headerNode.scrollLeft=v.scrollboxNode.scrollLeft;}}return top;},getFirstScrollingView:function(){for(var i=0,v;(v=this.views[i]);i++){if(v.hasHScrollbar()||v.hasVScrollbar()){return v;}}return null;}});}if(!_4._hasResource["dojox.grid._RowManager"]){_4._hasResource["dojox.grid._RowManager"]=true;_4.provide("dojox.grid._RowManager");(function(){var _8bd=function(_8be,_8bf){if(_8be.style.cssText==undefined){_8be.setAttribute("style",_8bf);}else{_8be.style.cssText=_8bf;}};_4.declare("dojox.grid._RowManager",null,{constructor:function(_8c0){this.grid=_8c0;},linesToEms:2,overRow:-2,prepareStylingRow:function(_8c1,_8c2){return {index:_8c1,node:_8c2,odd:Boolean(_8c1&1),selected:!!this.grid.selection.isSelected(_8c1),over:this.isOver(_8c1),customStyles:"",customClasses:"dojoxGridRow"};},styleRowNode:function(_8c3,_8c4){var row=this.prepareStylingRow(_8c3,_8c4);this.grid.onStyleRow(row);this.applyStyles(row);},applyStyles:function(_8c5){var i=_8c5;i.node.className=i.customClasses;var h=i.node.style.height;_8bd(i.node,i.customStyles+";"+(i.node._style||""));i.node.style.height=h;},updateStyles:function(_8c6){this.grid.updateRowStyles(_8c6);},setOverRow:function(_8c7){var last=this.overRow;this.overRow=_8c7;if((last!=this.overRow)&&(_4.isString(last)||last>=0)){this.updateStyles(last);}this.updateStyles(this.overRow);},isOver:function(_8c8){return (this.overRow==_8c8&&!_4.hasClass(this.grid.domNode,"dojoxGridColumnResizing"));}});})();}if(!_4._hasResource["dojox.grid._FocusManager"]){_4._hasResource["dojox.grid._FocusManager"]=true;_4.provide("dojox.grid._FocusManager");_4.declare("dojox.grid._FocusManager",null,{constructor:function(_8c9){this.grid=_8c9;this.cell=null;this.rowIndex=-1;this._connects=[];this._headerConnects=[];this.headerMenu=this.grid.headerMenu;this._connects.push(_4.connect(this.grid.domNode,"onfocus",this,"doFocus"));this._connects.push(_4.connect(this.grid.domNode,"onblur",this,"doBlur"));this._connects.push(_4.connect(this.grid.domNode,"oncontextmenu",this,"doContextMenu"));this._connects.push(_4.connect(this.grid.lastFocusNode,"onfocus",this,"doLastNodeFocus"));this._connects.push(_4.connect(this.grid.lastFocusNode,"onblur",this,"doLastNodeBlur"));this._connects.push(_4.connect(this.grid,"_onFetchComplete",this,"_delayedCellFocus"));this._connects.push(_4.connect(this.grid,"postrender",this,"_delayedHeaderFocus"));},destroy:function(){_4.forEach(this._connects,_4.disconnect);_4.forEach(this._headerConnects,_4.disconnect);delete this.grid;delete this.cell;},_colHeadNode:null,_colHeadFocusIdx:null,_contextMenuBindNode:null,tabbingOut:false,focusClass:"dojoxGridCellFocus",focusView:null,initFocusView:function(){this.focusView=this.grid.views.getFirstScrollingView()||this.focusView||this.grid.views.views[0];this._initColumnHeaders();},isFocusCell:function(_8ca,_8cb){return (this.cell==_8ca)&&(this.rowIndex==_8cb);},isLastFocusCell:function(){if(this.cell){return (this.rowIndex==this.grid.rowCount-1)&&(this.cell.index==this.grid.layout.cellCount-1);}return false;},isFirstFocusCell:function(){if(this.cell){return (this.rowIndex===0)&&(this.cell.index===0);}return false;},isNoFocusCell:function(){return (this.rowIndex<0)||!this.cell;},isNavHeader:function(){return (!!this._colHeadNode);},getHeaderIndex:function(){if(this._colHeadNode){return _4.indexOf(this._findHeaderCells(),this._colHeadNode);}else{return -1;}},_focusifyCellNode:function(_8cc){var n=this.cell&&this.cell.getNode(this.rowIndex);if(n){_4.toggleClass(n,this.focusClass,_8cc);if(_8cc){var sl=this.scrollIntoView();try{if(!this.grid.edit.isEditing()){_6.grid.util.fire(n,"focus");if(sl){this.cell.view.scrollboxNode.scrollLeft=sl;}}}catch(e){}}}},_delayedCellFocus:function(){if(this.isNavHeader()||!this.grid._focused){return;}var n=this.cell&&this.cell.getNode(this.rowIndex);if(n){try{if(!this.grid.edit.isEditing()){_4.toggleClass(n,this.focusClass,true);this.blurHeader();_6.grid.util.fire(n,"focus");}}catch(e){}}},_delayedHeaderFocus:function(){if(this.isNavHeader()){this.focusHeader();this.grid.domNode.focus();}},_initColumnHeaders:function(){_4.forEach(this._headerConnects,_4.disconnect);this._headerConnects=[];var _8cd=this._findHeaderCells();for(var i=0;i<_8cd.length;i++){this._headerConnects.push(_4.connect(_8cd[i],"onfocus",this,"doColHeaderFocus"));this._headerConnects.push(_4.connect(_8cd[i],"onblur",this,"doColHeaderBlur"));}},_findHeaderCells:function(){var _8ce=_4.query("th",this.grid.viewsHeaderNode);var _8cf=[];for(var i=0;i<_8ce.length;i++){var _8d0=_8ce[i];var _8d1=_4.hasAttr(_8d0,"tabIndex");var _8d2=_4.attr(_8d0,"tabIndex");if(_8d1&&_8d2<0){_8cf.push(_8d0);}}return _8cf;},_setActiveColHeader:function(_8d3,_8d4,_8d5){_4.attr(this.grid.domNode,"aria-activedescendant",_8d3.id);if(_8d5!=null&&_8d5>=0&&_8d5!=_8d4){_4.toggleClass(this._findHeaderCells()[_8d5],this.focusClass,false);}_4.toggleClass(_8d3,this.focusClass,true);this._colHeadNode=_8d3;this._colHeadFocusIdx=_8d4;this._scrollHeader(this._colHeadFocusIdx);},scrollIntoView:function(){var info=(this.cell?this._scrollInfo(this.cell):null);if(!info||!info.s){return null;}var rt=this.grid.scroller.findScrollTop(this.rowIndex);if(info.n&&info.sr){if(info.n.offsetLeft+info.n.offsetWidth>info.sr.l+info.sr.w){info.s.scrollLeft=info.n.offsetLeft+info.n.offsetWidth-info.sr.w;}else{if(info.n.offsetLeft<info.sr.l){info.s.scrollLeft=info.n.offsetLeft;}}}if(info.r&&info.sr){if(rt+info.r.offsetHeight>info.sr.t+info.sr.h){this.grid.setScrollTop(rt+info.r.offsetHeight-info.sr.h);}else{if(rt<info.sr.t){this.grid.setScrollTop(rt);}}}return info.s.scrollLeft;},_scrollInfo:function(cell,_8d6){if(cell){var cl=cell,sbn=cl.view.scrollboxNode,sbnr={w:sbn.clientWidth,l:sbn.scrollLeft,t:sbn.scrollTop,h:sbn.clientHeight},rn=cl.view.getRowNode(this.rowIndex);return {c:cl,s:sbn,sr:sbnr,n:(_8d6?_8d6:cell.getNode(this.rowIndex)),r:rn};}return null;},_scrollHeader:function(_8d7){var info=null;if(this._colHeadNode){var cell=this.grid.getCell(_8d7);info=this._scrollInfo(cell,cell.getNode(0));}if(info&&info.s&&info.sr&&info.n){var _8d8=info.sr.l+info.sr.w;if(info.n.offsetLeft+info.n.offsetWidth>_8d8){info.s.scrollLeft=info.n.offsetLeft+info.n.offsetWidth-info.sr.w;}else{if(info.n.offsetLeft<info.sr.l){info.s.scrollLeft=info.n.offsetLeft;}else{if(_4.isIE<=7&&cell&&cell.view.headerNode){cell.view.headerNode.scrollLeft=info.s.scrollLeft;}}}}},_isHeaderHidden:function(){var _8d9=this.focusView;if(!_8d9){for(var i=0,_8da;(_8da=this.grid.views.views[i]);i++){if(_8da.headerNode){_8d9=_8da;break;}}}return (_8d9&&_4.getComputedStyle(_8d9.headerNode).display=="none");},colSizeAdjust:function(e,_8db,_8dc){var _8dd=this._findHeaderCells();var view=this.focusView;if(!view){for(var i=0,_8de;(_8de=this.grid.views.views[i]);i++){if(_8de.header.tableMap.map){view=_8de;break;}}}var _8df=_8dd[_8db];if(!view||(_8db==_8dd.length-1&&_8db===0)){return;}view.content.baseDecorateEvent(e);e.cellNode=_8df;e.cellIndex=view.content.getCellNodeIndex(e.cellNode);e.cell=(e.cellIndex>=0?this.grid.getCell(e.cellIndex):null);if(view.header.canResize(e)){var _8e0={l:_8dc};var drag=view.header.colResizeSetup(e,false);view.header.doResizeColumn(drag,null,_8e0);view.update();}},styleRow:function(_8e1){return;},setFocusIndex:function(_8e2,_8e3){this.setFocusCell(this.grid.getCell(_8e3),_8e2);},setFocusCell:function(_8e4,_8e5){if(_8e4&&!this.isFocusCell(_8e4,_8e5)){this.tabbingOut=false;if(this._colHeadNode){this.blurHeader();}this._colHeadNode=this._colHeadFocusIdx=null;this.focusGridView();this._focusifyCellNode(false);this.cell=_8e4;this.rowIndex=_8e5;this._focusifyCellNode(true);}if(_4.isOpera){setTimeout(_4.hitch(this.grid,"onCellFocus",this.cell,this.rowIndex),1);}else{this.grid.onCellFocus(this.cell,this.rowIndex);}},next:function(){if(this.cell){var row=this.rowIndex,col=this.cell.index+1,cc=this.grid.layout.cellCount-1,rc=this.grid.rowCount-1;if(col>cc){col=0;row++;}if(row>rc){col=cc;row=rc;}if(this.grid.edit.isEditing()){var _8e6=this.grid.getCell(col);if(!this.isLastFocusCell()&&(!_8e6.editable||this.grid.canEdit&&!this.grid.canEdit(_8e6,row))){this.cell=_8e6;this.rowIndex=row;this.next();return;}}this.setFocusIndex(row,col);}},previous:function(){if(this.cell){var row=(this.rowIndex||0),col=(this.cell.index||0)-1;if(col<0){col=this.grid.layout.cellCount-1;row--;}if(row<0){row=0;col=0;}if(this.grid.edit.isEditing()){var _8e7=this.grid.getCell(col);if(!this.isFirstFocusCell()&&!_8e7.editable){this.cell=_8e7;this.rowIndex=row;this.previous();return;}}this.setFocusIndex(row,col);}},move:function(_8e8,_8e9){var _8ea=_8e9<0?-1:1;if(this.isNavHeader()){var _8eb=this._findHeaderCells();var _8ec=currentIdx=_4.indexOf(_8eb,this._colHeadNode);currentIdx+=_8e9;while(currentIdx>=0&&currentIdx<_8eb.length&&_8eb[currentIdx].style.display=="none"){currentIdx+=_8ea;}if((currentIdx>=0)&&(currentIdx<_8eb.length)){this._setActiveColHeader(_8eb[currentIdx],currentIdx,_8ec);}}else{if(this.cell){var sc=this.grid.scroller,r=this.rowIndex,rc=this.grid.rowCount-1,row=Math.min(rc,Math.max(0,r+_8e8));if(_8e8){if(_8e8>0){if(row>sc.getLastPageRow(sc.page)){this.grid.setScrollTop(this.grid.scrollTop+sc.findScrollTop(row)-sc.findScrollTop(r));}}else{if(_8e8<0){if(row<=sc.getPageRow(sc.page)){this.grid.setScrollTop(this.grid.scrollTop-sc.findScrollTop(r)-sc.findScrollTop(row));}}}}var cc=this.grid.layout.cellCount-1,i=this.cell.index,col=Math.min(cc,Math.max(0,i+_8e9));var cell=this.grid.getCell(col);while(col>=0&&col<cc&&cell&&cell.hidden===true){col+=_8ea;cell=this.grid.getCell(col);}if(!cell||cell.hidden===true){col=i;}var n=cell.getNode(row);if(!n&&_8e8){if((row+_8e8)>=0&&(row+_8e8)<=rc){this.move(_8e8>0?++_8e8:--_8e8,_8e9);}return;}else{if((!n||_4.style(n,"display")==="none")&&_8e9){if((col+_8e8)>=0&&(col+_8e8)<=cc){this.move(_8e8,_8e9>0?++_8e9:--_8e9);}return;}}this.setFocusIndex(row,col);if(_8e8){this.grid.updateRow(r);}}}},previousKey:function(e){if(this.grid.edit.isEditing()){_4.stopEvent(e);this.previous();}else{if(!this.isNavHeader()&&!this._isHeaderHidden()){this.grid.domNode.focus();_4.stopEvent(e);}else{this.tabOut(this.grid.domNode);if(this._colHeadFocusIdx!=null){_4.toggleClass(this._findHeaderCells()[this._colHeadFocusIdx],this.focusClass,false);this._colHeadFocusIdx=null;}this._focusifyCellNode(false);}}},nextKey:function(e){var _8ed=(this.grid.rowCount===0);if(e.target===this.grid.domNode&&this._colHeadFocusIdx==null){this.focusHeader();_4.stopEvent(e);}else{if(this.isNavHeader()){this.blurHeader();if(!this.findAndFocusGridCell()){this.tabOut(this.grid.lastFocusNode);}this._colHeadNode=this._colHeadFocusIdx=null;}else{if(this.grid.edit.isEditing()){_4.stopEvent(e);this.next();}else{this.tabOut(this.grid.lastFocusNode);}}}},tabOut:function(_8ee){this.tabbingOut=true;_8ee.focus();},focusGridView:function(){_6.grid.util.fire(this.focusView,"focus");},focusGrid:function(_8ef){this.focusGridView();this._focusifyCellNode(true);},findAndFocusGridCell:function(){var _8f0=true;var _8f1=(this.grid.rowCount===0);if(this.isNoFocusCell()&&!_8f1){var _8f2=0;var cell=this.grid.getCell(_8f2);if(cell.hidden){_8f2=this.isNavHeader()?this._colHeadFocusIdx:0;}this.setFocusIndex(0,_8f2);}else{if(this.cell&&!_8f1){if(this.focusView&&!this.focusView.rowNodes[this.rowIndex]){this.grid.scrollToRow(this.rowIndex);}this.focusGrid();}else{_8f0=false;}}this._colHeadNode=this._colHeadFocusIdx=null;return _8f0;},focusHeader:function(){var _8f3=this._findHeaderCells();var _8f4=this._colHeadFocusIdx;if(this._isHeaderHidden()){this.findAndFocusGridCell();}else{if(!this._colHeadFocusIdx){if(this.isNoFocusCell()){this._colHeadFocusIdx=0;}else{this._colHeadFocusIdx=this.cell.index;}}}this._colHeadNode=_8f3[this._colHeadFocusIdx];while(this._colHeadNode&&this._colHeadFocusIdx>=0&&this._colHeadFocusIdx<_8f3.length&&this._colHeadNode.style.display=="none"){this._colHeadFocusIdx++;this._colHeadNode=_8f3[this._colHeadFocusIdx];}if(this._colHeadNode&&this._colHeadNode.style.display!="none"){if(this.headerMenu&&this._contextMenuBindNode!=this.grid.domNode){this.headerMenu.unBindDomNode(this.grid.viewsHeaderNode);this.headerMenu.bindDomNode(this.grid.domNode);this._contextMenuBindNode=this.grid.domNode;}this._setActiveColHeader(this._colHeadNode,this._colHeadFocusIdx,_8f4);this._scrollHeader(this._colHeadFocusIdx);this._focusifyCellNode(false);}else{this.findAndFocusGridCell();}},blurHeader:function(){_4.removeClass(this._colHeadNode,this.focusClass);_4.removeAttr(this.grid.domNode,"aria-activedescendant");if(this.headerMenu&&this._contextMenuBindNode==this.grid.domNode){var _8f5=this.grid.viewsHeaderNode;this.headerMenu.unBindDomNode(this.grid.domNode);this.headerMenu.bindDomNode(_8f5);this._contextMenuBindNode=_8f5;}},doFocus:function(e){if(e&&e.target!=e.currentTarget){_4.stopEvent(e);return;}if(!this.tabbingOut){this.focusHeader();}this.tabbingOut=false;_4.stopEvent(e);},doBlur:function(e){_4.stopEvent(e);},doContextMenu:function(e){if(!this.headerMenu){_4.stopEvent(e);}},doLastNodeFocus:function(e){if(this.tabbingOut){this._focusifyCellNode(false);}else{if(this.grid.rowCount>0){if(this.isNoFocusCell()){this.setFocusIndex(0,0);}this._focusifyCellNode(true);}else{this.focusHeader();}}this.tabbingOut=false;_4.stopEvent(e);},doLastNodeBlur:function(e){_4.stopEvent(e);},doColHeaderFocus:function(e){this._setActiveColHeader(e.target,_4.attr(e.target,"idx"),this._colHeadFocusIdx);this._scrollHeader(this.getHeaderIndex());_4.stopEvent(e);},doColHeaderBlur:function(e){_4.toggleClass(e.target,this.focusClass,false);}});}if(!_4._hasResource["dojox.grid._EditManager"]){_4._hasResource["dojox.grid._EditManager"]=true;_4.provide("dojox.grid._EditManager");_4.declare("dojox.grid._EditManager",null,{constructor:function(_8f6){this.grid=_8f6;if(_4.isIE){this.connections=[_4.connect(document.body,"onfocus",_4.hitch(this,"_boomerangFocus"))];}else{this.connections=[_4.connect(this.grid,"onBlur",this,"apply")];}},info:{},destroy:function(){_4.forEach(this.connections,_4.disconnect);},cellFocus:function(_8f7,_8f8){if(this.grid.singleClickEdit||this.isEditRow(_8f8)){this.setEditCell(_8f7,_8f8);}else{this.apply();}if(this.isEditing()||(_8f7&&_8f7.editable&&_8f7.alwaysEditing)){this._focusEditor(_8f7,_8f8);}},rowClick:function(e){if(this.isEditing()&&!this.isEditRow(e.rowIndex)){this.apply();}},styleRow:function(_8f9){if(_8f9.index==this.info.rowIndex){_8f9.customClasses+=" dojoxGridRowEditing";}},dispatchEvent:function(e){var c=e.cell,ed=(c&&c["editable"])?c:0;return ed&&ed.dispatchEvent(e.dispatch,e);},isEditing:function(){return this.info.rowIndex!==undefined;},isEditCell:function(_8fa,_8fb){return (this.info.rowIndex===_8fa)&&(this.info.cell.index==_8fb);},isEditRow:function(_8fc){return this.info.rowIndex===_8fc;},setEditCell:function(_8fd,_8fe){if(!this.isEditCell(_8fe,_8fd.index)&&this.grid.canEdit&&this.grid.canEdit(_8fd,_8fe)){this.start(_8fd,_8fe,this.isEditRow(_8fe)||_8fd.editable);}},_focusEditor:function(_8ff,_900){_6.grid.util.fire(_8ff,"focus",[_900]);},focusEditor:function(){if(this.isEditing()){this._focusEditor(this.info.cell,this.info.rowIndex);}},_boomerangWindow:500,_shouldCatchBoomerang:function(){return this._catchBoomerang>new Date().getTime();},_boomerangFocus:function(){if(this._shouldCatchBoomerang()){this.grid.focus.focusGrid();this.focusEditor();this._catchBoomerang=0;}},_doCatchBoomerang:function(){if(_4.isIE){this._catchBoomerang=new Date().getTime()+this._boomerangWindow;}},start:function(_901,_902,_903){this.grid.beginUpdate();this.editorApply();if(this.isEditing()&&!this.isEditRow(_902)){this.applyRowEdit();this.grid.updateRow(_902);}if(_903){this.info={cell:_901,rowIndex:_902};this.grid.doStartEdit(_901,_902);this.grid.updateRow(_902);}else{this.info={};}this.grid.endUpdate();this.grid.focus.focusGrid();this._focusEditor(_901,_902);this._doCatchBoomerang();},_editorDo:function(_904){var c=this.info.cell;if(c&&c.editable){c[_904](this.info.rowIndex);}},editorApply:function(){this._editorDo("apply");},editorCancel:function(){this._editorDo("cancel");},applyCellEdit:function(_905,_906,_907){if(this.grid.canEdit(_906,_907)){this.grid.doApplyCellEdit(_905,_907,_906.field);}},applyRowEdit:function(){this.grid.doApplyEdit(this.info.rowIndex,this.info.cell.field);},apply:function(){if(this.isEditing()){this.grid.beginUpdate();this.editorApply();this.applyRowEdit();this.info={};this.grid.endUpdate();this.grid.focus.focusGrid();this._doCatchBoomerang();}},cancel:function(){if(this.isEditing()){this.grid.beginUpdate();this.editorCancel();this.info={};this.grid.endUpdate();this.grid.focus.focusGrid();this._doCatchBoomerang();}},save:function(_908,_909){var c=this.info.cell;if(this.isEditRow(_908)&&(!_909||c.view==_909)&&c.editable){c.save(c,this.info.rowIndex);}},restore:function(_90a,_90b){var c=this.info.cell;if(this.isEditRow(_90b)&&c.view==_90a&&c.editable){c.restore(c,this.info.rowIndex);}}});}if(!_4._hasResource["dojox.grid.Selection"]){_4._hasResource["dojox.grid.Selection"]=true;_4.provide("dojox.grid.Selection");_4.declare("dojox.grid.Selection",null,{constructor:function(_90c){this.grid=_90c;this.selected=[];this.setMode(_90c.selectionMode);},mode:"extended",selected:null,updating:0,selectedIndex:-1,setMode:function(mode){if(this.selected.length){this.deselectAll();}if(mode!="extended"&&mode!="multiple"&&mode!="single"&&mode!="none"){this.mode="extended";}else{this.mode=mode;}},onCanSelect:function(_90d){return this.grid.onCanSelect(_90d);},onCanDeselect:function(_90e){return this.grid.onCanDeselect(_90e);},onSelected:function(_90f){},onDeselected:function(_910){},onChanging:function(){},onChanged:function(){},isSelected:function(_911){if(this.mode=="none"){return false;}return this.selected[_911];},getFirstSelected:function(){if(!this.selected.length||this.mode=="none"){return -1;}for(var i=0,l=this.selected.length;i<l;i++){if(this.selected[i]){return i;}}return -1;},getNextSelected:function(_912){if(this.mode=="none"){return -1;}for(var i=_912+1,l=this.selected.length;i<l;i++){if(this.selected[i]){return i;}}return -1;},getSelected:function(){var _913=[];for(var i=0,l=this.selected.length;i<l;i++){if(this.selected[i]){_913.push(i);}}return _913;},getSelectedCount:function(){var c=0;for(var i=0;i<this.selected.length;i++){if(this.selected[i]){c++;}}return c;},_beginUpdate:function(){if(this.updating===0){this.onChanging();}this.updating++;},_endUpdate:function(){this.updating--;if(this.updating===0){this.onChanged();}},select:function(_914){if(this.mode=="none"){return;}if(this.mode!="multiple"){this.deselectAll(_914);this.addToSelection(_914);}else{this.toggleSelect(_914);}},addToSelection:function(_915){if(this.mode=="none"){return;}if(_4.isArray(_915)){_4.forEach(_915,this.addToSelection,this);return;}_915=Number(_915);if(this.selected[_915]){this.selectedIndex=_915;}else{if(this.onCanSelect(_915)!==false){this.selectedIndex=_915;var _916=this.grid.getRowNode(_915);if(_916){_4.attr(_916,"aria-selected","true");}this._beginUpdate();this.selected[_915]=true;this.onSelected(_915);this._endUpdate();}}},deselect:function(_917){if(this.mode=="none"){return;}if(_4.isArray(_917)){_4.forEach(_917,this.deselect,this);return;}_917=Number(_917);if(this.selectedIndex==_917){this.selectedIndex=-1;}if(this.selected[_917]){if(this.onCanDeselect(_917)===false){return;}var _918=this.grid.getRowNode(_917);if(_918){_4.attr(_918,"aria-selected","false");}this._beginUpdate();delete this.selected[_917];this.onDeselected(_917);this._endUpdate();}},setSelected:function(_919,_91a){this[(_91a?"addToSelection":"deselect")](_919);},toggleSelect:function(_91b){if(_4.isArray(_91b)){_4.forEach(_91b,this.toggleSelect,this);return;}this.setSelected(_91b,!this.selected[_91b]);},_range:function(_91c,inTo,func){var s=(_91c>=0?_91c:inTo),e=inTo;if(s>e){e=s;s=inTo;}for(var i=s;i<=e;i++){func(i);}},selectRange:function(_91d,inTo){this._range(_91d,inTo,_4.hitch(this,"addToSelection"));},deselectRange:function(_91e,inTo){this._range(_91e,inTo,_4.hitch(this,"deselect"));},insert:function(_91f){this.selected.splice(_91f,0,false);if(this.selectedIndex>=_91f){this.selectedIndex++;}},remove:function(_920){this.selected.splice(_920,1);if(this.selectedIndex>=_920){this.selectedIndex--;}},deselectAll:function(_921){for(var i in this.selected){if((i!=_921)&&(this.selected[i]===true)){this.deselect(i);}}},clickSelect:function(_922,_923,_924){if(this.mode=="none"){return;}this._beginUpdate();if(this.mode!="extended"){this.select(_922);}else{var _925=this.selectedIndex;if(!_923){this.deselectAll(_922);}if(_924){this.selectRange(_925,_922);}else{if(_923){this.toggleSelect(_922);}else{this.addToSelection(_922);}}}this._endUpdate();},clickSelectEvent:function(e){this.clickSelect(e.rowIndex,_4.isCopyKey(e),e.shiftKey);},clear:function(){this._beginUpdate();this.deselectAll();this._endUpdate();}});}if(!_4._hasResource["dojox.grid._Events"]){_4._hasResource["dojox.grid._Events"]=true;_4.provide("dojox.grid._Events");_4.declare("dojox.grid._Events",null,{cellOverClass:"dojoxGridCellOver",onKeyEvent:function(e){this.dispatchKeyEvent(e);},onContentEvent:function(e){this.dispatchContentEvent(e);},onHeaderEvent:function(e){this.dispatchHeaderEvent(e);},onStyleRow:function(_926){var i=_926;i.customClasses+=(i.odd?" dojoxGridRowOdd":"")+(i.selected?" dojoxGridRowSelected":"")+(i.over?" dojoxGridRowOver":"");this.focus.styleRow(_926);this.edit.styleRow(_926);},onKeyDown:function(e){if(e.altKey||e.metaKey){return;}var dk=_4.keys;var _927;switch(e.keyCode){case dk.ESCAPE:this.edit.cancel();break;case dk.ENTER:if(!this.edit.isEditing()){_927=this.focus.getHeaderIndex();if(_927>=0){this.setSortIndex(_927);break;}else{this.selection.clickSelect(this.focus.rowIndex,_4.isCopyKey(e),e.shiftKey);}_4.stopEvent(e);}if(!e.shiftKey){var _928=this.edit.isEditing();this.edit.apply();if(!_928){this.edit.setEditCell(this.focus.cell,this.focus.rowIndex);}}if(!this.edit.isEditing()){var _929=this.focus.focusView||this.views.views[0];_929.content.decorateEvent(e);this.onRowClick(e);_4.stopEvent(e);}break;case dk.SPACE:if(!this.edit.isEditing()){_927=this.focus.getHeaderIndex();if(_927>=0){this.setSortIndex(_927);break;}else{this.selection.clickSelect(this.focus.rowIndex,_4.isCopyKey(e),e.shiftKey);}_4.stopEvent(e);}break;case dk.TAB:this.focus[e.shiftKey?"previousKey":"nextKey"](e);break;case dk.LEFT_ARROW:case dk.RIGHT_ARROW:if(!this.edit.isEditing()){var _92a=e.keyCode;_4.stopEvent(e);_927=this.focus.getHeaderIndex();if(_927>=0&&(e.shiftKey&&e.ctrlKey)){this.focus.colSizeAdjust(e,_927,(_92a==dk.LEFT_ARROW?-1:1)*5);}else{var _92b=(_92a==dk.LEFT_ARROW)?1:-1;if(_4._isBodyLtr()){_92b*=-1;}this.focus.move(0,_92b);}}break;case dk.UP_ARROW:if(!this.edit.isEditing()&&this.focus.rowIndex!==0){_4.stopEvent(e);this.focus.move(-1,0);}break;case dk.DOWN_ARROW:if(!this.edit.isEditing()&&this.focus.rowIndex+1!=this.rowCount){_4.stopEvent(e);this.focus.move(1,0);}break;case dk.PAGE_UP:if(!this.edit.isEditing()&&this.focus.rowIndex!==0){_4.stopEvent(e);if(this.focus.rowIndex!=this.scroller.firstVisibleRow+1){this.focus.move(this.scroller.firstVisibleRow-this.focus.rowIndex,0);}else{this.setScrollTop(this.scroller.findScrollTop(this.focus.rowIndex-1));this.focus.move(this.scroller.firstVisibleRow-this.scroller.lastVisibleRow+1,0);}}break;case dk.PAGE_DOWN:if(!this.edit.isEditing()&&this.focus.rowIndex+1!=this.rowCount){_4.stopEvent(e);if(this.focus.rowIndex!=this.scroller.lastVisibleRow-1){this.focus.move(this.scroller.lastVisibleRow-this.focus.rowIndex-1,0);}else{this.setScrollTop(this.scroller.findScrollTop(this.focus.rowIndex+1));this.focus.move(this.scroller.lastVisibleRow-this.scroller.firstVisibleRow-1,0);}}break;default:break;}},onMouseOver:function(e){e.rowIndex==-1?this.onHeaderCellMouseOver(e):this.onCellMouseOver(e);},onMouseOut:function(e){e.rowIndex==-1?this.onHeaderCellMouseOut(e):this.onCellMouseOut(e);},onMouseDown:function(e){e.rowIndex==-1?this.onHeaderCellMouseDown(e):this.onCellMouseDown(e);},onMouseOverRow:function(e){if(!this.rows.isOver(e.rowIndex)){this.rows.setOverRow(e.rowIndex);e.rowIndex==-1?this.onHeaderMouseOver(e):this.onRowMouseOver(e);}},onMouseOutRow:function(e){if(this.rows.isOver(-1)){this.onHeaderMouseOut(e);}else{if(!this.rows.isOver(-2)){this.rows.setOverRow(-2);this.onRowMouseOut(e);}}},onMouseDownRow:function(e){if(e.rowIndex!=-1){this.onRowMouseDown(e);}},onCellMouseOver:function(e){if(e.cellNode){_4.addClass(e.cellNode,this.cellOverClass);}},onCellMouseOut:function(e){if(e.cellNode){_4.removeClass(e.cellNode,this.cellOverClass);}},onCellMouseDown:function(e){},onCellClick:function(e){this._click[0]=this._click[1];this._click[1]=e;if(!this.edit.isEditCell(e.rowIndex,e.cellIndex)){this.focus.setFocusCell(e.cell,e.rowIndex);}this.onRowClick(e);},onCellDblClick:function(e){if(this._click.length>1&&_4.isIE){this.edit.setEditCell(this._click[1].cell,this._click[1].rowIndex);}else{if(this._click.length>1&&this._click[0].rowIndex!=this._click[1].rowIndex){this.edit.setEditCell(this._click[0].cell,this._click[0].rowIndex);}else{this.edit.setEditCell(e.cell,e.rowIndex);}}this.onRowDblClick(e);},onCellContextMenu:function(e){this.onRowContextMenu(e);},onCellFocus:function(_92c,_92d){this.edit.cellFocus(_92c,_92d);},onRowClick:function(e){this.edit.rowClick(e);this.selection.clickSelectEvent(e);},onRowDblClick:function(e){},onRowMouseOver:function(e){},onRowMouseOut:function(e){},onRowMouseDown:function(e){},onRowContextMenu:function(e){_4.stopEvent(e);},onHeaderMouseOver:function(e){},onHeaderMouseOut:function(e){},onHeaderCellMouseOver:function(e){if(e.cellNode){_4.addClass(e.cellNode,this.cellOverClass);}},onHeaderCellMouseOut:function(e){if(e.cellNode){_4.removeClass(e.cellNode,this.cellOverClass);}},onHeaderCellMouseDown:function(e){},onHeaderClick:function(e){},onHeaderCellClick:function(e){this.setSortIndex(e.cell.index);this.onHeaderClick(e);},onHeaderDblClick:function(e){},onHeaderCellDblClick:function(e){this.onHeaderDblClick(e);},onHeaderCellContextMenu:function(e){this.onHeaderContextMenu(e);},onHeaderContextMenu:function(e){if(!this.headerMenu){_4.stopEvent(e);}},onStartEdit:function(_92e,_92f){},onApplyCellEdit:function(_930,_931,_932){},onCancelEdit:function(_933){},onApplyEdit:function(_934){},onCanSelect:function(_935){return true;},onCanDeselect:function(_936){return true;},onSelected:function(_937){this.updateRowStyles(_937);},onDeselected:function(_938){this.updateRowStyles(_938);},onSelectionChanged:function(){}});}if(!_4._hasResource["dojox.grid._Grid"]){_4._hasResource["dojox.grid._Grid"]=true;_4.provide("dojox.grid._Grid");(function(){if(!_4.isCopyKey){_4.isCopyKey=_4.dnd.getCopyKeyState;}_4.declare("dojox.grid._Grid",[_5._Widget,_5._Templated,_6.grid._Events],{templateString:"<div hidefocus=\"hidefocus\" role=\"grid\" dojoAttachEvent=\"onmouseout:_mouseOut\">\r\n\t<div class=\"dojoxGridMasterHeader\" dojoAttachPoint=\"viewsHeaderNode\" role=\"presentation\"></div>\r\n\t<div class=\"dojoxGridMasterView\" dojoAttachPoint=\"viewsNode\" role=\"presentation\"></div>\r\n\t<div class=\"dojoxGridMasterMessages\" style=\"display: none;\" dojoAttachPoint=\"messagesNode\"></div>\r\n\t<span dojoAttachPoint=\"lastFocusNode\" tabindex=\"0\"></span>\r\n</div>\r\n",classTag:"dojoxGrid",rowCount:5,keepRows:75,rowsPerPage:25,autoWidth:false,initialWidth:"",autoHeight:"",rowHeight:0,autoRender:true,defaultHeight:"15em",height:"",structure:null,elasticView:-1,singleClickEdit:false,selectionMode:"extended",rowSelector:"",columnReordering:false,headerMenu:null,placeholderLabel:"GridColumns",selectable:false,_click:null,loadingMessage:"<span class='dojoxGridLoading'>${loadingState}</span>",errorMessage:"<span class='dojoxGridError'>${errorState}</span>",noDataMessage:"",escapeHTMLInData:true,formatterScope:null,editable:false,sortInfo:0,themeable:true,_placeholders:null,_layoutClass:_6.grid._Layout,buildRendering:function(){this.inherited(arguments);if(!this.domNode.getAttribute("tabIndex")){this.domNode.tabIndex="0";}this.createScroller();this.createLayout();this.createViews();this.createManagers();this.createSelection();this.connect(this.selection,"onSelected","onSelected");this.connect(this.selection,"onDeselected","onDeselected");this.connect(this.selection,"onChanged","onSelectionChanged");_6.html.metrics.initOnFontResize();this.connect(_6.html.metrics,"onFontResize","textSizeChanged");_6.grid.util.funnelEvents(this.domNode,this,"doKeyEvent",_6.grid.util.keyEvents);if(this.selectionMode!="none"){_4.attr(this.domNode,"aria-multiselectable",this.selectionMode=="single"?"false":"true");}_4.addClass(this.domNode,this.classTag);if(!this.isLeftToRight()){_4.addClass(this.domNode,this.classTag+"Rtl");}},postMixInProperties:function(){this.inherited(arguments);var _939=_4.i18n.getLocalization("dijit","loading",this.lang);this.loadingMessage=_4.string.substitute(this.loadingMessage,_939);this.errorMessage=_4.string.substitute(this.errorMessage,_939);if(this.srcNodeRef&&this.srcNodeRef.style.height){this.height=this.srcNodeRef.style.height;}this._setAutoHeightAttr(this.autoHeight,true);this.lastScrollTop=this.scrollTop=0;},postCreate:function(){this._placeholders=[];this._setHeaderMenuAttr(this.headerMenu);this._setStructureAttr(this.structure);this._click=[];this.inherited(arguments);if(this.domNode&&this.autoWidth&&this.initialWidth){this.domNode.style.width=this.initialWidth;}if(this.domNode&&!this.editable){_4.attr(this.domNode,"aria-readonly","true");}},destroy:function(){this.domNode.onReveal=null;this.domNode.onSizeChange=null;delete this._click;this.edit.destroy();delete this.edit;this.views.destroyViews();if(this.scroller){this.scroller.destroy();delete this.scroller;}if(this.focus){this.focus.destroy();delete this.focus;}if(this.headerMenu&&this._placeholders.length){_4.forEach(this._placeholders,function(p){p.unReplace(true);});this.headerMenu.unBindDomNode(this.viewsHeaderNode);}this.inherited(arguments);},_setAutoHeightAttr:function(ah,_93a){if(typeof ah=="string"){if(!ah||ah=="false"){ah=false;}else{if(ah=="true"){ah=true;}else{ah=window.parseInt(ah,10);}}}if(typeof ah=="number"){if(isNaN(ah)){ah=false;}if(ah<0){ah=true;}else{if(ah===0){ah=false;}}}this.autoHeight=ah;if(typeof ah=="boolean"){this._autoHeight=ah;}else{if(typeof ah=="number"){this._autoHeight=(ah>=this.get("rowCount"));}else{this._autoHeight=false;}}if(this._started&&!_93a){this.render();}},_getRowCountAttr:function(){return this.updating&&this.invalidated&&this.invalidated.rowCount!=undefined?this.invalidated.rowCount:this.rowCount;},textSizeChanged:function(){this.render();},sizeChange:function(){this.update();},createManagers:function(){this.rows=new _6.grid._RowManager(this);this.focus=new _6.grid._FocusManager(this);this.edit=new _6.grid._EditManager(this);},createSelection:function(){this.selection=new _6.grid.Selection(this);},createScroller:function(){this.scroller=new _6.grid._Scroller();this.scroller.grid=this;this.scroller.renderRow=_4.hitch(this,"renderRow");this.scroller.removeRow=_4.hitch(this,"rowRemoved");},createLayout:function(){this.layout=new this._layoutClass(this);this.connect(this.layout,"moveColumn","onMoveColumn");},onMoveColumn:function(){this.render();},onResizeColumn:function(_93b){},createViews:function(){this.views=new _6.grid._ViewManager(this);this.views.createView=_4.hitch(this,"createView");},createView:function(_93c,idx){var c=_4.getObject(_93c);var view=new c({grid:this,index:idx});this.viewsNode.appendChild(view.domNode);this.viewsHeaderNode.appendChild(view.headerNode);this.views.addView(view);_4.attr(this.domNode,"align",_4._isBodyLtr()?"left":"right");return view;},buildViews:function(){for(var i=0,vs;(vs=this.layout.structure[i]);i++){this.createView(vs.type||_6._scopeName+".grid._View",i).setStructure(vs);}this.scroller.setContentNodes(this.views.getContentNodes());},_setStructureAttr:function(_93d){var s=_93d;if(s&&_4.isString(s)){_4.deprecated("dojox.grid._Grid.set('structure', 'objVar')","use dojox.grid._Grid.set('structure', objVar) instead","2.0");s=_4.getObject(s);}this.structure=s;if(!s){if(this.layout.structure){s=this.layout.structure;}else{return;}}this.views.destroyViews();this.focus.focusView=null;if(s!==this.layout.structure){this.layout.setStructure(s);}this._structureChanged();},setStructure:function(_93e){_4.deprecated("dojox.grid._Grid.setStructure(obj)","use dojox.grid._Grid.set('structure', obj) instead.","2.0");this._setStructureAttr(_93e);},getColumnTogglingItems:function(){return _4.map(this.layout.cells,function(cell){if(!cell.menuItems){cell.menuItems=[];}var self=this;var item=new _5.CheckedMenuItem({label:cell.name,checked:!cell.hidden,_gridCell:cell,onChange:function(_93f){if(self.layout.setColumnVisibility(this._gridCell.index,_93f)){var _940=this._gridCell.menuItems;if(_940.length>1){_4.forEach(_940,function(item){if(item!==this){item.setAttribute("checked",_93f);}},this);}_93f=_4.filter(self.layout.cells,function(c){if(c.menuItems.length>1){_4.forEach(c.menuItems,"item.set('disabled', false);");}else{c.menuItems[0].set("disabled",false);}return !c.hidden;});if(_93f.length==1){_4.forEach(_93f[0].menuItems,"item.set('disabled', true);");}}},destroy:function(){var _941=_4.indexOf(this._gridCell.menuItems,this);this._gridCell.menuItems.splice(_941,1);delete this._gridCell;_5.CheckedMenuItem.prototype.destroy.apply(this,arguments);}});cell.menuItems.push(item);return item;},this);},_setHeaderMenuAttr:function(menu){if(this._placeholders&&this._placeholders.length){_4.forEach(this._placeholders,function(p){p.unReplace(true);});this._placeholders=[];}if(this.headerMenu){this.headerMenu.unBindDomNode(this.viewsHeaderNode);}this.headerMenu=menu;if(!menu){return;}this.headerMenu.bindDomNode(this.viewsHeaderNode);if(this.headerMenu.getPlaceholders){this._placeholders=this.headerMenu.getPlaceholders(this.placeholderLabel);}},setHeaderMenu:function(menu){_4.deprecated("dojox.grid._Grid.setHeaderMenu(obj)","use dojox.grid._Grid.set('headerMenu', obj) instead.","2.0");this._setHeaderMenuAttr(menu);},setupHeaderMenu:function(){if(this._placeholders&&this._placeholders.length){_4.forEach(this._placeholders,function(p){if(p._replaced){p.unReplace(true);}p.replace(this.getColumnTogglingItems());},this);}},_fetch:function(_942){this.setScrollTop(0);},getItem:function(_943){return null;},showMessage:function(_944){if(_944){this.messagesNode.innerHTML=_944;this.messagesNode.style.display="";}else{this.messagesNode.innerHTML="";this.messagesNode.style.display="none";}},_structureChanged:function(){this.buildViews();if(this.autoRender&&this._started){this.render();}},hasLayout:function(){return this.layout.cells.length;},resize:function(_945,_946){this._pendingChangeSize=_945;this._pendingResultSize=_946;this.sizeChange();},_getPadBorder:function(){this._padBorder=this._padBorder||_4._getPadBorderExtents(this.domNode);return this._padBorder;},_getHeaderHeight:function(){var vns=this.viewsHeaderNode.style,t=vns.display=="none"?0:this.views.measureHeader();vns.height=t+"px";this.views.normalizeHeaderNodeHeight();return t;},_resize:function(_947,_948){_947=_947||this._pendingChangeSize;_948=_948||this._pendingResultSize;delete this._pendingChangeSize;delete this._pendingResultSize;if(!this.domNode){return;}var pn=this.domNode.parentNode;if(!pn||pn.nodeType!=1||!this.hasLayout()||pn.style.visibility=="hidden"||pn.style.display=="none"){return;}var _949=this._getPadBorder();var hh=undefined;var h;if(this._autoHeight){this.domNode.style.height="auto";}else{if(typeof this.autoHeight=="number"){h=hh=this._getHeaderHeight();h+=(this.scroller.averageRowHeight*this.autoHeight);this.domNode.style.height=h+"px";}else{if(this.domNode.clientHeight<=_949.h){if(pn==document.body){this.domNode.style.height=this.defaultHeight;}else{if(this.height){this.domNode.style.height=this.height;}else{this.fitTo="parent";}}}}}if(_948){_947=_948;}if(_947){_4.marginBox(this.domNode,_947);this.height=this.domNode.style.height;delete this.fitTo;}else{if(this.fitTo=="parent"){h=this._parentContentBoxHeight=this._parentContentBoxHeight||_4._getContentBox(pn).h;this.domNode.style.height=Math.max(0,h)+"px";}}var _94a=_4.some(this.views.views,function(v){return v.flexCells;});if(!this._autoHeight&&(h||_4._getContentBox(this.domNode).h)===0){this.viewsHeaderNode.style.display="none";}else{this.viewsHeaderNode.style.display="block";if(!_94a&&hh===undefined){hh=this._getHeaderHeight();}}if(_94a){hh=undefined;}this.adaptWidth();this.adaptHeight(hh);this.postresize();},adaptWidth:function(){var _94b=(!this.initialWidth&&this.autoWidth);var w=_94b?0:this.domNode.clientWidth||(this.domNode.offsetWidth-this._getPadBorder().w),vw=this.views.arrange(1,w);this.views.onEach("adaptWidth");if(_94b){this.domNode.style.width=vw+"px";}},adaptHeight:function(_94c){var t=_94c===undefined?this._getHeaderHeight():_94c;var h=(this._autoHeight?-1:Math.max(this.domNode.clientHeight-t,0)||0);this.views.onEach("setSize",[0,h]);this.views.onEach("adaptHeight");if(!this._autoHeight){var _94d=0,_94e=0;var _94f=_4.filter(this.views.views,function(v){var has=v.hasHScrollbar();if(has){_94d++;}else{_94e++;}return (!has);});if(_94d>0&&_94e>0){_4.forEach(_94f,function(v){v.adaptHeight(true);});}}if(this.autoHeight===true||h!=-1||(typeof this.autoHeight=="number"&&this.autoHeight>=this.get("rowCount"))){this.scroller.windowHeight=h;}else{this.scroller.windowHeight=Math.max(this.domNode.clientHeight-t,0);}},startup:function(){if(this._started){return;}this.inherited(arguments);if(this.autoRender){this.render();}},render:function(){if(!this.domNode){return;}if(!this._started){return;}if(!this.hasLayout()){this.scroller.init(0,this.keepRows,this.rowsPerPage);return;}this.update=this.defaultUpdate;this._render();},_render:function(){this.scroller.init(this.get("rowCount"),this.keepRows,this.rowsPerPage);this.prerender();this.setScrollTop(0);this.postrender();},prerender:function(){this.keepRows=this._autoHeight?0:this.keepRows;this.scroller.setKeepInfo(this.keepRows);this.views.render();this._resize();},postrender:function(){this.postresize();this.focus.initFocusView();_4.setSelectable(this.domNode,this.selectable);},postresize:function(){if(this._autoHeight){var size=Math.max(this.views.measureContent())+"px";this.viewsNode.style.height=size;}},renderRow:function(_950,_951){this.views.renderRow(_950,_951,this._skipRowRenormalize);},rowRemoved:function(_952){this.views.rowRemoved(_952);},invalidated:null,updating:false,beginUpdate:function(){this.invalidated=[];this.updating=true;},endUpdate:function(){this.updating=false;var i=this.invalidated,r;if(i.all){this.update();}else{if(i.rowCount!=undefined){this.updateRowCount(i.rowCount);}else{for(r in i){this.updateRow(Number(r));}}}this.invalidated=[];},defaultUpdate:function(){if(!this.domNode){return;}if(this.updating){this.invalidated.all=true;return;}this.lastScrollTop=this.scrollTop;this.prerender();this.scroller.invalidateNodes();this.setScrollTop(this.lastScrollTop);this.postrender();},update:function(){this.render();},updateRow:function(_953){_953=Number(_953);if(this.updating){this.invalidated[_953]=true;}else{this.views.updateRow(_953);this.scroller.rowHeightChanged(_953);}},updateRows:function(_954,_955){_954=Number(_954);_955=Number(_955);var i;if(this.updating){for(i=0;i<_955;i++){this.invalidated[i+_954]=true;}}else{for(i=0;i<_955;i++){this.views.updateRow(i+_954,this._skipRowRenormalize);}this.scroller.rowHeightChanged(_954);}},updateRowCount:function(_956){if(this.updating){this.invalidated.rowCount=_956;}else{this.rowCount=_956;this._setAutoHeightAttr(this.autoHeight,true);if(this.layout.cells.length){this.scroller.updateRowCount(_956);}this._resize();if(this.layout.cells.length){this.setScrollTop(this.scrollTop);}}},updateRowStyles:function(_957){this.views.updateRowStyles(_957);},getRowNode:function(_958){if(this.focus.focusView&&!(this.focus.focusView instanceof _6.grid._RowSelector)){return this.focus.focusView.rowNodes[_958];}else{for(var i=0,_959;(_959=this.views.views[i]);i++){if(!(_959 instanceof _6.grid._RowSelector)){return _959.rowNodes[_958];}}}return null;},rowHeightChanged:function(_95a){this.views.renormalizeRow(_95a);this.scroller.rowHeightChanged(_95a);},fastScroll:true,delayScroll:false,scrollRedrawThreshold:(_4.isIE?100:50),scrollTo:function(_95b){if(!this.fastScroll){this.setScrollTop(_95b);return;}var _95c=Math.abs(this.lastScrollTop-_95b);this.lastScrollTop=_95b;if(_95c>this.scrollRedrawThreshold||this.delayScroll){this.delayScroll=true;this.scrollTop=_95b;this.views.setScrollTop(_95b);if(this._pendingScroll){window.clearTimeout(this._pendingScroll);}var _95d=this;this._pendingScroll=window.setTimeout(function(){delete _95d._pendingScroll;_95d.finishScrollJob();},200);}else{this.setScrollTop(_95b);}},finishScrollJob:function(){this.delayScroll=false;this.setScrollTop(this.scrollTop);},setScrollTop:function(_95e){this.scroller.scroll(this.views.setScrollTop(_95e));},scrollToRow:function(_95f){this.setScrollTop(this.scroller.findScrollTop(_95f)+1);},styleRowNode:function(_960,_961){if(_961){this.rows.styleRowNode(_960,_961);}},_mouseOut:function(e){this.rows.setOverRow(-2);},getCell:function(_962){return this.layout.cells[_962];},setCellWidth:function(_963,_964){this.getCell(_963).unitWidth=_964;},getCellName:function(_965){return "Cell "+_965.index;},canSort:function(_966){},sort:function(){},getSortAsc:function(_967){_967=_967==undefined?this.sortInfo:_967;return Boolean(_967>0);},getSortIndex:function(_968){_968=_968==undefined?this.sortInfo:_968;return Math.abs(_968)-1;},setSortIndex:function(_969,_96a){var si=_969+1;if(_96a!=undefined){si*=(_96a?1:-1);}else{if(this.getSortIndex()==_969){si=-this.sortInfo;}}this.setSortInfo(si);},setSortInfo:function(_96b){if(this.canSort(_96b)){this.sortInfo=_96b;this.sort();this.update();}},doKeyEvent:function(e){e.dispatch="do"+e.type;this.onKeyEvent(e);},_dispatch:function(m,e){if(m in this){return this[m](e);}return false;},dispatchKeyEvent:function(e){this._dispatch(e.dispatch,e);},dispatchContentEvent:function(e){this.edit.dispatchEvent(e)||e.sourceView.dispatchContentEvent(e)||this._dispatch(e.dispatch,e);},dispatchHeaderEvent:function(e){e.sourceView.dispatchHeaderEvent(e)||this._dispatch("doheader"+e.type,e);},dokeydown:function(e){this.onKeyDown(e);},doclick:function(e){if(e.cellNode){this.onCellClick(e);}else{this.onRowClick(e);}},dodblclick:function(e){if(e.cellNode){this.onCellDblClick(e);}else{this.onRowDblClick(e);}},docontextmenu:function(e){if(e.cellNode){this.onCellContextMenu(e);}else{this.onRowContextMenu(e);}},doheaderclick:function(e){if(e.cellNode){this.onHeaderCellClick(e);}else{this.onHeaderClick(e);}},doheaderdblclick:function(e){if(e.cellNode){this.onHeaderCellDblClick(e);}else{this.onHeaderDblClick(e);}},doheadercontextmenu:function(e){if(e.cellNode){this.onHeaderCellContextMenu(e);}else{this.onHeaderContextMenu(e);}},doStartEdit:function(_96c,_96d){this.onStartEdit(_96c,_96d);},doApplyCellEdit:function(_96e,_96f,_970){this.onApplyCellEdit(_96e,_96f,_970);},doCancelEdit:function(_971){this.onCancelEdit(_971);},doApplyEdit:function(_972){this.onApplyEdit(_972);},addRow:function(){this.updateRowCount(this.get("rowCount")+1);},removeSelectedRows:function(){if(this.allItemsSelected){this.updateRowCount(0);}else{this.updateRowCount(Math.max(0,this.get("rowCount")-this.selection.getSelected().length));}this.selection.clear();}});_6.grid._Grid.markupFactory=function(_973,node,ctor,_974){var d=_4;var _975=function(n){var w=d.attr(n,"width")||"auto";if((w!="auto")&&(w.slice(-2)!="em")&&(w.slice(-1)!="%")){w=parseInt(w,10)+"px";}return w;};if(!_973.structure&&node.nodeName.toLowerCase()=="table"){_973.structure=d.query("> colgroup",node).map(function(cg){var sv=d.attr(cg,"span");var v={noscroll:(d.attr(cg,"noscroll")=="true")?true:false,__span:(!!sv?parseInt(sv,10):1),cells:[]};if(d.hasAttr(cg,"width")){v.width=_975(cg);}return v;});if(!_973.structure.length){_973.structure.push({__span:Infinity,cells:[]});}d.query("thead > tr",node).forEach(function(tr,_976){var _977=0;var _978=0;var _979;var _97a=null;d.query("> th",tr).map(function(th){if(!_97a){_979=0;_97a=_973.structure[0];}else{if(_977>=(_979+_97a.__span)){_978++;_979+=_97a.__span;var _97b=_97a;_97a=_973.structure[_978];}}var cell={name:d.trim(d.attr(th,"name")||th.innerHTML),colSpan:parseInt(d.attr(th,"colspan")||1,10),type:d.trim(d.attr(th,"cellType")||""),id:d.trim(d.attr(th,"id")||"")};_977+=cell.colSpan;var _97c=d.attr(th,"rowspan");if(_97c){cell.rowSpan=_97c;}if(d.hasAttr(th,"width")){cell.width=_975(th);}if(d.hasAttr(th,"relWidth")){cell.relWidth=window.parseInt(_4.attr(th,"relWidth"),10);}if(d.hasAttr(th,"hidden")){cell.hidden=(d.attr(th,"hidden")=="true"||d.attr(th,"hidden")===true);}if(_974){_974(th,cell);}cell.type=cell.type?_4.getObject(cell.type):_6.grid.cells.Cell;if(cell.type&&cell.type.markupFactory){cell.type.markupFactory(th,cell);}if(!_97a.cells[_976]){_97a.cells[_976]=[];}_97a.cells[_976].push(cell);});});}return new ctor(_973,node);};})();}if(!_4._hasResource["dojox.grid.DataSelection"]){_4._hasResource["dojox.grid.DataSelection"]=true;_4.provide("dojox.grid.DataSelection");_4.declare("dojox.grid.DataSelection",_6.grid.Selection,{getFirstSelected:function(){var idx=_6.grid.Selection.prototype.getFirstSelected.call(this);if(idx==-1){return null;}return this.grid.getItem(idx);},getNextSelected:function(_97d){var _97e=this.grid.getItemIndex(_97d);var idx=_6.grid.Selection.prototype.getNextSelected.call(this,_97e);if(idx==-1){return null;}return this.grid.getItem(idx);},getSelected:function(){var _97f=[];for(var i=0,l=this.selected.length;i<l;i++){if(this.selected[i]){_97f.push(this.grid.getItem(i));}}return _97f;},addToSelection:function(_980){if(this.mode=="none"){return;}var idx=null;if(typeof _980=="number"||typeof _980=="string"){idx=_980;}else{idx=this.grid.getItemIndex(_980);}_6.grid.Selection.prototype.addToSelection.call(this,idx);},deselect:function(_981){if(this.mode=="none"){return;}var idx=null;if(typeof _981=="number"||typeof _981=="string"){idx=_981;}else{idx=this.grid.getItemIndex(_981);}_6.grid.Selection.prototype.deselect.call(this,idx);},deselectAll:function(_982){var idx=null;if(_982||typeof _982=="number"){if(typeof _982=="number"||typeof _982=="string"){idx=_982;}else{idx=this.grid.getItemIndex(_982);}_6.grid.Selection.prototype.deselectAll.call(this,idx);}else{this.inherited(arguments);}}});}if(!_4._hasResource["dojox.grid.DataGrid"]){_4._hasResource["dojox.grid.DataGrid"]=true;_4.provide("dojox.grid.DataGrid");_4.declare("dojox.grid.DataGrid",_6.grid._Grid,{store:null,query:null,queryOptions:null,fetchText:"...",sortFields:null,updateDelay:1,items:null,_store_connects:null,_by_idty:null,_by_idx:null,_cache:null,_pages:null,_pending_requests:null,_bop:-1,_eop:-1,_requests:0,rowCount:0,_isLoaded:false,_isLoading:false,postCreate:function(){this._pages=[];this._store_connects=[];this._by_idty={};this._by_idx=[];this._cache=[];this._pending_requests={};this._setStore(this.store);this.inherited(arguments);},createSelection:function(){this.selection=new _6.grid.DataSelection(this);},get:function(_983,_984){if(_984&&this.field=="_item"&&!this.fields){return _984;}else{if(_984&&this.fields){var ret=[];var s=this.grid.store;_4.forEach(this.fields,function(f){ret=ret.concat(s.getValues(_984,f));});return ret;}else{if(!_984&&typeof _983==="string"){return this.inherited(arguments);}}}return (!_984?this.defaultValue:(!this.field?this.value:(this.field=="_item"?_984:this.grid.store.getValue(_984,this.field))));},_checkUpdateStatus:function(){if(this.updateDelay>0){var _985=false;if(this._endUpdateDelay){clearTimeout(this._endUpdateDelay);delete this._endUpdateDelay;_985=true;}if(!this.updating){this.beginUpdate();_985=true;}if(_985){var _986=this;this._endUpdateDelay=setTimeout(function(){delete _986._endUpdateDelay;_986.endUpdate();},this.updateDelay);}}},_onSet:function(item,_987,_988,_989){this._checkUpdateStatus();var idx=this.getItemIndex(item);if(idx>-1){this.updateRow(idx);}},_createItem:function(item,_98a){var idty=this._hasIdentity?this.store.getIdentity(item):_4.toJson(this.query)+":idx:"+_98a+":sort:"+_4.toJson(this.getSortProps());var o=this._by_idty[idty]={idty:idty,item:item};return o;},_addItem:function(item,_98b,_98c){this._by_idx[_98b]=this._createItem(item,_98b);if(!_98c){this.updateRow(_98b);}},_onNew:function(item,_98d){this._checkUpdateStatus();var _98e=this.get("rowCount");this._addingItem=true;this.updateRowCount(_98e+1);this._addingItem=false;this._addItem(item,_98e);this.showMessage();},_onDelete:function(item){this._checkUpdateStatus();var idx=this._getItemIndex(item,true);if(idx>=0){this._pages=[];this._bop=-1;this._eop=-1;var o=this._by_idx[idx];this._by_idx.splice(idx,1);delete this._by_idty[o.idty];this.updateRowCount(this.get("rowCount")-1);if(this.get("rowCount")===0){this.showMessage(this.noDataMessage);}}},_onRevert:function(){this._refresh();},setStore:function(_98f,_990,_991){this._setQuery(_990,_991);this._setStore(_98f);this._refresh(true);},setQuery:function(_992,_993){this._setQuery(_992,_993);this._refresh(true);},setItems:function(_994){this.items=_994;this._setStore(this.store);this._refresh(true);},_setQuery:function(_995,_996){this.query=_995;this.queryOptions=_996||this.queryOptions;},_setStore:function(_997){if(this.store&&this._store_connects){_4.forEach(this._store_connects,this.disconnect,this);}this.store=_997;if(this.store){var f=this.store.getFeatures();var h=[];this._canEdit=!!f["dojo.data.api.Write"]&&!!f["dojo.data.api.Identity"];this._hasIdentity=!!f["dojo.data.api.Identity"];if(!!f["dojo.data.api.Notification"]&&!this.items){h.push(this.connect(this.store,"onSet","_onSet"));h.push(this.connect(this.store,"onNew","_onNew"));h.push(this.connect(this.store,"onDelete","_onDelete"));}if(this._canEdit){h.push(this.connect(this.store,"revert","_onRevert"));}this._store_connects=h;}},_onFetchBegin:function(size,req){if(!this.scroller){return;}if(this.rowCount!=size){if(req.isRender){this.scroller.init(size,this.keepRows,this.rowsPerPage);this.rowCount=size;this._setAutoHeightAttr(this.autoHeight,true);this._skipRowRenormalize=true;this.prerender();this._skipRowRenormalize=false;}else{this.updateRowCount(size);}}if(!size){this.views.render();this._resize();this.showMessage(this.noDataMessage);this.focus.initFocusView();}else{this.showMessage();}},_onFetchComplete:function(_998,req){if(!this.scroller){return;}if(_998&&_998.length>0){_4.forEach(_998,function(item,idx){this._addItem(item,req.start+idx,true);},this);this.updateRows(req.start,_998.length);if(req.isRender){this.setScrollTop(0);this.postrender();}else{if(this._lastScrollTop){this.setScrollTop(this._lastScrollTop);}}}delete this._lastScrollTop;if(!this._isLoaded){this._isLoading=false;this._isLoaded=true;}this._pending_requests[req.start]=false;},_onFetchError:function(err,req){console.log(err);delete this._lastScrollTop;if(!this._isLoaded){this._isLoading=false;this._isLoaded=true;this.showMessage(this.errorMessage);}this._pending_requests[req.start]=false;this.onFetchError(err,req);},onFetchError:function(err,req){},_fetch:function(_999,_99a){_999=_999||0;if(this.store&&!this._pending_requests[_999]){if(!this._isLoaded&&!this._isLoading){this._isLoading=true;this.showMessage(this.loadingMessage);}this._pending_requests[_999]=true;try{if(this.items){var _99b=this.items;var _99c=this.store;this.rowsPerPage=_99b.length;var req={start:_999,count:this.rowsPerPage,isRender:_99a};this._onFetchBegin(_99b.length,req);var _99d=0;_4.forEach(_99b,function(i){if(!_99c.isItemLoaded(i)){_99d++;}});if(_99d===0){this._onFetchComplete(_99b,req);}else{var _99e=function(item){_99d--;if(_99d===0){this._onFetchComplete(_99b,req);}};_4.forEach(_99b,function(i){if(!_99c.isItemLoaded(i)){_99c.loadItem({item:i,onItem:_99e,scope:this});}},this);}}else{this.store.fetch({start:_999,count:this.rowsPerPage,query:this.query,sort:this.getSortProps(),queryOptions:this.queryOptions,isRender:_99a,onBegin:_4.hitch(this,"_onFetchBegin"),onComplete:_4.hitch(this,"_onFetchComplete"),onError:_4.hitch(this,"_onFetchError")});}}catch(e){this._onFetchError(e,{start:_999,count:this.rowsPerPage});}}},_clearData:function(){this.updateRowCount(0);this._by_idty={};this._by_idx=[];this._pages=[];this._bop=this._eop=-1;this._isLoaded=false;this._isLoading=false;},getItem:function(idx){var data=this._by_idx[idx];if(!data||(data&&!data.item)){this._preparePage(idx);return null;}return data.item;},getItemIndex:function(item){return this._getItemIndex(item,false);},_getItemIndex:function(item,_99f){if(!_99f&&!this.store.isItem(item)){return -1;}var idty=this._hasIdentity?this.store.getIdentity(item):null;for(var i=0,l=this._by_idx.length;i<l;i++){var d=this._by_idx[i];if(d&&((idty&&d.idty==idty)||(d.item===item))){return i;}}return -1;},filter:function(_9a0,_9a1){this.query=_9a0;if(_9a1){this._clearData();}this._fetch();},_getItemAttr:function(idx,attr){var item=this.getItem(idx);return (!item?this.fetchText:this.store.getValue(item,attr));},_render:function(){if(this.domNode.parentNode){this.scroller.init(this.get("rowCount"),this.keepRows,this.rowsPerPage);this.prerender();this._fetch(0,true);}},_requestsPending:function(_9a2){return this._pending_requests[_9a2];},_rowToPage:function(_9a3){return (this.rowsPerPage?Math.floor(_9a3/this.rowsPerPage):_9a3);},_pageToRow:function(_9a4){return (this.rowsPerPage?this.rowsPerPage*_9a4:_9a4);},_preparePage:function(_9a5){if((_9a5<this._bop||_9a5>=this._eop)&&!this._addingItem){var _9a6=this._rowToPage(_9a5);this._needPage(_9a6);this._bop=_9a6*this.rowsPerPage;this._eop=this._bop+(this.rowsPerPage||this.get("rowCount"));}},_needPage:function(_9a7){if(!this._pages[_9a7]){this._pages[_9a7]=true;this._requestPage(_9a7);}},_requestPage:function(_9a8){var row=this._pageToRow(_9a8);var _9a9=Math.min(this.rowsPerPage,this.get("rowCount")-row);if(_9a9>0){this._requests++;if(!this._requestsPending(row)){setTimeout(_4.hitch(this,"_fetch",row,false),1);}}},getCellName:function(_9aa){return _9aa.field;},_refresh:function(_9ab){this._clearData();this._fetch(0,_9ab);},sort:function(){this.edit.apply();this._lastScrollTop=this.scrollTop;this._refresh();},canSort:function(){return (!this._isLoading);},getSortProps:function(){var c=this.getCell(this.getSortIndex());if(!c){if(this.sortFields){return this.sortFields;}return null;}else{var desc=c["sortDesc"];var si=!(this.sortInfo>0);if(typeof desc=="undefined"){desc=si;}else{desc=si?!desc:desc;}return [{attribute:c.field,descending:desc}];}},styleRowState:function(_9ac){if(this.store&&this.store.getState){var _9ad=this.store.getState(_9ac.index),c="";for(var i=0,ss=["inflight","error","inserting"],s;s=ss[i];i++){if(_9ad[s]){c=" dojoxGridRow-"+s;break;}}_9ac.customClasses+=c;}},onStyleRow:function(_9ae){this.styleRowState(_9ae);this.inherited(arguments);},canEdit:function(_9af,_9b0){return this._canEdit;},_copyAttr:function(idx,attr){var row={};var _9b1={};var src=this.getItem(idx);return this.store.getValue(src,attr);},doStartEdit:function(_9b2,_9b3){if(!this._cache[_9b3]){this._cache[_9b3]=this._copyAttr(_9b3,_9b2.field);}this.onStartEdit(_9b2,_9b3);},doApplyCellEdit:function(_9b4,_9b5,_9b6){this.store.fetchItemByIdentity({identity:this._by_idx[_9b5].idty,onItem:_4.hitch(this,function(item){var _9b7=this.store.getValue(item,_9b6);if(typeof _9b7=="number"){_9b4=isNaN(_9b4)?_9b4:parseFloat(_9b4);}else{if(typeof _9b7=="boolean"){_9b4=_9b4=="true"?true:_9b4=="false"?false:_9b4;}else{if(_9b7 instanceof Date){var _9b8=new Date(_9b4);_9b4=isNaN(_9b8.getTime())?_9b4:_9b8;}}}this.store.setValue(item,_9b6,_9b4);this.onApplyCellEdit(_9b4,_9b5,_9b6);})});},doCancelEdit:function(_9b9){var _9ba=this._cache[_9b9];if(_9ba){this.updateRow(_9b9);delete this._cache[_9b9];}this.onCancelEdit.apply(this,arguments);},doApplyEdit:function(_9bb,_9bc){var _9bd=this._cache[_9bb];this.onApplyEdit(_9bb);},removeSelectedRows:function(){if(this._canEdit){this.edit.apply();var fx=_4.hitch(this,function(_9be){if(_9be.length){_4.forEach(_9be,this.store.deleteItem,this.store);this.selection.clear();}});if(this.allItemsSelected){this.store.fetch({query:this.query,queryOptions:this.queryOptions,onComplete:fx});}else{fx(this.selection.getSelected());}}}});_6.grid.DataGrid.cell_markupFactory=function(_9bf,node,_9c0){var _9c1=_4.trim(_4.attr(node,"field")||"");if(_9c1){_9c0.field=_9c1;}_9c0.field=_9c0.field||_9c0.name;var _9c2=_4.trim(_4.attr(node,"fields")||"");if(_9c2){_9c0.fields=_9c2.split(",");}if(_9bf){_9bf(node,_9c0);}};_6.grid.DataGrid.markupFactory=function(_9c3,node,ctor,_9c4){return _6.grid._Grid.markupFactory(_9c3,node,ctor,_4.partial(_6.grid.DataGrid.cell_markupFactory,_9c4));};}if(!_4._hasResource["esri.dijit.editing.TemplatePicker"]){_4._hasResource["esri.dijit.editing.TemplatePicker"]=true;_4.provide("esri.dijit.editing.TemplatePicker");(function(){var css=[_4.moduleUrl("esri.dijit.editing","css/TemplatePicker.css"),_4.moduleUrl("dojox","grid/resources/Grid.css")];var head=document.getElementsByTagName("head").item(0),link;for(var i=0,il=css.length;i<il;i++){link=document.createElement("link");link.type="text/css";link.rel="stylesheet";link.href=css[i].toString();head.appendChild(link);}}());_4.declare("esri.dijit.editing.TemplatePicker",[_5._Widget,_5._Templated],{widgetsInTemplate:true,templateString:"<div class=\"templatePicker\">\r\n\r\n  <table dojoType=\"dojox.grid.DataGrid\" noDataMessage=\"${emptyMessage}\" selectionMode=\"none\" autoHeight=\"${_rows}\" autoWidth=\"${_autoWidth}\"\r\n         query=\"{ query: '*' }\" dojoAttachPoint=\"grid\" class=\"grid\">\r\n  </table>\r\n  \r\n</div>\r\n",basePath:_4.moduleUrl("esri.dijit.editing"),featureLayers:null,items:null,grouping:true,showTooltip:false,maxLabelLength:0,rows:4,columns:3,surfaceWidth:30,surfaceHeight:30,emptyMessage:"",_uniqueId:{id:0},_assumedCellWidth:90,_initialAutoWidth:300,_initialAutoHeight:200,_ieTimer:150,constructor:function(_9c5,_9c6){_9c5=_9c5||{};if(!_9c5.items&&!_9c5.featureLayers){console.error("TemplatePicker: please provide 'featureLayers' or 'items' parameter in the constructor");}this._dojo14x=(_4.version.minor>=4);this._itemWidgets={};this.emptyMessage=_9c5.emptyMessage||_4.getObject("bundle.widgets.templatePicker.creationDisabled",false,esri)||"";},postMixInProperties:function(){this.inherited(arguments);this._preprocess();},startup:function(){this.inherited(arguments);if(this.rows==="auto"&&this.columns==="auto"){var box=_4.contentBox(this.domNode);if(!box.w){this.domNode.style.width=this._initialAutoWidth+"px";}if(!box.h){this.domNode.style.height=this._initialAutoHeight+"px";}box=_4.contentBox(this.domNode);this._columns=Math.floor(box.w/this._assumedCellWidth)||1;}this._applyGridPatches();this._setGridLayout();_4.connect(this.grid,"onRowClick",this,this._rowClicked);this._setGridData();this._toggleTooltip();if(_4.isIE<9){this._repaintItems=_4.hitch(this,this._repaintItems);setTimeout(this._repaintItems,this._ieTimer);}},destroy:function(){this.showTooltip=false;this._toggleTooltip();this.featureLayers=this.items=this.grid=this._flItems=this._itItems=this._groupRowIndices=this._selectedCell=this._selectedInfo=this._selectedItem=null;this.inherited(arguments);},getSelected:function(){return this._selectedCell?this._selectedItem:null;},clearSelection:function(){var _9c7=this._selectedCell,info=this._selectedInfo;if(_9c7){this._rowClicked({cellNode:_9c7,rowIndex:info.selRow,cellIndex:info.selCol});}},update:function(_9c8){var _9c9=(this.rows==="auto"&&this.columns==="auto"&&_9c8)?true:false;var grid=this.grid;if(_9c9){var _9ca=this.domNode,box=_4.contentBox(_9ca),id=_9ca.id;this._columns=Math.floor((box.w-grid.views.views[0].getScrollbarWidth())/_4.coords(_4.query("#"+id+".templatePicker div.item")[0].parentNode).w);this._columns=this._columns||1;}var _9cb=this._rows;this._preprocess();var _9cc=this._rows;this._setGridLayout();this._setGridData();if(_9cc!==_9cb){grid.set("autoHeight",this._rows,false);}if(_9c9){grid._resize({w:box.w,h:box.h});grid.viewsHeaderNode.style.display="none";}else{grid.update();}this._toggleTooltip();var self=this,_9cd=this.getSelected();if(_9cd){grid.store.fetch({onComplete:function(its){var _9ce=self._locate(_9cd,self._selectedInfo,its);var _9cf=_9ce&&grid.views.views[0].getCellNode(_9ce[0],_9ce[1]);if(_9cf){self._rowClicked({cellNode:_9cf,rowIndex:_9ce[0],cellIndex:_9ce[1]},true);}}});}if(_4.isIE<9){setTimeout(this._repaintItems,this._ieTimer);}var _9d0=this.featureLayers,_9d1=this.items;if((!_9d0||!_9d0.length)&&(!_9d1||!_9d1.length)&&grid&&this.emptyMessage){grid.showMessage(this.emptyMessage);}},onSelectionChange:function(){},_preprocess:function(){if(this.items){this.grouping=false;}this._autoWidth=false;if(this.rows==="auto"||this.columns==="auto"){this._autoWidth=true;}var _9d2;if(this.featureLayers){_9d2=this._flItems=this._getItemsFromLayers(this.featureLayers);}else{_9d2=this._itItems=this._getItemsFromItems(this.items);}if(this.rows==="auto"&&this.columns==="auto"){if(!this._started){this._rows=false;this._columns=null;this._autoWidth=false;}return;}var len=0;this._rows=this.rows;this._columns=this.columns;if(this.rows==="auto"){if(this.featureLayers){if(this.grouping){len=_9d2.length;_4.forEach(_9d2,function(_9d3){len+=Math.ceil(_9d3.length/this.columns);},this);}else{_4.forEach(_9d2,function(_9d4){len+=_9d4.length;},this);len=Math.ceil(len/this.columns);}}else{len=Math.ceil(_9d2.length/this.columns);}this._rows=len;}else{if(this.columns==="auto"){if(this.featureLayers){if(this.grouping){len=3;}else{_4.forEach(_9d2,function(_9d5){len+=_9d5.length;},this);len=Math.ceil(len/this.rows);}}else{len=Math.ceil(_9d2.length/this.rows);}this._columns=len;}}},_applyGridPatches:function(){var grid=this.grid;var _9d6=grid.adaptWidth;grid.adaptWidth=function(){var _9d7=this.views.views;for(var i=0,view;view=_9d7[i];i++){_4.style(view.headerNode,"display","block");}_9d6.apply(this,arguments);for(var i=0,view;view=_9d7[i];i++){_4.style(view.headerNode,"display","none");}};if(this._dojo14x){if(this.rows!=="auto"&&this.columns!=="auto"){var _9d8=_4.connect(grid,"_onFetchComplete",this,function(){_4.disconnect(_9d8);this.grid.set("autoHeight",this._rows);});}_4.connect(grid,"_onDelete",this,this._destroyItems);_4.connect(grid,"_clearData",this,this._destroyItems);_4.connect(grid,"destroy",this,this._destroyItems);var _9d9=grid.focus;if(_9d9&&_9d9.findAndFocusGridCell){_9d9.findAndFocusGridCell=function(){return false;};}}},_setGridLayout:function(){var _9da=function(_9db){return function(_9dc,_9dd){return this._cellGet(_9db,_9dc,_9dd);};};var _9de=_4.hitch(this,this._cellFormatter);var _9df=[],cols=this._columns;for(var i=0;i<cols;i++){_9df.push({field:"cell"+i,get:_4.hitch(this,_9da(i)),formatter:_9de});}var _9e0={cells:[_9df]};if(this.grouping){var _9e1={field:"groupName",colSpan:cols,get:_4.hitch(this,this._cellGetGroup),formatter:_4.hitch(this,this._cellGroupFormatter)};_9e0.cells.push([_9e1]);}var grid=this.grid;grid.set("structure",_9e0);},_setGridData:function(){var _9e2=[];if(this.grouping){this._groupRowIndices=[];var _9e3,_9e4,cols=this._columns;_4.forEach(this._flItems,function(_9e5,idx){_9e2.push({});var _9e6=(idx===0)?0:(_9e3+_9e4+1);this._groupRowIndices.push(_9e6);_9e3=_9e6;_9e4=Math.ceil(_9e5.length/cols);_9e2=_9e2.concat(this._getStoreItems(_9e5));},this);}else{if(this.featureLayers){_4.forEach(this._flItems,function(_9e7){_9e2=_9e2.concat(_9e7);});_9e2=this._getStoreItems(_9e2);}else{_9e2=this._getStoreItems(this._itItems);}}var _9e8=new _4.data.ItemFileReadStore({data:{items:_9e2}});this.grid.setStore(_9e8);},_toggleTooltip:function(){if(this.showTooltip){if(this.tooltip){return;}this.tooltip=_4.create("div",{"class":"tooltip"},this.domNode);this.tooltip.style.display="none";this.tooltip.style.position="fixed";var grid=this.grid;this._mouseOverConnect=_4.connect(grid,"onCellMouseOver",this,this._cellMouseOver);this._mouseOutConnect=_4.connect(grid,"onCellMouseOut",this,this._cellMouseOut);}else{if(this.tooltip){_4.disconnect(this._mouseOverConnect);_4.disconnect(this._mouseOutConnect);_4.destroy(this.tooltip);this.tooltip=null;}}},_rowClicked:function(evt,_9e9){var _9ea=evt.cellNode,row=evt.rowIndex,col=evt.cellIndex;var cell=this._getCellInfo(_9ea,row,col);if(!cell){return;}if(this._selectedCell){_4.removeClass(this._selectedCell,"selectedItem");}if(_9ea!==this._selectedCell){_4.addClass(_9ea,"selectedItem");this._selectedCell=_9ea;var _9eb=this.grid.store;this._selectedItem={featureLayer:_9eb.getValue(cell,"layer"),type:_9eb.getValue(cell,"type"),template:_9eb.getValue(cell,"template"),symbolInfo:_9eb.getValue(cell,"symbolInfo"),item:this._getItem(cell)};this._selectedInfo={selRow:row,selCol:col,index1:_9eb.getValue(cell,"index1"),index2:_9eb.getValue(cell,"index2"),index:_9eb.getValue(cell,"index")};}else{this._selectedCell=this._selectedInfo=this._selectedItem=null;}if(!_9e9){this.onSelectionChange();}},_locate:function(_9ec,info,_9ed){var _9ee=this.grid.store,cols=new Array(this._columns);var _9ef,_9f0=info.index1,_9f1=info.index2,_9f2=info.index,item=_9ec.item;_4.some(_9ed,function(_9f3,_9f4){return _4.some(cols,function(_9f5,_9f6){var cell=_9ee.getValue(_9f3,"cell"+_9f6);if(cell&&(item?(_9f2===_9ee.getValue(cell,"index")):(_9f0===_9ee.getValue(cell,"index1")&&_9f1===_9ee.getValue(cell,"index2")))){_9ef=[_9f4,_9f6];return true;}else{return false;}});});return _9ef;},_getCellInfo:function(_9f7,row,col){if(!_9f7){return;}var grid=this.grid;var item=grid.getItem(row);var cell=grid.store.getValue(item,"cell"+col);return cell;},_getItem:function(cell){var _9f8=this.items;if(_9f8){return _9f8[this.grid.store.getValue(cell,"index")];}},_cellMouseOver:function(evt){var _9f9=this.tooltip;var _9fa=evt.cellNode,row=evt.rowIndex,col=evt.cellIndex;var cell=this._getCellInfo(_9fa,row,col);if(_9f9&&cell){var _9fb=this.grid.store;var _9fc=_9fb.getValue(cell,"template");var type=_9fb.getValue(cell,"type");var _9fd=_9fb.getValue(cell,"symbolInfo");var _9fe=_9fb.getValue(cell,"layer");var item=this._getItem(cell);var _9ff=(item&&(item.label+(item.description?(": "+item.description):"")))||(_9fc&&(_9fc.name+(_9fc.description?(": "+_9fc.description):"")))||(type&&type.name)||(_9fd&&(_9fd.label+(_9fd.description?(": "+_9fd.description):"")))||((_9fe&&_9fe.name+": ")+"Default");_9f9.style.display="none";_9f9.innerHTML=_9ff;var _a00=_4.coords(_9fa.firstChild);_4.style(_9f9,{left:(_a00.x)+"px",top:(_a00.y+_a00.h+5)+"px"});_9f9.style.display="";}},_cellMouseOut:function(){var _a01=this.tooltip;if(_a01){_a01.style.display="none";}},_destroyItems:function(){var _a02=this._itemWidgets;for(var w in _a02){if(!_a02[w]){continue;}_a02[w].destroy();delete _a02[w];}},_repaintItems:function(){var _a03=this._itemWidgets;for(var w in _a03){var _a04=_a03[w];if(_a04){_a04._repaint(_a04._surface);}}},_getStoreItems:function(_a05){var uid=this._uniqueId;_a05=_4.map(_a05,function(item){return _4.mixin({"surfaceId":"tpick-surface-"+(uid.id++)},item);});var len=_a05.length,_a06=0,obj={},k=0,prop,_a07=[],flag=true,cols=this._columns;while(_a06<len){flag=true;prop="cell"+k;obj[prop]=_a05[_a06];_a06++;k++;if(k%cols===0){flag=false;_a07.push(obj);obj={};k=0;}}if(flag){_a07.push(obj);}return _a07;},_getItemsFromLayers:function(_a08){var _a09=[];_4.forEach(_a08,function(_a0a,_a0b){_a09.push(this._getItemsFromLayer(_a0a,_a0b));},this);return _a09;},_getItemsFromLayer:function(_a0c,_a0d){var _a0e=[];var _a0f=[];_a0f=_a0f.concat(_a0c.templates);_4.forEach(_a0c.types,function(_a10){var _a11=_a10.templates;_4.forEach(_a11,function(_a12){_a12._type_=_a10;});_a0f=_a0f.concat(_a11);});_a0f=_4.filter(_a0f,esri._isDefined);var _a13=_a0c.renderer;if(_a13){if(_a0f.length>0){_4.forEach(_a0f,function(_a14){var _a15=_a14.prototype;if(_a15){var _a16=_a13.getSymbol(_a15);if(_a16){_a0e.push({label:this._trimLabel(_a14.name),symbol:_a16,layer:_a0c,type:_a14._type_,template:_a14,index1:_a0d,index2:_a0e.length});}}delete _a14._type_;},this);}else{var _a17=_a13.declaredClass.replace("esri.renderer.",""),_a18=[];if(_a17==="TemporalRenderer"){_a13=_a13.observationRenderer;if(_a13){_a17=_a13.declaredClass.replace("esri.renderer.","");}}switch(_a17){case "SimpleRenderer":_a18=[{symbol:_a13.symbol,label:_a13.label,description:_a13.description}];break;case "UniqueValueRenderer":case "ClassBreaksRenderer":_a18=_a13.infos;break;}_a0e=_4.map(_a18,function(info,idx){return {label:this._trimLabel(info.label),description:info.description,symbolInfo:_4.mixin({constructor:function(){}},info),symbol:info.symbol,layer:_a0c,index1:_a0d,index2:idx};},this);}}return _a0e;},_getItemsFromItems:function(_a19){return _4.map(_a19,function(item,idx){var item=_4.mixin({index:idx},item);item.label=this._trimLabel(item.label);return item;},this);},_trimLabel:function(_a1a){var max=this.maxLabelLength;if(max&&_a1a){if(_a1a.length>max){_a1a=_a1a.substr(0,max)+"...";}}return _a1a||"";},_cellGet:function(_a1b,_a1c,_a1d){if(!_a1d){return "";}return this.grid.store.getValue(_a1d,"cell"+_a1b);},_cellFormatter:function(_a1e){if(_a1e){var _a1f=this._itemWidgets,_a20=this.grid.store;var sid=_a20.getValue(_a1e,"surfaceId");var w=_a1f[sid];if(!w){w=(_a1f[sid]=new esri.dijit.editing.TemplatePickerItem({id:sid,label:_a20.getValue(_a1e,"label"),symbol:_a20.getValue(_a1e,"symbol"),surfaceWidth:this.surfaceWidth,surfaceHeight:this.surfaceHeight,template:_a20.getValue(_a1e,"template")}));}return w||"";}else{return "";}},_cellGetGroup:function(_a21,_a22){if(!this._groupRowIndices){return "";}var _a23=_4.indexOf(this._groupRowIndices,_a21);if(!_a22||_a23===-1){return "";}return (this.featureLayers[_a23]&&this.featureLayers[_a23].name)||"";},_cellGroupFormatter:function(_a24){if(_a24){return "<div class='groupLabel'>"+_a24+"</div>";}else{return "";}}});_4.declare("esri.dijit.editing.TemplatePickerItem",[_5._Widget,_5._Templated],{templateString:"<div class='item' style='text-align: center;'>"+"<div class='itemSymbol' dojoAttachPoint='_surfaceNode'></div>"+"<div class='itemLabel'>${label}</div>"+"</div>",startup:function(){if(this._started){return;}this.inherited(arguments);this._surface=this._draw(this._surfaceNode,this.symbol,this.surfaceWidth,this.surfaceHeight,this.template);},_draw:function(node,_a25,_a26,_a27,_a28){var _a29=_6.gfx.createSurface(node,_a26,_a27);if(_4.isIE<9){var _a2a=_a29.getEventSource();_4.style(_a2a,"position","relative");_4.style(_a2a.parentNode,"position","relative");}var _a2b=this._getDrawingToolShape(_a25,_a28)||esri.symbol.getShapeDescriptors(_a25);var _a2c;try{_a2c=_a29.createShape(_a2b.defaultShape).setFill(_a2b.fill).setStroke(_a2b.stroke);}catch(e){_a29.clear();_a29.destroy();return;}var dim=_a29.getDimensions();var _a2d={dx:dim.width/2,dy:dim.height/2};var bbox=_a2c.getBoundingBox(),_a2e=bbox.width,_a2f=bbox.height;if(_a2e>_a26||_a2f>_a27){var _a30=_a2e>_a2f?_a2e:_a2f;var _a31=_a26<_a27?_a26:_a27;var _a32=(_a31-5)/_a30;_4.mixin(_a2d,{xx:_a32,yy:_a32});}_a2c.applyTransform(_a2d);return _a29;},_getDrawingToolShape:function(_a33,_a34){var _a35,_a36=_a34?_a34.drawingTool||null:null;switch(_a36){case "esriFeatureEditToolArrow":_a35={type:"path",path:"M 10,1 L 3,8 L 3,5 L -15,5 L -15,-2 L 3,-2 L 3,-5 L 10,1 E"};break;case "esriFeatureEditToolLeftArrow":_a35={type:"path",path:"M -15,1 L -8,8 L -8,5 L 10,5 L 10,-2 L -8,-2 L -8,-5 L -15,1 E"};break;case "esriFeatureEditToolRightArrow":_a35={type:"path",path:"M 10,1 L 3,8 L 3,5 L -15,5 L -15,-2 L 3,-2 L 3,-5 L 10,1 E"};break;case "esriFeatureEditToolUpArrow":_a35={type:"path",path:"M 1,-10 L 8,-3 L 5,-3 L 5,15 L -2,15 L -2,-3 L -5,-3 L 1,-10 E"};break;case "esriFeatureEditToolDownArrow":_a35={type:"path",path:"M 1,15 L 8,8 L 5,8 L 5,-10 L -2,-10 L -2,8 L -5,8 L 1,15 E"};break;case "esriFeatureEditToolTriangle":_a35={type:"path",path:"M -10,14 L 2,-10 L 14,14 L -10,14 E"};break;case "esriFeatureEditToolRectangle":_a35={type:"path",path:"M -10,-10 L 10,-10 L 10,10 L -10,10 L -10,-10 E"};break;case "esriFeatureEditToolCircle":_a35={type:"circle",cx:0,cy:0,r:10};break;case "esriFeatureEditToolEllipse":_a35={type:"ellipse",cx:0,cy:0,rx:10,ry:5};break;case "esriFeatureEditToolFreehand":if(_a33.type==="simplelinesymbol"||_a33.type==="cartographiclinesymbol"){_a35={type:"path",path:"m -11, -7c-1.5,-3.75 7.25,-9.25 12.5,-7c5.25,2.25 6.75,9.75 3.75,12.75c-3,3 -3.25,2.5 -9.75,5.25c-6.5,2.75 -7.25,14.25 2,15.25c9.25,1 11.75,-4 13.25,-6.75c1.5,-2.75 3.5,-11.75 12,-6.5"};}else{_a35={type:"path",path:"M 10,-13 c3.1,0.16667 4.42564,2.09743 2.76923,3.69231c-2.61025,2.87179 -5.61025,5.6718 -6.14358,6.20513c-0.66667,0.93333 -0.46667,1.2 -0.53333,1.93333c-0.00001,0.86666 0.6,1.66667 1.13334,2c1.03077,0.38462 2.8,0.93333 3.38974,1.70769c0.47693,0.42564 0.87693,0.75897 1.41026,1.75897c0.13333,1.06667 -0.46667,2.86667 -1.8,3.8c-0.73333,0.73333 -3.86667,2.66666 -4.86667,3.13333c-0.93333,0.8 -7.4,3.2 -7.6,3.06667c-1.06667,0.46667 -4.73333,1.13334 -5.2,1.26667c-1.6,0.33334 -4.6,0.4 -6.25128,0.05128c-1.41539,-0.18462 -2.34872,-2.31796 -1.41539,-4.45129c0.93333,-1.73333 1.86667,-3.13333 2.64615,-3.85641c1.28718,-1.47692 2.57437,-2.68204 3.88718,-3.54359c0.88718,-1.13845 1.8,-1.33333 2.26666,-2.45641c0.33334,-0.74359 0.37949,-1.7641 0.06667,-2.87692c-0.66666,-1.46666 -1.66666,-1.86666 -2.98975,-2.2c-1.27692,-0.26666 -2.12307,-0.64102 -3.27692,-1.46666c-0.66667,-1.00001 -1.01538,-3.01539 0.73333,-4.06667c1.73333,-1.2 3.6,-1.93333 4.93333,-2.2c1.33333,-0.46667 4.84104,-1.09743 5.84103,-1.23076c1.60001,-0.46667 6.02564,-0.50257 7.29231,-0.56924z"};}break;default:return null;}return {defaultShape:_a35,fill:_a33.getFill(),stroke:_a33.getStroke()};},_repaint:function(_a37){if(!_a37){this._surface=this._draw(this._surfaceNode,this.symbol,this.surfaceWidth,this.surfaceHeight,this.template);return;}if(_a37.getStroke&&_a37.setStroke){_a37.setStroke(_a37.getStroke());}if(_a37.getFill&&_a37.setFill){_a37.setFill(_a37.getFill());}if(_a37.children&&_4.isArray(_a37.children)){_4.forEach(_a37.children,this._repaint,this);}},destroy:function(){if(this._surface){this._surface.destroy();delete this._surface;}this.inherited(arguments);}});}if(!_4._hasResource["esri.dijit.editing.TemplatePicker-all"]){_4._hasResource["esri.dijit.editing.TemplatePicker-all"]=true;_4.provide("esri.dijit.editing.TemplatePicker-all");}}};});
