addComment={interval:0,replying:0,action_id:0,showOne:commentingL10n.rpl_show_1.replace("%name%",'<span class="poster-name"></span>').replace("%count%",'<span class="post-count">&nbsp;</span>'),hideOne:commentingL10n.rpl_hide_1.replace("%name%",'<span class="poster-name"></span>').replace("%count%",'<span class="post-count">&nbsp;</span>'),showMany:commentingL10n.rpl_show_2.replace("%name%",'<span class="poster-name"></span>').replace("%count%",'<span class="post-count">&nbsp;</span>'),hideMany:commentingL10n.rpl_hide_2.replace("%name%",'<span class="poster-name"></span>').replace("%count%",'<span class="post-count">&nbsp;</span>'),moveForm:function(c,b,d,a){var e=jQuery("#"+c+" > .comment-body .comment-meta").next().text(),f=jQuery("#"+c+" > .comment-body cite.fn").text();if(addComment.replying){addComment.cancelReply()}addComment.replying=b;jQuery("#comment-form #comment").focus().before(jQuery('<blockquote class="reply-quote"><cite>'+f+"</cite><p>"+(e.length>130?e.substring(0,129)+"&hellip;":e)+"</p></blockquote>").hide()).prev(".reply-quote").slideDown();jQuery("#comment-form input#comment_parent").attr({value:b});jQuery("#"+c+" > .comment-body ").find(".comment-reply-link").hide();jQuery("#comment-form #cancel-comment-reply-link").show();if(typeof jQuery.scrollTo=="function"){jQuery.scrollTo(jQuery("#respond"),{duration:500})}return false},cancelReply:function(){if(addComment.replying!==0){addComment.replying=0;jQuery("#comment-form .reply-quote").slideUp(500,function(){jQuery(this).remove()});jQuery("#comment-form input#comment_parent").attr({value:0});jQuery("#comment-form #cancel-comment-reply-link").hide();jQuery("#commentlist").find(".comment-reply-link").show()}jQuery("#comment-form .submit").attr({disabled:""}).removeClass("disabled");addComment.startInterval(true)},commentDepth:function(b){var a;if(b){a=jQuery("li#comment-"+b).attr("class").match(/\bdepth-(\d+)\b/i);return[1]!==undefined&&parseInt(a[1],10)>0?parseInt(a[1],10):1}else{return 0}},error:function(a){if(typeof a!=="string"){return false}jQuery("#comment-form .textarea-border").after(jQuery('<div class="error">'+a+"</div>").hide()).next(".error").slideDown("slow",function(){var b=jQuery(this);if(undefined!==jQuery(this)[0].style){jQuery(this).css("FILTER","");jQuery(this)[0].style.filter=""}setTimeout(function(){jQuery(b).slideUp("slow",function(){jQuery(this).remove()})},5000)});return true},deleteComment:function(b,c){var a=jQuery("ul#commentlist li#comment-"+b+", #trackback-list li#comment-"+b).length;if(!a){return true}if(c=="unapprove"&&jQuery("ul#commentlist li#comment-"+b+" > .comment-body:has( .moderation )")){return true}jQuery("li#comment-"+b+" > .comment-body").slideUp("slow",function(){jQuery(this).text("Deleted comment").slideDown().parent("li#comment-"+b).addClass("deleted")});return true},newComment:function(b,c,g,f,e){var a=jQuery("ul#commentlist li#comment-"+c+", #trackback-list li#comment-"+c).length,d;if(a){jQuery("ul#commentlist li#comment-"+c).find(".moderation").slideUp("slow",function(){jQuery(this).remove()});if(jQuery("li#comment-"+c).hasClass("deleted")){jQuery("li#comment-"+c+" > .comment-body").slideUp("slow",function(){jQuery(this).html(jQuery(b).find(".comment-body").html()).slideDown("slow")}).removeClass("deleted")}return true}if(e=="comment"&&g>0){if(jQuery("ul#commentlist li#comment-"+g).length){if(!jQuery("ul#commentlist li#comment-"+g+" > ul.children").length){jQuery("ul#commentlist li#comment-"+g+" > div.comment-body").after('<ul class="children"></ul>')}jQuery("ul#commentlist li#comment-"+g+" > ul.children").append(jQuery(b).hide().addClass("rolledup"));d=jQuery("li#comment-"+g).attr("class").match(/(?:\s|^)depth-(\d+)\s?/i);if(d[1]!==null&&d[1].match(/\d+/)){jQuery("ul#commentlist li#comment-"+c).removeClass("depth-1 depth-2 depth-3 depth-4 depth-5 depth-6 depth-7 depth-8 depth-9 depth-10").addClass("depth-"+(parseInt(d[1],10)+1));if((parseInt(d[1],10)+1)>=commentingL10n.max_depth){jQuery("ul#commentlist li#comment-"+c+" > div.comment-body .comment-reply-link").remove()}}if(jQuery("#comment-"+c).closest("li:has(div.toggle)").children(".toggle").hasClass("hidden")){jQuery("#comment-"+c).closest("li:has(div.toggle)").children(".toggle").removeClass("hidden").next("ul.children").slideDown("fast",function(){jQuery(this).prev("div.toggle").css({backgroundPosition:"bottom right"})})}addComment.toggleToggleText(jQuery("#comment-"+c).closest("li:has(div.toggle)").children(".toggle"));addComment.addToggles()}}else{if(e!=="comment"&&jQuery("#trackback-list").length){jQuery("#trackback-list").append(jQuery(b).hide().addClass("rolledup"))}else{if(commentingL10n.order==="desc"){jQuery("li#respond").after(jQuery(b).hide().addClass("rolledup"))}else{jQuery("li#respond").before(jQuery(b).hide().addClass("rolledup"))}}addComment.addToggles()}if(!f){jQuery("#comment-"+c).addClass("new").children("#div-comment-"+c).find(".comment-meta").prepend('<span class="new-comment"></span>');jQuery("#div-comment-"+c).bind("mouseover",function(){jQuery(this).find(".comment-meta span.new-comment").fadeTo(1000,0,function(){jQuery(this).closest("li").removeClass("new");jQuery(this).remove()})})}jQuery("ul#commentlist, ul#trackback-list").find(".rolledup").slideDown(500,function(){if(f){jQuery.scrollTo(jQuery("#comment-"+c),{duration:500})}}).removeClass("rolledup");if(e!=="comment"){addComment.trackbackToggle(400)}return true},submit:function(b){var a=false;jQuery(b).find(".vital").each(function(){var c=jQuery(this).attr("value");if(c===undefined||c===""){a=true;jQuery(this).addClass("oops");setTimeout(function(){jQuery("#comment-form .vital").removeClass("oops")},6000)}else{jQuery(this).removeClass("oops")}});if(a){addComment.error(commentingL10n.err_txt_mis);return false}addComment.startInterval(false);jQuery(b).ajaxSubmit({beforeSubmit:function(c){jQuery("#comment-form .submit").attr({disabled:"disabled"}).addClass("disabled")},type:"POST",data:{_spec_ajax:"Why are you looking at this POST data?",action:"new_comment_added",depth:addComment.commentDepth(addComment.replying)},error:function(c,d){var f;if(c.status===500){f=jQuery(c.responseText).text().replace(/(\s+|\t|\r\n|\n|\r)+/g," ");if(f===""||f===undefined){f=c.status+" "+c.statusText}addComment.error(f)}else{if(typeof d==="string"){addComment.error(d)}else{addComment.error("Oops!")}}addComment.cancelReply()},success:function(c){var g;try{g=JSON.parse(c)}catch(f){if(typeof c==="string"){addComment.error(c)}else{addComment.error("Oops!")}addComment.cancelReply();return}addComment.newComment(g.html,g.comment_ID,g.comment_parent,true,"comment");addComment.cancelReply();jQuery("#comment-form #comment").val("")}});return false},addToggles:function(a){jQuery("#commentlist li.depth-"+commentingL10n.nest_depth+" > ul.children").each(function(){if(!jQuery(this).prev("div.toggle").length){jQuery(this).before(jQuery('<div class="toggle"></div>').hide().css({opacity:0}));jQuery(this).prev("div.toggle").show().fadeTo("slow",1,function(){if(undefined!==jQuery(this)[0].style){jQuery(this).css("FILTER","");jQuery(this)[0].style.filter=""}})}if(a===true){jQuery(this).hide().prev("div.toggle").addClass("hidden")}addComment.toggleToggleText(jQuery(this).prev("div.toggle"))})},toggleToggleText:function(a){if(typeof a!=="object"&&typeof a==="string"){a=jQuery(a)}a.each(function(){var c=jQuery(this).prev("div.comment-body").find("cite.fn").text(),b=jQuery(this).next("ul.children").find("li.comment").length;if(jQuery(this).hasClass("hidden")){jQuery(this).html(b==1?addComment.showOne:addComment.showMany)}else{jQuery(this).html(b==1?addComment.hideOne:addComment.hideMany)}jQuery(this).find(".post-count").text(b);jQuery(this).find(".poster-name").text(c!=""?c:commentingL10n.unknown)});return true},startInterval:function(a){if(a===true){if(undefined!==commentingL10n.update&&commentingL10n.update==1){addComment.interval=setInterval(function(){addComment.getCommentUpdates()},parseInt(commentingL10n.polling,10)>=10?commentingL10n.polling*1000:10000)}}else{clearInterval(addComment.interval)}},getCommentUpdates:function(){var a={_spec_ajax:"Why is everyone looking at me",action:"get_comment_changes",action_id:addComment.action_id,time:commentingL10n.time,post_id:commentingL10n.post_id};jQuery.post(commentingL10n.ajax_url,a,function(c){var g,b;try{g=JSON.parse(c)}catch(f){if(typeof c==="string"){addComment.error(c)}else{addComment.error("Oops!")}return}if(g!==null&&g!==undefined){for(b in g){commentingL10n.time=g[b].log_date!==null?g[b].log_date:g[b].comment_date;addComment.action_id=g[b].action_id!==null?g[b].action_id:0;if(g[b].action==="approve"&&g[b].html!==undefined&&g[b].html!==null&&g[b].html!==""){addComment.newComment(g[b].html,g[b].comment_ID,g[b].comment_parent,false,g[b].comment_type)}else{addComment.deleteComment(g[b].comment_ID,g[b].action)}}}})},trackbackToggle:function(a){if(jQuery("#trackback-list").height()>(a>0?a:400)&&!jQuery("#trackback-list").prev(".trackback-toggle").length&&jQuery("#trackback-list").length){jQuery("#trackback-list").hide().before('<div class="trackback-toggle"><span class="toggle-text">'+commentingL10n.tb_show+"</span></div>").prev(".trackback-toggle").click(function(){jQuery(this).toggleClass("active").next("#trackback-list").slideToggle("fast",function(){jQuery(this).prev(".trackback-toggle").children(".toggle-text").text(jQuery(this).css("display")==="none"?commentingL10n.tb_show:commentingL10n.tb_hide)})})}jQuery("#commentlist li.pingback > .comment-body .comment-content, #commentlist li.trackback > .comment-body .comment-content").each(function(){if(jQuery(this).prev(".trackback-toggle").length){return true}var b=commentingL10n.tb_from.replace("%s",'<span class="tb-from">'+jQuery(this).find("cite.fn").text()+"</span>");jQuery(this).hide().addClass("with-toggle").before('<div class="trackback-toggle"></div>').prev(".trackback-toggle").html(b).click(function(){jQuery(this).next(".comment-content").slideToggle("fast")});return true})},_init:function(){jQuery(document).ready(function(a){addComment.startInterval(true);a.ajaxSetup({cache:false,timeout:(commentingL10n.polling*1000)-2000});a("form#comment-form").submit(function(){addComment.submit(this);return false});a("#cancel-comment-reply-link").click(function(){addComment.cancelReply();return false});addComment.addToggles(true);a("#commentlist div.toggle").live("click",function(){if(a(this).hasClass("hidden")){a(this).removeClass("hidden").next("ul.children").slideDown("fast",function(){a(this).prev("div.toggle").css({backgroundPosition:"bottom right"})})}else{a(this).addClass("hidden").next("ul.children").slideUp("fast",function(){a(this).prev("div.toggle").css({backgroundPosition:"top left"})})}addComment.toggleToggleText(jQuery(this))});addComment.trackbackToggle(400);a("#commentlist .comment-link").live("click",function(){var d=a(this).attr("href"),c=a(this).text(),b=a('<div class="comment-link-display"><span>'+c+'</span><input type="text" value="'+d+'" /></div>');a("body").append(b).find(".comment-link-display").css({position:"absolute",top:(a(this).offset().top-27)+"px",left:(a(this).offset().left+5)+"px",zIndex:100,opacity:0}).fadeTo("fast",1,function(){a(this).find("input").blur(function(){a(this).parents(".comment-link-display").fadeTo("fast",0,function(){a(this).remove()})});a(this).find("input").focus()});return false});a(".comment-link-display input").live("focus",function(){this.select()})})}};addComment._init();