﻿Type.registerNamespace('IWCtrls');
IWCtrls.AjaxLoadingIndicator = function(element) { IWCtrls.AjaxLoadingIndicator.initializeBase(this, [element]); }

IWCtrls.AjaxLoadingIndicator.prototype = {

    initialize : function() {        
        IWCtrls.AjaxLoadingIndicator.callBaseMethod(this, 'initialize');
        
        $('.AjaxLoadingIndicator').hide(0);
        
        
        Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded
		(			
			function()
			{            
				Sys.Net.WebRequestManager.add_completedRequest
				(
					function(){$('.AjaxLoadingIndicator').hide(0); }
				);
				Sys.Net.WebRequestManager.add_invokingRequest
				(
					function(){$('.AjaxLoadingIndicator').show(); }
				);            
				$('.AjaxLoadingIndicator').hide(0);            
			}
		);        
    },
    
    dispose : function() {        
        $clearHandlers(this.get_element());
        IWCtrls.AjaxLoadingIndicator.callBaseMethod(this, 'dispose');
    }
}

IWCtrls.AjaxLoadingIndicator.registerClass('IWCtrls.AjaxLoadingIndicator', Sys.UI.Control);
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();