function replyPost(forumid, topicid, postid, clearerror) { // Appened post form to post container $("forumpost_"+postid).appendChild($("form_newmessage")); // Let software know we want to reply to this post $("form_message_replyid").value = postid; $("form_message_editid").value = 0; $("messageposttype").value = "new"; $("newpostbutton").show(); $("forumpostcaption").update("Reply to this post:"); v_posteditor.setValue(""); if (clearerror) $("posterror").update(""); v_posteditor.enable(); } function editPost(forumid, topicid, postid, clearerror) { // Appened post form to post container $("forumpost_"+postid).appendChild($("form_newmessage")); // Let software know we want to edit this post $("form_message_replyid").value = 0; $("form_message_editid").value = postid; $("messageposttype").value = "edit"; $("newpostbutton").show(); $("forumpostcaption").update("Edit your post:"); if (clearerror) $("posterror").update(""); v_posteditor.disable(); v_posteditor.setValue(""); new Ajax.Request("/forum/getpost.php", { "method": "post", "parameters": {"getpost":postid}, onSuccess: function(transport) { onEditPost(transport.responseText); } }); } function onEditPost(bbtext) { v_posteditor.setValue(bbtext); v_posteditor.enable(); } function newPost(clearerror) { // Appened post form to newpost container $("newpostcontainer").appendChild($("form_newmessage")); // Let software know we DON'T want to reply to this post $("form_message_replyid").value = 0; $("form_message_editid").value = 0; $("messageposttype").value = "new"; v_posteditor.setValue(""); $("newpostbutton").hide(); $("forumpostcaption").update("Post a new message:"); if (clearerror) $("posterror").update(""); v_posteditor.enable(); }