j$(document).ready(function(){
	var contactForm = j$("#xg_feedback_form");

	// Form handler.
	contactForm.submit(function(){

		// Clean the slate.
		j$("div.bc_error").hide();
		var errors = false;

		var valMessage = j$("textarea#xg_feedback_feedback").val();

		// Just indicate that there was an error if the message is empty.
		// This is so we don't have a duplicate error with existing JS
		// validation.
		if(valMessage.length == 0){
			errors = true;
		}

		// If the user did not check the privacy policy box.
		if(j$("#privacy_confirm").is(":not(:checked)")){
			j$("#privacy_error").show();
			errors = true;
		}

		if(errors){
			return false;
		}
	});
});
