 <!--Javascript Slideshow Starts-->

window.onload=init;

var myDate = new Date();
var myYear = myDate.getFullYear();
	
//initialize all functions
function init()
{
	choosePic();
	choosePic2();
	initLinks();
}

//                                        //
// Begin code for testimonials slideshow. //
//                                        //
var adImages = new Array("images/slideshow/picture1.png","images/slideshow/picture2.png","images/slideshow/picture3.png","images/slideshow/picture4.png","images/slideshow/picture5.png","images/slideshow/picture6.png","images/slideshow/picture7.png","images/slideshow/picture8.png","images/slideshow/picture9.png","images/slideshow/picture10.png");
var thisAd = 0;

function choosePic( ) {
	thisAd = Math.floor((Math.random( ) * adImages.length));
	document.getElementById("slideshow").src = adImages[thisAd];
	rotate( );
}

function rotate( ) {
	thisAd++;
	if (thisAd == adImages.length) {
		thisAd = 0;
	}
	document.getElementById("slideshow").src = adImages[thisAd];

	setTimeout(rotate, 15 * 1000);
}

var myimages = new Array( );
var imgpath = "images/";

function preload( )
{
	if(document.images)
	{
		for (x=0; x<preload.arguments.length; x++)
		{
		  myimages[x] = new Image( );  
		  thisPic = imgpath + preload.arguments[x];  
		  myimages[x].src = thisPic;  
		}
	}
}

function rollover(thispic, imgfile)
{
 	var rollpic = imgpath + imgfile;  
	thispic.src = rollpic;  
}

//                                        //
// End code for testimonials slideshow.   //
//                                        //


//                                        //
// Begin code for flyers slideshow.       //
//                                        //

// To update flyers slideshow, alter the "var adImages2 = new Array" line of code.  //
// To add an image, just add an additional instance of "images/flyers/nameofflyer.jpg"  //
// To remove one, simply remove it from this line.  Make sure each one is seprated by a comma, with no comma after the final image. //
// If displaying only the default flyer, only flyer1.jpg should be listed.  //
// Just make sure that the names on this line match the names of the images in the images/flyers folder //
// var adImages2 = new Array("images/flyers/flyer1.jpg","images/flyers/flyer2.jpg","images/flyers/flyer3.jpg","images/flyers/flyer4.jpg");
var adImages2 = new Array("images/flyers/flyer1.jpg","images/flyers/flyer3.jpg","images/flyers/flyer4.jpg");
var thisAd2 = 0;

function choosePic2( ) {
	thisAd2 = Math.floor((Math.random( ) * adImages2.length));
	document.getElementById("flyer").src = adImages2[thisAd2];

	rotate2( );
}

function rotate2( ) {
	thisAd2++;
	if (thisAd2 == adImages2.length) {
		thisAd2 = 0;
	}
	document.getElementById("flyer").src = adImages2[thisAd2];
	document.getElementById("flyerlink").href = document.getElementById("flyer").src;
	setTimeout(rotate2, 15 * 1000);
}

var myimages2 = new Array( );
var imgpath2 = "images/";
function preload2( )
{
	if(document.images)
	{
		for (x=0; x<preload2.arguments.length; x++)
		{
		  myimages2[x] = new Image( );  
		  thisPic2 = imgpath2 + preload2.arguments[x];  
		  myimages2[x].src = thisPic2;  
		}
	}
}

function rollover2(thispic2, imgfile2)
{
 	var rollpic2 = imgpath2 + imgfile2;  
	thispic2.src = rollpic2;  
}
//                                        //
// End code for flyers slideshow.         //
//                                        //
