$(function(){
	$('#commentInput').elastic();

	// submit comment
	$('#commentInput').keyup(function () {$('#scriptDetailsPostComment').height($(this).height()+205);});
	$('#submitComment').click (function () {
		$.post ('/include/js/site/submitnewscomment.php', {newsid: $('#newsid').val (), name: $('#name').val (), comment: $('#commentInput').val (), code: $('#code').val ()}, function (response) { 
			if (!response)
				$('#scriptDetailsPostComment').slideUp(500, function () {$('#scriptDetailsCommentPosted').slideDown(500);});
			else
				$('#scriptDetailsPostCommentError').slideDown (250);
				
		});
	});	
});


