CommentStar =
{
    blueStarPath : null,
    greyStarPath : null,
    orderTitle : null,
    clearLock : new Array,
    rating : new Array,
    isAutoRating : false,
    urlForComment : null,

    set : function(i_StarLevel, i_StarNumber, i_StarPath)
    {
        try
        {
             if ( false == isNaN(i_StarNumber)
              && i_StarNumber > 0 )
            {
                for ( i=1; i <= i_StarNumber; i++)
                {
                    starId = document.getElementById('comment_star_' + i_StarLevel + '_' + i);

                    if ( undefined != starId )
                    {
                        starId.src = i_StarPath;
                    }
                    else
                    {
                        throw 'Undefined ident for star number: ' + i + ' ' + i_StarLevel;
                    }
                }
            }
        }
        catch (exceptionMsg)
        {
            throw new Error(exceptionMsg);
        }

        o_Result = false;
    },
    setRating : function(i_StarLevel, i_StarPosition)
    {
        if ( 0 < i_StarPosition )
        {
            this.clearLock[i_StarLevel] = true;

            this.rating[i_StarLevel] = i_StarPosition;

            this.setStarPosition(i_StarPosition);

            document.getElementById('sf_comment_score').value = i_StarPosition;

            document.getElementById('ratingText').innerHTML = this.orderTitle + i_StarPosition;
        }

    },
    setStarPosition : function (i_StarPosition)
    {
        starPosition = i_StarPosition;
    },
    setStarLevel : function (i_StarLevel)
    {
        starLevel = i_StarLevel;
    },
    getStarPosition : function ()
    {
        o_Result = null;

        if ( 'undefined' != typeof starPosition )
        {
            o_Result = starPosition;
        }
        else
        {
            return o_Result;
        }

        return o_Result;
    },
    getStarLevel : function ()
    {
        o_Result = null;

        if ( 'undefined' !== typeof starLevel )
        {
            o_Result = starLevel;
        }
        else
        {
            return o_Result;
        }

        return o_Result;
    },
    autoRating : function()
    {
        this.setRating(0, this.getStarPosition());

        if ( false == this.isAutoRating )
        {
            this.isAutoRating = true;
        }
    },
    showForm: function(i_StarLevel, i_StarPosition, i_ObjectId, i_LoadConfig)
    {
        this.setStarPosition(i_StarPosition);
        this.setStarLevel(i_StarLevel);
        this.clearLock[i_StarLevel] = true;
        this.rating[i_StarLevel] = i_StarPosition;

        new Ajax.Updater('product_modal_window_container', this.urlForComment + '/sf_comment_object_id/'+i_ObjectId+'/autoRating/1/', {asynchronous:true, evalScripts:true});
        openWinByClass('item',Array('7'));
    },
    toggleHint: function(i_ObjectId, i_display)
    {

        $$('div.commentsHint_'+i_ObjectId).each(function(o){

                if (true == i_display)
                {
                    o.show();
                }
                else
                {
                    o.hide();
                }
        });
/*
        elem = document.getElementById('commentsHint_'+i_ObjectId);
        if ("" != elem)
        {
            if (true == i_display)
            {
                elem.style.display="block";
            }
            else
            {
                elem.style.display="none";
            }
        }
*/
    }

}
