// library to make the global navigation work
// Tom Farrell, Zentropy Partners

// This library expects the layercontrol.js library to already be loaded.

// call this function from the mouseover handler to make the specified nav element highlight.
// foo is a string naming the element.
function navOn(foo) {
	var textLayerOn = makeAbstract("global" + foo + "on");
	var textLayerOff = makeAbstract("global" + foo + "off");
	var circleLayerOn = makeAbstract("circle" + foo + "on");
	var circleLayerOff = makeAbstract("circle" + foo + "off");
	var lineLayer = makeAbstract("line" + foo);
	hideLayer(textLayerOff);
	showLayer(textLayerOn);
	hideLayer(circleLayerOff);
	showLayer(circleLayerOn);
	showLayer(lineLayer);
	} //end function

//call this function from the mouseout handler to make the specified nav element dim.
function navOff(foo) {
	var textLayerOn = makeAbstract("global" + foo + "on");
	var textLayerOff = makeAbstract("global" + foo + "off");
	var circleLayerOn = makeAbstract("circle" + foo + "on");
	var circleLayerOff = makeAbstract("circle" + foo + "off");
	var lineLayer = makeAbstract("line" + foo);
	hideLayer(textLayerOn);
	showLayer(textLayerOff);
	hideLayer(circleLayerOn);
	showLayer(circleLayerOff);
	hideLayer(lineLayer);
	} //end function

//set the following array equal to a list of strings of nav element names if you want to be
//able to use the showNav function.
var navElements = [];

//set the following variable equal to a string for the name of the current section in order
//to have it stick on.
var currentNav = null;

function showNav(foo) {
	for (var x=0; x<navElements.length; x++) {
		navOff(navElements[x]);
		} //end for loop
	if (foo!=null) {
		navOn(foo);
		} //end if
	} //end function

function initializeGlobalNav() {
	showLayer(makeAbstract("globalpeopleoff"));
	showLayer(makeAbstract("globalsupportoff"));
	showLayer(makeAbstract("globalonsiteoff"));
	showLayer(makeAbstract("globalflashoff"));
	showLayer(makeAbstract("globalhomeoff"));
	showLayer(makeAbstract("circlepeopleoff"));
	showLayer(makeAbstract("circleonsiteoff"));
	showLayer(makeAbstract("circlesupportoff"));
	showLayer(makeAbstract("circlehomeoff"));
	showLayer(makeAbstract("circleflashoff"));
	} //end function
