// JavaScript Document
var xmlhttp;
function ajaxcreate(){
     if (window.ActiveXObject) {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else if (window.XMLHttpRequest) {
        xmlhttp = new XMLHttpRequest();
    }
}
function ajaxlogin(){
   ajaxcreate();
   var username=document.getElementById("name").value
   var password=document.getElementById("pwd").value
   var url="login.php?u="+username+"&p="+password+"&rnd="+Math.random();
   xmlhttp.onreadystatechange=requestlogin;
   xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
}

function requestlogin(){
   if(xmlhttp.readystate==4){
    //  if(xmlhttp.status==200){
		alert(xmlhttp.responseText);
	   document.getElementById("login").innerHTML='';
	  document.getElementById("login").innerHTML=xmlhttp.responseText; 
	//  }
   }
}