function Rating(div, url){
	var getStarN = function(s){
		var expr = new RegExp('star([0-9]{1})', 'gi');
		var r = expr.exec(s);
		return r[1];
	}

	$(div+' a').unbind('hover').unbind('click').click(function(){
		$(div).fadeTo('fast', 0.3);
		$.getJSON(url+'&note=' + getStarN($(this).attr('id')), null, function(data){
			$(div).fadeTo('fast', 1);
			message(data);
			if (data.note) {
				$(div+' > p:first').html(data.note_p);
				$(div+' a:lt(' + data.note + ')').each(function(){
					$(this).replaceWith('<span id="' + $(this).attr('id') + '" class="select">' + $(this).text() + '</span>');
				});
				$(div+' li:gt(' + (Math.floor(data.note) - 1) + ')').remove();
			}
		});
		return false;
	}).hover(function(){
		for (var j = 1; j <= getStarN($(this).attr('id')); j++) 
			$('a#star' + j).addClass('hover');
		
	}, function(){
		for (var j = 1; j <= getStarN($(this).attr('id')); j++) 
			$('a#star' + j).removeClass('hover');
	});
}