/*
	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","dojo.html"],["require","dojo.parser"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojo.html"]){_4._hasResource["dojo.html"]=true;_4.provide("dojo.html");_4.require("dojo.parser");_4.getObject("html",true,_4);(function(){var _7=0,d=_4;_4.html._secureForInnerHtml=function(_8){return _8.replace(/(?:\s*<!DOCTYPE\s[^>]+>|<title[^>]*>[\s\S]*?<\/title>)/ig,"");};_4.html._emptyNode=_4.empty;_4.html._setNodeContent=function(_9,_a){d.empty(_9);if(_a){if(typeof _a=="string"){_a=d._toDom(_a,_9.ownerDocument);}if(!_a.nodeType&&d.isArrayLike(_a)){for(var _b=_a.length,i=0;i<_a.length;i=_b==_a.length?i+1:0){d.place(_a[i],_9,"last");}}else{d.place(_a,_9,"last");}}return _9;};_4.declare("dojo.html._ContentSetter",null,{node:"",content:"",id:"",cleanContent:false,extractContent:false,parseContent:false,parserScope:_4._scopeName,startup:true,constructor:function(_c,_d){_4.mixin(this,_c||{});_d=this.node=_4.byId(this.node||_d);if(!this.id){this.id=["Setter",(_d)?_d.id||_d.tagName:"",_7++].join("_");}},set:function(_e,_f){if(undefined!==_e){this.content=_e;}if(_f){this._mixin(_f);}this.onBegin();this.setContent();this.onEnd();return this.node;},setContent:function(){var _10=this.node;if(!_10){throw new Error(this.declaredClass+": setContent given no node");}try{_10=_4.html._setNodeContent(_10,this.content);}catch(e){var _11=this.onContentError(e);try{_10.innerHTML=_11;}catch(e){console.error("Fatal "+this.declaredClass+".setContent could not change content due to "+e.message,e);}}this.node=_10;},empty:function(){if(this.parseResults&&this.parseResults.length){_4.forEach(this.parseResults,function(w){if(w.destroy){w.destroy();}});delete this.parseResults;}_4.html._emptyNode(this.node);},onBegin:function(){var _12=this.content;if(_4.isString(_12)){if(this.cleanContent){_12=_4.html._secureForInnerHtml(_12);}if(this.extractContent){var _13=_12.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(_13){_12=_13[1];}}}this.empty();this.content=_12;return this.node;},onEnd:function(){if(this.parseContent){this._parse();}return this.node;},tearDown:function(){delete this.parseResults;delete this.node;delete this.content;},onContentError:function(err){return "Error occured setting content: "+err;},_mixin:function(_14){var _15={},key;for(key in _14){if(key in _15){continue;}this[key]=_14[key];}},_parse:function(){var _16=this.node;try{var _17={};_4.forEach(["dir","lang","textDir"],function(_18){if(this[_18]){_17[_18]=this[_18];}},this);this.parseResults=_4.parser.parse({rootNode:_16,noStart:!this.startup,inherited:_17,scope:this.parserScope});}catch(e){this._onError("Content",e,"Error parsing in _ContentSetter#"+this.id);}},_onError:function(_19,err,_1a){var _1b=this["on"+_19+"Error"].call(this,err);if(_1a){console.error(_1a,err);}else{if(_1b){_4.html._setNodeContent(this.node,_1b,true);}}}});_4.html.set=function(_1c,_1d,_1e){if(undefined==_1d){console.warn("dojo.html.set: no cont argument provided, using empty string");_1d="";}if(!_1e){return _4.html._setNodeContent(_1c,_1d,true);}else{var op=new _4.html._ContentSetter(_4.mixin(_1e,{content:_1d,node:_1c}));return op.set();}};})();}}};});