/**
hasPassed returns true if show_Captcha() matches the security code.
*/
var hasPassed = false;

function get_captchaInfo(info)
{
	//The purpose of myRand is to prevent browser caching of the update_form_ajax.asp by having 
	//the url passed to it be different everytime, therefore tricking the browser
	myRand=parseInt(Math.random()*99999999);
	param = 'captcha='+info+'&random='+myRand;
	//The ajax object is created and calls the update_form_ajax.asp page 
	//and passes it the param variable using a get request
	//When the function completes it calls the show_response function passing it the output from the 
	//update_form_ajax.asp page
	new Ajax.Request('/lib/captcha/getCaptcha.asp',{method: 'get', parameters: param, onComplete: show_Captcha } )
};		

function show_Captcha(originalRequest)
{ 
	//Splits the response text and updates the associated form elements
	parsed_string = originalRequest.responseText.split("|");
  if (parsed_string[0] == "Yes" && parsed_string[0] != '' ) {
			  hasPassed = true;		  
	}
	else {
	      hasPassed = false;
	}
	/**
  if (parsed_string[1] != '' ) {
			//prints out the code
			alert(parsed_string[1]);  	  
	}
	*/
}	;		
