qcodo.registerDialogBox=function(mixControl,strMatteColor,intMatteOpacity,blnMatteClickable,blnAnyKeyCloses){qcodo.handleEvent();var objControl;if(!(objControl=qcodo.getControl(mixControl)))return;var objWrapper=objControl.wrapper;objWrapper.id=objControl.id+"_ctls";while(objOldDialogWrapper=document.getElementById(objControl.id+"_ctl")){objOldDialogWrapper.parentNode.removeChild(objOldDialogWrapper);};objWrapper.id=objControl.id+"_ctl";if(objWrapper.showDialogBox)return;document.getElementById(document.getElementById("Qform__FormId").value).appendChild(objWrapper);objWrapper.dbBg=document.getElementById(objWrapper.id+"dbbg");var objDbBg=objWrapper.dbBg;if(!objDbBg){var objDbBg=document.createElement("div");objDbBg.id=objWrapper.id+"dbbg";document.getElementById(document.getElementById("Qform__FormId").value).appendChild(objDbBg);objWrapper.dbBg=objDbBg;objDbBg.wrapper=objWrapper;if(qcodo.isBrowser(qcodo.IE)){var objIframe=document.createElement("iframe");objIframe.id=objWrapper.id+"dbbgframe";objIframe.style.left="0px";objIframe.style.top="0px";objIframe.style.position="absolute";objIframe.style.filter="alpha(opacity=0)";objIframe.src="javascript: false;";objIframe.frameBorder=0;objIframe.scrolling="no";objIframe.style.zIndex=990;objIframe.display="none";document.getElementById(document.getElementById("Qform__FormId").value).appendChild(objIframe);objWrapper.dbBgFrame=objIframe;};};objWrapper.handleResize=function(objEvent){objEvent=qcodo.handleEvent(objEvent);if(objEvent.target&&objEvent.target.nodeName){if((objEvent.target.nodeName.toLowerCase()=='div')||(objEvent.target.nodeName.toLowerCase()=='span'))
return;};var objWrapper=qcodo.activeDialogBox;var objDbBg=objWrapper.dbBg;var objDbBgFrame=objWrapper.dbBgFrame;objWrapper.style.display="none";objDbBg.style.display="none";if(objDbBgFrame)objDbBgFrame.style.display="none";qcodo.handleEvent(objEvent);objWrapper.style.display="inline";objDbBg.style.display="block";if(objDbBgFrame)objDbBgFrame.style.display="block";objDbBg.style.width=Math.max(qcodo.page.width,qcodo.client.width)+"px";objDbBg.style.height=Math.max(qcodo.page.height,qcodo.client.height)+"px";if(objDbBgFrame){objDbBgFrame.style.width=Math.max(qcodo.page.width,qcodo.client.width)+"px";objDbBgFrame.style.height=Math.max(qcodo.page.height,qcodo.client.height)+"px";};var intWidth=objWrapper.offsetWidth;var intHeight=objWrapper.offsetHeight;var intTop=Math.round((qcodo.client.height-intHeight)/2)+qcodo.scroll.y;var intLeft=Math.round((qcodo.client.width-intWidth)/2)+qcodo.scroll.x;objWrapper.setAbsolutePosition(intLeft,intTop);return true;};objWrapper.handleKeyPress=function(objEvent){objEvent=qcodo.handleEvent(objEvent);qcodo.terminateEvent(objEvent);var objWrapper=qcodo.activeDialogBox;objWrapper.hideDialogBox();return false;};objWrapper.showDialogBox=function(){var objDbBg=this.dbBg;var objDbBgFrame=this.dbBgFrame;objWrapper.style.display="none";objDbBg.style.display="none";if(objDbBgFrame)objDbBgFrame.style.display="none";qcodo.handleEvent();objDbBg.style.display="block";if(objDbBgFrame)objDbBgFrame.style.display="block";this.toggleDisplay("show");objDbBg.style.width=Math.max(qcodo.page.width,qcodo.client.width)+"px";objDbBg.style.height=Math.max(qcodo.page.height,qcodo.client.height)+"px";if(objDbBgFrame){objDbBgFrame.style.width=Math.max(qcodo.page.width,qcodo.client.width)+"px";objDbBgFrame.style.height=Math.max(qcodo.page.height,qcodo.client.height)+"px";};var intWidth=objWrapper.offsetWidth;var intHeight=objWrapper.offsetHeight;var intTop=Math.round((qcodo.client.height-intHeight)/2)+qcodo.scroll.y;var intLeft=Math.round((qcodo.client.width-intWidth)/2)+qcodo.scroll.x;objWrapper.setAbsolutePosition(intLeft,intTop);window.onresize=this.handleResize;window.onscroll=this.handleResize;qcodo.activeDialogBox=this;if(objWrapper.anyKeyCloses){document.body.onkeypress=this.handleKeyPress;objWrapper.control.focus();};};objWrapper.hideDialogBox=function(){var objWrapper=this;if(this.id.indexOf("_ctldbbg")>0)
objWrapper=this.wrapper;objWrapper.dbBg.style.display="none";if(objWrapper.dbBgFrame)objWrapper.dbBgFrame.style.display="none";objWrapper.toggleDisplay("hide");window.onresize=null;window.onscroll=null;document.body.onkeypress=null;qcodo.activeDialogBox=null;};objWrapper.style.zIndex=999;objWrapper.position="absolute";objWrapper.anyKeyCloses=blnAnyKeyCloses;objDbBg.style.position="absolute";objDbBg.style.zIndex=998;objDbBg.style.top="0px";objDbBg.style.left="0px";if(qcodo.isBrowser(qcodo.IE))
objDbBg.style.overflow="auto";else
objDbBg.style.overflow="hidden";if(blnMatteClickable){objDbBg.style.cursor="pointer";objDbBg.onclick=objWrapper.hideDialogBox;}else{objDbBg.style.cursor="url("+qc.imageAssets+"/_core/move_nodrop.cur), auto";objDbBg.onclick=null;};objDbBg.style.backgroundColor=strMatteColor;if(qcodo.isBrowser(qcodo.IE))
objDbBg.style.filter="alpha(opacity="+intMatteOpacity+")";else
objDbBg.style.opacity=intMatteOpacity/100.0;objDbBg.style.fontSize="1px";objDbBg.innerHTML=" ";if(objWrapper.style.display=='none')
objWrapper.hideDialogBox();else
objWrapper.showDialogBox();};qc.regDB=qcodo.registerDialogBox;
