/**
 *  javascript rotating pics
 */

var Rollpic1 = "_img/northreading_hp.jpg";
var Rollpic2 = "_img/hooksett_hp.jpg";
var Rollpic3 = "_img/kingston_hp.jpg";
//Start at the what pic:
var PicNumber=1;
//Number of pics:
var NumberOfPictures=3;
//Time between pics switching in secs
var HowLongBetweenPic=.25;
//SwitchPic Function
function SwitchPhotos(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("SwitchPhotos("+counter+")",3000); 
		}else{
			//if its not the last picture goto the next picture
			if(PicNumber < NumberOfPictures){
				PicNumber++;
				SwitchPhotos(0);
			}
			//its the last picture go to the first one
			else{
				PicNumber=1;
				SwitchPhotos(0);
				}
		}
}
