/*!
 * Simplest jQuery Slideshow Plugin v1.0
 * @link http://github.com/mathiasbynens/Simplest-jQuery-Slideshow
 * @author Mathias Bynens <http://mathiasbynens.be/>
 */
$(document).ready(function() {
	// home page slideshow
	// hide all images except the first so they can fade in later
	$('#slide-left img:gt(0)').hide();
	$('#slide-center img:gt(0)').hide();
	$('#slide-right img:gt(0)').hide();
	
	// slides left will start automatically
	// call the other two slide areas with a timeout to create offset
	setTimeout(function() { centerSlides(); }, 2500);
	setTimeout(function() { rightSlides(); }, 1500);
	
	// slides left
    setInterval(function(){
		$('#slide-left :first-child').fadeOut('slow')
			.next('img').fadeIn('slow')
			.end().appendTo('#slide-left');}, 
			4000);
		
	// slides center
	function centerSlides() {
		setInterval(function(){
			$('#slide-center :first-child').fadeOut('slow')
				.next('img').fadeIn('slow')
				.end().appendTo('#slide-center');}, 
				4000);
	}
	
	// slides right
	function rightSlides() {
		setInterval(function(){
			$('#slide-right :first-child').fadeOut('slow')
				.next('img').fadeIn('slow')
				.end().appendTo('#slide-right');}, 
				4000);
	}
	
	// Standard page/post slide area
	$('#slides img:gt(0)').hide();
	setInterval(function(){
		$('#slides :first-child').fadeOut('slow')
			.next('img').fadeIn('slow')
			.end().appendTo('#slides');}, 
			4000);
	
});
