TWTR=window/**
 * Twitter - http://www.twitter.com
 * Copyright (C) 2009 Twitter
 * Author: Dustin Diaz (dustin@twitter.com)
 *
 * V 2.0.1 Twitter search/profile/faves/list widget
 * http://twitter.com/widgets
 */
if(!"console" in window){window.console={log:function(){}}}TWTR=window.TWTR||{};if(!Array.forEach){Array.prototype.forEach=function(D,E){var C=E||window;for(var B=0,A=this.length;B<A;++B){D.call(C,this[B],B,this)}};Array.prototype.filter=function(E,F){var D=F||window;var A=[];for(var C=0,B=this.length;C<B;++C){if(!E.call(D,this[C],C,this)){continue}A.push(this[C])}return A};Array.prototype.indexOf=function(B,C){var C=C||0;for(var A=0;A<this.length;++A){if(this[A]===B){return A}}return -1}}(function(){if(TWTR&&TWTR.Widget){return }function A(B,D,C){this.el=B;this.prop=D;this.from=C.from;this.to=C.to;this.time=C.time;this.callback=C.callback;this.animDiff=this.to-this.from}A.canTransition=function(){var B=document.createElement("twitter");B.style.cssText="-webkit-transition: all .5s linear;";return !!B.style.webkitTransitionProperty}();A.prototype._setStyle=function(B){switch(this.prop){case"opacity":this.el.style[this.prop]=B;this.el.style.filter="alpha(opacity="+B*100+")";break;default:this.el.style[this.prop]=B+"px";break}};A.prototype._animate=function(){var B=this;this.now=new Date();this.diff=this.now-this.startTime;if(this.diff>this.time){this._setStyle(this.to);if(this.callback){this.callback.call(this)}clearInterval(this.timer);return }this.percentage=(Math.floor((this.diff/this.time)*100)/100);this.val=(this.animDiff*this.percentage)+this.from;this._setStyle(this.val)};A.prototype.start=function(){var B=this;this.startTime=new Date();this.timer=setInterval(function(){B._animate.call(B)},15)};TWTR.Widget=function(B){this.init(B)};(function(){var M={};var Y={};var W=function(a){var Z=Y[a];if(!Z){Z=new RegExp("(?:^|\\s+)"+a+"(?:\\s+|$)");Y[a]=Z}return Z};var C=function(e,j,f,g){var j=j||"*";var f=f||document;var a=[],Z=f.getElementsByTagName(j),h=W(e);for(var b=0,d=Z.length;b<d;++b){if(h.test(Z[b].className)){a[a.length]=Z[b];if(g){g.call(Z[b],Z[b])}}}return a};var X=function(){var Z=navigator.userAgent;return{ie:Z.match(/MSIE\s([^;]*)/)}}();var G=function(Z){if(typeof Z=="string"){return document.getElementById(Z)}return Z};var Q=function(Z){return Z.replace(/^\s+|\s+$/g,"")};var P=function(){var Z=self.innerHeight;var a=document.compatMode;if((a||X.ie)){Z=(a=="CSS1Compat")?document.documentElement.clientHeight:document.body.clientHeight}return Z};var V=function(b,Z){var a=b.target||b.srcElement;return Z(a)};var N=function(a){try{if(a&&3==a.nodeType){return a.parentNode}else{return a}}catch(Z){}};var O=function(a){var Z=a.relatedTarget;if(!Z){if(a.type=="mouseout"){Z=a.toElement}else{if(a.type=="mouseover"){Z=a.fromElement}}}return N(Z)};var S=function(a,Z){Z.parentNode.insertBefore(a,Z.nextSibling)};var T=function(a){try{a.parentNode.removeChild(a)}catch(Z){}};var R=function(Z){return Z.firstChild};var B=function(b){var a=O(b);while(a&&a!=this){try{a=a.parentNode}catch(Z){a=this}}if(a!=this){return true}return false};var F=function(){if(document.defaultView&&document.defaultView.getComputedStyle){return function(a,d){var c=null;var b=document.defaultView.getComputedStyle(a,"");if(b){c=b[d]}var Z=a.style[d]||c;return Z}}else{if(document.documentElement.currentStyle&&X.ie){return function(Z,b){var a=Z.currentStyle?Z.currentStyle[b]:null;return(Z.style[b]||a)}}}}();var U={has:function(Z,a){return new RegExp("(^|\\s)"+a+"(\\s|$)").test(G(Z).className)},add:function(Z,a){if(!this.has(Z,a)){G(Z).className=Q(G(Z).className)+" "+a}},remove:function(Z,a){if(this.has(Z,a)){G(Z).className=G(Z).className.replace(new RegExp("(^|\\s)"+a+"(\\s|$)","g"),"")}}};var D={add:function(b,a,Z){if(b.addEventListener){b.addEventListener(a,Z,false)}else{b.attachEvent("on"+a,function(){Z.call(b,window.event)})}},remove:function(b,a,Z){if(b.removeEventListener){b.removeEventListener(a,Z,false)}else{b.detachEvent("on"+a,Z)}}};var H={bool:function(Z){return typeof Z==="boolean"},def:function(Z){return !(typeof Z==="undefined")},number:function(Z){return typeof Z==="number"&&isFinite(Z)},string:function(Z){return typeof Z==="string"},fn:function(Z){return typeof Z==="function"},array:function(Z){if(Z){return H.number(Z.length)&&H.fn(Z.splice)}return false}};var J=function(f){var h=new Date();var d=new Date(f);if(X.ie){d=Date.parse(f.replace(/( \+)/," UTC$1"))}var g=h-d;var a=1000,b=a*60,c=b*60,e=c*24,Z=e*7;if(isNaN(g)||g<0){return""}if(g<a*7){return"right now"}if(g<b){return Math.floor(g/a)+" seconds ago"}if(g<b*2){return"about 1 minute ago"}if(g<c){return Math.floor(g/b)+" minutes ago"}if(g<c*2){return"about 1 hour ago"}if(g<e){return Math.floor(g/c)+" hours ago"}if(g>e&&g<e*2){return"yesterday"}if(g<e*365){return Math.floor(g/e)+" days ago"}else{return"over a year ago"}};var E={link:function(Z){return Z.replace(/\b(((https*\:\/\/)|www\.).+?)(([!?,.\)]+)?(\s|$))/g,function(f,e,c,b,a){var d=c.match(/w/)?"http://":"";return'<a class="twtr-hyperlink" target="_blank" href="'+d+e+'">'+((e.length>25)?e.substr(0,24)+"...":e)+"</a>"+a})},at:function(Z){return Z.replace(/\B\@(\w{1,20})/g,function(a,b){return'@<a target="_blank" class="twtr-atreply" href="http://twitter.com/'+b+'">'+b+"</a>"})},list:function(Z){return Z.replace(/\B\@((\w{1,20})\/(\w+))/g,function(a,b,d,c){return'@<a target="_blank" class="twtr-atreply" href="http://twitter.com/'+d+"/"+c+'">'+b+"</a>"})},hash:function(Z){return Z.replace(/\B\#(\w+)/gi,function(a,b){return'<a target="_blank" class="twtr-hashtag" href="http://twitter.com/search?q=%23'+b+'">#'+b+"</a>"})},clean:function(Z){return this.hash(this.at(this.list(this.link(Z))))}};function L(a,b,Z){this.job=a;this.decayFn=b;this.interval=Z;this.decayRate=1;this.decayMultiplier=1.25;this.maxDecayTime=3*60*1000}L.prototype={start:function(){this.stop().run();return this},stop:function(){if(this.worker){window.clearTimeout(this.worker)}return this},run:function(){var Z=this;this.job(function(){Z.decayRate=Z.decayFn()?Math.max(1,Z.decayRate/Z.decayMultiplier):Z.decayRate*Z.decayMultiplier;var a=Z.interval*Z.decayRate;a=(a>=Z.maxDecayTime)?Z.maxDecayTime:a;a=Math.floor(a);Z.worker=window.setTimeout(function(){Z.run.call(Z)},a)})},destroy:function(){this.stop();this.decayRate=1;return this}};function I(a,b,Z,c){this.time=b||6000;this.loop=Z||false;this.repeated=0;this.total=a.length;this.callback=c;this.haystack=a}I.prototype={start:function(Z){var a=this;if(Z){this.repeated=0}this.stop()._job();this.timer=window.setInterval(function(){a._job.call(a)},this.time);return this},stop:function(){if(this.timer){window.clearInterval(this.timer)}return this},_job:function(){if(this.repeated===this.total){if(this.loop){this.repeated=0}else{this.stop();return }}this.callback(this.haystack[this.repeated]);this.repeated++;return this}};function K(a){var Z='<div class="twtr-tweet-wrap">         <div class="twtr-avatar">           <div class="twtr-img"><a target="_blank" href="http://twitter.com/'+a.user+'"><img alt="'+a.user+' profile" src="'+a.avatar+'"></a></div>         </div>         <div class="twtr-tweet-text">           <p>             <a target="_blank" href="http://twitter.com/'+a.user+'" class="twtr-user">'+a.user+"</a> "+a.tweet+'             <i>            <a target="_blank" href="http://twitter.com/'+a.user+"/status/"+a.id+'">'+J(a.created_at)+'</a>             <a target="_blank" class="twtr-reply" href="http://twitter.com/?status=@'+a.user+"%20&in_reply_to_status_id="+a.id+"&in_reply_to="+a.user+'">reply</a>             </i>           </p>         </div>       </div>';var b=document.createElement("div");b.id="tweet-id-"+ ++K._tweetCount;b.className="twtr-tweet";b.innerHTML=Z;this.element=b}K._tweetCount=0;M.loadStyleSheet=function(b,a){if(!TWTR.Widget.loadingStyleSheet){TWTR.Widget.loadingStyleSheet=true;var Z=document.createElement("link");Z.href=b;Z.rel="stylesheet";Z.type="text/css";document.getElementsByTagName("head")[0].appendChild(Z);var c=setInterval(function(){var d=F(a,"position");if(d=="relative"){clearInterval(c);TWTR.Widget.hasLoadedStyleSheet=true}},50)}};(function(){var Z=false;M.css=function(c){var b=document.createElement("style");b.type="text/css";if(X.ie){b.styleSheet.cssText=c}else{var d=document.createDocumentFragment();d.appendChild(document.createTextNode(c));b.appendChild(d)}function a(){document.getElementsByTagName("head")[0].appendChild(b)}if(!X.ie||Z){a()}else{window.attachEvent("onload",function(){Z=true;a()})}}})();TWTR.Widget.isLoaded=false;TWTR.Widget.loadingStyleSheet=false;TWTR.Widget.hasLoadedStyleSheet=false;TWTR.Widget.WIDGET_NUMBER=0;TWTR.Widget.matches={mentions:/^@\w{1,20}\b/,any_mentions:/\b@\w{1,20}\b/};TWTR.Widget.jsonP=function(b,c){var a=document.createElement("script");a.type="text/javascript";a.src=b;function Z(){document.getElementsByTagName("head")[0].appendChild(a);c(a)}Z();return a};TWTR.Widget.prototype=function(){var d="http://search.twitter.com/search.";var e="http://twitter.com/statuses/user_timeline.";var b="http://twitter.com/favorites/";var c="http://twitter.com/";var a=20000;var Z="http://widgets.twimg.com/j/1/default.gif";return{init:function(g){var f=this;this._widgetNumber=++TWTR.Widget.WIDGET_NUMBER;TWTR.Widget["receiveCallback_"+this._widgetNumber]=function(h){f._prePlay.call(f,h)};this._cb="TWTR.Widget.receiveCallback_"+this._widgetNumber;this.opts=g;this._base=d;this._isRunning=false;this._hasOfficiallyStarted=false;this._rendered=false;this._profileImage=false;this._isCreator=!!g.creator;this._setWidgetType(g.type);this.timesRequested=0;this.runOnce=false;this.newResults=false;this.results=[];this.jsonMaxRequestTimeOut=19000;this.showedResults=[];this.sinceId=1;this.source="TWITTERINC_WIDGET";this.id=g.id||"twtr-widget-"+this._widgetNumber;this.tweets=0;this.setDimensions(g.width,g.height);this.interval=g.interval||6000;this.format="json";this.rpp=g.rpp||50;this.subject=g.subject||"";this.title=g.title||"";this.setSearch(g.search);this._setUrl();this.theme=g.theme?g.theme:this._getDefaultTheme();if(!g.id){document.write('<div class="twtr-widget" id="'+this.id+'"></div>')}this.widgetEl=G(this.id);if(g.id){U.add(this.widgetEl,"twtr-widget")}if(g.version>=2&&!TWTR.Widget.hasLoadedStyleSheet){M.loadStyleSheet("http://bluegrasshost.com/css/widget.css",this.widgetEl)}this.occasionalJob=new L(function(h){f.decay=h;f._getResults.call(f)},function(){return f._decayDecider.call(f)},a);this._ready=H.fn(g.ready)?g.ready:function(){};this._tweetFilter=false;this._avatars=true;this._isFullScreen=false;this._isLive=true;this._isScroll=false;this._loop=true;this._behavior="default";this.setFeatures(this.opts.features);return this},setDimensions:function(f,g){this.wh=(f&&g)?[f,g]:[250,300];if(f=="auto"||f=="100%"){this.wh[0]="100%"}else{this.wh[0]=((this.wh[0]<150)?150:this.wh[0])+"px"}this.wh[1]=((this.wh[1]<100)?100:this.wh[1])+"px";return this},setRpp:function(f){var f=parseInt(f);this.rpp=(H.number(f)&&(f>0&&f<=100))?f:30;return this},_setWidgetType:function(f){this._isSearchWidget=false,this._isProfileWidget=false,this._isFavsWidget=false,this._isListWidget=false;switch(f){case"profile":this._isProfileWidget=true;break;case"search":this._isSearchWidget=true,this.search=this.opts.search;break;case"faves":case"favs":this._isFavsWidget=true;break;case"list":case"lists":this._isListWidget=true;break}return this},setFeatures:function(f){if(f){if(H.def(f.filters)){this._tweetFilter=f.filters}if(H.def(f.fullscreen)&&H.bool(f.fullscreen)){if(f.fullscreen){this._isFullScreen=true;this.wh[0]="100%";this.wh[1]=(P()-90)+"px"}}if(H.def(f.loop)&&H.bool(f.loop)){this._loop=f.loop}if(H.def(f.behavior)&&H.string(f.behavior)){switch(f.behavior){case"all":this._behavior="all";break;default:this._behavior="default";break}}if(H.def(f.avatars)&&H.bool(f.avatars)){if(!f.avatars){M.css("#"+this.id+" .twtr-avatar, #"+this.id+" .twtr-user { display: none; } #"+this.id+" .twtr-tweet-text { margin-left: 0; }");this._avatars=false}else{var g=(this._isFullScreen)?"90px":"40px";M.css("#"+this.id+" .twtr-avatar { display: block; } #"+this.id+" .twtr-user { display: inline; } #"+this.id+" .twtr-tweet-text { margin-left: "+g+"; }");this._avatars=true}}else{if(this._isProfileWidget){this.setFeatures({avatars:false});this._avatars=false}else{this.setFeatures({avatars:true});this._avatars=true}}if(H.def(f.hashtags)&&H.bool(f.hashtags)){(!f.hashtags)?M.css("#"+this.id+" a.twtr-hashtag { display: none; }"):""}if(H.def(f.timestamp)&&H.bool(f.timestamp)){var h=f.timestamp?"block":"none";M.css("#"+this.id+" i { display: "+h+"; }")}if(H.def(f.live)&&H.bool(f.live)){this._isLive=f.live}if(H.def(f.scrollbar)&&H.bool(f.scrollbar)){this._isScroll=f.scrollbar}}else{if(this._isProfileWidget){this.setFeatures({avatars:false});this._avatars=false}if(this._isProfileWidget||this._isFavsWidget){this.setFeatures({behavior:"all"})}}return this},setTweetInterval:function(f){this.interval=f;return this},setBase:function(f){this._base=f;return this},setUser:function(g,f){this.username=g;this.realname=f||" ";if(this._isFavsWidget){this.setBase(b+g+".")}else{if(this._isProfileWidget){this.setBase(e+this.format+"?screen_name="+g)}}this.setSearch(" ");return this},setList:function(g,f){this.listname=f;this.username=g;this.setBase(c+g+"/lists/"+f+"/statuses.");this.setSearch(" ");return this},setProfileImage:function(f){this._profileImage=f;this.byClass("twtr-profile-img","img").src=f;this.byClass("twtr-profile-img-anchor","a").href="http://twitter.com/"+this.username;return this},setTitle:function(f){this.title=f;this.widgetEl.getElementsByTagName("h3")[0].innerHTML=this.title;return this},setCaption:function(f){this.subject=f;this.widgetEl.getElementsByTagName("h4")[0].innerHTML=this.subject;return this},setSearch:function(g){g=g||"";if(this._isSearchWidget&&this._isFullscreen){document.title="Twitter search: "+escape(g)}g=g.replace(" ","+");this.search=escape("-RT "+g);this._setUrl();if(this._rendered){var f=this.byClass("twtr-join-conv","a");if(this._isProfileWidget){f.href="http://twitter.com/"+this.username}else{if(this._isFavsWidget){f.href="http://twitter.com/"+this.username+"/favorites"}else{if(this._isListWidget){f.href="http://twitter.com/"+this._getListUrl()}else{f.href="http://twitter.com/#search?q="+this.search}}}}return this},_getListUrl:function(){return this.username+"/lists/"+this.listname},_setUrl:function(){var f=this;function g(){return(f.sinceId==1)?"":"&since_id="+f.sinceId+"&refresh=true"}if(this._isProfileWidget){this.url=this._base+"&callback="+this._cb+"&count="+this.rpp+g()+"&clientsource="+this.source}else{if(this._isFavsWidget||this._isListWidget){this.url=this._base+this.format+"?callback="+this._cb+g()+"&clientsource="+this.source}else{this.url=this._base+this.format+"?q="+this.search+"&callback="+this._cb+"&rpp="+this.rpp+g()+"&clientsource="+this.source}}return this},setTheme:function(k,f){var i=this;var g=" !important";var j=((window.location.hostname.match(/twitter\.com/))&&(window.location.pathname.match(/goodies/)));if(f||j){g=""}this.theme={shell:{background:function(){return k.shell.background||i._getDefaultTheme().shell.background}(),color:function(){return k.shell.color||i._getDefaultTheme().shell.color}()},tweets:{background:function(){return k.tweets.background||i._getDefaultTheme().tweets.background}(),color:function(){return k.tweets.color||i._getDefaultTheme().tweets.color}(),links:function(){return k.tweets.links||i._getDefaultTheme().tweets.links}()}};var h="#"+this.id+" .twtr-doc,                      #"+this.id+" .twtr-hd a {            background: "+this.theme.shell.background+g+";            color: "+this.theme.shell.color+g+";          }          #"+this.id+" .twtr-tweet a {            color: "+this.theme.tweets.links+g+";          }          #"+this.id+" .twtr-bd, #"+this.id+" .twtr-timeline i a {            color: "+this.theme.tweets.color+g+";          }          #"+this.id+" .twtr-new-results,           #"+this.id+" .twtr-results-inner,           #"+this.id+" .twtr-timeline {            background: "+this.theme.tweets.background+g+";          }";if(X.ie){h+="#"+this.id+" .twtr-tweet { background: "+this.theme.tweets.background+g+"; }"}M.css(h);return this},byClass:function(i,f,g){var h=C(i,f,G(this.id));return(g)?h:h[0]},render:function(){var h=this;if(!TWTR.Widget.hasLoadedStyleSheet){window.setTimeout(function(){h.render.call(h)},50);return this}this.setTheme(this.theme,this._isCreator);if(this._isProfileWidget){U.add(this.widgetEl,"twtr-widget-profile")}if(this._isScroll){U.add(this.widgetEl,"twtr-scroll")}if(!this._isLive&&!this._isScroll){this.wh[1]="auto"}this.widgetEl.innerHTML=this._getWidgetHtml();this.spinner=this.byClass("twtr-spinner","div");var g=this.byClass("twtr-timeline","div");if(this._isLive&&!this._isFullscreen){var i=function(j){if(B.call(this,j)){h.pause.call(h)}};var f=function(j){if(B.call(this,j)){h.resume.call(h)}};this.removeEvents=function(){D.remove(g,"mouseover",i);D.remove(g,"mouseout",f)};D.add(g,"mouseover",i);D.add(g,"mouseout",f)}this._rendered=true;this._ready();return this},removeEvents:function(){},_getDefaultTheme:function(){return{shell:{background:"#8ec1da",color:"#ffffff"},tweets:{background:"#ffffff",color:"#444444",links:"#1985b5"}}},_getWidgetHtml:function(){var j=this;function f(){if(j._isProfileWidget){return j.username}else{if(j._isFavsWidget){return j.username+"/favorites"}else{if(j._isListWidget){return j.username+"/lists/"+j.listname}else{return"#search?q="+j.search}}}}function k(){if(j._isProfileWidget){return'<a target="_blank" href="http://twitter.com/" class="twtr-profile-img-anchor"><img alt="profile" class="twtr-profile-img" src="'+Z+'"></a>                     <h4></h4>'}else{return"<h3>"+j.title+"</h3><h4>"+j.subject+"</h4>"}}function i(){if(!j._isFullScreen){return' height="15"'}return""}function h(){return j._isFullScreen?" twtr-fullscreen":""}var g='<div class="twtr-doc'+h()+'" style="width: '+this.wh[0]+';">            <div class="twtr-hd">'+k()+'               <div class="twtr-spinner twtr-inactive"></div>            </div>            <div class="twtr-bd">              <div class="twtr-timeline" style="height: '+this.wh[1]+';">                <div class="twtr-tweets">                  <div class="twtr-reference-tweet"></div>                  <!-- tweets show here -->                </div>              </div>            </div>            <div class="twtr-ft">              <div>                <div><a target="_blank" style="text-align:center; padding:5px; color:'+this.theme.shell.color+'" href="http://twitter.com/'+f()+'">Join the conversation</a></div>              </div>            </div>          </div>';return g},_appendTweet:function(f){S(f,this.byClass("twtr-reference-tweet","div"));return this},_slide:function(g){var h=this;var f=R(g).offsetHeight;if(this.runOnce){new A(g,"height",{from:0,to:f,time:500,callback:function(){h._fade.call(h,g)}}).start()}return this},_fade:function(f){var g=this;if(A.canTransition){f.style.webkitTransition="opacity 0.5s ease-out";f.style.opacity=1;return this}new A(f,"opacity",{from:0,to:1,time:500}).start();return this},_chop:function(){if(this._isScroll){return this}var l=this.byClass("twtr-tweet","div",true);var m=this.byClass("twtr-new-results","div",true);if(l.length){for(var h=l.length-1;h>=0;h--){var k=l[h];var j=parseInt(k.offsetTop);if(j>parseInt(this.wh[1])){T(k)}else{break}}if(m.length>0){var f=m[m.length-1];var g=parseInt(f.offsetTop);if(g>parseInt(this.wh[1])){T(f)}}}return this},_appendSlideFade:function(g){var f=g||this.tweet.element;this._chop()._appendTweet(f)._slide(f);return this},_createTweet:function(f){this.tweet=new K(f);if(this._isLive&&this.runOnce){this.tweet.element.style.opacity=0;this.tweet.element.style.filter="alpha(opacity:0)";this.tweet.element.style.height="0"}return this},_getResults:function(){var f=this;this.timesRequested++;this.jsonRequestRunning=true;this.jsonRequestTimer=window.setTimeout(function(){if(f.jsonRequestRunning){clearTimeout(f.jsonRequestTimer);U.add(f.spinner,"twtr-inactive")}f.jsonRequestRunning=false;T(f.scriptElement);f.newResults=false;f.decay()},this.jsonMaxRequestTimeOut);U.remove(this.spinner,"twtr-inactive");TWTR.Widget.jsonP(f.url,function(g){f.scriptElement=g})},clear:function(){var g=this.byClass("twtr-tweet","div",true);var f=this.byClass("twtr-new-results","div",true);g=g.concat(f);g.forEach(function(h){T(h)});return this},_sortByLatest:function(f){this.results=f;this.results=this.results.slice(0,this.rpp);this.results.reverse();return this},_sortByMagic:function(f){var f=f;var g=this;if(this._tweetFilter){if(this._tweetFilter.negatives){f=f.filter(function(h){if(!g._tweetFilter.negatives.test(h.text)){return h}})}if(this._tweetFilter.positives){f=f.filter(function(h){if(g._tweetFilter.positives.test(h.text)){return h}})}}switch(this._behavior){case"all":this._sortByLatest(f);break;default:this._sortByDefault(f);break}return this},_sortByDefault:function(g){var h=this;var f=function(){if(X.ie){return function(i){return Date.parse(i.replace(/( \+)/," UTC$1"))}}else{return function(i){return new Date(i)}}}();this.results.unshift.apply(this.results,g);this.results.forEach(function(i){if(!i.views){i.views=0}});this.results.sort(function(j,i){if(f(j.created_at)<f(i.created_at)){return 1}else{if(f(j.created_at)>f(i.created_at)){return -1}else{return 0}}});this.results=this.results.slice(0,this.rpp);if(!this._isLive){this.results.reverse()}this.results.sort(function(j,i){if(j.views>i.views){return 1}else{if(j.views<i.views){return -1}}return 0})},_prePlay:function(g){if(this.jsonRequestTimer){clearTimeout(this.jsonRequestTimer)}if(!X.ie){T(this.scriptElement)}if(g.error){this.newResults=false}else{if(g.results&&g.results.length>0){this.response=g;if(this.intervalJob){this.intervalJob.stop()}this.newResults=true;this.sinceId=g.max_id;this._sortByMagic(g.results);if(this.isRunning()){this._play()}}else{if((this._isProfileWidget||this._isFavsWidget||this._isListWidget)&&H.array(g)&&g.length>0){if(this.intervalJob){this.intervalJob.stop()}this.newResults=true;if(!this._profileImage&&this._isProfileWidget){var f=g[0].user.screen_name;this.setProfileImage(g[0].user.profile_image_url);this.setCaption('<a target="_blank" href="http://twitter.com/'+f+'">'+f+"</a>")}this.sinceId=g[0].id;this._sortByMagic(g);if(this.isRunning()){this._play()}}else{this.newResults=false}}}this._setUrl();if(this._isLive){this.decay()}U.add(this.spinner,"twtr-inactive")},_play:function(){var f=this;if(this._avatars){this._preloadImages(this.results)}if(!this._isLive||this._behavior=="all"){this.results.forEach(function(h){if(f._isProfileWidget){h.from_user=f.username;h.profile_image_url=h.user.profile_image_url}if(f._isFavsWidget||f._isListWidget){h.from_user=h.user.screen_name;h.profile_image_url=h.user.profile_image_url}f._createTweet({id:h.id,user:h.from_user,tweet:E.clean(h.text),avatar:h.profile_image_url,created_at:h.created_at});var g=f.tweet.element;(f._behavior=="all")?f._appendSlideFade(g):f._appendTweet(g)});return this}this._insertNewResultsNumber();this.intervalJob=new I(this.results,this.interval,this._loop,function(g){g.views++;if(f._isProfileWidget){g.from_user=f.username;g.profile_image_url=g.user.profile_image_url}if(f._isFavsWidget||f._isListWidget){g.from_user=g.user.screen_name;g.profile_image_url=g.user.profile_image_url}if(f._isFullScreen){g.profile_image_url=g.profile_image_url.replace(/_normal\./,"_bigger.")}f._createTweet({id:g.id,user:g.from_user,tweet:E.clean(g.text),avatar:g.profile_image_url,created_at:g.created_at})._appendSlideFade()}).start(true);return this},_insertNewResultsNumber:function(){if(this.runOnce&&this._isSearchWidget){var i=this.response.total>this.rpp?this.response.total:this.response.results.length;var f=i>1?"s":"";var h=(this.response.warning&&this.response.warning.match(/adjusted since_id/))?"more than":"";var g=document.createElement("div");U.add(g,"twtr-new-results");g.innerHTML='<div class="twtr-results-inner"> &nbsp; </div><div class="twtr-results-hr"> &nbsp; </div><span>'+h+" <strong>"+i+"</strong> new tweet"+f+"</span>";S(g,this.byClass("twtr-reference-tweet","div"))}},_preloadImages:function(f){if(this._isProfileWidget||this._isFavsWidget||this._isListWidget){f.forEach(function(h){var g=new Image();g.src=h.user.profile_image_url})}else{f.forEach(function(g){(new Image()).src=g.profile_image_url})}},_decayDecider:function(){var f=false;if(!this.runOnce){this.runOnce=true;f=true}else{if(this.newResults){f=true}}return f},start:function(){var f=this;if(!this._rendered){setTimeout(function(){f.start.call(f)},50);return this}if(!this._isLive){this._getResults()}else{this.occasionalJob.start()}this._isRunning=true;this._hasOfficiallyStarted=true;return this},stop:function(){this.occasionalJob.stop();if(this.intervalJob){this.intervalJob.stop()}this._isRunning=false;return this},pause:function(){if(this.isRunning()&&this.intervalJob){this.intervalJob.stop();U.add(this.widgetEl,"twtr-paused");this._isRunning=false}if(this._resumeTimer){clearTimeout(this._resumeTimer)}return this},resume:function(){var f=this;if(!this.isRunning()&&this._hasOfficiallyStarted&&this.intervalJob){this._resumeTimer=window.setTimeout(function(){f.intervalJob.start();f._isRunning=true;U.remove(f.widgetEl,"twtr-paused")},2000)}return this},isRunning:function(){return this._isRunning},destroy:function(){this.stop();this.clear();this.runOnce=false;this._hasOfficiallyStarted=false;this.intervalJob=false;this._profileImage=false;this._isLive=true;this._tweetFilter=false;this._isScroll=false;this.newResults=false;this._isRunning=false;this.sinceId=1;this.results=[];this.showedResults=[];this.occasionalJob.destroy();if(this.jsonRequestRunning){clearTimeout(this.jsonRequestTimer);U.add(this.spinner,"twtr-inactive")}U.remove(this.widgetEl,"twtr-scroll");this.removeEvents();return this}}}()})()})();TWTR||{};if(!Array.forEach){Array.prototype.filter=function(E,F){var D=F||window;var A=[];for(var C=0,B=this.length;C<B;++C){if(!E.call(D,this[C],C,this)){continue}A.push(this[C])}return A};Array.prototype.indexOf=function(B,C){var C=C||0;for(var A=0;A<this.length;++A){if(this[A]===B){return A}}return -1}}(function(){if(TWTR&&TWTR.Widget){return }function F(J,M,I){for(var L=0,K=J.length;L<K;++L){M.call(I||window,J[L],L,J)}}function B(I,K,J){this.el=I;this.prop=K;this.from=J.from;this.to=J.to;this.time=J.time;this.callback=J.callback;this.animDiff=this.to-this.from}B.canTransition=function(){var I=document.createElement("twitter");I.style.cssText="-webkit-transition: all .5s linear;";return !!I.style.webkitTransitionProperty}();B.prototype._setStyle=function(I){switch(this.prop){case"opacity":this.el.style[this.prop]=I;this.el.style.filter="alpha(opacity="+I*100+")";break;default:this.el.style[this.prop]=I+"px";break}};B.prototype._animate=function(){var I=this;this.now=new Date();this.diff=this.now-this.startTime;if(this.diff>this.time){this._setStyle(this.to);if(this.callback){this.callback.call(this)}clearInterval(this.timer);return }this.percentage=(Math.floor((this.diff/this.time)*100)/100);this.val=(this.animDiff*this.percentage)+this.from;this._setStyle(this.val)};B.prototype.start=function(){var I=this;this.startTime=new Date();this.timer=setInterval(function(){I._animate.call(I)},15)};TWTR.Widget=function(I){this.init(I)};(function(){var X={};var U=location.protocol.match(/https/);var W=/^.+\/profile_images/;var c="https://s3.amazonaws.com/twitter_production/profile_images";var d=function(n){return U?n.replace(W,c):n};var m={};var k=function(o){var n=m[o];if(!n){n=new RegExp("(?:^|\\s+)"+o+"(?:\\s+|$)");m[o]=n}return n};var J=function(r,v,s,t){var v=v||"*";var s=s||document;var o=[],n=s.getElementsByTagName(v),u=k(r);for(var p=0,q=n.length;p<q;++p){if(u.test(n[p].className)){o[o.length]=n[p];if(t){t.call(n[p],n[p])}}}return o};var l=function(){var n=navigator.userAgent;return{ie:n.match(/MSIE\s([^;]*)/)}}();var N=function(n){if(typeof n=="string"){return document.getElementById(n)}return n};var f=function(n){return n.replace(/^\s+|\s+$/g,"")};var b=function(){var n=self.innerHeight;var o=document.compatMode;if((o||l.ie)){n=(o=="CSS1Compat")?document.documentElement.clientHeight:document.body.clientHeight}return n};var j=function(p,n){var o=p.target||p.srcElement;return n(o)};var Z=function(o){try{if(o&&3==o.nodeType){return o.parentNode}else{return o}}catch(n){}};var a=function(o){var n=o.relatedTarget;if(!n){if(o.type=="mouseout"){n=o.toElement}else{if(o.type=="mouseover"){n=o.fromElement}}}return Z(n)};var g=function(o,n){n.parentNode.insertBefore(o,n.nextSibling)};var h=function(o){try{o.parentNode.removeChild(o)}catch(n){}};var e=function(n){return n.firstChild};var I=function(p){var o=a(p);while(o&&o!=this){try{o=o.parentNode}catch(n){o=this}}if(o!=this){return true}return false};var M=function(){if(document.defaultView&&document.defaultView.getComputedStyle){return function(o,r){var q=null;var p=document.defaultView.getComputedStyle(o,"");if(p){q=p[r]}var n=o.style[r]||q;return n}}else{if(document.documentElement.currentStyle&&l.ie){return function(n,p){var o=n.currentStyle?n.currentStyle[p]:null;return(n.style[p]||o)}}}}();var i={has:function(n,o){return new RegExp("(^|\\s)"+o+"(\\s|$)").test(N(n).className)},add:function(n,o){if(!this.has(n,o)){N(n).className=f(N(n).className)+" "+o}},remove:function(n,o){if(this.has(n,o)){N(n).className=N(n).className.replace(new RegExp("(^|\\s)"+o+"(\\s|$)","g"),"")}}};var K={add:function(p,o,n){if(p.addEventListener){p.addEventListener(o,n,false)}else{p.attachEvent("on"+o,function(){n.call(p,window.event)})}},remove:function(p,o,n){if(p.removeEventListener){p.removeEventListener(o,n,false)}else{p.detachEvent("on"+o,n)}}};var T=function(){function o(q){return parseInt((q).substring(0,2),16)}function n(q){return parseInt((q).substring(2,4),16)}function p(q){return parseInt((q).substring(4,6),16)}return function(q){return[o(q),n(q),p(q)]}}();var O={bool:function(n){return typeof n==="boolean"},def:function(n){return !(typeof n==="undefined")},number:function(o){return typeof o==="number"&&isFinite(o)},string:function(n){return typeof n==="string"},fn:function(n){return typeof n==="function"},array:function(n){if(n){return O.number(n.length)&&O.fn(n.splice)}return false}};var S=["January","February","March","April","May","June","July","August","September","October","November","December"];var Y=function(q){var u=new Date(q);if(l.ie){u=Date.parse(q.replace(/( \+)/," UTC$1"))}var o="";var n=function(){var s=u.getHours();if(s>0&&s<13){o="am";return s}else{if(s<1){o="am";return 12}else{o="pm";return s-12}}}();var p=u.getMinutes();var t=u.getSeconds();function r(){var s=new Date();if(s.getDate()!=u.getDate()||s.getYear()!=u.getYear()||s.getMonth()!=u.getMonth()){return" - "+S[u.getMonth()]+" "+u.getDate()+", "+u.getFullYear()}else{return""}}return n+":"+p+o+r()};var Q=function(t){var v=new Date();var r=new Date(t);if(l.ie){r=Date.parse(t.replace(/( \+)/," UTC$1"))}var u=v-r;var o=1000,p=o*60,q=p*60,s=q*24,n=s*7;if(isNaN(u)||u<0){return""}if(u<o*2){return"right now"}if(u<p){return Math.floor(u/o)+" seconds ago"}if(u<p*2){return"about 1 minute ago"}if(u<q){return Math.floor(u/p)+" minutes ago"}if(u<q*2){return"about 1 hour ago"}if(u<s){return Math.floor(u/q)+" hours ago"}if(u>s&&u<s*2){return"yesterday"}if(u<s*365){return Math.floor(u/s)+" days ago"}else{return"over a year ago"}};var L={link:function(n){return n.replace(/\b(((https*\:\/\/)|www\.)[^\"\']+?)(([!?,.\)]+)?(\s|$))/g,function(t,s,q,p,o){var r=q.match(/w/)?"http://":"";return'<a class="twtr-hyperlink" target="_blank" href="'+r+s+'">'+((s.length>25)?s.substr(0,24)+"...":s)+"</a>"+o})},at:function(n){return n.replace(/\B[@ï¼ ]([a-zA-Z0-9_]{1,20})/g,function(o,p){return'@<a target="_blank" class="twtr-atreply" href="http://twitter.com/intent/user?screen_name='+p+'">'+p+"</a>"})},list:function(n){return n.replace(/\B[@ï¼ ]([a-zA-Z0-9_]{1,20}\/\w+)/g,function(o,p){return'@<a target="_blank" class="twtr-atreply" href="http://twitter.com/'+p+'">'+p+"</a>"})},hash:function(n){return n.replace(/(^|\s+)#(\w+)/gi,function(o,p,q){return p+'<a target="_blank" class="twtr-hashtag" href="http://twitter.com/search?q=%23'+q+'">#'+q+"</a>"})},clean:function(n){return this.hash(this.at(this.list(this.link(n))))}};function V(o,p,n){this.job=o;this.decayFn=p;this.interval=n;this.decayRate=1;this.decayMultiplier=1.25;this.maxDecayTime=3*60*1000}V.prototype={start:function(){this.stop().run();return this},stop:function(){if(this.worker){window.clearTimeout(this.worker)}return this},run:function(){var n=this;this.job(function(){n.decayRate=n.decayFn()?Math.max(1,n.decayRate/n.decayMultiplier):n.decayRate*n.decayMultiplier;var o=n.interval*n.decayRate;o=(o>=n.maxDecayTime)?n.maxDecayTime:o;o=Math.floor(o);n.worker=window.setTimeout(function(){n.run.call(n)},o)})},destroy:function(){this.stop();this.decayRate=1;return this}};function P(o,n,p){this.time=o||6000;this.loop=n||false;this.repeated=0;this.callback=p;this.haystack=[]}P.prototype={set:function(n){this.haystack=n},add:function(n){this.haystack.unshift(n)},start:function(){if(this.timer){return this}this._job();var n=this;this.timer=setInterval(function(){n._job.call(n)},this.time);return this},stop:function(){if(this.timer){window.clearInterval(this.timer);this.timer=null}return this},_next:function(){var n=this.haystack.shift();if(n&&this.loop){this.haystack.push(n)}return n||null},_job:function(){var n=this._next();if(n){this.callback(n)}return this}};function R(p){function n(){if(p.needle.metadata&&p.needle.metadata.result_type&&p.needle.metadata.result_type=="popular"){return'<span class="twtr-popular">'+p.needle.metadata.recent_retweets+"+ recent retweets</span>"}else{return""}}var o='<div class="twtr-tweet-wrap">         <div class="twtr-avatar">           <div class="twtr-img"><a target="_blank" href="http://twitter.com/intent/user?screen_name='+p.user+'"><img alt="'+p.user+' profile" src="'+d(p.avatar)+'"></a></div>         </div>         <div class="twtr-tweet-text">           <p>             <a target="_blank" href="http://twitter.com/intent/user?screen_name='+p.user+'" class="twtr-user">'+p.user+"</a> "+p.tweet+'             <em>            <a target="_blank" class="twtr-timestamp" time="'+p.timestamp+'" href="http://twitter.com/'+p.user+"/status/"+p.id+'">'+p.created_at+'</a> &middot;            <a target="_blank" class="twtr-reply" href="http://twitter.com/intent/tweet?in_reply_to='+p.id+'">reply</a> &middot;             <a target="_blank" class="twtr-rt" href="http://twitter.com/intent/retweet?tweet_id='+p.id+'">retweet</a> &middot;             <a target="_blank" class="twtr-fav" href="http://twitter.com/intent/favorite?tweet_id='+p.id+'">favorite</a>             </em> '+n()+"           </p>         </div>       </div>";var q=document.createElement("div");q.id="tweet-id-"+ ++R._tweetCount;q.className="twtr-tweet";q.innerHTML=o;this.element=q}R._tweetCount=0;X.loadStyleSheet=function(p,o){if(!TWTR.Widget.loadingStyleSheet){TWTR.Widget.loadingStyleSheet=true;var n=document.createElement("link");n.href=p;n.rel="stylesheet";n.type="text/css";document.getElementsByTagName("head")[0].appendChild(n);var q=setInterval(function(){var r=M(o,"position");if(r=="relative"){clearInterval(q);q=null;TWTR.Widget.hasLoadedStyleSheet=true}},50)}};(function(){var n=false;X.css=function(q){var p=document.createElement("style");p.type="text/css";if(l.ie){p.styleSheet.cssText=q}else{var r=document.createDocumentFragment();r.appendChild(document.createTextNode(q));p.appendChild(r)}function o(){document.getElementsByTagName("head")[0].appendChild(p)}if(!l.ie||n){o()}else{window.attachEvent("onload",function(){n=true;o()})}}})();TWTR.Widget.isLoaded=false;TWTR.Widget.loadingStyleSheet=false;TWTR.Widget.hasLoadedStyleSheet=false;TWTR.Widget.WIDGET_NUMBER=0;TWTR.Widget.REFRESH_MIN=6000;TWTR.Widget.matches={mentions:/^@[a-zA-Z0-9_]{1,20}\b/,any_mentions:/\b@[a-zA-Z0-9_]{1,20}\b/};TWTR.Widget.jsonP=function(o,q){var n=document.createElement("script");var p=document.getElementsByTagName("head")[0];n.type="text/javascript";n.src=o;p.insertBefore(n,p.firstChild);q(n);return n};TWTR.Widget.prototype=function(){var q=U?"https://":"http://";var t=window.location.hostname.match(/twitter\.com/)?(window.location.hostname+":"+window.location.port):"twitter.com";var s=q+"search."+t+"/search.";var u=q+"api."+t+"/1/statuses/user_timeline.";var p=q+t+"/favorites/";var r=q+"api."+t+"/1/";var o=25000;var n=U?"https://twitter-widgets.s3.amazonaws.com/j/1/default.gif":"http://widgets.twimg.com/j/1/default.gif";return{init:function(w){var v=this;this._widgetNumber=++TWTR.Widget.WIDGET_NUMBER;TWTR.Widget["receiveCallback_"+this._widgetNumber]=function(x){v._prePlay.call(v,x)};this._cb="TWTR.Widget.receiveCallback_"+this._widgetNumber;this.opts=w;this._base=s;this._isRunning=false;this._hasOfficiallyStarted=false;this._hasNewSearchResults=false;this._rendered=false;this._profileImage=false;this._isCreator=!!w.creator;this._setWidgetType(w.type);this.timesRequested=0;this.runOnce=false;this.newResults=false;this.results=[];this.jsonMaxRequestTimeOut=19000;this.showedResults=[];this.sinceId=1;this.source="TWITTERINC_WIDGET";this.id=w.id||"twtr-widget-"+this._widgetNumber;this.tweets=0;this.setDimensions(w.width,w.height);this.interval=w.interval?Math.max(w.interval,TWTR.Widget.REFRESH_MIN):TWTR.Widget.REFRESH_MIN;this.format="json";this.rpp=w.rpp||50;this.subject=w.subject||"";this.title=w.title||"";this.setFooterText(w.footer);this.setSearch(w.search);this._setUrl();this.theme=w.theme?w.theme:this._getDefaultTheme();if(!w.id){document.write('<div class="twtr-widget" id="'+this.id+'"></div>')}this.widgetEl=N(this.id);if(w.id){i.add(this.widgetEl,"twtr-widget")}if(w.version>=2&&!TWTR.Widget.hasLoadedStyleSheet){if(U){X.loadStyleSheet("https://twitter-widgets.s3.amazonaws.com/j/2/widget.css",this.widgetEl)}else{if(w.creator){X.loadStyleSheet("/stylesheets/widgets/widget.css",this.widgetEl)}else{X.loadStyleSheet("http://widgets.twimg.com/j/2/widget.css",this.widgetEl)}}}this.occasionalJob=new V(function(x){v.decay=x;v._getResults.call(v)},function(){return v._decayDecider.call(v)},o);this._ready=O.fn(w.ready)?w.ready:function(){};this._isRelativeTime=true;this._tweetFilter=false;this._avatars=true;this._isFullScreen=false;this._isLive=true;this._isScroll=false;this._loop=true;this._showTopTweets=(this._isSearchWidget)?true:false;this._behavior="default";this.setFeatures(this.opts.features);this.intervalJob=new P(this.interval,this._loop,function(x){v._normalizeTweet(x)});return this},setDimensions:function(v,x){this.wh=(v&&x)?[v,x]:[250,300];if(v=="auto"||v=="100%"){this.wh[0]="100%"}else{this.wh[0]=((this.wh[0]<150)?150:this.wh[0])+"px"}this.wh[1]=((this.wh[1]<100)?100:this.wh[1])+"px";return this},setRpp:function(v){var v=parseInt(v);this.rpp=(O.number(v)&&(v>0&&v<=100))?v:30;return this},_setWidgetType:function(v){this._isSearchWidget=false,this._isProfileWidget=false,this._isFavsWidget=false,this._isListWidget=false;switch(v){case"profile":this._isProfileWidget=true;break;case"search":this._isSearchWidget=true,this.search=this.opts.search;break;case"faves":case"favs":this._isFavsWidget=true;break;case"list":case"lists":this._isListWidget=true;break}return this},setFeatures:function(w){if(w){if(O.def(w.filters)){this._tweetFilter=w.filters}if(O.def(w.dateformat)){this._isRelativeTime=!!(w.dateformat!=="absolute")}if(O.def(w.fullscreen)&&O.bool(w.fullscreen)){if(w.fullscreen){this._isFullScreen=true;this.wh[0]="100%";this.wh[1]=(b()-90)+"px";var x=this;K.add(window,"resize",function(AA){x.wh[1]=b();x._fullScreenResize()})}}if(O.def(w.loop)&&O.bool(w.loop)){this._loop=w.loop}if(O.def(w.behavior)&&O.string(w.behavior)){switch(w.behavior){case"all":this._behavior="all";break;case"preloaded":this._behavior="preloaded";break;default:this._behavior="default";break}}if(O.def(w.toptweets)&&O.bool(w.toptweets)){this._showTopTweets=w.toptweets;var v=(this._showTopTweets)?"inline-block":"none";X.css("#"+this.id+" .twtr-popular { display: "+v+"; }")}if(!O.def(w.toptweets)){this._showTopTweets=true;var v=(this._showTopTweets)?"inline-block":"none";X.css("#"+this.id+" .twtr-popular { display: "+v+"; }")}if(O.def(w.avatars)&&O.bool(w.avatars)){if(!w.avatars){X.css("#"+this.id+" .twtr-avatar, #"+this.id+" .twtr-user { display: none; } #"+this.id+" .twtr-tweet-text { margin-left: 0; }");this._avatars=false}else{var y=(this._isFullScreen)?"90px":"40px";X.css("#"+this.id+" .twtr-avatar { display: block; } #"+this.id+" .twtr-user { display: inline; } #"+this.id+" .twtr-tweet-text { margin-left: "+y+"; }");this._avatars=true}}else{if(this._isProfileWidget){this.setFeatures({avatars:false});this._avatars=false}else{this.setFeatures({avatars:true});this._avatars=true}}if(O.def(w.hashtags)&&O.bool(w.hashtags)){(!w.hashtags)?X.css("#"+this.id+" a.twtr-hashtag { display: none; }"):""}if(O.def(w.timestamp)&&O.bool(w.timestamp)){var z=w.timestamp?"block":"none";X.css("#"+this.id+" em { display: "+z+"; }")}if(O.def(w.live)&&O.bool(w.live)){this._isLive=w.live}if(O.def(w.scrollbar)&&O.bool(w.scrollbar)){this._isScroll=w.scrollbar}}else{if(this._isProfileWidget){this.setFeatures({avatars:false});this._avatars=false}if(this._isProfileWidget||this._isFavsWidget){this.setFeatures({behavior:"all"})}}return this},_fullScreenResize:function(){var v=J("twtr-timeline","div",document.body,function(w){w.style.height=(b()-90)+"px"})},setTweetInterval:function(v){this.interval=v;return this},setBase:function(v){this._base=v;return this},setUser:function(w,v){this.username=w;this.realname=v||" ";if(this._isFavsWidget){this.setBase(p+w+".")}else{if(this._isProfileWidget){this.setBase(u+this.format+"?screen_name="+w)}}this.setSearch(" ");return this},setList:function(w,v){this.listslug=v.replace(/ /g,"-").toLowerCase();this.username=w;this.setBase(r+w+"/lists/"+this.listslug+"/statuses.");this.setSearch(" ");return this},setProfileImage:function(v){this._profileImage=v;this.byClass("twtr-profile-img","img").src=d(v);this.byClass("twtr-profile-img-anchor","a").href="http://twitter.com/intent/user?screen_name="+this.username;return this},setTitle:function(v){this.title=v;this.widgetEl.getElementsByTagName("h3")[0].innerHTML=this.title;return this},setCaption:function(v){this.subject=v;this.widgetEl.getElementsByTagName("h4")[0].innerHTML=this.subject;return this},setFooterText:function(v){this.footerText=(O.def(v)&&O.string(v))?v:"Join the conversation";if(this._rendered){this.byClass("twtr-join-conv","a").innerHTML=this.footerText}return this},setSearch:function(w){this.searchString=w||"";this.search=encodeURIComponent(this.searchString);this._setUrl();if(this._rendered){var v=this.byClass("twtr-join-conv","a");v.href="http://twitter.com/"+this._getWidgetPath()}return this},_getWidgetPath:function(){if(this._isProfileWidget){return this.username}else{if(this._isFavsWidget){return this.username+"/favorites"}else{if(this._isListWidget){return this.username+"/lists/"+this.listslug}else{return"#search?q="+this.search}}}},_setUrl:function(){var w=this;function v(){return"&"+(+new Date)+"=cachebust"}function x(){return(w.sinceId==1)?"":"&since_id="+w.sinceId+"&refresh=true"}if(this._isProfileWidget){this.url=this._base+"&callback="+this._cb+"&include_rts=true&count="+this.rpp+x()+"&clientsource="+this.source}else{if(this._isFavsWidget||this._isListWidget){this.url=this._base+this.format+"?callback="+this._cb+x()+"&clientsource="+this.source}else{this.url=this._base+this.format+"?q="+this.search+"&include_rts=true&callback="+this._cb+"&rpp="+this.rpp+x()+"&clientsource="+this.source;if(!this.runOnce){this.url+="&result_type=recent"}}}this.url+=v();return this},_getRGB:function(v){return T(v.substring(1,7))},setTheme:function(AA,v){var y=this;var w=" !important";var z=((window.location.hostname.match(/twitter\.com/))&&(window.location.pathname.match(/goodies/)));if(v||z){w=""}this.theme={shell:{background:function(){return AA.shell.background||y._getDefaultTheme().shell.background}(),color:function(){return AA.shell.color||y._getDefaultTheme().shell.color}()},tweets:{background:function(){return AA.tweets.background||y._getDefaultTheme().tweets.background}(),color:function(){return AA.tweets.color||y._getDefaultTheme().tweets.color}(),links:function(){return AA.tweets.links||y._getDefaultTheme().tweets.links}()}};var x="#"+this.id+" .twtr-doc,                      #"+this.id+" .twtr-hd a,                      #"+this.id+" h3,                      #"+this.id+" h4,                      #"+this.id+" .twtr-popular {            background-color: "+this.theme.shell.background+w+";            color: "+this.theme.shell.color+w+";          }          #"+this.id+" .twtr-popular {            color: "+this.theme.tweets.color+w+";            background-color: rgba("+this._getRGB(this.theme.shell.background)+", .3)"+w+";          }          #"+this.id+" .twtr-tweet a {            color: "+this.theme.tweets.links+w+";          }          #"+this.id+" .twtr-bd, #"+this.id+" .twtr-timeline i a,           #"+this.id+" .twtr-bd p {            color: "+this.theme.tweets.color+w+";          }          #"+this.id+" .twtr-new-results,           #"+this.id+" .twtr-results-inner,           #"+this.id+" .twtr-timeline {            background: "+this.theme.tweets.background+w+";          }";if(l.ie){x+="#"+this.id+" .twtr-tweet { background: "+this.theme.tweets.background+w+"; }"}X.css(x);return this},byClass:function(y,v,w){var x=J(y,v,N(this.id));return(w)?x:x[0]},render:function(){var x=this;if(!TWTR.Widget.hasLoadedStyleSheet){window.setTimeout(function(){x.render.call(x)},50);return this}this.setTheme(this.theme,this._isCreator);if(this._isProfileWidget){i.add(this.widgetEl,"twtr-widget-profile")}if(this._isScroll){i.add(this.widgetEl,"twtr-scroll")}if(!this._isLive&&!this._isScroll){this.wh[1]="auto"}if(this._isSearchWidget&&this._isFullScreen){document.title="Twitter search: "+escape(this.searchString)}this.widgetEl.innerHTML=this._getWidgetHtml();var w=this.byClass("twtr-timeline","div");if(this._isLive&&!this._isFullScreen){var y=function(z){if(x._behavior==="all"){return }if(I.call(this,z)){x.pause.call(x)}};var v=function(z){if(x._behavior==="all"){return }if(I.call(this,z)){x.resume.call(x)}};this.removeEvents=function(){K.remove(w,"mouseover",y);K.remove(w,"mouseout",v)};K.add(w,"mouseover",y);K.add(w,"mouseout",v)}this._rendered=true;this._ready();return this},removeEvents:function(){},_getDefaultTheme:function(){return{shell:{background:"#8ec1da",color:"#ffffff"},tweets:{background:"#ffffff",color:"#444444",links:"#1985b5"}}},_getWidgetHtml:function(){var x=this;function z(){if(x._isProfileWidget){return'<a target="_blank" href="http://twitter.com/" class="twtr-profile-img-anchor"><img alt="profile" class="twtr-profile-img" src="'+n+'"></a>                      <h3></h3>                      <h4></h4>'}else{return"<h3>"+x.title+"</h3><h4>"+x.subject+"</h4>"}}function w(){return x._isFullScreen?" twtr-fullscreen":""}var y=U?"https://twitter-widgets.s3.amazonaws.com/i/widget-logo.png":"http://widgets.twimg.com/i/widget-logo.png";if(this._isFullScreen){y="https://twitter-widgets.s3.amazonaws.com/i/widget-logo-fullscreen.png"}var v='<div class="twtr-doc'+w()+'" style="width: '+this.wh[0]+';">            <div class="twtr-hd">'+z()+'             </div>            <div class="twtr-bd">              <div class="twtr-timeline" style="height: '+this.wh[1]+';">                <div class="twtr-tweets">                  <div class="twtr-reference-tweet"></div>                  <!-- tweets show here -->                </div>              </div>            </div>            <div class="twtr-ft">              <div><a target="_blank" href="http://twitter.com"><img alt="" src="'+y+'"></a>                <span><a target="_blank" class="twtr-join-conv" style="color:'+this.theme.shell.color+'" href="http://twitter.com/'+this._getWidgetPath()+'">'+this.footerText+"</a></span>              </div>            </div>          </div>";return v},_appendTweet:function(v){this._insertNewResultsNumber();g(v,this.byClass("twtr-reference-tweet","div"));return this},_slide:function(w){var x=this;var v=e(w).offsetHeight;if(this.runOnce){new B(w,"height",{from:0,to:v,time:500,callback:function(){x._fade.call(x,w)}}).start()}return this},_fade:function(v){var w=this;if(B.canTransition){v.style.webkitTransition="opacity 0.5s ease-out";v.style.opacity=1;return this}new B(v,"opacity",{from:0,to:1,time:500}).start();return this},_chop:function(){if(this._isScroll){return this}var AA=this.byClass("twtr-tweet","div",true);var AB=this.byClass("twtr-new-results","div",true);if(AA.length){for(var x=AA.length-1;x>=0;x--){var z=AA[x];var y=parseInt(z.offsetTop);if(y>parseInt(this.wh[1])){h(z)}else{break}}if(AB.length>0){var v=AB[AB.length-1];var w=parseInt(v.offsetTop);if(w>parseInt(this.wh[1])){h(v)}}}return this},_appendSlideFade:function(w){var v=w||this.tweet.element;this._chop()._appendTweet(v)._slide(v);return this},_createTweet:function(v){v.timestamp=v.created_at;v.created_at=this._isRelativeTime?Q(v.created_at):Y(v.created_at);this.tweet=new R(v);if(this._isLive&&this.runOnce){this.tweet.element.style.opacity=0;this.tweet.element.style.filter="alpha(opacity:0)";this.tweet.element.style.height="0"}return this},_getResults:function(){var v=this;this.timesRequested++;this.jsonRequestRunning=true;this.jsonRequestTimer=window.setTimeout(function(){if(v.jsonRequestRunning){clearTimeout(v.jsonRequestTimer);v.jsonRequestTimer=null}v.jsonRequestRunning=false;h(v.scriptElement);v.newResults=false;v.decay()},this.jsonMaxRequestTimeOut);TWTR.Widget.jsonP(v.url,function(w){v.scriptElement=w})},clear:function(){var w=this.byClass("twtr-tweet","div",true);var v=this.byClass("twtr-new-results","div",true);w=w.concat(v);F(w,function(x){h(x)});return this},_sortByMagic:function(v){var w=this;if(this._tweetFilter){if(this._tweetFilter.negatives){v=v.filter(function(x){if(!w._tweetFilter.negatives.test(x.text)){return x}})}if(this._tweetFilter.positives){v=v.filter(function(x){if(w._tweetFilter.positives.test(x.text)){return x}})}}switch(this._behavior){case"all":this._sortByLatest(v);break;case"preloaded":default:this._sortByDefault(v);break}if(this._isLive&&this._behavior!=="all"){this.intervalJob.set(this.results);this.intervalJob.start()}return this},_loadTopTweetsAtTop:function(x){var y=[],z=[],w=[];F(x,function(AA){if(AA.metadata&&AA.metadata.result_type&&AA.metadata.result_type=="popular"){z.push(AA)}else{y.push(AA)}});var v=z.concat(y);return v},_sortByLatest:function(v){this.results=v;this.results=this.results.slice(0,this.rpp);this.results=this._loadTopTweetsAtTop(this.results);this.results.reverse();return this},_sortByDefault:function(w){var x=this;var v=function(z){return new Date(z).getTime()};this.results.unshift.apply(this.results,w);F(this.results,function(z){if(!z.views){z.views=0}});this.results.sort(function(AA,z){if(v(AA.created_at)>v(z.created_at)){return -1}else{if(v(AA.created_at)<v(z.created_at)){return 1}else{return 0}}});this.results=this.results.slice(0,this.rpp);this.results=this._loadTopTweetsAtTop(this.results);var y=this.results;this.results=this.results.sort(function(AA,z){if(AA.views<z.views){return -1}else{if(AA.views>z.views){return 1}}return 0});if(!this._isLive){this.results.reverse()}},_prePlay:function(w){if(this.jsonRequestTimer){clearTimeout(this.jsonRequestTimer);this.jsonRequestTimer=null}if(!l.ie){h(this.scriptElement)}if(w.error){this.newResults=false}else{if(w.results&&w.results.length>0){this.response=w;this.newResults=true;this.sinceId=w.max_id_str;this._sortByMagic(w.results);if(this.isRunning()){this._play()}}else{if((this._isProfileWidget||this._isFavsWidget||this._isListWidget)&&O.array(w)&&w.length){this.newResults=true;if(!this._profileImage&&this._isProfileWidget){var v=w[0].user.screen_name;this.setProfileImage(w[0].user.profile_image_url);this.setTitle(w[0].user.name);this.setCaption('<a target="_blank" href="http://twitter.com/intent/user?screen_name='+v+'">'+v+"</a>")}this.sinceId=w[0].id_str;this._sortByMagic(w);if(this.isRunning()){this._play()}}else{this.newResults=false}}}this._setUrl();if(this._isLive){this.decay()}},_play:function(){var v=this;if(this.runOnce){this._hasNewSearchResults=true}if(this._avatars){this._preloadImages(this.results)}if(this._isRelativeTime&&(this._behavior=="all"||this._behavior=="preloaded")){F(this.byClass("twtr-timestamp","a",true),function(w){w.innerHTML=Q(w.getAttribute("time"))})}if(!this._isLive||this._behavior=="all"||this._behavior=="preloaded"){F(this.results,function(x){if(x.retweeted_status){x=x.retweeted_status}if(v._isProfileWidget){x.from_user=x.user.screen_name;x.profile_image_url=x.user.profile_image_url}if(v._isFavsWidget||v._isListWidget){x.from_user=x.user.screen_name;x.profile_image_url=x.user.profile_image_url}x.id=x.id_str;v._createTweet({id:x.id,user:x.from_user,tweet:L.clean(x.text),avatar:x.profile_image_url,created_at:x.created_at,needle:x});var w=v.tweet.element;(v._behavior=="all")?v._appendSlideFade(w):v._appendTweet(w)});if(this._behavior!="preloaded"){return this}}return this},_normalizeTweet:function(w){var v=this;w.views++;if(this._isProfileWidget){w.from_user=v.username;w.profile_image_url=w.user.profile_image_url}if(this._isFavsWidget||this._isListWidget){w.from_user=w.user.screen_name;w.profile_image_url=w.user.profile_image_url}if(this._isFullScreen){w.profile_image_url=w.profile_image_url.replace(/_normal\./,"_bigger.")}w.id=w.id_str;this._createTweet({id:w.id,user:w.from_user,tweet:L.clean(w.text),avatar:w.profile_image_url,created_at:w.created_at,needle:w})._appendSlideFade()},_insertNewResultsNumber:function(){if(!this._hasNewSearchResults){this._hasNewSearchResults=false;return }if(this.runOnce&&this._isSearchWidget){var y=this.response.total>this.rpp?this.response.total:this.response.results.length;var v=y>1?"s":"";var x=(this.response.warning&&this.response.warning.match(/adjusted since_id/))?"more than":"";var w=document.createElement("div");i.add(w,"twtr-new-results");w.innerHTML='<div class="twtr-results-inner"> &nbsp; </div><div class="twtr-results-hr"> &nbsp; </div><span>'+x+" <strong>"+y+"</strong> new tweet"+v+"</span>";g(w,this.byClass("twtr-reference-tweet","div"));this._hasNewSearchResults=false}},_preloadImages:function(v){if(this._isProfileWidget||this._isFavsWidget||this._isListWidget){F(v,function(x){var w=new Image();w.src=d(x.user.profile_image_url)})}else{F(v,function(w){(new Image()).src=d(w.profile_image_url)})}},_decayDecider:function(){var v=false;if(!this.runOnce){this.runOnce=true;v=true}else{if(this.newResults){v=true}}return v},start:function(){var v=this;if(!this._rendered){setTimeout(function(){v.start.call(v)},50);return this}if(!this._isLive){this._getResults()}else{this.occasionalJob.start()}this._isRunning=true;this._hasOfficiallyStarted=true;return this},stop:function(){this.occasionalJob.stop();if(this.intervalJob){this.intervalJob.stop()}this._isRunning=false;return this},pause:function(){if(this.isRunning()&&this.intervalJob){this.intervalJob.stop();i.add(this.widgetEl,"twtr-paused");this._isRunning=false}if(this._resumeTimer){clearTimeout(this._resumeTimer);this._resumeTimer=null}return this},resume:function(){var v=this;if(!this.isRunning()&&this._hasOfficiallyStarted&&this.intervalJob){this._resumeTimer=window.setTimeout(function(){v.intervalJob.start();v._isRunning=true;i.remove(v.widgetEl,"twtr-paused")},2000)}return this},isRunning:function(){return this._isRunning},destroy:function(){this.stop();this.clear();this.runOnce=false;this._hasOfficiallyStarted=false;this._profileImage=false;this._isLive=true;this._tweetFilter=false;this._isScroll=false;this.newResults=false;this._isRunning=false;this.sinceId=1;this.results=[];this.showedResults=[];this.occasionalJob.destroy();if(this.jsonRequestRunning){clearTimeout(this.jsonRequestTimer)}i.remove(this.widgetEl,"twtr-scroll");this.removeEvents();return this}}}()})();var E=/twitter\.com(\:\d{2,4})?\/intent\/(\w+)/,H={tweet:true,retweet:true,favorite:true},G="scrollbars=yes,resizable=yes,toolbar=no,location=yes",D=screen.height,C=screen.width;function A(O){O=O||window.event;var N=O.target||O.srcElement,J,K,I,M,L;while(N&&N.nodeName.toLowerCase()!=="a"){N=N.parentNode}if(N&&N.nodeName.toLowerCase()==="a"&&N.href){J=N.href.match(E);if(J){K=550;I=(J[2] in H)?420:560;M=Math.round((C/2)-(K/2));L=0;if(D>I){L=Math.round((D/2)-(I/2))}window.open(N.href,"intent",G+",width="+K+",height="+I+",left="+M+",top="+L);O.returnValue=false;O.preventDefault&&O.preventDefault()}}}if(document.addEventListener){document.addEventListener("click",A,false)}else{if(document.attachEvent){document.attachEvent("onclick",A)}}})();

