//dotimeout
(function($){var a={},c="doTimeout",d=Array.prototype.slice;$[c]=function(){return b.apply(window,[0].concat(d.call(arguments)))};$.fn[c]=function(){var f=d.call(arguments),e=b.apply(this,[c+f[0]].concat(f));return typeof f[0]==="number"||typeof f[1]==="number"?this:e};function b(k){var l=this,g,i={},m=arguments,h=4,f=m[1],j=m[2],o=m[3];if(typeof f!=="string"){h--;f=k=0;j=m[1];o=m[2]}if(k){g=l.eq(0);g.data(k,i=g.data(k)||{})}else{if(f){i=a[f]||(a[f]={})}}i.id&&clearTimeout(i.id);delete i.id;function e(){if(k){g.removeData(k)}else{if(f){delete a[f]}}}function n(){i.id=setTimeout(function(){i.fn()},j)}if(o){i.fn=function(p){o.apply(l,d.call(m,h))&&!p?n():e()};n()}else{if(i.fn){j===undefined?e():i.fn(j===false);return true}else{e()}}}})(jQuery);

//cleartype fix
jQuery.fn.fadeIn=function(speed,callback){return this.animate({opacity:'show'},speed,function(){if(jQuery.browser.msie)this.style.removeAttribute('filter');if(jQuery.isFunction(callback))callback()})};jQuery.fn.fadeOut=function(speed,callback){return this.animate({opacity:'hide'},speed,function(){if(jQuery.browser.msie)this.style.removeAttribute('filter');if(jQuery.isFunction(callback))callback()})};

//twitter
(function($){$.fn.relatedTweets=function(allOptions){var defaults={debug:0,query:'',default_query:'',realtime:1,status:0,lang:'en',n:10,max_tags:5,or_tags:1,show_avatar:1,show_author:1,show_date:1,show_source:1,image_width:48,from_users:'',to_users:'',at_users:'',links_only:0,geocode:'',stay_time:5000,enter_time:300,exit_time:200,animate:'opacity'};allOptions=$.extend({},defaults,allOptions);return this.each(function(){var div=$(this);var count=0,ul=null,max_id=0;var visibleI=-1;var calls=0,removeExtra=false;var effectParams=new Object;var op=allOptions;if(div.attr('options')){try{op=eval('('+div.attr('options')+')');}catch(e){if(op.debug)div.html('<b style="color:red">'+e+'</b>');return;}op=$.extend({},defaults,op);};var searchLoaded=function(json,status){if(!json.results||!json.max_id){if(op.debug)div.html('<b style="color:red">Error:'+(json.error?json.error:'unkown')+'</b>');return;}var rs=json.results;if(json.max_id>0)max_id=json.max_id;if(calls==0){if(rs.length==0)return;count=rs.length;var inDiv=$('<div class="rrt-inner"></div>').appendTo(div.html(''));ul=$('<ul></ul>').appendTo(inDiv);}calls++;for(var i=rs.length-1;i>=0;i--)appendLI(rs[i],rs.length-1-i);if(calls>1&&rs.length)removeExtra=true;if(calls==1)fadeOut();};var appendLI=function(x,i){$('<li style="display:none;">'+(op.show_avatar?'<span class="rrt-author-img">'+'<a href="http://twitter.com/'+x.from_user+'" title="'+x.from_user+'">'+'<img src="'+x.profile_image_url+'" height="'+op.image_width+'" width="'+op.image_width+'" border="0"/>'+'</a>'+'</span>':'')+'<span class="rrt-body">'+(op.show_author?'<strong>'+'<a href="http://twitter.com/'+x.from_user+'" title="'+x.from_user+'">@'+x.from_user+'</a>'+'</strong>':'')+'<span class="rrt-content">'+linkify(x.text)+'</span>'+' <span class="rrt-meta">'+(op.show_date?'(Posted <a class="rrt-date" href="http://twitter.com/'+x.from_user+'/status/'+x.id+'">'+formatDate(x.created_at)+'</a>)':'')+(op.show_source?'<span class="rrt-source"> from '+decodeHTML(x.source)+'</span>':'')+'</span>'+'</span>'+'</li>').appendTo(ul);};var fadeOut=function(){if(visibleI>-1){$('li',ul).eq(visibleI).fadeOut(op.exit_time,fadeIn);}else fadeIn();};var fadeIn=function(){if(removeExtra)removeExtraLI();visibleI++;if(visibleI>=count)visibleI=0;effectParams[op.animate]='show';$('li',ul).eq(visibleI).fadeIn(op.enter_time,fadeStill);if(visibleI+1>=count&&op.realtime)search();};var fadeStill=function(){$('li',ul).eq(visibleI).doTimeout(op.stay_time,fadeOut);};var removeExtraLI=function(){var crntCount=$('li',ul).size();if(crntCount>op.n){$('li:lt('+(crntCount-op.n)+')',ul).remove();count=op.n;}else{count=crntCount;}removeExtra=false;};var linkify=function(d){return d.replace(/\bhttps?\:\/\/\S+/gi,function(b){var c='';b=b.replace(/(\.*|\?*|\!*)$/,function(m,a){c=a;return''});return'<a class="rrt-link" href="'+b+'">'+((b.length>25)?b.substr(0,24)+'...':b)+'</a>'+c;}).replace(/\B\@([A-Z0-9_]{1,15})/gi,'@<a class="rrt-at" href="http://twitter.com/$1">$1</a>').replace(/\B\#([A-Z0-9_]+)/gi,'<a class="rrt-hashtag" href="http://search.twitter.com/search?q=%23$1">#$1</a>')};var decodeHTML=function(s){return s.replace(/&lt;/gi,'<').replace(/&gt;/gi,'>').replace(/&quot;/gi,'"');};var formatDate=function(dstr){var dat=new Date(),tody=new Date();dat.setTime(Date.parse(dstr));var td=tody.getDate(),tm=tody.getMonth()+1,ty=tody.getFullYear(),th=tody.getHours(),tmn=tody.getMinutes(),ts=tody.getSeconds();var months = new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');var d=dat.getDate();m=dat.getMonth()+1,y=dat.getFullYear(),h=dat.getHours(),mn=dat.getMinutes(),s=dat.getSeconds();if(y==ty&&m==tm&&d==td){var dh=th-h;if(dh>0)return dh+' hour'+(dh>1?'s':'')+' ago';var dmn=tmn-mn;if(dmn>0)return dmn+' minute'+(dmn>1?'s':'')+' ago';var ds=ts-s;return ds+' second'+(ds>1?'s':'')+' ago';}else return months[m-1]+'&nbsp;'+d+'&nbsp;'+y;};var search=function(){var data={lang:op.lang,q:op.query,rpp:op.n,since_id:max_id};if(op.geocode)data.geocode=op.geocode;$.ajax({url:'http://search.twitter.com/search.json',data:data,success:searchLoaded,dataType:'jsonp'});};var init=function(){var tags=[];if(!op.query&&!op.status)$('a[rel="tag"]:lt('+op.max_tags+')').each(function(){var tag=$.trim($(this).text().replace(/\n/g,''));if($.inArray(tag,tags)==-1)tags[tags.length]=tag;});if(tags.length>0)op.query=tags.join((op.or_tags?' OR ':' '));if(!op.query)op.query=op.default_query;if(op.from_users)op.query+=" from:"+op.from_users.replace(/\s/g,'').replace(/,/g,' OR from:');if(op.to_users)op.query+=" to:"+op.to_users.replace(/\s/g,'').replace(/,/g,' OR to:');if(op.at_users)op.query+=" @"+op.at_users.replace(/\s/g,'').replace(/,/g,' OR @');if(op.links_only)op.query+=' filter:links';search();};init();});}})(jQuery);jQuery(document).ready(function(){jQuery('div.related-tweets').relatedTweets();});

//cycle

(function(D){var A="Lite-1.0";D.fn.cycle=function(E){return this.each(function(){E=E||{};if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=0;this.cyclePause=0;var I=D(this);var J=E.slideExpr?D(E.slideExpr,this):I.children();var G=J.get();if(G.length<2){if(window.console&&window.console.log){window.console.log("terminating; too few slides: "+G.length)}return }var H=D.extend({},D.fn.cycle.defaults,E||{},D.metadata?I.metadata():D.meta?I.data():{});H.before=H.before?[H.before]:[];H.after=H.after?[H.after]:[];H.after.unshift(function(){H.busy=0});var F=this.className;H.width=parseInt((F.match(/w:(\d+)/)||[])[1])||H.width;H.height=parseInt((F.match(/h:(\d+)/)||[])[1])||H.height;H.timeout=parseInt((F.match(/t:(\d+)/)||[])[1])||H.timeout;if(I.css("position")=="static"){I.css("position","relative")}if(H.width){I.width(H.width)}if(H.height&&H.height!="auto"){I.height(H.height)}var K=0;J.css({position:"absolute",top:0,left:0}).hide().each(function(M){D(this).css("z-index",G.length-M)});D(G[K]).css("opacity",1).show();if(D.browser.msie){G[K].style.removeAttribute("filter")}if(H.fit&&H.width){J.width(H.width)}if(H.fit&&H.height&&H.height!="auto"){J.height(H.height)}if(H.pause){I.hover(function(){this.cyclePause=1},function(){this.cyclePause=0})}D.fn.cycle.transitions.fade(I,J,H);J.each(function(){var M=D(this);this.cycleH=(H.fit&&H.height)?H.height:M.height();this.cycleW=(H.fit&&H.width)?H.width:M.width()});J.not(":eq("+K+")").css({opacity:0});if(H.cssFirst){D(J[K]).css(H.cssFirst)}if(H.timeout){if(H.speed.constructor==String){H.speed={slow:600,fast:200}[H.speed]||400}if(!H.sync){H.speed=H.speed/2}while((H.timeout-H.speed)<250){H.timeout+=H.speed}}H.speedIn=H.speed;H.speedOut=H.speed;H.slideCount=G.length;H.currSlide=K;H.nextSlide=1;var L=J[K];if(H.before.length){H.before[0].apply(L,[L,L,H,true])}if(H.after.length>1){H.after[1].apply(L,[L,L,H,true])}if(H.click&&!H.next){H.next=H.click}if(H.next){D(H.next).bind("click",function(){return C(G,H,H.rev?-1:1)})}if(H.prev){D(H.prev).bind("click",function(){return C(G,H,H.rev?1:-1)})}if(H.timeout){this.cycleTimeout=setTimeout(function(){B(G,H,0,!H.rev)},H.timeout+(H.delay||0))}})};function B(J,E,I,K){if(E.busy){return }var H=J[0].parentNode,M=J[E.currSlide],L=J[E.nextSlide];if(H.cycleTimeout===0&&!I){return }if(I||!H.cyclePause){if(E.before.length){D.each(E.before,function(N,O){O.apply(L,[M,L,E,K])})}var F=function(){if(D.browser.msie){this.style.removeAttribute("filter")}D.each(E.after,function(N,O){O.apply(L,[M,L,E,K])})};if(E.nextSlide!=E.currSlide){E.busy=1;D.fn.cycle.custom(M,L,E,F)}var G=(E.nextSlide+1)==J.length;E.nextSlide=G?0:E.nextSlide+1;E.currSlide=G?J.length-1:E.nextSlide-1}if(E.timeout){H.cycleTimeout=setTimeout(function(){B(J,E,0,!E.rev)},E.timeout)}}function C(E,F,I){var H=E[0].parentNode,G=H.cycleTimeout;if(G){clearTimeout(G);H.cycleTimeout=0}F.nextSlide=F.currSlide+I;if(F.nextSlide<0){F.nextSlide=E.length-1}else{if(F.nextSlide>=E.length){F.nextSlide=0}}B(E,F,1,I>=0);return false}D.fn.cycle.custom=function(K,H,I,E){var J=D(K),G=D(H);G.css({opacity:0});var F=function(){G.animate({opacity:1},I.speedIn,I.easeIn,E)};J.animate({opacity:0},I.speedOut,I.easeOut,function(){J.css({display:"none"});if(!I.sync){F()}});if(I.sync){F()}};D.fn.cycle.transitions={fade:function(F,G,E){G.not(":eq(0)").css("opacity",0);E.before.push(function(){D(this).show()})}};D.fn.cycle.ver=function(){return A};D.fn.cycle.defaults={timeout:4000,speed:1000,next:null,prev:null,before:null,after:null,height:"auto",sync:1,fit:0,pause:0,delay:0,slideExpr:null}})(jQuery)

