var activeCommentId;
		
function removeDefaultText(which, text) {
	if (which.value == text) {
		which.value = "";
		which.style.color = "#333";
	}
}

function insertDefaultText(which, text) {
	if (which.value == "") {
		which.value = text;
		which.style.color = "#999";
	}
}

function resetDefaultText(which, text) {
	which.value = text;
	which.style.color = "#999";
}
		
function submitComment(which) {
	blogId = which.id.substr(0, which.id.length-7); // Remove '_submit'
	name = $(blogId + '_alias').value;
	message = $(blogId + '_comment').value;
	activeCommentId =  blogId;
	blogId = blogId.substr(4, blogId.length);
	runQuery("http://blog.dustinfarris.com/action/_putComment.php", "blogId=" + blogId + "&name=" + name + "&message=" + message, "finishComment");
	
}
		
function finishComment(str) {
	resetDefaultText($(activeCommentId + '_alias'), "Name");
	resetDefaultText($(activeCommentId + '_comment'), "Your text.");
	
	window.location.reload();
	
	//$('oldcomments').innerHTML = str + $('oldcomments').innerHTML;
}
