var xmlHttpObj=new Object();
var xmlHttp = false;

try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}

if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}
//alert(xmlHttp);
function htmlCallServer(url,method,vars,id,debug) {
 if(debug){alert(url);}
  xmlHttp.open(method, url, true);
  xmlHttpObj["id"]=id;
  // Setup a function for the server to run when it's done
  xmlHttp.onreadystatechange = updatePage;
 
  // Send the request
  xmlHttp.send(vars);
}

function updatePage() {
  if (xmlHttp.readyState == 4) {
    var response = xmlHttp.responseText;
	
   document.getElementById(xmlHttpObj["id"]).innerHTML =response;
 // alert(document.getElementById(xmlHttp.id).innerHTML);
}
}
/**/

