jQuery.easing["jswing"]=jQuery.easing["swing"];jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(a,b,c,d,e){return jQuery.easing[jQuery.easing.def](a,b,c,d,e)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158;var g=0;var h=d;if(b==0)return c;if((b/=e)==1)return c+d;if(!g)g=e*.3;if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g))+c},easeOutElastic:function(a,b,c,d,e){var f=1.70158;var g=0;var h=d;if(b==0)return c;if((b/=e)==1)return c+d;if(!g)g=e*.3;if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*b)*Math.sin((b*e-f)*2*Math.PI/g)+d+c},easeInOutElastic:function(a,b,c,d,e){var f=1.70158;var g=0;var h=d;if(b==0)return c;if((b/=e/2)==2)return c+d;if(!g)g=e*.3*1.5;if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);if(b<1)return-.5*h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)+c;return h*Math.pow(2,-10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)*.5+d+c},easeInBack:function(a,b,c,d,e,f){if(f==undefined)f=1.70158;return d*(b/=e)*b*((f+1)*b-f)+c},easeOutBack:function(a,b,c,d,e,f){if(f==undefined)f=1.70158;return d*((b=b/e-1)*b*((f+1)*b+f)+1)+c},easeInOutBack:function(a,b,c,d,e,f){if(f==undefined)f=1.70158;if((b/=e/2)<1)return d/2*b*b*(((f*=1.525)+1)*b-f)+c;return d/2*((b-=2)*b*(((f*=1.525)+1)*b+f)+2)+c},easeInBounce:function(a,b,c,d,e){return d-jQuery.easing.easeOutBounce(a,e-b,0,d,e)+c},easeOutBounce:function(a,b,c,d,e){if((b/=e)<1/2.75){return d*7.5625*b*b+c}else if(b<2/2.75){return d*(7.5625*(b-=1.5/2.75)*b+.75)+c}else if(b<2.5/2.75){return d*(7.5625*(b-=2.25/2.75)*b+.9375)+c}else{return d*(7.5625*(b-=2.625/2.75)*b+.984375)+c}},easeInOutBounce:function(a,b,c,d,e){if(b<e/2)return jQuery.easing.easeInBounce(a,b*2,0,d,e)*.5+c;return jQuery.easing.easeOutBounce(a,b*2-e,0,d,e)*.5+d*.5+c}});$(function(){$("body").removeClass("coda-slider-no-js");$(".coda-slider").children(".panel").hide().end().prepend('<p class="loading">Loading...<br /><img src="images/ajax-loader.gif" alt="loading..." /></p>')});var sliderCount=1;$.fn.codaSlider=function(a){a=$.extend({autoHeight:true,autoHeightEaseDuration:1e3,autoHeightEaseFunction:"easeInOutExpo",autoSlide:false,autoSlideInterval:7e3,autoSlideStopWhenClicked:true,crossLinking:true,dynamicArrows:true,dynamicArrowLeftText:"&#171; left",dynamicArrowRightText:"right &#187;",dynamicTabs:true,dynamicTabsAlign:"center",dynamicTabsPosition:"top",externalTriggerSelector:"a.xtrig",firstPanelToLoad:1,panelTitleSelector:"h2.title",slideEaseDuration:1e3,slideEaseFunction:"easeInOutExpo"},a);return this.each(function(){function c(b){if(a.autoHeight){panelHeight=$(".panel:eq("+b+")",d).height();d.animate({height:panelHeight},a.autoHeightEaseDuration,a.autoHeightEaseFunction)}}function b(){if(h==0||!a.autoSlideStopWhenClicked){if(i==f){var g=0;i=1}else{var g=-(e*i);i+=1}c(i-1);d.siblings(".coda-nav").find("a").removeClass("current").parents("ul").find("li:eq("+(i-1)+") a").addClass("current");$(".panel-container",d).animate({marginLeft:g},a.slideEaseDuration,a.slideEaseFunction);setTimeout(b,a.autoSlideInterval)}}var d=$(this);if(a.dynamicArrows){d.parent().addClass("arrows");d.before('<div class="coda-nav-left" id="coda-nav-left-'+sliderCount+'"><a href="#">'+a.dynamicArrowLeftText+"</a></div>");d.after('<div class="coda-nav-right" id="coda-nav-right-'+sliderCount+'"><a href="#">'+a.dynamicArrowRightText+"</a></div>")}var e=d.find(".panel").width();var f=d.find(".panel").size();var g=e*f;var h=0;$(".panel",d).wrapAll('<div class="panel-container"></div>');$(".panel-container",d).css({width:g});if(a.crossLinking&&location.hash&&parseInt(location.hash.slice(1))<=f){var i=parseInt(location.hash.slice(1));var j=-(e*(i-1));$(".panel-container",d).css({marginLeft:j})}else if(a.firstPanelToLoad!=1&&a.firstPanelToLoad<=f){var i=a.firstPanelToLoad;var j=-(e*(i-1));$(".panel-container",d).css({marginLeft:j})}else{var i=1}$("#coda-nav-left-"+sliderCount+" a").click(function(){h++;if(i==1){j=-(e*(f-1));c(f-1);i=f;d.siblings(".coda-nav").find("a.current").removeClass("current").parents("ul").find("li:last a").addClass("current")}else{i-=1;c(i-1);j=-(e*(i-1));d.siblings(".coda-nav").find("a.current").removeClass("current").parent().prev().find("a").addClass("current")}$(".panel-container",d).animate({marginLeft:j},a.slideEaseDuration,a.slideEaseFunction);if(a.crossLinking){location.hash=i}return false});$("#coda-nav-right-"+sliderCount+" a").click(function(){h++;if(i==f){j=0;i=1;c(0);d.siblings(".coda-nav").find("a.current").removeClass("current").parents("ul").find("a:eq(0)").addClass("current")}else{j=-(e*i);c(i);i+=1;d.siblings(".coda-nav").find("a.current").removeClass("current").parent().next().find("a").addClass("current")}$(".panel-container",d).animate({marginLeft:j},a.slideEaseDuration,a.slideEaseFunction);if(a.crossLinking){location.hash=i}return false});if(a.dynamicTabs){var k='<div class="coda-nav" id="coda-nav-'+sliderCount+'"><ul></ul></div>';switch(a.dynamicTabsPosition){case"bottom":d.parent().append(k);break;default:d.parent().prepend(k);break}ul=$("#coda-nav-"+sliderCount+" ul");$(".panel",d).each(function(b){ul.append('<li class="tab'+(b+1)+'"><a href="#'+(b+1)+'">'+$(this).find(a.panelTitleSelector).text()+"</a></li>")});navContainerWidth=d.width()+d.siblings(".coda-nav-left").width()+d.siblings(".coda-nav-right").width();ul.parent().css({width:navContainerWidth});switch(a.dynamicTabsAlign){case"center":ul.css({width:($("li",ul).width()+2)*f});break;case"right":ul.css({"float":"right"});break}}$("#coda-nav-"+sliderCount+" a").each(function(b){$(this).bind("click",function(){h++;$(this).addClass("current").parents("ul").find("a").not($(this)).removeClass("current");j=-(e*b);c(b);i=b+1;$(".panel-container",d).animate({marginLeft:j},a.slideEaseDuration,a.slideEaseFunction);if(!a.crossLinking){return false}})});$(a.externalTriggerSelector).each(function(){if(sliderCount==parseInt($(this).attr("rel").slice(12))){$(this).bind("click",function(){h++;targetPanel=parseInt($(this).attr("href").slice(1));j=-(e*(targetPanel-1));c(targetPanel-1);i=targetPanel;d.siblings(".coda-nav").find("a").removeClass("current").parents("ul").find("li:eq("+(targetPanel-1)+") a").addClass("current");$(".panel-container",d).animate({marginLeft:j},a.slideEaseDuration,a.slideEaseFunction);if(!a.crossLinking){return false}})}});if(a.crossLinking&&location.hash&&parseInt(location.hash.slice(1))<=f){$("#coda-nav-"+sliderCount+" a:eq("+(location.hash.slice(1)-1)+")").addClass("current")}else if(a.firstPanelToLoad!=1&&a.firstPanelToLoad<=f){$("#coda-nav-"+sliderCount+" a:eq("+(a.firstPanelToLoad-1)+")").addClass("current")}else{$("#coda-nav-"+sliderCount+" a:eq(0)").addClass("current")}if(a.autoHeight){panelHeight=$(".panel:eq("+(i-1)+")",d).height();d.css({height:panelHeight})}if(a.autoSlide){d.ready(function(){setTimeout(b,a.autoSlideInterval)})}$(".panel",d).show().end().find("p.loading").remove();d.removeClass("preload");sliderCount++})};(function(a){function c(b,d,e,f){if(d.busy){return}var g=b[0].parentNode,h=b[d.currSlide],i=b[d.nextSlide];if(g.cycleTimeout===0&&!e){return}if(e||!g.cyclePause){if(d.before.length){a.each(d.before,function(a,b){b.apply(i,[h,i,d,f])})}var j=function(){if(a.browser.msie){this.style.removeAttribute("filter")}a.each(d.after,function(a,b){b.apply(i,[h,i,d,f])})};if(d.nextSlide!=d.currSlide){d.busy=1;a.fn.cycle.custom(h,i,d,j)}var k=d.nextSlide+1==b.length;d.nextSlide=k?0:d.nextSlide+1;d.currSlide=k?b.length-1:d.nextSlide-1}if(d.timeout){g.cycleTimeout=setTimeout(function(){c(b,d,0,!d.rev)},d.timeout)}}function b(a,b,d){var e=a[0].parentNode,f=e.cycleTimeout;if(f){clearTimeout(f);e.cycleTimeout=0}b.nextSlide=b.currSlide+d;if(b.nextSlide<0){b.nextSlide=a.length-1}else{if(b.nextSlide>=a.length){b.nextSlide=0}}c(a,b,1,d>=0);return false}var d="Lite-1.0";a.fn.cycle=function(d){return this.each(function(){d=d||{};if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=0;this.cyclePause=0;var e=a(this);var f=d.slideExpr?a(d.slideExpr,this):e.children();var g=f.get();if(g.length<2){if(window.console&&window.console.log){window.console.log("terminating; too few slides: "+g.length)}return}var h=a.extend({},a.fn.cycle.defaults,d||{},a.metadata?e.metadata():a.meta?e.data():{});h.before=h.before?[h.before]:[];h.after=h.after?[h.after]:[];h.after.unshift(function(){h.busy=0});var i=this.className;h.width=parseInt((i.match(/w:(\d+)/)||[])[1])||h.width;h.height=parseInt((i.match(/h:(\d+)/)||[])[1])||h.height;h.timeout=parseInt((i.match(/t:(\d+)/)||[])[1])||h.timeout;if(e.css("position")=="static"){e.css("position","relative")}if(h.width){e.width(h.width)}if(h.height&&h.height!="auto"){e.height(h.height)}var j=0;f.css({position:"absolute",top:0,left:0}).hide().each(function(b){a(this).css("z-index",g.length-b)});a(g[j]).css("opacity",1).show();if(a.browser.msie){g[j].style.removeAttribute("filter")}if(h.fit&&h.width){f.width(h.width)}if(h.fit&&h.height&&h.height!="auto"){f.height(h.height)}if(h.pause){e.hover(function(){this.cyclePause=1},function(){this.cyclePause=0})}a.fn.cycle.transitions.fade(e,f,h);f.each(function(){var b=a(this);this.cycleH=h.fit&&h.height?h.height:b.height();this.cycleW=h.fit&&h.width?h.width:b.width()});f.not(":eq("+j+")").css({opacity:0});if(h.cssFirst){a(f[j]).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=j;h.nextSlide=1;var k=f[j];if(h.before.length){h.before[0].apply(k,[k,k,h,true])}if(h.after.length>1){h.after[1].apply(k,[k,k,h,true])}if(h.click&&!h.next){h.next=h.click}if(h.next){a(h.next).bind("click",function(){return b(g,h,h.rev?-1:1)})}if(h.prev){a(h.prev).bind("click",function(){return b(g,h,h.rev?1:-1)})}if(h.timeout){this.cycleTimeout=setTimeout(function(){c(g,h,0,!h.rev)},h.timeout+(h.delay||0))}})};a.fn.cycle.custom=function(b,c,d,e){var f=a(b),g=a(c);g.css({opacity:0});var h=function(){g.animate({opacity:1},d.speedIn,d.easeIn,e)};f.animate({opacity:0},d.speedOut,d.easeOut,function(){f.css({display:"none"});if(!d.sync){h()}});if(d.sync){h()}};a.fn.cycle.transitions={fade:function(b,c,d){c.not(":eq(0)").css("opacity",0);d.before.push(function(){a(this).show()})}};a.fn.cycle.ver=function(){return d};a.fn.cycle.defaults={timeout:4e3,speed:1e3,next:null,prev:null,before:null,after:null,height:"auto",sync:1,fit:0,pause:0,delay:0,slideExpr:null}})(jQuery);(function(a){var b,c,d,e,f,g,h,i,j,k,l=0,m={},n=[],o=0,p={},q=[],r=null,s=new Image,t=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,u=/[^\.]\.(swf)\s*$/i,v,w=1,x=0,y="",z,A,B=false,C=a.extend(a("<div/>")[0],{prop:0}),D=a.browser.msie&&a.browser.version<7&&!window.XMLHttpRequest,E=function(){c.hide();s.onerror=s.onload=null;if(r){r.abort()}b.empty()},F=function(){if(false===m.onError(n,l,m)){c.hide();B=false;return}m.titleShow=false;m.width="auto";m.height="auto";b.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');H()},G=function(){var d=n[l],e,f,h,i,j,k;E();m=a.extend({},a.fn.fancybox.defaults,typeof a(d).data("fancybox")=="undefined"?m:a(d).data("fancybox"));k=m.onStart(n,l,m);if(k===false){B=false;return}else if(typeof k=="object"){m=a.extend(m,k)}h=m.title||(d.nodeName?a(d).attr("title"):d.title)||"";if(d.nodeName&&!m.orig){m.orig=a(d).children("img:first").length?a(d).children("img:first"):a(d)}if(h===""&&m.orig&&m.titleFromAlt){h=m.orig.attr("alt")}e=m.href||(d.nodeName?a(d).attr("href"):d.href)||null;if(/^(?:javascript)/i.test(e)||e=="#"){e=null}if(m.type){f=m.type;if(!e){e=m.content}}else if(m.content){f="html"}else if(e){if(e.match(t)){f="image"}else if(e.match(u)){f="swf"}else if(a(d).hasClass("iframe")){f="iframe"}else if(e.indexOf("#")===0){f="inline"}else{f="ajax"}}if(!f){F();return}if(f=="inline"){d=e.substr(e.indexOf("#"));f=a(d).length>0?"inline":"ajax"}m.type=f;m.href=e;m.title=h;if(m.autoDimensions){if(m.type=="html"||m.type=="inline"||m.type=="ajax"){m.width="auto";m.height="auto"}else{m.autoDimensions=false}}if(m.modal){m.overlayShow=true;m.hideOnOverlayClick=false;m.hideOnContentClick=false;m.enableEscapeButton=false;m.showCloseButton=false}m.padding=parseInt(m.padding,10);m.margin=parseInt(m.margin,10);b.css("padding",m.padding+m.margin);a(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){a(this).replaceWith(g.children())});switch(f){case"html":b.html(m.content);H();break;case"inline":if(a(d).parent().is("#fancybox-content")===true){B=false;return}a('<div class="fancybox-inline-tmp" />').hide().insertBefore(a(d)).bind("fancybox-cleanup",function(){a(this).replaceWith(g.children())}).bind("fancybox-cancel",function(){a(this).replaceWith(b.children())});a(d).appendTo(b);H();break;case"image":B=false;a.fancybox.showActivity();s=new Image;s.onerror=function(){F()};s.onload=function(){B=true;s.onerror=s.onload=null;I()};s.src=e;break;case"swf":m.scrolling="no";i='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+m.width+'" height="'+m.height+'"><param name="movie" value="'+e+'"></param>';j="";a.each(m.swf,function(a,b){i+='<param name="'+a+'" value="'+b+'"></param>';j+=" "+a+'="'+b+'"'});i+='<embed src="'+e+'" type="application/x-shockwave-flash" width="'+m.width+'" height="'+m.height+'"'+j+"></embed></object>";b.html(i);H();break;case"ajax":B=false;a.fancybox.showActivity();m.ajax.win=m.ajax.success;r=a.ajax(a.extend({},m.ajax,{url:e,data:m.ajax.data||{},error:function(a,b,c){if(a.status>0){F()}},success:function(a,d,f){var g=typeof f=="object"?f:r;if(g.status==200){if(typeof m.ajax.win=="function"){k=m.ajax.win(e,a,d,f);if(k===false){c.hide();return}else if(typeof k=="string"||typeof k=="object"){a=k}}b.html(a);H()}}}));break;case"iframe":J();break}},H=function(){var c=m.width,d=m.height;if(c.toString().indexOf("%")>-1){c=parseInt((a(window).width()-m.margin*2)*parseFloat(c)/100,10)+"px"}else{c=c=="auto"?"auto":c+"px"}if(d.toString().indexOf("%")>-1){d=parseInt((a(window).height()-m.margin*2)*parseFloat(d)/100,10)+"px"}else{d=d=="auto"?"auto":d+"px"}b.wrapInner('<div style="width:'+c+";height:"+d+";overflow: "+(m.scrolling=="auto"?"auto":m.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');m.width=b.width();m.height=b.height();J()},I=function(){m.width=s.width;m.height=s.height;a("<img />").attr({id:"fancybox-img",src:s.src,alt:m.title}).appendTo(b);J()},J=function(){var f,r;c.hide();if(e.is(":visible")&&false===p.onCleanup(q,o,p)){a.event.trigger("fancybox-cancel");B=false;return}B=true;a(g.add(d)).unbind();a(window).unbind("resize.fb scroll.fb");a(document).unbind("keydown.fb");if(e.is(":visible")&&p.titlePosition!=="outside"){e.css("height",e.height())}q=n;o=l;p=m;if(p.overlayShow){d.css({"background-color":p.overlayColor,opacity:p.overlayOpacity,cursor:p.hideOnOverlayClick?"pointer":"auto",height:a(document).height()});if(!d.is(":visible")){if(D){a("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"})}d.show()}}else{d.hide()}A=R();L();if(e.is(":visible")){a(h.add(j).add(k)).hide();f=e.position(),z={top:f.top,left:f.left,width:e.width(),height:e.height()};r=z.width==A.width&&z.height==A.height;g.fadeTo(p.changeFade,.3,function(){var c=function(){g.html(b.contents()).fadeTo(p.changeFade,1,N)};a.event.trigger("fancybox-change");g.empty().removeAttr("filter").css({"border-width":p.padding,width:A.width-p.padding*2,height:m.autoDimensions?"auto":A.height-x-p.padding*2});if(r){c()}else{C.prop=0;a(C).animate({prop:1},{duration:p.changeSpeed,easing:p.easingChange,step:P,complete:c})}});return}e.removeAttr("style");g.css("border-width",p.padding);if(p.transitionIn=="elastic"){z=T();g.html(b.contents());e.show();if(p.opacity){A.opacity=0}C.prop=0;a(C).animate({prop:1},{duration:p.speedIn,easing:p.easingIn,step:P,complete:N});return}if(p.titlePosition=="inside"&&x>0){i.show()}g.css({width:A.width-p.padding*2,height:m.autoDimensions?"auto":A.height-x-p.padding*2}).html(b.contents());e.css(A).fadeIn(p.transitionIn=="none"?0:p.speedIn,N)},K=function(a){if(a&&a.length){if(p.titlePosition=="float"){return'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+a+'</td><td id="fancybox-title-float-right"></td></tr></table>'}return'<div id="fancybox-title-'+p.titlePosition+'">'+a+"</div>"}return false},L=function(){y=p.title||"";x=0;i.empty().removeAttr("style").removeClass();if(p.titleShow===false){i.hide();return}y=a.isFunction(p.titleFormat)?p.titleFormat(y,q,o,p):K(y);if(!y||y===""){i.hide();return}i.addClass("fancybox-title-"+p.titlePosition).html(y).appendTo("body").show();switch(p.titlePosition){case"inside":i.css({width:A.width-p.padding*2,marginLeft:p.padding,marginRight:p.padding});x=i.outerHeight(true);i.appendTo(f);A.height+=x;break;case"over":i.css({marginLeft:p.padding,width:A.width-p.padding*2,bottom:p.padding}).appendTo(f);break;case"float":i.css("left",parseInt((i.width()-A.width-40)/2,10)*-1).appendTo(e);break;default:i.css({width:A.width-p.padding*2,paddingLeft:p.padding,paddingRight:p.padding}).appendTo(e);break}i.hide()},M=function(){if(p.enableEscapeButton||p.enableKeyboardNav){a(document).bind("keydown.fb",function(b){if(b.keyCode==27&&p.enableEscapeButton){b.preventDefault();a.fancybox.close()}else if((b.keyCode==37||b.keyCode==39)&&p.enableKeyboardNav&&b.target.tagName!=="INPUT"&&b.target.tagName!=="TEXTAREA"&&b.target.tagName!=="SELECT"){b.preventDefault();a.fancybox[b.keyCode==37?"prev":"next"]()}})}if(!p.showNavArrows){j.hide();k.hide();return}if(p.cyclic&&q.length>1||o!==0){j.show()}if(p.cyclic&&q.length>1||o!=q.length-1){k.show()}},N=function(){if(!a.support.opacity){g.get(0).style.removeAttribute("filter");e.get(0).style.removeAttribute("filter")}if(m.autoDimensions){g.css("height","auto")}e.css("height","auto");if(y&&y.length){i.show()}if(p.showCloseButton){h.show()}M();if(p.hideOnContentClick){g.bind("click",a.fancybox.close)}if(p.hideOnOverlayClick){d.bind("click",a.fancybox.close)}a(window).bind("resize.fb",a.fancybox.resize);if(p.centerOnScroll){a(window).bind("scroll.fb",a.fancybox.center)}if(p.type=="iframe"){a('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(a.browser.msie?'allowtransparency="true""':"")+' scrolling="'+m.scrolling+'" src="'+p.href+'"></iframe>').appendTo(g)}e.show();B=false;a.fancybox.center();p.onComplete(q,o,p);O()},O=function(){var a,b;if(q.length-1>o){a=q[o+1].href;if(typeof a!=="undefined"&&a.match(t)){b=new Image;b.src=a}}if(o>0){a=q[o-1].href;if(typeof a!=="undefined"&&a.match(t)){b=new Image;b.src=a}}},P=function(a){var b={width:parseInt(z.width+(A.width-z.width)*a,10),height:parseInt(z.height+(A.height-z.height)*a,10),top:parseInt(z.top+(A.top-z.top)*a,10),left:parseInt(z.left+(A.left-z.left)*a,10)};if(typeof A.opacity!=="undefined"){b.opacity=a<.5?.5:a}e.css(b);g.css({width:b.width-p.padding*2,height:b.height-x*a-p.padding*2})},Q=function(){return[a(window).width()-p.margin*2,a(window).height()-p.margin*2,a(document).scrollLeft()+p.margin,a(document).scrollTop()+p.margin]},R=function(){var a=Q(),b={},c=p.autoScale,d=p.padding*2,e;if(p.width.toString().indexOf("%")>-1){b.width=parseInt(a[0]*parseFloat(p.width)/100,10)}else{b.width=p.width+d}if(p.height.toString().indexOf("%")>-1){b.height=parseInt(a[1]*parseFloat(p.height)/100,10)}else{b.height=p.height+d}if(c&&(b.width>a[0]||b.height>a[1])){if(m.type=="image"||m.type=="swf"){e=p.width/p.height;if(b.width>a[0]){b.width=a[0];b.height=parseInt((b.width-d)/e+d,10)}if(b.height>a[1]){b.height=a[1];b.width=parseInt((b.height-d)*e+d,10)}}else{b.width=Math.min(b.width,a[0]);b.height=Math.min(b.height,a[1])}}b.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-b.height-40)*.5),10);b.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-b.width-40)*.5),10);return b},S=function(a){var b=a.offset();b.top+=parseInt(a.css("paddingTop"),10)||0;b.left+=parseInt(a.css("paddingLeft"),10)||0;b.top+=parseInt(a.css("border-top-width"),10)||0;b.left+=parseInt(a.css("border-left-width"),10)||0;b.width=a.width();b.height=a.height();return b},T=function(){var b=m.orig?a(m.orig):false,c={},d,e;if(b&&b.length){d=S(b);c={width:d.width+p.padding*2,height:d.height+p.padding*2,top:d.top-p.padding-20,left:d.left-p.padding-20}}else{e=Q();c={width:p.padding*2,height:p.padding*2,top:parseInt(e[3]+e[1]*.5,10),left:parseInt(e[2]+e[0]*.5,10)}}return c},U=function(){if(!c.is(":visible")){clearInterval(v);return}a("div",c).css("top",w*-40+"px");w=(w+1)%12};a.fn.fancybox=function(b){if(!a(this).length){return this}a(this).data("fancybox",a.extend({},b,a.metadata?a(this).metadata():{})).unbind("click.fb").bind("click.fb",function(b){b.preventDefault();if(B){return}B=true;a(this).blur();n=[];l=0;var c=a(this).attr("rel")||"";if(!c||c==""||c==="nofollow"){n.push(this)}else{n=a("a[rel="+c+"], area[rel="+c+"]");l=n.index(this)}G();return});return this};a.fancybox=function(b){var c;if(B){return}B=true;c=typeof arguments[1]!=="undefined"?arguments[1]:{};n=[];l=parseInt(c.index,10)||0;if(a.isArray(b)){for(var d=0,e=b.length;d<e;d++){if(typeof b[d]=="object"){a(b[d]).data("fancybox",a.extend({},c,b[d]))}else{b[d]=a({}).data("fancybox",a.extend({content:b[d]},c))}}n=jQuery.merge(n,b)}else{if(typeof b=="object"){a(b).data("fancybox",a.extend({},c,b))}else{b=a({}).data("fancybox",a.extend({content:b},c))}n.push(b)}if(l>n.length||l<0){l=0}G()};a.fancybox.showActivity=function(){clearInterval(v);c.show();v=setInterval(U,66)};a.fancybox.hideActivity=function(){c.hide()};a.fancybox.next=function(){return a.fancybox.pos(o+1)};a.fancybox.prev=function(){return a.fancybox.pos(o-1)};a.fancybox.pos=function(a){if(B){return}a=parseInt(a);n=q;if(a>-1&&a<q.length){l=a;G()}else if(p.cyclic&&q.length>1){l=a>=q.length?0:q.length-1;G()}return};a.fancybox.cancel=function(){if(B){return}B=true;a.event.trigger("fancybox-cancel");E();m.onCancel(n,l,m);B=false};a.fancybox.close=function(){function b(){d.fadeOut("fast");i.empty().hide();e.hide();a.event.trigger("fancybox-cleanup");g.empty();p.onClosed(q,o,p);q=m=[];o=l=0;p=m={};B=false}if(B||e.is(":hidden")){return}B=true;if(p&&false===p.onCleanup(q,o,p)){B=false;return}E();a(h.add(j).add(k)).hide();a(g.add(d)).unbind();a(window).unbind("resize.fb scroll.fb");a(document).unbind("keydown.fb");g.find("iframe").attr("src",D&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");if(p.titlePosition!=="inside"){i.empty()}e.stop();if(p.transitionOut=="elastic"){z=T();var c=e.position();A={top:c.top,left:c.left,width:e.width(),height:e.height()};if(p.opacity){A.opacity=1}i.empty().hide();C.prop=1;a(C).animate({prop:0},{duration:p.speedOut,easing:p.easingOut,step:P,complete:b})}else{e.fadeOut(p.transitionOut=="none"?0:p.speedOut,b)}};a.fancybox.resize=function(){if(d.is(":visible")){d.css("height",a(document).height())}a.fancybox.center(true)};a.fancybox.center=function(){var a,b;if(B){return}b=arguments[0]===true?1:0;a=Q();if(!b&&(e.width()>a[0]||e.height()>a[1])){return}e.stop().animate({top:parseInt(Math.max(a[3]-20,a[3]+(a[1]-g.height()-40)*.5-p.padding)),left:parseInt(Math.max(a[2]-20,a[2]+(a[0]-g.width()-40)*.5-p.padding))},typeof arguments[0]=="number"?arguments[0]:200)};a.fancybox.init=function(){if(a("#fancybox-wrap").length){return}a("body").append(b=a('<div id="fancybox-tmp"></div>'),c=a('<div id="fancybox-loading"><div></div></div>'),d=a('<div id="fancybox-overlay"></div>'),e=a('<div id="fancybox-wrap"></div>'));f=a('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(e);f.append(g=a('<div id="fancybox-content"></div>'),h=a('<a id="fancybox-close"></a>'),i=a('<div id="fancybox-title"></div>'),j=a('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),k=a('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));h.click(a.fancybox.close);c.click(a.fancybox.cancel);j.click(function(b){b.preventDefault();a.fancybox.prev()});k.click(function(b){b.preventDefault();a.fancybox.next()});if(a.fn.mousewheel){e.bind("mousewheel.fb",function(b,c){if(B){b.preventDefault()}else if(a(b.target).get(0).clientHeight==0||a(b.target).get(0).scrollHeight===a(b.target).get(0).clientHeight){b.preventDefault();a.fancybox[c>0?"prev":"next"]()}})}if(!a.support.opacity){e.addClass("fancybox-ie")}if(D){c.addClass("fancybox-ie6");e.addClass("fancybox-ie6");a('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(f)}};a.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};a(document).ready(function(){a.fancybox.init()})})(jQuery)(function(a){a.fn.jTweetsAnywhere=function(b){b=a.extend({username:"tbillenstein",list:null,searchParams:null,count:0,tweetProfileImagePresent:null,tweetFilter:defaultTweetFilter,showTweetFeed:true,showFollowButton:false,showConnectButton:false,showLoginInfo:false,showTweetBox:false,mainDecorator:defaultMainDecorator,tweetFeedDecorator:defaultTweetFeedDecorator,tweetDecorator:defaultTweetDecorator,tweetProfileImageDecorator:defaultTweetProfileImageDecorator,tweetBodyDecorator:defaultTweetBodyDecorator,tweetUsernameDecorator:defaultTweetUsernameDecorator,tweetTextDecorator:defaultTweetTextDecorator,tweetAttributesDecorator:defaultTweetAttributesDecorator,tweetTimestampDecorator:defaultTweetTimestampDecorator,tweetSourceDecorator:defaultTweetSourceDecorator,tweetGeoLocationDecorator:defaultTweetGeoLocationDecorator,tweetInReplyToDecorator:defaultTweetInReplyToDecorator,tweetRetweeterDecorator:defaultTweetRetweeterDecorator,tweetFeedControlsDecorator:defaultTweetFeedControlsDecorator,tweetFeedControlsMoreBtnDecorator:defaultTweetFeedControlsMoreBtnDecorator,tweetFeedControlsPrevBtnDecorator:defaultTweetFeedControlsPrevBtnDecorator,tweetFeedControlsNextBtnDecorator:defaultTweetFeedControlsNextBtnDecorator,tweetFeedAutorefreshTriggerDecorator:defaultTweetFeedAutorefreshTriggerDecorator,tweetFeedAutorefreshTriggerContentDecorator:defaultTweetFeedAutorefreshTriggerContentDecorator,connectButtonDecorator:defaultConnectButtonDecorator,loginInfoDecorator:defaultLoginInfoDecorator,loginInfoContentDecorator:defaultLoginInfoContentDecorator,followButtonDecorator:defaultFollowButtonDecorator,tweetBoxDecorator:defaultTweetBoxDecorator,linkDecorator:defaultLinkDecorator,usernameDecorator:defaultUsernameDecorator,hashtagDecorator:defaultHashtagDecorator,loadingDecorator:defaultLoadingDecorator,errorDecorator:defaultErrorDecorator,noDataDecorator:defaultNoDataDecorator,tweetTimestampFormatter:defaultTweetTimestampFormatter,tweetTimestampTooltipFormatter:defaultTweetTimestampTooltipFormatter,tweetVisualizer:defaultTweetVisualizer,loadingIndicatorVisualizer:defaultLoadingIndicatorVisualizer,autorefreshTriggerVisualizer:defaultAutorefreshTriggerVisualizer,onDataRequestHandler:defaultOnDataRequestHandler,onRateLimitDataHandler:defaultOnRateLimitDataHandler,_tweetFeedConfig:{expandHovercards:false,showTimestamp:{refreshInterval:0},showSource:false,showGeoLocation:true,showInReplyTo:true,showProfileImages:null,showUserScreenNames:null,showUserFullNames:false,includeRetweets:true,paging:{mode:"none",_limit:0,_offset:0},autorefresh:{mode:"none",interval:60,duration:3600,_startTime:null,_triggerElement:null},_pageParam:0,_maxId:null,_recLevel:0,_noData:false,_clearBeforePopulate:false},_tweetBoxConfig:{counter:true,width:515,height:65,label:"What's happening?",defaultContent:"",onTweet:function(){}},_connectButtonConfig:{size:"medium"},_baseSelector:null,_baseElement:null,_tweetFeedElement:null,_tweetFeedControlsElement:null,_followButtonElement:null,_loginInfoElement:null,_connectButtonElement:null,_tweetBoxElement:null,_loadingIndicatorElement:null,_noDataElement:null,_tweetsCache:[],_autorefreshTweetsCache:[],_stats:{dataRequestCount:0,rateLimitPreventionCount:0,rateLimit:{remaining_hits:150,hourly_limit:150}}},b);if(b.mainDecorator){b._baseSelector=this.selector;if(typeof b.username!="string"){if(!b.searchParams)b.searchParams=["q=from:"+b.username.join(" OR from:")];b.username=b.username[0]}typeof b.showTweetFeed=="object"&&a.extend(true,b._tweetFeedConfig,b.showTweetFeed);if(typeof b.showTweetBox=="object"){b._tweetBoxConfig=b.showTweetBox;b.showTweetBox=true}if(typeof b.showConnectButton=="object"){b._connectButtonConfig=b.showConnectButton;b.showConnectButton=true}if(b._tweetFeedConfig.showProfileImages==null)b._tweetFeedConfig.showProfileImages=b.tweetProfileImagePresent;if(b._tweetFeedConfig.showProfileImages==null)b._tweetFeedConfig.showProfileImages=(b.list||b.searchParams)&&b.tweetProfileImageDecorator;if(b._tweetFeedConfig.showUserScreenNames==null){if(b.list||b.searchParams)b._tweetFeedConfig.showUserScreenNames=true;if(!b.tweetUsernameDecorator)b._tweetFeedConfig.showUserScreenNames=false}if(b._tweetFeedConfig.showUserFullNames==null){if(b.list||b.searchParams)b._tweetFeedConfig.showUserFullNames=true;if(!b.tweetUsernameDecorator)b._tweetFeedConfig.showUserFullNames=false}b.count=validateRange(b.count,0,b.searchParams?100:20);b._tweetFeedConfig.autorefresh.interval=Math.max(30,b._tweetFeedConfig.autorefresh.interval);b._tweetFeedConfig.paging._offset=0;b._tweetFeedConfig.paging._limit=b.count;if(b.count==0||!b.showTweetFeed){b.tweetFeedDecorator=null;b.tweetFeedControlsDecorator=null}if(b._tweetFeedConfig.paging.mode=="none")b.tweetFeedControlsDecorator=null;if(!b.showFollowButton)b.followButtonDecorator=null;if(!b.showTweetBox)b.tweetBoxDecorator=null;if(!b.showConnectButton)b.connectButtonDecorator=null;if(!b.showLoginInfo)b.loginInfoDecorator=null;if(!b._tweetFeedConfig.showTimestamp)b.tweetTimestampDecorator=null;if(!b._tweetFeedConfig.showSource)b.tweetSourceDecorator=null;if(!b._tweetFeedConfig.showGeoLocation)b.tweetGeoLocationDecorator=null;if(!b._tweetFeedConfig.showInReplyTo)b.tweetInReplyToDecorator=null;a.ajaxSetup({cache:true});return this.each(function(){b._baseElement=a(this);b._tweetFeedElement=b.tweetFeedDecorator?a(b.tweetFeedDecorator(b)):null;b._tweetFeedControlsElement=b.tweetFeedControlsDecorator?a(b.tweetFeedControlsDecorator(b)):null;b._followButtonElement=b.followButtonDecorator?a(b.followButtonDecorator(b)):null;b._tweetBoxElement=b.tweetBoxDecorator?a(b.tweetBoxDecorator(b)):null;b._connectButtonElement=b.connectButtonDecorator?a(b.connectButtonDecorator(b)):null;b._loginInfoElement=b.loginInfoDecorator?a(b.loginInfoDecorator(b)):null;b.mainDecorator(b);populateTweetFeed(b);populateAnywhereControls(b);bindEventHandlers(b);b._tweetFeedConfig.autorefresh._startTime=(new Date).getTime();startAutorefresh(b);startTimestampRefresh(b)})}};defaultMainDecorator=function(a){a._tweetFeedElement&&a._baseElement.append(a._tweetFeedElement);a._tweetFeedControlsElement&&a._baseElement.append(a._tweetFeedControlsElement);a._connectButtonElement&&a._baseElement.append(a._connectButtonElement);a._loginInfoElement&&a._baseElement.append(a._loginInfoElement);a._followButtonElement&&a._baseElement.append(a._followButtonElement);a._tweetBoxElement&&a._baseElement.append(a._tweetBoxElement)};defaultTweetFeedControlsDecorator=function(a){var b="";if(a._tweetFeedConfig.paging.mode=="prev-next"){if(a.tweetFeedControlsPrevBtnDecorator)b+=a.tweetFeedControlsPrevBtnDecorator(a);if(a.tweetFeedControlsNextBtnDecorator)b+=a.tweetFeedControlsNextBtnDecorator(a)}else if(a._tweetFeedConfig.paging.mode!="endless-scroll")if(a.tweetFeedControlsMoreBtnDecorator)b+=a.tweetFeedControlsMoreBtnDecorator(a);return'<div class="jta-tweet-list-controls">'+b+"</div>"};defaultTweetFeedControlsMoreBtnDecorator=function(){return'<span class="jta-tweet-list-controls-button jta-tweet-list-controls-button-more">More</span>'};defaultTweetFeedControlsPrevBtnDecorator=function(){return'<span class="jta-tweet-list-controls-button jta-tweet-list-controls-button-prev">Prev</span>'};defaultTweetFeedControlsNextBtnDecorator=function(){return'<span class="jta-tweet-list-controls-button jta-tweet-list-controls-button-next">Next</span>'};defaultTweetFeedAutorefreshTriggerDecorator=function(a,b){var c="";if(b.tweetFeedAutorefreshTriggerContentDecorator)c=b.tweetFeedAutorefreshTriggerContentDecorator(a,b);return'<li class="jta-tweet-list-autorefresh-trigger">'+c+"</li>"};defaultTweetFeedAutorefreshTriggerContentDecorator=function(a){return'<span class="jta-tweet-list-autorefresh-trigger-content">'+(""+a+" new "+(a>1?" tweets":" tweet"))+"</span>"};defaultTweetFeedDecorator=function(){return'<ul class="jta-tweet-list"></ul>'};defaultTweetDecorator=function(a,b){var c="";if(b._tweetFeedConfig.showProfileImages)c+=b.tweetProfileImageDecorator(a,b);if(b.tweetBodyDecorator)c+=b.tweetBodyDecorator(a,b);c+='<div class="jta-clear"> </div>';return'<li class="jta-tweet-list-item">'+c+"</li>"};defaultTweetProfileImageDecorator=function(a){a=a.retweeted_status||a;var b=a.user?a.user.screen_name:a.from_user;return'<div class="jta-tweet-profile-image">'+('<a class="jta-tweet-profile-image-link" href="http://twitter.com/'+b+'" target="_blank"><img src="'+(a.user?a.user.profile_image_url:a.profile_image_url)+'" alt="'+b+'"'+(isAnywherePresent()?"":' title="'+b+'"')+"/></a>")+"</div>"};defaultTweetBodyDecorator=function(a,b){var c="";if(b.tweetTextDecorator)c+=b.tweetTextDecorator(a,b);if(b.tweetAttributesDecorator)c+=b.tweetAttributesDecorator(a,b);return'<div class="jta-tweet-body '+(b._tweetFeedConfig.showProfileImages?"jta-tweet-body-list-profile-image-present":"")+'">'+c+"</div>"};defaultTweetTextDecorator=function(a,b){var c=a.text;if(a.retweeted_status&&(b._tweetFeedConfig.showUserScreenNames||b._tweetFeedConfig.showUserScreenNames==null||b._tweetFeedConfig.showUserFullNames||b._tweetFeedConfig.showUserFullNames==null))c=a.retweeted_status.text;if(b.linkDecorator)c=b.linkDecorator(c,b);if(b.usernameDecorator)c=b.usernameDecorator(c,b);if(b.hashtagDecorator)c=b.hashtagDecorator(c,b);if(b._tweetFeedConfig.showUserScreenNames||b._tweetFeedConfig.showUserFullNames||a.retweeted_status&&(b._tweetFeedConfig.showUserScreenNames==null||b._tweetFeedConfig.showUserFullNames==null))c=b.tweetUsernameDecorator(a,b)+" "+c;return'<span class="jta-tweet-text">'+c+"</span>"};defaultTweetUsernameDecorator=function(a,b){var c=a.retweeted_status||a,d=c.user?c.user.screen_name:c.from_user;c=c.user?c.user.name:null;var e;if(d&&(b._tweetFeedConfig.showUserScreenNames||b._tweetFeedConfig.showUserScreenNames==null&&a.retweeted_status))e='<span class="jta-tweet-user-screen-name"><a class="jta-tweet-user-screen-name-link" href="http://twitter.com/'+d+'" target="_blank">'+d+"</a></span>";var f;if(c&&(b._tweetFeedConfig.showUserFullNames||b._tweetFeedConfig.showUserFullNames==null&&a.retweeted_status))f='<span class="jta-tweet-user-full-name">'+(e?" (":"")+'<a class="jta-tweet-user-full-name-link" href="http://twitter.com/'+d+'" name="'+d+'" target="_blank">'+c+"</a>"+(e?")":"")+"</span>";d="";if(e)d+=e;if(f){if(e)d+=" ";d+=f}if(e||f)d='<span class="jta-tweet-user-name">'+(a.retweeted_status?"RT ":"")+d+"</span>";return d};defaultTweetAttributesDecorator=function(a,b){var c="";if(b.tweetTimestampDecorator||b.tweetSourceDecorator||b.tweetGeoLocationDecorator||b.tweetInReplyToDecorator||a.retweeted_status&&b.tweetRetweeterDecorator){c+='<span class="jta-tweet-attributes">';if(b.tweetTimestampDecorator)c+=b.tweetTimestampDecorator(a,b);if(b.tweetSourceDecorator)c+=b.tweetSourceDecorator(a,b);if(b.tweetGeoLocationDecorator)c+=b.tweetGeoLocationDecorator(a,b);if(b.tweetInReplyToDecorator)c+=b.tweetInReplyToDecorator(a,b);if(a.retweeted_status&&b.tweetRetweeterDecorator)c+=b.tweetRetweeterDecorator(a,b);c+="</span>"}return c};defaultTweetTimestampDecorator=function(a,b){var c=a.retweeted_status||a,d=formatDate(c.created_at),e=b.tweetTimestampFormatter(d),f=b.tweetTimestampTooltipFormatter(d);return'<span class="jta-tweet-timestamp"><a class="jta-tweet-timestamp-link" data-timestamp="'+d+'" href="http://twitter.com/'+(c.user?c.user.screen_name:c.from_user)+"/status/"+c.id+'" target="_blank" title="'+f+'">'+e+"</a></span>"};defaultTweetTimestampTooltipFormatter=function(a){return(new Date(a)).toLocaleString()};defaultTweetTimestampFormatter=function(a){var b=new Date,c=parseInt((b.getTime()-Date.parse(a))/1e3),d="";if(c<60)d+=c+" second"+(c==1?"":"s")+" ago";else if(c<3600){b=parseInt((c+30)/60);d+=b+" minute"+(b==1?"":"s")+" ago"}else if(c<86400){b=parseInt((c+1800)/3600);d+=b+" hour"+(b==1?"":"s")+" ago"}else{a=new Date(a);a.getHours();a.getMinutes();d+=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][a.getMonth()]+" "+a.getDate();if(a.getFullYear()<b.getFullYear())d+=", "+a.getFullYear();b=parseInt((c+43200)/86400);d+=" ("+b+" day"+(b==1?"":"s")+" ago)"}return d};exTimestampFormatter=function(a){var b=parseInt(((new Date).getTime()-Date.parse(a))/1e3),c="";if(b<60)c+="less than a minute ago";else if(b<3600){b=parseInt((b+30)/60);c+=b+" minute"+(b==1?"":"s")+" ago"}else if(b<86400){b=parseInt((b+1800)/3600);c+="about "+b+" hour"+(b==1?"":"s")+" ago"}else{b=parseInt((b+43200)/86400);c+="about "+b+" day"+(b==1?"":"s")+" ago";a=new Date(a);b="AM";var d=a.getHours();if(d>12){d-=12;b="PM"}var e=a.getMinutes();c+=" ("+d+":"+((e<10?"0":"")+e)+" "+b+" "+(a.getMonth()+1)+"/"+a.getDate()+"/"+a.getFullYear()+")"}return c};defaultTweetSourceDecorator=function(a){return'<span class="jta-tweet-source"> via <span class="jta-tweet-source-link">'+(a.retweeted_status||a).source.replace(/\&lt\;/gi,"<").replace(/\&gt\;/gi,">").replace(/\&quot\;/gi,'"')+"</span></span>"};defaultTweetGeoLocationDecorator=function(a){var b="";a=a.retweeted_status||a;var c;if(a.geo&&a.geo.coordinates)c=a.geo.coordinates.join();else if(a.place&&a.place.full_name)c=a.place.full_name;if(c){b="here";if(a.place&&a.place.full_name)b=a.place.full_name;b='<span class="jta-tweet-location"> from <a class="jta-tweet-location-link" href="'+("http://maps.google.com/maps?q="+c)+'" target="_blank">'+b+"</a></span>"}return b};defaultTweetInReplyToDecorator=function(a){a=a.retweeted_status||a;var b="";if(a.in_reply_to_status_id&&a.in_reply_to_screen_name)b='<span class="jta-tweet-inreplyto"> <a class="jta-tweet-inreplyto-link" href="http://twitter.com/'+a.in_reply_to_screen_name+"/status/"+a.in_reply_to_status_id+'" target="_blank">in reply to '+a.in_reply_to_screen_name+"</a></span>";return b};defaultTweetRetweeterDecorator=function(a){var b="";if(a.retweeted_status){b=a.user?a.user.screen_name:a.from_user;a=(a.retweeted_status.retweet_count||0)-1;var c=" and "+a+(a>1?" others":" other");b='<br/><span class="jta-tweet-retweeter">Retweeted by '+('<a class="jta-tweet-retweeter-link" href="http://twitter.com/'+b+'" target="_blank">'+b+"</a>")+(a>0?c:"")+"</span>"}return b};defaultConnectButtonDecorator=function(){return'<div class="jta-connect-button"></div>'};defaultLoginInfoDecorator=function(){return'<div class="jta-login-info"></div>'};defaultLoginInfoContentDecorator=function(a,b){var c="";if(b.isConnected()){c=b.currentUser.data("screen_name");var d=b.currentUser.data("profile_image_url");c='<div class="jta-login-info-profile-image"><a href="http://twitter.com/'+c+'" target="_blank"><img src="'+d+'" alt="'+c+'" title="'+c+'"/></a></div><div class="jta-login-info-block"><div class="jta-login-info-screen-name"><a href="http://twitter.com/'+c+'" target="_blank">'+c+'</a></div><div class="jta-login-info-sign-out">Sign out</div></div><div class="jta-clear"> </div>'}return c};defaultFollowButtonDecorator=function(){return'<div class="jta-follow-button"></div>'};defaultTweetBoxDecorator=function(){return'<div class="jta-tweet-box"></div>'};defaultLinkDecorator=function(a){return a.replace(/((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi,'<a href="$1" class="jta-tweet-a jta-tweet-link" target="_blank" rel="nofollow">$1</a>')};defaultUsernameDecorator=function(a){return isAnywherePresent()?a:a.replace(/@([a-zA-Z0-9_]+)/gi,'@<a href="http://twitter.com/$1" class="jta-tweet-a twitter-anywhere-user" target="_blank" rel="nofollow">$1</a>')};defaultHashtagDecorator=function(a){return a.replace(/#([a-zA-Z0-9_]+)/gi,'<a href="http://search.twitter.com/search?q=%23$1" class="jta-tweet-a jta-tweet-hashtag" title="#$1" target="_blank" rel="nofollow">#$1</a>')};defaultLoadingDecorator=function(){return'<li class="jta-loading">loading ...</li>'};defaultErrorDecorator=function(a){return'<li class="jta-error">ERROR: '+a+"</li>"};defaultNoDataDecorator=function(){return'<li class="jta-nodata">No more data</li>'};defaultTweetFilter=function(){return true};defaultTweetVisualizer=function(a,b,c){a[c](b)};defaultLoadingIndicatorVisualizer=function(a,b,c,d){defaultVisualizer(a,b,"append","fadeIn",600,"fadeOut",200,d)};defaultAutorefreshTriggerVisualizer=function(a,b,c,d){defaultVisualizer(a,b,"prepend","slideDown",600,"fadeOut",200,d)};defaultVisualizer=function(a,b,c,d,e,f,g,h){var i=function(){h&&h()};if(a){b.hide();a[c](b);b[d](e,i)}else b[f](g,function(){b.remove();i()})};defaultOnDataRequestHandler=function(){return true};defaultOnRateLimitDataHandler=function(){};updateLoginInfoElement=function(b,c){if(b._loginInfoElement&&b.loginInfoContentDecorator){b._loginInfoElement.children().remove();b._loginInfoElement.append(b.loginInfoContentDecorator(b,c));a(b._baseSelector+" .jta-login-info-sign-out").bind("click",function(){twttr.anywhere.signOut()})}};getFeedUrl=function(a,b){var c="https:"==document.location.protocol?"https:":"http:";if(a.searchParams)c+="//search.twitter.com/search.json?"+(a.searchParams instanceof Array?a.searchParams.join("&"):a.searchParams)+"&rpp=100";else if(a.list)c+="//api.twitter.com/1/"+a.username+"/lists/"+a.list+"/statuses.json?per_page=20";else{c+="//api.twitter.com/1/statuses/user_timeline.json?screen_name="+a.username+"&count=20";if(a._tweetFeedConfig.includeRetweets)c+="&include_rts=true"}if(b)c+=(a._tweetFeedConfig._maxId?"&max_id="+a._tweetFeedConfig._maxId:"")+"&page="+a._tweetFeedConfig._pageParam;c+="&callback=?";return c};isAnywherePresent=function(){return typeof twttr!="undefined"};clearTweetFeed=function(a){a._tweetFeedElement&&a._tweetFeedElement.empty()};populateTweetFeed=function(b){b.tweetDecorator&&b._tweetFeedElement&&getPagedTweets(b,function(b,c){c._tweetFeedConfig._clearBeforePopulate&&clearTweetFeed(c);hideLoadingIndicator(c,function(){a.each(b,function(b,d){c.tweetVisualizer(c._tweetFeedElement,a(c.tweetDecorator(d,c)),"append",c)});if(c._tweetFeedConfig._noData&&c.noDataDecorator&&!c._tweetFeedConfig._noDataElement){c._tweetFeedConfig._noDataElement=a(c.noDataDecorator(c));c._tweetFeedElement.append(c._tweetFeedConfig._noDataElement)}c._tweetFeedConfig._clearBeforePopulate&&c._tweetFeedElement.scrollTop(0);addHovercards(c)})})};populateTweetFeed2=function(b){if(b._tweetFeedElement&&b._autorefreshTweetsCache.length>0)if(b._tweetFeedConfig.autorefresh.mode=="trigger-insert")if(b._tweetFeedConfig.autorefresh._triggerElement)b.tweetFeedAutorefreshTriggerContentDecorator&&b._tweetFeedConfig.autorefresh._triggerElement.html(b.tweetFeedAutorefreshTriggerContentDecorator(b._autorefreshTweetsCache.length,b));else{if(b.tweetFeedAutorefreshTriggerDecorator){b._tweetFeedConfig.autorefresh._triggerElement=a(b.tweetFeedAutorefreshTriggerDecorator(b._autorefreshTweetsCache.length,b));b._tweetFeedConfig.autorefresh._triggerElement.bind("click",function(){b.autorefreshTriggerVisualizer(null,b._tweetFeedConfig.autorefresh._triggerElement,b,function(){insertTriggerTweets(b)});b._tweetFeedConfig.autorefresh._triggerElement=null});b.autorefreshTriggerVisualizer(b._tweetFeedElement,b._tweetFeedConfig.autorefresh._triggerElement,b)}}else insertTriggerTweets(b)};insertTriggerTweets=function(b){if(b.tweetDecorator&&b._autorefreshTweetsCache.length>0){for(;b._autorefreshTweetsCache.length>0;){var c=b._autorefreshTweetsCache.pop();b._tweetsCache.unshift(c);b._tweetFeedConfig.paging._offset++;b.tweetVisualizer(b._tweetFeedElement,a(b.tweetDecorator(c,b)),"prepend",b)}addHovercards(b)}};addHovercards=function(a){isAnywherePresent()&&twttr.anywhere(function(b){b(a._baseSelector+" .jta-tweet-list").hovercards({expanded:a._tweetFeedConfig.expandHovercards});b(a._baseSelector+" .jta-tweet-profile-image img").hovercards({expanded:a._tweetFeedConfig.expandHovercards,username:function(a){return a.alt}});b(a._baseSelector+" .jta-tweet-retweeter-link").hovercards({expanded:a._tweetFeedConfig.expandHovercards,username:function(a){return a.text}});b(a._baseSelector+" .jta-tweet-user-screen-name-link").hovercards({expanded:a._tweetFeedConfig.expandHovercards,username:function(a){return a.text}});b(a._baseSelector+" .jta-tweet-user-full-name-link").hovercards({expanded:a._tweetFeedConfig.expandHovercards,username:function(a){return a.name}})})};populateAnywhereControls=function(b){isAnywherePresent()&&twttr.anywhere(function(c){b.tweetBoxDecorator&&c(b._baseSelector+" .jta-tweet-box").tweetBox(b._tweetBoxConfig);b.followButtonDecorator&&c(b._baseSelector+" .jta-follow-button").followButton(b.username);if(b.connectButtonDecorator){var d=a.extend({authComplete:function(){updateLoginInfoElement(b,c)},signOut:function(){updateLoginInfoElement(b,c)}},b._connectButtonConfig);c(b._baseSelector+" .jta-connect-button").connectButton(d);updateLoginInfoElement(b,c)}})};bindEventHandlers=function(b){if(b.tweetFeedControlsDecorator)if(b._tweetFeedConfig.paging.mode=="prev-next"){a(b._baseSelector+" .jta-tweet-list-controls-button-prev").bind("click",function(){!isLoading(b)&&b._tweetFeedConfig.paging._offset>0&&prevPage(b,true)});a(b._baseSelector+" .jta-tweet-list-controls-button-next").bind("click",function(){isLoading(b)||nextPage(b,true)})}else b._tweetFeedConfig.paging.mode=="endless-scroll"?b._tweetFeedElement.bind("scroll",function(){!isLoading(b)&&a(this)[0].scrollHeight-a(this).scrollTop()==a(this).outerHeight()&&nextPage(b,false)}):a(b._baseSelector+" .jta-tweet-list-controls-button-more").bind("click",function(){isLoading(b)||nextPage(b,false)})};nextPage=function(a,b){doPage(a,b,Math.min(a._tweetFeedConfig.paging._offset+a._tweetFeedConfig.paging._limit,a._tweetsCache.length))};prevPage=function(a,b){doPage(a,b,Math.max(0,a._tweetFeedConfig.paging._offset-a._tweetFeedConfig.paging._limit))};doPage=function(a,b,c){a._tweetFeedConfig.paging._offset=c;a._tweetFeedConfig._clearBeforePopulate=b;populateTweetFeed(a)};startAutorefresh=function(a){if(a._tweetFeedConfig.autorefresh.mode!="none"&&a._tweetFeedConfig.paging.mode!="prev-next"&&a._tweetFeedConfig.autorefresh.duration!=0&&(a._tweetFeedConfig.autorefresh.duration<0||(new Date).getTime()-a._tweetFeedConfig.autorefresh._startTime<=a._tweetFeedConfig.autorefresh.duration*1e3))window.setTimeout(function(){processAutorefresh(a)},a._tweetFeedConfig.autorefresh.interval*1e3)};stopAutorefresh=function(a){a._tweetFeedConfig.autorefresh.duration=0};processAutorefresh=function(b){if(b._tweetFeedConfig.autorefresh.duration!=0){getRateLimitedData(b,true,getFeedUrl(b,false),function(b,c){var d=(b.results||b).slice(0);d.reverse();a.each(d,function(a,b){isTweetInCache(b,c)||c.tweetFilter(b,c)&&c._autorefreshTweetsCache.unshift(b)});populateTweetFeed2(c)});startAutorefresh(b)}};startTimestampRefresh=function(a){a.tweetTimestampDecorator&&typeof a._tweetFeedConfig.showTimestamp=="object"&&a._tweetFeedConfig.showTimestamp.refreshInterval>0&&window.setTimeout(function(){processTimestampRefresh(a)},a._tweetFeedConfig.showTimestamp.refreshInterval*1e3)};processTimestampRefresh=function(b){a.each(b._tweetFeedElement.find(".jta-tweet-timestamp-link"),function(c,d){var f=a(d).attr("data-timestamp");a(d).html(b.tweetTimestampFormatter(f))});startTimestampRefresh(b)};isTweetInCache=function(a,b){for(var c=b._tweetsCache.length,d=0;d<c;d++)if(a.id==b._tweetsCache[d].id)return true;return false};showLoadingIndicator=function(b){if(b._tweetFeedElement&&b.loadingDecorator&&!b._loadingIndicatorElement){b._loadingIndicatorElement=a(b.loadingDecorator(b));b.loadingIndicatorVisualizer(b._tweetFeedElement,b._loadingIndicatorElement,b,null);b._tweetFeedElement.scrollTop(1e6)}};hideLoadingIndicator=function(a,b){if(a._loadingIndicatorElement){a.loadingIndicatorVisualizer(null,a._loadingIndicatorElement,a,b);a._loadingIndicatorElement=null}else b&&b()};isLoading=function(a){return a._loadingIndicatorElement!=null};formatDate=function(a){return a.replace(/^([a-z]{3})( [a-z]{3} \d\d?)(.*)( \d{4})$/i,"$1,$2$4$3")};validateRange=function(a,b,c){if(a<b)a=b;if(a>c)a=c;return a};showError=function(a,b){a.errorDecorator&&a._tweetFeedElement&&a._tweetFeedElement.append(a.errorDecorator(b,a))};getPagedTweets=function(a,b){a._tweetFeedConfig._recLevel=0;getRecPagedTweets(a,a._tweetFeedConfig.paging._offset,a._tweetFeedConfig.paging._limit,b)};getRecPagedTweets=function(b,c,d,f){++b._tweetFeedConfig._recLevel;if(c+d<=b._tweetsCache.length||b._tweetFeedConfig._recLevel>3||b._tweetFeedConfig._noData){if(c+d>b._tweetsCache.length)d=Math.max(0,b._tweetsCache.length-c);for(var g=[],h=0;h<d;h++)g[h]=b._tweetsCache[c+h];f(g,b)}else{++b._tweetFeedConfig._pageParam;getRateLimitedData(b,false,getFeedUrl(b,true),function(b,g){var h=b.results||b;if(h.length==0)g._tweetFeedConfig._noData=true;else a.each(h,function(a,b){if(b.id_str)b.id=b.id_str;if(b.in_reply_to_status_id_str)b.in_reply_to_status_id=b.in_reply_to_status_id_str;if(!g._tweetFeedConfig._maxId)g._tweetFeedConfig._maxId=b.id;g.tweetFilter(b,g)&&g._tweetsCache.push(b)});getRecPagedTweets(g,c,d,f)})}};getRateLimitedData=function(a,b,c,d){getRateLimit(a,function(e){if(e&&e.remaining_hits<=0){a._stats.rateLimitPreventionCount++;hideLoadingIndicator(a,null)}else getData(a,b,c,d)})};getData=function(b,c,d,f){b._stats.dataRequestCount++;if(b.onDataRequestHandler(b._stats,b)){c||showLoadingIndicator(b);a.getJSON(d,function(a){a.error?showError(b,a.error):f(a,b)})}else hideLoadingIndicator(b,null)};getRateLimit=function(b,c){a.getJSON("http://api.twitter.com/1/account/rate_limit_status.json?callback=?",function(a){b._stats.rateLimit=a;b.onRateLimitDataHandler(b._stats,b);c(a)})}})(jQuery)
