text: /*
  	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
  */
  
  //>>built
  define("dojo/io/script",["../_base/connect","../_base/kernel","../_base/lang","../sniff","../_base/window","../_base/xhr","../dom","../dom-construct"],function(_1,_2,_3,_4,_5,_6,_7,_8){var _9=_4("ie")?"onreadystatechange":"load",_a=/complete|loaded/;var _b={get:function(_c){var _d=this._makeScriptDeferred(_c);var _e=_d.ioArgs;_6._ioAddQueryToUrl(_e);_6._ioNotifyStart(_d);if(this._canAttach(_e)){var _f=this.attach(_e.id,_e.url,_c.frameDoc);if(!_e.jsonp&&!_e.args.checkString){var _10=_1.connect(_f,_9,function(evt){if(evt.type=="load"||_a.test(_f.readyState)){_1.disconnect(_10);_e.scriptLoaded=evt;}});}}_6._ioWatch(_d,this._validCheck,this._ioCheck,this._resHandle);return _d;},attach:function(id,url,_11){var doc=(_11||_5.doc);var _12=doc.createElement("script");_12.type="text/javascript";_12.src=url;_12.id=id;_12.async=true;_12.charset="utf-8";return doc.getElementsByTagName("head")[0].appendChild(_12);},remove:function(id,_13){_8.destroy(_7.byId(id,_13));if(this["jsonp_"+id]){delete this["jsonp_"+id];}},_makeScriptDeferred:function(_14){var dfd=_6._ioSetArgs(_14,this._deferredCancel,this._deferredOk,this._deferredError);var _15=dfd.ioArgs;_15.id=_2._scopeName+"IoScript"+(this._counter++);_15.canDelete=false;_15.jsonp=_14.callbackParamName||_14.jsonp;if(_15.jsonp){_15.query=_15.query||"";if(_15.query.length>0){_15.query+="&";}_15.query+=_15.jsonp+"="+(_14.frameDoc?"parent.":"")+_2._scopeName+".io.script.jsonp_"+_15.id+"._jsonpCallback";_15.frameDoc=_14.frameDoc;_15.canDelete=true;dfd._jsonpCallback=this._jsonpCallback;this["jsonp_"+_15.id]=dfd;}return dfd;},_deferredCancel:function(dfd){dfd.canceled=true;if(dfd.ioArgs.canDelete){_b._addDeadScript(dfd.ioArgs);}},_deferredOk:function(dfd){var _16=dfd.ioArgs;if(_16.canDelete){_b._addDeadScript(_16);}return _16.json||_16.scriptLoaded||_16;},_deferredError:function(_17,dfd){if(dfd.ioArgs.canDelete){if(_17.dojoType=="timeout"){_b.remove(dfd.ioArgs.id,dfd.ioArgs.frameDoc);}else{_b._addDeadScript(dfd.ioArgs);}}return _17;},_deadScripts:[],_counter:1,_addDeadScript:function(_18){_b._deadScripts.push({id:_18.id,frameDoc:_18.frameDoc});_18.frameDoc=null;},_validCheck:function(dfd){var _19=_b._deadScripts;if(_19&&_19.length>0){for(var i=0;i<_19.length;i++){_b.remove(_19[i].id,_19[i].frameDoc);_19[i].frameDoc=null;}_b._deadScripts=[];}return true;},_ioCheck:function(dfd){var _1a=dfd.ioArgs;if(_1a.json||(_1a.scriptLoaded&&!_1a.args.checkString)){return true;}var _1b=_1a.args.checkString;return _1b&&eval("typeof("+_1b+") != 'undefined'");},_resHandle:function(dfd){if(_b._ioCheck(dfd)){dfd.callback(dfd);}else{dfd.errback(new Error("inconceivable dojo.io.script._resHandle error"));}},_canAttach:function(){return true;},_jsonpCallback:function(_1c){this.ioArgs.json=_1c;}};_3.setObject("dojo.io.script",_b);return _b;});