// JavaScript Document
function changeFaceImage(url){
	var face = document.getElementById('face_image');
	face.innerHTML = '<img src="'+ url +'" class="imgx" />';
}


function create(){
				var http;
				var msxmlhttp = new Array(
					'Msxml2.XMLHTTP.5.0',
					'Msxml2.XMLHTTP.4.0',
					'Msxml2.XMLHTTP.3.0',
					'Msxml2.XMLHTTP',
					'Microsoft.XMLHTTP');
				for (var i = 0; i < msxmlhttp.length; i++) {
					try {
						http = new ActiveXObject(msxmlhttp[i]);
					} catch (e) {
						http = null;
					}
				}	
				
				if(!http && typeof XMLHttpRequest != "undefined")
					http = new XMLHttpRequest();
				if (!http)
					alert("Trình duyệt không hỗ trợ javascript!");
				return http;
		}
		
		
function getParam(targetID,url){
	var http = create();
	//ShowMyLoad();
	http.open('GET', url , true);
	
	if (loading==0){
		loading=1;
		show_Loading();
	}
	
	http.onreadystatechange=function(){
    	writeContent(http,targetID)
	}    
	http.send(null);
	
}	

function writeContent(http,targetID) {
  if(http.readyState == 4){
  		if ((http.status==200)||(window.location.href.indexOf("http")==-1)){
      		document.getElementById(targetID).innerHTML = http.responseText;
      		
      		hide_Loading();
			loading=0;
	    }
    }
  
} 
