jQuery.fn.extend({
  disable_voting: function() {
    return this.each(function() {
      $(this).removeClass('votable').addClass('voted').
      attr('onclick', ''); // Disabilita l'evento AJAX onclick 
    });
  }
});

$(document).ready( function() {
  function vote_over(vote) {
    $("#vote.votable").addClass("voted" + vote);
  }
  function vote_out(vote) {
    $("#vote.votable").removeClass("voted" + vote);
  }
  $(".votable #vote1").hover(function(){vote_over(1)}, function(){vote_out(1)})
  $(".votable #vote2").hover(function(){vote_over(2)}, function(){vote_out(2)})
  $(".votable #vote3").hover(function(){vote_over(3)}, function(){vote_out(3)})
  $(".votable #vote4").hover(function(){vote_over(4)}, function(){vote_out(4)})
  $(".votable #vote5").hover(function(){vote_over(5)}, function(){vote_out(5)})
});
