function EditBlogComment(id) {
	field = 'comment_text_'+id;
	fields = document.admin_blog_comments.elements;
	textarea = fields[field];
	//alert(textarea.readOnly);
	textarea.readOnly = false;
	textarea.focus();
	buttonname = 'save_button_'+id;
	button = fields[buttonname];
	button.disabled = false;
	buttonname = 'approve_button_'+id;
	button = fields[buttonname];
	button.disabled = true;
}

var BlogCommentResponse = function(response) {
	alert(response);
	window.location.reload();
}

function SaveBlogComment(id) {
	field = 'comment_text_'+id;
	fields = document.admin_blog_comments.elements;
	textarea = fields[field].value;
	//alert(textarea);
	parameters = '';
	parameters += 'id='+id;
	parameters += '&text='+textarea;
	parameters += '&f=save';
	if (confirm('Click OK to save your changes to this comment...')) {	
		hajax('/blog/ajax/comments.php', BlogCommentResponse, parameters, 'POST');
	}
}

function ApproveBlogComment(id) {
	parameters = '';
	parameters += 'f=approve';
	parameters += '&id='+id;
	if (confirm('Click OK to Approve this Comment...')) {
		hajax('/blog/ajax/comments.php', BlogCommentResponse, parameters, 'POST');
	}
}

function DeleteBlogComment(id) {
	parameters = '';
	parameters += 'f=delete';
	parameters += '&id='+id;
	if (confirm('Are you sure you want to delete this comment?\n')) {
		hajax('/blog/ajax/comments.php', BlogCommentResponse, parameters, 'POST');
	}
}
