﻿// JScript File
Sys.Application.add_load(AppLoad);
 
function AppLoad()
{

   if ( Sys.WebForms.PageRequestManager.getInstance() == null )return;
  Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(InitializeRequest);
  Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequest);
}
 
function InitializeRequest(sender, args){
    //alert('ajax-block');
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    if (prm != null && prm.get_isInAsyncPostBack())
    {
        args.set_cancel(true);
    }
    $get('ajaxProgessBar').style.display = 'block';
   
  
    
 }
 
function EndRequest(sender, args) {
  //  alert('ajax-none');
  // Check to see if there's an error on this request.
  if (args.get_error() != undefined)
  {
    // If there is, show the custom error.
    alert(args.get_error().description);
    // Let the framework know that the error is handled, 
    //  so it doesn't throw the JavaScript alert.
    args.set_errorHandled(true);
  }
  $get('ajaxProgessBar').style.display = 'none';
 
    
}


      
