$(document).ready(function() {

	/* ----- ONLOAD ----- */
	featureSlideshow();
	
	/* ----- EVENTS ----- */
	
	
	/* ----- FUNCTIONS ----- */
	function featureSlideshow() {
	
		var delay = 5000;
		var cycleSpeed = 900;
		var slides = $('#page-feature img').size();
		
		$('#page-feature img').each(function(i) {
			$(this).data('slide', i + 1);
		});
		
		setInterval(function() {
			$('#page-feature img:visible').fadeOut(cycleSpeed, function() {
				if($(this).data('slide') + 1 > slides) {
					$('#page-feature img').first().fadeIn(cycleSpeed);
				} else {
					$(this).next('img').fadeIn(cycleSpeed);
				}
			});
		}, delay);
	}

});
