function mouseOutOfLayer(id)
{
	func = "hideLayer('"+id+"');previousLayer = \"\";";
	tim = setTimeout(func, timeout_time);
}
 
function mouseIntoLayer(id)
{
	if(tim)
		clearTimeout(tim);

	if(id.indexOf("sub_") >= 0)
	{  // we're mousing into a sub_layer
		if(open_sub_layer != id && open_sub_layer != "")
			hideLayer(open_sub_layer);
		clearTimeout(tim3);
		showLayer(id);
		showLayer(previousLayer);
		open_sub_layer = id;
	}
	else
	{  // we're just mousing into a regular layer
		if(previousLayer != id && previousLayer != "")
			hideLayer(previousLayer);
		showLayer(id);
		previousLayer = id;
	}
}

// BEGIN subnav LAYER SCRIPT
// var sections = new Array(4,0); // set the number of sublayers per section
var timeout_time = 800; // set the timeout time

var sub_tim;
var sub_tim2;
var sub_tim3;
// var previousSubLayer = "";
var open_sub_layer = "";

var previousSection = "-1";

function mouseIntoSection(section)
{
	if(!ready)
		return false;
	else
	{
//		alert("hello");
		if(sub_tim)
			clearTimeout(sub_tim);
	
		if(section != previousSection)
		{
			if(previousSection != "-1")
				hideSection(previousSection);
			for(i=0; i<sections[section]; i++)
				showLayer("subnav_" + section + "_" + i);
		}
		previousSection = section;
	}
}

function mouseOutOfSection(section)
{
	func = "hideSection('"+section+"')";
	sub_tim = setTimeout(func, timeout_time);
}

function hideSection(section)
{
	for(i=0; i<sections[section]; i++)
		hideLayer("subnav_" + section + "_" + i);
		
	previousSection = "-1";
}

function mouseOverSubnavLayer(layerID)
{
	if(document.all)
	{
		var div = returnDiv("subnav_" + layerID);
		div.bgColor = "#ff0000";
		div.backgroundColor = "#ff0000";
		div.color = "#FFFFFF";
	}
}

function mouseOutOfSubLayer(layerID)
{
	if (document.all)
	{
		var div = returnDiv("subnav_" + layerID);
		div.bgColor = "#000000";
		div.backgroundColor = "#848284";
		div.color = "#FFFFFF";
	}
}

function do_nothing()
{}