﻿function P(url,html,callbackFn,sOptions){this.url=aA(url)?url:'';this.html=aA(html)?html:'';this.callbackFn=callbackFn;this.title='';this.left=0;this.top=0;this.width=0;this.height=0;this.center=true;this.resize=bY.NONE;this.zoom=1.0;this.hasTitleBar=true;this.hasCloseBtn=true;this.hasExpandBtn=false;this.hasCollapseBtn=false;this.canDrag=true;this.autoWidth=false;this.autoHeight=false;this.autoHide=0;this.zOrder=0;this.zIndex=P.DefaultZIndex;this.titleAlign="left";this.parentElementId="";if(!aA(sOptions))sOptions="";var options=sOptions.split(';');for(var i=0;i<options.length;i++){var option=options[i].split(':');var key=option[0].trim().toLowerCase();if(key.isEmpty())continue;var value=option[1].trim();if(key!='title'&&key!='parentelementid')value=value.toLowerCase();if(key=='title')this.title=unescape(value);else if(key=='left'){this.left=parseInt(value);if(isNaN(this.left)||this.left<0)this.left=0;}else if(key=='top'){this.top=parseInt(value);if(isNaN(this.top)||this.top<0)this.top=0;}else if(key=='width'){this.width=parseInt(value);if(isNaN(this.width)||this.width<=0)this.width=P.DefaultWidth;}else if(key=='height'){this.height=parseInt(value);if(isNaN(this.height)||this.height<=0)this.height=P.DefaultHeight;}else if(key=='center')this.center=(value=='true'||value=='yes'||value=='1'||value=='on');else if(key=='resize'){if(value.indexOf('top')>=0)this.resize|=bY.TOP;if(value.indexOf('right')>=0)this.resize|=bY.RIGHT;if(value.indexOf('bottom')>=0)this.resize|=bY.BOTTOM;if(value.indexOf('left')>=0)this.resize|=bY.LEFT;if(value.indexOf('all')>=0)this.resize|=bY.ALL;}else if(key=='zoom'){this.zoom=parseFloat(value);if(isNaN(this.zoom)||this.zoom<0)this.zoom=1.0;}else if(key=='hastitlebar')this.hasTitleBar=(value=='true'||value=='yes'||value=='1'||value=='on');else if(key=='hasclosebtn')this.hasCloseBtn=(value=='true'||value=='yes'||value=='1'||value=='on');else if(key=='hasexpandbtn')this.hasExpandBtn=(value=='true'||value=='yes'||value=='1'||value=='on');else if(key=='hascollapsebtn')this.hasCollapseBtn=(value=='true'||value=='yes'||value=='1'||value=='on');else if(key=='candrag')this.canDrag=(value=='true'||value=='yes'||value=='1'||value=='on');else if(key=='autowidth')this.autoWidth=(value=='true'||value=='yes'||value=='1'||value=='on');else if(key=='autoheight')this.autoHeight=(value=='true'||value=='yes'||value=='1'||value=='on');else if(key=='autohide')this.autoHide=parseInt(value);else if(key=='zorder')this.zOrder=parseInt(value);else if(key=='zindex')this.zIndex=parseInt(value);else if(key=='titlealign'){if(value=='left'||value=='right')this.titleAlign=value;else if(value=='center')this.titleAlign="";}else if(key=='parentelementid')this.parentElementId=value;}this.id='';this.type='modal';this.parentElement=T(this.parentElementId);if(this.parentElement==null)this.parentElement=document.body;this.popupMaskId="popupMask";this.popupContainerId="popupContainer";this.popupTitleTableId="popupTitleTable";this.popupTitleBarId="popupTitleBar";this.popupTitleControlsId="popupTitleControls";this.popupCloseBoxId="popupCloseBox";this.popupFrameId="popupFrame";this.popupMask=null;this.popupContainer=null;this.popupTitleBar=null;this.popupFrame=null;this.init=function(type){this.id=P.nextId.toString();this.type=type.toLowerCase();P.dictionary.add(this.id,this);P.nextId++;var suffix='_'+this.id;this.popupMaskId+=suffix;this.popupContainerId+=suffix;this.popupTitleTableId+=suffix;this.popupTitleBarId+=suffix;this.popupTitleControlsId+=suffix;this.popupCloseBoxId+=suffix;this.popupFrameId+=suffix;if(this.type=='modal'||this.type=='popup'){this.popupMask=T(this.popupMaskId);if(this.popupMask==null){this.popupMask=document.createElement("div");this.popupMask.id=this.popupMaskId;this.popupMask.className='PopupWindowMask';this.popupMask.setAttribute("popupId",this.id);this.popupMask.style.zIndex=(this.zIndex+this.zOrder);eT(this.popupMask,'click',XO);this.parentElement.appendChild(this.popupMask);}}if(this.type=='modeless'){if((this.zIndex+this.zOrder)>P.maxModelessZIndex)P.maxModelessZIndex=(this.zIndex+this.zOrder);}this.popupContainer=T(this.popupContainerId);if(this.popupContainer==null){this.popupContainer=document.createElement("div");this.popupContainer.id=this.popupContainerId;this.popupContainer.className='PopupWindowContainer';this.popupContainer.setAttribute("popupId",this.id);if(this.resize!=0){this.popupContainer.className+="2";eT(this.popupContainer,'mousedown',Ya);eT(this.popupContainer,'mousemove',XZ);this.popupContainer.onmouseout=function(){this.style.cursor='';}}eT(this.popupContainer,'resize',Qx);this.popupContainer.style.zIndex=(this.zIndex+this.zOrder);this.parentElement.appendChild(this.popupContainer);var innerHTML="<table id='"+this.popupTitleTableId+"' border='0' cellpadding='0' cellspacing='0' "+" popupId='{0}' class='PopupWindowTitleTable' width='100%' style='height:{1}px;'>".format(this.id,P.TitleTableHeight)+"<tr popupId='{0}'>".format(this.id)+"<td popupId='{0}' style='width:100%; z-index:{1};' >".format(this.id,this.zIndex+this.zOrder)+"<div id='"+this.popupTitleBarId+"' class='PopupWindowTitleBar' {0} style='{1} z-index:{2}; text-align:{3}; ' popupId='{4}'> ".format(this.canDrag?"onmousedown='avx(event, \""+this.popupContainerId+"\")'":"",this.canDrag?"":"cursor:default;",(this.zIndex+this.zOrder),this.titleAlign,this.id)+"</div> "+"</td>"+"<td>"+"<div id='"+this.popupTitleControlsId+"' class='PopupWindowTitleControls' > "+"<img id='"+this.popupCloseBoxId+"'src='"+P.ImgSrc+"' onclick='dc("+this.id+");' /> "+"</div> "+"</td>"+"</tr>"+"</table>"+(this.html.isEmpty()?"<iframe id='"+this.popupFrameId+"' name='popupFrame' class='PopupWindowFrame' src='' "+"popupId='"+this.id+"'"+"style='z-index:{0};' ".format(this.zIndex+this.zOrder)+"scrolling='auto' frameborder='0' allowtransparency='true' > "+"</iframe> ":"<div id='"+this.popupFrameId+"' name='popupFrame' class='PopupWindowFrame' "+"popupId='"+this.id+"'"+"style='z-index:{0};' ".format(this.zIndex+this.zOrder)+">"+"</div>");this.popupContainer.innerHTML=innerHTML;}this.popupFrame=T(this.popupFrameId);if(this.html.isEmpty())this.popupFrame.src=url;else this.popupFrame.innerHTML=this.html;if(this.zoom!=1.0)this.popupFrame.style.zoom=this.zoom;if(this.type=='modeless')eT(this.popupFrame,'mousedown',avC);this.popupTitleBar=T(this.popupTitleTableId);this.popupTitleBar.style.display=this.hasTitleBar?"block":"none";if(this.hasTitleBar){T(this.popupCloseBoxId).style.display=this.hasCloseBtn?"block":"none";T(this.popupTitleBarId).innerHTML=this.title;}var popupContainer=this.popupContainer;popupContainer.style.left=this.left+"px";popupContainer.style.top=this.top+"px";if(this.autoWidth||this.autoHeight){popupContainer.style.visibility='hidden';}else{var offset=(this.popupContainer.offsetWidth-this.popupContainer.clientWidth);this.popupContainer.style.width=this.width+"px";this.popupContainer.style.height=this.height+"px";if(this.center)xy(this);}if(this.html.isEmpty()){eT(this.popupFrame,'load',Yb);}else{avD(this.popupFrame);}};this.getTitleTableHeight=function(){return(this.hasTitleBar?P.TitleTableHeight:0);};this.ShowModal=function(){this.init('modal');this.popupMask.style.display="block";this.popupContainer.style.display="block";if(this.popupContainer.style.visibility!='hidden')try{this.popupContainer.focus();}catch(e){}eT(window,"resize",xy);eT(window,"scroll",xy);};this.ShowModeless=function(){this.init('modeless');this.popupContainer.style.display="block";try{this.popupContainer.focus();}catch(e){}};this.ShowPopup=function(){this.init('popup');this.popupMask.style.display="none";this.popupContainer.style.display="block";try{this.popupContainer.focus();}catch(e){}};this.Show=function(){if(this.popupMask){this.popupMask.style.width=Ki()+"px";this.popupMask.style.height=Kh()+"px";if(this.type!="popup")this.popupMask.style.display="block";}this.popupContainer.style.display="block";try{this.popupContainer.focus();}catch(e){}};this.ShowMessageBox=function(message,icon,buttons,defaultButton){this.init('modal');if(!aA(icon))icon=cW.Information;if(!aA(buttons))buttons=cV.OK;if(!aA(defaultButton))defaultButton=JM.button1;var imgSrc=P.EssUrl;switch(icon){case cW.Success:imgSrc+="essPopupWindowCheck.gif";break;case cW.Stop:imgSrc+="essPopupWindowStop.gif";break;case cW.Question:imgSrc+="essPopupWindowQuestion.gif";break;case cW.Warning:imgSrc+="essPopupWindowWarning.gif";break;default:case cW.Information:imgSrc+="essPopupWindowInfo.gif";break;}var btnHtml1="<button id='button1' type='button' value='{1}' class='button' style='width:80px;' onclick='As(this, {0})' >{1}</button>";var btnHtml2=("<button id='button1' type='button' value='{1}' class='button' style='width:80px;' onclick='As(this, {0})'>{1}</button>"+"<span style='padding-left:10px;'></span>"+"<button id='button2' type='button' value='{2}' class='button' style='width:80px;' onclick='As(this, {0})'>{2}</button>");var btnHtml3=("<button id='button1' type='button' value='{1}' class='button' style='width:80px;' onclick='As(this, {0})'>{1}</button>"+"<span style='padding-left:10px;'></span>"+"<button id='button2' type='button' value='{2}' class='button' style='width:80px;' onclick='As(this, {0})'>{2}</button>"+"<span style='padding-left:10px;'></span>"+"<button id='button3' type='button' value='{3}' class='button' style='width:80px;' onclick='As(this, {0})'>{3}</button>");switch(buttons){case cV.OK:btnHtml=btnHtml1.format(this.id,"OK");break;case cV.OkCancel:btnHtml=btnHtml2.format(this.id,"OK","Cancel");break;case cV.YesNo:btnHtml=btnHtml2.format(this.id,"Yes","No");break;case cV.YesNoCancel:btnHtml=btnHtml3.format(this.id,"Yes","No","Cancel");break;case cV.RetryCancel:btnHtml=btnHtml2.format(this.id,"Retry","Cancel");break;case cV.AbortRetryIgnore:btnHtml=btnHtml3.format(this.id,"Abort","Retry","Ignore");break;}eT(this.popupContainer,'resize',XY);var width=parseInt(this.popupContainer.style.width)-2;var height=parseInt(this.popupContainer.style.height)-this.getTitleTableHeight()-2;var html=("<div id='divMessageBox_{0}' style='padding: 10px 10px 10px 10px;' >"+"<table id='tblMessageBox_{0}' border='0' cellpadding='0' cellspacing='5px' style='border: none;  width:100%; height:100%;' >"+"<tr>"+"<td id='tdImage_{0}' align='center' valign='middle' style='width: 35px;'>"+"<img alt='' src='{1}' />"+"</td>"+"<td id='tdMessage_{0}' align='left' style='overflow: auto; '>"+"<div id='divMessage_{0}' style='overflow: auto;'>{2}</div>"+"</td>"+"</tr>"+"<tr style='height:5px;'><td colspan='2'></td></tr>"+"<tr style='height:20px'>"+"<td>&nbsp;</td>"+"<td align='center' >"+"<div id='divButtons_{0}' defaultButton='{8}' style='white-space:nowrap; text-align:center; '>"+"<center>{3}</center>"+"</div>"+"</td>"+"</tr>"+"</table>"+"</div>").format(this.id,imgSrc,message,btnHtml,width,height,width-70,height-75,defaultButton);this.popupFrame.innerHTML=html;this.Show();setTimeout("avE('{0}')".format(defaultButton),1);};this.Move=function(left,top,width,height){this.popupContainer.style.left=(left+0.5)+"px";this.popupContainer.style.top=(top+0.5)+"px";if(width>0)this.popupContainer.style.width=(width+0.5)+"px";if(height>0)this.popupContainer.style.height=(height+0.5)+"px";};this.SetIFrameSrc=function(src){var popupFrame=T(this.popupFrameId);if(!aA(popupFrame))return;popupFrame.src=src;};this.SetTitleText=function(txt){var popupTitleBar=T(this.popupTitleBarId);if(!aA(popupTitleBar))return;popupTitleBar.innerHTML=txt;};this.GetTitleText=function(){var popupTitleBar=T(this.popupTitleBarId);if(!aA(popupTitleBar))return "";return popupTitleBar.innerHTML;};this.GetBounds=function(){var rect=new XS();if(aA(this.popupContainer)){rect.left=this.popupContainer.offsetLeft;rect.top=this.popupContainer.offsetTop;var width=this.popupContainer.offsetWidth;if(width==0)width=parseInt(this.popupContainer.style.width);if(isNaN(width))width=0;rect.width=width;var height=this.popupContainer.offsetHeight;if(height==0)height=parseInt(this.popupContainer.style.height);if(isNaN(height))height=0;rect.height=height;}return rect;};this.GetZOrder=function(){if(this.type!='modeless')return 0;XQ();return this.zOrder;};this.GetZoomFactor=function(){return this.zoom;};this.SetZoomFactor=function(zoomFactor){if(!aA(zoomFactor))zoomFactor=1.0;if(isNaN(zoomFactor)||zoomFactor<0.0)zoomFactor=1.0;this.zoom=zoomFactor;var evnt=new Object();evnt.srcElement=this.popupContainer;this.popupFrame.style.zoom=zoomFactor;Qx(evnt)};this.Close=function(){dc(this.id);}};function ON(){};ON.Modal="modal";ON.Modeless="modeless";ON.Popup="popup";P.AppUrl="";P.EssUrl="";P.ImgSrc="App_Share/Scripts/essPopupWindowClose2.gif";P.nextId=0;P.dictionary=new alH();P.TitleTableHeight=20;P.gripSize=22;P.DefaultZIndex=5000;P.DefaultWidth=200;P.DefaultHeight=200;P.maxModelessZIndex=0;P.Init=function(bM,yc){P.AppUrl=bM;if(!P.AppUrl.endsWith("/"))P.AppUrl+="/";P.EssUrl=P.AppUrl+yc;if(!P.EssUrl.endsWith("/"))P.EssUrl+="/";P.ImgSrc=P.AppUrl+P.ImgSrc;};P.GetPopupWindowById=function(popupWindowId){return P.dictionary.getValue(popupWindowId);};P.GetPopupWindowByChildId=function(popupChildId){if(!aA(popupChildId))return null;if(popupChildId.search(/_(\d*)/gi)<0)return null;var popupWindowId=RegExp.$1;return P.dictionary.getValue(popupWindowId);};P.ShowModal=function aBv(url,html,callbackFn,sOptions){var popupWindow=new P(url,html,callbackFn,sOptions);popupWindow.ShowModal();return popupWindow;};P.ShowModalAbsolute=function aBS(url,html,callbackFn,sOptions){url=this.AppUrl+url;var popupWindow=new P(url,html,callbackFn,sOptions);popupWindow.ShowModal();return popupWindow;};P.ShowModeless=function aBR(url,html,callbackFn,sOptions){var popupWindow=new P(url,html,callbackFn,sOptions);popupWindow.ShowModeless();return popupWindow;};P.ShowPopup=function aBU(url,html,callbackFn,sOptions){var popupWindow=new P(url,html,callbackFn,sOptions);popupWindow.ShowPopup();return popupWindow;};function cW(){};cW.Success=0x01;cW.Stop=0x02;cW.Question=0x03;cW.Warning=0x04;cW.Information=0x05;function cV(){};cV.OK=0x01;cV.OkCancel=0x02;cV.YesNo=0x03;cV.YesNoCancel=0x04;cV.RetryCancel=0x05;cV.AbortRetryIgnore=0x0006;function JM(){};JM.button1="button1";JM.button2="button2";JM.button3="button3";P.ShowMessageBox=function aAY(message,icon,buttons,callbackFn,sOptions){var popupWindow=new P("","<div></div>",callbackFn,sOptions);popupWindow.autoWidth=false;popupWindow.autoHeight=false;popupWindow.ShowMessageBox(message,icon,buttons);return popupWindow;};function As(button,popupWindowId){dc(popupWindowId,button.id);};function XY(evnt){var popupContainer=evnt.srcElement;var popupWindow=P.GetPopupWindowByChildId(popupContainer.id);var width=parseInt(popupContainer.style.width)-2;var height=parseInt(popupContainer.style.height)-popupWindow.getTitleTableHeight()-2;var divMessageBox=T("divMessageBox_{0}".format(popupWindow.id));divMessageBox.style.width=width;divMessageBox.style.height=height;var divMessage=T("divMessage_{0}".format(popupWindow.id));divMessage.style.width=width-70;divMessage.style.height=height-75;};function avE(defaultButtonId){try{var defaultButton=T(defaultButtonId);if(defaultButton)try{defaultButton.focus();}catch(e){}}catch(e){}};function xy(popupWindow){if(aA(popupWindow.cancelBubble)||aA(popupWindow.bubbles))popupWindow=null;if(!aA(popupWindow)){for(var key in P.dictionary.Obj){if(P.dictionary.Obj[key].type=='modal'){popupWindow=P.dictionary.Obj[key];XV(popupWindow);}}}else XV(popupWindow);};function XV(popupWindow){if(aA(popupWindow.cancelBubble)||aA(popupWindow.bubbles))popupWindow=null;if(!aA(popupWindow))return;avy(popupWindow);var titleBarHeight=parseInt(T(popupWindow.popupTitleBarId).offsetHeight,10);var fullWidth=avJ();var fullHeight=avK();var scrollLeft=avF();var scrollTop=avI();var width=parseInt(popupWindow.popupContainer.style.width);if(isNaN(width))width=popupWindow.popupContainer.offsetWidth;var height=parseInt(popupWindow.popupContainer.style.height);if(isNaN(height))height=popupWindow.popupContainer.offsetHeight;popupWindow.popupContainer.style.left=(scrollLeft+((fullWidth-width)/2))+"px";popupWindow.popupContainer.style.top=(scrollTop+((fullHeight-(height+titleBarHeight))/2))+"px";};function avy(modalPopup){if(modalPopup==null)return;if(modalPopup.popupMask==null)return;modalPopup.popupMask.style.width=Ki()+"px";modalPopup.popupMask.style.height=Kh()+"px";};function dc(popupWindowId,params){var popupWindow=P.dictionary.getValue(popupWindowId);if(!aA(popupWindow))return;var bOK=true;if(aA(popupWindow.callbackFn)){bOK=popupWindow.callbackFn(popupWindowId,params);if(!aA(bOK))bOK=true;}if(!bOK)return;var popupMask=T(popupWindow.popupMaskId);if(popupMask!=null){popupWindow.parentElement.removeChild(popupMask);ka(popupMask,'click',XO);popupMask=null;}var popupContainer=T(popupWindow.popupContainerId);if(popupContainer!=null){popupWindow.parentElement.removeChild(popupContainer);ka(popupContainer,'mousemove',XZ);ka(popupContainer,'mousedown',Ya);ka(popupContainer,'resize',Qx);ka(popupContainer,'resize',XY);popupContainer=null;}P.dictionary.remove(popupWindowId);ka(window,"resize",xy);ka(window,"scroll",xy);var doc=null;for(var key in P.dictionary.Obj){if(P.dictionary.Obj[key].type=='modal'){var popupWindow=P.dictionary.Obj[key];try{doc=popupWindow.popupFrame.contentWindow.document;}catch(e){}break;}}if(!doc)doc=document;var inputElements=new Array(doc.getElementsByTagName("input"),doc.getElementsByTagName("textarea"));var bOK=false;for(var i=0;i<inputElements.length&& !bOK;i++){for(var j=0;j<inputElements[i].length;j++){var input=inputElements[i][j];if(input.disabled==false&&input.style.visibility!="none"&&input.style.display!="none"&&(input.type=="text"||input.type=="textarea")){try{input.focus();input.blur();bOK=true;break;}catch(e){}}}}};function Qv(popupWindowId,params){var popupWindow=P.dictionary.getValue(popupWindowId);if(!aA(popupWindow))return;if(aA(popupWindow.callbackFn))popupWindow.callbackFn(params);var popupMask=T(popupWindow.popupMaskId);if(popupMask!=null)popupMask.style.display='none';var popupContainer=T(popupWindow.popupContainerId);if(popupContainer!=null)popupContainer.style.display='none';};function Yb(){var F=document.domain.split(".");if(F.length>2&& !(F.length==4&&isNaN(parseInt(F[3]))==false))document.domain=F[F.length-2]+"."+F[F.length-1];var evnt=arguments[0];var popupFrame=evnt.srcElement;var popupWindowId=popupFrame.getAttribute('popupId');var popupWindow=P.dictionary.getValue(popupWindowId);if(!aA(popupWindow))return;var popupContainer=popupWindow.popupContainer;if(!aA(popupContainer))return;if(popupWindow.autoHide>0){setTimeout(function(){dc(popupWindowId);},popupWindow.autoHide);}var popupContainerWidth=0;var popupContainerHeight=0;var childDocument=null;try{childDocument=popupFrame.contentWindow.document;if(popupWindow.autoWidth||popupWindow.autoHeight){if(popupWindow.autoWidth){var currSibling=childDocument.body.firstChild;while(currSibling!=null){popupContainerWidth=Math.max(popupContainerWidth,currSibling.offsetWidth)+10;currSibling=currSibling.nextSibling;}}if(popupContainerWidth==0||popupContainerWidth>popupWindow.width)popupContainerWidth=popupWindow.width;if(popupContainerWidth>0)popupContainer.style.width=popupContainerWidth;if(popupWindow.autoHeight){if(popupContainerWidth>0)childDocument.body.width=popupContainerWidth;if(aA(popupFrame.Document)&&aA(popupFrame.Document.body.scrollHeight)){var popupFrameHeight=parseInt(childDocument.body.scrollHeight);popupContainerHeight=popupFrameHeight+(popupContainer.clientHeight-popupFrame.clientHeight)+popupWindow.getTitleTableHeight();}else if(aA(popupFrame.contentDocument)&&aA(popupFrame.contentDocument.body.offsetHeight)){var popupFrameHeight=popupFrame.contentDocument.body.offsetHeight+20;popupContainerHeight=popupFrameHeight+(popupContainer.clientHeight-popupFrame.clientHeight)+popupWindow.getTitleTableHeight();}}else popupContainerHeight=popupWindow.height;if(popupContainerHeight>0)popupContainer.style.height=popupContainerHeight;popupWindow.popupContainer.style.visibility='';if(popupWindow.type=='modal')xy(popupWindow);}}catch(ex){popupContainer.style.width=popupWindow.width;popupContainer.style.height=popupWindow.height;popupWindow.popupContainer.style.visibility='';if(popupWindow.type=='modal')xy(popupWindow);}ka(popupFrame,'load',Yb);try{var doc=childDocument;var inputElements=new Array(doc.getElementsByTagName("input"),doc.getElementsByTagName("textarea"));var bOK=false;for(var i=0;i<inputElements.length&& !bOK;i++){for(var j=0;j<inputElements[i].length;j++){var input=inputElements[i][j];if(input.disabled==false&&input.style.visibility!="none"&&input.style.display!="none"&&(input.type=="text"||input.type=="textarea")){try{input.focus();input.blur();bOK=true;break;}catch(e){}}}}}catch(e){}};function avD(popupFrame){var popupWindowId=popupFrame.getAttribute('popupId');var popupWindow=P.dictionary.getValue(popupWindowId);var popupContainer=popupWindow.popupContainer;if(popupWindow.autoHide>0){setTimeout(function(){dc(popupWindowId);},popupWindow.autoHide);}};function XO(evnt){var popupMask=evnt.srcElement;if(!aA(popupMask))return;var popupWindowId=popupMask.getAttribute("popupId");var popupWindow=P.dictionary.getValue(popupWindowId);if(!aA(popupWindow))return;if(popupWindow.type=='modal'){var popupTitle=T(popupWindow.popupTitleTableId);setTimeout("XD('{0}','{1}','{2}',{3})".format(popupWindow.popupTitleTableId,"PopupWindowTitleTable","PopupWindowTitleTable2",0),1);}else if(popupWindow.type=='popup'){Qv(popupWindowId);}};function avz(popupTitleId,oldBgColor,newBgColor,blinkCount){var popupTitle=T(popupTitleId);if(popupTitle==null)return;if(blinkCount<3){popupTitle.style.backgroundColor=(blinkCount%2==0)?newBgColor:oldBgColor;setTimeout("avz('{0}', '{1}', '{2}', {3})".format(popupTitleId,oldBgColor,newBgColor,++blinkCount),200);}else popupTitle.style.backgroundColor=oldBgColor;};function XD(popupTitleId,oldClassName,newClassName,blinkCount){var popupTitle=T(popupTitleId);if(popupTitle==null)return;if(blinkCount<3){popupTitle.className=(blinkCount%2==0)?newClassName:oldClassName;setTimeout("XD('{0}', '{1}', '{2}', {3})".format(popupTitleId,oldClassName,newClassName,++blinkCount),200);}else popupTitle.className=oldClassName;};function XZ(evnt){var popupContainer=evnt.srcElement;if(!popupContainer.id.startsWith("popupContainer"))return;var popupWindowId=popupContainer.getAttribute("popupId");var popupWindow=P.dictionary.getValue(popupWindowId);if(!aA(popupWindow))return;var cursor='';var canLeftResize=((popupWindow.resize&bY.LEFT)!=0);var canTopResize=((popupWindow.resize&bY.TOP)!=0);var canRightResize=((popupWindow.resize&bY.RIGHT)!=0);var canBottomResize=((popupWindow.resize&bY.BOTTOM)!=0);if(evnt.offsetX<P.gripSize){if(canLeftResize){cursor='e-resize';if(canTopResize&&(evnt.offsetY<P.gripSize))cursor='nw-resize';else if(canBottomResize&&(evnt.offsetY>popupContainer.offsetHeight-P.gripSize))cursor='ne-resize';}}else if(evnt.offsetX>popupContainer.offsetWidth-P.gripSize){if(canRightResize){cursor='e-resize';if(canTopResize&&(evnt.offsetY<P.gripSize))cursor='ne-resize';else if(canBottomResize&&(evnt.offsetY>popupContainer.offsetHeight-P.gripSize))cursor='nw-resize';}}else{if(canTopResize&&(evnt.offsetY<P.gripSize))cursor='n-resize';else if(canBottomResize&&(evnt.offsetY>popupContainer.offsetHeight-P.gripSize))cursor='n-resize';}if(!cursor.isEmpty())popupContainer.style.cursor=cursor;};function Ya(evnt){var popupContainer=evnt.srcElement;if(!popupContainer.id.startsWith("popupContainer"))return;var popupWindowId=popupContainer.getAttribute("popupId");var popupWindow=P.dictionary.getValue(popupWindowId);if(!aA(popupWindow))return;if(popupWindow.type=='modeless')Lh(popupWindow);var direction=0;var canLeftResize=((popupWindow.resize&bY.LEFT)!=0);var canTopResize=((popupWindow.resize&bY.TOP)!=0);var canRightResize=((popupWindow.resize&bY.RIGHT)!=0);var canBottomResize=((popupWindow.resize&bY.BOTTOM)!=0);if(evnt.offsetX<P.gripSize){if(canLeftResize){direction=bY.LEFT;if(canTopResize&&(evnt.offsetY<P.gripSize))direction=bY.LEFTTOP;else if(canBottomResize&&(evnt.offsetY>popupContainer.offsetHeight-P.gripSize))direction=bY.LEFTBOTTOM;}}else if(evnt.offsetX>popupContainer.offsetWidth-P.gripSize){if(canRightResize){direction=bY.RIGHT;if(canTopResize&&(evnt.offsetY<P.gripSize))direction=bY.RIGHTTOP;else if(canBottomResize&&(evnt.offsetY>popupContainer.offsetHeight-P.gripSize))direction=bY.RIGHTBOTTOM;}}else{if(canTopResize&&(evnt.offsetY<P.gripSize))direction=bY.TOP;else if(canBottomResize&&(evnt.offsetY>popupContainer.offsetHeight-P.gripSize))direction=bY.BOTTOM;}if(direction!=0){var minWidth=0;var minHeight=0;minWidth=minHeight=2*P.TitleTableHeight;bY.Start(evnt,popupContainer.id,direction,false,minWidth,minHeight);}};function Qx(evnt){var popupContainer=evnt.srcElement;if(!popupContainer.id.startsWith("popupContainer"))return;var popupWindowId=popupContainer.getAttribute("popupId");var popupWindow=P.dictionary.getValue(popupWindowId);if(!aA(popupWindow))return;var popupFrame=T(popupWindow.popupFrameId);if(!aA(popupFrame))return;var offset=(popupContainer.offsetWidth-popupContainer.clientWidth);if(popupContainer.style.width.isNotEmpty()){var popupFrameWidth=parseInt(popupContainer.style.width);popupFrameWidth-=offset;if(popupFrameWidth<0)popupFrameWidth=0;if(popupWindow.zoom>0)popupFrameWidth=popupFrameWidth*(1/popupWindow.zoom);popupFrame.style.width=popupFrameWidth+"px";}if(popupContainer.style.height.isNotEmpty()){var popupFrameHeight=parseInt(popupContainer.style.height)-popupWindow.getTitleTableHeight();popupFrameHeight-=offset;if(popupFrameHeight<0)popupFrameHeight=0;if(popupWindow.zoom>0)popupFrameHeight=popupFrameHeight*(1/popupWindow.zoom);popupFrame.style.height=popupFrameHeight+"px";}};function avx(evnt,popupContainerId){if(!aA(popupContainerId))return;var popupWindow=P.GetPopupWindowByChildId(popupContainerId);if(popupWindow==null)return;if(popupWindow.type=='modeless')Lh(popupWindow);if(evnt.button==1)kE.Start(evnt,popupContainerId,false,avs);};function avs(evnt,popupContainerId){if(!aA(popupContainerId))return;popupContainer=T(popupContainerId);if(!popupContainer.id.startsWith("popupContainer"))return;var popupWindowId=popupContainer.getAttribute("popupId");var popupWindow=P.GetPopupWindowById(popupWindowId);if(!aA(popupWindow))return;popupWindow.left=popupContainer.offsetLeft;popupWindow.top=popupContainer.offsetTop;popupWindow.width=popupContainer.offsetWidth;popupWindow.height=popupContainer.offsetHeight;};function avC(evnt){var popupFrame=evnt.srcElement;var popupWindow=P.GetPopupWindowByChildId(popupFrame.id);if(!aA(popupWindow))return;if(popupWindow.type=='modeless')Lh(popupWindow);};function Lh(currPopupWindow){if(currPopupWindow==null)return;if(currPopupWindow.type!='modeless')return;P.maxModelessZIndex++;currPopupWindow.popupContainer.style.zIndex=P.maxModelessZIndex;currPopupWindow.popupTitleBar.style.zIndex=P.maxModelessZIndex;currPopupWindow.popupFrame.style.zIndex=P.maxModelessZIndex;XQ();};function XQ(){var arrZIndex=new Array();for(var key in P.dictionary.Obj){var popupWindow=P.dictionary.Obj[key];if(popupWindow.type!='modeless')continue;arrZIndex[arrZIndex.length]=popupWindow.popupContainer.style.zIndex;}arrZIndex.sort();P.maxModelessZIndex=0;for(var key in P.dictionary.Obj){var popupWindow=P.dictionary.Obj[key];if(popupWindow.type!='modeless')continue;var zOrder=Array.binarySearch(arrZIndex,Array.orderAscending,popupWindow.popupContainer.style.zIndex)+1;var zIndex=popupWindow.zIndex+zOrder;if(zIndex>P.maxModelessZIndex)P.maxModelessZIndex=zIndex;popupWindow.zOrder=zOrder;popupWindow.popupContainer.style.zIndex=zIndex;popupWindow.popupTitleBar.style.zIndex=zIndex;popupWindow.popupFrame.style.zIndex=zIndex;}};P.RemoveAll=function(){for(var key in P.dictionary.Obj){popupWindow=P.dictionary.Obj[key];dc(popupWindow.id);}};P.GetMaxZOrder=function(){var maxZOrder=0;for(var key in P.dictionary.Obj){popupWindow=P.dictionary.Obj[key];if(popupWindow.type!='modeless')continue;maxZOrder++;}return maxZOrder;}
