jQuery(function( $ ){

			$('#slideshow').serialScroll({

				items:'li',

				prev:'#carousel a.prev',

				next:'#carousel a.next',

				axis:'x',

				offset:-540, //when scrolling to photo, stop 230 before reaching it (from the left)

				start:3, //as we are centering it, start at the 2nd

				duration:600,

				interval:4000,

				force:true,

				stop:false,

				lock:false,

				cycle:true, //don't pull back once you reach the end

				easing:'backout', //use this easing equation for a funny effect

				jump: false //click on the images to scroll to them

			});			

		});

		//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;
		};

		
		$.easing.backout = function(x, t, b, c, d){
			var s=1.70158;
			return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
		};
		
		$(function () {
        // find the div.fade elements and hook the hover event
        $('div.fade').hover(function() {
            // on hovering over find the element we want to fade *up*
            var fade = $('> div', this);

            // if the element is currently being animated (to fadeOut)...
            if (fade.is(':animated')) {
                // ...stop the current animation, and fade it to 1 from current position
                fade.stop().fadeTo(250, 1);
            } else {
                fade.fadeIn(250);
            }
        }, function () {
            var fade = $('> div', this);
            if (fade.is(':animated')) {
                fade.stop().fadeTo(2000, 0);
            } else {
                fade.fadeOut(2000);
            }
        });
    });