// 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($){
	
	/**
	 * The call below, is just to show that you are not restricted to prev/next buttons
	 * In this case, the plugin will react to a custom event on the container
	 * You can trigger the event from the outside.
	 */
	
	$('#infiniteslider').serialScroll({
		items:'li',
		duration:4000,
		cycle:true,
		force:true,
		axis:'x',
		easing:'linear',
		lazy:false,// NOTE: it's set to true, meaning you can add/remove/reorder items and the changes are taken into account.
		interval:1, // yeah! I now added auto-scrolling
		constant:false,
		step:1 // scroll 2 news each time
	});	

});

/*
*target The element to scroll, it's relative to the matched element.
If you don't specify this option, the scrolled element is the one you called serialScroll on.
*event on which event to react (click by default).
*start first element of the series (zero-based index, 0 by default).
*step how many elements to scroll each time. Use a negative number to go on the other way.
*lock if true(default), the plugin will ignore events if already animating. Then animations can't be queued.
*cycle if true, the first element will be shown after going over the last, and the other way around.
*stop if true, the plugin will stop any previous animations of the element, to avoid queuing.
*force if true, an initial scroll will be forced on start.
*jump if true, the specified event can be triggered on the items, and the container will scroll to them.
*items selector to the items(relative to the scrolled element).
*prev (optional)selector to the 'previous' button.
*next (optional)selector to the 'next' button.
*lazy if true, the items are collected each time, allowing dynamic content(AJAX, AHAH, jQuery manipulation, etc).
*interval If you specify a number, the plugin will add auto scrolling with that interval.
*constant Should the speed remain constant, no matter how many items we scroll at once ? (true by default).
*navigation Optionally, a selector to a group of elements, that allow scrolling to specific elements by index. Can be less than the amount of items.
*exclude If you want the plugin, to stop scrolling before the actual last element, set this to a number, and that amount of items is ignored counting from the end.
This is useful if you show many items simultaneously, in that case, you probably want to set this option to the amount of visible items - 1.
*onBefore A function to be called before each scrolling. It receives the following arguments: event object, targeted element, element to be scrolled, collection of items and position of the targeted element in the collection.
The scope(this) will point to the element that got the event. If the function returns false, the event is ignored.
*/
