﻿var __postBackBtn = null;
if(typeof(Sys) != "undefined") 
    Sys.Application.add_load(ApplicationLoadHandler);
function ApplicationLoadHandler(sender, args) {
    Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(CancelSecondRequest);
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
}
function CancelSecondRequest(sender, args) {
    __postBackBtn = args.get_postBackElement();
    var type = __postBackBtn.getAttribute('type');
    if (type = 'button' || type == 'input') 
        __postBackBtn.disabled = 'disabled';
    else
        __postBackBtn = null;
}
function EndRequestHandler(sender, args) {
    if (__postBackBtn) __postBackBtn.removeAttribute('disabled');
}
function doNothing() { return false; }
if(typeof(Sys) != "undefined") Sys.Application.notifyScriptLoaded();


