/*
<!--- AUTHOR: Ryan Marincovich --->
<!--- DATE CREATED: 2007.06.05 --->
<!--- PURPOSE: Javascript functions and methods used in the main navigation --->
<!--- REVISIONS: 
--->
*/

// var that is set to true in the body onload tag. templates that include this file may reference this variable inorder to run javascript onload.
var isDocLoaded = false;
var FilePath = "http://www.lifetimefitness.com";

// Browser sniffing variables
var ns4 = document.layers ? 1 : 0;
var ie4 = document.all ? 1 : 0;
var ns6 = document.getElementById && !document.all ? 1 : 0;

// vars for dropdown menus
var navTimer = null;
var currNav = null;
var navHideDelay = 500;
var isNavLoaded = false;

// dhtml layer variables for cross-browser compatability
if (document.layers) {	// Netscape 4
	doc = "document[";
	conDoc = "document";
	sty = "]";
	htm = ".document";
} else if (document.getElementById) {	// NS 6 or IE 5 and up (W3C compliant browsers).
	doc = "document.getElementById(";
	conDoc = "document.getElementById(";
	sty = ").style";
	htm = ".document";
} else if (document.all) {	// IE 4
	doc = "document.all[";
	conDoc = "document.all[";
	sty = "].style";
	htm = "";
}

// build dropdown objects (run onload)
function buildNav() {
	// navAboutUsObj = eval(doc + '"navAboutUs"' + sty);	
	navMembershipObj = eval(doc + '"navMembership"' + sty);	
	navFitnessCentersObj = eval(doc + '"navFitnessCenters"' + sty);	
	// navActivitiesObj = eval(doc + '"navActivities"' + sty);
	// navServicesObj = eval(doc + '"navServices"' + sty);
	// navMemberRewardsObj = eval(doc + '"navMemberRewards"' + sty);
	// navmyLTObj = eval(doc + '"navmyLT"' + sty);	
	// navShopObj = eval(doc + '"navShop"' + sty);
	// navContactUsObj = eval(doc + '"navContactUs"' + sty);
	isNavLoaded = true;
}

function navStayOn(which) {
	eval("document.getElementById('" + which + "_nav').className = 'nav_" + which + "_roll'");
}

function navStayOff(which) {
	eval("document.getElementById('" + which + "_nav').className = 'nav_" + which + "'");
}

// shows a dropdown menu, hides any other dropdown that is currently showing
function showNav(which) {
	if (isNavLoaded) {
		if ((currNav != null) && (currNav != which)) {
			eval("nav" + currNav + "Obj.visibility = 'hidden'");
		}
		currNav = which;
		eval("nav" + currNav + "Obj.visibility = 'visible'");
		clearTimeout(navTimer);
		navTimer = null;
	}
}
// hides a dropdown menu on a time delay
function hideNav(which) {
	if (isNavLoaded) {
		navTimer = setTimeout("nav" + which + "Obj.visibility = 'hidden'", navHideDelay);
	}
}