var blogTimeTag=true;$(document).ready(function(){changeFontsize(".Wsmall,.Wmiddle,.Wbig",".Columntextall","fontSizeHighlight");if($("div.scrollable1")){$("div.scrollable1").scrollable({size:1,keyboard:false,speed:1000,clickable:false}).circular().autoscroll({interval:10000})}var c=$("div.viewPhoto img").size();if(c>0){$("div.viewPhoto").scrollable({vertical:true,size:1,keyboard:false,clickable:false}).circular().autoscroll({interval:10000}).navigator({navi:"#featureNavi",activeClass:"activeNavi"});var b=$("div.viewPhoto").scrollable();var a;b.onSeek(function(){var d=this.getIndex();if(d<0){d=Math.abs(d)}if(d==c){d=0}$("div.feature_text ul").hide().eq(d).fadeIn(600)});$("div.feature_text").mouseenter(function(){window.clearTimeout(a);b.pause()}).mouseleave(function(){a=window.setTimeout(function(){b.play()},5000)})}$("select#selectFeatureDate").change(function(){location.href="feature?date="+$(this).children("option:selected").val()});$("select#columnCode").change(function(){location.href="articlelist?columnCode="+$(this).children("option:selected").val()});$("textarea.readerCommentText:first").keypress(function(){return judgeStringLength($(this).val())<=2000});checkAll2(".checkAllCheckbox:checkbox","div.checkAll2Contain");$(".focusSelectText").focus(function(){this.select()});$("a.deletePop").overlay({onClose:function(g){var d=this.getTrigger();var h=this.getClosers();var f=g.originalTarget||g.srcElement;if(h.index(f)===1){location.href=d.attr("href")}},top:"center",closeOnEsc:false,closeOnClick:false});if($("form#deleteReaderComment")){$("div#deleteDialog").overlay({onClose:function(g){var d=this.getTrigger();var h=this.getClosers();var f=g.originalTarget||g.srcElement;if(h.index(f)===1){d.closest("form").get(0).submit()}},aip:true,top:"center",closeOnEsc:false,closeOnClick:false});$("form#deleteReaderComment").submit(function(d){d.preventDefault();if($(".checkAll2Contain :checkbox").is(":checked")){$("div#deleteDialog").overlay({onClose:function(h){var f=this.getTrigger();var i=this.getClosers();var g=h.originalTarget||h.srcElement;if(i.index(g)===1){f.closest("form").get(0).submit()}},aip:true,top:"center",closeOnEsc:false,closeOnClick:false}).load()}else{alert("请选择您要删除的评论！")}})}$(".submitReaderComment > img:last").click(function(){$("div#replyCommentShow").hide();$("div#replyCommentShow > span:first").text("");$("div#replyCommentShow > div:first").text("");$("input.hiddenCommendId").eq(0).val("");$("textarea").val("")});$("a.replyReaderComment").click(function(){$("div#replyCommentShow").hide();var e=$(this).closest("li");$("div#replyCommentShow > span:first").text("引用 "+e.find("label:first").text()+" "+e.find("span.Comments_data:first").text());$("div#replyCommentShow > div:first").text(e.find("span.Comments_body:first").text());var d=$("input.hiddenCommendId").eq(0);var f=e.attr("id");d.val(f);$("div#replyCommentShow").slideDown("slow")});$("div.articleSubmitCancel img:first").click(function(){$(".cancel2null").val("");FCKeditorAPI.GetInstance("content").SetHTML("")});$("div.editSubmitCancel img:first").click(function(){location.reload()});textareaCtrlEnterSubmit("textarea.readerCommentText:first",".submitReaderComment > input:first");$("span.returnText").click(function(){$($(this).attr("ref")).get(0).focus()});locateAd("div.moveAd","show");$("input.inputTimeLimit").keydown(onlyNumMinusSpaceColon).blur(function(){var g=$.trim($(this).val());var d=g.length;var f=$("span#BlogShowDateError li:first");if(d==0){f.text("请输入文章展示时间.");blogTimeTag=false;return}var e=/^\d{4}-\d{1,2}-\d{1,2}\s\d{1,2}:\d{1,2}:\d{1,2}$/;if(e.test(g)){blogTimeTag=true}else{f.text("文章展示时间格式不正确，正确的时间格式为年-月-日 时:分:秒，例如:2009-10-01 14:05:19 .");blogTimeTag=false}});commentFormV=$("#commentForm").validate({rules:{content:{required:true,rangelength_chineseAs2:[1,2000]}},messages:{content:{required:"请输入评论内容！",rangelength_chineseAs2:"评论内容最多输入1000个中文或2000个英文！"}},errorLabelContainer:$(".commentError:first")});contentFormV=$("#contentForm").validate({rules:{headLine:{required:true,rangelength_chineseAs2:[1,50]},articleDate:{required:true,timeFormat1:true},summary:{required:true,rangelength_chineseAs2:[1,200]},content:{CKEditorTextEmpty:"content",rangelength_chineseAs2:[1,20000]}},messages:{headLine:{required:"请输入文章标题！",rangelength_chineseAs2:"文章标题最多输入25个中文或50个英文！"},articleDate:{required:"请输入文章展示时间.",timeFormat1:"文章展示时间格式不正确，正确的时间格式为年-月-日 时:分:秒，例如:2009-10-01 14:05:19 ."},summary:{required:"请输入文章摘要！",rangelength_chineseAs2:"内容摘要最多输入100个中文或200个英文！"},content:{CKEditorTextEmpty:"请输入文章内容！",rangelength_chineseAs2:"文章内容最多输入10000个中文或20000个英文！"}},errorLabelContainer:$(".BloghintError:first")})});function initVote(){var a=$("#make_vote").validate({meta:"validate",errorPlacement:function(b,c){b.appendTo(c.closest(".voteQ").prev(".voteQtopCap").find(".voteError1").eq(0))}});$("#voteResult").click(function(){$(".hide_visib").css("visibility","visible")});$("#voteSubmit").click(function(){var f=a.form();if(f){var h=$(this).closest(".voteAll");var b=$.trim(h.attr("id"));var g=$(".lifetheading").attr("id");if($.cookie("vote_"+b)==b){$(this).hide();alert("你已经投过票了！");return}var d={};d.voteId=b;d.articleId=g;d.questions=[];var c=h.find(".voteLquestion");c.each(function(){var l=$(this).closest(".voteLquestion").attr("id");var k={};k.questionId=l;k.options=[];var j=$(this).find(":checked");j.each(function(){var m={};m.optionId=$(this).val();k.options.push(m)});d.questions.push(k)});function i(j){var k=h.find(".voteRdata");k.each(function(o){var m=$(this).find(".voteRate");var l=$(this).find(".votePNN");var n=j.questions[o];m.each(function(p){$(this).css("width",Math.round(n.options[p].choicePercent*100)+"%")});l.each(function(p){$(this).text("("+Math.round(n.options[p].choicePercent*100)+"%)")})});$(".hide_visib").css("visibility","visible")}try{VoteService.executeVote(d,function(k){if(typeof k.voteId=="number"){var j=new Date();j.setTime(j.getTime()+(8*60*60*1000));$.cookie("vote_"+k.voteId,k.voteId,{expires:j})}i(k)});$(this).hide()}catch(e){return}alert("感谢您的投票！");return}})};
