function myXMLHttpRequest() {
  var xmlhttplocal;
  try {
    xmlhttplocal= new ActiveXObject("Msxml2.XMLHTTP")
 } catch (e) {
  try {
    xmlhttplocal= new ActiveXObject("Microsoft.XMLHTTP")
  } catch (E) {
    xmlhttplocal=false;
  }
 }

if (!xmlhttplocal && typeof XMLHttpRequest!='undefined') {
 try {
  var xmlhttplocal = new XMLHttpRequest();
 } catch (e) {
  var xmlhttplocal=false;
  alert('couldn\'t create xmlhttp object');
 }
}
return(xmlhttplocal);
}

function checkUserFromServer(name) {
  url="chkuser.php?name="+name;
 var xmlhttp=myXMLHttpRequest();
 xmlhttp.open("GET",url,true);
  xmlhttp.onreadystatechange=function() {
    if (xmlhttp.readyState==4) {
     document.getElementById("chk").innerHTML=xmlhttp.responseText;
    }
  }
  xmlhttp.send(null);
}

