
    //code for the Recaptcha module
	var RecaptchaOptions = {
	    theme : "clean",  // the theme
	    tabindex : 3 // tab index
	};

    // jQuery Code to do a Ajax before the submit
	var ajaxUrl='recaptcha-php-1.10/Recaptcha.php';  // the url where the recaptcha input is tested
	var validateFormButtonId='validateFormButton';  // set the id of the validate form button
	var formToSubmitId='contactform'; // set the id of the form that will be submitted
	var recaptchaFormContainerId='recaptchaForm'; // the id of the div holding the recaptcha module
	var recaptchaErrorId='recaptchaError';  // the p in the div where an error is displayed
	var recaptchaError='sorry, the input did not match the image, try again';  // some text to display as the error

    // JQuery to add the click handler
	jQuery(function(){
	    jQuery('#'+validateFormButtonId).click(function(){
		getRecaptchaResponse();
	    });
	});

    // get the result and test whether to submit the form
	function getRecaptchaResponse(){
	    var recaptcha_challenge_field=jQuery('#recaptcha_challenge_field').val();
	    var rrecaptcha_response_field=jQuery('#recaptcha_response_field').val();
		
		jQuery('#'+recaptchaErrorId).html('');
		if(rrecaptcha_response_field == ''){
			jQuery('#'+recaptchaErrorId).html(recaptchaError);
			return false;
		} 

	    jQuery.get(ajaxUrl,{rcf:recaptcha_challenge_field,rrf:rrecaptcha_response_field},
		function(data){
		    if(data != 'false'){
			   jQuery('#'+validateFormButtonId).hide();
				jQuery('#'+formToSubmitId).append(data);
				
		    } else{
			Recaptcha.reload();
			jQuery('#'+recaptchaErrorId).html(recaptchaError);
		    }
		}
	    );
	}

