function validate(formData, jqForm, options)
{
	var errors = "";
	
	document.getElementById("comment-list-preview").innerHTML  = "<li class='status'>Loading...<\/li>";

	var form = jqForm[0]; 

	if(form.logged_in.value == 0)
	{	
		if (!form.author.value)
			errors += "<li>Author Name missing</li>";
		if (!form.email.value)
			errors += "<li>Email missing</li>";
		if (!form.comment.value)
			errors += "<li>Comment Body is empty</li>";
	}
	
	if(errors != "")
	{
		document.getElementById("comment-list-preview").innerHTML = "<li class='error'><strong>You have the following errors</strong><ul>"+errors+"</ul></li>";
		return false;
	}
	
 	return true;
}
/*
$(document).ready(function() {
	$('#form1').ajaxForm({
		target: "#comment-list-preview",
		beforeSubmit: validate,
		success : function(){
			$("comment-list-preview").fadeIn("slow");
		}
	});
});*/