﻿function O(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=ba.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=O.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=O.DefaultWidth;}else if(key=='height'){this.height=parseInt(value);if(isNaN(this.height)||this.height<=0)this.height=O.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|=ba.TOP;if(value.indexOf('right')>=0)this.resize|=ba.RIGHT;if(value.indexOf('bottom')>=0)this.resize|=ba.BOTTOM;if(value.indexOf('left')>=0)this.resize|=ba.LEFT;if(value.indexOf('all')>=0)this.resize|=ba.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=O.nextId.toString();this.type=type.toLowerCase();O.dictionary.add(this.id,this);O.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);dD(this.popupMask,'click',ZU);this.parentElement.appendChild(this.popupMask);}}if(this.type=='modeless'){if((this.zIndex+this.zOrder)>O.maxModelessZIndex)O.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";dD(this.popupContainer,'mousedown',aaf);dD(this.popupContainer,'mousemove',aac);this.popupContainer.onmouseout=function(){this.style.cursor='';}}dD(this.popupContainer,'resize',OO);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,O.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='ahK(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='"+O.ImgSrc+"' onclick='bJ("+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')dD(this.popupFrame,'mousedown',aio);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)xl(this);}if(this.html.isEmpty()){dD(this.popupFrame,'load',aae);}else{ais(this.popupFrame);}};this.getTitleTableHeight=function(){return(this.hasTitleBar?O.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){}dD(window,"resize",xl);dD(window,"scroll",xl);};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=IF()+"px";this.popupMask.style.height=IE()+"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=bz.Information;if(!aa(buttons))buttons=bA.OK;if(!aa(defaultButton))defaultButton=HU.button1;var imgSrc=O.EssUrl;switch(icon){case bz.Success:imgSrc+="essPopupWindowCheck.gif";break;case bz.Stop:imgSrc+="essPopupWindowStop.gif";break;case bz.Question:imgSrc+="essPopupWindowQuestion.gif";break;case bz.Warning:imgSrc+="essPopupWindowWarning.gif";break;default:case bz.Information:imgSrc+="essPopupWindowInfo.gif";break;}var btnHtml1="<button id='button1' type='button' value='{1}' class='button' style='width:80px;' onclick='yP(this, {0})' >{1}</button>";var btnHtml2=("<button id='button1' type='button' value='{1}' class='button' style='width:80px;' onclick='yP(this, {0})'>{1}</button>"+"<span style='padding-left:10px;'></span>"+"<button id='button2' type='button' value='{2}' class='button' style='width:80px;' onclick='yP(this, {0})'>{2}</button>");var btnHtml3=("<button id='button1' type='button' value='{1}' class='button' style='width:80px;' onclick='yP(this, {0})'>{1}</button>"+"<span style='padding-left:10px;'></span>"+"<button id='button2' type='button' value='{2}' class='button' style='width:80px;' onclick='yP(this, {0})'>{2}</button>"+"<span style='padding-left:10px;'></span>"+"<button id='button3' type='button' value='{3}' class='button' style='width:80px;' onclick='yP(this, {0})'>{3}</button>");switch(buttons){case bA.OK:btnHtml=btnHtml1.format(this.id,"OK");break;case bA.OkCancel:btnHtml=btnHtml2.format(this.id,"OK","Cancel");break;case bA.YesNo:btnHtml=btnHtml2.format(this.id,"Yes","No");break;case bA.YesNoCancel:btnHtml=btnHtml3.format(this.id,"Yes","No","Cancel");break;case bA.RetryCancel:btnHtml=btnHtml2.format(this.id,"Retry","Cancel");break;case bA.AbortRetryIgnore:btnHtml=btnHtml3.format(this.id,"Abort","Retry","Ignore");break;}dD(this.popupContainer,'resize',aab);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("aip('{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 Zr();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;Za();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;OO(evnt)};this.Close=function(){bJ(this.id);}};function NU(){};NU.Modal="modal";NU.Modeless="modeless";NU.Popup="popup";O.AppUrl="";O.EssUrl="";O.ImgSrc="App_Share/Scripts/essPopupWindowClose2.gif";O.nextId=0;O.dictionary=new ahG();O.TitleTableHeight=20;O.gripSize=22;O.DefaultZIndex=5000;O.DefaultWidth=200;O.DefaultHeight=200;O.maxModelessZIndex=0;O.Init=function(aO,wc){O.AppUrl=aO;if(!O.AppUrl.endsWith("/"))O.AppUrl+="/";O.EssUrl=O.AppUrl+wc;if(!O.EssUrl.endsWith("/"))O.EssUrl+="/";O.ImgSrc=O.AppUrl+O.ImgSrc;};O.GetPopupWindowById=function(popupWindowId){return O.dictionary.getValue(popupWindowId);};O.GetPopupWindowByChildId=function(popupChildId){if(!aa(popupChildId))return null;if(popupChildId.search(/_(\d*)/gi)<0)return null;var popupWindowId=RegExp.$1;return O.dictionary.getValue(popupWindowId);};O.ShowModal=function avg(url,html,callbackFn,sOptions){var popupWindow=new O(url,html,callbackFn,sOptions);popupWindow.ShowModal();return popupWindow;};O.ShowModalAbsolute=function avk(url,html,callbackFn,sOptions){url=this.AppUrl+url;var popupWindow=new O(url,html,callbackFn,sOptions);popupWindow.ShowModal();return popupWindow;};O.ShowModeless=function awg(url,html,callbackFn,sOptions){var popupWindow=new O(url,html,callbackFn,sOptions);popupWindow.ShowModeless();return popupWindow;};O.ShowPopup=function awh(url,html,callbackFn,sOptions){var popupWindow=new O(url,html,callbackFn,sOptions);popupWindow.ShowPopup();return popupWindow;};function bz(){};bz.Success=0x01;bz.Stop=0x02;bz.Question=0x03;bz.Warning=0x04;bz.Information=0x05;function bA(){};bA.OK=0x01;bA.OkCancel=0x02;bA.YesNo=0x03;bA.YesNoCancel=0x04;bA.RetryCancel=0x05;bA.AbortRetryIgnore=0x0006;function HU(){};HU.button1="button1";HU.button2="button2";HU.button3="button3";O.ShowMessageBox=function avh(message,icon,buttons,callbackFn,sOptions){var popupWindow=new O("","<div></div>",callbackFn,sOptions);popupWindow.autoWidth=false;popupWindow.autoHeight=false;popupWindow.ShowMessageBox(message,icon,buttons);return popupWindow;};function yP(button,popupWindowId){bJ(popupWindowId,button.id);};function aab(evnt){var popupContainer=evnt.srcElement;var popupWindow=O.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 aip(defaultButtonId){try{var defaultButton=T(defaultButtonId);if(defaultButton)try{defaultButton.focus();}catch(e){}}catch(e){}};function xl(popupWindow){if(aa(popupWindow.cancelBubble)||aa(popupWindow.bubbles))popupWindow=null;if(!aa(popupWindow)){for(var key in O.dictionary.Obj){if(O.dictionary.Obj[key].type=='modal'){popupWindow=O.dictionary.Obj[key];Zy(popupWindow);}}}else Zy(popupWindow);};function Zy(popupWindow){if(aa(popupWindow.cancelBubble)||aa(popupWindow.bubbles))popupWindow=null;if(!aa(popupWindow))return;aii(popupWindow);var titleBarHeight=parseInt(T(popupWindow.popupTitleBarId).offsetHeight,10);var fullWidth=aiF();var fullHeight=aiE();var scrollLeft=aiI();var scrollTop=aiH();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 aii(modalPopup){if(modalPopup==null)return;if(modalPopup.popupMask==null)return;modalPopup.popupMask.style.width=IF()+"px";modalPopup.popupMask.style.height=IE()+"px";};function bJ(popupWindowId,params){var popupWindow=O.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);iy(popupMask,'click',ZU);popupMask=null;}var popupContainer=T(popupWindow.popupContainerId);if(popupContainer!=null){popupWindow.parentElement.removeChild(popupContainer);iy(popupContainer,'mousemove',aac);iy(popupContainer,'mousedown',aaf);iy(popupContainer,'resize',OO);iy(popupContainer,'resize',aab);popupContainer=null;}O.dictionary.remove(popupWindowId);iy(window,"resize",xl);iy(window,"scroll",xl);var doc=null;for(var key in O.dictionary.Obj){if(O.dictionary.Obj[key].type=='modal'){var popupWindow=O.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 OB(popupWindowId,params){var popupWindow=O.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 aae(){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=O.dictionary.getValue(popupWindowId);if(!aa(popupWindow))return;var popupContainer=popupWindow.popupContainer;if(!aa(popupContainer))return;if(popupWindow.autoHide>0){setTimeout(function(){bJ(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')xl(popupWindow);}}catch(ex){popupContainer.style.width=popupWindow.width;popupContainer.style.height=popupWindow.height;popupWindow.popupContainer.style.visibility='';if(popupWindow.type=='modal')xl(popupWindow);}iy(popupFrame,'load',aae);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 ais(popupFrame){var popupWindowId=popupFrame.getAttribute('popupId');var popupWindow=O.dictionary.getValue(popupWindowId);var popupContainer=popupWindow.popupContainer;if(popupWindow.autoHide>0){setTimeout(function(){bJ(popupWindowId);},popupWindow.autoHide);}};function ZU(evnt){var popupMask=evnt.srcElement;if(!aa(popupMask))return;var popupWindowId=popupMask.getAttribute("popupId");var popupWindow=O.dictionary.getValue(popupWindowId);if(!aa(popupWindow))return;if(popupWindow.type=='modal'){var popupTitle=T(popupWindow.popupTitleTableId);setTimeout("ZG('{0}','{1}','{2}',{3})".format(popupWindow.popupTitleTableId,"PopupWindowTitleTable","PopupWindowTitleTable2",0),1);}else if(popupWindow.type=='popup'){OB(popupWindowId);}};function aih(popupTitleId,oldBgColor,newBgColor,blinkCount){var popupTitle=T(popupTitleId);if(popupTitle==null)return;if(blinkCount<3){popupTitle.style.backgroundColor=(blinkCount%2==0)?newBgColor:oldBgColor;setTimeout("aih('{0}', '{1}', '{2}', {3})".format(popupTitleId,oldBgColor,newBgColor,++blinkCount),200);}else popupTitle.style.backgroundColor=oldBgColor;};function ZG(popupTitleId,oldClassName,newClassName,blinkCount){var popupTitle=T(popupTitleId);if(popupTitle==null)return;if(blinkCount<3){popupTitle.className=(blinkCount%2==0)?newClassName:oldClassName;setTimeout("ZG('{0}', '{1}', '{2}', {3})".format(popupTitleId,oldClassName,newClassName,++blinkCount),200);}else popupTitle.className=oldClassName;};function aac(evnt){var popupContainer=evnt.srcElement;if(!popupContainer.id.startsWith("popupContainer"))return;var popupWindowId=popupContainer.getAttribute("popupId");var popupWindow=O.dictionary.getValue(popupWindowId);if(!aa(popupWindow))return;var cursor='';var canLeftResize=((popupWindow.resize&ba.LEFT)!=0);var canTopResize=((popupWindow.resize&ba.TOP)!=0);var canRightResize=((popupWindow.resize&ba.RIGHT)!=0);var canBottomResize=((popupWindow.resize&ba.BOTTOM)!=0);if(evnt.offsetX<O.gripSize){if(canLeftResize){cursor='e-resize';if(canTopResize&&(evnt.offsetY<O.gripSize))cursor='nw-resize';else if(canBottomResize&&(evnt.offsetY>popupContainer.offsetHeight-O.gripSize))cursor='ne-resize';}}else if(evnt.offsetX>popupContainer.offsetWidth-O.gripSize){if(canRightResize){cursor='e-resize';if(canTopResize&&(evnt.offsetY<O.gripSize))cursor='ne-resize';else if(canBottomResize&&(evnt.offsetY>popupContainer.offsetHeight-O.gripSize))cursor='nw-resize';}}else{if(canTopResize&&(evnt.offsetY<O.gripSize))cursor='n-resize';else if(canBottomResize&&(evnt.offsetY>popupContainer.offsetHeight-O.gripSize))cursor='n-resize';}if(!cursor.isEmpty())popupContainer.style.cursor=cursor;};function aaf(evnt){var popupContainer=evnt.srcElement;if(!popupContainer.id.startsWith("popupContainer"))return;var popupWindowId=popupContainer.getAttribute("popupId");var popupWindow=O.dictionary.getValue(popupWindowId);if(!aa(popupWindow))return;if(popupWindow.type=='modeless')Iq(popupWindow);var direction=0;var canLeftResize=((popupWindow.resize&ba.LEFT)!=0);var canTopResize=((popupWindow.resize&ba.TOP)!=0);var canRightResize=((popupWindow.resize&ba.RIGHT)!=0);var canBottomResize=((popupWindow.resize&ba.BOTTOM)!=0);if(evnt.offsetX<O.gripSize){if(canLeftResize){direction=ba.LEFT;if(canTopResize&&(evnt.offsetY<O.gripSize))direction=ba.LEFTTOP;else if(canBottomResize&&(evnt.offsetY>popupContainer.offsetHeight-O.gripSize))direction=ba.LEFTBOTTOM;}}else if(evnt.offsetX>popupContainer.offsetWidth-O.gripSize){if(canRightResize){direction=ba.RIGHT;if(canTopResize&&(evnt.offsetY<O.gripSize))direction=ba.RIGHTTOP;else if(canBottomResize&&(evnt.offsetY>popupContainer.offsetHeight-O.gripSize))direction=ba.RIGHTBOTTOM;}}else{if(canTopResize&&(evnt.offsetY<O.gripSize))direction=ba.TOP;else if(canBottomResize&&(evnt.offsetY>popupContainer.offsetHeight-O.gripSize))direction=ba.BOTTOM;}if(direction!=0){var minWidth=0;var minHeight=0;minWidth=minHeight=2*O.TitleTableHeight;ba.Start(evnt,popupContainer.id,direction,false,minWidth,minHeight);}};function OO(evnt){var popupContainer=evnt.srcElement;if(!popupContainer.id.startsWith("popupContainer"))return;var popupWindowId=popupContainer.getAttribute("popupId");var popupWindow=O.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 ahK(evnt,popupContainerId){if(!aa(popupContainerId))return;var popupWindow=O.GetPopupWindowByChildId(popupContainerId);if(popupWindow==null)return;if(popupWindow.type=='modeless')Iq(popupWindow);if(evnt.button==1)jv.Start(evnt,popupContainerId,false,ahS);};function ahS(evnt,popupContainerId){if(!aa(popupContainerId))return;popupContainer=T(popupContainerId);if(!popupContainer.id.startsWith("popupContainer"))return;var popupWindowId=popupContainer.getAttribute("popupId");var popupWindow=O.GetPopupWindowById(popupWindowId);if(!aa(popupWindow))return;popupWindow.left=popupContainer.offsetLeft;popupWindow.top=popupContainer.offsetTop;popupWindow.width=popupContainer.offsetWidth;popupWindow.height=popupContainer.offsetHeight;};function aio(evnt){var popupFrame=evnt.srcElement;var popupWindow=O.GetPopupWindowByChildId(popupFrame.id);if(!aa(popupWindow))return;if(popupWindow.type=='modeless')Iq(popupWindow);};function Iq(currPopupWindow){if(currPopupWindow==null)return;if(currPopupWindow.type!='modeless')return;O.maxModelessZIndex++;currPopupWindow.popupContainer.style.zIndex=O.maxModelessZIndex;currPopupWindow.popupTitleBar.style.zIndex=O.maxModelessZIndex;currPopupWindow.popupFrame.style.zIndex=O.maxModelessZIndex;Za();};function Za(){var arrZIndex=new Array();for(var key in O.dictionary.Obj){var popupWindow=O.dictionary.Obj[key];if(popupWindow.type!='modeless')continue;arrZIndex[arrZIndex.length]=popupWindow.popupContainer.style.zIndex;}arrZIndex.sort();O.maxModelessZIndex=0;for(var key in O.dictionary.Obj){var popupWindow=O.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>O.maxModelessZIndex)O.maxModelessZIndex=zIndex;popupWindow.zOrder=zOrder;popupWindow.popupContainer.style.zIndex=zIndex;popupWindow.popupTitleBar.style.zIndex=zIndex;popupWindow.popupFrame.style.zIndex=zIndex;}};O.RemoveAll=function(){for(var key in O.dictionary.Obj){popupWindow=O.dictionary.Obj[key];bJ(popupWindow.id);}};O.GetMaxZOrder=function(){var maxZOrder=0;for(var key in O.dictionary.Obj){popupWindow=O.dictionary.Obj[key];if(popupWindow.type!='modeless')continue;maxZOrder++;}return maxZOrder;}