document.cookie = 'displayAnimation=false; path='+location.hostname+'; path=/;';

function changeImg(navSection, turnOn) {

	if (navSection != currentSection) {
	
		var imgSrc = "images/n_" + navSection;
		
		imgSrc += turnOn ? "_mouseon.gif" : "_off.gif";
	
		document.getElementById(navSection + "_img").src = imgSrc;
	
	}

}

// corresponds to the link/div currently active
var activeLink = 1;

//*****************************************************
// a c t i v a t e
//*****************************************************
// Activates the link & div for the selected client

function activate (linkId) {

	// Extract the id number from the link's id
	var idPos = linkId.lastIndexOf("_") + 1;
	var idNum = linkId.substring(idPos);
	
	// If there's a previously active link/div...
	if (activeLink > 0 && activeLink != idNum) {
	
		// ...turn it off
		changeState ("off", activeLink);
	}
	
	// turn on the current link/div
	changeState("on", idNum);
	
	// mark the current link/div number as the active number for next go-round
	activeLink = idNum;

}

//*****************************************************
// c h a n g e S t a t e
//*****************************************************
// Changes the display state for a specified client

function changeState (state, idNum) {

	// set the display variable depending on whether we're turning on or off
	var displayState = state == "on" ? "block" : "none";
		
	// get a reference to the content div
	var cb = document.getElementById("cb" + idNum);
	
	// if it's valid...
	if (cb + "" != "undefined") {
	
		// change the display property
		cb.style.display = displayState;
	}
	
	// get a reference to the link
	var cbLink = document.getElementById("link_" + idNum);
	
	// If it's valid...
	if (cbLink + "" != "undefined") {
	
		// change the background image
		cbLink.style.backgroundImage = "url(images/nav_arrow_" + state + ".gif)";
		
		// change the link class (on/off)
		cbLink.className = state + "Link";
	}

}
