var xmlHttp
var t


function showHint(st)
{
clearTimeout(t)
t = setTimeout(function(){getHint(st);},200);
//var t = setTimeout("getHint(str1)",1000)
//getHint(str1)    not_Working(me),
}


function getHint(str)
{
if (str.length != 6)
  {
  document.getElementById("txtHint").innerHTML="Requires 6 Characters";
  document.getElementById('security_code').style.border = '1px solid #c24949';
  document.getElementById('security_code').style.background = '#ffbcbc';

  return;
  }

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
document.getElementById("txtHint").innerHTML="Standby.  Checking...";

var url="process.php";
url=url+"?captcha="+str;
//url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}





function stateChanged()
{
if (xmlHttp.readyState==4)
{
document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
//{
		var showcheck = xmlHttp.responseText;
		if(showcheck == 'The security code is correct!')
		{
			document.getElementById('security_code').style.border = '1px solid #49c24f';
			document.getElementById('security_code').style.background = '#bcffbf';

		}
		if(showcheck == 'The security code is NOT correct!')
		{
			document.getElementById('security_code').style.border = '1px solid #c24949';
			document.getElementById('security_code').style.background = '#ffbcbc';

		}

  //	}
}
}

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;
}

