$(document).ready(function(){
	$(".required").each(function() {
		$(this).after("<span class='required-star'>*</span>");
	});
	
	$('#formContent').submit(function() {
	  $(".required").each(function() {
			if ($(this).val() == "") {
				missingFields = 1;
			} else {
				missingFields = 0;
			}
	   });

	   if (missingFields) {
	  	 alert("Sorry you are missing some of the required fields.\nPlease try again.");
		 return false; // <-- important!
	   } else {
			$(this).ajaxSubmit({
		      success: function(i) {
				$("#formResponsetxt").html(i);
				$("#formContent").hide();
				$("#formResponse").show();
			 }
			});
			return false; // <-- important!
	   }
	});
	
	$('#try-form-again').livequery('click', function() {
		$("#formResponse").hide();
		$("#formContent").show();
	})
});