// @author Brian W. Howell
$(document).ready(function(){
	//Delay & fade controls
	var delayFor = 5200; // How long is each photo displayed? In milliseconds
	var fadeFor = 800; // Control speed of fade out
	$('ul#slideshow li').css({'display' : 'none'}); // turn of all
	$('ul#slideshow li').first().css('display', 'list-item'); //make first li visible
	function nextLI() {
		$('ul#slideshow li.activeImg').fadeOut(fadeFor, function() { //fade out current li
			$(this).removeClass('activeImg').next().fadeIn(fadeFor).addClass('activeImg'); // remove it's class, select next, fade it in and add class
			if($(this).hasClass('lastli')) { //if the last li
				$(this).removeClass('activeImg');
				$('ul#slideshow li').first().fadeIn(fadeFor).addClass('activeImg'); //jump to beginning to ul
			};
		});		
	};
	var playInterval = setInterval(nextLI, delayFor); //initiate slideshow onload
});
