﻿Type.registerNamespace("Hxsoft.AppV1._Controls");

Hxsoft.AppV1._Controls.UpdateProgress = function(element)
{
	Hxsoft.AppV1._Controls.UpdateProgress.initializeBase(this, [element]);
}
Hxsoft.AppV1._Controls.UpdateProgress.prototype = 
{
	initialize : function()
	{
		Hxsoft.AppV1._Controls.UpdateProgress.callBaseMethod(this, 'initialize');
	},

	_startRequest : function()
	{
		if (this._pageRequestManager.get_isInAsyncPostBack())
		{
            $.blockUI({ message: $(this.get_element()) });
            $.blockUI._trigger = this;
        }
        
        this._timerCookie = null;
	},
	
	_handleEndRequest : function(sender, arg)
	{
		if($.blockUI._trigger == this)
			$.unblockUI();
		
        if (this._timerCookie)
        {
            window.clearTimeout(this._timerCookie);
            this._timerCookie = null;
        }		
	}
}
Hxsoft.AppV1._Controls.UpdateProgress.registerClass("Hxsoft.AppV1._Controls.UpdateProgress", Sys.UI._UpdateProgress);
