(function(){var addListener=function(){if(window.addEventListener){return function(el,eventName,fn,capture){el.addEventListener(eventName,fn,!!capture);};}else{if(window.attachEvent){return function(el,eventName,fn,capture){el.attachEvent("on"+eventName,fn);};}else{return function(){};}}}(),removeListener=function(){if(window.removeEventListener){return function(el,eventName,fn,capture){el.removeEventListener(eventName,fn,(capture));};}else{if(window.detachEvent){return function(el,eventName,fn){el.detachEvent("on"+eventName,fn);};}else{return function(){};}}}();var EV=Ext.lib.Event;var MIM;var MASK_TARGET="x-frame-mask-target";Ext.ux.ManagedIFrame=function(){var args=Array.prototype.slice.call(arguments,0),el=Ext.get(args[0]),config=args[0];if(el&&el.dom&&el.dom.tagName=="IFRAME"){config=args[1]||{};}else{config=args[0]||args[1]||{};el=config.autoCreate?Ext.get(Ext.DomHelper.append(config.autoCreate.parent||Ext.getBody(),Ext.apply({tag:"iframe",frameborder:0,src:(Ext.isIE&&Ext.isSecure)?Ext.SSL_SECURE_URL:"about:blank"},config.autoCreate))):null;if(el&&this.unsupportedText){Ext.DomHelper.append(el.dom.parentNode,{tag:"noframes",html:this.unsupportedText});}}if(!el||el.dom.tagName!="IFRAME"){return el;}el.dom.name||(el.dom.name=el.dom.id);el.dom.ownerEl=el;this.addEvents({"focus":true,"blur":true,"unload":true,"domready":true,"documentloaded":true,"exception":true,"message":true});if(config.listeners){this.listeners=config.listeners;Ext.ux.ManagedIFrame.superclass.constructor.call(this);}Ext.apply(el,this);el.addClass("x-managed-iframe");if(config.style){el.applyStyles(config.style);}Ext.apply(el,{disableMessaging:config.disableMessaging===true,loadMask:!!config.loadMask?Ext.apply({msg:"Loading..",maskEl:null,hideOnReady:false,disabled:false},config.loadMask):false,_windowContext:null,eventsFollowFrameLinks:typeof config.eventsFollowFrameLinks=="undefined"?true:config.eventsFollowFrameLinks});if(el.loadMask){el.loadMask.maskEl||(el.loadMask.maskEl=el.parent("."+MASK_TARGET)||el.parent());el.loadMask.maskEl.addClass(MASK_TARGET);}var um=el.updateManager=new Ext.UpdateManager(el,true);um.showLoadIndicator=config.showLoadIndicator||false;Ext.ux.ManagedIFrame.Manager.register(el);if(config.src){el.setSrc(config.src);}else{var content=config.html||config.content||false;if(content){el.reset(null,function(frame){frame.update.apply(el,[].concat(content));});}}return el;};Ext.extend(Ext.ux.ManagedIFrame,Ext.util.Observable,{src:null,CSS:null,manager:null,disableMessaging:true,domReadyRetries:7500,resetUrl:(function(){if(Ext.isIE&&Ext.isSecure){return Ext.SSL_SECURE_URL;}else{return"about:blank";}})(),unsupportedText:"Inline frames are NOT enabled/supported by your browser.",setSrc:function(url,discardUrl,callback,scope){if(url&&typeof url=="object"){callback=url.callback||false;discardUrl=url.discardUrl||false;url=url.url||false;scope=url.scope||null;}var src=url||this.src||this.resetUrl;this._windowContext=null;this._unHook();this._frameAction=this.frameInit=this._domReady=false;this.showMask();var s=this._targetURI=typeof src=="function"?src()||"":src;try{this._frameAction=true;this._callBack=typeof callback=="function"?callback.createDelegate(scope):null;this.dom.src=s;this.frameInit=true;this.checkDOM();}catch(ex){this.fireEvent("exception",this,ex);}if(discardUrl!==true){this.src=src;}return this;},setLocation:function(url,discardUrl,callback,scope){if(url&&typeof url=="object"){callback=url.callback||false;discardUrl=url.discardUrl||false;url=url.url||false;scope=url.scope||null;}var src=url||this.src||this.resetUrl;this._windowContext=null;this._unHook();this._frameAction=this.frameInit=this._domReady=false;this.showMask();var s=this._targetURI=typeof src=="function"?src()||"":src;try{this._frameAction=true;this._callBack=typeof callback=="function"?callback.createDelegate(scope):null;this.getWindow().location.replace(s);this.frameInit=true;this.checkDOM();}catch(ex){this.fireEvent("exception",this,ex);}if(discardUrl!==true){this.src=src;}return this;},reset:function(src,callback,scope){this._unHook();var loadMaskOff=false;if(this.loadMask){loadMaskOff=this.loadMask.disabled;this.loadMask.disabled=false;}this._callBack=function(frame){if(frame.loadMask){frame.loadMask.disabled=loadMaskOff;}frame._frameAction=false;frame.frameInit=true;this._isReset=false;if(callback){callback.call(scope||window,frame);}};this.hideMask(true);this._frameAction=false;this.frameInit=true;this._isReset=true;var s=src;if(typeof src=="function"){s=src();}s=this._targetURI=Ext.isEmpty(s,true)?this.resetUrl:s;this.getWindow().location.href=s;return this;},scriptRE:/(?:)((\n|\r|.)*?)(?:<\/script>)/gi,update:function(content,loadScripts,callback,scope){loadScripts=loadScripts||this.getUpdateManager().loadScripts||false;content=Ext.DomHelper.markup(content||"");content=loadScripts===true?content:content.replace(this.scriptRE,"");var doc;if((doc=this.getDocument())&&!!content.length){this._unHook();this._windowContext=this.src=null;this._targetURI=location.href;this.src=null;this.frameInit=true;this.showMask();this._callBack=typeof callback=="function"?callback.createDelegate(scope):null;doc.open();this._frameAction=true;doc.write(content);doc.close();this.checkDOM();}else{this.hideMask(true);if(callback){callback.call(scope,this);}}return this;},disableMessaging:true,_XFrameMessaging:function(){var tagStack={"$":[]};var isEmpty=function(v,allowBlank){return v===null||v===undefined||(!allowBlank?v==="":false);};var apply=function(o,c,defaults){if(defaults){apply(o,defaults);}if(o&&c&&typeof c=="object"){for(var p in c){o[p]=c[p];}}return o;};window.sendMessage=function(message,tag,origin){var MIF;if(MIF=arguments.callee.manager){if(message._fromHost){var fn,result;var compTag=message.tag||tag||null;var mstack=!isEmpty(compTag)?tagStack[compTag.toLowerCase()]||[]:tagStack["$"];for(var i=0,l=mstack.length;i