function checkRecapchafun()
{   
	sendMaskValue('check_recaptcha.php','showMsg',document.getElementById('word').value);
}

function sendMaskValue(url,target,word)
{
   // native XMLHttpRequest object
//   document.getElementById(target).innerHTML = '<span>Requesting...';
   if (window.XMLHttpRequest) 
   {
       req = new XMLHttpRequest();
       url	=	url + "?word=" + word ;
      req.onreadystatechange = function() {ajaxDone_SaveMaskValue(target);};
       req.open("GET", url, true);
       req.send(null);
   // IE/Windows ActiveX version
   } 
   else if (window.ActiveXObject) 
   {
      req = new ActiveXObject("Microsoft.XMLHTTP");
       if (req) 
       {
       	   url	=	url + "?word=" + word ;
           req.onreadystatechange = function() {ajaxDone_SaveMaskValue(target);};
           req.open("GET",url, true);
           req.send();
       }
   }
   
}

function ajaxDone_SaveMaskValue(target) 
{
			// only if req is "loaded"
	if (req.readyState == 4) 
	{ 
		// only if "OK"
		if (req.status == 200 || req.status == 304) 
		{
			results = req.responseText;
					
			
			if((results == 'no' || results == '') && document.getElementById('checkValue').value == 'false')
			{
				document.getElementById('checkValue').value = 'false';
				document.getElementById(target).innerHTML = "<font style='margin-left:10px;font-size:11px;color:#FF0000;font-family: Tahoma, Arial, Verdana;font-weight: bold;'>sorry, that's not the right word, try again.</font>";
			}
			else if(results == 'yes')
			{	
				document.getElementById(target).innerHTML = "";
				document.getElementById('checkValue').value = 'true';
			}
		} 
		else 
		{
			document.getElementById(target).innerHTML="ajax error:\n" +
			req.statusText;
		}
	}
}


/*
function getXMLHttp()
{
  var xmlHttp

  try
  {
    //Firefox, Opera 8.0+, Safari
    xmlHttp = new XMLHttpRequest();
  }
  catch(e)
  {
    //Internet Explorer
    try
    {
      xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch(e)
    {
      try
      {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
      }
      catch(e)
      {
        alert("Your browser does not support AJAX!")
        return false;
      }
    }
  }
  return xmlHttp;
}

function MakeRequest()
{
  var xmlHttp = getXMLHttp();
  
  xmlHttp.onreadystatechange = function()
  {
    if(xmlHttp.readyState == 4)
    {
      HandleResponse(xmlHttp.responseText);
    }
  }

  var word = document.getElementById('word').value;
  alert(word);
  xmlHttp.open("GET", "check_recaptcha.php?word=" + word , true); 
  xmlHttp.send(null);
}


function HandleResponse(response)
{
	
		alert(response);
	if(response == 'no')
	{
		document.getElementById('checkValue').value = 'false';
		document.getElementById('showMsg').innerHTML = "<font style='margin-left:10px;font-size:11px;color:#FF0000;font-family: Tahoma, Arial, Verdana;font-weight: bold;'>Please try again.</font>";
		alert(response);
	}
	else if(response == 'yes')
	{	
		document.getElementById('checkValue').value = 'true';
		alert(response);
		alert('yes in');
		
	}
	
//  document.getElementById('ResponseDiv').innerHTML = response;
}

*/