var xmlhttp = null;

try {
     xmlhttp = new XMLHttpRequest();
   } catch (trymicrosoft) {
     try {
       xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
     } catch (othermicrosoft) {
       try {
         xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
       } catch (failed) {
         xmlhttp = null;
       }
     }
   }

 if (xmlhttp == null)
   alert("Error creating xmlhttp object!");






function showXmlHttp(url, target)
{
	
  url = url + "?dummy=" + new Date().getTime();	

  xmlhttp.open("GET", url  , true);
  
  xmlhttp.onreadystatechange=function() 
    {
      if (xmlhttp.readyState==4)
      {
		if (xmlhttp.status==200)
		{
        var giatritrave = xmlhttp.responseText;
        var myarrayvalue = giatritrave.split(";")
        
        for (var i=0; i < target.length; i++)
        {
			var span  = document.getElementById(target[i]);	
			/*if (i==0) {			
				var vnDate=new Date();
				tmpHour 	= vnDate.getHours();
				tmpMinute 	= vnDate.getMinutes();
				tmpSecond 	= vnDate.getSeconds();
				tmpDay		= vnDate.getDate();
				tmpMonth	= vnDate.getMonth();
				tmpYear		= vnDate.getFullYear();
				dateString 	= checkTime(tmpDay) + "/" + checkTime(tmpMonth+1) + "/" + tmpYear;
				timeString	= checkTime(tmpHour)+":"+checkTime(tmpMinute)+":"+checkTime(tmpSecond);
				var showTimeVN = dateString + " " + timeString;
			//	alert(showTimeVN);				
				span.innerHTML = showTimeVN;
			}		
			else
			{ */
				span.innerHTML = myarrayvalue[i];
			
			/*} */
				
        }
        }        
      }
    }
    xmlhttp.send(null);
  
  
 
}


function checkTime(i){
	if (i<10) {
		i="0" + i;
	}
	return i;
}


function closeXmlHttp(target){
  
  var s = document.getElementById(target);
  if(s==null)
  {
  }
  else
  {  
    s.innerHTML = '';
  }
}
