function loadmenu() {

	var menustring = new String;
	var menulinks = new Array;
	var menuactive = new Array;
	var menuinactive = new Array;

	menustring = "";

	menulinks[0] = "ind";
	menulinks[1] = "res";
	menulinks[2] = "ppl";
	menulinks[3] = "pub";
	menulinks[4] = "lin";

	menuactive[0] = "images/home-active.gif";
	menuactive[1] = "images/res-active.gif";
	menuactive[2] = "images/ppl-active.gif";
	menuactive[3] = "images/pub-active.gif";
	menuactive[4] = "images/links-active.gif";

	menuinactive[0] = "images/home-tab.gif";
	menuinactive[1] = "images/res-tab.gif";
	menuinactive[2] = "images/ppl-tab.gif";
	menuinactive[3] = "images/pub-tab.gif";
	menuinactive[4] = "images/links-tab.gif";

	//This code parses the URL to find the file name, used in the array to highlight the proper menu item
	var active = window.location.pathname.substring(window.location.pathname.lastIndexOf("/")+1);

	if (active == "") { 
		active = "ind";
	}
	else {
		active = active.substring(0, 3);
	}

	/* Go through all the menu items to find out which tab needs to be highlighted */
	for (a = 0; a < menulinks.length; a++) {
		if (menulinks[a] == active) {
			menustring = '<img valign="bottom" id="' + menulinks[a] + '-img" src="' + menuactive[a] + '">';
			document.getElementById(menulinks[a]).innerHTML = menustring;
		} else {
			menustring = '<img valign="bottom" id="' + menulinks[a] + '-img" src="' + menuinactive[a] + '">';
			document.getElementById(menulinks[a]).innerHTML = menustring;
		}
	}
	
	if (navigator.appName.indexOf("Netscape") != -1) {
		document.getElementById('resmenu').style.position = 'fixed';
		document.getElementById('pplmenu').style.position = 'fixed';
	}
	else if (navigator.appName.indexOf("MS") != -1) {
		document.getElementById('resmenu').style.position = 'absolute';
		document.getElementById('pplmenu').style.position = 'absolute';
	}
}

/* Produce the hover effect on hover over tabs */
function hoverImg(id, file) {
        var imgid = id + "-img";
        var active = window.location.pathname.substring(window.location.pathname.lastIndexOf("/")+1);
        if (active == "") {
                active = "ind";
        }
        else {
                active = active.substring(0, 3);
        }

        if (active != id) {
                document.getElementById(imgid).src = file;
        }
}

/* Show larger versions of images on main page collage on hover over Research menu topics */
function showResImg(file) {
        var file = "images/" + file + "-big.gif";
        var active = window.location.pathname.substring(window.location.pathname.lastIndexOf("/")+1);
        if (active == "") {
                active = "ind";
        }
        else {
                active = active.substring(0, 3);
        }

        /* Show these images only if user is on the home page */
        if (active.toLowerCase() == "ind") {
                document.getElementById('resimg').src = file;
        }
}

/* This shows the main collage instead of individual image */
function hideResImg() {
        var active = window.location.pathname.substring(window.location.pathname.lastIndexOf("/")+1);
        if (active == "") {
                active = "ind";
        }
        else {
                active = active.substring(0, 3);
        }

        if (active.toLowerCase() == "ind") {
                document.getElementById('resimg').src = "images/collage1.gif";
        }
}

/* This function pops up larger versions of the images on the research pages */
function imgwin(Imgn) {
        var filename = new Array();
        var ImgWin = "";

        for(i=0; i<10; i++) {
                filename[i] = new Image();
        }

        /* These are all the images */
        filename[0].src = "images/res1-big.gif";
        filename[1].src = "images/res1-fig2-big.gif";
        filename[2].src = "images/res1-fig3-big.gif";
        filename[3].src = "images/res2-big.gif";
        filename[4].src = "images/res2-table1-big.gif";
        filename[5].src = "images/res3-big.gif";
        filename[6].src = "images/res4-big.gif";
        filename[7].src = "images/res4-fig2-big.gif";
        filename[8].src = "images/res5-big.gif";
        filename[9].src = "images/res5-fig2-big.gif";

        /* Find the image width */
        w = filename[Imgn].width;
        w = w + 25;

        /* Find the image height */
        h = filename[Imgn].height;
        h = h + 25;

        picgif = filename[Imgn].src; // Build image source

        if(ImgWin.open)  //  If the window is open close it
                ImgWin.close();

        /* Open a new window with the image in it */
        WinProps="width="+w+",height="+h+",location=no,status=no,directories=no,toolbar=no,scrollbars=no,menubar=no,resize=no";
        ImgWin=window.open("","winimg",config=WinProps);
        ImgWin.document.write("<html>");
        ImgWin.document.write("<body bgcolor='#111111'>");
        ImgWin.document.write("<center><img src=" +picgif+ " border='0'><br>");
        ImgWin.document.write("</body>");
        ImgWin.document.write("</html>");
        ImgWin.document.close();
        ImgWin.focus();

}

/* Function to hide the Research and People menus */
function hideAll() {
	document.getElementById('resmenu').style.visibility = 'hidden';
	document.getElementById('pplmenu').style.visibility = 'hidden';
}

/* Show Research menu on hover over Research tab */
function showRes() {
        document.getElementById('pplmenu').style.visibility = 'hidden';
        document.getElementById('resmenu').style.visibility = 'visible';
}

/* Show People menu on hover over People tab */
function showPpl() {
        document.getElementById('resmenu').style.visibility = 'hidden';
        document.getElementById('pplmenu').style.visibility = 'visible';
}

/* Hide menus on Don's page...called Music just to confuse everyone */
function hideMusic() {
        document.getElementById('jazzmenu').style.visibility = 'hidden';
        document.getElementById('fabmenu').style.visibility = 'hidden';
	document.getElementById('bentmenu').style.visibility = 'hidden';
}

/* Show Jazz menu on Don's page */
function showJazz() {
        document.getElementById('fabmenu').style.visibility = 'hidden';
	document.getElementById('bentmenu').style.visibility = 'hidden';
        document.getElementById('jazzmenu').style.visibility = 'visible';
}

/* Show Funny and Bitter Songwriters menu on Don's page*/
function showFab() {
        document.getElementById('jazzmenu').style.visibility = 'hidden';
	document.getElementById('bentmenu').style.visibility = 'hidden';
        document.getElementById('fabmenu').style.visibility = 'visible';
}

/* Show Getting Bent menu on Don's page */
function showBent() {
        document.getElementById('jazzmenu').style.visibility = 'hidden';
	document.getElementById('fabmenu').style.visibility = 'hidden';
        document.getElementById('bentmenu').style.visibility = 'visible';
}

/* Show Hometown Boys on Steve's page */
function showSports() {
	document.getElementById('sportsmenu').style.visibility = 'visible';
}

/* Hide Hometown Boys on Steve's page */
function hideSports() {
        document.getElementById('sportsmenu').style.visibility = 'hidden';
}

/* Hide menus on Martha's page */
function hideMartha() {
        document.getElementById('mdmenu').style.visibility = 'hidden';
        document.getElementById('musmenu').style.visibility = 'hidden';
        document.getElementById('eqmenu').style.visibility = 'hidden';
}

/* Show Modern Dance menu on Martha's page */
function showMD() {
        document.getElementById('musmenu').style.visibility = 'hidden';
        document.getElementById('eqmenu').style.visibility = 'hidden';
        document.getElementById('mdmenu').style.visibility = 'visible';
}

/* Show Music menu on Martha's page*/
function showMus() {
        document.getElementById('mdmenu').style.visibility = 'hidden';
        document.getElementById('eqmenu').style.visibility = 'hidden';
        document.getElementById('musmenu').style.visibility = 'visible';
}

/* Show Equality menu on Martha's page */
function showEq() {
        document.getElementById('mdmenu').style.visibility = 'hidden';
        document.getElementById('musmenu').style.visibility = 'hidden';
        document.getElementById('eqmenu').style.visibility = 'visible';
}

