﻿function rate(ratingFieldName, rating, urlPrefix) {
    elmt = document.getElementById(ratingFieldName);
    if (elmt != undefined) {
        elmt.value = rating;
        for (var i = 1; i <= 5; i++) {
            img = document.getElementById('img_rate_' + i);
            if (img != undefined) {
                if (i <= rating) {
                    img.src = urlPrefix + 'images/i_starbig_rated.png';
                }
                else {
                    img.src = urlPrefix + 'images/i_starbig_unrated.png';
                }
            }
        }
    }

}
