$(document).ready(function(){
	//global vars
	var form = $("#feedbackForm");
	var comment = $("#comment");
	var commentError = $("#commentError").hide();
	
	comment.blur(validateComment);
	
	form.submit(function(){
		if(validateComment()){
			return true;
		}else{
			return false;
		}
	});
	
	function validateComment(){
		//if not valid
		if(comment.val().length == 0){
			commentError.text("Please enter a comment").slideDown("fast");
			return false;
		}else{
			commentError.slideUp("fast");
			return true;
		}
	}
	
});
