// JavaScript Document

function validateAndSubmitSearch(form) {
	if(form.search.value == "Search CSRV" || form.search.value == "") {
		// no search submitted on "Search CSRV" or empty searches
		form.search.focus() // places cursor back in the search field
		return false //stops the form from being submitted
	} else {
		form.search.value = form.search.value + " site:www.csuchico.edu/csrv/" //search only csrv site
		return true
	}
}

function selectImage() {
	var randNum = Math.round(Math.random()*4)+1
	document.write("<img src='http://www.csuchico.edu/csrv/images/right" + randNum + ".jpg' alt='CSRV rotational photograph' name='rotating_photo' width='180' height='238' border='0' id='rotating_photo'/>")
	//alert(randNum)
}

function dowork() {
	var randNum = Math.round(Math.random()*2)+1
	document.write("<img src='http://www.csuchico.edu/csrv/images/fp" + randNum + ".jpg' alt='CSRV rotational photograph' name='rotating_photo' width='413' height='273' border='0' id='rotating_photo'/>")
	//alert(randNum)
}