function CancelComment(reply_id){if ( _is_rtf_ ){if ( window.frames["editor_"+reply_id] != null )window.frames["editor_"+reply_id].setHTML("");}elsejQuery("#editor_" + reply_id).html("");if ( comment_post_id != 0 ) {jQuery("#cancelButton_" + reply_id).hide();jQuery("#commentList_" + reply_id).show();comment_post_id = 0;}document.fmPost.CommentPost_ID.value = "";document.fmPost.CommentedReply_ID.value = 0;eval("document.fmPost." + _CONTENT_ + ".value = \"\";");// Stop pinging the server after a comment has been entered//spireStopPing();}function DoCommentPreview(reply_post_id){comment_post_id = reply_post_id;document.fmPost.CommentedReply_ID.value = reply_post_id;saveAll( _PREVIEW_ );}function SaveUserPost(postId, viewPostId){window.frames["userSavedPostFrame"].SaveUserPost(postId, viewPostId, _form_post_url_);}	function PixelTop( ctl ){if ( ctl )return ctl.offsetTop + PixelTop(ctl.offsetParent);elsereturn 0;}function checkCommentLength(ctl) {if (ctl.value.length > 800) {alert("This field is limited to 800 characters.");ctl.value = ctl.value.substring(0,800);ctl.focus();}}function DoCommentSpellCheck(){spellCheckWindow = window.open("about:blank", "spell_check", "height=480px,status=yes,width=640px");passSpellCheckText(getCommentContent(comment_post_id));}function passSpellCheckText(text) {text = text.replace(/\n/g, "<br>");textArea.document.open();textArea.document.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");textArea.document.write("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"></head><body>" + text + "</body></html>");textArea.document.close();document.spell_check_fm.text.value = textArea.document.body.innerHTML;document.spell_check_fm.submit();}function setValue(html,text) {if( comment_post_id != 0 ) {if ( _is_rtf_ ) { window.frames["editor_" + comment_post_id].setHTML(html);}else {document.getElementById("editor_" + comment_post_id).value = text;}}}function AddReplyPost(){eval("document.fmPost." + _CMD_ + ".value = \"Reply\";");submitForm(document.fmPost, _form_post_url_ );}function SubmitComment(reply_post_id){document.fmPost.CommentedReply_ID.value = reply_post_id;document.fmPost.CommentPost_ID.value = comment_post_id;if ( trimString(getCommentContent( reply_post_id )).length <= 0 ){alert("Please enter a comment.");}else {saveAll("AddComment", reply_post_id);}}function initEditor() {return eval("document.fmPost." + _CONTENT_ + ".value;");}function saveAll(cmd, reply_id) {if (cmd == null) {cmd = _ADD_;}eval("document.fmPost." + _CMD_ + ".value = cmd;");eval("document.fmPost." + _CONTENT_ + ".value = getCommentContent( reply_id );");if ( trimString(eval("document.fmPost." + _CONTENT_ + ".value")) != "" ) {submitForm(document.fmPost, _form_post_url_ );//return false;}	elseCancelComment(reply_id);}function getCommentContent( postid ) {if ( _is_rtf_ ) {return window.frames["editor_" + postid].getHTML();}else {return breaksToHTML(document.getElementById("editor_" + postid).value);}}function ReportPost( post_id ){eval("document.rpForm." + _POST_ID_ + ".value = post_id;");submitForm( document.rpForm );}function loginActiveMode( mode ) {if ( mode == "sign-in" ) {jQuery("#spanSignIn").show();jQuery("#linkSignIn").hide();jQuery("#spanSignUp").hide();jQuery("#linkSignUp").show();}else if ( mode == "sign-up" ) {jQuery("#spanSignIn").hide();jQuery("#linkSignIn").show();jQuery("#spanSignUp").show();jQuery("#linkSignUp").hide();}	else if ( mode == "logged-in" ) {jQuery(".loginOptions").hide();jQuery(".addComment").each(function() {var id = this.id;var idx = id.lastIndexOf("_");if ( idx >= 0 )showAddComments(id.substring(idx+1));});}}