$(document).ready(function(){        $('div.userrating').live('mouseover', function(){        $(this).find('div.rating_initial').hide();    });    $('div.userrating').live('mouseout', function(){        $(this).find('div.rating_initial').show();    });        function set_stars_width() {        $("div.rating_initial").each(function(){            var max_width_spaces = parseInt($(this).attr('class').split(' ')[1]);            var spaces = parseInt($(this).attr('class').split(' ')[2]);            var max_width = max_width_spaces - (4*spaces);            var score = $(this).attr('class').split(' ')[3];            if (!score) {                score = 0;            };            var width = score*max_width/5 + parseInt(score)*spaces;            if (width > max_width_spaces) width = max_width_spaces;            $(this).css('width', width);            $(this).show();        });    };        $("div.rating a").live("click", function(){        var url = $(this).attr("href");        var element = $(this).parent().parent().parent().parent();        var template = "site/include/rating_sidebar.html";        $.ajax({            async: true,            cache: false,            data: "template=" + template,            url: url,            dataType: "html",            beforeSend: function() {                element.children("div.voting").css('visibility', 'hidden');                element.children("div.voting_loader").show();            },            success: function(data, textStatus) {                element.html(data);                set_stars_width();            }        });        return false;    });        set_stars_width();    });