//- Console_AddRemove -//
function Console_AddRemove(oFromSet, oToSet, bIsAll) {
	//+ unselect
	for (var hOption = 0; hOption < oToSet.length; hOption++) {
		oToSet.options[hOption].selected = false;
	}
	//+ move
	for (hOption = oFromSet.length; hOption != 0; hOption--) {
		if ((bIsAll == true) || (oFromSet.options[hOption - 1].selected == true)) {
			oToSet.options[oToSet.length] = new Option(oFromSet.options[hOption - 1].text, oFromSet.options[hOption - 1].value, false, true);
			oFromSet.options[hOption - 1] = null;
		}
	}
}
//- Console_Pack -//
function Console_Pack(oSet, oField) {
	var cPack = '';
	for (var hOption = 0; hOption < oSet.length; hOption++) {
		cPack += ',' + oSet.options[hOption].value;
	}
	oField.value = cPack.substring(1);
}
	
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);
	}
}