function updateUserRating(rating) {
    rating = Math.round(rating);
    rating = (rating >= 1 && rating <= 5) ? rating : 0;
    $('#productRating').val(rating);
    $('#current-rating-temp').attr('style', 'width:' + 20 * rating + 'px;');
}