$(document).ready(function( ) {

	$("#commentForm").submit( function(e) {
		if(tinyMCE) tinyMCE.triggerSave( );
		$.get(basedir+"ajax/comments.php", {comment: $("#comment").val( ), item: $("#item").val( ), type: $("#type").val( ), name: $("#name").val( )}, function(xml) {
			$("#commentsContainer").prepend($("comment", xml).text( ));
			$("#commentForm").replaceWith($("message", xml).text( ));
		//	$("#commentForm").css({display: "none"}); // remove the comment form so they can only comment once.

		});

		return false;

	});

	$(".jswarning").css({display: "none"});

});