jQuery.fn.voting = function() {
    return this.each(function(){
        var vote_button = $(this);
        vote_button.click(function(){
            var vote_button = $(this);
            $.post(vote_button.attr("href"), {},
                function(data){
                    if (data.ok) {
                        vote_button.parents("li.poll").fadeOut("fast", function(){
                            $(this).html(data.poll).fadeIn("fast");
                        });
                    }
                }, "json"
            );
        });
    });
}