if(typeof (PHP2Controls)=="undefined"){PHP2Controls=new Object()}PHP2Controls.hWindow=function(B,E,D,C,A){this.wHandle=((B)?B:"aWindow");this.wTitleCaption=((E)?E:"System Messages");this.wCSSBaseClass=((D)?D:"aWindow");this.wContentElement=((C)?C:null);this.canClose=((A)?A:true)};PHP2Controls.AWindow=function(A){this.id=A.wHandle;this.wHandle=A.wHandle;this.wTitleCaption=A.wTitleCaption;this.wCSSBaseClass=A.wCSSBaseClass;this.wContentElement=A.wContentElement;this.canClose=A.canClose;if(!document.getElementById(this.id)){createWindowHtmlCode='<div id="'+this.id+'" class="aWindow"><div id="'+this.id+'_wHeader" class="wHeader"><span id="'+this.id+'_wTitle" class="wHText">Window Title</span><span class="rHButtons"><div id="'+this.id+'_wBtnHide" class="wBtnHide">&nbsp;</div><div id="'+this.id+'_wBtnClose" class="wBtnClose">&nbsp;</div></span></div><div id="'+this.id+'_wBody" class="wBody"></div></div>';document.body.insertAdjacentHTML("afterBegin",createWindowHtmlCode)}this.aWindow=document.getElementById(this.id);this.wHeader=document.getElementById(this.id+"_wHeader");this.wTitle=document.getElementById(this.id+"_wTitle");this.wBtnHide=document.getElementById(this.id+"_wBtnHide");this.wBtnClose=document.getElementById(this.id+"_wBtnClose");this.wBody=document.getElementById(this.id+"_wBody");this.aWindow.className=this.wCSSBaseClass;this.wBtnClose.currentWinObject=this;this.wBtnHide.currentWinObject=this;this.wHeader.currentWinObject=this;this.wBtnClose.onclick=function(){this.currentWinObject.close()};this.wBtnHide.onclick=function(){this.currentWinObject.hide()};this.wHeader.ondblclick=function(){this.currentWinObject.hide()};this.wTitle.innerHTML=this.wTitleCaption?this.wTitleCaption:"System Messages";if(this.wContentElement){this.attachContent(this.wContentElement)}this.protectFrameId=null};PHP2Controls.AWindow.prototype.close=function(){this.aWindow.style.display="none";if(this.protectFrameId&&(document.all.item(this.protectFrameId)!=null)){document.all.item(this.protectFrameId).style.display="none"}HTMLWindow.unsetDraggable(this.aWindow,this.wHeader)};PHP2Controls.AWindow.prototype.display=function(){this.aWindow.style.display="inline";this.protectFrameId=HTMLElement.protectIEDiv(this.id)};PHP2Controls.AWindow.prototype.hide=function(){if(typeof (this.wBody)==undefined){return true}headerHeight=this.wHeader.offsetHeight;this.wBody.style.display="none";this.aWindow.oldHeight=this.aWindow.height;this.wHeader.height=headerHeight+"px";this.aWindow.height=headerHeight+"px";this.wBtnHide.onclick=function(){this.currentWinObject.show()};this.wHeader.ondblclick=function(){this.currentWinObject.show()};this.protectFrameId=HTMLElement.protectIEDiv(this.id)};PHP2Controls.AWindow.prototype.show=function(){if(typeof (this.wBody)==undefined){return true}if(typeof (this.aWindow.oldHeight)!="undefined"){this.aWindow.height=this.aWindow.oldHeight}this.wBody.style.display="";this.wBtnHide.onclick=function(){this.currentWinObject.hide()};this.wHeader.ondblclick=function(){this.currentWinObject.hide()};this.protectFrameId=HTMLElement.protectIEDiv(this.id)};PHP2Controls.AWindow.prototype.initScreenPosition=function(){var B=(HTMLElement.getBrowserWidth()-HTMLElement.getWidth(this.id))/2;var A=(HTMLElement.getBrowserHeight()/2)-200;this.aWindow.style.left=((B>0)?B:"")+"px";this.aWindow.style.top=((A>0)?A:"")+"px";this.protectFrameId=HTMLElement.protectIEDiv(this.id)};PHP2Controls.AWindow.prototype.attachContent=function(D){var A=document.getElementById(D);if(A.parentNode==this.wBody){return true}this.wBody.innerHTML="";this.wBody.style.width=A.offsetWidth+"px";this.wBody.style.height=A.offsetHeight+"px";this.aWindow.style.height=this.wBody.offsetHeight+this.wHeader.offsetHeight+"px";this.aWindow.style.width=this.wBody.offsetWidth+"px";this.aWindow.style.left=HTMLElement.findPosX(A)+"px";this.aWindow.style.top=HTMLElement.findPosY(A)+"px";A.style.padding=0;A.style.margin=0;if(typeof (document.importNode)=="function"){var B=document.importNode(A,true);this.wBody.appendChild(B)}else{var C=(A.xml||A.outerHTML);this.wBody.innerHTML=C}A.parentNode.removeChild(A)};PHP2Controls.AWindow.prototype.onMove=function(){this.protectFrameId=HTMLElement.protectIEDiv(this.id)};PHP2Controls.AWindow.prototype.initDragAndDrop=function(){this.aWindow.onMove=this.onMove;HTMLWindow.setDraggable(this.aWindow,this.wHeader,null,false)};PHP2Controls.Alert=function(B){this.id="pageSystemAlert";this.hWindow=new PHP2Controls.hWindow(this.id,"System Messages","aAlertWindow",null,true);this.aWindowObject=new PHP2Controls.AWindow(this.hWindow);var A='<div id="'+this.id+'_wAlertBody" class="wAlertBody"><div id="'+this.id+'_wAlertMessageBody" class="wAlertMessageBody">'+B+'</div><div class="wAlertFooter"><center><input id="'+this.id+'_wBtnAClose" type="button" class="button" value="Ok" /></center></div></div>';this.aWindowObject.wBody.innerHTML=A;this.aWindowObject.wHeader.style.cursor="move";this.aWindowObject.display();this.aWindowObject.show();this.wBtnAClose=document.getElementById(this.id+"_wBtnAClose");this.wBtnAClose.currentWinObject=this.aWindowObject;this.wBtnAClose.onclick=function(){this.currentWinObject.close()};this.aWindowObject.initScreenPosition();this.aWindowObject.initDragAndDrop()};PHP2Controls.MessageBox=function(){};PHP2Controls.MessageBox.prototype.add=function(A){};PHP2Controls.MessageBox.prototype.clear=function(A){};PHP2Controls.MessageBox.prototype.show=function(A){};
