var xmlHttp;
var url
url="recaptcha_verify.asp"
var method
method="post"
function getDatafromServer(){
			
/* this if structure test to see which browser the client is using
	the first part tests for netscape and other mozilla browsers
	the second part test for internet explorer
	then depending on which browser the page tries to create an httprequest object
	the object will be named xmlHttp
*/
	if (navigator.appName=="Netscape") {
		xmlHttp = new XMLHttpRequest();
		xmlHttp.overrideMimeType('text/xml');
	}
	else{
		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		// use a & to separate paired information
		if (typeof ActiveXObject != 'undefined') {
			xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
		}
	}
/*
if the htttprequest object was successfully created
then set up the connection to the page to be called when a request is required
and create function to be executed
the if test if the http request object has been create
the next line opens the connection to the page to be called when a request is made

	The first parameter of the call to open() is the HTTP request method 
	GET, POST, HEAD or any other method you want to use and that is supported by your server. 
	Keep the method capitalized as per the HTTP standard; otherwise some browsers (like Firefox) 
	might not process the request. For more information on the possible HTTP request methods 
	you can check the W3C specs 

	The second parameter is the URL of the page you're requesting. As a security feature, you 
	cannot call pages on 3rd-party domains. Be sure to use the exact domain name on all of 
	your pages or you will get a 'permission denied' error when you call open(). A common 
	pitfall is accessing your site by domain.tld, but attempting to call pages with www.domain.tld. 

	The third parameter sets whether the request is asynchronous. If TRUE, the execution of 
	the JavaScript function will continue while the response of the server has not yet arrived. 
	This is the A in AJAX. 

the next line creates a header to be sent so the called file knows 
the data being sent to it
is in "form" format
the next line create the function and sets it to wait for a request
*/
	if (xmlHttp) {
		xmlHttp.open(method, url, true);
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlHttp.onreadystatechange=function(){
/*
this if statement test to see if the calling page has finished its business
then assigns an object on the webpage called junk to a temp object called y
then assigns the returned value kept in the responseText property of the httprequest object to y
*/
			if(xmlHttp.readyState==4){
				junk(xmlHttp.responseText)
			}
		}
/*
first line creates a string in "form submittion" format from the data in the webpage
second line submits the data to the url specified, using the send method of the httprequest object
*/
dataToPost=""
	dataToPost="recaptcha_challenge_field="+document.getElementById("recaptcha_challenge_field").value+"&recaptcha_response_field="+document.getElementById("recaptcha_response_field").value
	xmlHttp.send(dataToPost);
	}
}
