// Script for basic image rollover support v1.0

function createNavImages(imageRoot) {
	if (document.images) {
	
		// vars for conference changing each year
		var date = new Date();
		var year = date.getYear();
		
		if (year >= 100 && year <= 200) {
			year += 1900;
		} else {
			// such a hack due to netscape being a CHEESE browser
		}

		// create off images, these are the images the user sees before an event fires for the rollover
		home_off = new Image();
		home_off.src = imageRoot + "/nav/btn_home.gif";

		about_off = new Image();
		about_off.src = imageRoot + "/nav/btn_aboutus.gif";

		calendar_off = new Image();
		calendar_off.src = imageRoot + "/nav/btn_calendar.gif";

		conference_off = new Image();
		conference_off.src = imageRoot + "/nav/confer/btn_conference_" + year + ".gif";

		media_off = new Image();
		media_off.src = imageRoot + "/nav/btn_media.gif";
		
		objectives_off = new Image();
		objectives_off.src = imageRoot + "/nav/objectives/btn_objectives_" + year + ".gif";

		//update_off = new Image();
		//update_off.src = imageRoot + "/nav/btn_update.gif";
		
		submit_off = new Image();
		submit_off.src = imageRoot + "/btn_submit.gif";
		
		reset_off = new Image();
		reset_off.src = imageRoot + "/btn_reset.gif";
		
		logout_off = new Image();
		logout_off.src = imageRoot + "/admin_btn_logout.gif";
		
		back_off = new Image();
		back_off.src = imageRoot + "/admin_btn_back.gif";
		
	
		// create the on images, these are the images the user sees on the onMouseOver event
		home_on = new Image();
		home_on.src = imageRoot + "/nav/btn_homeRO.gif";
		
		about_on = new Image();
		about_on.src = imageRoot + "/nav/btn_aboutusRO.gif";
		
		calendar_on = new Image();
		calendar_on.src = imageRoot + "/nav/btn_calendarRO.gif";
		
		conference_on = new Image();
		conference_on.src = imageRoot + "/nav/confer/btn_conferenceRO_" + year + ".gif";
		
		media_on = new Image();
		media_on.src = imageRoot + "/nav/btn_mediaRO.gif";
		
		//update_on = new Image();
		//update_on.src = imageRoot + "/nav/btn_updateRO.gif";
		
		objectives_on = new Image();
		objectives_on.src = imageRoot + "/nav/objectives/btn_objectivesRO_" + year + ".gif";
		
		submit_on = new Image();
		submit_on.src = imageRoot + "/btn_submitRO.gif";
		
		reset_on = new Image();
		reset_on.src = imageRoot + "/btn_resetRO.gif";
		
		logout_on = new Image();
		logout_on.src = imageRoot + "/admin_btn_logoutRO.gif";
		
		back_on = new Image();
		back_on.src = imageRoot + "/admin_btn_backRO.gif";
		
		} else {
		// this browser does not support images.  A text only browser
	}
}


function img_On(imgName) {
	imgOn = eval(imgName + "_on.src");
	document [imgName].src = imgOn;
}

function img_Off(imgName) {
	imgOff = eval(imgName + "_off.src");
	document [imgName].src = imgOff;
}