function PreSubmit(){return UpdateEditorElement(),CKEDITOR.instances.ckMent.getData()==""?(alert("必须输入评论内容！"),!1):!0}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 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();$.browser.oldie?n.setData(u):n.editable().setHtml(u);n.focus()}}function canelEdit(){var n=CKEDITOR.instances.ckMent;n&&($("#editId").val(""),$.browser.oldie?n.setData(""):n.editable().setHtml(""),$("#btnCanel").addClass("hide"),$("#btnMent").val("发表评论"),$("#writeMent .blockTitle").text("发表评论："))}function SaveOkPrompt(n){n=="edit"?(canelEdit(),ShowMsgPop("修改成功！")):($.browser.oldie?CKEDITOR.instances.ckMent.setData(""):CKEDITOR.instances.ckMent.editable().setHtml(""),$("#comments").length==0&&ShowMsgPop("评论已提交成功！但您本人因权限原因，无法查看。"))}function toPage(n){$("#curPageIndex").val(n);showLoading();__doPostBack("curPageIndex","")}function toWrite(){var n=CKEDITOR.instances.ckMent;n&&n.focus()}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)})