		var curHomeImage = 1;
		var numSwitchingImages = 10;

		var curMidImage = 1;
		// var numMidImages = 10; // This gets set by template.class in head_include's script block
		var curTagline = 1;
		//var numTaglines = 2; // This gets set by templates.class in head_include's script block
		var switchingTimeoutTaglinesInitial = 4500; 
		var switchingTimeoutTaglinesGeneral = 4500;
		var switchingTimeoutMidImagesInitial = 6500; 
		var switchingTimeoutMidImagesGeneral = 6500;

		var currentSectionPID = 0;

		function loadMe(pid, section_pid, datum) {
			//alert("loadme: " + pid + ", " + section_pid + ", " + datum);
			//preloadCommonImages();

			currentSectionPID = section_pid;

			if(switch_taglines) { // switch_taglines is a global that gets set by templates.class in the head_include script block
				//alert("doing taglines");
				setTimeout("switchTagline()", switchingTimeoutTaglinesInitial);
			}

			if(switch_mid_images) { // switch_mid_images is a global that gets set by templates.class in the head_include script block
				setTimeout("switchMidImage()", switchingTimeoutMidImagesInitial);
			}
		}


		function switchMidImage() {
			//alert("switching!");

			// Figure out which img is currently displaying:
			var nextMidImage = curMidImage + 1;
			if(nextMidImage > numMidImages) {
				nextMidImage= 1;
			}
			var fadeMeOut = "mid_image_" + curMidImage;
			var fadeMeIn = "mid_image_" + nextMidImage;

			//alert("fOut = " + fadeMeOut + ", fIn = " + fadeMeIn);

			// Fade the old jazz out.
			Effect.Fade(fadeMeOut, { duration: 2.0 });

			//alert("Done with fade");

			// Update
			curMidImage = nextMidImage;
			
			// Bring up the next image
			Effect.Appear(fadeMeIn, { duration: 2.0 });

			// Set the display to none
			//var obj = document.getElementById(fadeMeIn);
		
			// Do this all again
			setTimeout("switchMidImage()", switchingTimeoutMidImagesGeneral);
		
		}





		function switchTagline() {
			//alert("switching!");

			// Figure out which img is currently displaying:
			var nextTagline = curTagline + 1;
			if(nextTagline > numTaglines) {
				nextTagline = 1;
			}
			var fadeMeOut = "tagline_" + curTagline;
			var fadeMeIn = "tagline_" + nextTagline;

			//alert("fOut = " + fadeMeOut + ", fIn = " + fadeMeIn);

			// Fade the old jazz out.
			Effect.Puff(fadeMeOut, { duration: 1.0 });

			//alert("Done with fade");

			// Update
			curTagline = nextTagline;
			
			// Bring up the next image
			Effect.Appear(fadeMeIn, { duration: 2.0 });

			// Set the display to none
			//var obj = document.getElementById(fadeMeIn);
		
			// Do this all again
			setTimeout("switchTagline()", switchingTimeoutTaglinesGeneral);
		
		}

		/*
			- On Main-Nav MouseOver, 
				-change the subNav to reflect the navOver target.
				
			- On Main-Nav MouseOut
				-Start a timer to reset subNav to native.
				
			- On Sub-Nav MouseOver,
				- Pause the timer
			
			- On Sub-Nav MouseOut,
				- Restart the timer


			Problem: if user doesn't mouse back over the selected section, the prior subsection can continue to be shown.
			Solution: write a JS var for the currently selected section, then after every mouseover, set a timer to return the subNav to native section.
				Issues: Mouse could be hovering over a different section when the subNav just changes.
					Workaround: cancel the timer when the user mouses into the subNav div. Re-start the timer when the user mouses out of the subNav div.
			
			Solution: Only show the corresponding non-native subNav while the user is currently mousing over a non-native section.
				Issues: I'd have to set a mouse-out that returns the subNav to the native state. That would prevent users from ever clicking a non-native subNav option.
					Workaround: Set a timeout on the return to native subNav which gets cancelled if the user actually ends up mousing over the subnav.
						Issues: 1) Tricky to implement. 2) Would also have to return to native subNav somehow; perhaps when user mouses out of existing subNav? Messy.
		*/

		var navTimerState = "stopped";
		var navTimerDuration = 3000;

		function resetSubNavToNative() {
			if(navTimerState == "running") { // execute normally
				hideAllSubNavBlocks();
				showElement("subNav_" + currentSectionPID);
				navTimerState = "stopped";
			} else if(navTimerState == "paused") { // reset this timer
				setTimeout("resetSubNavToNative()", navTimerDuration);
			}
		}

		function subNavOver() {
			navTimerState = "paused";
		}

		function subNavOut() {
			if(navTimerState == "stopped") {
				setTimeout("resetSubNavToNative()", navTimerDuration);
			}
			navTimerState = "running";
		}

		function mainNavOver(pid) {
			navTimerState = "stopped";
			hideAllSubNavBlocks();
			showElement("subNav_" + pid);
		}

		function mainNavOut(pid) {
			//hideAllSubNavBlocks();
			//showElement("subNav_" + currentSectionPID);
			if(navTimerState == "stopped") { // only trigger timer if it's not already active
				navTimerState = "running";
				setTimeout("resetSubNavToNative()", navTimerDuration);
			}
		}

		function mainNavClick(pid) {

		}


		function hideElement(elID) {
			var obj = document.getElementById(elID);
			obj.style.display = "none";
		}

		function showElement(elID) {
			var obj = document.getElementById(elID);
			obj.style.display = "block";
		}

		function hideAllSubNavBlocks() {
			// TBD: Don't hardcode these IDs
			hideElement("subNav_1");
			hideElement("subNav_2");
			hideElement("subNav_3");
			hideElement("subNav_39");
			hideElement("subNav_40");
			hideElement("subNav_41");
		}


		var curShownNLBlock;
		function navOverNLBlock(year) {

		}

		function navOutNLBlock(year) {

		}

		function navClickNLBlock(year) {
			var curShownID = "nl_year_block_" + curShownNLBlock;
			var nextShownID = "nl_year_block_" + year;
			hideElement(curShownID);
			showElement(nextShownID);
			curShownNLBlock = year;
		}


		function navOver(name) {

		}

		function navOut(name) {

		}

		function navClick(name) {

		}


		function navOverTruckThumb(th_num) {
			var elID = "truckMainThumb_" + th_num;
			var obj = document.getElementById(elID);
			obj.style.cursor = "pointer";
		}

		function navOutTruckThumb(th_num) {
			var elID = "truckMainThumb_" + th_num;
			var obj = document.getElementById(elID);
			obj.style.cursor = "auto";
		}

		function navClickTruckThumb(th_num, new_main_src) {
			//alert("new main src = " + new_main_src);
			var mainImageID = "truckMainImage";
			var obj = document.getElementById(mainImageID);
			//obj.style = "border: 1px solid red";
			obj.src = "" + new_main_src;
		}
