var xmlHttp_check_tagged;

function check_tagged(name){
xmlHttp_check_tagged=GetXmlHttpObject_check_tagged();
if (xmlHttp_check_tagged==null)
 {
 alert ("Browser does not support HTTP Request");
 return
 } 
var url="http://www.oldstockcars.com/faces/check_tagged.php";
url=url+"?recip="+name
url=url+"&sid="+Math.random();
xmlHttp_check_tagged.onreadystatechange=stateChanged_check_tagged; 
xmlHttp_check_tagged.open("GET",url,true);
xmlHttp_check_tagged.send(null);
} 


function stateChanged_check_tagged() 
{ 
 if (xmlHttp_check_tagged.readyState==4)
 { 
     document.getElementById("status").innerHTML=xmlHttp_check_tagged.responseText;
     document.getElementById("status").style.display='block';

	if(xmlHttp_check_tagged.responseText == "Well done! You've found the tagged person. You have earned 100 points and now your it!"){
		setTimeout("go_redirect()", 5000);
	}
 } 
} 

function go_redirect(){
		location.href="build_images.php";
}

function GetXmlHttpObject_check_tagged()
{
var xmlHttp_check_tagged=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp_check_tagged=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp_check_tagged=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp_check_tagged=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp_check_tagged;
}