<!--
	// Script Variables
	var imageFolderPath = "http://hospicehavasu.org/images/template/home/";
	var moreInfoFolderPath = "http://hospicehavasu.org/";
	var mainImageFileName = "option";
	var mainImageFileExt = ".png";
	var sideImageFileName = "optionLink";
	var sideImageFileExt = ".png";
	var moreInfoFileExt = ".html";
	var highlightColor = "#663300";
	var numImages = 5;
	var choosenImage = -1;
	var moreInfoFileName = new Array( "support", "volunteer", "hospice", "children", "giving");
	
	function ChangeChoosenImage(imgIndex)
	{
		// Local Variables
		var mainLink = document.getElementById('linkMain');
		var mainImage = document.getElementById('imgMain');
		var prevHighlightDiv = document.getElementById('divSideImage' + choosenImage);
		var nextHighlightDiv = document.getElementById('divSideImage' + imgIndex);
		
		// Change the chosen image to the selected image
		choosenImage = imgIndex;
		
		// Redisplay more info link and main image
		if(mainLink != null)
			mainLink.setAttribute("href", moreInfoFolderPath + moreInfoFileName[choosenImage-1] + moreInfoFileExt);
		if(mainImage != null)
			mainImage.setAttribute("src", imageFolderPath + mainImageFileName + choosenImage + mainImageFileExt);
			
		// Remove highlight from prev selected image
		if(prevHighlightDiv != null)
			prevHighlightDiv.removeAttribute("style");
			
		// Set hightlight for next selected image
		if(nextHighlightDiv != null)
			nextHighlightDiv.style.cssText = "background-color: " + highlightColor + ";";
	}
	function DisplayMainImage()
	{
		// Pick random image (if image isn't selected)
		if(choosenImage == -1)
			choosenImage = GenerateRandomNumber();
		
		
		// Start selected image link
		document.write('<a id="linkMain" href="' + moreInfoFolderPath + moreInfoFileName[choosenImage-1] + moreInfoFileExt + '">');
		
		// Write out selected image
		document.write('<img id="imgMain" src="' + imageFolderPath + mainImageFileName + choosenImage + mainImageFileExt + '" alt="It\'s About Living" style="border: none;" />');
		
		// End selected image link
		document.write('</a>');
	}
 	function DisplaySideImages()
	{
		// Display all of the side images
		for(var i = 1; i <= numImages; i++)
		{
			// Is this the currently displayed main image?
			if(i == choosenImage)
			{	// Yes
				// Start containing div with highlight background
				document.write('<div id="divSideImage' + i + '" class="' + sideImageFileName + i + '" style="background-color: ' + highlightColor + ';">');
			}
			else
			{	// No
				// Start containing div without highlight background
				document.write('<div id="divSideImage' + i + '" class="' + sideImageFileName + i + '">');
			}
			
			if(i == 5)
			{
				// Start donation link
				document.write('<a href="http://www.guidestar.org/partners/networkforgood/donate.jsp?ein=94-2836972" target="_blank">');
				
				// Write out current image
				document.write('<img src="' + imageFolderPath + sideImageFileName + i + sideImageFileExt + '" alt="It\'s About Living" onclick="ChangeChoosenImage(' + i + ');" style="border: solid 1px #330000; cursor: pointer;" />');
				
				// End donation link
				document.write('</a>');
			}
			else
			{
				// Write out current image
				document.write('<img src="' + imageFolderPath + sideImageFileName + i + sideImageFileExt + '" alt="It\'s About Living" onclick="ChangeChoosenImage(' + i + ');" style="cursor: pointer;" />');

			}
			
			// End containing div
			document.write('</div>');
		}
	}
	function GenerateRandomNumber()
	{
		// Return a random number between 1 and numImages
		return (Math.floor(Math.random() * numImages)) + 1;
	}
 // -->