/*Around Concord Script*/
/*Slideshow Script */
/*Created by Ryan Frisch*/


//Slide Object
function slide(source, title, description)
{
this.source="images/slideshow/" + source;
this.caption=title + "<br /> &nbsp;&nbsp;" + description;
this.link = "subscriptions.aspx";
}

//Initialize instances of the Slide object
slide1 = new slide("tree.jpg", "The Mystique of Winter", "There is nothing quite like the tranquility of a winter day");
slide2 = new slide("wine.jpg", "Wine Watch", "A port for every storm");
slide3 = new slide("juniper-hill-inn.jpg", "The New England Living Show House", "Designers to transform Juniper Hill Inn");
slide4 = new slide("ski-museum.jpg", "New Enlgand Ski Museum", "Touched by Big Green luminaries");
slide5 = new slide("food-fun.jpg", "Food, Friendship, and Philanthropy", "Girls wanna have more than just fun");
slide6 = new slide("meal.jpg", "Merry & Bright", "Gather simple ingredients from around town for a dinner that is both");
slide7 = new slide("broadcasting.jpg", "Ken Cail", "A major-league talent broadcasts his love of sports");
slide8 = new slide("grand-canyon.jpg", "Travel Log", "What I did on my Summer vacation");
slide9 = new slide("cheers.jpg", "Local Flavors", "Local restaurant helps kids in need");


//Array of slide objects
var slides=new Array(slide1, slide2, slide3, slide4, slide5, slide6, slide7, slide8, slide9);   //Add or remove slides based on number of slides in array

//set duration for each image
var duration;
duration = 5;   //Seconds

//Sets number of images
var len;
len = slides.length;

//Initialize slideshow
var currentslide;
currentslide=0;

//Rotate slides
function changeSlide()
{
	
if (currentslide == len)
{
currentslide=0;
}

document.getElementById("changeImage").src=slides[currentslide].source;
document.getElementById("changeLink").href=slides[currentslide].link;
document.getElementById("changeCaption").innerHTML=slides[currentslide].caption;

currentslide = currentslide+1;

setTimeout("changeSlide()",duration*1000);
}

//Start slideshow
onload = function(){
changeSlide();
}