function switch_loading_box (box_id) {
	
	if(document.getElementById(box_id).style.display!="none") {
		document.getElementById(box_id).style.display="none";
	}
	else {
		document.getElementById(box_id).style.display="";
		
		var ie=document.all;
		iebody=document.body;
		var scroll_top=(ie)? iebody.scrollTop : window.pageYOffset;
		var docwidth=(ie)? iebody.clientWidth : window.innerWidth;
		docheight=(ie)? iebody.clientHeight: window.innerHeight;
		var objwidth=document.getElementById(box_id).offsetWidth;
		objheight=document.getElementById(box_id).offsetHeight;
		var test=docwidth/2-objwidth/2+"px";

		document.getElementById(box_id).style.left=docwidth/2-objwidth/2+"px";
		document.getElementById(box_id).style.top=scroll_top+docheight/3-objheight/2+"px";
	}
	
	return false;
	
}

var XMLHttpRequestObject = false;

if (window.XMLHttpRequest) {
XMLHttpRequestObject = new XMLHttpRequest();
}
else if (window.ActiveXObject) {
XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");
}

function getData(dataSource, divID) {
switch_loading_box('loading');
	if(XMLHttpRequestObject) {
var obj = document.getElementById(divID);
XMLHttpRequestObject.open("GET", dataSource, true);
		XMLHttpRequestObject.onreadystatechange = function() {
			if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) {
			obj.innerHTML = XMLHttpRequestObject.responseText;
			switch_loading_box('loading');
			}
		}
XMLHttpRequestObject.send(null);
}
}
