function comment_delete_handler()
{
	if(http.readyState != 4) {
		return;
	}
	if(http.status != 200) {
		window.alert(http.responseText);
		return;
	} else {
		comment = document.getElementById('comment_'+http.comment_id);
		if(comment) {
			comment.parentNode.removeChild(comment);
		}
		return;
	}
}

function comment_delete(id)
{
	// attempt to delete comment
	if(window.confirm("Are you sure you want to delete this comment?")) {
		http = get_http();
		http.open("GET", "/helpers/comments.php?comment_delete="+id);
		http.comment_id = id;
		http.onreadystatechange = comment_delete_handler;
		http.send(null);
	}
	return false;
}

