// validateCaptcha
//
// Example taken from:
//
// http://www.darksideofthecarton.com/2008/12/15/validating-recaptcha-with-jquery-and-ajax/
//
function validateCaptcha()
{
    challengeField = $("input#recaptcha_challenge_field").val();
    responseField = $("input#recaptcha_response_field").val();
    //alert(challengeField);
    //alert(responseField);
    //return false;
    var html = $.ajax({
    type: "POST",
    url: "/information-technology/scripts/ajax.recaptcha.php",
    data: "recaptcha_challenge_field=" + challengeField + "&recaptcha_response_field=" + responseField,
    async: false
    }).responseText;

    if(html == "success")
    {
        //alert('success!');
        $("#captchaStatus").html("Success. Submitting form.");
        return true;
    }
    else
    {
        //alert('failure!, html="' + html + '"');
        $("#captchaStatus").html("Your captcha is incorrect. Please try again");
        Recaptcha.reload();
        return false;
    }
}
