xajax.loadingFunction = loadingLayerStart;
xajax.doneLoadingFunction = loadingLayerEnd;
function loadingLayerStart() {
	if ( typeof( window.innerWidth ) == 'number' )
	{
		//----------------------------------
		// Non IE
		//----------------------------------
	  
		w  = window.innerWidth;
		h = window.innerHeight;
	}
	else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
	{
		//----------------------------------
		// IE 6+
		//----------------------------------
		
		w  = document.documentElement.clientWidth;
		h = document.documentElement.clientHeight;
	}
	else if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
	{
		//----------------------------------
		// Old IE
		//----------------------------------
		
		w  = document.body.clientWidth;
		h = document.body.clientHeight;
	}

	var scrollY = 0;
	
	if ( document.documentElement && document.documentElement.scrollTop )
	{
		scrollY = document.documentElement.scrollTop;
	}
	else if ( document.body && document.body.scrollTop )
	{
		scrollY = document.body.scrollTop;
	}
	else if ( window.pageYOffset )
	{
		scrollY = window.pageYOffset;
	}
	else if ( window.scrollY )
	{
		scrollY = window.scrollY;
	}
	
	h = (h/2) - 100 + scrollY;
	w = (w/2) - 100;
	document.getElementById('loading-layer').style.top = h + "px";
	document.getElementById('loading-layer').style.left = w + "px";
	document.getElementById('loading-layer').style.position = 'absolute';
	document.getElementById('loading-layer').style.display = 'block';
}

function loadingLayerEnd() {
	document.getElementById('loading-layer').style.display = 'none';
}