
function retrieveURL(url,pars) {
	//alert(url);
	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);
			//alert();
		}
	}
}

function processStateChange() {
			document.getElementById(Object_show).innerHTML = loadingtext;
			self.status=statusload;
	if (req.readyState == 4) { // Complete
		if (req.status == 200) { // OK response
			document.getElementById(Object_show).innerHTML = req.responseText;
			//tfm_progressBarEnd(tfm_ProgressBar);
			document.title='..:: TRUNG TAM TU VAN  NOI KET ::..';
			self.status=statuscomp;
		} else {
			document.getElementById(Object_show).innerHTML = "Thông báo lỗi: " + req.statusText + "<br />Hãy thử lại lần nữa";
			//alert("Thông báo lỗi: " + req.statusText);
		}
	}
}

function StatusClick(url,pars,DivMainID){
	//alert(url);
	loadingtext='<div align="center" style="margin:5px; font-size:8pt;"><img src="img/load.gif" width="16" height="16" alt="" border="0" style="margin:5px;" /><br />Đang tải dữ liệu...</div>';
	statusload='Đang tải dữ liệu ...';
	statuscomp='Đã tải xong dữ liệu';
	Object_show = DivMainID;
	retrieveURL(url,pars);
}