qcodo.registerDialogBox=function(a,b,c,d,e){qcodo.handleEvent();var f;if(!(f=qcodo.getControl(a)))return;var g=f.wrapper;objForm=document.getElementById(document.getElementById("Qform__FormId").value);for(var h=0;objForm.childNodes[h];h++){if(objForm.childNodes[h].id==g.id&&objForm.childNodes[h]!=g){objForm.removeChild(objForm.childNodes[h]);break}}var i=document.getElementById(g.id);if(!i)objForm.appendChild(g);g.dbBg=document.getElementById(g.id+"dbbg");var j=g.dbBg;if(!j){var j=document.createElement("div");j.id=g.id+"dbbg";document.getElementById(document.getElementById("Qform__FormId").value).appendChild(j);g.dbBg=j;j.wrapper=g;if(qcodo.isBrowser(qcodo.IE)){var k=document.createElement("iframe");k.id=g.id+"dbbgframe";k.style.left="0px";k.style.top="0px";k.style.position="absolute";k.style.filter="alpha(opacity=0)";k.src="javascript: false;";k.frameBorder=0;k.scrolling="no";k.style.zIndex=990;k.display="none";document.getElementById(document.getElementById("Qform__FormId").value).appendChild(k);g.dbBgFrame=k}}g.handleResize=function(a){a=qcodo.handleEvent(a);if(a.target){if(a.target.nodeName.toLowerCase()=="div"||a.target.nodeName.toLowerCase()=="span")return}var b=qcodo.activeDialogBox;var c=b.dbBg;var d=b.dbBgFrame;b.style.display="none";c.style.display="none";if(d)d.style.display="none";qcodo.handleEvent(a);b.style.display="inline";c.style.display="block";if(d)d.style.display="block";c.style.width=Math.max(qcodo.page.width,qcodo.client.width)+"px";c.style.height=Math.max(qcodo.page.height,qcodo.client.height)+"px";if(d){d.style.width=Math.max(qcodo.page.width,qcodo.client.width)+"px";d.style.height=Math.max(qcodo.page.height,qcodo.client.height)+"px"}var e=b.offsetWidth;var f=b.offsetHeight;var g=Math.round((qcodo.client.height-f)/2)+qcodo.scroll.y;var h=Math.round(Math.max((qcodo.client.width,qcodo.page.width)-e)/2)+qcodo.scroll.x;b.setAbsolutePosition(h,g);console.log(qcodo.client.height+" "+qcodo.page.height);return true};g.handleKeyPress=function(a){a=qcodo.handleEvent(a);qcodo.terminateEvent(a);var b=qcodo.activeDialogBox;b.hideDialogBox();return false};g.showDialogBox=function(){var a=this.dbBg;var b=this.dbBgFrame;g.style.display="none";a.style.display="none";if(b)b.style.display="none";qcodo.handleEvent();a.style.display="block";if(b)b.style.display="block";this.toggleDisplay("show");a.style.width=Math.max(qcodo.page.width,qcodo.client.width)+"px";a.style.height=Math.max(qcodo.page.height,qcodo.client.height)+"px";if(b){b.style.width=Math.max(qcodo.page.width,qcodo.client.width)+"px";b.style.height=Math.max(qcodo.page.height,qcodo.client.height)+"px"}var c=g.offsetWidth;var d=g.offsetHeight;var e=Math.round((qcodo.client.height-d)/2)+qcodo.scroll.y;var f=Math.round(Math.max((qcodo.client.width,qcodo.page.width)-c)/2)+qcodo.scroll.x;g.setAbsolutePosition(f,e);window.onresize=this.handleResize;window.onscroll=this.handleResize;qcodo.activeDialogBox=this;if(g.anyKeyCloses){document.body.onkeypress=this.handleKeyPress;g.control.focus()}};g.hideDialogBox=function(){var a=this;if(this.id.indexOf("_ctldbbg")>0)a=this.wrapper;a.dbBg.style.display="none";if(a.dbBgFrame)a.dbBgFrame.style.display="none";a.toggleDisplay("hide");window.onresize=null;window.onscroll=null;document.body.onkeypress=null;qcodo.activeDialogBox=null};g.style.zIndex=999;g.position="absolute";g.anyKeyCloses=e;j.style.position="absolute";j.style.zIndex=998;j.style.top="0px";j.style.left="0px";if(qcodo.isBrowser(qcodo.IE))j.style.overflow="auto";else j.style.overflow="hidden";if(d){j.style.cursor="pointer";j.onclick=g.hideDialogBox}else{j.style.cursor="url("+qc.imageAssets+"/_core/move_nodrop.cur), auto";j.onclick=null}j.style.backgroundColor=b;if(qcodo.isBrowser(qcodo.IE))j.style.filter="alpha(opacity="+c+")";else j.style.opacity=c/100;j.style.fontSize="1px";j.innerHTML=" ";if(g.style.display=="none")g.hideDialogBox();else g.showDialogBox()};qc.regDB=qcodo.registerDialogBox
