var poll = null;

var PollAjax = {
    'el': null,

    construct : function(elprop)
    {
        this.el = $(elprop);
        if(this.el && this.el.length == 1)
            this.el = this.el[0];
        else
            return false;

        return this;
    },

    load : function()
    {
        $(this.el).load("/ajax/poll.php?teamid="+teamid);
        return false;
    },

    vote : function(aid, qid)
    {
        if(Number(aid) == aid && Number(qid) == qid)
            $(this.el).load("/ajax/poll.php?teamid="+teamid, {'aid': aid, 'qid': qid});

        return false;
    },

    show_votes : function()
    {
        $(this.el).load("/ajax/poll.php?show_votes=1&teamid="+teamid);
        return false;
    }
};
