$(document).ready(function(){
	$("#formComment #submit").click(function(){					   				   
		$(".error").hide();
		var hasError = false;		
		
		var messageVal  = $("#textcomment").val();
		var commentMark = $("#commentmark").val();
		if(messageVal == '') {
			$("#textcomment").after('<span class="error">Empty comment !.</span>');
			hasError = true;
		}
		
		if(hasError == false) {
			$(this).hide();
			$("#formComment li.buttons").append('<img src="/jq/ajax-loader2.gif" alt="Loading" id="loading" />');
			
			$.post("docomment.php",
   				{ textcomment: messageVal , commentmark: commentMark   },
   					function(data){
						$("#formComment").slideUp("normal", function() {				   							
						});
						$('#commentResponse').append(data);
						
   					}
				 );
			$('#commentResponse').fadeIn(3000);	
		}
		
		return false;
	});						   
});
