/*=======================================*/
//# Common JavaScript
//# Name: Dang Xuan Thao
//# Email: Thaodx@gmail.com
//# Y!M: Love_Online1986
/*=======================================*/
var xmlHttp = false;
if(window.XMLHttpRequest){
	xmlHttp = new XMLHttpRequest();
}
else if(window.ActiveXObject){
	xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
function getRes(div,src){
	var obj = document.getElementById(div);
	if(xmlHttp){
		xmlHttp.open("GET",src);
		xmlHttp.onreadystatechange = function(){
			if(xmlHttp.readyState == 1 || xmlHttp.readyState == 2){
				obj.innerHTML = "<center><br><img src='images/load.gif' border='0'><br></center>";
			}
			else if(xmlHttp.readyState == 4 && xmlHttp.status == 200){
				obj.innerHTML = xmlHttp.responseText;
			}			
		}	
		xmlHttp.send(null);	
	}
}
function postRes(div,src,param){
	var obj = document.getElementById(div);
	if(xmlHttp){
		xmlHttp.open("POST",src,true);
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8;");
		xmlHttp.onreadystatechange = function(){
			if(xmlHttp.readyState == 1 || xmlHttp.readyState == 2){
				obj.innerHTML = "<center><br><img src='images/load.gif' border='0'><br></center>";
			}
			else if(xmlHttp.readyState == 4 && xmlHttp.status == 200){
				obj.innerHTML = xmlHttp.responseText;
			}			
		}	
		xmlHttp.send(param);	
	}
}
function createWindow(link,title,w,h){
	window.open(""+link,""+title,"toolbar=no,width="+w+",height="+h+",directories=no,status=no,scrollbars=yes,resizable=no,menubar=no")
}
