/*
	Make sure that <body onload="start_slideshow();"> appears on every page that you want the slideshow to occur.
	This calls the start_slideshow function which is explained in the script comments.
	
	WHAT TO CHANGE WHEN UPDATING THIS SCRIPT:
	1. If you changed the ID names for the div tags that contain the images, those changes need to be added
		in the slides array.
	2. If you have a fewer or greater amount of images, you need to change the statement if (i == 5) i = 0 to however
		many images you now have. There should also be fewer or greater ID names in the slides array.
	3. To have each image displayed for a longer or shorter amount of time, change the amount of the wait
		variable. This number is in milliseconds: 5 secs = 5000 msecs
	4. To change the speed of the transition between images, change the duration found in both the Effect.Fade
		and the Effect.Appear functions. This number needs to be the same in both functions for a proper fade.
		
	The original file and instructions for this script can be found at:
	http://srinix.wordpress.com/2007/05/02/tutorial-how-to-make-scriptaculous-based-slideshow/
	
	IMPORTANT
	This script uses the scriptaculous javascript library. Effect.Appear and Effect.Fade are two functions that are
	a part of this particular library. The 3 files found in the scripts folder called effects.js, prototype.js, and 
	scriptaculous.js are required to make this script work. If for some reason these 3 files are removed from this 
	folder, they can be downloaded at: http://script.aculo.us/downloads
*/

var images= new Array('rha1', 'rha2', 'rha3', 'rha4', 'rha5'); // create an array using the div IDs
var i = 0; // slide number
var wait = 5000; // amount of time (milliseconds) to display an image

// actual workings of the slideshow; what images to change, how long to change, and loops the slideshow
function SlideShow() {
	Effect.Fade(images[i], { duration:1.5, from:1.0, to:0.0 }); // fade out current image, takes 1.5 seconds
	
	i++; // increase the slide number
	
 	if (i == 5) i = 0; // when the end of the slide show is reached, go back to the first slide (loops the slideshow)
	
	Effect.Appear(images[i], { duration:1.5, from:0.0, to:1.0 }); // fade in next image, takes 1.5 seconds
 } 

// calls the function SlideShow() after the specified wait time has elapsed
function start_slideshow() { 
	setInterval('SlideShow()',wait); 
}
