﻿var _progress;

Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);

function BeginRequestHandler(sender, args)
{
	ToogleCallbackProgress();
}
function EndRequestHandler(sender, args)
{
	ToogleCallbackProgress();
}
function ToogleCallbackProgress()
{
	if (this._progress == null) this._progress = $get('CallbackProgress');
	
	if (this._progress.style.display == 'none' || this._progress.style.display == '')
	{
		this._progress.style.position = 'absolute';
		var bounds = this.GetWindowBounds();
		this._progress.style.top = (bounds.y / 2) - 50 + 'px';
		this._progress.style.left = (bounds.x / 2) - 150 + 'px';
		this._progress.style.display = 'block';
		//alert($get('__eventTarget').value);
	}
	else 
	{
		this._progress.style.display = 'none';
	}
	
}
function GetWindowBounds()
{
    var bounds = {x: 0, y: 0}
    if (self.innerHeight){ // all except Explorer
	    bounds.x = self.innerWidth;
	    bounds.y = self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientHeight){ // Explorer 6 Strict Mode
	    bounds.x = document.documentElement.clientWidth;
	    bounds.y = document.documentElement.clientHeight;
    }
    else if (document.body){ // other Explorers
	    bounds.x = document.body.clientWidth;
	    bounds.y = document.body.clientHeight;
    }
    return bounds;
}
function ShowChildTab(id)
{
	var tab = document.getElementById(id);
	tab.style.display = 'block';
}
function HideChildTab(id)
{
	var tab = document.getElementById(id);
	tab.style.display = 'none';
}
/*var map = null;
	    
function GetMap()
{
	try
	{
		map = new VEMap('myMap');
		map.LoadMap();
	 }
	 catch(e)
	 {
		alert(e.message);
	 }
}   
 
function FindLoc()
{
	try
	{
		map.Find(null, '');
	}
	catch(e)
	{
		alert(e.message);
	}
}*/
