Kwo.Poll = {

  onCallback: function(res) {
    if (Kwo.hasError(res)) {
      $('poll-error').update(res["result"]["msg"]).show();
      return false;
    }
    Kwo.exec("/poll/poll.result",
             {id: res["result"]["poll_id"],
              choice_id: res["result"]["choice_id"]},
             {container: this});
  },

  onSubmit: function(args) {
    Kwo.exec("/poll/poll.vote", args,
             {callback: Kwo.Poll.onCallback.bind($(args))});
  }

};