		var fileList = new Array();
		var swapperTimer, opacityTimer, swapperIndex = -1, timerTurnedOn = 1, ajaxSwapperHandler;
		var lastURL;

		function prePopulateArray(passableArray) { fileList = passableArray; triggerTimer(); }
		function showNav() { return; $("navigation").style.display="inline"; }
		function hideNav() { return; $("navigation").style.display="none"; }
		function swapContents(newFileNum) 
		{ 
			swapperIndex = newFileNum;
			var myFileName = fileList[newFileNum][0].substr(fileList[newFileNum][0].lastIndexOf(".")+1,fileList[newFileNum][0].length);

			lastURL = fileList[newFileNum][0];

			$("slideshowimg").src = "http://www.downhomelife.com/images/submissions/"+fileList[newFileNum][0];
		
			var pCString = "";
			if(newFileNum>0)
			{
				pCString = '<a href="#" onClick="javascript:swapContents('+(newFileNum-1)+');return false;">&lt;</a>&nbsp;&nbsp;';
			}
			pCString += "Photo "+(swapperIndex+1)+"/"+fileList.length;
			if(newFileNum<fileList.length)
			{
				pCString += '&nbsp;&nbsp;<a href="#" onClick="javascript:swapContents('+(newFileNum+1)+');return false;">&gt;</a>';
			}
			
			$("photoCounter").innerHTML = pCString;
			
			triggerTimer();
		}

		function triggerTimer()
		{
			if(!timerTurnedOn) return;
			if(swapperTimer) clearTimeout(swapperTimer);
			swapperTimer = setTimeout("swapNext()",6000);
		}

		function swapNext()
		{
			swapperIndex++;
			if(swapperIndex>=fileList.length) swapperIndex=0;
			flashIn(); //swapContents(swapperIndex);
			triggerTimer();
		}

		function swapPausePlay()
		{
			if(timerTurnedOn)
			{
				clearTimeout(swapperTimer);
				timerTurnedOn = 0;
				$("pausetext").innerHTML="play slideshow";
			}
			else
			{
				timerTurnedOn = 1;
				swapNext();
				$("pausetext").innerHTML="pause slideshow";
			}
		}

		function flashIn(opacityDegree)
		{
			var objStyle = $("whiteLayer").style;
			if(objStyle.display=="none")
			{
				objStyle.display="block";
				//$("load_indicator").style.display="inline";
				objStyle.opacity = 0;
				objStyle.MozOpacity = 0;
				objStyle.KhtmlOpacity = 0;
				objStyle.filter = "alpha(opacity=0)";
				continueSwapping = 1;
				flashIn(1);
			}
			else
			{
				opacityDegree+=3;
				if(opacityDegree<100)
				{
					objStyle.opacity = (opacityDegree/100);
					objStyle.MozOpacity = (opacityDegree/100);
					objStyle.KhtmlOpacity = (opacityDegree/100);
					objStyle.filter = "alpha(opacity="+opacityDegree+")";

					if(opacityTimer) clearTimeout(opacityTimer);
					opacityTimer = setTimeout("flashIn("+opacityDegree+")",1);
				}
				else
				{
					swapContents(swapperIndex);
					flashOut(100);
				}
			}
		}

		function flashOut(opacityDegree)
		{
			var objStyle = $("whiteLayer").style;

			opacityDegree-=3;
			if(opacityDegree>0)
			{
				objStyle.opacity = (opacityDegree/100);
				objStyle.MozOpacity = (opacityDegree/100);
				objStyle.KhtmlOpacity = (opacityDegree/100);
				objStyle.filter = "alpha(opacity="+opacityDegree+")";

				if(opacityTimer) clearTimeout(opacityTimer);
				opacityTimer = setTimeout("flashOut("+opacityDegree+")",1);
			}
			else
			{
				objStyle.display="none";
				//$("load_indicator").style.display="none";
			}
		}
