function validate()
 {
   if(document.getElementById("username").value=="")
   {
	   alert("Enter Username");
	   document.getElementById("username").focus();
	   return false;
   }
   if(document.getElementById("password").value=="")
   {
    alert("Enter  Password");
	document.getElementById("password").focus();
    return false;
   }
  return true;
 }

function validate1()
 {
   if(document.getElementById("username1").value=="")
   {
	   alert("Enter  Username");
	   document.getElementById("username1").focus();
	   return false;
   }
   if(document.getElementById("password1").value=="")
   {
    alert("Enter  Password");
	document.getElementById("password1").focus();
    return false;
   }
  return true;
 }


function checkRem(u_nm)
  {
    xmlHttpReq = getXmlHttpRequest();
	xmlHttpReq.onreadystatechange = function()
			{
				handleChange(xmlHttpReq);
			};
	xmlHttpReq.open("GET","checkrem.php?u_nm="+u_nm,true);
	xmlHttpReq.send(null);
  }

function checkRem1(u_nm)
  {
    xmlHttpReq = getXmlHttpRequest();
	xmlHttpReq.onreadystatechange = function()
			{
				handleChange1(xmlHttpReq);
			};
	xmlHttpReq.open("GET","checkrem.php?u_nm="+u_nm,true);
	xmlHttpReq.send(null);
  }

 function handleChange(xmlHttpReq)
  {
    if (xmlHttpReq.readyState == 4 && xmlHttpReq.status==200)
      {
		var xml=xmlHttpReq.responseXML;
		var root=xml.getElementsByTagName("response");
		var pass = root[0].getElementsByTagName("pwd")[0].firstChild.nodeValue;
        if(pass!="empty") document.getElementById("password").value = pass;
	  }
  }
  
 function handleChange1(xmlHttpReq)
  {
   if (xmlHttpReq.readyState == 4 && xmlHttpReq.status == 200) 
      {
		var xml=xmlHttpReq.responseXML;
		var root=xml.getElementsByTagName("response");
		var pass = root[0].getElementsByTagName("pwd")[0].firstChild.nodeValue;
        if(pass!="empty") document.getElementById("password1").value = pass;
	  }
  }
