var imgPath='http://troop316.org/images/Buttons/';



function preLoadBtn(btnName) {
	
	if (navigator.appVersion.substring(0,1) > 2) {

		eval(btnName + "h = new Image()");

		eval(btnName + "h.src = '" + imgPath + "h" + btnName + ".gif'");

		eval(btnName + "a = new Image()");

		eval(btnName + "a.src = '" + imgPath + "a" + btnName + ".gif'");

	}

	return true;

}



function hilite(btnName) {

	// Called by OnMouseOver

	if (navigator.appVersion.substring(0,1) > 2) {

		document[btnName].src = imgPath + "h" + btnName + ".gif";

	}

	return true;

}



function unhilite(btnName) {

	// Called by OnMouseOut

	if (navigator.appVersion.substring(0,1) > 2) {

		document[btnName].src = imgPath + btnName + ".gif";

		findactive();

	}

	return true;

}



function makeactive(btnName) {

	// Sets button for current page

	if (navigator.appVersion.substring(0,1) > 2) {

		document[btnName].src = imgPath + "a" + btnName + ".gif";

	}

	return true;

}



function findactive() {

	switch (document.location.pathname) {

		case "/" :

		case "/index.htm" :

			makeactive('home');

			break;

		case "/calendar.htm" :

			makeactive('calendar');

			break;

		case "/events.htm" :

			makeactive('events');

			break;

		case "/parentsguide.htm" :

			makeactive('parentsguide');

			break;

		case "/meritbadges.htm" :

			makeactive('meritbadge');

			break;

		case "/profiles.htm" :

			makeactive('profiles');

			break;

		case "/photo_album.htm" :

			makeactive('photoalbum');

			break;

		case "/sponsors.htm" :

			makeactive('sponsors');

			break;

	}

	return true;

}



function popWindow() {

	popWin = window.open('http://troop316.org/disaster.htm','popWin','width=480,height=420');

}



function clickGo(obj) {

	var scout = obj.options[obj.selectedIndex].value;

	if ( scout != '' ) {

		window.location = '/Profiles/scout_profile.php?scout=' + scout;

	}

}
