var HOME = 0;
var HOME_P = 1;
var NEWSLETTER = 2;
var NEWSLETTER_P = 3;
var BY_LAWS = 4;
var BY_LAWS_P = 5;
var SCHOLARSHIP = 6;
var SCHOLARSHIP_P = 7;
var DIRECTORS = 8;
var DIRECTORS_P = 9;
var MEMBERSHIP = 10;
var MEMBERSHIP_P = 11;
var DIRECTIONS = 12;
var DIRECTIONS_P = 13;
var RESERVATIONS = 14;
var RESERVATIONS_P = 15;
var SPECIAL_EVENTS = 16;
var SPECIAL_EVENTS_P = 17;
var LINKS = 18;
var LINKS_P = 19;
var TECH_Q_A = 20;
var TECH_Q_A_P = 21;

var menuImages = new Array(22);
for (var i = 0; i < menuImages.length; i++) {
	menuImages[i] = new Image();
}
menuImages[HOME].src = "../images/home.gif";
menuImages[NEWSLETTER].src = "../images/newsletter.gif";
menuImages[BY_LAWS].src = "../images/byLaws.gif";
menuImages[SCHOLARSHIP].src = "../images/Scholarship.gif";
menuImages[DIRECTORS].src = "../images/directors.gif";
menuImages[MEMBERSHIP].src = "../images/membership.gif";
menuImages[DIRECTIONS].src = "../images/directions.gif";
menuImages[RESERVATIONS].src = "../images/reservations.gif";
menuImages[SPECIAL_EVENTS].src = "../images/specialEvents.gif";
menuImages[LINKS].src = "../images/links.gif";
menuImages[TECH_Q_A].src = "../images/techQA.gif";

menuImages[HOME_P].src = "../images/homeP.gif";
menuImages[NEWSLETTER_P].src = "../images/newsletterP.gif";
menuImages[BY_LAWS_P].src = "../images/byLawsP.gif";
menuImages[SCHOLARSHIP_P].src = "../images/ScholarshipP.gif";
menuImages[DIRECTORS_P].src = "../images/directorsP.gif";
menuImages[MEMBERSHIP_P].src = "../images/membershipP.gif";
menuImages[DIRECTIONS_P].src = "../images/directionsP.gif";
menuImages[RESERVATIONS_P].src = "../images/reservationsP.gif";
menuImages[SPECIAL_EVENTS_P].src = "../images/specialEventsP.gif";
menuImages[LINKS_P].src = "../images/linksP.gif";
menuImages[TECH_Q_A_P].src = "../images/techQAP.gif";


function flipImage(image, index) {
	image.src = menuImages[index].src;
}

function navigateTo(url, newWindow) {
	if (newWindow) {
		window.open(url, "", "", true);
	} else {
		self.location = url;
	}
}

// This function returns true if there is nothing in the field or if the field is filled with spaces.
function isEmpty(value) {
 var spaces = "";
	if (value == null) {
		return true;
	}

	for (var i = 0; i < value.length + 1; i++) {
		if (value == spaces) {
			return true;		
		} // end if
	spaces += " ";
	}
 return false;
}

// This function alerts the user of the msg highlighting the field passed in.
// This function does NOT work for select boxes!  There is no .select() function.
function alertUser(fld, msg) {
	fld.focus();
	fld.select();
	alert(msg);
	fld.focus();
	fld.select();
}

