function poll_vote(node_id, result_url){

    var choice=""
    for (var i=0; i < document.pollform.choice.length; i++)
       {
       if (document.pollform.choice[i].checked)
          {
            choice = document.pollform.choice[i].value;
          }
       }
       if (choice == "") { alert("Please select a value.");}
       else{


            if(!$.cookie('voted_'+node_id)){
                $.cookie('voted_'+node_id,1);
                $.ajax({
                  url: '/polls/'+node_id+'/vote?choice='+choice,
                  cache: false,
                  success: function() {
                    tb_show('Results',result_url);
                  }
                });

            }else{
                tb_show('Results',result_url);
            }
        }

}

function show_results(result_url){

    tb_show('Results',result_url);
}

