if(!ColdFusion.Window){ColdFusion.Window={}}ColdFusion.Window.windowIdCounter=1;ColdFusion.Window.create=function(H,G,D,F){if(H==null){ColdFusion.handleError(null,"window.create.nullname","widget",null,null,null,true);return }if(H==""){ColdFusion.handleError(null,"window.create.emptyname","widget",null,null,null,true);return }var E=ColdFusion.objectCache[H];var C=false;if(typeof (E)!="undefined"&&E!=null){if(E.callfromtag){ColdFusion.handleError(null,"window.create.duplicatename","widget",[H])}if(typeof (E.isConfObj)!="undefined"&&E.isConfObj==true){C=true;if(F!=null&&typeof (F.initshow)!="undefined"){if(F.initshow==false){return }}}else{if(!F||(F&&F.initshow!==false)){ColdFusion.Window.show(H)}return }}if(!E){ColdFusion.Log.info("window.create.creating","widget",[H])}var B=ColdFusion.Window.createHTML(H,G,D,F,C);var A=ColdFusion.objectCache[H];if(A!=null&&typeof (A.isConfObj)!="undefined"&&A.isConfObj==true){return }ColdFusion.Window.createJSObj(H,D,B)};ColdFusion.Window.createHTML=function(G,F,D,B,P){var O=null;var M=null;if(B&&B.divid){O=document.getElementById(B.divid)}if(O==null){O=document.createElement("div");M="cf_window"+ColdFusion.Window.windowIdCounter;ColdFusion.Window.windowIdCounter++;O.id=M;O.className="yuiextdlg"}document.body.appendChild(O);var H=false;if(B!=null&&typeof (B.headerstyle)!="undefined"&&B.headerstyle!=null){var E=new String(B.headerstyle);E=E.toLowerCase();if(E.indexOf("background-color")>=0){H=true}}var C=document.getElementById(G+"_title");if(H==true){var A=document.getElementById(G+"_b");if(!A){A=document.createElement("b");A.className="corner";A.id=G+"_b";for(var I=1;I<4;I++){var J=document.createElement("b");J.className="filler"+I;J.style.cssText=B.headerstyle;A.appendChild(J)}if(C!=null){O.insertBefore(A,C)}else{O.appendChild(A)}}}if(C==null){C=document.createElement("div");C.id=G+"_title";var N="x-dlg-hd";C.className=N;if(F){C.innerHTML=F}else{C.innerHTML="&nbsp;"}O.appendChild(C)}var L=document.getElementById(G+"_body");if(L==null){L=document.createElement("div");L.id=G+"_body";L.className="x-dlg-bd";O.appendChild(L)}var K;K=ColdFusion.Window.getUpdatedConfigObj(B,G);if(typeof (K)=="undefined"){O.innerHTML="";return }if(M){K.divid=M}if(typeof (K.initshow)!="undefined"&&K.initshow===false){K.url=D;ColdFusion.objectCache[G]=K;ColdFusion.objectCache[G+"_body"]=K}return K};ColdFusion.Window.createJSObj=function(M,A,J){var H;var F=false;if(typeof (J.childlayoutid)&&J.childlayoutid!=null){F=true;H=new Ext.LayoutDialog(J.divid,J)}else{H=new Ext.BasicDialog(J.divid,J)}H.cfwindowname=M;H.tempx=J.tempx;H.tempy=J.tempy;H.divid=J.divid;if(typeof (J.onShow)!="undefined"){H.onShow=J.onShow;H.addListener("show",ColdFusion.Window.onShowWrapper)}if(typeof (J.onHide)!="undefined"){H.onHide=J.onHide;H.addListener("hide",ColdFusion.Window.onHideWrapper)}if(typeof (J.headerstyle)!="undefined"&&J.headerstyle!=null){var D=document.getElementById(M+"_title");if(D!=null){D.style.cssText="background:none;"+J.headerstyle}}if(typeof (J.bodystyle)!="undefined"&&J.bodystyle!=null){var B=document.getElementById(M+"_body");var L=B.parentNode;if(L!=null){L.style.cssText=J.bodystyle}}H.isConfObj=false;H._cf_body=M+"_body";ColdFusion.objectCache[M]=H;if(F){var K=H.getLayout();var I=ColdFusion.objectCache[J.childlayoutid];K.add("center",new Ext.NestedLayoutPanel(I))}var G=null;if(typeof (A)!="undefined"&&A!=""){G=A}if(G==null){if(typeof (J.initshow)=="undefined"||J.initshow==true){ColdFusion.Window.showandhide(H,J)}return }ColdFusion.objectCache[M+"_body"]=H;if(typeof (J.callfromtag)=="undefined"){var E;var C;H._cf_visible=false;H._cf_dirtyview=true;H.addListener("show",ColdFusion.Window.showHandler);H.addListener("hide",ColdFusion.Window.hideHandler);H.url=G;if(J){if(typeof (J.initshow)=="undefined"||J.initshow==true){ColdFusion.Window.showandhide(H,J)}E=J.callbackHandler;C=J.errorHandler}}else{H.callfromtag=true;H._cf_visible=false;H._cf_dirtyview=true;H.addListener("show",ColdFusion.Window.showHandler);H.addListener("hide",ColdFusion.Window.hideHandler);if(typeof (J.initshow)=="undefined"||J.initshow==true){ColdFusion.Window.showandhide(H,J)}}};ColdFusion.Window.showandhide=function(B,A){if(typeof (A.tempinitshow)!="undefined"&&A.tempinitshow==false){B.el.show();B.el.hide()}else{B.show()}};ColdFusion.Window.destroy=function(C,B){if(C){var A=ColdFusion.Window.getWindowObject(C);if(A){if(B===true){A.destroy(true)}else{A.destroy()}ColdFusion.objectCache[C]=null}}};ColdFusion.Window.showHandler=function(B){B._cf_visible=true;if(B._cf_dirtyview){if(typeof (B.callfromtag)=="undefined"){ColdFusion.Ajax.replaceHTML(B._cf_body,B.url,"GET",null,B.callbackHandler,B.errorHandler)}else{var A=ColdFusion.bindHandlerCache[B._cf_body];if(A){A()}}B._cf_dirtyview=false}};ColdFusion.Window.hideHandler=function(A){A._cf_visible=false;if(A._cf_refreshOnShow){A._cf_dirtyview=true}};ColdFusion.Window.xPosition=50;ColdFusion.Window.yPosition=50;ColdFusion.Window.resetHTML=function(B){var A=document.getElementById(B);if(A){A.innerHTML=""}};ColdFusion.Window.getUpdatedConfigObj=function(H,G){var F={};if(H!=null){if(typeof (H)!="object"){ColdFusion.Window.resetHTML(G);ColdFusion.handleError(null,"window.getupdatedconfigobject.invalidconfig","widget",[G],null,null,true);return }for(var I in H){if(I=="center"&&ColdFusion.Util.isBoolean(H.center)){F.fixedcenter=H.center}else{F[I]=H[I]}}}if(typeof (F.initshow)!="undefined"){if(ColdFusion.Util.isBoolean(F.initshow)==false){ColdFusion.Window.resetHTML(G);ColdFusion.handleError(null,"window.getupdatedconfigobject.invalidinitshow","widget",[G],null,null,true);return }else{F.initshow=ColdFusion.Util.castBoolean(F.initshow);F._cf_visible=F.initshow}}F.tempcenter=null;if(typeof (F.fixedcenter)!="undefined"){if(ColdFusion.Util.isBoolean(F.fixedcenter)==false){ColdFusion.Window.resetHTML(G);ColdFusion.handleError(null,"window.getupdatedconfigobject.invalidcenter","widget",[G],null,null,true);return }else{F.fixedcenter=ColdFusion.Util.castBoolean(F.fixedcenter)}}if(typeof (F.resizable)!="undefined"){if(ColdFusion.Util.isBoolean(F.resizable)==false){ColdFusion.Window.resetHTML(G);ColdFusion.handleError(null,"window.getupdatedconfigobject.invalidresizable","widget",[G],null,null,true);return }else{F.resizable=ColdFusion.Util.castBoolean(F.resizable)}}if(typeof (F.draggable)!="undefined"){if(ColdFusion.Util.isBoolean(F.draggable)==false){ColdFusion.Window.resetHTML(G);ColdFusion.handleError(null,"window.getupdatedconfigobject.invaliddraggable","widget",[G],null,null,true);return }else{F.draggable=ColdFusion.Util.castBoolean(F.draggable)}}if(typeof (F.closable)!="undefined"){if(ColdFusion.Util.isBoolean(F.closable)==false){ColdFusion.Window.resetHTML(G);ColdFusion.handleError(null,"window.getupdatedconfigobject.invalidclosable","widget",[G],null,null,true);return }else{F.closable=ColdFusion.Util.castBoolean(F.closable)}}if(typeof (F.modal)!="undefined"){if(ColdFusion.Util.isBoolean(F.modal)==false){ColdFusion.Window.resetHTML(G);ColdFusion.handleError(null,"window.getupdatedconfigobject.invalidmodal","widget",[G],null,null,true);return }else{F.modal=ColdFusion.Util.castBoolean(F.modal)}}if(typeof (F.refreshonshow)!="undefined"){if(ColdFusion.Util.isBoolean(F.refreshonshow)==false){ColdFusion.Window.resetHTML(G);ColdFusion.handleError(null,"window.getupdatedconfigobject.invalidrefreshonshow","widget",[G],null,null,true);return }else{F._cf_refreshOnShow=ColdFusion.Util.castBoolean(F.refreshonshow)}}F.shadow=true;if(!F.height){F.height=300}else{if(ColdFusion.Util.isInteger(F.height)==false){ColdFusion.Window.resetHTML(G);ColdFusion.handleError(null,"window.getupdatedconfigobject.invalidheight","widget",[G],null,null,true);return }}if(!F.width){F.width=500}else{if(ColdFusion.Util.isInteger(F.width)==false){ColdFusion.Window.resetHTML(G);ColdFusion.handleError(null,"window.getupdatedconfigobject.invalidwidth","widget",[G],null,null,true);return }}var E=false;if(F.minwidth){if(ColdFusion.Util.isInteger(F.minwidth)==false){ColdFusion.Window.resetHTML(G);ColdFusion.handleError(null,"window.getupdatedconfigobject.invalidminwidth","widget",[G],null,null,true);return }var D=F.minwidth;var C=F.width;if(typeof (D)!="number"){D=parseInt(D)}if(typeof (C)!="number"){C=parseInt(C)}if(D>C){ColdFusion.Window.resetHTML(G);ColdFusion.handleError(null,"window.getupdatedconfigobject.invalidminwidth","widget",[G],null,null,true);return }F.minWidth=F.minwidth;E=true}if(F.minheight){if(ColdFusion.Util.isInteger(F.minheight)==false){ColdFusion.Window.resetHTML(G);ColdFusion.handleError(null,"window.getupdatedconfigobject.invalidminheight","widget",[G],null,null,true);return }var B=F.minheight;var A=F.height;if(typeof (B)!="number"){B=parseInt(B)}if(typeof (A)!="number"){A=parseInt(A)}if(B>A){ColdFusion.Window.resetHTML(G);ColdFusion.handleError(null,"window.getupdatedconfigobject.invalidheightvalue","widget",[G],null,null,true);return }F.minHeight=F.minheight;E=true}if(F.x){if(ColdFusion.Util.isInteger(F.x)==false){ColdFusion.Window.resetHTML(G);ColdFusion.handleError(null,"window.getupdatedconfigobject.invalidx","widget",[G],null,null,true);return }}if(F.y){if(ColdFusion.Util.isInteger(F.y)==false){ColdFusion.Window.resetHTML(G);ColdFusion.handleError(null,"window.getupdatedconfigobject.invalidy","widget",[G],null,null,true);return }}if(typeof (F.x)=="undefined"&&(typeof (F.center)=="undefined"||F.center==false)){F.x=ColdFusion.Window.xPosition;ColdFusion.Window.xPosition+=15}if(typeof (F.y)=="undefined"&&(typeof (F.center)=="undefined"||F.center==false)){F.y=ColdFusion.Window.yPosition;ColdFusion.Window.yPosition+=15}if(typeof (F.initshow)!="undefined"&&F.initshow===false){F.tempinitshow=false;if(typeof (F.fixedcenter)!="undefined"&&F.fixedcenter===true){F.tempcenter=F.fixedcenter;F.fixedcenter=null}else{F.tempx=F.x;F.tempy=F.y}F.x=-10000;F.y=-10000}F.constraintoviewport=true;F.initshow=true;if(F.resizable!=null&&F.resizable==false&&E==true){ColdFusion.Window.resetHTML(G);ColdFusion.handleError(null,"window.getupdatedconfigobject.minhwnotallowed","widget",[G],null,null,true);return }F.collapsible=false;F.shadow=true;F.isConfObj=true;return F};ColdFusion.Window.show=function(D){var C=ColdFusion.objectCache[D];if(typeof (C)!="undefined"&&C!=null){if(typeof (C.isConfObj)!="undefined"&&C.isConfObj==true){C.initshow=true;var B=ColdFusion.Window.createHTML(D,null,C.url,C,true);ColdFusion.Window.createJSObj(D,C.url,B)}else{if(C.isVisible()==false){C.show();ColdFusion.Log.info("window.show.shown","widget",[D])}if(C.tempcenter!=null){C.center();C.tempcenter=null}else{if(C.getEl()&&C.getEl().getX()>0&&C.getEl().getY()>0){C.tempx=null;C.tempy=null}else{if(C.tempx!=null&&C.tempy!=null){C.moveTo(C.tempx,C.tempy);C.tempx=null;C.tempy=null}else{var A=C.getEl().getX();var E=C.getEl().getY();C.moveTo(A+1,E+1);C.moveTo(A,E)}}}Ext.DialogManager.bringToFront(C)}}else{ColdFusion.handleError(null,"window.show.notfound","widget",[D],null,null,true)}};ColdFusion.Window.hide=function(A){var B=ColdFusion.objectCache[A];if(B){if(B.isVisible&&B.isVisible()==true){B.hide();ColdFusion.Log.info("window.hide.hidden","widget",[A])}}else{ColdFusion.handleError(null,"window.hide.notfound","widget",[A],null,null,true)}};ColdFusion.Window.onShow=function(C,B){var A=ColdFusion.objectCache[C];if(typeof (A)!="undefined"&&A!=null){A.onShow=B;if(A.addListener){A.addListener("show",ColdFusion.Window.onShowWrapper)}}else{ColdFusion.handleError(null,"window.onshow.notfound","widget",[C],null,null,true)}};ColdFusion.Window.onShowWrapper=function(A){A.onShow.call(null,A.cfwindowname)};ColdFusion.Window.onHide=function(C,A){var B=ColdFusion.objectCache[C];if(typeof (B)!="undefined"&&B!=null){B.onHide=A;if(B.addListener){B.addListener("hide",ColdFusion.Window.onHideWrapper)}}else{ColdFusion.handleError(null,"window.onhide.notfound","widget",[C],null,null,true)}};ColdFusion.Window.onHideWrapper=function(A){A.onHide.call(null,A.cfwindowname)};ColdFusion.Window.getWindowObject=function(C){if(!C){ColdFusion.handleError(null,"window.getwindowobject.emptyname","widget",null,null,null,true);return }var B=ColdFusion.objectCache[C];if(B==null||(typeof (B.isConfObj)=="undefined"&&Ext.LayoutDialog.prototype.isPrototypeOf(B)==false&&Ext.BasicDialog.prototype.isPrototypeOf(B)==false)){ColdFusion.handleError(null,"window.getwindowobject.notfound","widget",[C],null,null,true);return }if(typeof (B.isConfObj)!="undefined"&&B.isConfObj==true){B.initshow=true;var A=ColdFusion.Window.createHTML(C,null,B.url,B,true);ColdFusion.Window.createJSObj(C,B.url,A);ColdFusion.Window.hide(C);B=ColdFusion.objectCache[C]}return B};