﻿  
  function RegisterHook()
  {
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_initializeRequest(InitializeRequest);
    prm.add_endRequest(EndRequest);
  }

  
  function InitializeRequest(sender, args) 
  {
   $get(sender._postBackSettings.sourceElement.id).style.cursor = 'wait'; 
 
    // Get a reference to the element that raised the postback,
    //   and disables it.
    $get(args._postBackElement.id).disabled = true;
  }
 
  function EndRequest(sender, args) 
  {
   if ($get(sender._postBackSettings.sourceElement.id)!=null)
   {     
    $get(sender._postBackSettings.sourceElement.id).style.cursor = 'auto';
 
    // Get a reference to the element that raised the postback
    //   which is completing, and enable it.
    $get(sender._postBackSettings.sourceElement.id).disabled = false;
   }
  }
