var prm = Sys.WebForms.PageRequestManager.getInstance();
if (prm) {     
    prm.add_initializeRequest(InitializeRequest);
    prm.add_endRequest(EndRequest);
    } 
  // Executed anytime an async postback occurs.
  function InitializeRequest(sender, args) {
      var varContainer = document.getElementById('Container');
      if (varContainer != null) {
          // Change the Container div's CSS class to .AJAXProgress.
          if (('Container').className != 'AJAXProgress') {
              $get('Container').className = 'AJAXProgress';              
          }
          
          $('#Container').block({ message: null });
      }
  } 
  // Executed when the async postback completes.
  function EndRequest(sender, args) {
      var varContainer = document.getElementById('Container');
      if (varContainer != null) {
          // Change the Container div's class back to .Normal.
          if (('Container').className != 'Normal') {
              $get('Container').className = 'Normal';
              $get('Container').style.cursor = 'auto';           
          }
          
          $('#Container').unblock();
      }
  }



