gx.popup={lvl:-1,currentPopup:null,currentPrompt:null,showParentPopups:false,Class:function(a,b){this.id="";this.url="";this.autoresize=1;this.width=0;this.height=0;this.position=0;this.top=0;this.left=0;this.zindex=1000;this.lvl=-1;this.parentPopup=null;this.window=null;this.document=null;this.frameDocument=null;this.frameWindow=null;this.ReturnParms=[];this.RawReturnedParms=[];this.ModifCtrl=null;this.Opener=null;this.IsPrompt=(b!=undefined)?b:false;this.PromptIsGet=false;this.InternalPopup=null;this.OncloseCmds=[];this.CustomRenderGrid=null;this.state="created";this.setPopupData=function(){if(a instanceof Array){this.url=a[0];this.autoresize=a[1];this.width=a[2];this.height=a[3];this.position=a[4];this.top=a[5];this.left=a[6];this.OncloseCmds=a[7]||[];this.ReturnParms=a[8]||[]}else{if(a.Url){this.url=a.Url;if(typeof(a.Autoresize)!="undefined"){this.autoresize=a.Autoresize}if(typeof(a.Width)!="undefined"){this.width=a.Width}if(typeof(a.Height)!="undefined"){this.height=a.Height}if(typeof(a.Position)!="undefined"){this.position=a.Position}if(typeof(a.Top)!="undefined"){this.top=a.Top}if(typeof(a.Left)!="undefined"){this.left=a.Left}if(typeof(a.OncloseCmds)!="undefined"){this.OncloseCmds=a.OncloseCmds}if(typeof(a.ReturnParms)!="undefined"){this.ReturnParms=a.ReturnParms}}}};this.open=function(){this.state="opening";var d=gx.popup.gxOpener();this.lvl=-1;if(d&&d.gx&&d.gx.popup.ext.win&&d.gx.popup.ext.win.gx){this.lvl=d.gx.popup.ext.win.gx.popup.lvl}else{this.lvl=gx.popup.lvl}if(document.gxPopup!=null){this.parentPopup=document.gxPopup;this.zindex=gx.popup.ext.zdx+document.gxPopup.zindex}else{this.zindex=gx.popup.ext.zdx}var g=this.url;if(this.IsPrompt==true){gx.popup.currentPrompt=this;var h="?";var c=this.ReturnParms.length;for(var e=0;e<c;e++){if(!gx.lang.emptyObject(this.ReturnParms[e].Ctrl)){h+=gx.util.urlValue(this.ReturnParms[e].Ctrl)+","}else{if(typeof this.ReturnParms[e]=="string"){h+=gx.util.urlValue(this.ReturnParms[e])+","}else{if(this.CustomRenderGrid){var f=this.CustomRenderGrid.grid.getCellValue(this.ReturnParms[e].id);if(!gx.lang.emptyObject(f)){h+=gx.util.urlValue(f+"")+","}}else{if(!gx.lang.emptyObject(this.ReturnParms[e].id)){h+=gx.util.urlValue(gx.fn.getHidden(this.ReturnParms[e].id))+","}else{continue}}}}if((this.ReturnParms[e].isLastKey==true)&&(this.ReturnParms[e].isOut==true)&&(this.PromptIsGet==false)){gx.fn.setControlValue("_EventName",this.Opener.CmpContext);this.PromptIsGet=true}}if(this.ModifCtrl!=null){this.ModifCtrl.value=1}g+=h}this.InternalPopup=gx.popup.Impl(this,g,this.autoresize,this.width,this.height,this.position,this.top,this.left)};this.getOutputParms=function(){var f=[];if(this.IsPrompt){var c=this.ReturnParms.length;for(var e=0;e<c;e++){var d=this.ReturnParms[e];if(d.isOut==true){f.push(d)}}}else{return this.ReturnParms}return f};this.close=function(m){this.state="closing";if(m){this.RawReturnedParms=m}gx.ajax.windowClosed(gx.popup.lvl);gx.popup.lvl--;if(this.frameWindow&&this.frameWindow.gx){if(this.IsPrompt==true){if(this.parentPopup==null){gx.popup.currentPrompt=null
}else{this.parentPopup.frameWindow.gx.popup.currentPrompt=null}}this.frameWindow.gx.evt.onunload.call(this.frameWindow);this.frameDocument.gxPopup=null;this.frameDocument=null;this.frameWindow=null}gx.popup.ext.close(this);var d=this.getOutputParms();if((m!=null)&&(this.IsPrompt==true)){var h=m.length;var f=gx.popup.assignPromptField;var l=gx.popup;if(!gx.lang.emptyObject(this.CustomRenderGrid)){f=this.CustomRenderGrid.grid.setCellValue;l=this.CustomRenderGrid.grid}for(var g=0;g<h;g++){f.apply(l,[d[g],m[g]])}if(this.PromptIsGet){gx.csv.loadScreen()}else{try{var k=null;h=d.length;for(var g=0;g<h;g++){var c=d[g].Ctrl;if(gx.fn.isAccepted(c)){k=c}}if(k){gx.fn.setFocus(k)}gx.evt.ctrlOnchange(gx.fn.getControlValue(this.Opener.CmpContext+"Mode"),gx.fn.getControlValue(this.Opener.CmpContext+"IsConfirmed"),(typeof(window.GXPkIsDirty)=="undefined"?false:window.GXPkIsDirty),null,"eng")}catch(j){gx.dbg.logEx(j,"gxpopup.js","close")}}}else{if(m){if(d&&d instanceof Array&&d.length>0){gx.fn.setReturnParms(this.Opener,d,m)}}}gx.ajax.dispatchCommands(this.OncloseCmds);this.cleanup();this.state="closed"};this.setFocusFirst=function(){if(this.frameWindow.gx){this.frameWindow.gx.fn.setFocusOnload()}};this.cleanup=function(){try{this.OncloseCmds=[];this.ReturnParms=[];this.PromptIsGet=false;this.InternalPopup=null;this.window=null;this.document=null;this.Opener=null;this.parentPopup=null;this.RawReturnedParms=[];this.ModifCtrl=null;this.InternalPopup=null;this.CustomRenderGrid=null}catch(c){gx.dbg.logEx(c,"gxpopup.js","popupObj.cleanup")}};this.setPopupData()},gxOpener:function(){var a=null;try{parent.gxTestAvailable=1;a=parent}catch(b){gx.dbg.logEx(b,"gxpopup.js","gxOpener")}return a},setFocus:function(){var a=this.getPopup();if(a){a.window.frames[0].focus()}},ispopup:function(){return(this.getPopup()!=null)},popupurl:function(){return this.getPopup().url},waitCallback:function(b){var a=gx.popup.getPopup();if(a){if(a.state=="opened"){b()}else{gx.lang.doCallTimeout(gx.popup.waitCallback,gx.popup,[b],50)}}else{b()}},getPopup:function(){var a=this.gxOpener();if(!gx.lang.emptyObject(a)&&!gx.lang.emptyObject(a.gx)){return a.gx.popup.currentPopup}return null},setPopup:function(a){this.currentPopup=a},open:function(a){return this.openPopup(a)},openUrl:function(a,b,f){var i=1;var g=0;var e=0;var c=0;var j=0;var d=0;if(f){i=f[0];g=f[1];e=f[2];c=f[3];j=f[4];d=f[5]}return this.openPopup([a,i,g,e,c,j,d,[],b])},openPopup:function(a){var b=new this.Class(a,false);b.Opener=gx.O;b.open();return b},openPrompt:function(m,f,g,j,l,k){if(gx.popup.currentPrompt==null){var d=f[0].Ctrl;var i=false;var e;var c;var a;if(d){e=gx.fn.rowGridId(d);c=gx.fn.controlRowId(d);if(!gx.lang.emptyObject(e)&&!gx.lang.emptyObject(c)){gx.csv.lastGrid=e;gx.fn.setCurrentGridRow(e,c)}}else{var h=gx.O.getValidStructFld(f[0].id);if(!gx.lang.emptyObject(h)){a=gx.O.getGridById(h.grid);if(a){i=a.isUsercontrol;if(i){e=a.gridId+"";c=(!gx.lang.emptyObject(a.grid.getSelectedRow))?gx.text.padl(a.grid.getSelectedRow()+"",4,"0"):undefined;
if(!gx.lang.emptyObject(e)&&!gx.lang.emptyObject(c)){gx.csv.lastGrid=e;gx.fn.setCurrentGridRow(e,c)}}}}}if(!k&&!this.outParmsAccepted(f)&&!i){return}var b=new this.Class([m,1,0,0,0,0,0,[],f],true);b.IsMod=g;b.Opener=gx.getObj(j,l);b.CustomRenderGrid=a;b.open()}},outParmsAccepted:function(b){var a=b.length;var c=false;for(var d=0;d<a;d++){var e=b[d];if(e.isOut){c=true}if(e.isOut&&e.Ctrl&&gx.fn.isAccepted(e.Ctrl)){return true}}return !c},gxReturn:function(a){gx.fn.closeWindow(a)},parmId:function(a){var b=gx.dom.id(a);if(b.indexOf("span_")==0){b=b.substring(5)}return b},assignPromptField:function(b,c){if(gx.lang.emptyObject(b)){return}gx.csv.pkDirty=b.isKey;if(!b.Ctrl){return}if(b.Ctrl.type=="checkbox"&&b.Ctrl.value!=c){b.Ctrl.checked=!b.Ctrl.checked}if(b.Ctrl.value!=c&&b.isKey){gx.popup.gxOpener().GXPkIsDirty=true}var a=gx.O.getCtrlIdx(b.Ctrl.id);if(a){if(a>gx.O.toValid){gx.O.toValid=a}gx.csv.validateAll()}var e=gx.csv.ctxControlId(this.parmId(b.Ctrl));var g=gx.O.getValidStructFld(e);if(!gx.lang.emptyObject(g)&&!gx.lang.emptyObject(g.v2c)&&(g.type=="date"||g.type=="dtime")){g.v2v(c);g.v2c()}else{gx.fn.setControlValue(this.parmId(b.Ctrl),c,0)}b.Ctrl.setAttribute("gxvalid","0");gx.evt.execOnchange(b.Ctrl);var f=gx.dom.byId("span_"+b.Ctrl.name);if(f!=null){if(f.childNodes.length==0){f.appendChild(gx.popup.gxOpener().document.createTextNode(""))}var d=f.childNodes[0];d.nodeValue=c}},autofit:function(){var a=this.getPopup();if(!gx.lang.emptyObject(a)){this.ext.autofit(a,null,false)}},Impl:function(j,a,c,d,m,h,k,g){var b="PopupHeader";var l="PopupHeaderButton";var f="PopupContent";var e="PopupBorder";var i="PopupShadow";return new this.ext.popUp(j,c,h,g,k,d,m,"gxp",a,"white","#00385c","16pt serif","GxPopup","#00385c","white","lightgrey","#00568c","black",true,false,true,true,true,true,false,"min.gif","max.gif","close.gif","resize.gif",b,l,f,e,i,undefined)},setZIndex:function(a){var b=gx.dom.getStyle(a,"zIndex");if(isNaN(b)){b=999}b++;this.zindex=b;this.ext.zdx=b},ext:{w3c:gx.util.browser.w3c,ns4:gx.util.browser.ns4,ie5:gx.util.browser.ie5,ns6:gx.util.browser.ns6,isFF:gx.util.browser.isFirefox(),currIDb:null,xoff:0,yoff:0,currRS:null,rsxoff:0,rsyoff:0,zdx:1000,sdiff:5,win:null,doc:null,hide:function(b){if(this.w3c){var a=gx.dom.byId;a(b+"_t").style.visibility="hidden";a(b+"_c").style.visibility="hidden";a(b+"_rs").style.visibility="hidden";a(b+"_b").style.visibility="hidden";a(b+"_s").style.visibility="hidden"}},show:function(b){var a=gx.dom.byId;a(b+"_t").style.visibility="visible";a(b+"_c").style.visibility="visible";a(b+"_rs").style.visibility="visible";a(b+"_b").style.visibility="visible";a(b+"_s").style.visibility="visible"},close:function(c){gx.popup.ext.win=null;gx.popup.ext.doc=null;gx.popup.ext.currIDb=null;gx.popup.ext.currIDs=null;gx.popup.ext.currRS=null;var e=c.id;var d=document.getElementById(e+"_s");var b=document.getElementById(e+"_b");gx.dom.removeControlSafe(d);var a=document.getElementById(e+"_ifrm");if(a){a.src=""}if(gx.util.browser.isIE()&&gx.util.browser.ieVersion()==7){b.parentNode.removeChild(b)
}else{gx.dom.removeControlSafe(b)}gx.popup.ext.deinitmodal(c);gx.popup.setPopup(c.parentPopup);if(c.parentPopup){c.parentPopup.frameWindow.gx.fx.obs.notify("popup.close",[c])}else{gx.fx.obs.notify("popup.close",[c])}},move:function(d,b,f){if(this.w3c){var c=gx.dom.byId;var a=c(d+"_b");var e=c(d+"_c");var d=c(d+"_s");a.style.left=b+"px";d.style.left=b+this.sdiff+"px";a.style.top=f+"px";d.style.top=f+this.sdiff+"px";e.style.overflow="hidden"}},resize:function(a,c,b){if(this.w3c){var k=gx.dom.byId;if(k(a+"_rs").rsEnable){var e=k(a+"_extWA");var h=k(a+"_rs");var i=k(a+"_b");var g=k(a+"_t");var d=k(a+"_s");var j=k(a+"_c");var f=this.ie5;e.style.display="block";h.style.left=Math.max(c,((f)?88:92))+"px";h.style.top=Math.max(b,((f)?68:72))+"px";i.style.width=Math.max(c+((f)?12:8),100)+"px";i.style.height=Math.max(b+((f)?12:8),80)+"px";g.style.width=Math.max(c+((f)?4:3),((this.ns6)?95:92))+"px";d.style.width=Math.max(c+12,((f)?100:104))+"px";d.style.height=Math.max(b+((f)?12:13),((f)?80:86))+"px";j.style.width=Math.max(c-((f)?-5:5),((f)?92:87))+"px";j.style.height=Math.max(b-((f)?24:28),44)+"px";j.style.overflow="hidden"}}},ns6bugfix:function(){if(navigator.userAgent.indexOf("Netscape/6")>0){setTimeout("self.resizeBy(0,1); self.resizeBy(0,-1);",100)}},movepopup:function(){if((this.currIDb!=null)&&this.w3c){this.move(this.currIDb.cid,gx.evt.mouse.x+this.xoff,gx.evt.mouse.y+this.yoff)}if((this.currRS!=null)&&this.w3c){this.resize(this.currRS.cid,gx.evt.mouse.x+this.rsxoff,gx.evt.mouse.y+this.rsyoff)}return false},stopRS:function(){document.getElementById(this.cid+"_extWA").style.display="none";gx.popup.ext.currRS=null},startRS:function(a){var d=gx.popup.ext;var c=(d.ie5)?event.clientX+document.body.scrollLeft:a.pageX;var b=(d.ie5)?event.clientY+document.body.scrollTop:a.pageY;d.rsxoff=parseInt(this.style.left)-c;d.rsyoff=parseInt(this.style.top)-b;d.currRS=this;if(d.ns6){document.getElementById(this.cid+"_c").style.overflow="hidden"}return false},changez:function(a){var d=(a!=null)?a:this;var c=gx.popup.ext;var b=gx.dom.byId;if(c.ns6){b(d.cid+"_c").style.overflow="hidden"}b(d.cid+"_s").style.zIndex=++c.zdx;d.style.zIndex=++c.zdx;b(d.cid+"_rs").style.zIndex=++c.zdx},stopdrag:function(){var a=gx.popup.ext;a.currIDb=null;document.getElementById(this.cid+"_extWA").style.display="none";a.ns6bugfix()},grab_id:function(a){var e=gx.popup.ext;var d=gx.dom.byId;var c=(e.ie5)?event.clientX+document.body.scrollLeft:a.pageX;var b=(e.ie5)?event.clientY+document.body.scrollTop:a.pageY;e.xoff=parseInt(d(this.cid+"_b").style.left)-c;e.yoff=parseInt(d(this.cid+"_b").style.top)-b;e.currIDb=d(this.cid+"_b");e.currIDs=d(this.cid+"_s");d(this.cid+"_extWA").style.display="block";return false},subBox:function(b,g,c,e,a,f){var d=document.createElement("div");d.setAttribute("id",f);d.style.position="absolute";d.style.left=b+"px";d.style.top=g+"px";d.style.width=c+"px";d.style.height=e+"px";d.style.visibility="visible";d.style.padding="0px";return d},popUp:function(E,q,v,O,N,P,ae,j,C,ai,a,W,I,Y,ad,ab,F,k,al,aj,V,aa,U,c,l,D,Z,J,af,L,R,p,i,g,e){e=(e!==undefined)?e:gx.popup.showParentPopups;
var H=gx.popup.ext;var u=gx.basePath+gx.staticDirectory;if(E.parentPopup!=null){var S=E.parentPopup.window,f=S.document;H=S.gx.popup.ext;H.win=S;H.doc=f;gx.popup.ext=H}else{H.win=window;H.doc=H.win.document}H.win.gx.popup.setPopup(E);E.window=H.win;E.document=H.doc;H.win.gx.popup.lvl++;j+=H.win.gx.popup.lvl;E.id=j;var o=function(h){return H.doc.getElementById(h)};if(!E.IsPrompt&&!gx.util.sameAppUrl(C)){al=false;gx.popup.setPopup(null);var B=new Date();B=B.getTime();var Q=(c)?C:"";var s="";if(v==1){s=(H.ns4)?"screenX="+O+",screenY="+N:"left="+O+",top="+N}var z="";if(q==0){z=",width="+P+",height="+ae}var S=window.open(Q,"gx"+B,"status=no,menubar=no"+z+",resizable="+((aa)?"yes":"no")+",scrollbars=yes,"+s)}else{P=Math.max(P,100);ae=Math.max(ae,80);var M=new H.subBox(P-((H.ie5)?12:8),ae-((H.ie5)?12:8),7,7,"",j+"_rs");if(aa){M.innerHTML='<img src="'+gx.util.resourceUrl(u+af,true)+'" width="7" height="7">';M.style.cursor="se-resize"}M.rsEnable=aa;var ac=(H.ie5)?P:P+4;var b=(H.ie5)?ae:ae+6;var K=new H.subBox(O+H.sdiff,N+H.sdiff,ac,b,k,j+"_s");K.className=g;if(H.ie5){K.style.filter="alpha(opacity=50)"}else{K.style.MozOpacity=0.5}K.style.zIndex=++H.zdx;if(!aj){K.style.visibility="hidden"}var ah=new H.subBox(O,N,P,ae,ab,j+"_b");ah.className=i;ah.style.display="block";ah.style.zIndex=++H.zdx;if(!aj){ah.style.visibility="hidden"}ac=(H.ie5)?P-8:P-5;b=(H.ie5)?ae+4:ae-4;var ag=new H.subBox(2,2,ac,20,Y,j+"_t");ag.style.overflow="hidden";ag.className=L;if(!aj){ag.style.visibility="hidden"}ag.innerHTML='<span id="'+j+'_gxtitle"  style="white-space:nowrap;position:absolute;padding: 2px;">'+I+'</span><span class="'+R+'" style="z-index:'+(++H.zdx)+';" id="'+j+'_cls"></span>';ac=(H.ie5)?P-7:P-13;var m=new H.subBox(2,24,ac,ae-36,ai,j+"_c");m.className=p;C+=(C.indexOf("?")!=-1)?",":"?";C+=encodeURIComponent("gxPopupLevel="+H.win.gx.popup.lvl+";");var T=(gx.util.browser.isFirefox()&&q==1)?"hidden":"auto";m.innerHTML='<iframe id="'+j+'_ifrm" src="'+C+'" width="100%" height="100%" frameborder="0" scrolling="off" style="overflow:'+T+';"></iframe>';m.style.overflow="hidden";if(!aj){m.style.visibility="hidden"}if(!aj){ah.style.visibility="hidden"}var d=new H.subBox(2,24,0,0,"",j+"_extWA");d.style.display="none";d.style.width="100%";d.style.height="100%";ah.appendChild(ag);ah.appendChild(m);ah.appendChild(d);ah.appendChild(M);H.doc.body.appendChild(K);H.doc.body.appendChild(ah);if(!aj){H.hide(j)}var A=o(j+"_b");A.cid=j;A.isExt=(c)?true:false;var n=o(j+"_t");n.cid=j;if(aa){var G=o(j+"_rs");G.cid=j;G.onmousedown=H.startRS;G.onmouseup=H.stopRS}var r=o(j+"_cls");var X=o(j+"_extWA");A.activecolor=Y;A.inactivecolor=F;r.onclick=E.close.closure(E);if(V){n.onmousedown=H.grab_id;n.onmouseup=H.stopdrag}var ak=o(j+"_ifrm");gx.lang.doCallTimeout(H.showIfLoaded,H,[E,ak,1],50)}if(al||e){H.initmodal(E,e)}},initmodal:function(c,b){c.showParentPopups=b;if(c.parentPopup==null){gx.ajax.disableForm()}else{if(b){var d=gx.http.notification.node();var a=gx.dom.el(c.id+"_b");if(d&&a){d.style.zIndex=parseInt(a.style.zIndex)-1
}}else{this.hide(c.parentPopup.id)}}},deinitmodal:function(b){if(b.parentPopup==null){gx.ajax.enableForm()}else{if(b.showParentPopups){var c=gx.http.notification.node();var a=gx.dom.el(b.parentPopup.id+"_b");if(c&&a){c.style.zIndex=parseInt(a.style.zIndex)-1}}this.show(b.parentPopup.id)}},showIfLoaded:function(b,a,f){try{if(this.docReady(a,f)){var c=gx.dom.iFrameDoc(a);if(c.URL!="about:blank"){b.state="opened";this.autofit(b,c,true);return}}}catch(d){gx.dbg.logEx(d,"gxpopup.js","showIfLoaded")}f++;gx.lang.doCallTimeout(gx.popup.ext.showIfLoaded,gx.popup.ext,[b,a,f],f*50)},docReady:function(b,d){if(b.readyState=="complete"){return true}var c=gx.dom.iFrameDoc(b);if(c){var a=(typeof(c.gxReadyState)!="undefined")?c.gxReadyState:c.readyState;if(a=="complete"){return true}}if(!gx.util.browser.isIE()&&d>=10&&c&&c.body&&c.body.childNodes.length!=0){return true}return false},autofit:function(x,J,D){if(gx.lang.emptyObject(x)){return}var I=document;if(I.gxPopup!=null){x.zindex=this.zdx+I.gxPopup.zindex}else{x.zindex=this.zdx}var t=x.id;if(!this.doc){this.doc=x.document}I=this.doc;var w=I.getElementById(t+"_ifrm");if(!J&&gx.popup.ispopup()){J=gx.dom.iFrameDoc(w)}x.frameDocument=J;x.frameWindow=w.contentWindow;if(J){J.gxPopup=x}var z=I.getElementById(t+"_rs");var A=I.getElementById(t+"_s");var l=I.getElementById(t+"_t");var o=I.getElementById(t+"_b");var G=I.getElementById(t+"_c");var c=I.getElementById(t+"_gxtitle");c.innerHTML=J?J.title:"";var f=parseInt(G.style.height);var C=parseInt(G.style.width);var p;var E;var d;var y;var n=0;var m=0;var j=true;try{window.frameElement.id}catch(B){j=false}if(!j||window==window.top||gx.lang.emptyObject(window.top)){p=I.body.clientWidth;E=I.body.clientHeight;d=I.body.scrollTop;y=I.body.scrollLeft}else{var r=gx.dom.position(window.frameElement);p=Math.min(window.top.document.body.clientWidth,I.body.clientWidth);if(window.top.document.body.clientHeight>I.body.clientHeight){E=I.body.clientHeight}else{E=window.top.document.body.clientHeight;m=r.y}if(window.top.document.body.clientWidth>I.body.clientWidth){p=I.body.clientWidth}else{p=window.top.document.body.clientWidth;n=r.x}d=I.body.scrollTop;y=I.body.scrollLeft}var v=gx.dom.dimensions(o);if(x.autoresize==0){f=x.height-f+v.h;C=x.width-C+v.w}var u=x.width-C;var F=x.height-f;if(x.autoresize!=0){if(J&&J.body){var g=J.body.scrollWidth+30-p;var q=J.body.scrollHeight+30-E;var H=0;if(gx.util.browser.isIE()){H=1}else{if(gx.util.browser.isFirefox()){H=-10}}var b=gx.util.browser.isIE()?10:0;u=Math.max(J.body.scrollWidth,c.clientWidth+10)-C-((g>0)?g:0)+b;F=J.body.scrollHeight-f-((q>0)?q:0)+H}}var s=parseInt(x.top);var h=parseInt(x.left);if(x.position==0){s=(E-F)/2-(v.h/2)+d-m;h=(p-u)/2-(v.w/2)+y-n;if(s<0){s=5;F=F-5}if(h<0){h=5;u=u-5}}o.style.top=parseInt(s)+"px";o.style.left=parseInt(h)+"px";A.style.top=parseInt(s)+this.sdiff+"px";A.style.left=parseInt(h)+this.sdiff+"px";if(x.autoresize==0){f=x.height;C=x.width;var k=this.ie5;z.style.left=Math.max(C,((k)?88:92))+"px";z.style.top=Math.max(f,((k)?68:72))+"px";
o.style.width=Math.max(C+((k)?12:8),100)+"px";o.style.height=Math.max(f+((k)?12:8),80)+"px";l.style.width=Math.max(C+((k)?4:3),((this.ns6)?95:92))+"px";A.style.width=Math.max(C+12,((k)?100:104))+"px";A.style.height=Math.max(f+((k)?12:13),((k)?80:86))+"px";G.style.width=Math.max(C-((k)?-5:5),((k)?92:87))+"px";G.style.height=Math.max(f-((k)?24:28),44)+"px"}else{var a=function(K,e){var L=parseInt(K)+e;return L>0?L:K};l.style.width=a(l.style.width,u)+"px";o.style.height=a(o.style.height,F)+"px";o.style.width=a(o.style.width,u)+"px";G.style.height=a(G.style.height,F)+"px";G.style.width=a(G.style.width,u)+"px";var i=gx.util.browser.isIE()?0:4;A.style.height=(parseInt(o.style.height)+i)+"px";A.style.width=(parseInt(o.style.width)+i)+"px";i=gx.util.browser.isIE()?4:2;z.style.top=(parseInt(o.style.height)-parseInt(z.style.height)-i)+"px";z.style.left=(parseInt(o.style.width)-parseInt(z.style.width)-i)+"px"}G.style.overflow="hidden";if(D){this.show(t)}},_init:function(){this.w3c=gx.util.browser.w3c;this.ns4=gx.util.browser.ns4;this.ie5=gx.util.browser.ie5;this.ns6=gx.util.browser.ns6;setInterval(gx.popup.ext.movepopup.closure(gx.popup.ext),40)}},_init:function(){this.ext._init();var b=this.getPopup();if(b){try{if(b.frameDocument){b.frameDocument.gxPopup=b}}catch(c){b.frameDocument=b.frameWindow.document;gx.dbg.logEx(c,"gxpopup.js","_init")}var a=b.window.gx.popup;gx.fx.obs.addObserver("gx.onload",a,function(){this.autofit()}.closure(a));gx.fx.obs.addObserver("grid.onafterrefresh",a,function(e,d,f){if(d<f){this.autofit()}}.closure(a));gx.fx.obs.addObserver("gx.onafterevent",a,function(d){this.autofit()}.closure(a))}}};