//Script for rotating pictures Dennis Helwig 7/1/2011
//Pictures to rotate

var Rollpic1 = "images/other/coin.jpg";
var Rollpic2 = "images/other/display.jpg";
var Rollpic3 = "images/other/reader.jpg";
var Rollpic4 = "images/other/perkins.jpg";

//Start at the picture
var PicNumber=1;
//Number of pictures
var NumberOfPictures=4;
//Time between pictures in seconds
var HowLongBetweenPic=2;

//Switch Function
function SwitchPic(counter){

	if(counter < HowLongBetweenPic){
	
		counter++;
		
		//display info for status bar if necessary
		window.status="Switch picture at 5 : "+counter+" PicNumber: "+PicNumber+" ";
		
		//scroll through pictures
		document.roll.src = eval("Rollpic" + PicNumber);
		
		//function calls itself to loop
		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);
				}
	
		}

}
