function imageTransition(slideshowElement, currentImage, makeRandom){
	var slideshowImages = slideshowElement.getElements('img');
	
	if(makeRandom == "true"){
		nextImage = $random(0,slideshowImages.length - 1)
	}
	else if(currentImage < (slideshowImages.length - 1)){
		var nextImage = currentImage + 1;
	}else{
		var nextImage = 0;
	}	
	slideshowImages.each(function(thisImage){
		thisImage.setStyles({ display: 'block'});
		if(thisImage.get('src') == slideshowImages[currentImage].get('src')){
			fadeIn(thisImage);
		}else{
			fadeOut(thisImage);
		}
		
	})
	currentImageNum = nextImage;
	imageTransition.delay(3000,this,[slideshowElement, currentImageNum, makeRandom]);
}
function fadeOut (thisImage)
	{
		new Fx.Tween(thisImage,  {duration: 700}).start('opacity',0);	
	};
	
function fadeIn (thisImage)
	{		
		new Fx.Tween(thisImage, {duration: 700}).start('opacity',1);	
	};