(function(w){var u=false,n=false,d=true,f=200,x=(new Date()).getTime(),b,p,z=/http:\/\/s.twimg.com\/a\/\d+\/images\/default_profile_\d+_normal\.png/,J,r,C,F,o,g,I;
w.brokenFollowers=[];w.availableFollowers=[];w.genericFollowers=[];function s(K){if(K&&K.length>0){if(K[0]){this.id(K[0])}if(K[1]){this.created_at(K[1])
}if(K[2]){this.user(K[2])}}}s.prototype={_id:false,id:function(K){if(K){this._id=K}return this._id},_created_at:false,created_at:function(K){if(K){this._created_at=new Date();
this._created_at.setTime(K)}return this._created_at},_user:false,user:function(K){if(K){this._user=new l(K)}return this._user}};function l(K){if(K&&K.length>0){if(K[0]){this.id(K[0])
}if(K[1]){this.followers_count(K[1])}if(K[2]){this.friends_count(K[2])}if(K[3]){this.statuses_count(K[3])}if(K[4]){this.screen_name(K[4])
}if(K[5]){this.profile_image_url(K[5])}if(K[6]){this.name(K[6])}if(K[7]){this.location(K[7])}if(K[8]){this.description(K[8])}}}l.prototype={_id:false,id:function(K){if(K){this._id=K
}return this._id},_followers_count:false,followers_count:function(K){if(K){this._followers_count=parseInt(K)}return this._followers_count
},_friends_count:false,friends_count:function(K){if(K){this._friends_count=parseInt(K)}return this._friends_count},_statuses_count:false,statuses_count:function(K){if(K){this._statuses_count=parseInt(K)
}return this._statuses_count},_screen_name:false,screen_name:function(K){if(K){this._screen_name=K}return this._screen_name},_profile_image_url:false,profile_image_url:function(K){if(K){this._profile_image_url=K
}return this._profile_image_url},_name:false,name:function(K){if(K){this._name=K}return this._name},_location:false,location:function(K){if(K){this._location=K
}return this._location},_description:false,description:function(K){if(K){this._description=K}return this._description}};function t(L){if(u){console.log("["+((new Date()).getTime()-x)+"] addFollowers()")
}var M;for(var K=0,N=L.length;K<N;++K){if(L[K][2][5].match(z)){if(u){console.log("["+((new Date()).getTime()-x)+"] addFollowers: skipping generic profile image: "+L[K][2][5])
}w.genericFollowers.push(L)}else{M=new s(L[K]);w.availableFollowers.push(M)}}if(u){console.log("["+((new Date()).getTime()-x)+"] addFollowers DONE")
}}function c(){var P=Math.floor(Math.random()*w(".follower").length),N=w("#followers .follower").eq(P),L=N.data("follower"),M=w("img",L),K=w.availableFollowers.pop(),O;
if(K){O=E(K);O.hide().css({top:N.css("top"),left:N.css("left")});w("#followers").append(O);N.hide("puff",{},800,function(){w.availableFollowers.unshift(L);
O.fadeIn(500,function(){N.remove()})})}}function h(M,L){if(u){console.log("["+((new Date()).getTime()-x)+"] handleMissingImage("+M.id()+")")
}w.brokenFollowers.push(M);var K=w.availableFollowers.pop();if(K){L.data("follower",K);w("img",L).attr("src",K.user().profile_image_url()).error(function(O){var N=w(this).closest(".follower"),P=N.data("follower");
if(u){console.log("["+((new Date()).getTime()-x)+"] redrawFollowers: image error for "+(P?P.id():"?")+" !!!")}h(P,N)})}w.getJSON("/stale/"+M.id()+".json",function(N){return true
})}function E(M){if(!g){g=w('<div class="follower"><img src="http://s.twimg.com/a/1255464717/images/default_profile_0_bigger.png" width="48" height="48" title="" /></div>')
}var N=g.clone(),L=w("img",N),K=M.user();N.data("follower",M);L.attr("src",K.profile_image_url()).attr("title","@"+K.screen_name()).error(function(O){if(u){console.log("["+((new Date()).getTime()-x)+"] redrawFollowers: image error for "+(M?M.id():"?")+" - div["+N.html()+"]")
}h(M,N)});return N}function G(){if(u){console.log("["+((new Date()).getTime()-x)+"] redrawFollowers()")}w("#followers").height(w(window).height()-w("#hd").height()-w("#ft").height());
var K=w("#followers"),O=Math.ceil(w(window).width()/48),S=Math.ceil((w(window).height()-w("#hd").height()-w("#ft").height())/48),L,M,Q,R;
if(u){console.log("["+((new Date()).getTime()-x)+"] redrawFollowers: cols["+O+"/"+p+"], rows["+S+"/"+b+"]")}for(var N=0;N<S;++N){for(var P=0;
P<O;++P){M=w.availableFollowers.pop();if(M){Q=M.user();E(M).css({top:(48*N)+"px",left:(48*P)+"px"}).appendTo(K)}}}}function q(K){if(K>1000){return"$"+Math.floor(K/1000)+","+((K%1000)<100?"0":"")+((K%1000)<10?"0":"")+(K%1000)
}else{return"$"+K}}function m(L){var K=L.donor();return'<li class="donorCol '+(L.amount()==100?"lgAv":"smAv")+'"><a href="#" title="" rel="'+L.id()+'"><img src="'+K.profile_image_url()+'" class="donor" /></a></li>'
}function D(M,R){var P=R.donor(),N=M.offset(),O,K,S,T,Q;try{if(activeDonation&&(activeDonation.id()==R.id())){return false}if(activeDonation&&(activeDonation.id()!=R.id())){e(false,activeDonation)
}activeDonation=R;w("#tooltip .donation_amount").html("$"+R.amount());w("#tooltip .screen_name").attr("href","http://twitter.com/"+P.screen_name()).html("@"+P.screen_name());
w("#tooltip .profile_image").attr("src",P.profile_image_url());w("#tooltip .bio").html(P.description());w("#tooltip .followers_count em").html(P.followers_count());
w("#tooltip .follow_action a").attr("href","http://twitter.com/"+P.screen_name());if(Math.floor(N.left)>Math.floor(w(window).width()/2)){T=Math.floor(N.left-w("#tooltip").outerWidth()-8);
K=Math.floor(N.left-10);S="right_stem"}else{T=Math.floor(N.left+M.width()+10);K=Math.floor(T-8);S="left_stem"}if(Math.floor(N.top)>Math.floor(w(window).height()/2)){Q=Math.floor(Math.min((w(document).height()-w("#tooltip").outerHeight()-1),(N.top-w("#tooltip").outerHeight()+M.outerHeight())))
}else{Q=Math.floor(N.top)}O=Math.floor(N.top)+((M.outerHeight()>17)?Math.floor((M.outerHeight()-17)/2):0);w("#tooltip").css({top:Q+"px",left:T+"px"});
w("#tooltip_outline").css({top:(Q-1)+"px",left:(T-1)+"px",width:(w("#tooltip").outerWidth()+2)+"px",height:(w("#tooltip").outerHeight()+2)+"px"});
w("#tooltip_shadow").css({top:(Q-5)+"px",left:(T-5)+"px",width:(w("#tooltip").outerWidth()+10)+"px",height:(w("#tooltip").outerHeight()+10)+"px"});
w("#tooltip").show();w("#tooltip_outline").show();w("#tooltip_shadow").show();w("#left_stem").hide();w("#right_stem").hide();w("#"+S).css({top:O+"px",left:K+"px"}).show();
w("#left_stem_outline").hide();w("#right_stem_outline").hide();w("#"+S+"_outline").css({top:(O-1)+"px",left:(K+((S=="right_stem")?0:-1))+"px"}).show();
w("#left_stem_shadow").hide();w("#right_stem_shadow").hide();w("#"+S+"_shadow").css({top:(O-1)+"px",left:(K+((S=="right_stem")?7:-2))+"px"}).show()
}catch(L){if(u){console.log("showInfo error: "+L.message)}}}function e(M,L){var K=L?L.donor():false;if(u){console.log("hideInfo("+M+", "+(L?L.id():"-")+")")
}if(!n&&L&&activeDonation&&(activeDonation.id()==L.id())){j();activeDonation=false}}function j(){if(u){console.log("["+((new Date()).getTime()-x)+"] hideTooltipEl()")
}w("#left_stem_outline").hide();w("#right_stem_outline").hide();w("#tooltip_outline").hide();w("#tooltip_shadow").hide();w("#left_stem_shadow").hide();
w("#right_stem_shadow").hide();w("#left_stem").hide();w("#right_stem").hide();w("#tooltip").hide()}function a(){if(u){console.log("["+((new Date()).getTime()-x)+"] loadTweets()")
}var K=window.location.search;w.ajax({type:"get",url:"/donors.json"+K,dataType:"json",success:function(M,L){if(u){console.log("["+((new Date()).getTime()-x)+"] loadTweets.success!")
}addDonations(M);G()},error:function(N,M,L){alert("Error loading data: "+M+" ("+L+")")}})}function k(){w("#pg").css({height:w(window).height()+"px"});
var K=(w(window).height()-w("#hd").height()-w("#ft").height());w("#bd, #followers").height(K);w("#dialog").css({left:(Math.floor((w(window).width()-w("#dialog").width())/2/48)*48)+"px",top:(Math.floor((K-w("#dialog").height())/2/48)*48)+"px"})
}function A(P,O){if(u){console.log("handleHover("+P+", "+O+") ["+w(O.target).attr("id").toString()+"]")}var N=w(O.target.parentNode),M=parseInt(N.attr("rel")),K=(M)?donationIdMap[M]:false,L=(K)?w.donationList[(K-1)]:false;
if(!L){N=w(O.target);M=parseInt(N.attr("rel"));K=(M)?donationIdMap[M]:false;L=(K)?w.donationList[(K-1)]:false}if(!L){if(u){console.log("NO DONATION FOUND ["+M+", "+K+"] for: "+w(O.target).html().substring(0,50))
}return false}if(u){console.log("handleHover: donation["+L+"] donationId["+M+"]")}if(P){if(r){window.clearTimeout(r)}r=window.setTimeout(function(){r=false;
D(N,L)},f)}else{if(r){window.clearTimeout(r);r=false}else{r=window.setTimeout(function(){r=false;e(N,L)},f)}}}function y(K){}function H(){w("#tweak").css("top","-60px");
w("#tweak_tab_button").click(function(K){if(parseInt(w("#tweak").css("top"))==0){w("#tweak").animate({top:"-60px"},"fast")}else{w("#tweak").animate({top:"0"},"fast")
}});w("#tooltip").hover(function(K){if(u){console.log("TT.hover: on ("+this+")["+K+"] ["+w(K.target).html().substring(0,60)+"]")}n=true
},function(K){if(u){console.log("TT.hover: OFF ("+this+")["+K+"] ["+w(K.target).html().substring(0,60)+"]")}n=false;j();activeDonation=false
});w("#donors").mouseover(function(K){return A(true,K)}).mouseout(function(K){return A(false,K)});w("#bd").css("top",(w("#hd").outerHeight())+"px");
w(window).resize(function(K){if(C){window.clearTimeout(C)}C=window.setTimeout(function(){k()},100)});C=window.setTimeout(function(){k()
},100);w("#follow_drew_button").click(function(K){w.ajax({type:"post",url:"/t/follow.json",data:{follow:"yes"},dataType:"json",success:function(M,L){if(u){console.log("["+((new Date()).getTime()-x)+"] follow.success!")
}if(M.status=="auth"){window.location="/t/follow"}else{w("#follow_drew_button").hide();w("#follow_drew_thanks").show();w("#tweet_button").addClass("active");
w("#info_dialog").hide();w("#tweet_dialog").show()}},error:function(N,M,L){}})});w("#tweet_button").click(function(K){w("#info_dialog").toggle();
w("#tweet_dialog").toggle()});w("#post_tweet_button").click(function(K){w.ajax({type:"post",url:"/t/tweet.json",data:{message:w("#tweet_status").val()},dataType:"json",success:function(M,L){if(u){console.log("["+((new Date()).getTime()-x)+"] post_tweet.success!")
}if(M.status=="auth"){window.location="/t/tweet"}else{w("#tweet_dialog").hide();w("#info_dialog").show()}},error:function(N,M,L){}})
});w("#post_tweet_cancel").click(function(K){w("#info_dialog").toggle();w("#tweet_dialog").toggle();return false});if(w.cookie("is_following")=="yes"){w("#follow_drew_button").hide();
w("#follow_drew_thanks").show();w("#tweet_button").addClass("active")}else{w("#follow_drew_button").show();w("#follow_drew_thanks").hide()
}w("#followers").click(function(K){var M=w(K.target),L=M.hasClass("follower")?M.data("follower"):M.parent().data("follower");if(L){if(u){console.log("CLICK: follower is "+L.id())
}window.open("http://twitter.com/"+L.user().screen_name(),"_blank");return false}else{if(u){console.log("CLICK: not a follower!")
}}});if(w.followers.length>0){if(u){console.log("START: follower count is "+w.followers.length)}t(w.followers);G()}else{a()}}function i(K){if(u){console.log("updateTotal: setting to: "+K)
}w("#sum_donations").css("width",Math.min(98,Math.floor((K/1000000)*83)+15)+"%").html(q(K)+"&nbsp;&nbsp;")}function v(){F=window.setInterval(function(){c()
},5000)}function B(){window.clearInterval(F)}w.MDD={start:function(){H();v();w.MDD.updateProgress();window.setTimeout(function(){w.MDD.updateProgress()
},(60*1000));o=window.setInterval(function(){w.MDD.updateProgress()},(180*1000))},startCycle:function(){v()},stopCycle:function(){B()
},updateProgress:function(){w.getJSON("http://twitter.com/users/show.json?user_id=50835878&callback=?",function(K){if(u){console.log("updateProgress: got user info: "+K)
}if(K&&K.followers_count){i(parseInt(K.followers_count))}})}}})(jQuery);