﻿function applicationLoadHandler(){};function applicationUnloadHandler(){mainForm.CleanUp();mainForm=null;Sys.Application.dispose()};function beginRequestHandler(){mainForm.StartUpdating()};function endRequestHandler(){mainForm.EndUpdating()};var mainForm={pnlPopup:"pnlPopup",innerPopup:"innerPopup",updating:false};mainForm.StartUpdating=function(){mainForm.updating=true;mainForm.AttachPopup();mainForm.onUpdating()};mainForm.EndUpdating=function(){mainForm.updating=false;mainForm.DetachPopup();mainForm.onUpdated()};mainForm.onUpdating=function(){if(mainForm.updating){var pnlPopup=$get(this.pnlPopup);pnlPopup.style.display='';var docBounds=mainForm.GetClientBounds();var pnlPopupBounds=Sys.UI.DomElement.getBounds(pnlPopup);var x=docBounds.x+Math.round(docBounds.width/2)-Math.round(pnlPopupBounds.width/2);var y=docBounds.y+Math.round(docBounds.height/2)-Math.round(pnlPopupBounds.height/2);Sys.UI.DomElement.setLocation(pnlPopup,x,y);if(!pnlPopup.iFrame){var iFrame=document.createElement("IFRAME");iFrame.scrolling="no";iFrame.frameBorder=0;iFrame.style.display="none";iFrame.style.position="absolute";iFrame.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";iFrame.style.zIndex=998;pnlPopup.parentNode.insertBefore(iFrame,pnlPopup);pnlPopup.iFrame=iFrame}pnlPopup.iFrame.style.width=docBounds.width+"px";pnlPopup.iFrame.style.height=docBounds.height+"px";pnlPopup.iFrame.style.left=docBounds.x+"px";pnlPopup.iFrame.style.top=docBounds.y+"px";pnlPopup.iFrame.style.display="block";}};mainForm.onUpdated=function(){var pnlPopup=$get(this.pnlPopup);pnlPopup.style.display='none';if(pnlPopup.iFrame){pnlPopup.iFrame.style.display="none"}};mainForm.AttachPopup=function(){this._scrollHandler=Function.createDelegate(this,this.onUpdating);this._resizeHandler=Function.createDelegate(this,this.onUpdating);$addHandler(window,'resize',this._resizeHandler);$addHandler(window,'scroll',this._scrollHandler);this._windowHandlersAttached=true};mainForm.DetachPopup=function(){if(this._windowHandlersAttached){if(this._scrollHandler){$removeHandler(window,'scroll',this._scrollHandler)}if(this._resizeHandler){$removeHandler(window,'resize',this._resizeHandler)}this._scrollHandler=null;this._resizeHandler=null;this._windowHandlersAttached=false}};mainForm.CleanUp=function(){this.DetachPopup();var pnlPopup=$get(this.pnlPopup);if(pnlPopup&&pnlPopup.iFrame){pnlPopup.parentNode.removeChild(pnlPopup.iFrame);pnlPopup.iFrame=null}this._scrollHandler=null;this._resizeHandler=null;this.pnlPopup=null;this.innerPopup=null;this.updating=null};mainForm.GetClientBounds=function(){var clientWidth;var clientHeight;switch(Sys.Browser.agent){case Sys.Browser.InternetExplorer:clientWidth=document.documentElement.clientWidth;clientHeight=document.documentElement.clientHeight;break;case Sys.Browser.Safari:clientWidth=window.innerWidth;clientHeight=window.innerHeight;break;case Sys.Browser.Opera:clientWidth=Math.min(window.innerWidth,document.body.clientWidth);clientHeight=Math.min(window.innerHeight,document.body.clientHeight);break;default:clientWidth=Math.min(window.innerWidth,document.documentElement.clientWidth);clientHeight=Math.min(window.innerHeight,document.documentElement.clientHeight);break}var scrollLeft=(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft);var scrollTop=(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);return new Sys.UI.Bounds(scrollLeft,scrollTop,clientWidth,clientHeight)};if(typeof(Sys)!=="undefined")Sys.Application.notifyScriptLoaded();
