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


window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dijit._Templated"],["require","dijit._Widget"],["require","dojo.string"],["require","dojo.parser"],["require","dojo.cache"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dijit._Templated"]){_4._hasResource["dijit._Templated"]=true;_4.provide("dijit._Templated");_4.require("dijit._Widget");_4.require("dojo.string");_4.require("dojo.parser");_4.require("dojo.cache");_4.declare("dijit._Templated",null,{templateString:null,templatePath:null,widgetsInTemplate:false,_skipNodeCache:false,_earlyTemplatedStartup:false,constructor:function(){this._attachPoints=[];this._attachEvents=[];},_stringRepl:function(_7){var _8=this.declaredClass,_9=this;return _4.string.substitute(_7,this,function(_a,_b){if(_b.charAt(0)=="!"){_a=_4.getObject(_b.substr(1),false,_9);}if(typeof _a=="undefined"){throw new Error(_8+" template:"+_b);}if(_a==null){return "";}return _b.charAt(0)=="!"?_a:_a.toString().replace(/"/g,"&quot;");},this);},buildRendering:function(){var _c=_5._Templated.getCachedTemplate(this.templatePath,this.templateString,this._skipNodeCache);var _d;if(_4.isString(_c)){_d=_4._toDom(this._stringRepl(_c));if(_d.nodeType!=1){throw new Error("Invalid template: "+_c);}}else{_d=_c.cloneNode(true);}this.domNode=_d;this.inherited(arguments);this._attachTemplateNodes(_d);if(this.widgetsInTemplate){var cw=(this._startupWidgets=_4.parser.parse(_d,{noStart:!this._earlyTemplatedStartup,template:true,inherited:{dir:this.dir,lang:this.lang},propsThis:this,scope:"dojo"}));this._supportingWidgets=_5.findWidgets(_d);this._attachTemplateNodes(cw,function(n,p){return n[p];});}this._fillContent(this.srcNodeRef);},_fillContent:function(_e){var _f=this.containerNode;if(_e&&_f){while(_e.hasChildNodes()){_f.appendChild(_e.firstChild);}}},_attachTemplateNodes:function(_10,_11){_11=_11||function(n,p){return n.getAttribute(p);};var _12=_4.isArray(_10)?_10:(_10.all||_10.getElementsByTagName("*"));var x=_4.isArray(_10)?0:-1;for(;x<_12.length;x++){var _13=(x==-1)?_10:_12[x];if(this.widgetsInTemplate&&(_11(_13,"dojoType")||_11(_13,"data-dojo-type"))){continue;}var _14=_11(_13,"dojoAttachPoint")||_11(_13,"data-dojo-attach-point");if(_14){var _15,_16=_14.split(/\s*,\s*/);while((_15=_16.shift())){if(_4.isArray(this[_15])){this[_15].push(_13);}else{this[_15]=_13;}this._attachPoints.push(_15);}}var _17=_11(_13,"dojoAttachEvent")||_11(_13,"data-dojo-attach-event");if(_17){var _18,_19=_17.split(/\s*,\s*/);var _1a=_4.trim;while((_18=_19.shift())){if(_18){var _1b=null;if(_18.indexOf(":")!=-1){var _1c=_18.split(":");_18=_1a(_1c[0]);_1b=_1a(_1c[1]);}else{_18=_1a(_18);}if(!_1b){_1b=_18;}this._attachEvents.push(this.connect(_13,_18,_1b));}}}var _1d=_11(_13,"waiRole");if(_1d){_5.setWaiRole(_13,_1d);}var _1e=_11(_13,"waiState");if(_1e){_4.forEach(_1e.split(/\s*,\s*/),function(_1f){if(_1f.indexOf("-")!=-1){var _20=_1f.split("-");_5.setWaiState(_13,_20[0],_20[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(_21){delete this[_21];},this);this._attachPoints=[];_4.forEach(this._attachEvents,this.disconnect,this);this._attachEvents=[];this.inherited(arguments);}});_5._Templated._templateCache={};_5._Templated.getCachedTemplate=function(_22,_23,_24){var _25=_5._Templated._templateCache;var key=_23||_22;var _26=_25[key];if(_26){try{if(!_26.ownerDocument||_26.ownerDocument==_4.doc){return _26;}}catch(e){}_4.destroy(_26);}if(!_23){_23=_4.cache(_22,{sanitize:true});}_23=_4.string.trim(_23);if(_24||_23.match(/\$\{([^\}]+)\}/g)){return (_25[key]=_23);}else{var _27=_4._toDom(_23);if(_27.nodeType!=1){throw new Error("Invalid template: "+_23);}return (_25[key]=_27);}};if(_4.isIE){_4.addOnWindowUnload(function(){var _28=_5._Templated._templateCache;for(var key in _28){var _29=_28[key];if(typeof _29=="object"){_4.destroy(_29);}delete _28[key];}});}_4.extend(_5._Widget,{dojoAttachEvent:"",dojoAttachPoint:"",waiRole:"",waiState:""});}}};});