/********************************************************************************************************************/
/* SlideShow Generator 																								*/
/* Created by Chuck Terry  																							*/
/* From http://www.draac.com/picture-roll.html																		*/
/********************************************************************************************************************/

//Pictures to switch inbetween
// Make Images 600x400 - Chuck T.
 var Rollpic1 = "images/slideshow/01.jpg";
 var Rollpic2 = "images/slideshow/02.jpg";
 var Rollpic3 = "images/slideshow/03.jpg";
 var Rollpic4 = "images/slideshow/04.jpg";
 var Rollpic5 = "images/slideshow/05.jpg";
 var Rollpic6 = "images/slideshow/06.jpg";
 var Rollpic7 = "images/slideshow/07.jpg";
 var Rollpic8 = "images/slideshow/08.jpg";
 var Rollpic9 = "images/slideshow/09.jpg";
var Rollpic10 = "images/slideshow/10.jpg";
var Rollpic11 = "images/slideshow/11.jpg";
var Rollpic12 = "images/slideshow/12.jpg";
var Rollpic13 = "images/slideshow/13.jpg";
var Rollpic14 = "images/slideshow/14.jpg";

//Start at the what pic:
var PicNumber=1;
//Number of pics:
var NumberOfPictures=14;
//Time between pics switching in secs
var HowLongBetweenPic=3;

//SwitchPic Function
function SwitchPic(counter){

	if(counter < HowLongBetweenPic){
	
		counter++;
		
		//DEBUG in the status bar at the bottom of the screen
//		window.status="Switch picture at 5 : "+counter+" PicNumber: "+PicNumber+" ";
		
		//Display pic in what <IMG> tag roll is what I called the image
		document.roll.src = eval("Rollpic" + PicNumber);
		
		//function calls itself
		CallSwitchPic=window.setTimeout("SwitchPic("+counter+")",1500); 
		
		}
		
		else{
			//if its not the last picture goto the next picture
			if(PicNumber < NumberOfPictures){
				PicNumber++;
				SwitchPic(0);
			}
			//its the last picture go to the first one
			else{
				PicNumber=1;
				SwitchPic(0);
				}
	
		}

}
