function PreSubmit(){return UpdateEditorElement(),CKEDITOR.instances.ckMent.getData()==""?(alert("必须输入评论内容！"),!1):!0}function InitAuditPop(){$("#aud_rblAudit").click(function(){var n=$("#aud_rblAudit_1").prop("checked"),t;$("#divOpn").toggleClass("hide",!n);$("label[for='aud_rblAudit_1']").text(n?"未通过，原因：":"未通过");n&&(t=CKEDITOR.instances.aud_tbOpn,t&&t.focus())});MakeEditor("#aud_tbOpn",null,110,!1,!1)}function reply(){var n=CKEDITOR.instances.ckMent,t,i;n&&(t=getEventSrc(),i=$(t).closest("tr").find("a:first").text(),n.insertHtml("@"+i+"<p><\/p>"),n.focus())}function quote(){var i=CKEDITOR.instances.ckMent,u,n,t;if(i){u=getEventSrc();n=$(u).closest("tr").find("td:first").html();n=n.substr(n.indexOf("<"));n=n.replace(/<\/a>/i,"<\/a> ");var e=$(u).closest("table").find(".con:first"),o=e.find("div.inbubble"),r=o.length>0?o.html():e.html(),f=r.toLowerCase();f.indexOf("<legend>引用 ")>-1?(t=f.lastIndexOf('<p class="replied"'),t==-1&&(t=f.lastIndexOf("<p class=replied")),t>0?i.insertHtml("<div class='quote'>"+r.substr(0,t)+"<div class='refsrc'>"+n+" 发表：<\/div>"+r.substr(t)+'<\/div><p class="replied"><\/p>'):i.insertHtml("<div class='qu'><fieldset><legend>引用 "+n+" 的评论：<\/legend>"+r+'<\/fieldset><\/div><p class="replied"><\/p>')):i.insertHtml("<div class='qu'><fieldset><legend>引用 "+n+" 的评论：<\/legend>"+r+'<\/fieldset><\/div><p class="replied"><\/p>');i.focus()}}function del(){if(confirm("确定删除该评论吗？")){var n=getEventSrc();toDelId=$(n).closest("table").attr("rid");__doPostBack("btnDel",toDelId)}else return!1}function clearAll(){confirm("确定要清空当前主题下的所有评论吗？")&&__doPostBack("btnDel","0")}function auditCmnt(n){PageMethods.AuditCmnt(n,function(t){/\d+/.test(t)?$("table[rid="+n+"]").removeClass("unaudit").find("img[onclick*='auditCmnt']").remove():alert(t)})}function edit(){var n=CKEDITOR.instances.ckMent,t;if(n){t=getEventSrc();$("#editId").val($(t).closest("table").attr("rid"));$("#btnMent").val("修改评论");$("#btnCanel").removeClass("hide");$("#writeMent .blockTitle").text("修改评论：");var i=$(t).closest("table").find("td:last"),r=i.find("div.inbubble"),u=r.length>0?r.html():i.html();n.editable().setHtml(u);n.focus()}}function canelEdit(){var n=CKEDITOR.instances.ckMent;n&&($("#editId").val(""),n.editable().setHtml(""),$("#btnCanel").addClass("hide"),$("#btnMent").val("发表评论"),$("#writeMent .blockTitle").text("发表评论："))}function SaveOkPrompt(n,t){n=="edit"?(canelEdit(),ShowMsgPop("修改成功！"+(t?"":"在审核通过前，该评论不会显示。"))):(CKEDITOR.instances.ckMent.editable().setHtml(""),t?$("#comments").length==0&&ShowMsgPop("评论已提交成功！但您本人因权限原因，无法查看。"):ShowMsgPop("评论已提交，等待审核。"))}function toPage(n){$("#curPageIndex").val(n);showLoading();__doPostBack("curPageIndex","")}function toWrite(){var n=CKEDITOR.instances.ckMent;n&&n.focus()}function toEdit(n){getFrame().is("#ifr_main")?parent.location="m_infoEdit.aspx?id="+n:location="infoEdit.aspx?id="+n}function toExport(){return toExportAs("#content",null,$("#pageTitle").text(),"#prompt","border-width:0;background:#fff")}function toPrint(){return $("#content").printIt({pageTitle:$("#pageTitle").text(),styleToAdd:"border-width:0;background:#fff",exclude:"#prompt"}),!1}LoadEditor();var toDelId;$(function(){$(".ui-tabs").tabs().fadeIn(350);MakeEditor("#ckMent","Compact",132,!1,!1);InitScroller()})