ACPuzzle.reload()  // to display form onload 

function TestCaptcha() {
	resp = cform.adcopy_response.value;
	challenge = cform.adcopy_challenge.value;
	if (window.XMLHttpRequest)
	{	// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}
	else
	{	// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4)
		{
			document.getElementById("results").value='ACCESS-GRANTED';
			if (xmlhttp.responseText=='ACCESS-GRANTED'){
				document.cform.submit();
			}
			else {
				//display error 
				document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
				// to display a new captcha when error is made 
				ACPuzzle.reload();  
			}
		}
	}
	xmlhttp.open("GET","adcopy_test_captcha.asp?resp=" + resp + "&challenge=" + challenge)
	xmlhttp.send(null);	
}		


