
var xmlHttp_check_login;

function check_login(){

	str = document.getElementById("username").value;
	if(!str)return;

	
xmlHttp_check_login=GetXmlHttpObject_check_login();
if (xmlHttp_check_login==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="http://www.oldstockcars.com/vfsn/check_login.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp_check_login.onreadystatechange=stateChanged_check_login;
xmlHttp_check_login.open("GET",url,true);
xmlHttp_check_login.send(null);
} 

function stateChanged_check_login() 
{ 
if (xmlHttp_check_login.readyState==4)
{ 
//document.getElementById("captchaHolder").innerHTML=xmlHttp_check_login.responseText;
		if(xmlHttp_check_login.responseText=="Username could not be found! Please check spelling or register to continue."){
			document.getElementById("notification").innerHTML=xmlHttp_check_login.responseText;
			document.getElementById("notification").style.display='block';
			//alert(xmlHttp_check_login.responseText);
			timer1=window.setTimeout("hide_notification()",3000)
			document.getElementById("username").value = "";
			document.getElementById("username").focus();
		}
}
}

function hide_notification(){
			document.getElementById("notification").style.display='none';
}

function GetXmlHttpObject_check_login()
{
var xmlHttp_check_login=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp_check_login=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp_check_login=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp_check_login=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp_check_login;
}