var xmlHttp;

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

//-------- email check---------------
function signupemailstatus(str)
{
/*if (str.length==0)
{ 
document.getElementById("txtHint").innerHTML=""
return
}*/
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="includes/validate-signup.php"
url=url+"?email="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=disp_signupemailstatus
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function disp_signupemailstatus() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
 if(xmlHttp.responseText!="")
   {
     document.getElementById("emailstatus").innerHTML=xmlHttp.responseText; 
	 document.getElementById("email").select();
   }
   else
   {
	 document.getElementById("emailstatus").innerHTML=xmlHttp.responseText;
   }
}
}
//-------- user id check---------------
function signupuserstatus(str)
{
/*if (str.length==0)
{ alert("shdfdjs");
document.getElementById("memid").focus();
document.getElementById("txtHint").innerHTML=""
return
}*/
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="includes/validate-signup.php"
url=url+"?username="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=disp_signupuserstatus
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function disp_signupuserstatus() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
 if(xmlHttp.responseText!="")
   {
     document.getElementById("usernamestatus").innerHTML=xmlHttp.responseText;
	 document.getElementById("username").select();
   }
   else
   {
	 document.getElementById("usernamestatus").innerHTML=xmlHttp.responseText;
   }
}
}

function changemailstatus(str)
{
/*if (str.length==0)
{ 
document.getElementById("txtHint").innerHTML=""
return
}*/
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="includes/validate-signup.php"
url=url+"?emailid="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=disp_changemailstatus
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function disp_changemailstatus() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
 if(xmlHttp.responseText!="")
   {
     document.getElementById("editemailstatus").innerHTML=xmlHttp.responseText; 
	 document.getElementById("emailid").select();
   }
   else
   {
	 document.getElementById("editemailstatus").innerHTML=xmlHttp.responseText;
   }
}
}
