var SPECTRUM_numMenus       = 6;
var SPECTRUM_numBlocks      = 6;

var SPECTRUM_Timer          = null;
var SPECTRUM_Timer_Duration = 2000; // In milliseconds


function SPECTRUM_initialise () {
	SPECTRUM_showMenu(1);
	SPECTRUM_hideMenus();
	document.getElementById("contBlock0").style.display = "block";
}

function SPECTRUM_setTimeout () {
	SPECTRUM_Timer = window.setTimeout( "SPECTRUM_hideMenus(); SPECTRUM_hideContentBlocks();", SPECTRUM_Timer_Duration );
}


function SPECTRUM_showMenu ( num ) {
	if( SPECTRUM_Timer ) {
		window.clearTimeout( SPECTRUM_Timer );
	}
	SPECTRUM_hideMenus();
	var id      = "spec" + num;
	var menuObj = document.getElementById( id );
	menuObj.style.display = "block";
}


function SPECTRUM_hideMenus () {
	for( var i = 1 ; i <= SPECTRUM_numMenus ; i++ ) {
		var id      = "spec" + i;
		var menuObj = document.getElementById( id );
		menuObj.style.display = "none";
	}
}


function SPECTRUM_showContentBlock ( num ) {
	if( SPECTRUM_Timer ) {
		window.clearTimeout( SPECTRUM_Timer );
	}
	SPECTRUM_hideContentBlocks();
	document.getElementById("contBlock0").style.display = "none";
	var id      = "contBlock" + num;
	var menuObj = document.getElementById( id );
	menuObj.style.display = "block";
}


function SPECTRUM_hideContentBlocks () {
	for( var i = 0 ; i <= SPECTRUM_numBlocks ; i++ ) {
		var id      = "contBlock" + i;
		var menuObj = document.getElementById( id );
		menuObj.style.display = "none";
	}
	document.getElementById("contBlock0").style.display = "block";
}
