document.write('<style type=\'text/css\'>\n.pe_multiple_choice_poll_52694.peWidget table, .pe_multiple_choice_poll_52694.peWidget caption, .pe_multiple_choice_poll_52694.peWidget tbody, .pe_multiple_choice_poll_52694.peWidget tfoot, .pe_multiple_choice_poll_52694.peWidget thead, .pe_multiple_choice_poll_52694.peWidget tr, .pe_multiple_choice_poll_52694.peWidget th, .pe_multiple_choice_poll_52694.peWidget td {\n	margin: 0;\n	padding: 0;\n	border: 0;\n	outline: 0;\n	font-size: 100%;\n	vertical-align: baseline;\n	background: transparent;\n}\n.pe_multiple_choice_poll_52694.peWidget table{\n  border-collapse: collapse;\n	border-spacing: 0;\n}\n.pe_multiple_choice_poll_52694.peWidget{\n  background: #ffffff;\n  color: #000000;\n  font-family: \'Lucida Grande\', \'Lucida Sans Unicode\', \'sans-serif\';\n  padding: 0;\n  margin: 0;\n  width: 275px;\n}\n  .pe_multiple_choice_poll_52694.peWidget a{\n    color: #3399ff;\n  }\n  .pe_multiple_choice_poll_52694 img, .pe_multiple_choice_poll_52694 div{\n    padding: 0;\n    margin: 0;\n  }\n  .pe_multiple_choice_poll_52694.peWidget table{\n    border: none;\n  }\n  .pe_multiple_choice_poll_52694.peWidget td{\n    padding: 0;\n    border: none;\n  }\n  \n  .pe_multiple_choice_poll_52694.peWidget .peDialog{\n    padding: 1em;\n    border: none;\n    line-height: 1.5em;\n  }\n  \n  .pe_multiple_choice_poll_52694.peWidget .peHeader{}\n    .pe_multiple_choice_poll_52694.peWidget .peHeader .peTitle{\n      font-size: 1.2em;\n      font-weight: bold;\n      padding: 1em 1em 0;\n      text-align: center;\n    }\n    .pe_multiple_choice_poll_52694.peWidget .peHeader .peStatus{\n      text-align: center;\n      padding-top: 1em;\n      font-size: 0.9em;\n    }\n  .pe_multiple_choice_poll_52694.peWidget .peMultipleChoicePoll .peBody{}\n    .pe_multiple_choice_poll_52694.peWidget .peMultipleChoicePoll .peOptions {\n      padding: 1em 0;\n    }\n      .pe_multiple_choice_poll_52694.peWidget .peMultipleChoicePoll .peOptions .peOption{\n        padding: 1em; \n      }\n      .pe_multiple_choice_poll_52694.peWidget .peMultipleChoicePoll .peOptions a.peOption {\n        display: block;\n        color: #3399ff;\n      }\n      .pe_multiple_choice_poll_52694.peWidget .peMultipleChoicePoll .peOptions a.peOption:hover{\n        background: #3399ff;\n        color: #ffffff;\n      }\n  .pe_multiple_choice_poll_52694.peWidget .peMultipleChoicePoll .peChart{\n    padding: 1em;\n  }\n    .pe_multiple_choice_poll_52694.peWidget .peMultipleChoicePoll .peChart table{\n      width: 100%;\n    }\n    .pe_multiple_choice_poll_52694.peWidget .peMultipleChoicePoll .peChart table tr td{\n      vertical-align: middle;\n      padding: 0.5em 0.25em;\n    }\n    .pe_multiple_choice_poll_52694.peWidget .peMultipleChoicePoll .peChart .peChartBar{\n      background: #3399ff;\n      color: #ffffff;\n      padding: 0.75em 0.25em;\n      -moz-border-radius: 0.25em;\n      -webkit-border-radius: 0.25em;\n    }\n    .pe_multiple_choice_poll_52694.peWidget .peMultipleChoicePoll .peChart .peChartBar{\n      background: #3399ff;\n      color: #ffffff;\n      padding: 0.75em 0.25em;\n    }\n    .pe_multiple_choice_poll_52694.peWidget .peMultipleChoicePoll .peChart .peChartBar.peChartBlankBar{\n      background: #ffffff;\n      color: #3399ff;\n    }\n  .pe_multiple_choice_poll_52694.peWidget.peBranded{\n    border: 3px solid #036;\n  }\n  .pe_multiple_choice_poll_52694.peWidget.peBranded .peBranding{\n    background: #036;\n    text-align: center;\n    padding: 5px;\n  }\n  .pe_multiple_choice_poll_52694.peWidget.peBranded .peBranding a img{\n    border: 0;\n  }\n<\/style>\n<iframe height=\'0\' src=\'http://www.polleverywhere.com/sessions/NjE0MzM3NjQy.hapi\' style=\'visibility: hidden;\' width=\'0\'><\/iframe>\n<div class=\'peBranded peWidget pe_multiple_choice_poll_52694\' id=\'pe_multiple_choice_poll_52694\'>\n<div class=\'peClosed peMultipleChoicePoll\'>\n<div class=\'peHeader\'>\n<div class=\'peTitle\'>PI: What social bookmarking tool do you use?<\/div>\n<div class=\'peStatus\' style=\'display: none;\'><\/div>\n<\/div>\n<div class=\'peBody\'>\n<div class=\'peDisabled\'>\n<div class=\'peOptions\'>\n<div class=\'peOption\'>\nI don\'t\n<\/div>\n<div class=\'peOption\'>\ndelicious.com\n<\/div>\n<div class=\'peOption\'>\ndiigo.com\n<\/div>\n<\/div>\n<\/div>\n<div class=\'peVote\' style=\'display: none;\'>\n<div class=\'peOptions\'>\n<a class=\'peOption\' data-answer-id=\'159133\' href=\'#\'>\nI don\'t\n<\/a>\n<a class=\'peOption\' data-answer-id=\'159134\' href=\'#\'>\ndelicious.com\n<\/a>\n<a class=\'peOption\' data-answer-id=\'159135\' href=\'#\'>\ndiigo.com\n<\/a>\n<\/div>\n<\/div>\n<div class=\'peChart\' style=\'display: none;\'>\n<div class=\'peChartPlotArea\'>\n<table>\n<colgroup class=\'peValue\'><\/colgroup>\n<colgroup class=\'peResponses\' style=\'width: 100%;\'><\/colgroup>\n<thead style=\'display:none;\'>\n<tr>\n<th>Value<\/th>\n<th>Responses<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\nI don\'t\n<\/td>\n<td>\n<div class=\'peChartBar\' style=\'width: 43%;\'>\n<div class=\'peChartDataLabel\'>\n43%\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\ndelicious.com\n<\/td>\n<td>\n<div class=\'peChartBar\' style=\'width: 45%;\'>\n<div class=\'peChartDataLabel\'>\n45%\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\ndiigo.com\n<\/td>\n<td>\n<div class=\'peChartBar\' style=\'width: 10%;\'>\n<div class=\'peChartDataLabel\'>\n10%\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n\n<\/div>\n<div class=\'peMaxedOut\' style=\'display: none;\'>\n<div class=\'peDialog\'>This poll has received that maximum number of votes.<\/div>\n<\/div>\n<div class=\'peEnableWeb\' style=\'display: none;\'>\n<div class=\'peDialog\'>\nWeb voting is currently disabled for this poll. If you created this poll,\n<a href=\"http://www.polleverywhere.com/multiple_choice_polls/NjE0MzM3NjQy/edit\">enable web voting<\/a>,\nthen refresh this page.\n<\/div>\n<\/div>\n<div class=\'peStopped\' style=\'display: none;\'>\n<div class=\'peDialog\'>\nThis poll is stopped and not accepting responses. If you created this poll,\n<a href=\"http://www.polleverywhere.com/multiple_choice_polls/NjE0MzM3NjQy\">start the poll<\/a>,\nthen refresh this page.\n<\/div>\n<\/div>\n<\/div>\n<div class=\'peFooter\'>\n<div class=\'peBranding\'>\n<a href=\"http://www.polleverywhere.com/\" alt=\"Poll Everywhere was used to create this poll.\" target=\"_parent\" title=\"Poll Everywhere was used to create this poll.\"><img alt=\"Logo_widget\" src=\"http://www.polleverywhere.com/images/logo_widget.gif\" /><\/a>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n');
/* Load javascript in 'harsh' environments like third party websites, etc.

scripts('http://www.google.com/script.js').include(function(){
  Do some stuff here w/ this callback
}); 

*/

(function(fun){
  
  // Loads one external javascript and fires off a few callbacks x-browser
  var script = function script(src, options){
    if(options.loading) { options.loading.call(this); }
    var el = document.createElement("script");
    el.setAttribute("type", "text/javascript");
    el.setAttribute("src", src);
    if(options.loaded) {
      el.onload = options.loaded;           // FF, Safari, & Modern browsers.
      el.onreadystatechange = function() {  // IE
        if (this.readyState === 'loaded') {
          options.loaded();
        }
      };
    }
    document.getElementsByTagName("head")[0].appendChild(el);
    return el;
  };
  
  // Manages the loading of multiple scripts and takes care of potential
  // race conditions.
  var scripts = function scripts(src){
    
    // We're gonna hang a global off of window for other widgets that might
    // be loading up the same js in the window.
    var global = (function global(){
      if(typeof window.sandBox === 'undefined'){
        window.sandBox = {
          scripts: {}
        };
      }
      return window.sandBox.scripts;
    })();
    
    var scriptController = function(src){
      var callbacks = [];
      var loaded = false;
      
      script(src, {
        loaded: function(){
          loaded = true;
          for(i = 0; i < callbacks.length; i++){
            callbacks[i].call();
          }
        }
      });
      
      return {
        include: function(callback){
          if(loaded){
            callback.call();
          }
          else{
            callbacks.push(callback);
          }
        }
      };
    };
    
    // Initialize a stinkin' script in the glob
    if (typeof global[src] === 'undefined') {
      global[src] = scriptController(src); 
    }
    
    return global[src];
  };
  
  var sandBox = {
    js: {
      include: function(src, apply, closure){
        if(!closure) {
          closure = apply;
          apply = null;
        }
        
        scripts(src).include(function(){
          if(apply){
            apply(closure);
          }
          else{
            closure();
          }
        });
      }
    }
  };
  
  fun(sandBox);
  
})(function($sb){
  
  $sb.js.include("http://www.polleverywhere.com/javascripts/jquery-1.3.2.min.js", function(closure){ 
    closure(jQuery.noConflict());
  }, function($){
    $sb.js.include('http://www.polleverywhere.com/javascripts/jquery.polleverywhere.js', function(){

      var poll_permalink = "NjE0MzM3NjQy";

      var poll = $.pe.polls.mcp('http://www.polleverywhere.com/multiple_choice_polls/NjE0MzM3NjQy',{
        data: {"show_branding": true, "results_count": 55, "direct_enabled": true, "twitter_keyword": "@poll", "shortcode": null, "flash_options": {"Leaderboard": false, "GridColor": 15658734, "IsDefault": {"GridColor": true, "Leaderboard": true, "IsDefault": true, "BackgroundCSS": true, "ShowGradation": true, "ShowVoteChoices": true, "RememberToken": false, "ChartBackgroundColor": true, "ChartTextColor": true, "ChartFontSize": true, "LeaderboardLength": true, "OptionsTableColumnRatio": true, "DisplayMode": false, "ChartForegroundColor": true, "ChartType": true, "ShowTitle": true, "LogoUrl": true, "ShowLogo": true, "TitleFontSize": true, "ShowKeywords": true, "BackgroundAlpha": true, "ShowPercent": true}, "ShowGradation": true, "BackgroundCSS": "No pattern", "ShowVoteChoices": true, "RememberToken": "", "ChartBackgroundColor": 16777215, "ChartTextColor": 0, "ChartFontSize": 4, "LeaderboardLength": "", "OptionsTableColumnRatio": 0.5, "DisplayMode": "barchart", "ChartForegroundColor": 3381759, "ChartType": "bar", "ShowTitle": true, "ShowLogo": true, "LogoUrl": "", "TitleFontSize": 6, "ShowKeywords": true, "BackgroundAlpha": 0, "ShowPercent": false}, "participation_verb": "vote", "question": "PI: What social bookmarking tool do you use?", "sms_enabled": true, "options": [{"results_count": 24, "value": "I don't", "keyword": null}, {"results_count": 25, "value": "delicious.com", "keyword": null}, {"results_count": 6, "value": "diigo.com", "keyword": null}], "mobile_site": "http://poll4.com", "state": "closed", "session_keyword": null, "accept_multiple_responses": false, "web_enabled": true, "twitter_enabled": false, "title": "PI: What social bookmarking tool do you use?"}
      });


      poll.alreadyVoted = function() {
        return (document.cookie.indexOf('__pe_' + poll_permalink) !== -1);
      };
      
      poll.setAsVoted = function() {
        var expiresAt = new Date();
        expiresAt.setDate(expiresAt.getDate() + 365);
        document.cookie = '__pe_' + poll_permalink + '=true; expires=' + expiresAt.toUTCString() + '; path=/';
      }
      
      // Grab the widget and add some randomness at the end of the ID 
      // so the page can support multiple instances of a widget
      var widget = (function widget(){
        var el = $('#pe_multiple_choice_poll_52694');
        return el.attr("id", el.attr("id") + '_' + Math.random()*9999);
      })();
      
      widget.updateChart = function(data) {
        widget.find('.peChart').html(data);
      };
      
      widget.installHandlers = function() {
        $('#' + poll_permalink + '_results').unbind("click");
        $('#' + poll_permalink + '_vote').unbind("click");
        
        $('#' + poll_permalink + '_results').click(function(e) {
          e.preventDefault();
          var link = $(widget.find('.peStatus a'));
          link.text('Vote again');
          link.attr('id', poll_permalink + '_vote');
          widgetController.action('chart');
          setTimeout(function () { widget.installHandlers(); }, 130); 
          return false;
        });
        $('#' + poll_permalink + '_vote').click(function(e) {
          e.preventDefault();
          var link = $(widget.find('.peStatus a'));
          link.text('View results');
          link.attr('id', poll_permalink + '_results');
          widgetController.action("vote");
          setTimeout(function () { widget.installHandlers(); }, 130); 
          return false;
        });
      };
      
      var notice = function(message){
        var el = $(widget).find('.peStatus').get().pop();
        
        if(message && message.length > 0){
          $(el).show().html(message);
        }
        else{
          $(el).hide();
        }
      };
      
      var controller = function(actions){
        var hide = function hide(action){
          (action.hide) && (action.hide.call(action.view));
          action.view.hide();
        };
        
        var show = function show(action){
          (action.show) && (action.show.call(action.view));
          action.view.show();
        };
        
        var action = function action(action){
          $.each(actions, function(a){
            (action === a) ? show(actions[a]) : hide(actions[a]);
          });
        };
        
        return {
          actions: actions,
          action: action
        };
      };
      
      var widgetController = controller({
        chart: {
          view: widget.find('.peChart'),
          show: function() {
            if (poll.acceptsMultipleResponses() && poll.alreadyVoted()) {
              notice('<a href="#" id="'+poll_permalink+'_vote">Vote again</a>');
              setTimeout(function () { widget.installHandlers(); }, 130); 
            }
          }
        },
        vote: {
          view: widget.find('.peVote'),
          show: function(){
            $(this).find('.peOption').unbind('click');
            $(this).find('.peOption').click(function(e){
              e.preventDefault();
              poll.vote($(this).attr('data-answer-id'), {
                success: function(){
                  widget.updateChart(this.view);
                  widgetController.action('chart');
                  var noticeText = 'You chose ' + this.result.value;
                  if (poll.acceptsMultipleResponses()) {
                    noticeText += '<br><a href="#" id="'+poll_permalink+'_vote">Vote again</a>';
                  }
                  notice(noticeText);
                  setTimeout(function () { widget.installHandlers(); }, 130); 
                  poll.setAsVoted();
                },
                error: function(){
                  notice(this.errors.pop());
                }
              });
              return false;
            });
          },
          hide: function(){}
        },
        maxed_out: {
          view: widget.find('.peMaxedOut')
        },
        disabled: {
          view: widget.find('.peDisabled')
        },
        stopped: {
          view: widget.find('.peStopped')
        },
        enable_web: {
          view: widget.find('.peEnableWeb')
        }
      });
      // Initialize the correct state of the widget.

      if (poll.alreadyVoted()) {
        widgetController.action('chart');
      } else {
        switch(poll.state()){
          case 'opened':
            widgetController.action(poll.webEnabled() ? 'vote' : 'enable_web');
            break;
          case 'closed':
            widgetController.action('stopped');
            break;
          case 'maxed_out':
            widgetController.action('maxed_out');
            break;
        }
      }


    });
  });

});