var toggleContact = function() {
	if ($('#toggle_slide').hasClass('shown')){
		$('#toggle_slide').toggleClass('shown').slideUp("slow");
	}
	else {
	$('#toggle_slide').toggleClass('shown').slideDown("slow");
	}
}

var toggleSubmit = function() {
//Form variables
var name = $("#name").val();
var phone = $("#phone").val();
var email = $("#email").val();
var business = $("#business").val();
var comments = $("#comments").val();

//Assemble variable array
var dataString = 'name='+ name + '&phone=' + phone + '&email=' + email + '&business=' + business + '&comments=' + comments;

//Check for required fields
if(name=='Your Name...' || email=='Your Email...')
{
$('.success').fadeOut(200).hide();
$('.error').fadeOut(200).show();
}

//Check captcha and send to post.cfm
else
{
	if (validateCaptcha()){
		$.ajax({
		type: "POST",
		url: "http://" + window.location.hostname + "/includes/post.cfm",
		data: dataString,
		success: function(){
		$('.success').fadeIn(200).show();
		$('.error').fadeOut(200).hide();}
		});
	}
	return true;
}
return false;
};

// Validate CAPTCHA 
function validateCaptcha()
{
    challengeField = $("input#recaptcha_challenge_field").val();
    responseField = $("input#recaptcha_response_field").val();
    var html = $.ajax({
    type: "POST",
    url: "http://" + window.location.hostname + "/includes/action.cfm",
    data: "recaptcha_challenge_field=" + challengeField + "&recaptcha_response_field=" + responseField,
    async: false
    }).responseText;
	//alert (html);
	html = jQuery.trim(html);
    if(html == "success")
    {
        $("#success").html("");
        return true;
    }
    else
    {
		$('.error').fadeOut(200).hide();
	    $("#success").html("Your captcha is incorrect. Please try again");
		Recaptcha.reload();
        return false;
    }
}