/*
 * jQuery.timers - Timer abstractions for jQuery
 */
jQuery.fn.extend({everyTime:function(b,c,d,e,a){return this.each(function(){jQuery.timer.add(this,b,c,d,e,a)})},oneTime:function(a,b,c){return this.each(function(){jQuery.timer.add(this,a,b,c,1)})},stopTime:function(a,b){return this.each(function(){jQuery.timer.remove(this,a,b)})}});jQuery.event.special;jQuery.extend({timer:{global:[],guid:1,dataKey:"jQuery.timer",regex:/^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,powers:{ms:1,cs:10,ds:100,s:1000,das:10000,hs:100000,ks:1000000},timeParse:function(c){if(c==undefined||c==null){return null}var a=this.regex.exec(jQuery.trim(c.toString()));if(a[2]){var b=parseFloat(a[1]);var d=this.powers[a[2]]||1;return b*d}else{return c}},add:function(e,c,h,g,b,f){var a=0;if(jQuery.isFunction(h)){if(!b){b=g}g=h;h=c}c=jQuery.timer.timeParse(c);if(typeof c!="number"||isNaN(c)||c<=0){return}if(b&&b.constructor!=Number){f=!!b;b=0}b=b||0;f=f||false;var d=jQuery.data(e,this.dataKey)||jQuery.data(e,this.dataKey,{});if(!d[h]){d[h]={}}g.timerID=g.timerID||this.guid++;var i=function(){if(f&&this.inProgress){return}this.inProgress=true;if((++a>b&&b!==0)||g.call(e,a)===false){jQuery.timer.remove(e,h,g)}this.inProgress=false};i.timerID=g.timerID;if(!d[h][g.timerID]){d[h][g.timerID]=window.setInterval(i,c)}this.global.push(e)},remove:function(c,b,d){var e=jQuery.data(c,this.dataKey),a;if(e){if(!b){for(b in e){this.remove(c,b,d)}}else{if(e[b]){if(d){if(d.timerID){window.clearInterval(e[b][d.timerID]);delete e[b][d.timerID]}}else{for(var d in e[b]){window.clearInterval(e[b][d]);delete e[b][d]}}for(a in e[b]){break}if(!a){a=null;delete e[b]}}}for(a in e){break}if(!a){jQuery.removeData(c,this.dataKey)}}}}});jQuery(window).bind("unload",function(){jQuery.each(jQuery.timer.global,function(a,b){jQuery.timer.remove(b)})});
/**
Vertigo Tip by www.vertigo-project.com
Requires jQuery
*/
this.vtip=function(){this.xOffset=-10;this.yOffset=10;$(".vtip").unbind().hover(function(a){this.t=this.title;this.title="";this.top=(a.pageY+yOffset);this.left=(a.pageX+xOffset);$("body").append('<p id="vtip"><img id="vtipArrow" />'+this.t+"</p>");$("p#vtip #vtipArrow").attr("src","/wp-content/themes/web-kreation/images/vtip_arrow.png");$("p#vtip").css("top",this.top+"px").css("left",this.left+"px").fadeIn("slow")},function(){this.title=this.t;$("p#vtip").fadeOut("slow").remove()}).mousemove(function(a){this.top=(a.pageY+yOffset);this.left=(a.pageX+xOffset);$("p#vtip").css("top",this.top+"px").css("left",this.left+"px")})};jQuery(document).ready(function(a){vtip()});

/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 */
jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}});


/*
 * jQuery.ScrollTo - http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);


/*
 * 	Easy Slider 1.5 - http://cssglobe.com/post/4004/easy-slider-15-the-easiest-jquery-plugin-for-sliding
 */
(function($) {
	$.fn.easySlider = function(options){	  
		// default configuration properties
		var defaults = {			
			prevId: 		'prevBtn',
			prevText: 		'Previous',
			nextId: 		'nextBtn',	
			nextText: 		'Next',
			controlsShow:	true,
			controlsBefore:	'',
			controlsAfter:	'',	
			controlsFade:	true,
			firstId: 		'firstBtn',
			firstText: 		'First',
			firstShow:		false,
			lastId: 		'lastBtn',	
			lastText: 		'Last',
			lastShow:		false,				
			vertical:		true,
			speed: 			1000,
			auto:			true,
			pause:			6000,
			continuous:		true
		}; 		
		var options=$.extend(defaults,options);this.each(function(){var b=$(this);var j=$("li",b).length;var g=$("li",b).width();var c=$("li",b).height();b.width(g);b.height(c);b.css("overflow","hidden");var e=j-1;var i=0;$("ul",b).css("width",j*g);if(!options.vertical){$("li",b).css("float","left")}if(options.controlsShow){var d=options.controlsBefore;if(options.firstShow){d+='<span id="'+options.firstId+'"><a href="javascript:void(0);">'+options.firstText+"</a></span>"}d+=' <span id="'+options.prevId+'"><a href="javascript:void(0);">'+options.prevText+"</a></span>";d+=' <span id="'+options.nextId+'"><a href="javascript:void(0);">'+options.nextText+"</a></span>";if(options.lastShow){d+=' <span id="'+options.lastId+'"><a href="javascript:void(0);">'+options.lastText+"</a></span>"}d+=options.controlsAfter;$(b).after(d)}$("a","#"+options.nextId).click(function(){a("next",true)});$("a","#"+options.prevId).click(function(){a("prev",true)});$("a","#"+options.firstId).click(function(){a("first",true)});$("a","#"+options.lastId).click(function(){a("last",true)});function a(h,k){var l=i;switch(h){case"next":i=(l>=e)?(options.continuous?0:e):i+1;break;case"prev":i=(i<=0)?(options.continuous?e:0):i-1;break;case"first":i=0;break;case"last":i=e;break;default:break}var n=Math.abs(l-i);var m=n*options.speed;if(!options.vertical){p=(i*g*-1);$("ul",b).animate({marginLeft:p},m)}else{p=(i*c*-1);$("ul",b).animate({marginTop:p},m)}if(!options.continuous&&options.controlsFade){if(i==e){$("a","#"+options.nextId).hide();$("a","#"+options.lastId).hide()}else{$("a","#"+options.nextId).show();$("a","#"+options.lastId).show()}if(i==0){$("a","#"+options.prevId).hide();$("a","#"+options.firstId).hide()}else{$("a","#"+options.prevId).show();$("a","#"+options.firstId).show()}}if(k){clearTimeout(f)}if(options.auto&&h=="next"&&!k){f=setTimeout(function(){a("next",false)},n*options.speed+options.pause)}}var f;if(options.auto){f=setTimeout(function(){a("next",false)},options.pause)}if(!options.continuous&&options.controlsFade){$("a","#"+options.prevId).hide();$("a","#"+options.firstId).hide()}});	  
	};
})(jQuery);


/*
 * GalleryView - http://www.spaceforaname.com/jquery/galleryview/
 */
(function(a){a.fn.galleryView=function(d){var o=a.extend(a.fn.galleryView.defaults,d);var s;var r=0;var i;var u;var k=10;var f;var C;var n=0;var E;var v;var B=false;var z=60;var p=5;var e=2;var D;var w;var y;var l;var q;var A;function j(F){a("btn-next-big").unbind("click");a("btn-previous-big").unbind("click");y.unbind("click");if(has_panels){if(o.fade_panels){l.fadeOut(o.transition_speed).eq(F%n).fadeIn(o.transition_speed,function(){if(!has_filmstrip){a("btn-previous-big").click(c);a("btn-next-big").click(t)}})}}if(has_filmstrip){if(E=="strip"){w.stop();var I=x(y[F]).left-(x(q[0]).left+2);var G=(I>=0?"-=":"+=")+Math.abs(I)+"px";w.animate({left:G},o.transition_speed,o.easing,function(){if(F>n){F=F%n;r=F;w.css("left","-"+((o.frame_width+k)*F)+"px")}else{if(F<=(n-strip_size)){F=(F%n)+n;r=F;w.css("left","-"+((o.frame_width+k)*F)+"px")}}if(!o.fade_panels){l.hide().eq(F%n).show()}a("btn-previous-big").click(c);a("btn-next-big").click(t);m()})}else{if(E=="pointer"){q.stop();var H=x(y[F]);q.animate({left:(H.left-2+"px")},o.transition_speed,o.easing,function(){if(!o.fade_panels){l.hide().eq(F%n).show()}a("btn-previous-big").click(c);a("btn-next-big").click(t);m()})}}if(a("a",y[F])[0]){q.unbind("click").click(function(){var J=a("a",y[F]).eq(0);if(J.attr("target")=="_blank"){window.open(J.attr("href"))}else{location.href=J.attr("href")}})}}}function t(){a(document).stopTime("transition");if(++r==y.length){r=0}j(r);a(document).everyTime(o.transition_interval,"transition",function(){t()})}function c(){a(document).stopTime("transition");if(--r<0){r=n-1}j(r);a(document).everyTime(o.transition_interval,"transition",function(){t()})}function x(I){var L=0,K=0;var F=I.id;if(I.offsetParent){do{L+=I.offsetLeft;K+=I.offsetTop}while(I=I.offsetParent)}if(F==s){return{left:L,top:K}}else{var H=x(D[0]);var J=H.left;var G=H.top;return{left:L-J,top:K-G}}}function m(){y.each(function(F){if(a("a",this).length==0){a(this).click(function(){a(document).stopTime("transition");j(F);r=F;a(document).everyTime(o.transition_interval,"transition",function(){t()})})}})}function h(){if(a(".panel-overlay").length>0){l.append('<div class="overlay"></div>')}l.css({width:(o.panel_width-parseInt(l.css("paddingLeft").split("px")[0],10)-parseInt(l.css("paddingRight").split("px")[0],10))+"px",height:(o.panel_height-parseInt(l.css("paddingTop").split("px")[0],10)-parseInt(l.css("paddingBottom").split("px")[0],10))+"px",position:"absolute",top:(o.filmstrip_position=="top"?(o.frame_height+p+(o.show_captions?z:p))+"px":"0px"),left:"0px",overflow:"hidden",background:"white",display:"none"});a(".panel-overlay",l).css({position:"absolute",zIndex:"999",width:(o.panel_width-20)+"px",height:o.overlay_height+"px",top:(o.overlay_position=="top"?"0":o.panel_height-o.overlay_height+"px"),left:"0",padding:"0 10px",color:o.overlay_text_color,fontSize:o.overlay_font_size});a(".panel-overlay a",l).css({color:o.overlay_text_color,textDecoration:"underline",fontWeight:"bold"});a(".overlay",l).css({position:"absolute",zIndex:"998",width:o.panel_width+"px",height:o.overlay_height+"px",top:(o.overlay_position=="top"?"0":o.panel_height-o.overlay_height+"px"),left:"0",background:o.overlay_color,opacity:o.overlay_opacity});a(".panel iframe",l).css({width:o.panel_width+"px",height:(o.panel_height-o.overlay_height)+"px",border:"0"})}function g(){w.wrap('<div class="strip_wrapper"></div>');if(E=="strip"){y.clone().appendTo(w);y.clone().appendTo(w);y=a("li",w)}if(o.show_captions){y.append('<div class="caption"></div>').each(function(M){a(this).find(".caption").html(a(this).find("img").attr("title"))})}y.css({"float":"left",height:o.frame_height+"px",marginTop:p+"px",marginBottom:"0px",marginRight:k+"px",padding:"0",cursor:"pointer"});a("img",y).css({border:"none"});a(".strip_wrapper",D).css({overflow:"hidden"});a(".caption",D).css({position:"absolute",top:o.frame_height+"px",left:"0",margin:"0",width:o.frame_width+"px",padding:"0",color:o.caption_text_color,textAlign:"center",fontSize:"10px",height:z+"px",lineHeight:z+"px"});var L=a("<div></div>");L.attr("id","pointer").appendTo(D).css({position:"absolute",zIndex:"1000",cursor:"pointer",top:"412px",left:x(y[0]).left-(e/2)+"px",height:o.frame_height-e+"px",width:o.frame_width-e+"px",border:"none"});q=a("#pointer",D);if(has_panels){var K=a('<div class="pointer"></div>');K.appendTo(a("#pointer")).css({position:"absolute",zIndex:"1001",top:(o.filmstrip_position=="bottom"?"-"+(10+e)+"px":o.frame_height+"px"),left:((o.frame_width/2)-10)+"px"})}if(E=="strip"){w.css("left","-"+((o.frame_width+k)*n)+"px");r=n}if(a("a",y[r])[0]){q.click(function(){var M=a("a",y[r]).eq(0);if(M.attr("target")=="_blank"){window.open(M.attr("href"))}else{location.href=M.attr("href")}})}A=a(".strip_wrapper",D);var F=a("<div></div>");var I=a("<div></div>");var J=a("<div></div>");J.addClass("nav_nextPrev_big").appendTo(A);F.addClass("btn-next-big").appendTo(J).click(t);I.addClass("btn-previous-big").appendTo(J).click(c);var G=a('<a href="/index.php/portfolio" class="btn-big" title="View Portfolio"><span>Portfolio</span></a>');G.appendTo(A)}function b(F,J){var I=x(D[0]);var H=I.top;var G=I.left;return F>G&&F<G+o.panel_width&&J>H&&J<H+o.panel_height}return this.each(function(){D=a(this);a("script").each(function(F){var G=a(this);if(G.attr("src")&&G.attr("src").match(/jquery\.galleryview/)){v=G.attr("src").split("jquery.galleryview")[0]+"themes/"}});D.css("visibility","hidden");w=a(".filmstrip",D);y=a("li",w);l=a(".panel",D);s=D.attr("id");has_panels=l.length>0;has_filmstrip=y.length>0;if(!has_panels){o.panel_height=0}n=has_panels?l.length:y.length;strip_size=has_panels?Math.floor((o.panel_width-64)/(o.frame_width+k)):Math.min(n,o.filmstrip_size);if(strip_size>=n){E="pointer";strip_size=n}else{E="strip"}i=has_panels?o.panel_width:(strip_size*(o.frame_width+k))-k+64;u=(has_panels?o.panel_height:0)+(has_filmstrip?o.frame_height+p+(o.show_captions?z:p):0);if(E=="pointer"){f=(o.frame_width*n)+(k*(n))}else{f=(o.frame_width*n*3)+(k*(n*3))}C=((strip_size*o.frame_width)+((strip_size-1)*k));D.css({position:"relative",margin:"0",background:o.background_color,border:o.border,width:i+"px",height:u+"px"});if(has_filmstrip){g()}if(has_panels){h()}if(has_filmstrip){m()}a().mousemove(function(F){if(b(F.pageX,F.pageY)){if(o.pause_on_hover){a(document).oneTime(500,"animation_pause",function(){a(document).stopTime("transition");B=true})}if(has_panels&&!has_filmstrip){a(".nav-overlay").fadeIn("fast");a(".btn-next-big").fadeIn("fast");a(".btn-previous-big").fadeIn("fast")}}else{if(o.pause_on_hover){a(document).stopTime("animation_pause");if(B){a(document).everyTime(o.transition_interval,"transition",function(){t()});B=false}}if(has_panels&&!has_filmstrip){a(".nav-overlay").fadeOut("fast");a(".btn-next-big").fadeOut("fast");a(".btn-previous-big").fadeOut("fast")}}});l.eq(0).show();if(n>1){a(document).everyTime(o.transition_interval,"transition",function(){t()})}D.css("visibility","visible")})}	
	$.fn.galleryView.defaults = {
		panel_width: 900,
		panel_height: 360,
		frame_width: 60,
		frame_height: 40,
		filmstrip_size: 9,
		overlay_height: 70,
		overlay_font_size: '1em',
		transition_speed: 900,
		transition_interval: 4000,
		overlay_opacity: 0.6,
		overlay_color: 'black',
		background_color: 'transparent',
		overlay_text_color: 'white',
		caption_text_color: 'white',
		border: 'none',
		nav_theme: 'light',
		easing: 'swing',
		filmstrip_position: 'bottom',
		overlay_position: 'bottom',
		show_captions: false,
		fade_panels: true,
		pause_on_hover: true
	};
})(jQuery);

/* Twitter plugin: latest Tweets */
/* http://tweet.seaofclouds.com/*/
(function($) {
 
  $.fn.tweet = function(o){
    var s = {
      username: ["seaofclouds"],              // [string]   required, unless you want to display our tweets. :) it can be an array, just do ["username1","username2","etc"]
      list: null,                              //[string]   optional name of list belonging to username
      avatar_size: null,                      // [integer]  height and width of avatar if displayed (48px max)
      count: 3,                               // [integer]  how many tweets to display?
      intro_text: null,                       // [string]   do you want text BEFORE your your tweets?
      outro_text: null,                       // [string]   do you want text AFTER your tweets?
      join_text:  null,                       // [string]   optional text in between date and tweet, try setting to "auto"
      auto_join_text_default: "i said,",      // [string]   auto text for non verb: "i said" bullocks
      auto_join_text_ed: "i",                 // [string]   auto text for past tense: "i" surfed
      auto_join_text_ing: "i am",             // [string]   auto tense for present tense: "i was" surfing
      auto_join_text_reply: "i replied to",   // [string]   auto tense for replies: "i replied to" @someone "with"
      auto_join_text_url: "i was looking at", // [string]   auto tense for urls: "i was looking at" http:...
      loading_text: null,                     // [string]   optional loading text, displayed while tweets load
      query: null                             // [string]   optional search query
    };
if(o)$.extend(s,o);$.fn.extend({linkUrl:function(){var returning=[];var regexp=/((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi;this.each(function(){returning.push(this.replace(regexp,"<a href=\"$1\">$1</a>"))});return $(returning)},linkUser:function(){var returning=[];var regexp=/[\@]+([A-Za-z0-9-_]+)/gi;this.each(function(){returning.push(this.replace(regexp,"<a href=\"http://twitter.com/$1\">@$1</a>"))});return $(returning)},linkHash:function(){var returning=[];var regexp=/ [\#]+([A-Za-z0-9-_]+)/gi;this.each(function(){returning.push(this.replace(regexp,' <a href="http://search.twitter.com/search?q=&tag=$1&lang=all&from='+s.username.join("%2BOR%2B")+'">#$1</a>'))});return $(returning)},capAwesome:function(){var returning=[];this.each(function(){returning.push(this.replace(/\b(awesome)\b/gi,'<span class="awesome">$1</span>'))});return $(returning)},capEpic:function(){var returning=[];this.each(function(){returning.push(this.replace(/\b(epic)\b/gi,'<span class="epic">$1</span>'))});return $(returning)},makeHeart:function(){var returning=[];this.each(function(){returning.push(this.replace(/(&lt;)+[3]/gi,"<tt class='heart'>&#x2665;</tt>"))});return $(returning)}});function parse_date(date_str){return Date.parse(date_str.replace(/^([a-z]{3})( [a-z]{3} \d\d?)(.*)( \d{4})$/i,'$1,$2$4$3'))}function relative_time(time_value){var parsed_date=parse_date(time_value);var relative_to=(arguments.length>1)?arguments[1]:new Date();var delta=parseInt((relative_to.getTime()-parsed_date)/1000);var pluralize=function(singular,n){return''+n+' '+singular+(n==1?'':'s')};if(delta<60){return'less than a minute ago'}else if(delta<(60*60)){return'about '+pluralize("minute",parseInt(delta/60))+' ago'}else if(delta<(24*60*60)){return'about '+pluralize("hour",parseInt(delta/3600))+' ago'}else{return'about '+pluralize("day",parseInt(delta/86400))+' ago'}}function build_url(){var proto=('https:'==document.location.protocol?'https:':'http:');if(s.list){return proto+"//api.twitter.com/1/"+s.username[0]+"/lists/"+s.list+"/statuses.json?per_page="+s.count+"&callback=?"}else if(s.query==null&&s.username.length==1){return proto+'//api.twitter.com/1/statuses/user_timeline.json?screen_name='+s.username[0]+'&count='+s.count+'&callback=?'}else{var query=(s.query||'from:'+s.username.join(' OR from:'));return proto+'//search.twitter.com/search.json?&q='+escape(query)+'&rpp='+s.count+'&callback=?'}}return this.each(function(i,widget){var list=$('<ul class="tweet_list">').appendTo(widget);var intro='<p class="tweet_intro">'+s.intro_text+'</p>';var outro='<p class="tweet_outro">'+s.outro_text+'</p>';var loading=$('<p class="loading">'+s.loading_text+'</p>');if(typeof(s.username)=="string"){s.username=[s.username]}if(s.loading_text)$(widget).append(loading);$.getJSON(build_url(),function(data){if(s.loading_text)loading.remove();if(s.intro_text)list.before(intro);var tweets=(data.results||data);$.each(tweets,function(i,item){if(s.join_text=="auto"){if(item.text.match(/^(@([A-Za-z0-9-_]+)) .*/i)){var join_text=s.auto_join_text_reply}else if(item.text.match(/(^\w+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+) .*/i)){var join_text=s.auto_join_text_url}else if(item.text.match(/^((\w+ed)|just) .*/im)){var join_text=s.auto_join_text_ed}else if(item.text.match(/^(\w*ing) .*/i)){var join_text=s.auto_join_text_ing}else{var join_text=s.auto_join_text_default}}else{var join_text=s.join_text};var from_user=item.from_user||item.user.screen_name;var profile_image_url=item.profile_image_url||item.user.profile_image_url;var join_template='<span class="tweet_join"> '+join_text+' </span>';var join=((s.join_text)?join_template:' ');var avatar_template='<a class="tweet_avatar" href="http://twitter.com/'+from_user+'"><img src="'+profile_image_url+'" height="'+s.avatar_size+'" width="'+s.avatar_size+'" alt="'+from_user+'\'s avatar" title="'+from_user+'\'s avatar" border="0"/></a>';var avatar=(s.avatar_size?avatar_template:'');var date='<span class="tweet_time"><a href="http://twitter.com/'+from_user+'/statuses/'+item.id+'" title="view tweet on twitter">'+relative_time(item.created_at)+'</a></span>';var text='<span class="tweet_text">'+$([item.text]).linkUrl().linkUser().linkHash().makeHeart().capAwesome().capEpic()[0]+'</span>';list.append('<li>'+avatar+date+join+text+'</li>');list.children('li:first').addClass('tweet_first');list.children('li:odd').addClass('tweet_even');list.children('li:even').addClass('tweet_odd')});if(s.outro_text)list.after(outro);$(widget).trigger("loaded").trigger((tweets.length==0?"empty":"full"))})})};
})(jQuery);
