var twitstat={lol:false,jsonp:function(){if(document.all&&document.getElementById("twitstat_badge_call"))document.getElementById("twitstat_badge_call").src=twitstat.updateurl;else if(document.getElementById("twitstat_badge_call")){var a=document.getElementById("twitstat_badge_call");a.parentNode.removeChild(a)}else{a=document.createElement("script");a.src=twitstat.updateurl==""?twitstat.url:twitstat.updateurl;a.id="twitstat_badge_call";document.body.appendChild(a)}setTimeout(twitstat.jsonp,6E3)},fx:function(a){if(a.style.display=="none"){a.style.filter="alpha(opacity:0)";a.style.opacity=0;a.style.display="block"}if(twitstat.fxopac<100){twitstat.fxopac+=4;var b=twitstat.fxopac/100;a.style.filter="alpha(opacity:"+twitstat.fxopac+")";a.style.opacity=b;setTimeout(function(){twitstat.fx(a)},30)}else twitstat.fxopac=0},init:function(a){twitstat.props=a;twitstat.url=twitstat.searchurl+"?rpp="+a.max+"&callback=twitstat.construct&q="+encodeURIComponent(a.keywords);
if(a.near)twitstat.url+="&near="+a.near;if(a.within&&a.units)twitstat.url+="&within="+a.within+"&units="+a.units;if(typeof document.addEventListener!=="undefined")document.addEventListener("DOMContentLoaded",twitstat.jsonp,false);else typeof window.attachEvent!="undefined"?window.attachEvent("onload",twitstat.jsonp):document.write(unescape('%3Cscript src="'+twitstat.url+'" type="text/javascript"%3E%3C/script%3E'))},loop:function(a,b){for(var e=[],c=0;c<a.length;c++){var d='<li style="margin: 5px; font: normal 12px/14px helvetica, sans-serif; min-height: 54px; height: auto !important; height: 54px;">';
d+='<img src="'+a[c].profile_image_url+'" style="float: left; margin: 0 5px 10px 0; width: 48px; height: 48px;">';d+="<div>";d+='<a href="http://www.twitter.com/'+a[c].from_user+'" style="color: '+twitstat.props.link_color+'">'+a[c].from_user+"</a>: ";d+="<span>"+twitstat.convertUrls(a[c].text)+"</span></div></li>";e[c]=d}return b&&a.length>0?'<div style="display: none;">'+e.join("")+"</div>":e.join("")},construct:function(a){var b=document.getElementById(twitstat.props.badge_container),e=twitstat.loop(a.results,
false),c=document.createDocumentFragment(),d='<a href="http://bit.ly/gZm6eK" title="Donate to help those affected by the earthquake and tsunami in Japan" target="_blank" style="font-weight: bold;">Donate to help disaster relief efforts in Japan.</a>';b.style.width=twitstat.props.width+"px";twitstat.holder=document.createElement("div");twitstat.updateurl=
twitstat.searchurl+a.refresh_url+"&callback=twitstat.update";twitstat.holder.innerHTML="<div>"+('<div class="twitstatus_header" style="font: normal 14px/16px helvetica, sans-serif; -moz-border-radius-topleft: 2px; -moz-border-radius-topright: 2px; -webkit-border-top-left-radius: 2px; -webkit-border-top-right-radius: 2px; color: '+twitstat.props.header_font_color+"; background-color: "+twitstat.props.header_background+'; margin: 0; padding: 4px 4px 2px;">'+twitstat.props.title+"</div>")+('<ul style="list-style-type: none; overflow: hidden; height: '+
twitstat.props.max*60+"px; padding: 0; margin: 0; color:"+twitstat.props.content_font_color+"; border: 1px solid "+twitstat.props.border_color+"; background-color: "+twitstat.props.content_background_color+';">')+e+"</ul>"+('<div class="twitstatus_footer" style="font: normal 11px/12px helvetica, sans-serif; color: '+twitstat.props.header_font_color+"; -moz-border-radius-bottomright: 2px; -moz-border-radius-bottomleft: 2px; -webkit-border-bottom-left-radius: 2px; -webkit-border-bottom-right-radius: 2px;background-color: "+
twitstat.props.header_background+'; margin: 0; padding: 4px; text-align: right;">'+d+"</div>")+"</div>";c.appendChild(twitstat.holder.firstChild);b.appendChild(c);twitstat.list=b.getElementsByTagName("UL")[0];return false},update:function(a){if(a.results.length>0){twitstat.updateurl=twitstat.updateurl=twitstat.searchurl+a.refresh_url+"&callback=twitstat.update";var b=twitstat.loop(a.results,true);frag=document.createDocumentFragment();twitstat.holder.innerHTML=b;frag.appendChild(twitstat.holder.firstChild);
twitstat.list.insertBefore(frag,twitstat.list.childNodes[0]);a.results.length>0&&twitstat.fx(twitstat.list.childNodes[0]);return false}},convertUrls:function(a){a=a.replace(twitstat.urlRE,function(b){return twitstat.replaceUrl(b)});return a.replace(twitstat.twitterUsernameRE,'<a style="color: '+twitstat.props.link_color+'" href="http://twitter.com/$1">@$1</a>')},twitterUsernameRE:/@(\w+)/gm,urlRE:/((((ht|f){1}(tp:[/][/]){1})|((www.){1}))[-a-zA-Z0-9@:%_\+.~#?&//=]+)/gm,replaceUrl:function(a){return'<a href="'+
a+'" title="'+a+'" style="color: '+twitstat.props.link_color+'">'+(a.length>34?a.substring(0,20)+"&hellip;":a)+"</a>"},badge:{init:function(a){twitstat.init(a)}},props:{},url:"",searchurl:"http://search.twitter.com/search.json",updateurl:"",fxopac:0,list:{},holder:{}};
