//function to open a window
function newSlideshow(theURL,winName,features)
{
	window.open(theURL,winName,'resizable=yes,width=545,height=500');
}

//preload function
function preLoad()
{
	// make an image object variable
	//loop through array of images and preLoad each
	for (var i=0; i < imgNum;i++)
	{
		imageArray[i] = new Image();
		imageArray[i].src = "image" + i + ".jpg";
		
	}
	document.getElementById("imgNum").innerHTML = "Image 1 of " + imgNum
	document.getElementById("caption").innerHTML = imageCaption[0]
}


function preLoadHome()

{
	var homeArray = new array("../../images/collage.jpg")
}

//function to move forward in the slideshow
function nextImage()
{
	//test counter
	if (counter < imgNum - 1)
	{
		//add one to counter if not to end of array
		counter++;
	}
	else
	{
		//reset counter
		counter = 0;
	}

	//show an image from the array.
	var imgName = "image" + counter + ".jpg";
	document.slide.src = imgName
	var imgCount = counter + 1
	document.getElementById("caption").innerHTML = imageCaption[counter]
	document.getElementById("imgNum").innerHTML = "Image " + imgCount + " of " + imgNum
	
}

//function to move back in the slideshow
function prevImage()
{
	//test counter
	if (counter > 0)
	{
		//subtract one from counter if not 0
		counter--;
	}
	else
	{
		//subtract one from the length of the array
		counter = imgNum - 1;
	}
	{
	//show an image from the array.
	var imgName = "image" + counter + ".jpg";
	document.slide.src = imgName
	var imgCount = counter + 1
	document.getElementById("caption").innerHTML = imageCaption[counter]
	document.getElementById("imgNum").innerHTML = "Image " + imgCount + " of " + imgNum
	}
}

//ROLLOVER
	
	function Rollover(imageID,Hover){
	
	document.getElementById(imageID).src = Hover
	
	}
	
//SHOW PHOTO

function showPhoto(imageID,imageNum){

	document.getElementById(imageID).src = "images/" + imageID + "/image" + imageNum + ".jpg"
}

function guestComments() {
{
		//holly, pendant, holly bag, key west bag, lamps	
		var aryComments = new Array(
			"We had such a lovely time in your new home!  Pat, your special touches and efforts make such an inviting place to stay.",
			"Thank you for the incredible experience at Montfaucon.  We will never forget our happy week there.",
			"Thank you so much for giving us the best vacation ever.  We could not have asked for better scenery, activities, food, drink and company.",
			"Our room overlooking the Aude was a wonderful home away from home.",
			"Montfaucon is just beautiful.",
			"We will always remember our two weeks at Montfaucon as some of the best times of our life.  You and your staff were so gracious and so fun.",
			"We can't stop thinking about the whole experience.",
"Everything was so perfect. It's not far from heaven.",
"The only thing wrong with this place and country is that we don't live here permanently. Our week was more than wonderful.The food was more than wonderful; the tours were amazing. The countryside was more than we expected and our hosts were great!" ,
"Fantastic accommodation, great food, awesome riding!",
"Incredible 2 weeks! Vive Montfaucon et Blanquette!" 

		);
		
		var aryAttribute = new Array(
			"Pat and Ted",
			"Hanna and Maire",
			"Jill and Charles",
			"Rob and Sue",
			"Sharron",
			"Kathy and John",
			"Daphne and Ken",
			"Father Cyril O'Sullivan",
			"Sue and Marco Torres", 
			"Steve Hand",
			"Ed and Dana Haverlah"
		);
		
		
		
		var ranNum= Math.round(Math.random()*6);
	  	document.getElementById("quotation").innerHTML = "&quot;" + aryComments[ranNum] + "&quot;";
		document.getElementById("attribute").innerHTML = "&mdash;&nbsp;" + aryAttribute[ranNum];
	}
}



//function to move forward in the slideshow
function nextImageSpecial(folder)
{
	//test counter
	if (counter < imgNum - 1)
	{
		//add one to counter if not to end of array
		counter++;
	}
	else
	{
		//reset counter
		counter = 0;
	}

	//show an image from the array.
	var imgName = folder + "/image" + counter + ".jpg";
	document.slide.src = imgName
	var imgCount = counter + 1
	document.getElementById("caption").innerHTML = imageCaption[counter]
	document.getElementById("imgNum").innerHTML = "Image " + imgCount + " of " + imgNum
	
}

//function to move back in the slideshow
function prevImageSpecial(folder)
{
	//test counter
	if (counter > 0)
	{
		//subtract one from counter if not 0
		counter--;
	}
	else
	{
		//subtract one from the length of the array
		counter = imgNum - 1;
	}
	{
	//show an image from the array.
	var imgName = folder + "/image" + counter + ".jpg";
	document.slide.src = imgName
	var imgCount = counter + 1
	document.getElementById("caption").innerHTML = imageCaption[counter]
	document.getElementById("imgNum").innerHTML = "Image " + imgCount + " of " + imgNum
	}
}


//preload function
function preLoadSpecial(folder)
{
	// make an image object variable
	//loop through array of images and preLoad each
	for (var i=0; i < imgNum;i++)
	{
		imageArray[i] = new Image();
		imageArray[i].src = folder + "/image" + i + ".jpg";
		
	}
	document.getElementById("imgNum").innerHTML = "Image 1 of " + imgNum
	document.getElementById("caption").innerHTML = imageCaption[0]
}

