var xmlhhtp;

function loadComments(commentBoxID){
	$("#comments").load("phpdb/" + commentBoxID + "_comments.txt");
}

function newComment(where){
var n = document.getElementById('name').value;
var c = document.getElementById('comment').value;
if (n == "" || c == "") {
	//invalid comment
	$("#commentwarningmsg").fadeIn("medium");
} else {
	$("#commentwarningmsg").fadeOut("fast");
	$.post('comments.php', {
		loc: "phpdb/" + where + "_comments.txt",
		name: n,
		comment: c
	}, function(data) {
		document.getElementById('name').value="";
		document.getElementById('comment').value="";
		document.getElementById('comments').innerHTML = data;
	});
}
}


