function Slideshow() {
	this.locked = false;
	this.container = $('div.features').get();
	this.features = [];
	this.index = 0;
	this.wait = 5000;
	this.autoChangeSpeed = 5000;
	this.animSpeed = 1000;
	this.interval;
	
	this.init = function() {
		this.features = $('.feature-story').get();
		
		for(var i = 0; i < this.features.length; i++)
		{
		    $('.feature-info-header', this.features[i]).css('top', (324/2) - ($('.feature-info-header', this.features[i]).height()/2) );
		}
		
		$('#prev-button').click( function(obj) { return function() { obj.prev(); } }(this) );
		$('#next-button').click( function(obj) { return function() { obj.next(); } }(this) );
		
		$(this.container).mouseover( function(obj) { return function() { obj.onMouseOver(); } }(this) );
		$(this.container).mouseout( function(obj) { return function() { obj.onMouseOut(); } }(this) );
		
		setTimeout( function(obj) { return function() { obj.start(); } }(this), this.wait);
	}
	
	this.onMouseOver = function() {
		this.locked = true;
		
		$('#prev-button').show();
		$('#next-button').show();
	}
	
	this.onMouseOut = function() {
		this.locked = false;
		
		$('#prev-button').hide();
		$('#next-button').hide();
	}
	
	this.prev = function(automated) {
		if( automated && this.locked )
			return;
		
		var nextIndex = this.index-1;
		if( nextIndex == -1 )
		{
			nextIndex = this.features.length-1;
		}
		
		$('#prev-button').css('top', '-342px');
		$('#next-button').css('top', '-342px');
		
		$(this.features[this.index]).animate({left:'960px'}, this.animSpeed);
		$('.feature-image', $(this.features[this.index])).animate({left:'0px'}, this.animSpeed);
		$('.feature-caption', $(this.features[this.index])).animate({left:'600px'}, this.animSpeed);
		
		$('.feature-caption', $(this.features[nextIndex])).css({left:'800px'});
		$(this.features[nextIndex]).css('left', '-960px');
		$('.feature-image', $(this.features[nextIndex])).css('left', '0px');
		$(this.features[nextIndex]).animate({left:'0px'}, this.animSpeed, function(obj) { return function() { obj.onAnimationComplete(); } }(this) );
		
		this.index = nextIndex;
	}
	
	this.next = function(automated) {
		if( automated && this.locked )
			return;
		
		var nextIndex = this.index+1;
		if( nextIndex == this.features.length )
		{
		    nextIndex = 0;
		}
		
		$('#prev-button').css('top', '-342px');
		$('#next-button').css('top', '-342px');
		
		$(this.features[this.index]).animate({left:'-960px'}, this.animSpeed);
		$('.feature-image', $(this.features[this.index])).animate({left:'360px'}, this.animSpeed);
		$('.feature-caption', $(this.features[this.index])).animate({left:'800px'}, this.animSpeed);
	
		$('.feature-caption', $(this.features[nextIndex])).css({left:'600px'});
		$(this.features[nextIndex]).css('left', '960px');
		$('.feature-image', $(this.features[nextIndex])).css('left', '0px');
		$(this.features[nextIndex]).animate({left:'0px'}, this.animSpeed, function(obj) { return function() { obj.onAnimationComplete(); } }(this) );
	
		this.index = nextIndex;
	}
	
	this.onAnimationComplete = function() {
		$('#prev-button').css('top', '0px');
		$('#next-button').css('top', '0px');
	}
	
	this.start = function() {
		this.interval = setInterval( function(obj) { return function() { obj.next(true); } }(this), this.autoChangeSpeed);
	}
	
	this.stop = function() {
		clearInterval( this.interval );
	}
	
	this.init();
}
