(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;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..",msgCls:"x-mask-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(".x-managed-iframe-mask")||el.parent().addClass("x-managed-iframe-mask"))}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,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();(function(){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)}}).defer(10,this);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();(function(){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)}}).defer(10,this);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:/(?:<script.*?>)((\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.frameInit=true;this.showMask();(function(){this._callBack=typeof callback=="function"?callback.createDelegate(scope):null;doc.open();this._frameAction=true;doc.write(content);doc.close();this.checkDOM()}).defer(10,this)}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<l;i++){if(fn=mstack[i]){result=fn.apply(fn.__scope,arguments)===false?false:result;if(fn.__single){mstack[i]=null}if(result===false){break}}}return result}else{message={type:isEmpty(tag)?"message":"message:"+tag.toLowerCase().replace(/^\s+|\s+$/g,""),data:message,domain:origin||document.domain,uri:document.documentURI,source:window,tag:isEmpty(tag)?null:tag.toLowerCase()};try{return MIF.disableMessaging!==true?MIF.fireEvent.call(MIF,message.type,MIF,message):null}catch(ex){}return null}}};window.onhostmessage=function(fn,scope,single,tag){if(typeof fn=="function"){if(!isEmpty(fn.__index)){throw"onhostmessage: duplicate handler definition"+(tag?" for tag:"+tag:"")}var k=isEmpty(tag)?"$":tag.toLowerCase();tagStack[k]||(tagStack[k]=[]);apply(fn,{__tag:k,__single:single||false,__scope:scope||window,__index:tagStack[k].length});tagStack[k].push(fn)}else{throw"onhostmessage: function required"}};window.unhostmessage=function(fn){if(typeof fn=="function"&&typeof fn.__index!="undefined"){var k=fn.__tag||"$";tagStack[k][fn.__index]=null}}},getHistory:function(){var h=null;try{h=this.getWindow().history}catch(eh){}return h},get:function(el){return MIM.El.get(this,el)},fly:function(el,named){named=named||"_global";el=this.getDom(el);if(!el){return null}if(!MIM._flyweights[named]){MIM._flyweights[named]=new Ext.Element.Flyweight()}MIM._flyweights[named].dom=el;return MIM._flyweights[named]},getDom:function(el){var d;if(!el||!(d=this.getDocument())){return null}return el.dom?el.dom:(typeof el=="string"?d.getElementById(el):el)},select:function(selector,unique){var d;return(d=this.getDocument())?Ext.Element.select(selector,unique,d):null},query:function(selector){var d;return(d=this.getDocument())?Ext.DomQuery.select(selector,d):null},getDoc:function(){return this.get(this.getDocument())},removeNode:function(node){MIM.removeNode(this,this.getDom(node))},_unHook:function(){var elcache,h=MIM.getFrameHash(this)||{};if(this._hooked){if(h&&(elcache=h.elCache)){for(var id in elcache){var el=elcache[id];if(el.removeAllListeners){el.removeAllListeners()}delete elcache[id]}if(h.docEl){h.docEl.removeAllListeners();h.docEl=null;delete h.docEl}}var w;if(this._frameProxy&&(w=this.getWindow())){removeListener(w,"focus",this._frameProxy);removeListener(w,"blur",this._frameProxy);removeListener(w,"resize",this._frameProxy);removeListener(w,"unload",this._frameProxy)}}this.CSS=this.CSS?this.CSS.destroy():null;this._hooked=this._domReady=this._domFired=this._frameAction=false},_renderHook:function(){this._windowContext=null;this.CSS=this.CSS?this.CSS.destroy():null;this._hooked=false;try{if(this.writeScript('(function(){(window.hostMIF = parent.Ext.get("'+this.dom.id+'"))._windowContext='+(Ext.isIE?"window":"{eval:function(s){return eval(s);}}")+";})();")){this._frameProxy||(this._frameProxy=MIM.eventProxy.createDelegate(this));var w;if(w=this.getWindow()){addListener(w,"focus",this._frameProxy);addListener(w,"blur",this._frameProxy);addListener(w,"resize",this._frameProxy);addListener(w,"unload",this._frameProxy)}if(this.disableMessaging!==true){this.loadFunction({name:"XMessage",fn:this._XFrameMessaging},false,true);var sm;if(sm=w.sendMessage){sm.manager=this}}this.CSS=new CSSInterface(this.getDocument())}}catch(ex){}return this.domWritable()},sendMessage:function(message,tag,origin){var win;if(this.disableMessaging!==true&&(win=this.getWindow())){tag||(tag=message.tag||"");tag=tag.toLowerCase();message=Ext.applyIf(message.data?message:{data:message},{type:Ext.isEmpty(tag)?"message":"message:"+tag,domain:origin||document.domain,uri:document.documentURI,source:window,tag:tag||null,_fromHost:this});return win.sendMessage?win.sendMessage.call(null,message,tag,origin):null}return null},_windowContext:null,getDocument:function(){var win=this.getWindow(),doc=null;try{doc=(Ext.isIE&&win?win.document:null)||this.dom.contentDocument||window.frames[this.id].document||null}catch(gdEx){return false}return doc},getBody:function(){var d;return(d=this.getDocument())?d.body:null},getDocumentURI:function(){var URI,d;try{URI=this.src&&(d=this.getDocument())?d.location.href:null}catch(ex){}return URI||(typeof this.src=="function"?this.src():this.src)},getWindowURI:function(){var URI,w;try{URI=(w=this.getWindow())?w.location.href:null}catch(ex){}return URI||(typeof this.src=="function"?this.src():this.src)},getWindow:function(){var dom=this.dom,win=null;try{win=dom.contentWindow||window.frames[dom.name]||null}catch(gwEx){}return win},print:function(){var win;try{if(win=this.getWindow()){if(Ext.isIE){win.focus()}win.print()}}catch(ex){throw"print exception: "+(ex.description||ex.message||ex)}},destroy:function(){this.removeAllListeners();if(this.loadMask){this.hideMask(true);Ext.apply(this.loadMask,{masker:null,maskEl:null})}if(this.dom){Ext.ux.ManagedIFrame.Manager.deRegister(this);this.dom.ownerEl=this._windowContext=null;if(Ext.isIE&&this.dom.src){this.dom.src="javascript:false"}this._maskEl=null;this.remove()}},domWritable:function(){return !!this._windowContext},execScript:function(block,useDOM){try{if(this.domWritable()){if(useDOM){this.writeScript(block)}else{return this._windowContext.eval(block)}}else{throw"execScript:non-secure context"}}catch(ex){this.fireEvent("exception",this,ex);return false}return true},writeScript:function(block,attributes){attributes=Ext.apply({},attributes||{},{type:"text/javascript",text:block});try{var head,script,doc=this.getDocument();if(doc&&typeof doc.getElementsByTagName!="undefined"){if(!(head=doc.getElementsByTagName("head")[0])){head=doc.createElement("head");doc.getElementsByTagName("html")[0].appendChild(head)}if(head&&(script=doc.createElement("script"))){for(var attrib in attributes){if(attributes.hasOwnProperty(attrib)&&attrib in script){script[attrib]=attributes[attrib]}}return !!head.appendChild(script)}}}catch(ex){this.fireEvent("exception",this,ex)}return false},loadFunction:function(fn,useDOM,invokeIt){var name=fn.name||fn;var fn=fn.fn||window[fn];this.execScript(name+"="+fn,useDOM);if(invokeIt){this.execScript(name+"()")}},showMask:function(msg,msgCls,forced){var lmask=this.loadMask;if(lmask&&!lmask.disabled){lmask.masker||(lmask.masker=Ext.get(lmask.maskEl||this.dom.parentNode||this.wrap({tag:"div",style:{position:"static"}})));(function(){this._vis=!!this.masker.mask(msg||this.msg,msgCls||this.msgCls)}).defer(lmask.delay||10,lmask)}},hideMask:function(forced){var tlm=this.loadMask;if(tlm&&!tlm.disabled&&tlm.masker){if(forced||(tlm.hideOnReady&&this._domReady)){tlm.masker.unmask();tlm._vis=false}}},loadHandler:function(e,target){target||(target={});var rstatus=(e&&typeof e.type!=="undefined"?e.type:this.dom.readyState);if(!this.frameInit||(!this._frameAction&&!this.eventsFollowFrameLinks)){return}switch(rstatus){case"domready":if(this._domReady){return}this._domReady=true;if((this._frameAction||this.eventsFollowFrameLinks)&&this.getDocumentURI()!="about:blank"&&(this._hooked=this._renderHook())){this._domFired=true;this.fireEvent("domready",this)}case"domfail":this._domReady=true;this.hideMask();break;case"load":case"complete":if(!this._domReady){this.loadHandler({type:"domready",id:this.id},this.dom)}this.hideMask(true);if(this._frameAction||this.eventsFollowFrameLinks){this.fireEvent.defer(1,this,["documentloaded",this]);if(this._callBack){this._callBack.defer(1,null,[this])}}this._frameAction=this._frameInit=false;if(this.eventsFollowFrameLinks){this._domFired=this._domReady=false}break;default:}this.frameState=rstatus},checkDOM:function(win){if(Ext.isOpera||Ext.isGecko||!this._frameAction){return}var n=0,manager=this,domReady=false,b,l,d,max=300,polling=false,startLocation=(this.getDocument()||{location:{}}).location.href;(function(){d=manager.getDocument()||{location:{}};polling=(d.location.href!==startLocation||d.location.href===manager._targetURI);if(!manager._frameAction||manager._domReady){return}domReady=polling&&((b=manager.getBody())&&!!(b.innerHTML||"").length)||false;if(d.location.href&&!domReady&&(++n<max)){setTimeout(arguments.callee,2);return}manager.loadHandler({type:domReady?"domready":"domfail"})})()}});var styleCamelRe=/(-[a-z])/gi;var styleCamelFn=function(m,a){return a.charAt(1).toUpperCase()};var CSSInterface=function(hostDocument){var doc;if(hostDocument){doc=hostDocument;return{rules:null,destroy:function(){return doc=null},createStyleSheet:function(cssText,id){var ss;if(!doc){return}var head=doc.getElementsByTagName("head")[0];var rules=doc.createElement("style");rules.setAttribute("type","text/css");if(id){rules.setAttribute("id",id)}if(Ext.isIE){head.appendChild(rules);ss=rules.styleSheet;ss.cssText=cssText}else{try{rules.appendChild(doc.createTextNode(cssText))}catch(e){rules.cssText=cssText}head.appendChild(rules);ss=rules.styleSheet?rules.styleSheet:(rules.sheet||doc.styleSheets[doc.styleSheets.length-1])}this.cacheStyleSheet(ss);return ss},removeStyleSheet:function(id){if(!doc){return}var existing=doc.getElementById(id);if(existing){existing.parentNode.removeChild(existing)}},swapStyleSheet:function(id,url){this.removeStyleSheet(id);if(!doc){return}var ss=doc.createElement("link");ss.setAttribute("rel","stylesheet");ss.setAttribute("type","text/css");ss.setAttribute("id",id);ss.setAttribute("href",url);doc.getElementsByTagName("head")[0].appendChild(ss)},refreshCache:function(){return this.getRules(true)},cacheStyleSheet:function(ss){if(this.rules){this.rules={}}try{var ssRules=ss.cssRules||ss.rules;for(var j=ssRules.length-1;j>=0;--j){this.rules[ssRules[j].selectorText]=ssRules[j]}}catch(e){}},getRules:function(refreshCache){if(this.rules==null||refreshCache){this.rules={};if(doc){var ds=doc.styleSheets;for(var i=0,len=ds.length;i<len;i++){try{this.cacheStyleSheet(ds[i])}catch(e){}}}}return this.rules},getRule:function(selector,refreshCache){var rs=this.getRules(refreshCache);if(!Ext.isArray(selector)){return rs[selector]}for(var i=0;i<selector.length;i++){if(rs[selector[i]]){return rs[selector[i]]}}return null},updateRule:function(selector,property,value){if(!Ext.isArray(selector)){var rule=this.getRule(selector);if(rule){rule.style[property.replace(styleCamelRe,styleCamelFn)]=value;return true}}else{for(var i=0;i<selector.length;i++){if(this.updateRule(selector[i],property,value)){return true}}}return false}}}};Ext.ux.ManagedIframePanel=Ext.extend(Ext.Panel,{defaultSrc:null,bodyStyle:{position:"relative"},frameStyle:{overflow:"auto"},frameConfig:null,hideMode:!Ext.isIE?"nosize":"display",shimCls:"x-frame-shim",shimUrl:null,loadMask:false,stateful:false,animCollapse:Ext.isIE&&Ext.enableFx,autoScroll:false,closable:true,ctype:"Ext.ux.ManagedIframePanel",showLoadIndicator:false,unsupportedText:"Inline frames are NOT enabled/supported by your browser.",initComponent:function(){var f=this.frameConfig?this.frameConfig.autoCreate||this.frameConfig:{};var frCfg=Ext.apply(f,{id:f.id||Ext.id()});frCfg.name=f.name||frCfg.id;if(Ext.isIE&&Ext.isSecure){frCfg.src=Ext.SSL_SECURE_URL}var frameTag=Ext.apply({tag:"iframe",frameborder:0,cls:"x-managed-iframe",style:this.frameStyle||f.style||{}},frCfg);var unsup=this.unsupportedText?{tag:"noframes",html:this.unsupportedText}:[];this.bodyCfg||(this.bodyCfg={cls:this.baseCls+"-body",children:this.contentEl?[]:[frameTag].concat(unsup)});this.autoScroll=false;this.items=null;if(this.stateful!==false){this.stateEvents||(this.stateEvents=["documentloaded"])}Ext.ux.ManagedIframePanel.superclass.initComponent.call(this);this.monitorResize||(this.monitorResize=!!this.fitToParent);this.addEvents({documentloaded:true,domready:true,message:true,exception:true,blur:true,focus:true});this.addListener=this.on},doLayout:function(){if(this.fitToParent&&!this.ownerCt){var pos=this.getPosition(),size=(Ext.get(this.fitToParent)||this.getEl().parent()).getViewSize();this.setSize(size.width-pos[0],size.height-pos[1])}Ext.ux.ManagedIframePanel.superclass.doLayout.apply(this,arguments)},beforeDestroy:function(){if(this.rendered){if(this.tools){for(var k in this.tools){Ext.destroy(this.tools[k])}}if(this.header&&this.headerAsText){var s;if(s=this.header.child("span")){s.remove(true,true)}this.header.update("")}Ext.each(["iframe","shim","header","topToolbar","bottomToolbar","footer","loadMask","body","bwrap"],function(elName){if(this[elName]){if(typeof this[elName].destroy=="function"){this[elName].destroy()}else{Ext.destroy(this[elName])}this[elName]=null;delete this[elName]}},this)}Ext.ux.ManagedIframePanel.superclass.beforeDestroy.call(this)},onDestroy:function(){Ext.Panel.superclass.onDestroy.call(this)},afterRender:function(container){var html=this.html;delete this.html;Ext.ux.ManagedIframePanel.superclass.afterRender.apply(this,arguments);if(this.iframe=this.body.child("iframe")){this.iframe.ownerCt=this;if(this.loadMask){var mEl;if(mEl=this.loadMask.maskEl){this.loadMask.maskEl=this[mEl]||mEl||this.body;this.loadMask.maskEl.addClass("x-managed-iframe-mask")}this.loadMask=Ext.apply({disabled:false,hideOnReady:false},this.loadMask)}this.getUpdater().showLoadIndicator=this.showLoadIndicator||false;var ownerCt=this.ownerCt;while(ownerCt){ownerCt.on("afterlayout",function(container,layout){var MIM=Ext.ux.ManagedIFrame.Manager,st=false;Ext.each(["north","south","east","west"],function(region){var reg;if((reg=layout[region])&&reg.splitEl){st=true;if(!reg.split._splitTrapped){reg.split.on("beforeresize",MIM.showShims,MIM);reg.split._splitTrapped=true}}},this);if(st&&!this._splitTrapped){this.on("resize",MIM.hideShims,MIM);this._splitTrapped=true}},this,{single:true});ownerCt=ownerCt.ownerCt}this.shim=Ext.get(this.body.child("."+this.shimCls))||Ext.DomHelper.append(this.body,{tag:"img",src:this.shimUrl||Ext.BLANK_IMAGE_URL,cls:this.shimCls,galleryimg:"no"},true);var El=Ext.Element;var mode=El[this.hideMode.toUpperCase()]||"x-hide-nosize";Ext.each([this[this.collapseEl],this.floating?null:this.getActionEl(),this.iframe],function(el){if(el){el.setVisibilityMode(mode)}},this);if(this.iframe=new Ext.ux.ManagedIFrame(this.iframe,{loadMask:this.loadMask,showLoadIndicator:this.showLoadIndicator,disableMessaging:this.disableMessaging,style:this.frameStyle,src:this.defaultSrc,html:html})){this.loadMask=this.iframe.loadMask;this.iframe.ownerCt=this;this.relayEvents(this.iframe,["blur","focus","unload","documentloaded","domready","exception","message"].concat(this._msgTagHandlers||[]));delete this._msgTagHandlers}}},sendMessage:function(){if(this.iframe){this.iframe.sendMessage.apply(this.iframe,arguments)}},filterOptRe:/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/,on:function(name){var tagRE=/^message\:/i,n=null;if(typeof name=="object"){for(var na in name){if(!this.filterOptRe.test(na)&&tagRE.test(na)){n||(n=[]);n.push(na.toLowerCase())}}}else{if(tagRE.test(name)){n=[name.toLowerCase()]}}if(this.getFrame()&&n){this.relayEvents(this.iframe,n)}else{this._msgTagHandlers||(this._msgTagHandlers=[]);if(n){this._msgTagHandlers=this._msgTagHandlers.concat(n)}}Ext.ux.ManagedIframePanel.superclass.on.apply(this,arguments)},setSrc:function(url,discardUrl,callback,scope){url=url||this.defaultSrc||false;if(url&&this.rendered&&this.iframe){this.iframe.setSrc.call(this.iframe,url,discardUrl,callback,scope)}return this},setLocation:function(url,discardUrl,callback,scope){url=url||this.defaultSrc||false;if(url&&this.rendered&&this.iframe){this.iframe.setLocation.call(this.iframe,url,discardUrl,callback,scope)}return this},getState:function(){var URI=this.iframe?this.iframe.getDocumentURI()||null:null;return Ext.apply(Ext.ux.ManagedIframePanel.superclass.getState.call(this)||{},URI?{defaultSrc:typeof URI=="function"?URI():URI}:null)},getUpdater:function(){return this.rendered?(this.iframe||this.body).getUpdater():null},getFrame:function(){return this.rendered?this.iframe:null},getFrameWindow:function(){return this.rendered&&this.iframe?this.iframe.getWindow():null},getFrameDocument:function(){return this.rendered&&this.iframe?this.iframe.getDocument():null},getFrameDoc:function(){return this.rendered&&this.iframe?this.iframe.getDoc():null},getFrameBody:function(){return this.rendered&&this.iframe?this.iframe.getBody():null},load:function(loadCfg){var um;if(um=this.getUpdater()){if(loadCfg&&loadCfg.renderer){um.setRenderer(loadCfg.renderer);delete loadCfg.renderer}um.update.apply(um,arguments)}return this},doAutoLoad:function(){this.load(typeof this.autoLoad=="object"?this.autoLoad:{url:this.autoLoad})}});Ext.ux.ManagedIFrame.Manager=MIM=function(){var frames={};var implementation={readyHandler:function(e){try{var $frame=e.target.ownerEl;if($frame&&$frame._frameAction){$frame.loadHandler.call($frame,{type:"domready"})}}catch(rhEx){return}},shimCls:"x-frame-shim",register:function(frame){frame.manager=this;frames[frame.id]=frames[frame.dom.name]={ref:frame,elCache:{}};frame.dom[Ext.isIE?"onreadystatechange":"onload"]=frame.loadHandler.createDelegate(frame);return frame},deRegister:function(frame){frame._unHook();frame.dom.onload=frame.dom.onreadystatechange=null;delete frames[frame.id];delete frames[frame.dom.name]},hideShims:function(){if(!this.shimApplied){return}Ext.select("."+this.shimCls,true).removeClass(this.shimCls+"-on");this.shimApplied=false},showShims:function(){if(!this.shimApplied){this.shimApplied=true;Ext.select("."+this.shimCls,true).addClass(this.shimCls+"-on")}},getFrameById:function(id){return typeof id=="string"?(frames[id]?frames[id].ref||null:null):null},getFrameByName:function(name){return this.getFrameById(name)},getFrameHash:function(frame){return frame.id?frames[frame.id]:null},eventProxy:function(e){if(!e){return}e=Ext.EventObject.setEvent(e);var be=e.browserEvent||e;if(e.type=="unload"){this._unHook()}if(!be.eventPhase||(be.eventPhase==(be.AT_TARGET||2))){return this.fireEvent(e.type,e)}},_flyweights:{},destroy:function(){if(document.addEventListener){window.removeEventListener("DOMFrameContentLoaded",this.readyHandler,true)}},removeNode:Ext.isIE?function(frame,n){frame=MIM.getFrameHash(frame);if(frame&&n&&n.tagName!="BODY"){d=frame.scratchDiv||(frame.scratchDiv=frame.getDocument().createElement("div"));d.appendChild(n);d.innerHTML=""}}:function(frame,n){if(n&&n.parentNode&&n.tagName!="BODY"){n.parentNode.removeChild(n)}}};if(document.addEventListener){window.addEventListener("DOMFrameContentLoaded",implementation.readyHandler,true)}Ext.EventManager.on(window,"beforeunload",implementation.destroy,implementation);return implementation}();MIM.showDragMask=MIM.showShims;MIM.hideDragMask=MIM.hideShims;MIM.El=function(frame,el,forceNew){var frameObj;frame=(frameObj=MIM.getFrameHash(frame))?frameObj.ref:null;if(!frame){return null}var elCache=frameObj.elCache||(frameObj.elCache={});var dom=frame.getDom(el);if(!dom){return null}var id=dom.id;if(forceNew!==true&&id&&elCache[id]){return elCache[id]}this.dom=dom;this.id=id||Ext.id(dom)};MIM.El.get=function(frame,el){var ex,elm,id,doc;if(!frame||!el){return null}var frameObj;frame=(frameObj=MIM.getFrameHash(frame))?frameObj.ref:null;if(!frame){return null}var elCache=frameObj.elCache||(frameObj.elCache={});if(!(doc=frame.getDocument())){return null}if(typeof el=="string"){if(!(elm=frame.getDom(el))){return null}if(ex=elCache[el]){ex.dom=elm}else{ex=elCache[el]=new MIM.El(frame,elm)}return ex}else{if(el.tagName){if(!(id=el.id)){id=Ext.id(el)}if(ex=elCache[id]){ex.dom=el}else{ex=elCache[id]=new MIM.El(frame,el)}return ex}else{if(el instanceof MIM.El){if(el!=frameObj.docEl){el.dom=frame.getDom(el.id)||el.dom;elCache[el.id]=el}return el}else{if(el.isComposite){return el}else{if(Ext.isArray(el)){return frame.select(el)}else{if(el==doc){if(!frameObj.docEl){var f=function(){};f.prototype=MIM.El.prototype;frameObj.docEl=new f();frameObj.docEl.dom=doc}return frameObj.docEl}}}}}}return null};Ext.apply(MIM.El.prototype,Ext.Element.prototype);Ext.ns("Ext.ux.panel","Ext.ux.portlet");Ext.reg("iframepanel",Ext.ux.panel.ManagedIframe=Ext.ux.ManagedIframePanel);Ext.ux.ManagedIframePortlet=Ext.extend(Ext.ux.ManagedIframePanel,{anchor:"100%",frame:true,collapseEl:"bwrap",collapsible:true,draggable:true,cls:"x-portlet"});Ext.reg("iframeportlet",Ext.ux.portlet.ManagedIframe=Ext.ux.ManagedIframePortlet);Ext.apply(Ext.Element.prototype,{setVisible:function(visible,animate){if(!animate||!Ext.lib.Anim){if(this.visibilityMode==Ext.Element.DISPLAY){this.setDisplayed(visible)}else{if(this.visibilityMode==Ext.Element.VISIBILITY){this.fixDisplay();this.dom.style.visibility=visible?"visible":"hidden"}else{this[visible?"removeClass":"addClass"](String(this.visibilityMode))}}}else{var dom=this.dom;var visMode=this.visibilityMode;if(visible){this.setOpacity(0.01);this.setVisible(true)}this.anim({opacity:{to:(visible?1:0)}},this.preanim(arguments,1),null,0.35,"easeIn",function(){if(!visible){if(visMode==Ext.Element.DISPLAY){dom.style.display="none"}else{if(visMode==Ext.Element.VISIBILITY){dom.style.visibility="hidden"}else{Ext.get(dom).addClass(String(visMode))}}Ext.get(dom).setOpacity(1)}})}return this},isVisible:function(deep){var vis=!(this.hasClass(this.visibilityMode)||this.getStyle("visibility")=="hidden"||this.getStyle("display")=="none");if(deep!==true||!vis){return vis}var p=this.dom.parentNode;while(p&&p.tagName.toLowerCase()!="body"){if(!Ext.fly(p,"_isVisible").isVisible()){return false}p=p.parentNode}return true}});Ext.onReady(function(){var CSS=Ext.util.CSS,rules=[];CSS.getRule(".x-managed-iframe")||(rules.push(".x-managed-iframe {height:100%;width:100%;overflow:auto;position:relative;}"));CSS.getRule(".x-managed-iframe-mask")||(rules.push(".x-managed-iframe-mask{position:relative;zoom:1;}"));if(!CSS.getRule(".x-frame-shim")){rules.push(".x-frame-shim {z-index:8500;position:absolute;top:0px;left:0px;background:transparent!important;overflow:hidden;display:none;}");rules.push(".x-frame-shim-on{width:100%;height:100%;display:block;zoom:1;}");rules.push(".ext-ie6 .x-frame-shim{margin-left:5px;margin-top:3px;}")}CSS.getRule(".x-hide-nosize")||(rules.push(".x-hide-nosize,.x-hide-nosize *{height:0px!important;width:0px!important;border:none;}"));if(!!rules.length){CSS.createStyleSheet(rules.join(" "))}})})();if(Ext.provide){Ext.provide("miframe")}Ext.ns("Ext.ux");Ext.ux.Carousel=Ext.extend(Ext.util.Observable,{interval:3,transitionDuration:1,transitionType:"carousel",transitionEasing:"easeOut",itemSelector:"img",activeSlide:0,autoPlay:false,showPlayButton:false,pauseOnNavigate:false,wrap:false,freezeOnHover:false,navigationOnHover:false,hideNavigation:false,constructor:function(b,a){a=a||{};Ext.apply(this,a);Ext.ux.Carousel.superclass.constructor.call(this,a);this.addEvents("beforeprev","prev","beforenext","next","change","play","pause","freeze","unfreeze");this.el=Ext.get(b);this.slides=this.els=[];if(this.autoPlay||this.showPlayButton){this.wrap=true}if(this.autoPlay&&a.showPlayButton===undefined){this.showPlayButton=true}this.initMarkup();this.initEvents();if(this.carouselSize>0){this.refresh()}},initMarkup:function(){var a=Ext.DomHelper;this.carouselSize=0;this.els.container=a.append(this.el,{cls:"ux-carousel-container"},true);this.els.slidesWrap=a.append(this.els.container,{cls:"ux-carousel-slides-wrap"},true);this.els.navigation=a.append(this.els.container,{cls:"ux-carousel-nav"},true).hide();this.els.caption=a.append(this.els.navigation,{tag:"h2",cls:"ux-carousel-caption"},true);this.els.navNext=a.append(this.els.navigation,{tag:"a",href:"#",cls:"ux-carousel-nav-next"},true);if(this.showPlayButton){this.els.navPlay=a.append(this.els.navigation,{tag:"a",href:"#",cls:"ux-carousel-nav-play"},true)}this.els.navPrev=a.append(this.els.navigation,{tag:"a",href:"#",cls:"ux-carousel-nav-prev"},true);this.slideWidth=this.el.getWidth(true);this.slideHeight=this.el.getHeight(true);this.els.container.setStyle({width:this.slideWidth+"px",height:this.slideHeight+"px"});this.els.caption.setWidth((this.slideWidth-(this.els.navNext.getWidth()*2)-(this.showPlayButton?this.els.navPlay.getWidth():0)-20)+"px");this.el.select(this.itemSelector).appendTo(this.els.slidesWrap).each(function(b){b=b.wrap({cls:"ux-carousel-slide"});this.slides.push(b);b.setWidth(this.slideWidth+"px").setHeight(this.slideHeight+"px")},this);this.carouselSize=this.slides.length;if(this.navigationOnHover){this.els.navigation.setStyle("top",(-1*this.els.navigation.getHeight())+"px")}this.el.clip()},initEvents:function(){this.els.navPrev.on("click",function(a){a.preventDefault();var b=a.getTarget();b.blur();if(Ext.fly(b).hasClass("ux-carousel-nav-disabled")){return}this.prev()},this);this.els.navNext.on("click",function(a){a.preventDefault();var b=a.getTarget();b.blur();if(Ext.fly(b).hasClass("ux-carousel-nav-disabled")){return}this.next()},this);if(this.showPlayButton){this.els.navPlay.on("click",function(a){a.preventDefault();a.getTarget().blur();if(this.playing){this.pause()}else{this.play()}},this)}if(this.freezeOnHover){this.els.container.on("mouseenter",function(){if(this.playing){this.fireEvent("freeze",this.slides[this.activeSlide]);Ext.TaskMgr.stop(this.playTask)}},this);this.els.container.on("mouseleave",function(){if(this.playing){this.fireEvent("unfreeze",this.slides[this.activeSlide]);Ext.TaskMgr.start(this.playTask)}},this,{buffer:(this.interval/2)*1000})}if(this.navigationOnHover){this.els.container.on("mouseenter",function(){if(!this.navigationShown){this.navigationShown=true;this.els.navigation.stopFx(false).shift({y:this.els.container.getY(),duration:this.transitionDuration})}},this);this.els.container.on("mouseleave",function(){if(this.navigationShown){this.navigationShown=false;this.els.navigation.stopFx(false).shift({y:this.els.navigation.getHeight()-this.els.container.getY(),duration:this.transitionDuration})}},this)}if(this.interval&&this.autoPlay){this.play()}},prev:function(){if(this.fireEvent("beforeprev")===false){return}if(this.pauseOnNavigate){this.pause()}this.setSlide(this.activeSlide-1);this.fireEvent("prev",this.activeSlide);return this},next:function(){if(this.fireEvent("beforenext")===false){return}if(this.pauseOnNavigate){this.pause()}this.setSlide(this.activeSlide+1);this.fireEvent("next",this.activeSlide);return this},play:function(){if(!this.playing){this.playTask=this.playTask||{run:function(){this.playing=true;this.setSlide(this.activeSlide+1)},interval:this.interval*1000,scope:this};this.playTaskBuffer=this.playTaskBuffer||new Ext.util.DelayedTask(function(){Ext.TaskMgr.start(this.playTask)},this);this.playTaskBuffer.delay(this.interval*1000);this.playing=true;this.els.navPlay.addClass("ux-carousel-playing");this.fireEvent("play")}return this},pause:function(){if(this.playing){Ext.TaskMgr.stop(this.playTask);this.playTaskBuffer.cancel();this.playing=false;this.els.navPlay.removeClass("ux-carousel-playing");this.fireEvent("pause")}return this},clear:function(){this.els.slidesWrap.update("");this.slides=[];this.carouselSize=0;this.pause();return this},add:function(b,a){var c=Ext.fly(b).appendTo(this.els.slidesWrap).wrap({cls:"ux-carousel-slide"});c.setWidth(this.slideWidth+"px").setHeight(this.slideHeight+"px");this.slides.push(c);if(a){this.refresh()}return this},refresh:function(){this.carouselSize=this.slides.length;this.els.slidesWrap.setWidth((this.slideWidth*this.carouselSize)+"px");if(this.carouselSize>0){if(!this.hideNavigation){this.els.navigation.show()}this.activeSlide=0;this.setSlide(0,true)}return this},setSlide:function(b,a){if(!this.wrap&&!this.slides[b]){return}else{if(this.wrap){if(b<0){b=this.carouselSize-1}else{if(b>this.carouselSize-1){b=0}}}}if(!this.slides[b]){return}this.els.caption.update(this.slides[b].child(":first-child",true).title||"");var e=b*this.slideWidth;if(!a){switch(this.transitionType){case"fade":this.slides[b].setOpacity(0);this.slides[this.activeSlide].stopFx(false).fadeOut({duration:this.transitionDuration/2,callback:function(){this.els.slidesWrap.setStyle("left",(-1*e)+"px");this.slides[this.activeSlide].setOpacity(1);this.slides[b].fadeIn({duration:this.transitionDuration/2})},scope:this});break;default:var c=(-1*e)+this.els.container.getX();this.els.slidesWrap.stopFx(false);this.els.slidesWrap.shift({duration:this.transitionDuration,x:c,easing:this.transitionEasing});break}}else{this.els.slidesWrap.setStyle("left","0")}this.activeSlide=b;this.updateNav();this.fireEvent("change",this.slides[b],b)},updateNav:function(){this.els.navPrev.removeClass("ux-carousel-nav-disabled");this.els.navNext.removeClass("ux-carousel-nav-disabled");if(!this.wrap){if(this.activeSlide===0){this.els.navPrev.addClass("ux-carousel-nav-disabled")}if(this.activeSlide===this.carouselSize-1){this.els.navNext.addClass("ux-carousel-nav-disabled")}}}});
/*
 * Ext Core Library 3.0
 * http://extjs.com/
 * Copyright(c) 2006-2009, Ext JS, LLC.
 * 
 * MIT Licensed - http://extjs.com/license/mit.txt
 */
Ext.ns("Ext.ux");Ext.ux.Lightbox=(function(){var c={},a=[],e,f=false,b=[];return{overlayOpacity:0.85,animate:true,resizeSpeed:8,borderSize:10,labelImage:"Image",labelOf:"of",init:function(){this.resizeDuration=this.animate?((11-this.resizeSpeed)*0.15):0;this.overlayDuration=this.animate?0.2:0;if(!f){Ext.apply(this,Ext.util.Observable.prototype);Ext.util.Observable.constructor.call(this);this.addEvents("open","close");this.initMarkup();this.initEvents();f=true}},initMarkup:function(){c.shim=Ext.DomHelper.append(document.body,{tag:"iframe",id:"ux-lightbox-shim"},true);c.overlay=Ext.DomHelper.append(document.body,{id:"ux-lightbox-overlay"},true);var h=new Ext.Template(this.getTemplate());c.lightbox=h.append(document.body,{},true);var i=["outerImageContainer","imageContainer","image","hoverNav","navPrev","navNext","loading","loadingLink","outerDataContainer","dataContainer","data","details","caption","imageNumber","bottomNav","navClose"];Ext.each(i,function(j){c[j]=Ext.get("ux-lightbox-"+j)});Ext.each([c.overlay,c.lightbox,c.shim],function(j){j.setVisibilityMode(Ext.Element.DISPLAY);j.hide()});var g=(this.animate?250:1)+"px";c.outerImageContainer.setStyle({width:g,height:g})},getTemplate:function(){return['<div id="ux-lightbox">','<div id="ux-lightbox-outerImageContainer">','<div id="ux-lightbox-imageContainer">','<img id="ux-lightbox-image">','<div id="ux-lightbox-hoverNav">','<a href="#" id="ux-lightbox-navPrev"></a>','<a href="#" id="ux-lightbox-navNext"></a>',"</div>",'<div id="ux-lightbox-loading">','<a id="ux-lightbox-loadingLink"></a>',"</div>","</div>","</div>",'<div id="ux-lightbox-outerDataContainer">','<div id="ux-lightbox-dataContainer">','<div id="ux-lightbox-data">','<div id="ux-lightbox-details">','<span id="ux-lightbox-caption"></span>','<span id="ux-lightbox-imageNumber"></span>',"</div>",'<div id="ux-lightbox-bottomNav">','<a href="#" id="ux-lightbox-navClose"></a>',"</div>","</div>","</div>","</div>","</div>"]},initEvents:function(){var g=function(h){h.preventDefault();this.close()};c.overlay.on("click",g,this);c.loadingLink.on("click",g,this);c.navClose.on("click",g,this);c.lightbox.on("click",function(h){if(h.getTarget().id=="ux-lightbox"){this.close()}},this);c.navPrev.on("click",function(h){h.preventDefault();this.setImage(e-1)},this);c.navNext.on("click",function(h){h.preventDefault();this.setImage(e+1)},this)},register:function(g,h){if(b.indexOf(g)===-1){b.push(g);Ext.fly(document).on("click",function(i){var j=i.getTarget(g);if(j){i.preventDefault();this.open(j,g,h)}},this)}},open:function(i,g,h){h=h||false;this.setViewSize();c.overlay.fadeIn({duration:this.overlayDuration,endOpacity:this.overlayOpacity,callback:function(){a=[];var j=0;if(!h){a.push([i.href,i.title])}else{var k=Ext.query(g);Ext.each(k,function(o){if(o.href){a.push([o.href,o.title])}});while(a[j][0]!=i.href){j++}}var m=Ext.fly(document).getScroll();var n=m.top+(Ext.lib.Dom.getViewportHeight()/10);var l=m.left;c.lightbox.setStyle({top:n+"px",left:l+"px"}).show();this.setImage(j);this.fireEvent("open",a[j])},scope:this})},setViewSize:function(){var g=this.getViewSize();c.overlay.setStyle({width:g[0]+"px",height:g[1]+"px"});c.shim.setStyle({width:g[0]+"px",height:g[1]+"px"}).show()},setImage:function(h){e=h;this.disableKeyNav();if(this.animate){c.loading.show()}c.image.hide();c.hoverNav.hide();c.navPrev.hide();c.navNext.hide();c.dataContainer.setOpacity(0.0001);c.imageNumber.hide();var g=new Image();g.onload=(function(){c.image.dom.src=a[e][0];this.resizeImage(g.width,g.height)}).createDelegate(this);g.src=a[e][0]},resizeImage:function(n,i){var p=c.outerImageContainer.getWidth();var l=c.outerImageContainer.getHeight();var k=(n+this.borderSize*2);var j=(i+this.borderSize*2);var m=p-k;var g=l-j;var o=function(){c.hoverNav.setWidth(c.imageContainer.getWidth()+"px");c.navPrev.setHeight(i+"px");c.navNext.setHeight(i+"px");c.outerDataContainer.setWidth(k+"px");this.showImage()};if(g!=0||m!=0){c.outerImageContainer.shift({height:j,width:k,duration:this.resizeDuration,scope:this,callback:o,delay:50})}else{o.call(this)}},showImage:function(){c.loading.hide();c.image.fadeIn({duration:this.resizeDuration,scope:this,callback:function(){this.updateDetails()}});this.preloadImages()},updateDetails:function(){var g=c.data.getWidth(true)-c.navClose.getWidth()-10;c.details.setWidth((g>0?g:0)+"px");c.caption.update(a[e][1]);c.caption.show();if(a.length>1){c.imageNumber.update(this.labelImage+" "+(e+1)+" "+this.labelOf+"  "+a.length);c.imageNumber.show()}c.dataContainer.fadeIn({duration:this.resizeDuration/2,scope:this,callback:function(){var h=this.getViewSize();c.overlay.setHeight(h[1]+"px");this.updateNav()}})},updateNav:function(){this.enableKeyNav();c.hoverNav.show();if(e>0){c.navPrev.show()}if(e<(a.length-1)){c.navNext.show()}},enableKeyNav:function(){Ext.fly(document).on("keydown",this.keyNavAction,this)},disableKeyNav:function(){Ext.fly(document).un("keydown",this.keyNavAction,this)},keyNavAction:function(g){var h=g.getKey();if(h==88||h==67||h==27){this.close()}else{if(h==80||h==37){if(e!=0){this.setImage(e-1)}}else{if(h==78||h==39){if(e!=(a.length-1)){this.setImage(e+1)}}}}},preloadImages:function(){var g,h;if(a.length>e+1){g=new Image();g.src=a[e+1][0]}if(e>0){h=new Image();h.src=a[e-1][0]}},close:function(){this.disableKeyNav();c.lightbox.hide();c.overlay.fadeOut({duration:this.overlayDuration});c.shim.hide();this.fireEvent("close",e)},getViewSize:function(){return[Ext.lib.Dom.getViewWidth(),Ext.lib.Dom.getViewHeight()]}}})();Ext.onReady(Ext.ux.Lightbox.init,Ext.ux.Lightbox);Ext.namespace("Montior");Ext.override(Ext.util.Observable,{subscribe:function(a,c,b,f){Monitor.Bus.addEvents(a);Monitor.Bus.on(a,c,b,f);if(this.on){this.events=this.events||[];this.on("destroy",function(g,h,i){Monitor.Bus.un(g,h,i)}.createDelegate(this,[a,c,b]))}if(Monitor.Cache.has(a)){var e=Monitor.Bus.events[a];e.fire.call(e,Monitor.Cache.get(a),a)}},publish:function(g,a,j){if(this!=Monitor.Cache){Monitor.Cache.set(g,a,j)}if(Monitor.Bus.eventsSuspended===true){return true}if(!Monitor.Bus.events){return false}var c=Monitor.Bus.events["*"];if(c){if(c.fire.call(c,a,g)===false){return true}}if(g.substr(0,1)=="/"&&g.length>1){var f=g.substr(1).split("/");var b=false;for(var e=0,h=f.length;e<=h;e++){var i=Monitor.Bus.events["/"+f.slice(0,e).join("/").toLowerCase()];if(i){b=true;if(i.fire.call(i,a,g)===false){return true}}}return b}else{var i=Monitor.Bus.events[g.toLowerCase()];if(i){i.fire.call(i,a,g);return true}}return false},removeSubcribers:function(a){for(var c in Monitor.Bus.events){if((c==a)||(!a)){var b=Monitor.Bus.events[c];if(b){Monitor.Bus.events[b].clearListeners()}}}}});Monitor.Bus=new Ext.util.Observable();Ext.namespace("Monitor");Monitor.CacheEngine=Ext.extend(Ext.util.Observable,{cache:[],constructor:function(a){Ext.apply(this,a);var b={run:function(){var f=new Date().getTime();var i=[];for(var e=0,c=this.cache.length;e<c;e++){var j=this.cache[e];if(j.expires&&j.expires<f){i.push(j)}}for(var e=0,c=i.length;e<c;e++){var j=i[e];var g=j.key;var h={key:j.key,value:j.value};this.cache.remove(j);if(g[0]!="/"){g="/"+g}this.publish("/cache/expire"+g,h)}},interval:1000,scope:this};Ext.TaskMgr.start(b);Monitor.CacheEngine.superclass.constructor.call(a)},clear:function(){this.cache=[]},get:function(a){var b=this.find(a);if(b){return b.value}return null},set:function(b,f,e){var a=null;if(e){a=new Date().getTime()+(e*1000)}var c=this.find(b);if(c){c.value=f;c.expires=a;this.publish("/cache/update",c)}else{c={key:b,value:f,expires:a};this.cache.push(c);this.publish("/cache/add",c)}},remove:function(a){var b=this.find(a);if(b){this.cache.remove(b);this.publish("/cached/remove",b);return true}return false},has:function(a){var b=this.find(a);return b!=null},find:function(c){for(var b=0,a=this.cache.length;b<a;b++){var e=this.cache[b];if(c==e.key){return e}}return null}});Monitor.Cache=new Monitor.CacheEngine();function createCookie(c,e,f){var a="";if(f){var b=new Date();b.setTime(b.getTime()+(f*24*60*60*1000));a="; expires="+b.toGMTString()}document.cookie=c+"="+e+a+"; path="+Monitor.baseurl}function readCookie(b){var f=b+"=";var a=document.cookie.split(";");for(var e=0;e<a.length;e++){var g=a[e];while(g.charAt(0)==" "){g=g.substring(1,g.length)}if(g.indexOf(f)==0){return g.substring(f.length,g.length)}}return null}function eraseCookie(a){createCookie(a,"",-1)}Ext.namespace("Monitor");Monitor.TimeSpan=function(a){Ext.apply(this,a);if(!this.selected){this.selected=this.items[0].id}Ext.each(this.items,function(b){if(this.selected==b.id){this.selectedText=b.text}},this)};Monitor.TimeSpan.prototype={id:null,items:null,selected:null,selectedText:"",show:function(b){var a=Ext.getCmp("timerangeButton");a.menu.removeAll();Ext.each(this.items,function(c){a.menu.add({id:c.id,text:c.text,group:this.id,checked:this.selected==c.id,checkHandler:this.onItemCheck.createDelegate(this)})},this);a.setText(this.selectedText);this.page=b},onItemCheck:function(b,a){if(a){this.selected=b.id;this.selectedText=b.text;Ext.getCmp("timerangeButton").setText(b.text);this.page.reload()}}};Ext.namespace("Monitor");Monitor.SidebarPanel=Ext.extend(Ext.Panel,{frame:true});Ext.reg("sidebarpanel",Monitor.SidebarPanel);Ext.namespace("Monitor");Monitor.WebcamPanel=Ext.extend(Monitor.SidebarPanel,{title:"Current View",images:null,carouselConfig:null,iconPath:"/share/monitor-1.5/resources/icons/silk",imagePath:Monitor.rooturl+"/plots/webcam/sony/position-{pos}-thumbnail.jpg",imageWidth:125,imageHeight:93,initComponent:function(){this.carouselConfig=Ext.applyIf(this.carouselConfig||{},{autoPlay:true,hideNavigation:true,freezeOnHover:true});Ext.apply(this,{html:this.html||this.createMarkup()});this.carouselConfig=this.carouselConfig||{};Monitor.WebcamPanel.superclass.initComponent.call(this);this.on("afterrender",this.startUpdates,this)},startUpdates:function(){this.carousel=new Ext.ux.Carousel("carousel",this.carouselConfig);Ext.get("carouselnext").on("click",this.carousel.next,this.carousel);Ext.get("carouselprev").on("click",this.carousel.prev,this.carousel);Ext.get("carouselplay").on("click",this.togglePlay,this);this.carousel.on("pause",this.setPlayIcon,this);this.carousel.on("play",this.setPauseIcon,this);if(this.running){clearInterval(this.running)}this.running=setInterval(this.updateImages.createDelegate(this),60*10*1000)},setPauseIcon:function(){var a=Ext.getDom("carouselplay");a.src=this.iconPath+"/control_pause_blue.png"},setPlayIcon:function(){var a=Ext.getDom("carouselplay");a.src=this.iconPath+"/control_play_blue.png"},togglePlay:function(){if(this.carousel.playing){this.carousel.pause()}else{this.carousel.play()}},updateImages:function(){},createMarkup:function(){var k=document.createDocumentFragment();var a=document.createElement("div");k.appendChild(a);var b=Ext.DomHelper.append(a,{tag:"div",id:"carouselframe"});var e=Ext.DomHelper.append(b,{tag:"div",id:"carousel"});var f='<img id={id} src="'+this.imagePath+'" width="'+this.imageWidth+'" height="'+this.imageHeight+'" />';var h=new Ext.Template(f);Ext.each(this.images,function(m){h.append(e,m)},this);var j=[{id:"carouselprev",icon:"control_rewind_blue.png"},{id:"carouselplay",icon:"control_pause_blue.png"},{id:"carouselnext",icon:"control_fastforward_blue.png"}];var i=Ext.DomHelper.append(a,{tag:"ul",id:"carouselcontrols"});var l=this.iconPath+"/{icon}";var g='<li><img id={id} src="'+l+'" /></li>';var c=new Ext.Template(g);Ext.each(j,function(m){c.append(i,m)},this);return a.innerHTML}});Ext.reg("webcampanel",Monitor.WebcamPanel);Ext.namespace("Monitor");Monitor.NullRenderer=Ext.extend(Ext.Updater.BasicRenderer,{render:function(c,a,b,e){}});Monitor.StatusPanel=Ext.extend(Monitor.SidebarPanel,{title:"Status",leds:null,listid:"status-list",listcls:"ledlist",url:"/instrumentstatus",updateRate:60,timeout:600,initComponent:function(){Ext.apply(this,{html:this.html||this.createMarkup()});Monitor.StatusPanel.superclass.initComponent.call(this);this.prevUpdateRate=null;this.on("afterrender",this.startUpdates,this);this.subscribe("/cache/expire/status",this.expiredStatus,this)},startUpdates:function(){var a=this.getUpdater();a.setRenderer(new Monitor.NullRenderer);a.on("update",this.updateStatus,this);a.showLoadIndicator=false;this.setUpdateRate(this.updateRate)},refresh:function(){this.prevUpdateRate=null;this.setUpdateRate(this.updateRate)},setUpdateRate:function(a){if(this.updateRate&&a!=this.prevUpdateRate){var b=this.getUpdater();b.stopAutoRefresh();b.startAutoRefresh(a,Monitor.baseurl+this.url,null,null,true);this.prevUpdateRate=a}},setLeds:function(a){for(var b in a){var c=Ext.getDom(b);if(c){c.className=a[b]}}},updateStatus:function(c,a){var b=Ext.decode(a.responseText);this.setLeds(b.status);this.publish("/status",b.status,this.timeout)},expiredStatus:function(c){var a=c.value;for(var b in a){a[b]="unknown"}this.setLeds(a);this.publish("/status",a)},createMarkup:function(){var f=document.createDocumentFragment();var e=document.createElement("div");f.appendChild(e);var c=Ext.DomHelper.append(e,{tag:"ul",id:this.listid,cls:this.listcls});var a='<li id="{id}" class="unknown">{label}</li>';var b=new Ext.Template(a);Ext.each(this.leds,function(g){b.append(c,g)},this);return e.innerHTML}});Ext.reg("statuspanel",Monitor.StatusPanel);Ext.namespace("Monitor");Monitor.NavigationPanel=Ext.extend(Ext.tree.TreePanel,{links:null,rootid:"displays",initComponent:function(){var a={frame:true,root:new Ext.tree.TreeNode({id:this.rootid}),rootVisible:false,useArrows:true,animate:true,autoScroll:true,collapseFirst:false,lines:false,ctCls:"feed"};Ext.apply(this,a);Monitor.NavigationPanel.superclass.initComponent.call(this);this.getSelectionModel().on({selectionchange:function(e,b){if(b.isLeaf()){var c=b.attributes.target;Ext.getCmp("center").getLayout().setActiveItem(c)}},scope:this});if(this.links){Ext.each(this.links,this.addLink,this)}},addLink:function(b){if(!b.path){b.path=b.text.replace(/[ ()\/?]/g,"").toLowerCase()}var a=new Ext.tree.TreeNode({text:b.text,target:b.id,path:b.path,leaf:true});this.root.appendChild(a)},findLink:function(a){return this.root.findChild("path",a)},getActivePath:function(){var a=this.getSelectionModel().getSelectedNode();var b=Ext.getCmp(a.attributes.target);return b.path+"/"+b.activeTab.path}});Ext.reg("navpanel",Monitor.NavigationPanel);Ext.namespace("Monitor");Monitor.ManagedTabPanel=Ext.extend(Ext.TabPanel,{enableTabScroll:true,defaultType:"plotspanel",tabPosition:"bottom",activeTab:0,initComponent:function(){if(!this.path){this.path=this.text.replace(/[ ()\/?]/g,"").toLowerCase()}Ext.each(this.items,function(a){if(a.title==undefined){a.title="Tab"}if(a.path==undefined){a.path=a.title.replace(/[ ()\/?]/g,"").toLowerCase()}});Monitor.ManagedTabPanel.superclass.initComponent.call(this);this.on("show",function(){if(typeof this.activeTab=="object"){this.activeTab.fireEvent("startupdate");this.changeLocation(this.activeTab)}},this);this.on("hide",function(){if(typeof this.activeTab=="object"){this.activeTab.fireEvent("stopupdate")}},this);this.on("tabchange",function(b,a){this.changeLocation(a)},this)},changeLocation:function(a){window.location.replace("#"+this.path+"/"+a.path)}});Ext.reg("managedtabpanel",Monitor.ManagedTabPanel);Ext.namespace("Monitor");Monitor.UpdatingPanel=Ext.extend(Ext.Panel,{timespan:null,rate:600,cls:"updatingpanel",autoScroll:true,initComponent:function(){Ext.apply(this,{html:this.createMarkup()});Monitor.UpdatingPanel.superclass.initComponent.call(this);this.running=null;this.prevTime=0;this.curTimespan=null;this.addEvents("startupdate","stopupdate");this.on("startupdate",this.onStartUpdate,this);this.on("stopupdate",this.onStopUpdate,this);this.on("activate",this.onStartUpdate,this);this.on("deactivate",this.onStopUpdate,this);this.on("render",this.update,this)},log:function(a){},onStartUpdate:function(){this.log("onStart");if(this.timespan){this.timespan.show(this);Ext.getCmp("reloadButton").panel=this;if(this.curTimespan!=this.timespan.selected){this.curTimespan=this.timespan.selected;this.prevtime=0}}if(this.running){clearInterval(this.running);delete this.running}var a=(new Date()).getTime();var b=(a-this.prevTime)/1000;if(b>this.rate){this.reload()}else{this.countdown=this.rate-b;this.wait()}},onStopUpdate:function(){this.log("onStopUpdate");if(this.running){clearInterval(this.running);delete this.running}},update:function(){},wait:function(){this.log("wait");if(this.countdown>1){var b=Math.floor(this.countdown/60);var a=this.countdown%60;var c="Next update in "+String.leftPad(b,2,"0")+":"+String.leftPad(a,2,"0");Ext.getCmp("nextupdate").setText(c);this.countdown-=1;this.schedule()}else{this.reload()}},reload:function(){this.log("reload");Ext.getCmp("nextupdate").setText("Updating");this.update();this.countdown=this.rate;this.schedule()},schedule:function(){if(this.running){clearInterval(this.running)}this.running=setInterval(this.wait.createDelegate(this),1000)},createMarkup:function(){return this.html}});Ext.reg("updatingpanel",Monitor.UpdatingPanel);Ext.namespace("Monitor");Monitor.PlotsPanel=Ext.extend(Monitor.UpdatingPanel,{plots:null,prefix:"",createMarkup:function(){var a=[];var b=(new Date()).getTime();Ext.each(this.plots,function(c){if(c.substring(0,7)!="http://"){c=this.prefix+c}a.push({tag:"img",url:c})},this);return{tag:"div",children:a}},update:function(){var a=(new Date()).getTime();var b=Ext.query("img",this.body.dom);Ext.each(b,function(c){var e=c.getAttribute("url");if(this.timespan){e=e.replace("<timespan>",this.timespan.selected)}c.src=e+"?timestamp="+a},this)}});Ext.reg("plotspanel",Monitor.PlotsPanel);Ext.namespace("Monitor");Monitor.MapLabel=function(a,b){this.setValues(a);this.setMap(b)};Monitor.MapLabel.prototype=new google.maps.OverlayView();Monitor.MapLabel.prototype.setClass=function(a){a="markerlabel "+a;this.set("className",a);if(this.div){this.div.className=a}};Monitor.MapLabel.prototype.onRemove=function(){if(this.div){this.div.parentNode.removeChild(this.div);this.div=null;for(var a=0,b=this.listeners.length;a<b;++a){google.maps.event.removeListener(this.listeners[a])}}};Monitor.MapLabel.prototype.draw=function(){var e=this;if(!this.div){this.span=document.createElement("span");this.div=document.createElement("div");this.div.appendChild(this.span);this.div.className=this.get("className")||"waypoint";this.div.style.display="block";var c=this.getPanes();c.overlayImage.appendChild(this.div);this.listeners=[google.maps.event.addListener(this,"position_changed",function(){e.draw()}),google.maps.event.addListener(this,"text_changed",function(){e.draw()}),google.maps.event.addListener(this,"zoom_changed",function(){e.draw()})]}if(this.minZoom&&this.map.getZoom()<this.minZoom){Ext.fly(this.div).hide()}else{if(this.maxZoom&&this.map.getZoom()>this.maxZoom){Ext.fly(this.div).hide()}else{Ext.fly(this.div).show()}}var b=this.getProjection();var a=b.fromLatLngToDivPixel(this.get("position"));if(a){this.div.style.left=a.x+"px";this.div.style.top=a.y+"px"}if(this.offset){this.span.style.top=this.offset.toFixed()+"px"}this.span.innerHTML=this.get("text").toString()};Monitor.MapPanel=Ext.extend(Ext.Panel,{initComponent:function(){var a={plain:true,border:false,ctCls:"mappanel",mapConfig:{zoom:10,mapTypeId:google.maps.MapTypeId.HYBRID,backgroundColor:"white",center:new google.maps.LatLng(37,-97.8),scaleControl:true,streetViewControl:false}};Ext.applyIf(this,a);Monitor.MapPanel.superclass.initComponent.call(this)},afterRender:function(){var a=this.ownerCt.getSize();Ext.applyIf(this,a);Monitor.MapPanel.superclass.afterRender.call(this);this.map=new google.maps.Map(this.body.dom,this.mapConfig)},onResize:function(b,a){Monitor.MapPanel.superclass.onResize.call(this,b,a);if(this.map){google.maps.event.trigger(this.map,"resize")}},setSize:function(b,a){Monitor.MapPanel.superclass.setSize.call(this,b,a);if(this.map){google.maps.event.trigger(this.map,"resize")}},getMap:function(){return this.map}});Ext.reg("mappanel",Monitor.MapPanel);Ext.namespace("Monitor");Monitor.Clock=Ext.extend(Ext.Panel,{unstyled:true,monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],initComponent:function(){Ext.apply(this,{html:this.html||this.createMarkup()});Monitor.Clock.superclass.initComponent.call(this);this.on("afterrender",this.startUpdates,this)},startUpdates:function(){var a=Ext.get("account");Ext.get("clock").appendChild(a);Ext.fly("account").setVisible(true);var b=this.getUpdater();b.setRenderer(new Monitor.NullRenderer);b.on("update",this.setTime,this);b.showLoadIndicator=false;b.startAutoRefresh(600,Monitor.baseurl+"/clock",null,null,true);if(this.running){clearInterval(this.running)}this.running=setInterval(this.display.createDelegate(this),60*1000)},setTime:function(c,a){var b=Ext.decode(a.responseText);if(this.version&&b.version!=this.version){window.location=Monitor.baseurl}this.version=b.version;this.curTime=Date.parse(b.timestamp);this.display();this.publish("/clock",b)},display:function(){var b=new Date(this.curTime);this.curTime+=60*1000;var e=String.leftPad(b.getUTCHours(),2,"0");var h=String.leftPad(b.getUTCMinutes(),2,"0");var c=String.leftPad(b.getUTCSeconds(),2,"0");var g=b.getUTCFullYear();var a=this.monthNames[b.getUTCMonth()];var f=b.getUTCDate();Ext.fly("clock-time").update(e+":"+h+" UTC");Ext.fly("clock-date").update(a+" "+f+", "+g)},createMarkup:function(){return{tag:"div",id:"clock",children:[{tag:"div",id:"clock-date"},{tag:"div",id:"clock-time"}]}}});Ext.reg("clock",Monitor.Clock);Ext.namespace("Monitor");Ext.BLANK_IMAGE_URL="/share/monitor-1.5/resources/images/ext-s.gif";Monitor.Application=function(a){a=a||{};Ext.apply(this,a);this.startHash=window.location.hash};Ext.extend(Monitor.Application,Ext.util.Observable,{documentTitle:"Default title",footerText:"&copy "+Monitor.startTime.getFullYear()+" SRI International.&nbsp;&nbsp;Release "+Monitor.release,navigationTitle:"Displays",headerTitle:null,headerSubtitle:null,activeLink:0,unmask:function(){var a=Ext.get("loading-mask");var c=Ext.get("loading-msg");var b={duration:1,easing:"easeNone",remove:true};a.fadeOut(b);c.fadeOut(b)},createSidebarPanels:function(){return[]},createPages:function(){return[]},createTimeSpans:function(){},createTasks:function(){},createLayout:function(){document.title=this.documentTitle;this.createTimeSpans();var c=this.createSidebarPanels();var f=this.createPages();var b={id:"navpanel",title:this.navigationTitle,links:f,xtype:"navpanel"};var e={cls:"sidebar",region:"west",width:175,border:false,baseCls:"x-plain",defaultType:"sidebarpanel",items:[b].concat(c)};var g={id:"titleblock",layout:"vbox",layoutConfig:{align:"stretch",pack:"start"},defaults:{unstyled:true},flex:1,items:[{flex:1},{id:"title",html:this.headerTitle,height:30},{id:"subtitle",html:this.headerSubtitle,height:25},{flex:1}]};var i={region:"north",id:"header",unstyled:true,defaults:{unstyled:true},layout:"hbox",layoutConfig:{align:"stretch",pack:"start"},items:[g,{xtype:"clock"}],height:70};var h={region:"south",html:{tag:"div",id:"footer",html:this.footerText},height:20};var a={id:"center",region:"center",layout:"card",defaultType:"managedtabpanel",activeItem:0,layoutConfig:{deferredRender:true},defaults:{border:false},tbar:[new Ext.Toolbar.TextItem("Time span:"),{id:"timerangeButton",text:"Time Range",menu:{id:"timerangeMenu"}},"-",{id:"reloadButton",iconCls:"reload",text:"Reload",listeners:{click:function(j,k){if(j.panel){j.panel.reload()}}}},"->",{id:"nextupdate",text:"Next update"}],items:f};this.viewport=new Ext.Viewport({id:"viewport",layout:"border",items:[i,e,a,h]});this.unmask()},startup:function(){this.setLocation(this.startHash);this.subscribe("/clock",this.checkVersion,this);if("onhashchange" in window){var a=this.hashChange.createDelegate(this);if(window.addEventListener){window.addEventListener("hashchange",a,false)}else{if(window.addEvent){window.attachEvent("onhashchange",a)}}}},setLocation:function(g){var a=Ext.getCmp("navpanel");var i=g.substr(1);var b=null;var e=a.root.firstChild;if(i){var h=i.split("/",2);e=a.findLink(h[0]);b=h[1]||""}if(!e){e=a.root.firstChild;b=null}a.selectPath(e.getPath());var f=Ext.getCmp(e.attributes.target);var c=f.find("path",b)[0]||0;f.activate(c)},hashChange:function(c){var a=Ext.getCmp("navpanel");var b="#"+a.getActivePath();if(b!=window.location.hash){this.setLocation(window.location.hash)}},checkVersion:function(a){if(a.version!=Monitor.release){window.location.reload(true)}},run:function(){Ext.state.Manager.setProvider(new Ext.state.CookieProvider({expires:new Date(new Date().getTime()+(1000*60*60*24*7)),path:Monitor.baseurl}));Ext.QuickTips.init();this.createLayout();this.startup();this.createTasks()}});
