// JavaScript Document
	var Images = 12;
	var Height = 380;
	var Width = 623;
	var WaitInterval = 2000; //Change me to change the time it takes to swap images. (time is in milliseconds
	var CurrentImage = 1;
	var BlurTimer;	
	var BlurCounter = 100; 
	var BlurLength = 10;  //Change the time it takes to blur the fade the images. (int stands for how many times to cycle each x milliseconds)
	var Swap = 1;
	var FirstRun = true;
	var PicArray = new Array();
	var Season;
	
	/* Code for changing the date object. If the date is between 4/11 and 6/18 it will change to the spring hours */
	/* Make not that January is 0 so subtract one from the month's number to ensure it's the right date i.e. August is the 7th month not the 8th */
		if (month == 1 && day >= 16 || month == 2 || month == 3 || month == 4 || month == 5 && day <= 15) //Spring (2/16-6/15)
		Season = "Spring";
		
		else if (month == 5 && day >= 16 || month == 6 || month == 7 && day <= 15)	// Summer (6/16-8/15)	
		Season = "Summer";
		
		else if (month == 7 && day >= 16 || month == 8 || month == 9 || month == 10 && day <= 15)	// Fall (8/16-11/15)
		Season = "Fall";
		
		else if (month == 10 && day >= 16 || month == 11 && day <= 31)	// Christmas (11/16-12/31)	
		Season = "Christmas";	
				
		else if (month == 0 && day >= 1 || month == 1 && day <= 15)	// Winter (1/1-2/15)
		Season = "Winter";
			
	for (x = 1; x < Images + 1; x++)
	{
		PicArray[x] = new Image(Width,Height); 
		PicArray[x].src="Front_Page_Slideshow/" + Season + "/image-" + x + ".jpg";
	}
	/*--------------------------FIREFOX BUG FIX--------------------------*/
	if (navigator.userAgent.indexOf("Firefox") != -1) //Firefox bug fix
	{
		document.getElementById("Slideshow").style.overflow = "visible";
		document.getElementById("SlideshowImage1").style.top = -190 + "px";
		document.getElementById("SlideshowImage2").style.top = -190 + "px";
	}
	/*--------------------------FIREFOX BUG FIX--------------------------*/
	
	//Write the first image of the slideshow
	document.getElementById("SlideshowImage1").style.background = "url(Front_Page_Slideshow/" + Season + "/image-" + 1 + ".jpg)";
	
	setTimeout("Change();", WaitInterval);

function Change()
{
	if (CurrentImage == Images)
			CurrentImage = 0;
	if (Swap == 0 || FirstRun)
	{
		document.getElementById("SlideshowImage2").style.background = "url(Front_Page_Slideshow/" + Season + "/image-" + (CurrentImage + 1) + ".jpg)";		
	}
	else
	{
		document.getElementById("SlideshowImage1").style.background = "url(Front_Page_Slideshow/" + Season + "/image-" + (CurrentImage + 1) + ".jpg)";
	}
	CurrentImage++;
	Blur();
}
	
function Blur()
{	
	BlurTimer = setInterval("BlurMath()", BlurLength);	
}	
function BlurMath()
{
	for (x = 0; x < 2; x++)
	{
		if (Swap == 0 || FirstRun)
		{
			document.getElementById("SlideshowImage1").style.filter = "alpha(opacity=" + BlurCounter + ")";
			document.getElementById("SlideshowImage1").style.MozOpacity = BlurCounter/100;
			document.getElementById("SlideshowImage1").style.opacity = BlurCounter/100;
			
			
			
			document.getElementById("SlideshowImage2").style.visibility = "visible";
			document.getElementById("SlideshowImage2").style.filter = "alpha(opacity=" + (100 - BlurCounter) + ")";
			document.getElementById("SlideshowImage2").style.MozOpacity = (100 - BlurCounter)/100;
			document.getElementById("SlideshowImage2").style.opacity = (100 - BlurCounter)/100;
			
		}
		else
		{
			
			document.getElementById("SlideshowImage2").style.filter = "alpha(opacity=" + BlurCounter + ")";
			document.getElementById("SlideshowImage2").style.MozOpacity = BlurCounter/100;
			document.getElementById("SlideshowImage2").style.opacity = BlurCounter/100;
			
			
			document.getElementById("SlideshowImage1").style.visibility = "visible";
			document.getElementById("SlideshowImage1").style.filter = "alpha(opacity=" + (100 - BlurCounter) + ")";
			document.getElementById("SlideshowImage1").style.MozOpacity = (100 - BlurCounter)/100;
			document.getElementById("SlideshowImage1").style.opacity = (100 - BlurCounter)/100;
			
		}
	}
	if (BlurCounter == 0)
	{
		
		if (Swap == 0 || FirstRun)
		{
			document.getElementById("SlideshowImage1").style.visibility = "hidden";
			Swap = 1;
			
			FirstRun = false;
		}
		else
		{
			document.getElementById("SlideshowImage2").style.visibility = "hidden";
			Swap = 0;
		}
		
		BlurCounter = 100;
		clearInterval(BlurTimer);
		setTimeout("Change();", WaitInterval);
	}
	else
	{
		BlurCounter--;
	}
}
