$(document).ready(function() {
	$("#content .btn").click(function(e) {
		e.preventDefault();
		var btn = this.id.split('_');
		if(btn[1]=="fake") if(!confirm("Are you absolutely sure this is fake?")) return;
		$.post("/interface.php", {action: this.id}, function(xml) {
			var id = $("id", xml).text();
			switch($("result", xml).text()) {
				case "hide":
					$("#comment_"+id).fadeOut("fast");
					break;
				case "nospam":
					$("#comment_"+id+" .fake").fadeOut("fast");
					$("#report_nospam_"+id).fadeOut("fast");
					break;
				case "hidefake":
					$("#file_"+id).fadeOut("fast");
					break;
				case "nofake":
					$("#file_"+id+" .fake").fadeOut("fast");
					$("#report_nofake_"+id).fadeOut("fast");
					break;
				case "error":
					alert("Sorry, you reached your daily report limit.");
			}
		})
	});
});

