
function CommentDelete(entryid, cmtid, url) {

	if (confirm("Delete comment?")) {
		var newurl = "comment_delete.php?id=" + escape(cmtid) + "&entry=" + escape(entryid) + "&url=" + escape(url);
		self.location.href = newurl;
	}
}

function CommentFormCheck(frm) {

	if (frm.comment.value.length == 0) {
		alert("Comment text is required");
		frm.comment.focus();
		return false;
	}

	if (! CheckInvalidTags(frm.comment.value)) return false;

	if (! CheckTags(frm.comment.value, "b")) return false;
	if (! CheckTags(frm.comment.value, "u")) return false;
	if (! CheckTags(frm.comment.value, "i")) return false;
	if (! CheckTags(frm.comment.value, "ul")) return false;
	if (! CheckTags(frm.comment.value, "ol")) return false;
	if (! CheckTags(frm.comment.value, "li")) return false;

	return true;
}

function HelpEntryRating() {

	var msg = "The entry ranking fields are feedback for the person who submitted this entry.\n";
	msg += "These rankings have no effect on voting and can be set or changed any time.\n";
	msg += "The rankings are displayed anonymously with the photo -\n";
	msg += "your name will not be shown with these rankings.\n\n";
	msg += "Fits Subject: Does the entry convey the subject without explanation?\n";
	msg += "Composition: How is the overall composition?\n";
	msg += "Lighting: Over exposed, under exposed, or just right?\n";
	msg += "Technical: Focus, depth of field, etc.\n";
	msg += "Emotional: Emotional impact.\n";
	alert(msg);
}

function HelpEntrySubscribe() {

	var msg = "If you subscribe to this entry, you will receive an email\n";
	msg += "whenever someone leaves a comment on this entry.";
	alert(msg);
}

function HelpEntrySubscribeVoting() {

	var msg = "If you subscribe to this entry, you will receive an email whenever someone\n";
	msg += "leaves a comment on this entry. You may subscribe or unsubscribe at any time,\n";
	msg += "but you will only receive the emails for comments left after voting ends.";
	alert(msg);
}

function PageLoad() {

	if (document.commentEditForm) document.commentEditForm.comment.focus();
}
