function switchDiv(id, allstring)
{
	var stringArray = allstring.split('|');

	for (var i = 0; i < stringArray.length; i++)
	{
		if (document.layers)
		{
			document.layers['' + stringArray[i] + ''].visibility = "hide";
		}
		else if (document.all)
		{
			document.all['' + stringArray[i] + ''].style.visibility = "hidden";
		}
		else if (document.getElementById)
		{
			document.getElementById('' + stringArray[i] + '').style.visibility = "hidden";
		}
	}
	
	if (document.layers)
	{
		document.layers['' + id + ''].visibility = "show";
	}
	else if (document.all)
	{
		document.all['' + id + ''].style.visibility = "visible";
	}
	else if (document.getElementById)
	{
		document.getElementById('' + id + '').style.visibility = "visible";
	}
}

function HideDiv(allstring)
{
	var stringArray = allstring.split('|');

	for (var i = 0; i < stringArray.length; i++)
	{
		if (document.layers)
		{
			document.layers['' + stringArray[i] + ''].visibility = "hide";
		}
		else if (document.all)
		{
			document.all['' + stringArray[i] + ''].style.visibility = "hidden";
		}
		else if (document.getElementById)
		{
			document.getElementById('' + stringArray[i] + '').style.visibility = "hidden";
		}
	}
}

var seconds;
var timerId = null;
var timerRunning = false;
var delay = 1000;
var dividstring;

function InitializeTimer(allstring)
{
	// Set the length of the timer, in seconds
	dividstring = allstring;
	seconds = 2;
	StopTimer();
	StartTimer();
}

function StopTimer()
{
	if(timerRunning)
	{
		clearTimeout(timerId);
	}
	timerRunning = false;
}

function StartTimer()
{
	if(seconds == 0)
	{
		StopTimer()
		// hide subnav divs
		HideDiv(dividstring);
	}
	else
	{
		self.status = seconds;
		seconds = seconds - 1;
		timerRunning = true;
		timerId = self.setTimeout("StartTimer()", delay);
	}
}