(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){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){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)};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]=[]);Ext.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&&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}}this.CSS=this.CSS?this.CSS.destroy():null;this._hooked=this._domReady=this._domFired=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()){EV.doAdd(w,"focus",this._frameProxy);EV.doAdd(w,"blur",this._frameProxy);EV.doAdd(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){if(!this.frameInit||(!this._frameAction&&!this.eventsFollowFrameLinks)){return}target||(target={});var rstatus=(e&&typeof e.type!=="undefined"?e.type:this.dom.readyState);switch(rstatus){case"domready":if(this._domReady){return}this._domReady=true;if(this._frameAction&&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={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)}},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){return this}if(url.url){callback=url.callback||false;discardUrl=url.discardUrl||false;url=url.url||false;scope=url.scope||null}if(this.rendered&&this.iframe){var u=url||this.iframe.resetUrl;this.iframe.setSrc(u,discardUrl,callback,scope)}return this},setLocation:function(url,discardUrl,callback,scope){url=url||this.defaultSrc||false;if(!url){return this}if(url.url){callback=url.callback||false;discardUrl=url.discardUrl||false;url=url.url||false;scope=url.scope||null}if(this.rendered&&this.iframe){var u=url||this.iframe.resetUrl;this.iframe.setLocation(u,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")}(function(){function b(c){return true}function a(c){return function(e){return c.test(e)}}Ext.applyIf(Ext.form.VTypes,{"int":a(/^\-?\d*$/i),intMask:/[0-9\-]/,intText:"This field should only contain numbers","float":a(/^\-?(\d+(\.\d+)?)?$/i),floatMask:/[0-9\.\-]/,floatText:"This field should only contain numbers",string:b,text:b,v12cmsurl:a(/^\/.+\.aspx$/i),v12cmsurlMask:/[a-z0-9_\-\/\.]/i,v12cmsurlText:'This field should start with "/" and end with ".aspx"',phone:function(c){c=new String(c);if(c.length<10){return false}if(c.length>10&&c.indexOf("+")===0){return/^\+\d{1,3}(-|\S)?\d+\-?\d+$/.test(c)}if(c.length==11){return/^\d{1,9}\-\d{1,9}$/.test(c)}return/^\d{10}$/.test(c)}})})();Ext.ns("V12.Layout");(function(a){var b=V12.Layout,e=a.layout,c;b.FillContainerLayout=c=a.extend(e.ContainerLayout,{monitorResize:true,onLayout:function(j,l){c.superclass.onLayout.apply(this,arguments);var h=j.getHeight(),k=0,g;j.items.each(function(m){if(m.fillContainer===true){g=m}else{k+=m.getHeight()}});if(g!=undefined&&h>k){var f=h-k;g.setHeight(Math.max(f,g.minHeight))}}});a.Container.LAYOUTS.fillcontainer=c})(Ext);Ext.ns("V12.Layout");(function(a){var c=V12.Layout,e=a.layout,b;c.FillFormLayout=b=a.extend(e.FormLayout,{monitorResize:true,onLayout:function(j,l){b.superclass.onLayout.apply(this,arguments);var k=0,g=undefined,h=l.getViewSize(true).height;j.items.each(function(m){if(m.fillContainer===true){g=m}else{k+=m.getOuterSize().height}});if(g!=undefined&&h>k){var f=h-k;g.setHeight(Math.max(f,g.minHeight))}}});a.Container.LAYOUTS.fillform=b})(Ext);Ext.namespace("V12.Cms.Tree");V12.Cms.Tree.Tree=Ext.extend(Ext.tree.TreePanel,{displayColumn:0,handler:"../CmsModules/Documents/MenuTreeHandler.ashx",processAttribs:null,contextMenu:null,filter:null,margins:"2 2 0 2",autoScroll:true,rootVisible:false,enableDD:true,border:false,initComponent:function(){var a=this;a.root=new Ext.tree.AsyncTreeNode();if(!a.processAttribs){a.processAttribs=function(b,c){b.text=c.get(a.displayColumn)}}this.loader=new V12.Cms.Data.TreeLoader({handler:a.handler,processAttribs:a.processAttribs,filter:a.filter});this.on("contextmenu",function(b,c){b.select();var f=a.contextMenu;if(f){f.contextNode=b;f.showAt(c.getXY())}});V12.Cms.Tree.Tree.superclass.initComponent.call(a)}});Ext.preg("V12Tree",V12.Cms.Tree.Tree);Ext.namespace("V12.Cms.Util");V12.Cms.Util.Poster=Ext.extend(Object,{params:{},action:null,enctype:"multipart/form-data",constructor:function(a){Ext.apply(this,a)},post:function(e){var c=this;if(Ext.get("postForm")){Ext.get("postForm").remove()}Ext.DomHelper.append(Ext.getBody(),{tag:"form",method:"post",id:"postForm"});var a=Ext.get("postForm");a.set({enctype:c.enctype,action:c.action});for(var b in e){V12.log(b+","+e[b]);Ext.DomHelper.append(a,{tag:"input",type:"hidden",id:b,name:b});Ext.get(b).set({value:e[b]})}a.dom.submit()}});Ext.ns("V12.Cms.Util");V12.msg=function(b,a){V12.Log.rootLogger.info(b+": "+a);Ext.Msg.show({title:b,msg:a,minWidth:200,modal:true,icon:Ext.Msg.INFO,buttons:Ext.Msg.OK})};V12.error=function(b,a){V12.Log.rootLogger.error(b+": "+a);Ext.Msg.show({title:b,msg:message,minWidth:200,modal:true,icon:Ext.Msg.ERROR,buttons:Ext.Msg.OK})};V12.confirm=function(f,e,c,b){V12.Log.rootLogger.info(f+": "+e);var a=function(g){if(g==="yes"){V12.Log.rootLogger.info(f+": "+g);if(typeof c!=="undefined"){c()}}else{V12.Log.rootLogger.info(f+": "+g);if(typeof b!=="undefined"){b()}}};Ext.Msg.show({title:f,msg:e,minWidth:200,modal:true,icon:Ext.Msg.QUESTION,buttons:Ext.Msg.YESNO,fn:a})};V12.confirmPanelSwitch=function(b,a){V12.confirm("Bevestigen","Are you sure you wish to continue?",b,a)};if(typeof Nxt=="undefined"){Nxt={}}(function(P){var B="group",A="[%s] [%s] %s %s",G="] [",H="groupEnd",D="[",F="undefined",z="none",T,M,L=true,S=false,R=function(){},E=new R(),N=new Date().getTime(),Q=1000,U=60*Q,I=60*U,W=[z,"error","warn","log","info","debug","trace","dir","dirxml","stackTrace",B,H];T={NONE:0,ERROR:2,WARN:4,LOG:8,INFO:16,DEBUG:32,TRACE:64,DIR:128,DIRXML:256,STACKTRACE:512};T.ALL=T.ERROR|T.WARN|T.LOG|T.INFO|T.DEBUG|T.TRACE|T.DIR|T.DIRXML|T.STACKTRACE;M=P.Log=function(b,a){if(!(b instanceof R)){throw new Error("You should not create an instance directly. Use Nxt.Log.getLogger(..) instead")}this.name=a};M.prototype={level:-1,getTime:function(){var a=new Date().getTime();return a-N},_checkLevel:function(a){if(this.level>-1){return(this.level&a)==a}else{return(M.level&a)==a}},setLevel:function(a){this.level=a},getChild:function(a){var b=new M(E,this.name+"."+a);b.setLevel(this.level);return b},none:function(a){}};for(var K in W){var O=new String(W[K]),J=O.toUpperCase();if(O==z){continue}if(typeof(T[J])!==F){(function(a,b,c){M.prototype[c]=function(e){if(this._checkLevel(a)){M.appender[c].call(M.appender,b,this.getTime(),this.name,e)}}})(T[J],J,O)}else{if(O==B||O==H){(function(a){M.prototype[a]=function(b){M.appender[a].call(M.appender,this.getTime(),this.name,b)}})(O)}}}M.getLogger=function(a){if(!a){throw new Error("You should specify a name")}return new M(E,a)};M.Level=T;M.level=T.ALL;M.enableQueue=S;M.setLevel=function(a){M.level=a};M.formatTime=function(a){if(!a){return a}if(a<Q){return"0."+a+" s"}var b,e,c,f="";b=Math.floor(a/I);a-=(b*I);e=Math.floor(a/U);a-=(e*U);c=Math.floor(a/Q);a-=(c*Q);if(b>0){f+=b+"h"}if(e>0||b>0){f+=e+"m"}if(c>0||e>0||b>0){f+=c+"s"}f+=a+"ms";return f};M.NullAppender=function(){};M.NullAppender.prototype={};for(var X in W){M.NullAppender.prototype[X]=function(){}}M.ConsoleAppender=function(){if(L){this._queue=new Array()}};M.ConsoleAppender.prototype={_queue:null,_queueSize:function(){return this._queue==null?0:this._queue.length},_available:function(){return(typeof(console)!==F&&console.log)},group:function(a,b,c){if(console.group){console.group(D+M.formatTime(a)+G+b+"] "+c)}},groupEnd:function(){if(console.groupEnd){console.groupEnd()}},error:function(c,e,a,b){if(console.error){console.error(A,M.formatTime(e),a,c,b)}else{console.log(A,M.formatTime(e),a,c,b)}},warn:function(c,e,a,b){if(console.warn){console.warn(A,M.formatTime(e),a,c,b)}else{console.log(A,M.formatTime(e),a,c,b)}},log:function(c,e,a,b){console.log(A,M.formatTime(e),a,c,b)},info:function(c,e,a,b){if(console.info){console.info(A,M.formatTime(e),a,c,b)}else{console.log(A,M.formatTime(e),a,c,b)}},debug:function(c,e,a,b){if(console.debug){console.debug(A,M.formatTime(e),a,c,b)}else{console.log(A,M.formatTime(e),a,c,b)}},trace:function(c,e,a,b){console.log(A,M.formatTime(e),a,c,b)},stackTrace:function(c,e,a,b){console.log(A,M.formatTime(e),a,c,b);if(console.trace){console.trace()}},dir:function(c,b,a,e){if(!console.dir){return}if(console.group){console.group(D+M.formatTime(b)+G+a+"]")}console.dir(e);if(console.groupEnd){console.groupEnd()}},dirxml:function(c,b,a,e){if(!console.dirxml){return}if(console.group){console.group(D+M.formatTime(b)+G+a+"] dirxml")}console.dirxml(e);if(console.groupEnd){console.groupEnd()}}};if(L){M.ConsoleAppender.prototype._processQueue=function(){var a=this._queue;this._queue=new Array();for(var b=0;b<a.length;b++){var c=a[b];c.fn.apply(c.scope,c.args)}};for(var X in M.ConsoleAppender.prototype){var V=new String(X);if(V.indexOf("_")===0){continue}var C=M.ConsoleAppender.prototype[X];(function(b,a){M.ConsoleAppender.prototype[b]=function(){if(!this._available()){if(M.enableQueue){this._queue[this._queue.length]={fn:a,args:arguments,scope:this}}return}if(this._queue.length>0){this._processQueue()}a.apply(this,arguments)}})(X,C)}}M.appender=new M.ConsoleAppender()})(Nxt);
/*
* Ext JS Library 3.0+
* Copyright(c) 2006-2009 Ext JS, LLC
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.ns("Ext.ux.grid");Ext.ux.grid.RowExpander=Ext.extend(Ext.util.Observable,{expandOnEnter:true,expandOnDblClick:false,header:"",width:20,sortable:false,fixed:true,menuDisabled:true,dataIndex:"",id:"expander",lazyRender:true,enableCaching:true,defaultExpanded:true,constructor:function(a){Ext.apply(this,a);this.addEvents({beforeexpand:true,expand:true,beforecollapse:true,collapse:true});Ext.ux.grid.RowExpander.superclass.constructor.call(this);if(this.tpl){if(typeof this.tpl=="string"){this.tpl=new Ext.Template(this.tpl)}this.tpl.compile()}this.state={};this.bodyContent={}},getRowClass:function(a,f,e,c){e.cols=e.cols-1;var b=this.bodyContent[a.id];if(!b&&!this.lazyRender){b=this.getBodyContent(a,f)}if(b){e.body=b}return this.state[a.id]?"x-grid3-row-expanded":"x-grid3-row-collapsed"},init:function(b){this.grid=b;var a=b.getView();a.getRowClass=this.getRowClass.createDelegate(this);a.enableRowBody=true;b.on("render",this.onRender,this);b.on("destroy",this.onDestroy,this)},onRender:function(){var a=this.grid;var c=this;var b=a.getView().mainBody;b.on("mousedown",this.onMouseDown,this,{delegate:".x-grid3-row-expander"});if(this.expandOnEnter){this.keyNav=new Ext.KeyNav(this.grid.getGridEl(),{enter:this.onEnter,scope:this})}if(this.expandOnDblClick){a.on("rowdblclick",this.onRowDblClick,this)}if(this.defaultExpanded){a.store.on("load",function(){for(var e=0;e<a.store.getCount();e++){V12.log("row"+e);c.expandRow(e)}})}},onDestroy:function(){if(this.keyNav){this.keyNav.disable();delete this.keyNav}var a=this.grid.getView().mainBody;if(a){a.un("mousedown",this.onMouseDown,this)}},onRowDblClick:function(a,b,c){this.toggleRow(b)},onEnter:function(j){var h=this.grid;var k=h.getSelectionModel();var b=k.getSelections();for(var c=0,a=b.length;c<a;c++){var f=h.getStore().indexOf(b[c]);this.toggleRow(f)}},getBodyContent:function(a,b){if(this.prepareData){this.prepareData(a,b)}if(!this.enableCaching){return this.tpl.apply(a.data)}var c=this.bodyContent[a.id];if(!c){c=this.tpl.apply(a.data);this.bodyContent[a.id]=c}return c},onMouseDown:function(b,a){b.stopEvent();var c=b.getTarget(".x-grid3-row");this.toggleRow(c)},renderer:function(b,c,a){c.cellAttr='rowspan="2"';return'<div class="x-grid3-row-expander">&#160;</div>'},beforeExpand:function(b,a,c){if(this.fireEvent("beforeexpand",this,b,a,c)!==false){if(this.tpl&&this.lazyRender){a.innerHTML=this.getBodyContent(b,c)}return true}else{return false}},toggleRow:function(a){if(typeof a=="number"){a=this.grid.view.getRow(a)}this[Ext.fly(a).hasClass("x-grid3-row-collapsed")?"expandRow":"collapseRow"](a)},expandRow:function(c){if(typeof c=="number"){c=this.grid.view.getRow(c);if(!c){return}}var b=this.grid.store.getAt(c.rowIndex);var a=Ext.DomQuery.selectNode("tr:nth(2) div.x-grid3-row-body",c);if(this.beforeExpand(b,a,c.rowIndex)){this.state[b.id]=true;Ext.fly(c).replaceClass("x-grid3-row-collapsed","x-grid3-row-expanded");this.fireEvent("expand",this,b,a,c.rowIndex)}},collapseRow:function(c){if(typeof c=="number"){c=this.grid.view.getRow(c)}var b=this.grid.store.getAt(c.rowIndex);var a=Ext.fly(c).child("tr:nth(1) div.x-grid3-row-body",true);if(this.fireEvent("beforecollapse",this,b,a,c.rowIndex)!==false){this.state[b.id]=false;Ext.fly(c).replaceClass("x-grid3-row-expanded","x-grid3-row-collapsed");this.fireEvent("collapse",this,b,a,c.rowIndex)}}});Ext.preg("rowexpander",Ext.ux.grid.RowExpander);Ext.grid.RowExpander=Ext.ux.grid.RowExpander;Ext.ns("Ext.ux.grid");Ext.ux.grid.Search=function(a){Ext.apply(this,a);Ext.ux.grid.Search.superclass.constructor.call(this)};Ext.extend(Ext.ux.grid.Search,Ext.util.Observable,{searchText:"Search",searchTipText:"Type a text to search and press Enter",selectAllText:"Select All",position:"bottom",iconCls:"icon-magnifier",checkIndexes:"all",disableIndexes:[],showSelectAll:false,menuStyle:"checkbox",minCharsTipText:"Type at least {0} characters",mode:"remote",width:100,xtype:"gridsearch",paramNames:{fields:"fields",query:"query"},shortcutKey:"r",shortcutModifier:"alt",init:function(a){this.grid=a;if("string"===typeof this.toolbarContainer){this.toolbarContainer=Ext.getCmp(this.toolbarContainer)}a.onRender=a.onRender.createSequence(this.onRender,this);a.reconfigure=a.reconfigure.createSequence(this.reconfigure,this)},onRender:function(){var b=this.toolbarContainer||this.grid;var a="bottom"===this.position?b.bottomToolbar:b.topToolbar;this.menu=new Ext.menu.Menu();if("right"===this.align){a.addFill()}else{if(0<a.items.getCount()){a.addSeparator()}}a.add({text:this.searchText,menu:this.menu,iconCls:this.iconCls});this.field=new Ext.form.TwinTriggerField({width:this.width,selectOnFocus:undefined===this.selectOnFocus?true:this.selectOnFocus,trigger1Class:"x-form-clear-trigger",trigger2Class:this.minChars?"x-hide-display":"x-form-search-trigger",onTrigger1Click:this.onTriggerClear.createDelegate(this),onTrigger2Click:this.minChars?Ext.emptyFn:this.onTriggerSearch.createDelegate(this),minLength:this.minLength});this.field.on("render",function(){if(undefined===this.minChars||1<this.minChars){}if(this.minChars){this.field.el.on({scope:this,buffer:300,keyup:this.onKeyUp})}var f=new Ext.KeyMap(this.field.el,[{key:Ext.EventObject.ENTER,scope:this,fn:this.onTriggerSearch},{key:Ext.EventObject.ESC,scope:this,fn:this.onTriggerClear}]);f.stopEvent=true},this,{single:true});a.add(this.field);this.reconfigure();if(this.shortcutKey&&this.shortcutModifier){var e=this.grid.getEl();var c=[{key:this.shortcutKey,scope:this,stopEvent:true,fn:function(){this.field.focus()}}];c[0][this.shortcutModifier]=true;this.keymap=new Ext.KeyMap(e,c)}if(true===this.autoFocus){this.grid.store.on({scope:this,load:function(){this.field.focus()}})}},onKeyUp:function(){var a=this.field.getValue().toString().length;if(0===a||this.minChars<=a){this.onTriggerSearch()}},onTriggerClear:function(){if(this.field.getValue()){this.field.setValue("");this.field.focus();this.onTriggerSearch()}},onTriggerSearch:function(){if(!this.field.isValid()){return}var c=this.field.getValue();var b=this.grid.store;if("local"===this.mode){b.clearFilter();if(c){b.filterBy(function(f){var e=false;this.menu.items.each(function(h){if(!h.checked||e){return}var j=f.get(h.dataIndex);j=j instanceof Date?j.format(this.dateFormat||f.fields.get(h.dataIndex).dateFormat):j;var g=new RegExp(RegExp.escape(c),"gi");e=g.test(j)},this);if(e){return true}return e},this)}else{}}else{if(b.lastOptions&&b.lastOptions.params){b.lastOptions.params[b.paramNames.start]=0}var a=[];this.menu.items.each(function(e){if(e.checked){a.push(e.dataIndex)}});if(a.length==0){return}delete (b.baseParams[this.paramNames.fields]);delete (b.baseParams[this.paramNames.query]);if(b.lastOptions&&b.lastOptions.params){delete (b.lastOptions.params[this.paramNames.fields]);delete (b.lastOptions.params[this.paramNames.query])}if(a.length){b.baseParams[this.paramNames.fields]=Ext.encode(a);b.baseParams[this.paramNames.query]=c}b.reload()}},setDisabled:function(){this.field.setDisabled.apply(this.field,arguments)},enable:function(){this.setDisabled(false)},disable:function(){this.setDisabled(true)},reconfigure:function(){var c=this.menu;if(!c){this.menu=new Ext.menu.Menu();c=this.menu}c.removeAll();if(this.showSelectAll&&"radio"!==this.menuStyle){c.add(new Ext.menu.CheckItem({text:this.selectAllText,checked:!(this.checkIndexes instanceof Array),hideOnClick:false,handler:function(f){var e=!f.checked;f.parentMenu.items.each(function(g){if(f!==g&&g.setChecked&&!g.disabled){g.setChecked(e)}})}}),"-")}var a=this.grid.colModel;var b=undefined;if("radio"===this.menuStyle){b="g"+(new Date).getTime()}Ext.each(a.config,function(f){var e=false;if(f.header&&f.dataIndex&&f.searchable){Ext.each(this.disableIndexes,function(g){e=e?e:g===f.dataIndex});if(!e){c.add(new Ext.menu.CheckItem({text:f.header,hideOnClick:("radio"===this.menuStyle),group:b,checked:("all"===this.checkIndexes),dataIndex:f.dataIndex}))}}},this);if(this.checkIndexes instanceof Array){Ext.each(this.checkIndexes,function(f){var e=c.items.find(function(g){return g.dataIndex===f});if(e){e.setChecked(true,true)}},this)}if(this.readonlyIndexes instanceof Array){Ext.each(this.readonlyIndexes,function(f){var e=c.items.find(function(g){return g.dataIndex===f});if(e){e.disable()}},this)}}});
/*
 * Ext JS Library 3.0.0
 * Copyright(c) 2006-2009 Ext JS, LLC
 * licensing@extjs.com
 * http://www.extjs.com/license
 */
Ext.ns("Ext.ux.grid");Ext.ux.grid.GridColumn=function(a){Ext.apply(this,a);if(!this.id){this.id=Ext.id()}this.renderer=this.renderer.createDelegate(this)};Ext.ux.grid.GridColumn.prototype={init:function(b){this.grid=b;var a=this.grid.getView();a.mainBody.on("mousedown",this.onMouseDown,this)},selectedName:null,onMouseDown:function(f,c){if(this.editable){if(c.className&&c.className.indexOf("x-grid3-cc-"+this.id)!=-1){f.stopEvent();var b=this.grid.getView().findRowIndex(c);var a=this.grid.store.getAt(b);this.showDialog(a)}}},renderer:function(b,c,a){var e=(b)?b:"";name=a.get(this.nameField);if(name){return'<div class="x-grid3-cc-'+this.id+'">'+name+"</div>"}else{return'<div class="x-grid3-cc-'+this.id+'">click to select..</div>'}},showDialog:function(b){this.dialog=new Ext.Window({modal:true,items:[],title:"Please make a selection",width:500,height:500,layout:"fit"});var e=this;var a=new Ext.grid.RowSelectionModel();var c=new V12.Cms.Grid.RichGrid({iconCls:"silk-grid",autoSizeColumns:true,layout:"fit",handler:this.crudHandler,title:"List",sm:a,editable:false,editable:false,clicksToEdit:2,listeners:{rowdblclick:function(g){var f=a.getSelected();b.set(e.dataIndex,f.get(e.refKeyField));e.dialog.hide()}}});this.dialog.items.add(c);this.dialog.show();var e=this;setTimeout(function(){e.dialog.focus()},500)}};
/*
 * Ext JS Library 3.0.0
 * Copyright(c) 2006-2009 Ext JS, LLC
 * licensing@extjs.com
 * http://www.extjs.com/license
 */
Ext.ns("Ext.ux.grid");Ext.ux.grid.CheckColumn=function(a){Ext.apply(this,a);if(!this.id){this.id=Ext.id()}this.renderer=this.renderer.createDelegate(this)};Ext.ux.grid.CheckColumn.prototype={init:function(a){this.grid=a;a.on("mousedown",this.onMouseDown,this)},onMouseDown:function(f,c){if(c&&this.editable){if(c.className&&c.className.indexOf("x-grid3-cc-"+this.id)!=-1){f.stopEvent();var b=this.grid.getView().findRowIndex(c);var a=this.grid.store.getAt(b);a.set(this.dataIndex,!a.data[this.dataIndex])}}},renderer:function(b,c,a){c.css+=" x-grid3-check-col-td";return'<div class="x-grid3-check-col'+(b?"-on":"")+" x-grid3-cc-"+this.id+'">&#160;</div>'}};Ext.preg("checkcolumn",Ext.ux.grid.CheckColumn);Ext.grid.CheckColumn=Ext.ux.grid.CheckColumn;Ext.namespace("V12.Cms.Globalisation");V12.Cms.Globalisation.nativeLanguage="en";V12.Cms.Globalisation.init=function(b,c){V12.Cms.Globalisation.languageCode=b;V12.Cms.Globalisation.callback=c;var a=new Ext.data.Connection();a.request({url:"modules/Translate/Dictionary/CmsHandlerData.ashx?action=loadDictionairy&languageCode="+b,method:"GET",failure:function(){V12.error("Status","Dictionary could not be loaded")},success:V12.Cms.Globalisation.loaded,scope:V12.Cms.Globalisation})};V12.Cms.Globalisation.loaded=function(a){V12.Cms.Globalisation.dictionary=Ext.decode(a.responseText);if(V12.Cms.Globalisation.callback){V12.Cms.Globalisation.callback()}};V12.Cms.Globalisation.translate=function(a){if(!V12.Cms.Globalisation.dictionary){return a}var b=V12.Cms.Globalisation.dictionary[a];if(b){return b}else{V12.Cms.Globalisation.dictionary[a]=a;b=a;google.language.translate(a,V12.Cms.Globalisation.nativeLanguage,V12.Cms.Globalisation.languageCode,function(c){V12.Cms.Globalisation.googleResponse(a,c,V12.Cms.Globalisation.dictionary)})}return b};V12.Cms.Globalisation.googleResponse=function(b,a,c){if(!a.error){c[b]=a.translation;V12.Cms.Globalisation.addToDictionaty(b)}};V12.Cms.Globalisation.addToDictionaty=function(a){var b=new Ext.data.Connection();b.request({url:"modules/Translate/Dictionary/CmsHandlerData.ashx",method:"POST",failure:function(){V12.error("Status","The translation of "+a+" could not be saved")},params:{action:"save",key:a,translation:V12.Cms.Globalisation.dictionary[a],languageCode:V12.Cms.Globalisation.languageCode},scope:V12.Cms.Globalisation})};V12.tr=V12.Cms.Globalisation.translate;Ext.namespace("V12.Cms.Data");V12.Cms.Data.Store=Ext.extend(Ext.data.Store,{autoSave:true,autoLoad:true,remoteSort:true,loaded:false,preferenceName:null,layoutLoaded:function(a){a.reader=new Ext.data.JsonReader({root:"rows",totalProperty:"totalCount",idProperty:"id",successProperty:"success"},a.metaData.fields);V12.Cms.Data.Store.superclass.constructor.call(a,a.params);a.fireEvent("metaChange",a,a.metaData);a.pkChanged=false},listeners:{load:function(b,a,c){b.loaded=true},beforeload:function(a,b){a.loaded=false;if(a.filter){Ext.apply(b.params,{filter:Ext.encode(a.filter)})}else{if(b.params.filter){b.params.filter=undefined}}this.lastOptions=b},beforewrite:function(e,f,b,c,a){if(this.filter){Ext.apply(c.params,{filter:Ext.encode(this.filter)})}else{if(c.params.filter){c.params.filter=undefined}}},exception:function(e,f,g,c,b,a){this.metaData=Ext.decode(b.responseText);this.fireEvent("CRUDexception",this,this.metaData,b.message);if(f==="remote"){Ext.Msg.show({title:"REMOTE EXCEPTION",msg:b.message,icon:Ext.MessageBox.ERROR,buttons:Ext.Msg.OK})}}},constructor:function(f){var c=this;var h=c.autoLoad;c.autoLoad=false;V12.Cms.Data.Store.superclass.constructor.call(c,f);c.autoLoad=h;var b=new Ext.data.Connection();var e=this.layoutLoaded;c.writer=new Ext.data.JsonWriter({encode:true,writeAllFields:false,listful:true});c.proxy=new Ext.data.HttpProxy({api:{read:c.handler+"?crudOp=read",create:c.handler+"?crudOp=create",update:c.handler+"?crudOp=update",destroy:c.handler+"?crudOp=destroy"}});var g="GET";var f=null;if(c.filter){g="POST";f={filter:Ext.encode(c.filter)}}var a=c.handler+"?crudop=layout";if(this.preferenceName){a+="&preferenceName="+this.preferenceName}b.request({url:a,method:g,params:f,failure:function(){V12.error("Status","Data-store definition could not be loaded.")},success:function(j){c.metaData=Ext.decode(j.responseText);if(c.metaData.success===false){c.fireEvent("CRUDexception",c,c.metaData,j.message)}else{e(c)}}})}});Ext.namespace("V12.Cms.Util");V12.Cms.Util.V12TinyMceHelper=Ext.extend(Object,{bookmark:false,editor:null,constructor:function(a){this.editor=a;if(!a){a=tinyMCE.activeEditor}this.bookmark=false},storeSelection:function(){this.bookmark=this.editor.selection.getBookmark()},restoreSelection:function(){this.editor.getWin().focus();if(this.bookmark){this.editor.selection.moveToBookmark(this.bookmark)}}});V12.Cms.Util.TinymceImageList=Ext.extend(Object,{handler:null,window:null,editor:null,constructor:function(a){if(a){Ext.apply(this,a)}},showList:function(){var a=this;if(!this.editor){this.editor=tinyMCE.activeEditor}this.helper=new V12.Cms.Util.V12TinyMceHelper(this.editor);try{this.helper.storeSelection()}catch(b){}this.contentPanel=new Ext.Panel({});this.contentPanel.load({url:this.handler,scope:a,callback:function(){var c=a.contentPanel.getEl();Ext.select("img",c).on("click",function(){a.insertImage(this.src)})}});this.window=new Ext.Window({title:"Image selector",minimizable:false,modal:true,items:[this.contentPanel]});this.window.show()},insertImage:function(){tinyMCE.activeEditor.selection.setContent(tinyMCE.activeEditor.dom.createHTML("img",{src:"test.jpg"}));this.close()},close:function(){if(this.window!=null){this.window.close();this.helper=null;this.window=null}}});V12.Cms.Util.TinymceImageList.register=function(a){V12.Cms.Ui.Editor.TinyMce.registerSetupFunction(function(b){Ext.apply(a,{editor:b});b.addButton("v12_images",{title:a.title||"Afbeeldingen selecteren en invoegen",image:a.image||"http://static.v12.nl/cms/ext/ext-3.0.0/resources/Silk/fam/image_add.png",onclick:function(c){if(!c){c=window.event}var f=new V12.Cms.Util.TinymceImageList(a);f.showList()}})})};Ext.namespace("V12.Cms.Grid");V12.Cms.Grid.DefaultCmBuilder=Ext.extend(Object,{grid:null,renderers:{},editors:{},columns:{},cols:[],parseFields:function(){var g=this.store.metaData.fields;var c=this.grid.editable;var l;this.grid.preferenceName=this.store.metaData.preferenceName;if(this.store.metaData.preferences){l=Ext.decode(this.store.metaData.preferences);if(l.sortInfo){this.store.sortInfo=l.sortInfo}}this.cols=[];for(var h in this.columns){var k=false;for(e=0;e<g.length;e++){var j=g[e];if(j.name==h){k=true}}if(!k){this.addColumn(this.columns[h])}}for(var e=0;e<g.length;e++){var j=g[e];if(j.name!="id"&&j.enabled==true){this.parseField(j,c)}}if(l&&l.columns){if(this.cols.length==l.columns.length){var a=new Array(l.columns.length);for(var b=0;b<l.columns.length;b++){var f=l.columns[b].index;if(isNaN(f)){return}Ext.apply(this.cols[f],{width:l.columns[b].width,hidden:!l.columns[b].visible});a[b]=this.cols[f]}this.cols=a}}},parseField:function(c,a){if(this.columns[c.name]){var b=this.columns[c.name];b.dataIndex=c.name;b.editable=a;this.addColumn(b)}else{if(c.type=="bool"){var e=new Ext.ux.grid.CheckColumn(c);e.editable=a;this.addColumn(e)}else{if(c.type=="date"){c.renderer=Ext.util.Format.dateRenderer("d-m-Y");if(a){c.editor=new Ext.form.DateField({format:"d-m-Y"})}this.addColumn(c)}else{if(a){if(c.editorType){c.editor=Ext.ComponentMgr.create({xtype:c.editorType})}else{c.editor=new Ext.form.TextField()}}this.addColumn(c)}}}if(this.renderers[c.name]){c.renderer=this.renderers[c.name]}if(a&&this.editors[c.name]){c.editor=this.editors[c.name]}},getColumnModel:function(){this.parseFields();this.cm=new Ext.grid.ColumnModel(this.cols);return this.cm},constructor:function(a){Ext.apply(this,a);if(!this.store&&this.grid&&this.grid.store){this.store=this.grid.store}},addColumn:function(a){a.orginalIndex=this.cols.length;this.cols[this.cols.length]=a;if(a.init){this.grid.addPlugin(a,true)}}});Ext.namespace("V12.Cms.Grid");V12.Cms.Grid.RowReorder=function(b,a){this.target=new Ext.dd.DropTarget(b.getEl(),{ddGroup:b.ddGroup||"GridDD",grid:b,gridDropTarget:this,notifyDrop:function(n,l,h){var o=Ext.lib.Event.getTarget(l);var j=this.grid.getView().findRowIndex(o);if(j===false){return false}if(j==h.rowIndex){return false}var c=this.grid.getStore();if(this.gridDropTarget.fireEvent(this.copy?"beforerowcopy":"beforerowmove",this.gridDropTarget,h.rowIndex,j,h.selections)===false){return false}var g=c.indexOf(h.selections[0]);g=Math.min(g,j);var k=c.getAt(g).get(a.orderField);c.autoSave=false;if(!this.copy){for(i=0;i<h.selections.length;i++){c.remove(c.getById(h.selections[i].id))}}c.insert(j,h.selections);c.removed=[];c.rejectChanges();var m=c.getRange(g,c.getTotalCount()-1);for(ind=0;ind<m.length;ind++){m[ind].set(a.orderField,k);k++}c.save();c.autoSave=true;var f=this.grid.getSelectionModel();if(f){f.selectRecords(h.selections)}this.gridDropTarget.fireEvent(this.copy?"afterrowcopy":"afterrowmove",this.gridDropTarget,h.rowIndex,j,h.selections);return true},notifyOver:function(c,j,h){var g=Ext.lib.Event.getTarget(j);var f=this.grid.getView().findRowIndex(g);if(f==h.rowIndex){f=false}return(f===false)?this.dropNotAllowed:this.dropAllowed}});if(a){Ext.apply(this.target,a);if(a.listeners){Ext.apply(this,{listeners:a.listeners})}}this.addEvents({beforerowmove:true,afterrowmove:true,beforerowcopy:true,afterrowcopy:true});V12.Cms.Grid.RowReorder.superclass.constructor.call(this)};Ext.extend(V12.Cms.Grid.RowReorder,Ext.util.Observable,{getTarget:function(){return this.target},getGrid:function(){return this.target.grid},getCopy:function(){return this.target.copy?true:false},setCopy:function(a){this.target.copy=a?true:false}});V12.Cms.Grid.GridSelector=Ext.extend(Ext.Button,{layout:"column",referNameColumn:"moduleName",dialogWidth:500,dialogHeight:500,selectedValue:null,selectedRecord:null,selectedName:null,crudFilter:null,text:"Click me",dialog:null,handler:function(){this.showDialog(this)},getValue:function(){return""},setValue:function(a){this.selectedValue=a;if(this.grid){this.selectedRecord=this.grid.store.getById(this.selectedValue);if(this.selectedRecord){this.selectedName=this.selectedRecord.get(this.referNameColumn)}}},validateValue:function(a){return true},onTriggerClick:function(){var a=this;if(this.disabled){return}this.onFocus();a.showDialog(a)},setSelected:function(a){if(a.grid.getSelectionModel().getSelected()!=null){a.setValue(a.grid.getSelectionModel().getSelected().id)}else{a.setValue(null)}a.dialog.hide();a.fireEvent("changed",a)},showDialog:function(a){a.dialog=new Ext.Window({modal:true,items:[],title:"Please make a selection",width:a.dialogWidth,height:a.dialogHeight,layout:"fit",buttons:[{xtype:"button",text:"select",handler:function(){a.setSelected(a)}}],listeners:{close:function(){a.grid.getSelectionModel().clearSelections();a.setSelected(a)}}});a.grid=new V12.Cms.Grid.RichGrid({iconCls:"silk-grid",autoSizeColumns:true,layout:"fit",handler:a.crudHandler,filter:a.crudFilter,editable:false,addButton:false,deleteButton:false,exportButton:false,listeners:a.listeners,title:"List",listeners:{rowdblclick:function(b){a.setSelected(a)}}});a.dialog.items.add(a.grid);a.dialog.show();setTimeout(function(){a.dialog.focus()},500)}});Ext.namespace("V12.Cms.Grid");V12.Cms.Grid.Grid=Ext.extend(Ext.grid.EditorGridPanel,{cmBuilder:null,filter:null,editable:false,columns:[],iconCls:"silk-table",layout:"fit",clicksToEdit:2,link:function(c,a){var b=this;b.linkMapping=a;b.store.autoLoad=false;c.on("change",function(j,k,h,e){if(!b.store.filter){b.store.filter={}}if(!a){Ext.apply(b.store.filter,k);b.store.reload()}else{for(var g in a){if(a.hasOwnProperty(g)){var l=a[g];var f=e.get(g);b.store.filter[l]=f}}b.store.reload()}})},initComponent:function(){var a=this;this.viewConfig={forceFit:true};if(this.columns==null&&this.cm==null){this.columns=[{id:"",dataIndex:"",width:100}]}if(this.mapping==null){this.mapping=[{name:"",mapping:"",type:"string"}];this.requestMapping=true}if(!this.store){this.store=new V12.Cms.Data.Store({handler:this.handler,filter:this.filter,preferenceName:this.preferenceName});this.store.on("metaChange",this.onMetaChange,this);this.columns=[];if(!this.cmBuilder){this.cmBuilder=new V12.Cms.Grid.DefaultCmBuilder({grid:this,store:this.store})}else{this.cmBuilder.store=this.store;this.cmBuilder.grid=this}}if(this.buildBotToolbar){this.buildBotToolbar()}if(this.buildTopToolbar){this.buildTopToolbar()}V12.Cms.Grid.Grid.superclass.initComponent.call(this);this.store.on("load",function(){if(!a.montorPrefs){a.montorPrefs=true;a.on("sortchange",a.columnresize);a.on("columnresize",a.columnresize);a.on("columnmoved",a.columnresize);a.on("hiddenchange",a.columnresize)}})},columnresize:function(){var c=this;if(c.preferenceName!=null){var g=c.getColumnModel();var b=[];for(var a=0;a<g.getColumnCount();a++){b.push({width:g.getColumnWidth(a),index:g.config[a].orginalIndex,visible:!g.isHidden(a)})}var f=Ext.encode({sortInfo:c.store.sortInfo,columns:b});var e=new Ext.data.Connection();e.request({url:"modules/Core/Preferences/CmsHandlerData.ashx",method:"Post",failure:function(){V12.error("Status","Could not save your preferences")},params:{preferenceName:c.preferenceName,preference:f}})}},onMetaChange:function(a,b){this.reconfigure(a,this.cmBuilder.getColumnModel())},addPlugin:function(a,b){if(!this.plugins){this.plugins=[]}this.plugins.push(a);if(b){a.init(this)}}});Ext.namespace("V12.Cms.Grid");V12.Cms.Grid.RichGrid=Ext.extend(V12.Cms.Grid.Grid,{editable:true,addButton:true,deleteButton:true,exportButton:true,paging:true,searching:true,indexProperty:null,initComponent:function(){var a=this;if(!a.sm){a.sm=new Ext.grid.RowSelectionModel()}if(a.indexProperty){a.enableDragDrop=true;a.ddGroup=Ext.id(),a.on("render",function(c){var b=new V12.Cms.Grid.RowReorder(c,{copy:false,orderField:a.indexProperty});Ext.dd.ScrollManager.register(c.getView().getEditorParent())});a.on("beforedestroy",function(b){Ext.dd.ScrollManager.unregister(b.getView().getEditorParent())})}a.sm.on("rowselect",function(b){var e=null;var c=null;if(a.selectedRecord){c=Ext.decode(a.selectedRecord.get("id"))}a.selectedRecord=this.getSelected();if(a.selectedRecord){e=Ext.decode(a.selectedRecord.get("id"))}a.fireEvent("change",a,e,c,a.selectedRecord)});V12.Cms.Grid.RichGrid.superclass.initComponent.call(this)},buildTopToolbar:function(){function a(c,b){if(!b.tbar){b.tbar=[]}else{b.tbar.push("-")}b.tbar.push(c)}if(this.addButton){a({text:V12.tr("Add"),iconCls:"silk-add",handler:this.onAdd,scope:this},this)}if(this.deleteButton){a({text:V12.tr("Delete"),iconCls:"silk-delete",handler:this.onDelete,scope:this},this)}if(this.exportButton){a({text:V12.tr("Export"),iconCls:"silk-table",handler:this.onExport,scope:this},this)}},buildBotToolbar:function(){this.bbar=[];var a=this;if(this.paging){this.bbar=new Ext.PagingToolbar({pageSize:25,store:a.store,displayInfo:true,beforePageText:V12.tr("Page"),afterPageText:V12.tr("of {0}"),displayMsg:V12.tr("{0} - {1} of {2}"),emptyMsg:V12.tr("No topics to display")})}if(this.searching){this.addPlugin(new Ext.ux.grid.Search({searchText:V12.tr("Search"),iconCls:"icon-zoom",minChars:2,autoFocus:false,region:"east",menuStyle:"radio"}))}},onAdd:function(b,c){var a=new this.store.recordType();if(this.store.defaultRecord!=null){a=new this.store.recordType(this.store.defaultRecord)}this.stopEditing();this.store.insert(0,a);this.startEditing(0,0)},onDelete:function(b,c){var a=this.getSelectionModel().getSelections();if(!a){return false}this.store.remove(a[0])},onExport:function(a,b){var e=new V12.Cms.Util.Poster({action:this.handler+"?crudOp=export"});var c=this.store.lastOptions.params;V12.log(Ext.encode(c));e.post(c)}});(function(){Ext.namespace("Ext.ux");var c=false;Ext.ux.TinyMCE=Ext.extend(function(e){var f={tinymceSettings:{accessibility_focus:false}};Ext.apply(f,e);this.addEvents({editorcreated:true});Ext.ux.TinyMCE.superclass.constructor.call(this,f)},Ext.form.Field,{tinymceSettings:null,allowBlank:true,invalidText:"The value in this field is invalid",invalidClass:"invalid-content-body",minLengthText:"The minimum length for this field is {0}",maxLengthText:"The maximum length for this field is {0}",blankText:"This field is required",hideMode:"offsets",defaultAutoCreate:{tag:"textarea",style:"width:1px;height:1px;",autocomplete:"off"},initComponent:function(){this.tinymceSettings=this.tinymceSettings||{};Ext.ux.TinyMCE.initTinyMCE({language:this.tinymceSettings.language})},initEvents:function(){this.originalValue=this.getValue()},onRender:function(f,e){Ext.ux.TinyMCE.superclass.onRender.call(this,f,e);var h=this.getEl();if(Ext.type(this.width)=="number"){this.tinymceSettings.width=this.width}if(Ext.type(this.height)=="number"){this.tinymceSettings.height=this.height}this.el.dom.setAttribute("tabIndex",-1);this.el.addClass("x-hidden");this.textareaEl=this.el;var k={overflow:"hidden"};if(Ext.isIE){k["margin-top"]="-1px";k["margin-bottom"]="-1px"}this.wrapEl=this.el.wrap({style:k});this.actionMode="wrapEl";var l=this.getId();this.ed=new tinymce.Editor(l,this.tinymceSettings);var g=new Ext.util.DelayedTask(this.validate,this);this.ed.onKeyPress.add(function(n,m){g.delay(250)}.createDelegate(this));this.ed.onBeforeRenderUI.add(function(n,m){n.controlManager=new a(this,n)}.createDelegate(this));this.ed.onPostRender.add(function(n,m){var p=n.settings;var q=Ext.get(Ext.DomQuery.selectNode("#"+this.ed.id+"_tbl td.mceToolbar"));if(q!=null){var o=q.select("> table.mceToolbar");Ext.DomHelper.append(q,{tag:"div",id:this.ed.id+"_xtbar",style:{overflow:"hidden"}},true).appendChild(o)}n.windowManager=new b(this.ed);Ext.get(n.getContentAreaContainer()).addClass("patch-content-body");Ext.Element.fly(p.content_editable?n.getBody():(tinymce.isGecko?n.getDoc():n.getWin())).on("focus",this.onFocus,this);Ext.Element.fly(p.content_editable?n.getBody():(tinymce.isGecko?n.getDoc():n.getWin())).on("blur",this.onBlur,this,this.inEditor&&Ext.isWindows&&Ext.isGecko?{buffer:10}:null)}.createDelegate(this));this.ed.onChange.add(function(n,m){this.fireEvent("change",n,m)}.createDelegate(this));this.ed.render();tinyMCE.add(this.ed);(function j(){if(!this.isVisible()){arguments.callee.defer(50,this);return}var m=this.getSize();this.withEd(function(){this._setEditorSize(m.width,m.height)})}).call(this);this.fireEvent("editorcreated")},getResizeEl:function(){return this.wrapEl},getName:function(){return this.rendered&&this.textareaEl.dom.name?this.textareaEl.dom.name:(this.name||"")},initValue:function(){if(!this.rendered){Ext.ux.TinyMCE.superclass.initValue.call(this)}else{if(this.value!==undefined){this.setValue(this.value)}else{var e=this.textareaEl.value;if(e){this.setValue(e)}}}},beforeDestroy:function(){if(this.ed){tinyMCE.remove(this.ed)}Ext.ux.TinyMCE.superclass.beforeDestroy.call(this)},getRawValue:function(){if(!this.rendered||!this.ed.initialized){return Ext.value(this.value,"")}var e=this.ed.getContent();if(e===this.emptyText){e=""}return e},getValue:function(){if(!this.rendered||!this.ed.initialized){return Ext.value(this.value,"")}var e=this.ed.getContent();if(e===this.emptyText||e===undefined){e=""}return e},setRawValue:function(e){this.value=e;if(this.rendered){this.withEd(function(){this.ed.undoManager.clear();this.ed.setContent(e===null||e===undefined?"":e);this.ed.startContent=this.ed.getContent({format:"raw"})})}},setValue:function(e){this.value=e;if(this.rendered){this.withEd(function(){this.ed.undoManager.clear();this.ed.setContent(e===null||e===undefined?"":e);this.ed.startContent=this.ed.getContent({format:"raw"});this.validate()})}},isDirty:function(){if(this.disabled||!this.rendered){return false}this.withEd(function(){return this.ed.isDirty()})},syncValue:function(){if(this.rendered&&this.ed.initialized){this.ed.save()}},getEd:function(){return this.ed},disable:function(){this.withEd(function(){var e=this.ed.getBody();e=Ext.get(e);if(e.hasClass("mceContentBody")){e.removeClass("mceContentBody");e.addClass("mceNonEditable")}})},enable:function(){this.withEd(function(){var e=this.ed.getBody();e=Ext.get(e);if(e.hasClass("mceNonEditable")){e.removeClass("mceNonEditable");e.addClass("mceContentBody")}})},onResize:function(f,e){if(Ext.type(f)!="number"){f=this.getWidth()}if(Ext.type(e)!="number"){e=this.getHeight()}if(f==0||e==0){return}if(this.rendered){this.withEd(function(){this._setEditorSize(f,e)})}},_setEditorSize:function(f,e){if(e<100){e=100}var g=Ext.get(this.ed.id+"_xtbar");if(g){g.setWidth(f-2)}this.ed.theme.resizeTo(f,e)},focus:function(f,e){if(e){this.focus.defer(typeof e=="number"?e:10,this,[f,false]);return}this.withEd(function(){this.ed.focus()});return this},processValue:function(e){return Ext.util.Format.stripTags(e)},validateValue:function(e){if(Ext.isFunction(this.validator)){var g=this.validator(e);if(g!==true){this.markInvalid(g);return false}}if(e.length<1||e===this.emptyText){if(this.allowBlank){this.clearInvalid();return true}else{this.markInvalid(this.blankText);return false}}if(e.length<this.minLength){this.markInvalid(String.format(this.minLengthText,this.minLength));return false}if(e.length>this.maxLength){this.markInvalid(String.format(this.maxLengthText,this.maxLength));return false}if(this.vtype){var f=Ext.form.VTypes;if(!f[this.vtype](e,this)){this.markInvalid(this.vtypeText||f[this.vtype+"Text"]);return false}}if(this.regex&&!this.regex.test(e)){this.markInvalid(this.regexText);return false}return true},withEd:function(e){if(!this.ed){this.on("editorcreated",function(){this.withEd(e)},this)}else{if(this.ed.initialized){e.call(this)}else{this.ed.onInit.add(function(){e.defer(10,this)}.createDelegate(this))}}}});Ext.apply(Ext.ux.TinyMCE,{tinymcePlugins:"safari,pagebreak,style,layer,table,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,noneditable,visualchars,nonbreaking,xhtmlxtras,template",initTinyMCE:function(f){if(!c){var e={mode:"none",plugins:Ext.ux.TinyMCE.tinymcePlugins,theme:"advanced"};Ext.apply(e,f);if(!tinymce.dom.Event.domLoaded){tinymce.dom.Event._pageInit()}tinyMCE.init(e);c=true}}});Ext.ComponentMgr.registerType("tinymce",Ext.ux.TinyMCE);var b=Ext.extend(function(e){b.superclass.constructor.call(this,e)},tinymce.WindowManager,{alert:function(f,e,g){Ext.MessageBox.alert("",f,function(){if(!Ext.isEmpty(e)){e.call(this)}},g)},confirm:function(f,e,g){Ext.MessageBox.confirm("",f,function(h){if(!Ext.isEmpty(e)){e.call(this,h=="yes")}},g)},open:function(e,g){e=e||{};g=g||{};if(!e.type){this.bookmark=this.editor.selection.getBookmark("simple")}e.width=parseInt(e.width||320);e.height=parseInt(e.height||240)+(tinymce.isIE?8:0);e.min_width=parseInt(e.min_width||150);e.min_height=parseInt(e.min_height||100);e.max_width=parseInt(e.max_width||2000);e.max_height=parseInt(e.max_height||2000);e.movable=true;e.resizable=true;g.mce_width=e.width;g.mce_height=e.height;g.mce_inline=true;this.features=e;this.params=g;var f=new Ext.Window({title:e.name,width:e.width,height:e.height,minWidth:e.min_width,minHeight:e.min_height,resizable:true,maximizable:e.maximizable,minimizable:e.minimizable,modal:true,stateful:false,constrain:true,layout:"fit",items:[{xtype:"iframepanel",border:false,defaultSrc:e.url||e.file,stateful:false}]});g.mce_window_id=f.getId();f.show(null,function(){if(e.left&&e.top){f.setPagePosition(e.left,e.top)}var h=f.getPosition();e.left=h[0];e.top=h[1];this.onOpen.dispatch(this,e,g)},this);return f},close:function(f){if(!f.tinyMCEPopup||!f.tinyMCEPopup.id){b.superclass.close.call(this,f);return}var e=Ext.getCmp(f.tinyMCEPopup.id);if(e){this.onClose.dispatch(this);e.close()}},setTitle:function(g,f){if(!g.tinyMCEPopup||!g.tinyMCEPopup.id){b.superclass.setTitle.call(this,g,f);return}var e=Ext.getCmp(g.tinyMCEPopup.id);if(e){e.setTitle(f)}},resizeBy:function(f,h,j){var e=Ext.getCmp(j);if(e){var g=e.getSize();e.setSize(g.width+f,g.height+h)}},focus:function(f){var e=Ext.getCmp(f);if(e){e.setActive(true)}}});var a=Ext.extend(function(g,e,f){this.control=g;a.superclass.constructor.call(this,e,f)},tinymce.ControlManager,{control:null,createDropMenu:function(h,f){var e=a.superclass.createDropMenu.call(this,h,f);var g=e.showMenu;e.showMenu=function(j,l,k){g.call(this,j,l,k);Ext.fly("menu_"+this.id).setStyle("z-index",200001)};return e},createColorSplitButton:function(h,f){var e=a.superclass.createColorSplitButton.call(this,h,f);var g=e.showMenu;e.showMenu=function(j,l,k){g.call(this,j,l,k);Ext.fly(this.id+"_menu").setStyle("z-index",200001)};return e}})})();Ext.namespace("V12.Cms.Form");V12.Cms.Form.BasicForm=Ext.extend(Ext.form.FormPanel,{iconCls:"silk-user",region:"center",labelAlign:"right",title:"Form -- All fields are required",width:500,defaultType:"textfield",defaults:{anchor:"100%"},record:null,initComponent:function(){this.items=this.buildForm();this.buttons=this.buildUI();this.addEvents({create:true});V12.Cms.Form.BasicForm.superclass.initComponent.call(this)},buildForm:function(){return[{fieldLabel:"DemoName",name:"demoField",allowBlank:false}]},buildUI:function(){return this.createButtons()},createButtons:function(){return[{text:"Cancel",handler:function(a,b){if(this.onCancel(a,b)!==false){this.destroy()}},scope:this},{text:"Save",iconCls:"icon-save",handler:function(a,b){if(this.formType=="create"){this.onCreate(a,b)}else{this.onUpdate(a,b)}},scope:this}]},loadRecord:function(a){this.record=a;this.getForm().loadRecord(a)},onCancel:function(a,b){return true},onUpdate:function(a,b){if(this.record==null){return}if(!this.getForm().isValid()){Ext.Msg.show({title:"Error",msg:"Invalid field values",icon:Ext.MessageBox.ERROR,buttons:Ext.Msg.OK});return false}this.getForm().updateRecord(this.record);return true},onCreate:function(a,b){if(!this.getForm().isValid()){Ext.Msg.show({title:"Error",msg:"Invalid field values",icon:Ext.MessageBox.ERROR,buttons:Ext.Msg.OK});return false}this.fireEvent("create",this,this.getForm().getValues());this.getForm().reset();return true},onReset:function(a,b){this.fireEvent("update",this,this.getForm().getValues());this.getForm().reset()}});Ext.namespace("V12.Cms.Form");V12.Cms.Form.AutoForm=Ext.extend(V12.Cms.Form.BasicForm,{metadata:null,formType:"update",buildForm:function(){var a=new Array();for(var c=0;c<this.metadata.fields.length;c++){var b=this.metadata.fields[c];if(b.formHide){continue}if(b.name=="id"){continue}var e={fieldLabel:(b.header||b.name),name:b.dataIndex,allowBlank:!b.required};if(b.vtype){e.vtype=b.vtype}if(b.formXtype){e.xtype=b.formXtype}a.push(e)}return a}});Ext.namespace("V12.Cms.Form");V12.Cms.Form.MultiForm=Ext.extend(Ext.Panel,{layout:"vbox",forms:null,constructor:function(){this.forms=[];V12.Cms.Form.MultiForm.superclass.constructor.apply(this,arguments)},add:function(e){V12.Cms.Form.MultiForm.superclass.add.apply(this,arguments);if(e instanceof Array){for(var a=0;a<e.length;a++){var b=e[a];if(b instanceof Ext.form.FormPanel){this.forms.push(b)}}}else{if(e instanceof Ext.form.FormPanel){this.forms.push(e)}}},getForm:function(){return this},callMethodOnForms:function(b,a){for(var c=0;c<this.forms.length;c++){var e=this.forms[c].getForm();e[b].apply(e,a)}},updateRecord:function(a){this.callMethodOnForms("updateRecord",arguments)},loadRecord:function(a){this.callMethodOnForms("loadRecord",arguments)},reset:function(a){this.callMethodOnForms("reset",arguments)},clearInvalid:function(a){this.callMethodOnForms("clearInvalid",arguments)},setValues:function(a){this.callMethodOnForms("setValues",arguments)},getValues:function(c){var b={};for(var a=0;a<this.forms.length;a++){var e=this.forms[a].getForm();Ext.applyIf(b,e.getValues(c))}return b}});Ext.namespace("V12.Cms.FlashUploader");V12.Cms.FlashUploader.AddFile=function(e,g,c,j,a){var f=Ext.StoreMgr.lookup(e);f.totalFileCount=g;f.totalSize=c;f.fireEvent("totalChange",0,g+" files");var b={fileName:j,fileSize:a,progress:0};var h=new f.recordType(b,j);f.insert(0,h)};V12.Cms.FlashUploader.FlashHover=function(b,c){var a=Ext.get(b);if(c){a.addClass("x-btn-over")}else{a.removeClass("x-btn-over")}};V12.Cms.FlashUploader.StoreReset=function(b,a){var c=Ext.StoreMgr.lookup(b);c.removeAll();c.state=0;c.totalFileCount=0;c.totalSize=0;c.fireEvent("totalChange",0,"please select files")};V12.Cms.FlashUploader.StoreUpdate=function(b,e,a){var c=Ext.StoreMgr.lookup(b);c.totalFileCount=e;c.totalSize=a;c.fireEvent("totalChange",0,e+" files")};V12.Cms.FlashUploader.Progress=function(b,h,e,f,g){var c=Ext.StoreMgr.lookup(b);c.percentTotal=f;c.uploadState=g;c.fireEvent("totalChange",f/100,f+"% uploaded");if(g!=2){c.fireEvent("totalChange",f/100,f+"% uploaded")}else{c.fireEvent("totalChange",1,"Ready, uploaded "+c.totalFileCount+" files.");c.fireEvent("uploadReady")}var a=c.getById(h);a.set("progress",e/100);a.commit()};V12.Cms.FlashUploader.ProgressColumn=function change(f,j,c,l,b,g){var a=Ext.id();if(!this.id){this.id=Ext.id()}var h=V12.tr("Ready for upload");if(f==1){h=V12.tr("ready")}else{if(f>0){h=(f*100)+" %"}}var e=new Ext.Template('<div class="{cls}-wrap">','<div class="{cls}-inner">','<div class="{cls}-bar" style="width: {progress}%;">','<div class="{cls}-text">',"<div>&#160;{text}</div>","</div>","</div>",'<div class="{cls}-text {cls}-text-back">',"<div>&#160;{text}</div>","</div>","</div>","</div>");var k=e.apply({cls:"x-progress",progress:Math.floor(f*100),text:h});return k};V12.Cms.FlashUploader.UploadGrid=Ext.extend(Ext.grid.EditorGridPanel,{uploadHandler:null,postdata:"example=1&example2=2",fileFilter:"All files,*.*",sm:new Ext.grid.RowSelectionModel(),columns:[{header:V12.tr("name"),dataIndex:"fileName"},{header:V12.tr("size"),dataIndex:"fileSize"},{header:V12.tr("progress"),dataIndex:"progress",renderer:V12.Cms.FlashUploader.ProgressColumn}],initComponent:function(){this.viewConfig={forceFit:true};var b=this;b.store=new Ext.data.ArrayStore({storeId:Ext.id(),autodestroy:true,fields:["fileName",{name:"fileSize",type:"float"},{name:"progress",type:"float"}]});var a=this.store;this.buildTopToolbar();this.store.on("totalChange",function(e,c){b.progressBar.updateProgress(e,c)});b.relayEvents(a,["uploadReady"]);V12.Cms.FlashUploader.UploadGrid.superclass.initComponent.call(this)},buildTopToolbar:function(){var b=this;function c(f,e){if(!e.tbar){e.tbar=[]}else{e.tbar.push("-")}e.tbar.push(f)}var a=Ext.id();c(new V12.Cms.FlashUploader.UploadButton({store:this.store,uploadHandler:this.uploadHandler,fileFilter:this.fileFilter,id:a}),this);c({text:V12.tr("Delete"),iconCls:"silk-delete",handler:function(){var f=this.getSelectionModel().getSelections();if(!f){return false}this.store.remove(f[0]);var e=V12.Cms.FlashUploader.FlashMovie("uploadSWF"+a);e.remove(f[0].get("fileName"))},id:"delButton",scope:this},this);c({text:V12.tr("Upload"),iconCls:"silk-arrow-up",handler:function(){var e=V12.Cms.FlashUploader.FlashMovie("uploadSWF"+a);e.upload(b.postdata)},id:"uploadButton",scope:this},this);this.progressBar=new Ext.ProgressBar({value:0,width:200});c(this.progressBar,this)}});V12.Cms.FlashUploader.UploadButton=Ext.extend(Ext.Button,{flashTemplate:function(b,a,e,c){return['<div id="wrapperDiv',e,'" style="position:absolute; overflow: hidden; width:',b,"px; height:",a,'px; ">','<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" style="border:0px; padding:0px; margin:0px " width="100%" height="100%"  id="uploadSWF',e,'" >','<param name="movie" value="',V12.Cms.Context.cmsUrl,'CmsGui/Libs/flashUploader/fileUploader.swf" >',' <param name="wmode" value="transparent">','<param name="FlashVars" value="',"storeId=",this.store.storeId,"&gridId=",e,"&uploadHandler=",this.uploadHandler,"&fileFilter=",this.fileFilter,"&magicId=",V12.Cms.Context.magicId,'" /><embed src="',V12.Cms.Context.cmsUrl,'CmsGui/Libs/flashUploader/fileUploader.swf" swliveconnect="true" allowscriptaccess="always" name="uploadSWF',e,'" ','width="100%" height="100%" ','FlashVars="storeId=',this.store.storeId,"&gridId=",e,"&uploadHandler=",this.uploadHandler,"&fileFilter=",this.fileFilter,"&magicId=",V12.Cms.Context.magicId,'" scale="exactfit" ','wmode="transparent"',"></embed>","</object>","</div>"]},text:V12.tr("Add"),iconCls:"silk-add",listeners:{afterrender:function(){var b=Ext.get(this.id);var c=b.getWidth();var a=b.getHeight();Ext.DomHelper.insertBefore(b,this.flashTemplate(c,a,this.id,this.uploadHandler).join(""))}},constructor:function(a){V12.Cms.FlashUploader.UploadButton.superclass.constructor.call(this,a);Ext.apply(this,a)}});V12.Cms.FlashUploader.UploadDialog=function(e){var c={fileFilter:"All files,*.*",uploadHandler:V12.Cms.Context.cmsUrl+"CustomModules/Showcases/UploadHandler.ashx",postdata:"",onready:function(){}};Ext.apply(c,e);this.dialog=new Ext.Window({modal:true,title:V12.tr("File uploader"),width:500,height:500,layout:"fit",items:[]});var b=this.dialog;var a=new V12.Cms.FlashUploader.UploadGrid(c);b.items.add(a);b.show();a.on("uploadReady",function(){b.hide();c.onready()})};V12.Cms.FlashUploader.FlashMovie=function(a){if(window.document[a]){return window.document[a]}if(navigator.appName.indexOf("Microsoft Internet")==-1){if(document.embeds&&document.embeds[a]){return document.embeds[a]}}else{return document.getElementById(a)}};Ext.namespace("V12.Cms.Data");V12.Cms.Data.TreeLoader=Ext.extend(V12.Cms.Data.Store,{autoLoad:false,constructor:function(b){var a=this;V12.Cms.Data.TreeLoader.superclass.constructor.call(a,b);a.proxy.setApi({read:a.handler+"?crudOp=tree",create:a.handler+"?crudOp=create",update:a.handler+"?crudOp=update",destroy:a.handler+"?crudOp=destroy"});a.storeLoad=a.load;a.load=a.newLoad;a.on("metaChange",function(){a.layoutReady=true;if(a.rootN){a.storeLoad({callback:a.loadReady,scope:this})}});a.on("write",a.newNodeSaved)},newLoad:function(c,e,a){var b=this;b.rootN=c;b.tree=c.getOwnerTree();b.callback=e;if(b.layoutReady){b.storeLoad({callback:b.loadReady,scope:this})}return true},loadReady:function(b,c,g){var f=this;var a=this.reader.jsonData.node;var h=this.reader.jsonData.treeProps;Ext.apply(f.tree,h);var e=f.rootN;e.beginUpdate();e.appendChild(this.parseNode(a));e.endUpdate();if(typeof f.callback=="function"){f.callback(this,e)}f.tree.addNewNode=function(j,k){f.newNode(f,j,k)};this.fireEvent("load",this,e,null)},parseNode:function(e){var a=this.getById(e.rowId);var c=this.createNode(this,a);for(var b=0;b<e.children.length;b++){c.beginUpdate();c.appendChild(this.parseNode(e.children[b]));c.endUpdate()}return c},processAttribs:function(a,b){},createNode:function(e,b){var a={};a.id=Ext.id();a.leaf=false;a.expanded=true;a.loaded=true;e.processAttribs(a,b);var c=new Ext.tree.AsyncTreeNode(a);c.record=b;c.on("move",e.nodeMove);c.on("remove",e.nodeRemove);c.on("beforemove",e.beforeMove);c.on("beforeremove",e.beforeRemove);c.reorderChildren=e.reorderChildren;return c},newNode:function(e,a,f){var b=a.record.store;var c=new b.recordType(f);var g=a.record.get(e.tree.KeyProperty);f[e.tree.ParentProperty]=g;f[e.tree.IndexProperty]=a.childNodes.length;b.insert(0,c);b.tempRecord={parentNode:a,record:c,treeLoader:e}},newNodeSaved:function(j,a,k,f,b){if(a=="create"){var e=j.tempRecord.record;var g=j.tempRecord.treeLoader;var h=j.tempRecord.treeLoader.createNode(g,e);var c=j.tempRecord.parentNode;c.appendChild(h)}},nodeMove:function(a,j,f,h,e){var g=this;var c=h.record.get(a.KeyProperty);var b=j.record.store;j.record.set(a.ParentProperty,c);h.reorderChildren();b.save();b.autoSave=true},beforeMove:function(a,f,c,e,b){f.moveNode=true},beforeRemove:function(a,c,e){var b=e.record.store;b.autoSave=false},nodeRemove:function(a,c,e){c.reorderChildren();if(!e.moveNode){var b=e.record.store;b.remove(e.record);b.save()}},reorderChildren:function(){this.eachChild(function(c){var a=c.getOwnerTree();var b=this.indexOf(c);c.record.set(a.IndexProperty,b);return true})}});
