// JavaScript Document

	/* This script is used to automatically step through the tabs on the Landing Pages or the Home page.
	The functions below are initiated from a timmer call on the calling page
	*/

	
	function hideAllTabs() {
	/* hideAllTabs is hides all sections before the new tab is displayed */
		var tabObj, tabHighlightObj;
		for (i=1;i<=numberOfTabs;i++) {
			tabObj=document.getElementById("rotateTab" + i);
			if(typeof(tabObj)!="undefined") tabObj.style.display="none";
		}
	}
	
	var timerRunning=true;
	var currentTab=0;
	var timmerId;
	function rotateTabs() {
		currentTab++;
		if (currentTab > numberOfTabs) currentTab=1;
		var tabObj=document.getElementById("rotateTab" + currentTab);
		hideAllTabs();
		tabObj.style.display="block";
		if (timerRunning==true) timerID=self.setTimeout("rotateTabs()",delayTime);
	}
	function stopTimer() {
		if(timerRunning==true) clearTimeout(timerID);
		var startObj=document.getElementById("pauseButton");
		if (startObj != null) startObj.className="off";
		var playObj=document.getElementById("playButton");
		if (startObj != null) playObj.className="on";				
		timerRunning=false;
	}
	function startTimer() { 
		if(timerRunning==true) clearTimeout(timerID);
		var startObj=document.getElementById("pauseButton");
		if (startObj != null) startObj.className="on";
		var playObj=document.getElementById("playButton");
		if (startObj != null) playObj.className="off";		
		timerRunning=true;
		rotateTabs();
	}
	

	
