function validateSearch(){
	if (document.frmSearch.txtSearch.value == ""){
		alert("Please enter your search criteria.")
		document.frmSearch.txtSearch.focus()
		return false;
	}
}

function validateEmailCollector(){
	if (document.frmEmail.txtName.value == ""){
		alert("Please enter your first name.")
		document.frmEmail.txtName.focus()
		return false;
	}
	if (document.frmEmail.txtLastName.value == ""){
		alert("Please enter your last name.")
		document.frmEmail.txtLastName.focus()
		return false;
	}
	if (document.frmEmail.txtEmail.value.indexOf("@") == -1 || document.frmEmail.txtEmail.value.indexOf(".") == -1 || document.frmEmail.txtEmail.value.indexOf(" ") != -1) {
			alert("Please enter a valid email address.")
			document.frmEmail.txtEmail.focus()
			return false;
		}
	
	var j = 0
	for (var i = 0; i < document.frmEmail.optAge.length; i++){
		if (document.frmEmail.optAge[i].checked){
			j = 1
		}
	}
	if (j == 0){
	 alert("Please select your age group")
	 return false;
	}
}

function validatePoll(){
	var j = 0
	for (var i = 0; i < document.frmPoll.optAns.length; i++){
		if (document.frmPoll.optAns[i].checked){
			j = 1
		}
	}
	if (j == 0){
	 alert("Please select a poll option.")
	 return false;
	}
}

//rollover nav images
var flag = false;
function imageLoad(){  //called with onLoad()
	if (document.images){
		img1on = new Image(); img1on.src = "res/img/nav_home_on.gif";
		img2on = new Image(); img2on.src = "res/img/nav_youandme_on.gif";
		img3on = new Image(); img3on.src = "res/img/nav_education_on.gif";
		img4on = new Image(); img4on.src = "res/img/nav_life_on.gif";
		img5on = new Image(); img5on.src = "res/img/nav_realitybytes_on.gif";
		img6on = new Image(); img6on.src = "res/img/nav_getinvolved_on.gif";
		img7on = new Image(); img7on.src = "res/img/nav_asktheguru_on.gif";
		img8on = new Image(); img8on.src = "res/img/nav_letafmeentertainyou_on.gif";
		img9on = new Image(); img9on.src = "res/img/nav_inprint_on.gif";
		return (flag = true);  //set the flag and let the function know know it can work
	}
}
if (document.images){   //load the off images in the normal way
	img1off = new Image(); img1off.src = "res/img/nav_home_off.gif";
	img2off = new Image(); img2off.src = "res/img/nav_youandme_off.gif";
	img3off = new Image(); img3off.src = "res/img/nav_education_off.gif";
	img4off = new Image(); img4off.src = "res/img/nav_life_off.gif";
	img5off = new Image(); img5off.src = "res/img/nav_realitybytes_off.gif";
	img6off = new Image(); img6off.src = "res/img/nav_getinvolved_off.gif";
	img7off = new Image(); img7off.src = "res/img/nav_asktheguru_off.gif";
	img8off = new Image(); img8off.src = "res/img/nav_letafmeentertainyou_off.gif";
	img9off = new Image(); img9off.src = "res/img/nav_inprint_off.gif";
}
function rollIn(imgName,title) {
	window.status = title
	if (document.images && (flag == true)) {
		document[imgName].src = eval(imgName + "on.src");
	}
}
function rollOut(imgName) {  //the normal onMouseOut function
window.status = ""
	if (document.images){
		document[imgName].src = eval(imgName + "off.src");
	}
}
