﻿
    var arrRatingControlScores = {}

    function RatingControlMouseOver(element, item)
    {
        RatingControlDrawIcons(element,item);
    }
    
    function RatingControlMouseOut(element)
    {
        RatingControlDrawIcons(element, arrRatingControlScores[element]);
    }
    
    function RatingControlMouseClick(element, number)
    {
        arrRatingControlScores[element] = number;
        RatingControlDrawIcons(element, number);
        document.getElementById('hid' + element).value = number;
    }
    
    function RatingControlDrawIcons(element, number)
    {
        for(var i = 1; i <= 5; i++)
        {
            if(i <= number)
            {
                document.getElementById(element + 'Icon' + i).style.backgroundImage = 'url(/_images/Site/RatingControlStarSelected.png)';              
            }
            else
            {
                document.getElementById(element + 'Icon' + i).style.background = 'url(/_images/site/RatingControlStarNormal.png)';
            }
        }
    }
    