/*
 *	jsSlideshow2.js
 *
 *  Simple rotation script to change image src attribute
 *  using jQuery.
 *
 *  Dependencies:  jQuery
 */

(function($){
	$(document).ready(function() {
	
		var imgArray = ['imgWAStore.jpg',
			'imgMPStore.jpg',
			'imgKIStore.jpg'];
			
		var intervalSeconds = 4;
		var imgIndex = 0;
			
		function changeImg() {
		
			// $('#slideshow').fadeTo(500,0.1);
			if (imgIndex < imgArray.length-1) {
				imgIndex++;
			} else {
				imgIndex = 0;
			}
			$('#slideshow').attr('src', imgArray[imgIndex]);
			// $('#slideshow').fadeTo(500,1);

		}
		
		// Repeat at interval
		setInterval(changeImg, intervalSeconds * 1000);

	});
})(jQuery);

