jQuery.extend({
	postJSON: function(url, data, callback) {
		return jQuery.post(url, data, callback, "json");
	}
});

$(document).ready(function(){
	var hrf = '/news/seen_commented/';
	
	$("input.article_id").map(function(){
		hrf += parseInt($(this).val()) + '/';
		});
	
	$.getJSON(hrf,{},function(j){
		$("input.article_id").map(function(){
			var id = $(this).val();
			if(j[id])
			{
				$(this).parent().find("span.comment_count").html(j[id].commented);
				$(this).parent().find("span.seen_count").html(j[id].seen);
			}
			else
			{
				$(this).parent().find("span.comment_count").html('0');
				$(this).parent().find("span.seen_count").html('0');
			}
			});
		});
});
