﻿// JScript File
var _updateProgressDiv;
            
            function pageLoad(sender, args){ 
            
              
                //  register for our events
                Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequest);
                Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequest);    
                
                _updateProgressDiv = $get('updateProgressDiv');
                
            }

        function beginRequest(sender, args){
                //  get the gridview element     
                
               var MainContainer = $get('ctl00_InmaaContentPlaceHolder_UpdatePanel1');
                
                // make it visible
                _updateProgressDiv.style.display = '';	    
                
                // get the bounds of both the gridview and the progress div
	            var MainContainerwBounds = Sys.UI.DomElement.getBounds(MainContainer);
	            var updateProgressDivBounds = Sys.UI.DomElement.getBounds(_updateProgressDiv);
                
	            //  center of gridview
	            var x = MainContainerwBounds.x + Math.round(MainContainerwBounds.width / 2) - Math.round(updateProgressDivBounds.width / 2);
	            var y = MainContainerwBounds.y + Math.round(MainContainerwBounds.height / 2) - Math.round(updateProgressDivBounds.height / 2);	    

	            //	set the progress element to this position
	            Sys.UI.DomElement.setLocation (_updateProgressDiv, x, y);    
            }

            function endRequest(sender, args) {
                // make it invisible
                _updateProgressDiv.style.display = 'none';
            }         
