function retrieveURL(url,pars) {
	if (window.XMLHttpRequest) { // Non-IE browsers
		req = new XMLHttpRequest();
		req.onreadystatechange = processStateChange;
		try {
			req.open("POST", url+'.php'+pars);
			req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		} catch (e) {
			alert(e);
		}
		req.send(pars);
	} else if (window.ActiveXObject) { // IE
		req = new ActiveXObject("Microsoft.XMLHTTP");
		if (req) {
			req.onreadystatechange = processStateChange;
			req.open("POST", url+'.php'+pars);
			req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			req.send(pars);
		}
	}
}

function processStateChange() {
			if (loadingtext!=''){
				document.getElementById(Object_show).innerHTML = loadingtext;
			}else{
			//self.status=statusload;
			show_Loading();
			}
	if (req.readyState == 4) { // Complete
		if (req.status == 200) { // OK response
			document.getElementById(Object_show).innerHTML = req.responseText;
			self.status=statuscomp;
			hide_Loading();
		} else {
			alert("Thông báo lỗi: " + req.statusText);
		}
	}
}

function StatusClick(url,pars,DivMainID){
	//loadingtext='<div align="center" style="margin:5px; font-size:8pt;"><img src="img/loadingAnimation.gif" width="100" height="100" alt="" border="0" style="margin:5px;" /><br />Xin vui lòng chờ trong giây lát ...</div>';
	loadingtext='';
	statusload='Đang tải dữ liệu ...';
	statuscomp='Đã tải xong dữ liệu';
	Object_show = DivMainID;
	retrieveURL(url,pars);
}
