// JavaScript Document
var xmlHttp;
function showResult(str)
{
	if (str.length==0)
	{ 
		 alert("Please insert the Email Id");
		 document.getElementById("emailadress").innerHTML="";
		 document.getElementById("emailadress").style.border="0px";
		 return;
	}
		 xmlHttp=GetXmlHttpObject()
		 if (xmlHttp==null)
		 {
			 alert ("Browser does not support HTTP Request");
			 return;
		 }
		 var url="email.php";
		 url=url+"?q="+str;
		 url=url+"&sid="+Math.random();
		 xmlHttp.onreadystatechange=stateChanged;
		 xmlHttp.open("GET",url,true);
		 xmlHttp.send(null);
		} 
function showUser(str)
{

	if (str.length==0)
	{ 
		 alert("Please insert the UserName");
		 document.getElementById("username").innerHTML="";
		 document.getElementById("username").style.border="0px";
		 return;
	}
		 xmlHttp=GetXmlHttpObject()
		 if (xmlHttp==null)
		 {
			 alert ("Browser does not support HTTP Request");
			 return;
		 }
		 var url="email.php";
		 url=url+"?u="+str;
		 url=url+"&sid="+Math.random();
		 xmlHttp.onreadystatechange=stateChanged1;
		 xmlHttp.open("GET",url,true);
		 xmlHttp.send(null);
		} 
function showforResult(str)
{

	if (str.length==0)
	{ 
		 document.getElementById("emailadress").innerHTML="";
		 document.getElementById("emailadress").style.border="0px";
		 return;
	}
		 xmlHttp=GetXmlHttpObject()
		 if (xmlHttp==null)
		 {
			 alert ("Browser does not support HTTP Request");
			 return;
		 }
		 var url="email.php";
		 url=url+"?e="+str;
		 url=url+"&sid="+Math.random();
		 xmlHttp.onreadystatechange=stateChanged2;
		 xmlHttp.open("GET",url,true);
		 xmlHttp.send(null);
} 	
function showState(str)
{

	 xmlHttp=GetXmlHttpObject()
		 if (xmlHttp==null)
		 {
			 alert ("Browser does not support HTTP Request");
			 return;
		 }
		 var url="email.php";
		 url=url+"?s="+str;
		 url=url+"&sid="+Math.random();
		 
		 xmlHttp.onreadystatechange=stateChanged4;
		 xmlHttp.open("GET",url,true);
		 xmlHttp.send(null);
} 	

	function stateChanged4() 
		{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			 { 
				 document.getElementById("state").innerHTML=xmlHttp.responseText;
								 
			 } 
			}


		function stateChanged2() 
		{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			 { 

				 document.getElementById("forgotresponse").innerHTML=xmlHttp.responseText;
				 if(xmlHttp.responseText!='')
				 {
		  			 document.getElementById("emailadress").value='';
				 }
				 document.getElementById("forgotresponse").style.border="0px solid #A5ACB2";
				 
				 
			 } 
			}
		
		function stateChanged1() 
		{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			 { 
				 document.getElementById("userresponse").innerHTML=xmlHttp.responseText;
				 document.getElementById("userresponse").style.border="0px solid #A5ACB2";
			 } 
		}
		
		
		
		function stateChanged() 
		{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			 { 
				 document.getElementById("forgotresponse").innerHTML=xmlHttp.responseText;
				 document.getElementById("forgotresponse").style.border="0px solid #A5ACB2";
				 
			 } 
			}
		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;
			}
			
			
function check_validation()
{
	if(document.lngfrm.emailid.value=="")
		 {
		  alert("Enter Email Id.");
		  document.lngfrm.emailid.focus();
		  return false;
		 }
	if(document.lngfrm.password.value=="")
		 {
		  alert("Enter Password.");
		  document.lngfrm.password.focus();
		  return false;
		 }
}
			
			
			
			
			