function add_comment(blog_post_id)
{
	error_message = '';

	if ($F('blog_comment') == '') {
		$('blog_comment').focus();
		error_message = 'Please enter comment';
	}

	$('blog_comment_error').update(error_message);

	if (error_message == '') {
		
		pars = 'cmd=add';
		pars += '&comment=' + $F('blog_comment');
		pars += '&blog_post_id=' + blog_post_id;
		
		var myAjax = new Ajax.Request(
				'control/blog.php',
				{
					method: 'get',
					parameters: pars,
					onComplete: showResponse
				}
			);

	}

	function showResponse(originalRequest)
	{
		if (originalRequest.responseText == 'OK') {
			document.location.href = '/blog_comments/' + blog_post_id + '/';	
		} else {
			$('blog_comment_error').update(originalRequest.responseText);	
		}
	}
	
	return false;
}







