// **************************************************************************** \\
//				********								********				\\	
//				********			SLIDESHOW			********				\\
//				********			ver 1.0	 			********				\\
//				********								********				\\

var photosAll = new Array();				// Array of Photo Objects - all photos
var showTimer;								// Windows event timer
var currentPhoto = 0;						// Index of current photo
var xValue = 52;							// Default left most point of photo
var	yValue = 48;							// Default top most point of photo
var	xWidth = 200;							// Default width of photo					
var	yHeight = 175;							// Default height of photo
var	pauseTime = 5000;						// Default pause time per photo


function Photo(p, t) {						// Photo Object
	this.number = photosAll.length+1;		//		Integer - photo number
	if (arguments.length >= 3)				//
		this.width = arguments[2];			//
		else this.width = xWidth;			//		Integer - photo width	
	if (arguments.length >= 4)				//
		this.height = arguments[3];			//
		else this.height = yHeight;			//		Integer - photo height	
	this.path = p;							//		String - full pathname of photo image
	this.title = t;							//		String - photo title
	}

function initializeSlideshow() {
	buildPhotosArray();
	randomizePhotosArray();
	autoSlideshow();
	}

function autoSlideshow() {
	if (showTimer) window.clearTimeout(showTimer);
	if (currentPhoto >= photosAll.length) currentPhoto = 0;
	if (currentPhoto < 0) currentPhoto = photosAll.length-1;

	document.slideImg.src = photosAll[currentPhoto].path;
//	slideImg.width = photosAll[currentPhoto]].width;
//	slideImg.height = photosAll[currentPhoto]].height;
	if (photosAll[currentPhoto].title!="") {
		// Print photo title
		} 

	currentPhoto++;
	showTimer = window.setTimeout("autoSlideshow()", pauseTime);

	}

function randomizePhotosArray() {
	tempPhoto = new Photo("", "");
	for (i=0; i<photosAll.length; i++) {
		j=Math.round(Math.random()*photosAll.length-1);
		if (j<0) j=0;
		if (j>photosAll.length-1) j=photosAll.length-1;
		tempPhoto = photosAll[i];
		photosAll[i] = photosAll[j];
		photosAll[j] = tempPhoto;
		}
	}

function closeSlideshow() {
	if (showTimer) window.clearTimeout(showTimer);
	}

// *************************** ADD PHOTOS HERE ****************************** \\

function buildPhotosArray() {

//	photosAll.push(new Photo(
//		"path",					path of photo
//		"title",				caption of photo
//		width,					width of photo (optional)
//		height					height of photo (optional)
//		));

	photosAll.push(new Photo(
		"images/Race Track.jpg",
		"Saratoga Race Track",
		200, 164
		));

	photosAll.push(new Photo(
		"images/Country scene 1.jpg",
		"Saratoga Countryside",
		200, 132
		));
	
	photosAll.push(new Photo(
		"images/Waterfalls.jpg",
		"Saratoga Mineral Springs",
		200, 136
		));
	
	photosAll.push(new Photo(
		"images/ADK-Balloon-fest.jpg",
		"Balloon Fesival",
		166, 166
		));

	photosAll.push(new Photo(
		"images/BOATS-(5).jpg",
		"Steam Boat",
		168, 168
		));

	photosAll.push(new Photo(
		"images/BOATS-(12).jpg",
		"Parasail",
		168, 168
		));
	
	photosAll.push(new Photo(
		"images/Caroline_Street_from_Broadway.jpg",
		"Caroline Street",
		120, 90
		));	
	
	photosAll.push(new Photo(
		"images/Downtown_Saratoga_Springs_2.jpg",
		"Broadway",
		200, 150
		));	

	photosAll.push(new Photo(
		"images/Charter-fishing.jpg",
		"Charter Fishing",
		168, 168
		));	

	photosAll.push(new Photo(
		"images/GORE-KELLEY-(23).jpg",
		"Ski Gore",
		166, 166
		));	

	photosAll.push(new Photo(
		"images/HudsonRiver.jpg",
		"Rafting",
		158, 168
		));	

	photosAll.push(new Photo(
		"images/ICE-SKATING-(41).jpg",
		"Ice Skating",
		166, 166
		));	

	photosAll.push(new Photo(
		"images/Kayak-Fisherman.jpg",
		"Fishing in Kayak",
		168, 168
		));	

	photosAll.push(new Photo(
		"images/Kayak-Sunset.jpg",
		"Kayaking",
		166, 166
		));	

	photosAll.push(new Photo(
		"images/Lake_George_022.jpg",
		"Lake George",
		120, 90
		));	

	photosAll.push(new Photo(
		"images/Million-Dollar-Beach.jpg",
		"Sunning at the Beach",
		166, 166
		));	

	photosAll.push(new Photo(
		"images/OUTDOOR.jpg",
		"Camping",
		168, 168
		));	

	photosAll.push(new Photo(
		"images/Sabbath_Day_Point.jpg",
		"Sabbath Day Point",
		200, 133
		));	

	photosAll.push(new Photo(
		"images/WCT_389.jpg",
		"Sailing",
		166, 166
		));	

	photosAll.push(new Photo(
		"images/WCT_397.jpg",
		"Kayaks",
		168, 168
		));	

	photosAll.push(new Photo(
		"images/SPAC_2.JPG",
		"SPAC",
		200, 150
		));	

//	photosAll.push(new Photo(
//		"images/Yaddo Artists.gif",
//		"Yaddo Artists",
//		200, 176
//		));
	
	


//	photosAll.push(new Photo(
//		"images//.jpg",
//		"-title-",
//		w, h
//		));
//


	}	// End function buildPhotosArray()

