/* Venture Brands Scroller */

//easing equation, borrowed from jQuery easing plugin
//http://gsgd.co.uk/sandbox/jquery/easing/
$.easing.easeOutQuart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};

jQuery(function( $ ){

	$('#logoBox').serialScroll({
		items:'li',
		prev:'#ventureBrands a.prev',
		next:'#ventureBrands a.next',
		axis:'x',
		offset:-176, //when scrolling to photo, stop 176 before reaching it (from the left)
		start:1, //as we are centering it, start at the 2nd
		event:'click',
		interval:5000,
		force:true,
		stop:false,
		lock:false,
		exclude:3,
		cycle:true, //don't pull back once you reach the end
		easing:'easeOutQuart', //use this easing equation for a funny effect
		jump: false, //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();
		},
		onAfter:function( elem ){
			//'this' is the element being scrolled ($pane) not jqueryfied
		}
	});

});