// SIMPLE IMAGE ROTATOR
// This example is optimised for PNGs with transparency and can rotate through 2 to an infinate amount of pictures.
// Code under the setInterval function can be deleted if images are JPEGs or images without transparency
// Copyright Clint Milner - Twitter: clint_milner

$(function() {
		setInterval("rotateImages()", 3500);
			   
		var clearPic = $("#photoShow div");
		clearPic.animate({opacity:0.0},0);
		var showInit = $("#photoShow div.current");
		showInit.animate({opacity:1.0},500);
		});
	
			function rotateImages() {
				var curPhoto = $("#photoShow div.current");
				
				var nextPhoto = curPhoto.next();
				
				if (nextPhoto.length == 0)
					nextPhoto = $("#photoShow div:first");
					
				curPhoto.removeClass("current").addClass("previous").animate({opacity:0.0},1000);
				nextPhoto.css({opacity:0.0}).addClass("current").animate({opacity:1.0}, 1000, 
																		 function() {
																			 curPhoto.removeClass("previous");
																			 });
			}