 var captcha = false;
      
      //Validate the Recaptcha' Before continuing with POST ACTION
      function validate_recaptcha(buttonID,urlLink,updateID,formID)
		{
		    var original_button_val = document.getElementById(buttonID).value;
		     
		    //Disable the button ensuring only one AJAX request is sent to the server
		    document.getElementById(buttonID).disabled=true;
		    //Change text of button informing user that their ReCaptcha is being validated
		    document.getElementById(buttonID).value='validating...';
		    //Change text of captchaErrorMsg informing user that their ReCaptcha is being validated
		    document.getElementById('captchaErrorMsg').innerHTML = 'Validating your ReCaptcha entry...';
		     
                     $.ajax({
                               type: "POST",
                               url: "ReCaptcha.now",
                               data: $("#"+formID).serialize(),
                               async: false,
                               success: function(response){successFunc(response,buttonID,original_button_val,urlLink,updateID,formID); }
                             });
                    
                    // captcha contains the success/failure result
                    return captcha;                     
		    
		}

//The onSuccess function 
		function successFunc(response,buttonID,original_button_val,urlLink,updateID,formID)
		{
		    //Check response from captchaAjax.html
		    if (response == 'success')
		    {
		        //Change text of button informing user that their request is now being processed
		        document.getElementById(buttonID).value='processing...';
		        //Change text of captchaErrorMsg informing user that their captcha was validated
		        document.getElementById('captchaErrorMsg').innerHTML = 'ReCaptcha entry validated. ';        
		        captcha = true;
		    }
		    else
		    {
		        //ReCaptcha Failed - revert button to original state
		        document.getElementById(buttonID).disabled=false;
		        document.getElementById(buttonID).value=original_button_val;
		         
		        //Change text of captchaErrorMsg informing user that their ReCaptcha entry failed validation and reload the ReCaptcha
		        document.getElementById('captchaErrorMsg').innerHTML = 'The captcha you entered was incorrect. Please try again.';
		        Recaptcha.reload();
		        captcha = false;
		    }
                    return captcha;
		}
		
//The onFailure function
		function failureFunc(response)
		{
		     alert("reCaptcha service is not available at moment" );   
                     captcha = false;
		}
				