// ** NAVIGATION.JS ** //
// Copyright 2002-2004, StatueCreative (http://www.statuecreative.com)

var gSubMenuWidth = 190;
var gSubFooterH = 15;
var gPrevRoll = null;

function initNavigation() {

	for (var i=1; i<=gNumNavBttns; i++) {
		eval('gNavBttn'+ i + '= new navigationObj('+ i +',"'+ gNavBttnNames + i +'","lyrNavBtn'+ i +'")');
	}
}

function navigationObj(num, name, layername) {

	this.num = num;
	this.name = name;

	this.image = getObjRef(layername,name);
	if (gSection == this.num)
		this.lolite = gGraphPath + gNavBttnNames + num+ "_sel.gif";
	else
		this.lolite = gGraphPath + gNavBttnNames + num+ "_lo.gif";
	this.hilite = gGraphPath + gNavBttnNames + num+ "_hi.gif";
	this.selected = gGraphPath + gNavBttnNames + num+ "_sel.gif";
	this.layer = getObjRef(layername);
	this.layer.visibility = "visible";

	this.toggle = 0;
	
	this.navRoll = navRoll;
}

function navRoll() {
	this.toggle = !(this.toggle);
	this.image.src = (this.toggle) ? this.hilite : this.lolite;
}

// [write functions]
/* navigation buttons for site pages */
function writeNavBttn(num) {
	
	var lLocation = "";
	var lStr = '';
	var lSubDir = 'html/';
	var lImgSuffix = 'lo';
	var lImgPath = '../';
	
	if (gSection == num)
		lImgSuffix = "sel";

	if (gAtRootLevel) {
		lImgPath = '';
		if (num==1) {
			lSubDir = ''
		}
	}
	else {
		if (num==1)
			lSubDir = '../'
		else 
			lSubDir = ''
	}

	lStr += '<a href="'+ lSubDir + gNavLoc[(num-1)] +'" onMouseOver="gNavBttn'+ num +'.navRoll()" onMouseOut="gNavBttn'+ num +'.navRoll()" onFocus="this.blur()">';		
	lStr += '<img src="' + lImgPath + 'assets/images/nav_'+ num +'_'+ lImgSuffix +'.gif" width="'+ gNavBttnW[(num-1)] +'" height="'+ gNavBttnH[(num-1)] +'" alt="" border="0" name="'+ gNavBttnNames + num +'">';	
	lStr += '</a>';

	var lLyr = "lyrNavBtn"+num;
	writeString(lLyr,lStr);
}

function writeGroupMemberBack() {
	var lStr = '<a href="group_members.html">';
	lStr += 'Back to Group Members Home';
	lStr += '</a>';
	
	var lLyr = 'lyrTextContent'
	writeString(lLyr, lStr);
}