// JavaScript Document
function __getBrowserSize()
{
	var bodyWidth = document.documentElement.clientWidth;
	var bodyHeight = document.documentElement.clientHeight;
	
	var bodyWidth, bodyHeight; 
	if (self.innerHeight){ // all except Explorer 
	 
	   bodyWidth = self.innerWidth; 
	   bodyHeight = self.innerHeight; 
	}  else if (document.documentElement && document.documentElement.clientHeight) {
	   // Explorer 6 Strict Mode 		 
	   bodyWidth = document.documentElement.clientWidth; 
	   bodyHeight = document.documentElement.clientHeight; 
	} else if (document.body) {// other Explorers 		 
	   bodyWidth = document.body.clientWidth; 
	   bodyHeight = document.body.clientHeight; 
	} 
	return [bodyWidth,bodyHeight];
	
}
var brSize = __getBrowserSize();
var bodyWidth = brSize[0];
var bodyHeight = brSize[1];
$(document).ajaxStart(function(){
	var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
	document.getElementById('LoadingDiv').style.left = Math.ceil((bodyWidth - document.getElementById('LoadingDiv').offsetWidth - 200) / 2) + 'px';
	document.getElementById('LoadingDiv').style.top = Math.ceil((bodyHeight - document.getElementById('LoadingDiv').offsetHeight - 50) / 2) + st +'px';
	$('#LoadingDiv').show();
}).ajaxStop(function(){
	$('#LoadingDiv').hide();
});