//set captcha style
var RecaptchaOptions = {
	theme : 'custom',
	custom_theme_widget: 'recaptcha_widget'
};
//validate it on click
function validateCaptcha()
{

	challengeField = $("input#recaptcha_challenge_field").val();
	responseField = $("input#recaptcha_response_field").val();
	//console.log(challengeField);
	//console.log(responseField);
	//return false;
	var html = $.ajax({
		type: "POST",
		url: "valid-cap.php",
		data: "recaptcha_challenge_field=" + challengeField + "&recaptcha_response_field=" + responseField,
		async: false
		}).responseText;

	//console.log( html );
	if(html == "success") {
		$("form").attr("action", "help-request-confirmation.php");
		initNav();
		form.submit();
		//Add the Action to the Form
		//Indicate a Successful Captcha
		//$("#captchaStatus").php("Success!");
		// Uncomment the following line in your application
		return true;
	} else {
		$("#captchaStatus").html("The security code you entered did not match. Please try again.");
		Recaptcha.reload();
		return false;
	}
}

function validateContest()
{
	challengeField = $("input#recaptcha_challenge_field").val();
	responseField = $("input#recaptcha_response_field").val();
	//console.log(challengeField);
	//console.log(responseField);
	//return false;
	var html = $.ajax({
		type: "POST",
		url: "valid-cap.php",
		data: "recaptcha_challenge_field=" + challengeField + "&recaptcha_response_field=" + responseField,
		async: false
		}).responseText;
	//console.log( html );
	if(html == "success") {
		$("form").attr("action", "contest-entry-form-02");
		form.submit();
		//Add the Action to the Form
		//Indicate a Successful Captcha
		//$("#captchaStatus").php("Success!");
		// Uncomment the following line in your application
		
		return true;
	} else {
		$("#captchaStatus").html("The security code you entered did not match. Please try again.");
		Recaptcha.reload();
		return false;
	}
}
function validateInstant()
{
	challengeField = $("input#recaptcha_challenge_field").val();
	responseField = $("input#recaptcha_response_field").val();
	//console.log(challengeField);
	//console.log(responseField);
	//return false;
	var html = $.ajax({
		type: "POST",
		url: "valid-cap.php",
		data: "recaptcha_challenge_field=" + challengeField + "&recaptcha_response_field=" + responseField,
		async: false
		}).responseText;

	//console.log( html );
	if(html == "success") {
		$("form").attr("action", "instant-win");
		initNav();
		form.submit();
		//Add the Action to the Form
		//Indicate a Successful Captcha
		//$("#captchaStatus").php("Success!");
		// Uncomment the following line in your application
		
		return true;
	} else {
		$("#captchaStatus").html("The security code you entered did not match. Please try again.");
		Recaptcha.reload();
		return false;
	}
}
