// 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( $ ){

	$('#screen').serialScroll({
		target:'#sections',
		items:'.sub', // Selector to the items ( relative to the matched elements, '#sections' in this case )
		prev:'img.prev',// Selector to the 'prev' button (absolute!, meaning it's relative to the document)
		next:'img.next',// Selector to the 'next' button (absolute too)
		axis:'xy',// The default is 'y' scroll on both ways
		navigation:'#navigation li.home, #navigation li.studio, #navigation li.ref, #navigation li.cont',
		duration:700,// Length of the animation (if you scroll 2 axes and use queue, then each axis take half this time)
		force:false, // Force a scroll to the element specified by 'start' (some browsers don't reset on refreshes)
		constant:true, // constant speed

		onBefore:function( e, elem, $pane, $items, pos ){

			e.preventDefault();
			if( this.blur )
				this.blur();
		},
		onAfter:function( elem ){
			//'this' is the element being scrolled ($pane) not jqueryfied
		}
	});
		
	$('#screen-site').serialScroll({
		target:'#sections-site',
		items:'li.pages', // Selector to the items ( relative to the matched elements, '#sections' in this case )
		axis:'x',// The default is 'y' scroll on both ways
		prev:'img.prev-ref',// Selector to the 'prev' button (absolute!, meaning it's relative to the document)
		next:'img.next-ref',// Selector to the 'next' button (absolute too)
		duration:600,// Length of the animation (if you scroll 2 axes and use queue, then each axis take half this time)
		force: false, // Force a scroll to the element specified by 'start' (some browsers don't reset on refreshes)
		constant: false, // constant speed
		lock:false, // Ignore events if already animating (true by default)			
		onBefore:function( e, elem, $pane, $items, pos ){
			e.preventDefault();
			if( this.blur )
				this.blur();
		},
		onAfter:function( elem ){
			//'this' is the element being scrolled ($pane) not jqueryfied
		}
	});

});