function initPage(){$(".displayContent img, .articleContent img").each(function(){if($(this).width()>580){$(this).width(580)}})}function initReplyClick(){$(".commentReplyClick").click(function(){$("#contents").val(this.title+$("#contents").val());self.location.href="#respond";$("#contents").focus();return false})}function getComments(artId,pg){$("#comments").html("<div class=\"commentsLoading\">正在载入评论数据, 请稍后...</div>");location.href="#comments";$.ajax({url:$("#appPath").val()+"Service.aspx?act=comment&mode=list&artId="+artId+"&page="+pg,type:"POST",dataType:"xml",success:function(data){$("#comments").html($(data).find("html").text());if($(data).find("msg").text()){alert($(data).find("msg").text())}initReplyClick()},error:function(e){alert("出错！")}})}function getPasswordArticle(artId){$("#sysArticlePasswordCheckButton_"+artId).attr("disabled","disabled");var pwd=$("#sysArticlePasswordCheckInput_"+artId).val();$.ajax({url:$("#appPath").val()+"Service.aspx?act=passwordArticle",type:"POST",data:{artId:artId,pwd:pwd,isContent:1},dataType:"xml",success:function(data){if($(data).find("error").text()=="0"){$("#articleContentDom_"+artId).html($(data).find("result").text());initPage()}else{alert($(data).find("msg").text())}$("#sysArticlePasswordCheckButton_"+artId).removeAttr("disabled")},error:function(e){alert("出错")}})}$(document).ready(function(){initPage();$("#comment_form").submit(function(){$("#cmtSubmit").attr("disabled","disabled");$("#cmtSubmit").val("提交中...");var myArtId=$("#artId").val();var myName=$("#author").val();var myMail=$("#mail").val();var myUrl=$("#url").val();var myContent=$("#contents").val();$.ajax({url:$("#appPath").val()+"Service.aspx?act=comment&mode=post&artId="+myArtId,type:"POST",data:{author:myName,mail:myMail,url:myUrl,content:myContent},dataType:"xml",success:function(data){$("#comments").html($(data).find("html").text());if($(data).find("msg").text()!=""){alert($(data).find("msg").text())}else{location.href="#comments"}$("#cmtSubmit").removeAttr("disabled");$("#cmtSubmit").val("提交评论");$("#contents").val("")},error:function(e){alert("出错")}});return false});initReplyClick()});