var timerID = 0;

/* If you add any new tabs, add them to the tab array below. Dn't forget to add a layer to the layer array as well. 
   The associated layer MUST BE THERE!
   
   I recommend using the same naming convention - might be easier to keep it straight if you keep the ascending numerics convention */
var layerArray=new Array;
layerArray=['level2layer1','level2layer2','level2layer3','level2layer4'];
var tabArray=new Array;
tabArray=['topNavigationTab1','topNavigationTab2','topNavigationTab3','topNavigationTab4'];

function startTimer() { 
	stopTimer();
	timerID = setTimeout("showLayer('none')", 50);
}

function stopTimer() { 
	clearTimeout(timerID); 
}

function mouseOnTab(tabID,level2layer){
	myTab=document.getElementById(tabID);
	myLayer=document.getElementById(level2layer);
	myTab.className='topNavigationLevel1TabOn';
	myLayer.style.display='block';
}

function showLayer(layerName,tabName){
	for (var i = 0; i < layerArray.length; i++) {
		thisLayer = document.getElementById(layerArray[i]);
		thisLayer.style.display = 'none';
	}
	for (var i = 0; i < tabArray.length; i++) {
		thisTab = document.getElementById(tabArray[i]);
		thisTab.className = 'topNavigationLevel1TabOff';
	}
	if (layerName != 'none') {
		thisLayer = document.getElementById(layerName);
		thisLayer.style.display = 'block';
		thisTab = document.getElementById(tabName);
		thisTab.className = 'topNavigationLevel1TabOn';
	}
}
