// Does the AJAX call to validate the CAPTCHA code entered by the user
function capValidate()
{
document.body.style.cursor='wait';
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
    var xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
    var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
var objCCode = document.getElementById("captchacode");
var strCCode = objCCode.value;
//alert("strCCode: " + strCCode);
//return false;
var strURL = "http://www.pearceband.org/includes/verify.asp";
xmlhttp.open("POST",strURL,false);
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xmlhttp.send("CCode="+strCCode);

//alert("ResponseText is " + xmlhttp.responseText);
//return false;

if (xmlhttp.responseText=="NoMatch") {
    alert("Sorry, you did not enter the correct code. Please try again or change the image and try again.");
    document.body.style.cursor='auto';
    return false;
    }
else {
    document.body.style.cursor='auto';
    return true;
    }    
}
