	var fileList = new Array();
	var swapperTimer, opacityTimer, swapperIndex = 0, timerTurnedOn = 1, ajaxSwapperHandler;
	var lastURL;
	var panelDelay = 8000; // MILISECONDS; 8000 = 8 seconds.
	var firstPanelBonusDelay = 4000; // MILITSECONDS; 4000 = 4 seconds.

	function prePopulateArray(passableArray) { fileList = passableArray; setupSwapContents(0); }
	function showNav() { return; $("navigation").style.display="inline"; }
	function hideNav() { return; $("navigation").style.display="none"; }

	function swapWrapper()
	{
		firstPanelBonusDelay=0;
		swapperIndex++;
		if(swapperIndex>=fileList.length) swapperIndex=0;
		swapContents(swapperIndex);	
	}

	function setupSwapContents(newFileNum) 
	{ 
		swapperIndex = newFileNum;
		var myFileName = fileList[newFileNum][0].substr(fileList[newFileNum][0].lastIndexOf(".")+1,fileList[newFileNum][0].length);
		ajaxSwapperHandler = initAjaxMessage();
		lastURL = fileList[newFileNum][0];
		sendAjaxMessage("GET","widgets/main/panels/"+fileList[newFileNum][0],imperativeHTMLPopin,ajaxSwapperHandler);
	}

	function swapContents(newFileNum) 
	{ 
		swapperIndex = newFileNum;
		var myFileName = fileList[newFileNum][0].substr(fileList[newFileNum][0].lastIndexOf(".")+1,fileList[newFileNum][0].length);
		ajaxSwapperHandler = initAjaxMessage();
		lastURL = fileList[newFileNum][0];
		sendAjaxMessage("GET","widgets/main/panels/"+fileList[newFileNum][0],displayHTMLPopin,ajaxSwapperHandler);
	}

	function imperativeHTMLPopin() { HTMLPopin(1); }
	function displayHTMLPopin() { HTMLPopin(0); }

	function HTMLPopin(imperative)
	{
		if(ajaxSwapperHandler.readyState==4)
		{
		if(ajaxSwapperHandler.status==200)
		{
			$("whiteLayer").innerHTML = ajaxSwapperHandler.responseText;
			if(lastURL=="main1-snowblower.php"||lastURL=="main1-20th-winner.php"||lastURL=="main1-top12.php") 
			{ 
				$("navigation").style.display="none";
				$("navigation_sublayer").style.display="none";
			}
			else
			{
				$("navigation").style.display="inline";
				$("navigation_sublayer").style.display="inline";
			}
			//$("navigationBox").style.border = "1px solid black";
			if(!imperative) blendIn(0);
			else blendIn(100);
		}
		}
	}

	function setOp(opV)
	{
		var nopV = opV/100;

		$("whiteLayer").style.display="block";
		$("whiteLayer").style.opacity = nopV;
		$("whiteLayer").style.MozOpacity = nopV;
		$("whiteLayer").style.KhtmlOpacity = nopV;
		$("whiteLayer").style.filter = "alpha(opacity="+opV+")";
	}

	function nukeWL()
	{
		$("whiteLayer").style.display="none";
	}

	function blendIn(blend)
	{
		if(blend<100)
		{
			blend+=1;
			setOp(blend);
			setTimeout("blendIn("+blend+")",1);
		}
		else
		{
			$("contents").innerHTML = $("whiteLayer").innerHTML;
			nukeWL();
			setTimeout("swapWrapper()",panelDelay+firstPanelBonusDelay);
		}
	}

	function blendOut(blend)
	{
		if(blend>0)
		{
			blend-=1;
			setOp(blend);
			setTimeout("blendOut("+blend+")",1);
		}
	}
