// 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;
};
$.easing.elasout = function (x, t, b, c, d) {
	var s=1.70158;var p=0;var a=c;
	if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
	if (a < Math.abs(c)) { a=c; var s=p/4; }
	else var s = p/(2*Math.PI) * Math.asin (c/a);
	return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
};

jQuery(function( $ ){
	$('#scroller').serialScroll({
		target:'#scrollItems',
		items:'li', // Selector to the items ( relative to the matched elements, '#sections' in this case )
		prev:'img.prevslide',// Selector to the 'prev' button (absolute!, meaning it's relative to the document)
		next:'img.nextslide',// Selector to the 'next' button (absolute too)
		axis:'x',// The default is 'y' scroll on both ways
		duration:500,// Length of the animation (if you scroll 2 axes and use queue, then each axis take half this time)
		force:true, // Force a scroll to the element specified by 'start' (some browsers don't reset on refreshes)
		cycle:true, // Cycle endlessly ( constant velocity, true is the default )
		step:1, // How many items to scroll each time ( 1 is the default, no need to specify )
		constant:false // constant speed
	});
	
	$('#scroller2').serialScroll({
		target:'#scrollItems2',
		items:'a', // Selector to the items ( relative to the matched elements, '#sections' in this case )
		prev:'img.prevslide',// Selector to the 'prev' button (absolute!, meaning it's relative to the document)
		next:'img.nextslide',// Selector to the 'next' button (absolute too)
		axis:'x',// The default is 'y' scroll on both ways
		duration:500,// Length of the animation (if you scroll 2 axes and use queue, then each axis take half this time)
		interval:5000, // It's the number of milliseconds to automatically go to the next
		force:true, // Force a scroll to the element specified by 'start' (some browsers don't reset on refreshes)
		cycle:true, // Cycle endlessly ( constant velocity, true is the default )
		step:1, // How many items to scroll each time ( 1 is the default, no need to specify )
		constant:false, // constant speed
	});
});

