//save rating
$('.star').rating({ 
callback: function(value){ 
	title_id = $(this).attr("id").substr(6);
	
	//save in database
	$.post(HTTP + 'ajax/?save_rating', {id:title_id,rating:value}, function(response) {
		if(response == 1){
			//disable rating to prevent double voting
			$('input[name=rating]').rating('disable');
			
			//update votes counter
			/*counter = $("#count_votes").text();
			
			new_counter = counter.substr(1, (counter.length - 2));
			new_counter++;
			
			$("#count_votes").text('(' + new_counter + ')');*/
		}
					
	});
		
} 
});
