
var vote = {

    init: function()
    {

    },


    send: function(this_)
    {
        var vote = $(this_).get('class');
        var parent_id = $(this_).getParent().get('id');
        var id = parent_id.split('_')[2];
        var object = parent_id.split('_')[1];

        if (vote == 'plus' || vote == 'minus')
        {
            new Request.JSON({
                url: '/ajax.php?do=voteRegister',
                onComplete: function(response)
                {
                    if (response['restrict']) 
                    {                                  
                        user.restrictDialog(response, this_);
                    }
                    else if (response)
                    {
                        $(parent_id).set('html', response);
                        comment.highlight();
                    }
                }
            }).get({'object': object, 'vote': vote, 'id': id});
        }
    }

}


