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 a',
		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 ){}
	});
	
	$('#com-screen').serialScroll({
		target:'#com-sections',
		items:'li',
		axis:'xy',
		navigation:'#com-navigation li a',
		duration:900,
		force: false,
		constant: false,
		lock:false,
		onBefore:function( e, elem, $pane, $items, pos ){
			e.preventDefault();
			if( this.blur )
				this.blur();
		},
		onAfter:function( elem ){}
	});
	$('#pr-screen').serialScroll({
		target:'#consult-sections',
		items:'li',
		axis:'xy',
		navigation:'#pr-consult li a',
		duration:900,
		force: false, 
		constant: false,
		lock:false,
		onBefore:function( e, elem, $pane, $items, pos ){
			e.preventDefault();
			if( this.blur ) 
			this.blur();
		},
		onAfter:function( elem ){}
	});
		
	$('.hometop2').serialScroll({
		//stop:true,
		//lock:false,
		cycle:true, //don't pull back once you reach the end
		jump: false, //click on the images to scroll to them
		items:'li',
		duration:1200,
		force:true,
		axis:'x',
		easing:'linear',
		lazy:true,// NOTE: it's set to true, meaning you can add/remove/reorder items and the changes are taken into account.
		interval:8000, // yeah! I now added auto-scrolling
		step:1 // scroll 2 news each time
	});


});
