/*

MINISTRY HIGHLIGHTS SLIDESHOW

*/

/**** Set Custom Variables Here ****/

////////////////////////////////////////////////
//                                            //
//               PHOTO DIRECTORY              //
//                                            //
//   Set the directory which your slideshow   //
//   images are stored in. Make sure to       // 
//   include the ending '/' character         //
//                                            //
//   ex: my_pictures/slideshow/               //
//                                            //
       var imageDir = "images/slideshow/";
//                                            //
////////////////////////////////////////////////


var totalHighlights = 3;

var interval = 10000;

/**** End Custom User Variables ****/

var img;
var timer;
var currentImageIndex = 1;
var imageArray = new Array();
var titleArray = new Array();
var descriptionArray = new Array();

img = new Image();
img.src = imageDir + "01.jpg";
imageArray[1] = img;
titleArray[1] = "New Events Added";
descriptionArray[1] = "Check out the events page for fun and exciting events that are happening soon!";

img = new Image();
img.src = imageDir + "02.jpg";
imageArray[2] = img;
titleArray[2] = "New Events Added";
descriptionArray[2] = "Check out the events page for fun and exciting events that are happening soon!";

img = new Image();
img.src = imageDir + "03.jpg";
imageArray[3] = img;
titleArray[3] = "New Events Added";
descriptionArray[3] = "Check out the events page for fun and exciting events that are happening soon!";


function getHighlight(num)
{
	currentImageIndex = (num - 1) % totalHighlights;
	
	document['slideImg'].src = imageArray[currentImageIndex + 1].src;
	document.getElementById('slideshowTitle').innerHTML = titleArray[currentImageIndex + 1];
	document.getElementById('slideshowBody').innerHTML = descriptionArray[currentImageIndex + 1];
	clearTimeout(timer);
	timer = setTimeout("slideshow()", interval);
}

function slideshow()
{
	currentImageIndex = ((currentImageIndex + 1) % totalHighlights) + 1;
	getHighlight(currentImageIndex);
}