// Easing equation, borrowed from jQuery easing plugin
// http://gsgd.co.uk/sandbox/jquery/easing/
jQuery.easing.easeOutQuart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};


jQuery(function( $ ){
	
	$('#gallery').serialScroll({
		items:'li',
		prev:'#recent-projects a.prev',
		next:'#recent-projects a.next',
		navigation: '#gallery-nav li a',
		offset:0, //when scrolling to photo, stop 230 before reaching it (from the left)
		start:0, //as we are centering it, start at the 2nd
		duration:800,
		force:true,
		stop:true,
		constant:true,
		lock:false,
		cycle:true, //don't pull back once you reach the end
		easing:'easeOutQuart', //use this easing equation for a funny effect
		jump: true, //click on the images to scroll to them
		
		onBefore:function( e, elem, $pane, $items, pos ){
			/**
			 * 'this' is the triggered element 
			 * e is the event object
			 * elem is the element we'll be scrolling to
			 * $pane is the element being scrolled
			 * $items is the items collection at this moment
			 * pos is the position of elem in the collection
			 * if it returns false, the event will be ignored
			 */
			 //those arguments with a $ are jqueryfied, elem isn't.
			e.preventDefault();
			if( this.blur )
				this.blur();
			/*$($items).fadeTo('fast',0.8);
			$(elem).fadeTo('fast',1);*/
		},
		onAfter:function( elem ){
			/*$(elem).css('opacity',1);*/
		}

		
	});
	
});

$(document).ready(function() {
	$("#twitter").getTwitter({
		userName: "delaphi",
		numTweets: 3,
		loaderText: "Loading tweets...",
		slideIn: true,
		slideDuration: 750,
		showHeading: true,
		headingText: "Latest Tweets",
		showProfileLink: false,
		showTimestamp: true
	});
});