function enable_ajax_reporting(){$("#report_error_parent").hide();$("#flagged_reason").selectmenu({width:375});$("a.flag_link").click(function(){var n=this,t=$(this).attr("href"),u=t.split("?")[0],f=t.split("?")[1],i,r;return launch_modal("report_item","report_item"),i=$("#report_item_modal"),$("html, body").animate({scrollTop:0},"fast"),r=$(".bubble",i),r.click(function(t){t.preventDefault();$("#report_error_parent").hide();$(this).prop("disabled",!0);$(this).find("span").removeClass("fa-flag-o").addClass("fa-refresh fa-spin");var i=$("#flagged_reason").val();i!=""?$.ajax({url:u,data:"ajax=1&"+f+"&reason_code="+i,dataType:"json",type:"post",success:function(t){t.error!=null?($("#report_error_msg").html(t.error),$("#report_error_parent").show(),$(this).prop("disabled",!1),$(this).find("span").removeClass("fa-refresh fa-spin").addClass("fa-flag-o")):($(n).html("reported"),$(n).unbind("click"),$(n).click(function(){return!1}),close_modal())}}):($("#report_error_msg").html("Reason is required"),$("#report_error_parent").show(),$(this).prop("disabled",!1),$(this).find("span").removeClass("fa-refresh fa-spin").addClass("fa-flag-o"))}),!1})}$(document).ready(function(){enable_ajax_reporting()})