$(function () {
	c = $("#cmtinput");
	if (!c.length) return;
	
	dfcode_init("cmtinput");
});

function modcomments_submit() {
	$.post("/ajax/submitcomment", { "type": cmttype, "id": cmtid, "text": $("#cmtinput").val() }, modcomments_submitresult);
}

function modcomments_submitresult(text) {
	if (text == "OK") {
		location.href = cmtref;
	}
	else alert(text);
}

