function initSlideShowImages(startImage,endImage,duration,transition,path){
	//initializes the slideshow.  
	
	//Input Variables:
	//startImage: first number in the sequence of images
	//endImage: last number in the sequence of images	
	//duration: period of time between transitions
	//transition: transition time
	//path: path to images

	imgCount = 1; //starting image
	imgIdCount = 1; //this will increment every time a new slide is created so that each new slide can have a unique id

	nextImg = document.createElement("img"); //create the image element that will be used for preloading the next image

	imageFiles = new Array(); //array of all the images files from start image to end image
	for(i=startImage; i <= endImage; i++){
		imageFiles[i] = path + i +'.jpg';
	}

	nextSlide(startImage,endImage,duration,transition,path);
	
}

function nextSlide(startImage,endImage,duration,transition,path){ 
	//preloads the next slide and executes changeSlide after the duration
	imgCount++;
	if (imgCount > endImage){ 
		imgCount = startImage; //loop
	}
	nextImg.setAttribute("src",imageFiles[imgCount]);

	setTimeout("changeSlide("+startImage+","+endImage+","+duration+","+transition+",'"+path+"')",duration*1000);
}

function changeSlide(startImage,endImage,duration,transition,path){

	imgIdCount++; 

	var currentImg = document.createElement("img"); //create the new image

	currentImg.style.display = 'none';
	currentImg.setAttribute("src",nextImg.src);

	currentImg.setAttribute("className","slideImg");
	currentImg.setAttribute("class","slideImg");
	currentImg.setAttribute("id","slideImg_"+imgIdCount);
	$('slideContainer').appendChild(currentImg);

	new Effect.Fade('slideImg_'+(imgIdCount-1),{duration:transition});
	new Effect.Appear('slideImg_'+imgIdCount,{duration:transition,afterFinish:function(){wait=false}});
	
	nextSlide(startImage,endImage,duration,transition,path);
	
}
