function getScore( gameID, mark )
{
    if(!mark)
    {
        mark = 0;
    }
    var opt =
    {
        method: 'post',
        postBody: 'gameID=' + gameID + '&mark=' + mark ,
        onSuccess: function(t)
        {
            eval( t.responseText );
            if( score >= 0 )
            {
                Element.hide('setRating');

                if(score > 0)
                {
                    for( i = 1; i <= score; i++)
                    {
                        $('gameRating' + i).src = "/images/star2.png";
                    }

                    $('gameVoted').innerHTML = amount;
                }
                Element.show('gameRating')
            }
            else
            {
                Element.hide('gameRating')
                Element.show('setRating');
            }
        },
        on404: function(t)
        {
            alert('Error 404: location "' + t.statusText + '" was not found.');
        },
        onFailure: function(t)
        {
            alert('Error ' + t.status + ' -- ' + t.statusText);
        }
    }
    Element.hide('setRating');
    Element.hide('gameRating');
    new Ajax.Request('/util/getScore.php', opt);
}