// Image rollover function
function swap(name, number) {
	document.images[name].src = "images/index_images/" + name + "_" + number + ".gif";
}
// Jumps to a year specified by the value of textbox
function goToYear(textbox) {
	var year = textbox.value;
	
	if( !isNaN(year) ) {
		var yearInt = parseInt(year);
		
		if( yearInt < 100 ) {
			yearInt += 1900;
			year = "19" + year;
		}
			
		if( yearInt < 1914 || yearInt > 1994 || isNotUsed(yearInt) ) 
			alertReset("Sorry, TU did not publish a yearbook in " + year + ".\nPlease try again.", textbox);
		else {
			var decade = year.substring(2,3);
			window.location.href = "19" + decade + "0-19" + decade + "9/" + year + "/" + year + "_main.php";
		}
	}
	else
		alertReset("Please enter an integer year. (eg 1976)", textbox);
}
// Alerts the user to their error and resets the textbox
function alertReset(str,textbox) {
	alert(str);
	textbox.value = "";
	textbox.focus();
}