// heavily influnced by http://kentbrewster.com/widget-summit/.  Thanks!
( function() {
 var trueName = '';
 for (var i = 0; i < 16; i++) {
  trueName += String.fromCharCode(Math.floor(Math.random() * 26) + 97);
 }
 window[trueName] = {};
 var $ = window[trueName];
 $.f = function() {
  return {
   init : function(target) {
    var theScripts = document.getElementsByTagName('SCRIPT');
    for (var i = 0; i < theScripts.length; i++) {
     if (theScripts[i].src.match(target)) {
      $.w = document.createElement('DIV');
	  $.w.className = 'tweeeeet_wrapper';
      $.w.innerHTML = "<ul class=\"tweeeeet_list\"><li class=\"tweeeeet_tweet_item tweeeeet_tweet_item_1\"><a href=\"http:\/\/twitter.com\/SURFER_Magazine\" target=\"_blank\"><img src=\"http:\/\/a1.twimg.com\/profile_images\/1043165413\/SURFER_Magazine_normal.jpg\" alt=\"SURFER_Magazine\" \/><\/a>Bali Dreaming Part 1 - Photos by Jason Childs: SURFER Magazine Photographer Jason Childs Presents Best of Bali\u2019s L... <a target=\"_blank\" href=\"http:\/\/bit.ly\/aBtk3L\">http:\/\/bit.ly\/aBtk3L<\/a><span class=\"tweeeeet_date\">about 5 hours ago<\/span><\/li><li class=\"tweeeeet_tweet_item tweeeeet_tweet_item_2\"><a href=\"http:\/\/twitter.com\/hydro74\" target=\"_blank\"><img src=\"http:\/\/a1.twimg.com\/profile_images\/391776672\/hydro_twitpic_normal.jpg\" alt=\"hydro74\" \/><\/a>Aiight! Think I have most everything prepped for the flight. Got 25 print sets, 100 sticker packs to give. Hit me up if going to Sea no Evil<span class=\"tweeeeet_date\">about 5 hours ago<\/span><\/li><li class=\"tweeeeet_tweet_item tweeeeet_tweet_item_3\"><a href=\"http:\/\/twitter.com\/hydro74\" target=\"_blank\"><img src=\"http:\/\/a1.twimg.com\/profile_images\/391776672\/hydro_twitpic_normal.jpg\" alt=\"hydro74\" \/><\/a>Is the newer PSP any good?  Any game suggestions?<span class=\"tweeeeet_date\">about 11 hours ago<\/span><\/li><li class=\"tweeeeet_tweet_item tweeeeet_tweet_item_4\"><a href=\"http:\/\/twitter.com\/SURFER_Magazine\" target=\"_blank\"><img src=\"http:\/\/a1.twimg.com\/profile_images\/1043165413\/SURFER_Magazine_normal.jpg\" alt=\"SURFER_Magazine\" \/><\/a>SURFER Magazine Photographer Jason Childs Presents Best of Bali\u2019s Lefts <a target=\"_blank\" href=\"http:\/\/bit.ly\/aBaFaV\">http:\/\/bit.ly\/aBaFaV<\/a><span class=\"tweeeeet_date\">about 11 hours ago<\/span><\/li><li class=\"tweeeeet_tweet_item tweeeeet_tweet_item_5\"><a href=\"http:\/\/twitter.com\/Snowboardermag\" target=\"_blank\"><img src=\"http:\/\/a3.twimg.com\/profile_images\/614124553\/jp-walker-jeremy-jones-guest-editor-covers_normal.jpg\" alt=\"Snowboardermag\" \/><\/a>White Hot American Summer: Videos for Session 3 & 4 at High Cascade and info about the upcoming Spin Cycle Classic. <a target=\"_blank\" href=\"http:\/\/bit.ly\/aTfK6A\">http:\/\/bit.ly\/aTfK6A<\/a><span class=\"tweeeeet_date\">about 12 hours ago<\/span><\/li><li class=\"tweeeeet_tweet_item tweeeeet_tweet_item_6\"><a href=\"http:\/\/twitter.com\/Snowboardermag\" target=\"_blank\"><img src=\"http:\/\/a3.twimg.com\/profile_images\/614124553\/jp-walker-jeremy-jones-guest-editor-covers_normal.jpg\" alt=\"Snowboardermag\" \/><\/a>America\'s Next Top Pro Model Best Jib video and results. Watch it here. <a target=\"_blank\" href=\"http:\/\/bit.ly\/a27XsC\">http:\/\/bit.ly\/a27XsC<\/a><span class=\"tweeeeet_date\">about 12 hours ago<\/span><\/li><li class=\"tweeeeet_tweet_item tweeeeet_tweet_item_7\"><a href=\"http:\/\/twitter.com\/Legwork\" target=\"_blank\"><img src=\"http:\/\/a1.twimg.com\/profile_images\/240979050\/lw_normal.jpg\" alt=\"Legwork\" \/><\/a>We love redvines.  Our bellies ache.<span class=\"tweeeeet_date\">about 14 hours ago<\/span><\/li><li class=\"tweeeeet_tweet_item tweeeeet_tweet_item_8\"><a href=\"http:\/\/twitter.com\/HumanoidWake\" target=\"_blank\"><img src=\"http:\/\/a1.twimg.com\/profile_images\/1002471064\/Newlogo_thumb_normal.jpg\" alt=\"HumanoidWake\" \/><\/a>\"2010 Oracle review with Kyle Schmidt\" - <a target=\"_blank\" href=\"http:\/\/bit.ly\/dcAqDy\">http:\/\/bit.ly\/dcAqDy<\/a><span class=\"tweeeeet_date\">about 14 hours ago<\/span><\/li><li class=\"tweeeeet_tweet_item tweeeeet_tweet_item_9\"><a href=\"http:\/\/twitter.com\/Snowboardermag\" target=\"_blank\"><img src=\"http:\/\/a3.twimg.com\/profile_images\/614124553\/jp-walker-jeremy-jones-guest-editor-covers_normal.jpg\" alt=\"Snowboardermag\" \/><\/a>Ha maybe we will make the next waterproof. RT <a target=\"_blank\" href=\"http:\/\/twitter.com\/SeanKerrick\">@SeanKerrick<\/a>: The new <a target=\"_blank\" href=\"http:\/\/twitter.com\/Snowboardermag\">@Snowboardermag<\/a> is so ill E-Stone wouldn\'t let it anywhere near the pool<span class=\"tweeeeet_date\">about 16 hours ago<\/span><\/li><li class=\"tweeeeet_tweet_item tweeeeet_tweet_item_10\"><a href=\"http:\/\/twitter.com\/WAKEBOARDINGMag\" target=\"_blank\"><img src=\"http:\/\/a1.twimg.com\/profile_images\/590318022\/twitter_thumb_normal.jpg\" alt=\"WAKEBOARDINGMag\" \/><\/a>Get a sneak peek at the new Supra Launch 242, which will tow the pro divisions at Worlds: <a target=\"_blank\" href=\"http:\/\/bit.ly\/d3vnO8\">http:\/\/bit.ly\/d3vnO8<\/a> <a target=\"_blank\" href=\"http:\/\/twitter.com\/supraboats\">@supraboats<\/a><span class=\"tweeeeet_date\">about 16 hours ago<\/span><\/li><\/ul><p class=\"tweeeeet_powered\"><a href=\"http:\/\/tweeeeet.com\" target=\"_blank\">powered by tweeeeet.com<\/a><\/p>";
      $.a = {};
      if (theScripts[i].innerHTML) {
       $.a = $.f.parseJson(theScripts[i].innerHTML);
      }
      if ($.a.err) {
       alert('bad json! make sure your passing params to us the right way.');
      }
      if ($.a.color) {
       $.w.style.color = $.a.color;
      }
      if ($.a.width) {
       $.w.style.width = $.a.width;
      }

      theScripts[i].parentNode.insertBefore($.w, theScripts[i]);
      theScripts[i].parentNode.removeChild(theScripts[i]);
      break;
     }
    }
   },
   parseJson : function(json) {
    this.parseJson.data = json;
    if ( typeof json !== 'string') {
     return {"err":"trying to parse a non-string JSON object"};
    }
    try {
     var f = Function(['var document,top,self,window,parent,Number,Date,Object,Function,',
      'Array,String,Math,RegExp,Image,ActiveXObject;',
      'return (' , json.replace(/<\!--.+-->/gim,'').replace(/\bfunction\b/g,'function­') , ');'].join(''));
       return f();
    } catch (e) {
     return {"err":"trouble parsing JSON object"};
    }
   }
  };
 }();
 var thisScript = /^https?:\/\/[^\/]*tweeeeet.com\/twitter\/widget\/js*/;
 if (typeof window.addEventListener !== 'undefined') {
  window.addEventListener('load', function() { $.f.init(thisScript); }, false);
 } else if (typeof window.attachEvent !== 'undefined') {
  window.attachEvent('onload', function() { $.f.init(thisScript); });
 }
})();