var ReportController = function()
{

	this.work = function(link_id, rating) {
		var url = "/report/notwork";
		$("#v" + link_id).hide();
		
		$.ajax({
			url: url,
			type: "POST",
			data: ({
				link_id: link_id,
				rating: rating
	        }),
			success: function(response) {
				if (response.match(/<status>OK<\/status>/)) {
					$("#work").show();
					
	            } else {
	                $("#work").html(response);
	            }
			}
		});
	};

};

var report = new ReportController();
