/*
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.layout.ContentPane"],["require","dijit._Widget"],["require","dijit.layout._ContentPaneResizeMixin"],["require","dojo.string"],["require","dojo.html"],["requireLocalization","dijit","loading",null,"ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw","ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dijit.layout.ContentPane"]){_4._hasResource["dijit.layout.ContentPane"]=true;_4.provide("dijit.layout.ContentPane");_4.require("dijit._Widget");_4.require("dijit.layout._ContentPaneResizeMixin");_4.require("dojo.string");_4.require("dojo.html");_4.declare("dijit.layout.ContentPane",[_5._Widget,_5.layout._ContentPaneResizeMixin],{href:"",extractContent:false,parseOnLoad:true,parserScope:_4._scopeName,preventCache:false,preload:false,refreshOnShow:false,loadingMessage:"${loadingState}",errorMessage:"${errorState}",isLoaded:false,baseClass:"dijitContentPane",ioArgs:{},onLoadDeferred:null,attributeMap:_4.delegate(_5._Widget.prototype.attributeMap,{title:[]}),stopParser:true,template:false,create:function(_7,_8){if((!_7||!_7.template)&&_8&&!("href" in _7)&&!("content" in _7)){var df=_4.doc.createDocumentFragment();_8=_4.byId(_8);while(_8.firstChild){df.appendChild(_8.firstChild);}_7=_4.delegate(_7,{content:df});}this.inherited(arguments,[_7,_8]);},postMixInProperties:function(){this.inherited(arguments);var _9=_4.i18n.getLocalization("dijit","loading",this.lang);this.loadingMessage=_4.string.substitute(this.loadingMessage,_9);this.errorMessage=_4.string.substitute(this.errorMessage,_9);},buildRendering:function(){this.inherited(arguments);if(!this.containerNode){this.containerNode=this.domNode;}this.domNode.title="";if(!_4.attr(this.domNode,"role")){_5.setWaiRole(this.domNode,"group");}},_startChildren:function(){this.inherited(arguments);if(this._contentSetter){_4.forEach(this._contentSetter.parseResults,function(_a){if(!_a._started&&!_a._destroyed&&_4.isFunction(_a.startup)){_a.startup();_a._started=true;}},this);}},setHref:function(_b){_4.deprecated("dijit.layout.ContentPane.setHref() is deprecated. Use set('href', ...) instead.","","2.0");return this.set("href",_b);},_setHrefAttr:function(_c){this.cancel();this.onLoadDeferred=new _4.Deferred(_4.hitch(this,"cancel"));this.onLoadDeferred.addCallback(_4.hitch(this,"onLoad"));this._set("href",_c);if(this.preload||(this._created&&this._isShown())){this._load();}else{this._hrefChanged=true;}return this.onLoadDeferred;},setContent:function(_d){_4.deprecated("dijit.layout.ContentPane.setContent() is deprecated. Use set('content', ...) instead.","","2.0");this.set("content",_d);},_setContentAttr:function(_e){this._set("href","");this.cancel();this.onLoadDeferred=new _4.Deferred(_4.hitch(this,"cancel"));if(this._created){this.onLoadDeferred.addCallback(_4.hitch(this,"onLoad"));}this._setContent(_e||"");this._isDownloaded=false;return this.onLoadDeferred;},_getContentAttr:function(){return this.containerNode.innerHTML;},cancel:function(){if(this._xhrDfd&&(this._xhrDfd.fired==-1)){this._xhrDfd.cancel();}delete this._xhrDfd;this.onLoadDeferred=null;},uninitialize:function(){if(this._beingDestroyed){this.cancel();}this.inherited(arguments);},destroyRecursive:function(_f){if(this._beingDestroyed){return;}this.inherited(arguments);},_onShow:function(){this.inherited(arguments);if(this.href){if(!this._xhrDfd&&(!this.isLoaded||this._hrefChanged||this.refreshOnShow)){return this.refresh();}}},refresh:function(){this.cancel();this.onLoadDeferred=new _4.Deferred(_4.hitch(this,"cancel"));this.onLoadDeferred.addCallback(_4.hitch(this,"onLoad"));this._load();return this.onLoadDeferred;},_load:function(){this._setContent(this.onDownloadStart(),true);var _10=this;var _11={preventCache:(this.preventCache||this.refreshOnShow),url:this.href,handleAs:"text"};if(_4.isObject(this.ioArgs)){_4.mixin(_11,this.ioArgs);}var _12=(this._xhrDfd=(this.ioMethod||_4.xhrGet)(_11));_12.addCallback(function(_13){try{_10._isDownloaded=true;_10._setContent(_13,false);_10.onDownloadEnd();}catch(err){_10._onError("Content",err);}delete _10._xhrDfd;return _13;});_12.addErrback(function(err){if(!_12.canceled){_10._onError("Download",err);}delete _10._xhrDfd;return err;});delete this._hrefChanged;},_onLoadHandler:function(_14){this._set("isLoaded",true);try{this.onLoadDeferred.callback(_14);}catch(e){console.error("Error "+this.widgetId+" running custom onLoad code: "+e.message);}},_onUnloadHandler:function(){this._set("isLoaded",false);try{this.onUnload();}catch(e){console.error("Error "+this.widgetId+" running custom onUnload code: "+e.message);}},destroyDescendants:function(){if(this.isLoaded){this._onUnloadHandler();}var _15=this._contentSetter;_4.forEach(this.getChildren(),function(_16){if(_16.destroyRecursive){_16.destroyRecursive();}});if(_15){_4.forEach(_15.parseResults,function(_17){if(_17.destroyRecursive&&_17.domNode&&_17.domNode.parentNode==_4.body()){_17.destroyRecursive();}});delete _15.parseResults;}_4.html._emptyNode(this.containerNode);delete this._singleChild;},_setContent:function(_18,_19){this.destroyDescendants();var _1a=this._contentSetter;if(!(_1a&&_1a instanceof _4.html._ContentSetter)){_1a=this._contentSetter=new _4.html._ContentSetter({node:this.containerNode,_onError:_4.hitch(this,this._onError),onContentError:_4.hitch(this,function(e){var _1b=this.onContentError(e);try{this.containerNode.innerHTML=_1b;}catch(e){console.error("Fatal "+this.id+" could not change content due to "+e.message,e);}})});}var _1c=_4.mixin({cleanContent:this.cleanContent,extractContent:this.extractContent,parseContent:this.parseOnLoad,parserScope:this.parserScope,startup:false,dir:this.dir,lang:this.lang},this._contentSetterParams||{});_1a.set((_4.isObject(_18)&&_18.domNode)?_18.domNode:_18,_1c);delete this._contentSetterParams;if(this.doLayout){this._checkIfSingleChild();}if(!_19){if(this._started){this._startChildren();this._scheduleLayout();}this._onLoadHandler(_18);}},_onError:function(_1d,err,_1e){this.onLoadDeferred.errback(err);var _1f=this["on"+_1d+"Error"].call(this,err);if(_1e){console.error(_1e,err);}else{if(_1f){this._setContent(_1f,true);}}},onLoad:function(_20){},onUnload:function(){},onDownloadStart:function(){return this.loadingMessage;},onContentError:function(_21){},onDownloadError:function(_22){return this.errorMessage;},onDownloadEnd:function(){}});}}};});