function enable_comment_reply(){$("a.comment_reply").click(function(){var n=$(this).parents("li[id^=comment]"),t=n.attr("id").match("comment([0-9]+)")[1],i=n.find(".comment_username").html(),r=n.find(".comment_username").attr("href").replace("/user/","");return $("input#parent_id").val(t),$("input#parent_username").val(r),$("span#comment_replyto_username").html(i),$("#comment_replyto").show(),document.location.hash="add_comment",$("#comment_text").focus(),!1}).removeClass("hidden")}function enable_ajax_comment_nav(){$("#comments .paginator a").click(function(){var n=$(this).attr("href"),t=n.split("?")[0],i=n.split("=")[1];return load_comment_page(t+"?comments_page="+i),!1})}function load_comment_page(n){$("#comments .body").load(n,{},function(){document.location.hash="comments";enable_comment_reply();enable_ajax_comment_nav();enable_ajax_comment_adult();enable_ajax_reporting()})}function enable_ajax_comment_adult(){$("a.comment_adult_bypass").click(function(){return load_comment_page($(this).attr("href").replace("request_comment_page","comments_page")),!1})}$(document).on("click","a.vote_link",function(){var n=this,t=$(this).attr("href"),i=t.split("?")[0],r=t.split("?")[1];return $.ajax({url:i,data:r,dataType:"json",type:"post",success:function(t){var i,r;t.success?(i=$(n).siblings(".vote_count"),i.html(parseInt(i.text())+1),r=$(n).closest(".vote_links").find(".vote_link"),r.click(function(){return!1})):t.error&&t.error_msg&&alert(t.error_msg)}}),!1});$(document).ready(function(){enable_comment_reply();$("a.cancel_reply").click(function(){return $("input#parent_id").val(""),$("input#parent_username").val(""),$("#comment_replyto").hide(),$("span#comment_replyto_username").html("no one"),!1});enable_ajax_comment_nav();enable_ajax_comment_adult();$("#comments .previous_comments_link a").each(function(){$(this).click(function(n){var t;n.preventDefault();t=$("i",this);t.addClass("fa-circle-o-notch fa-spin");var i=$(this).attr("href"),r=i.split("?")[1],u=r.split("=")[1];return $.ajax({type:"post",url:i,success:function(n){$("#parent_id_"+u).after(n).remove()},complete:function(){t.removeClass("fa-circle-o-notch fa-spin")}}),!1})})})