//script that allows images to be scrolled through repetitively
var Slides = new Array('images/testimonials/testimonial1.gif', 'images/testimonials/testimonial2.gif');
var Slide1=0;
//makes the image a string
function CacheImage(ImageSource)
{
	var ImageObject = new Image();
	ImageObject.src = ImageSource;
	return ImageObject;
}
//clicking scroll buttons calls this function
//function moves images through slideshow
function ShowSlide(Direction)
{
	if(SlideReady)
	{
		//sets slide 1 direction taken from scroll button clicked
		Slide1 = Slide1 + Direction;
		//sets slide one to be the last slide if back scroll button clicked and slide 1 is the 1st image
		if (Slide1 < 0)
		{
			Slide1 = Slides.length -1;
		}
		//sets slide one to be the first slide if next scroll button clicked and slide 1 is the last image
		if (Slide1 >= Slides.length)
		{
			Slide1 = 0;
		}
		//sets images from array to be placed at document.images.etc
		document.images['Testimonials1'].src = Slides[Slide1].src;
	}
}
//called onload function creates array with slides in
//sets slide 1 and sets SlideReady as true
function StartSlideShow()
{
	for (var n = 0; n < Slides.length; n++)
	{
		Slides[n] = CacheImage(Slides[n]);
	}
		SlideReady = true;
		ShowSlide(0);
}

