

//Sys.Application.add_load(application_Load);
var isAjaxMsgShowed = false;
var ajaxMsgTimer = 0;



function application_Load()
{
	var prmInstance = Sys.WebForms.PageRequestManager.getInstance();
	prmInstance.add_beginRequest(onBeginAjaxRequest);
	prmInstance.add_endRequest(onEndAjaxRequest);
}

function onBeginAjaxRequest() 
{
	if (isAjaxMsgShowed) 
	{
		if (ajaxMsgTimer != 0) window.clearTimeout(ajaxMsgTimer);
		ajaxMsgTimer = 0;
	} 
	else 
	{
		var dd = document.getElementById('MsgInAjaxRequest');
		var ps = getScrollXY();
		var sz = getInnerSize();
		dd.style.top = (ps[1] + 3) + "px";
		var lf = (ps[0] + sz[0] - 105);
		if (!document.all) lf -= 20;
		dd.style.left = lf + "px";
		dd.style.display = 'block';
		isAjaxMsgShowed = true;
	}
}

function onEndAjaxRequest(sender, args) 
{
    if (args.get_error() != undefined)
    {
	    
	}
	ajaxMsgTimer = window.setTimeout('doHideMsgAjax()', 500);
}

function doHideMsgAjax() 
{
	var dd = document.getElementById('MsgInAjaxRequest');
	if (dd != null) dd.style.display = 'none';
	isAjaxMsgShowed = false;
}
