// Bradley University Alumni Association
// Javsacript Include File

// The following function generates a random header image for the BUAA home page
function random__home_image (eleImage)
{
	var arrImages = new Array("images/home_top_image.jpg"); // Array of iamges to pull from
	var currentImage = arrImages.random(); // Grab a random image from array
	
	$(eleImage).src = currentImage; // Update source of header image
}

function quicklink () {
	var url = document.getElementById('selQuicklink').options[document.getElementById('selQuicklink').selectedIndex].value;
	window.location = url;
}

function check_contact () {
	if(document.getElementById('firstname').value == '' || document.getElementById('lastname').value == "" || document.getElementById('email').value == "" || document.getElementById('message').value == "")
	{
		document.getElementById('error').innerHTML = "Please fill in all required fields.";
		window.location = '#error_anchor';
		return false;
	}
	return true;
}

function centurion_year(yearIndex) {
	var selectedYear = document.getElementById('year').options[yearIndex].value;
	document.location = "#" + selectedYear;
}