'; html += '
'; html += '
'; }); html += '
'; html += '
Share this Poll
'; $('#poll-2824649-1 div.poll-content').html(html); } }; var getResults = function(evt) { $.get('/ajax/record_poll.php', { "sid": '2824649' , "rid": '1' , "slugs": 'nationals,capitals,i-cant-pick-i-love-both' , "get_results": "yes" }, displayData); }; var submitPoll = function(evt) { $.post('/ajax/record_poll.php', $(this).serialize(),function(data,status,xhr) { checked = $('#poll-2824649-1 li.vote input:checked'); if (checked.length == 1) ans = checked.val(); else { ans = [] checked.each(function(i,v) { ans.push(v.value); }); } d = new Date(); d.setDate(d.getDate() + 30); exp = d.toUTCString(); document.cookie = 'poll-2824649-1=' + ans + '; expires=' + exp + '; path=/'; displayData(data); }); evt.preventDefault(); }; var displayPoll = function() { html = '
- '; html += '
- '; html += ''; html += '
- '; html += ''; html += '
- '; html += ''; html += '
'; html += '
'; html += '
'; html += '
'; html += '
'; html += ''; html += '
'; $('#poll-2824649-1 div.poll-content').html(html); //$('#poll-2824649-1').submit(submitPoll); }; $(document).ready(function(evt) { $('#poll-2824649-1 .poll-submit').live('click',function(evt) { $('#poll-2824649-1 div.error, #poll-2824649-1 div.message').text(""); }); $('#revote-2824649-1').live('click',displayPoll) $('#fbshare-2824649-1').live('click',postToFBFeed) $('#get-poll-2824649-1').live('click',getResults); $('#poll-2824649-1').submit(submitPoll); }); })(jQuery)

