/******** PROFILE SLIDER *******/
// 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( $ ){

/**
	 * No need to have only one element in view, you can use it for slideshows or similar.
	 * In this case, clicking the images, scrolls to them.
	 * No target in this case, so the selectors are absolute.
	 */
	$('#slideshow').serialScroll({
		items:'li',
		prev:'#profileslider a.prev',
		next:'#profileslider a.next',
		offset:-148, //when scrolling to photo, stop 230 before reaching it (from the left)
		start:1, //as we are centering it, start at the 2nd
		duration:1200,
		force:true,
		stop:true,
		lock:false,
		cycle:false, //don't pull back once you reach the end
		easing:'easeOutQuart', //use this easing equation for a funny effect
		exclude:4,
		jump: true //click on the images to scroll to them		
		
	});
});

$(document).ready(function() {
	$("#stafftext div:first").addClass("staffselected");
	$("#slideshow li").click(function() {
		$("#stafftext div").removeClass();
		$clicked = $(this);
		// each button div MUST have a "xx-button" and the target div must have an id "xx"
		var idToLoad = "staff-"+$clicked.attr("id");
		//alert(idToLoad);
		$("#stafftext").find("#"+idToLoad).addClass("staffselected");
	});
});

