function checkForm(theForm) {
	
	// check that sender has entered their name
	if (theForm.YourName.value=="") {
		alert('Please enter your name.');
		theForm.YourName.focus();
		return false;
	}
	
	// check that sender has entered their e-mail address
	if (theForm.YourEmail.value=="") {
		alert('Please enter your e-mail.');
		theForm.YourEmail.focus();
		return false;
	}
	
	// check sender's e-mail for valid address
	if (!(validEmail(theForm.YourEmail.value))) {
		alert('Your e-mail address is not valid.');
		theForm.YourEmail.select();
		theForm.YourEmail.focus();
		return false;
	}
	
	// check that at least one recipient has been entered
	if (theForm.Email_1.value=="") {
		alert('You must enter at least one e-mail address.');
		theForm.Email_1.focus();
		return false;
	}

	// check E-mail 1
	if (!(validEmail(theForm.Email_1.value))) {
		alert('You have entered and invalid e-mail for Colleague 1.');
		theForm.Email_1.select();
		theForm.Email_1.focus();
		return false;
	}
	
	// check E-mail 2
	if (!(validEmail(theForm.Email_2.value))) {
		alert('You have entered and invalid e-mail for Colleague 2.');
		theForm.Email_2.select();
		theForm.Email_2.focus();
		return false;
	}
	
	// check E-mail 3
	if (!(validEmail(theForm.Email_3.value))) {
		alert('You have entered and invalid e-mail for Colleague 3.');
		theForm.Email_3.select();
		theForm.Email_3.focus();
		return false;
	}
	
}


// FUNCTION: return true if valid e-mail address
function validEmail(email) {
	invalidChars = " /:,;"
	if (email == "") {
		return true;
	}
	for (i=0; i<invalidChars.length; i++) {
		badChar = invalidChars.charAt(i)
		if (email.indexOf(badChar,0) > -1) {
			return false;
		}
	}
	atPos = email.indexOf("@",1)
	if (atPos == -1) {
		return false;
	}
	if (email.indexOf("@",atPos+1) > -1) {
		return false;
	}
	periodPos = email.indexOf(".",atPos)
	if (periodPos == -1) {
		return false;
	}
	if (periodPos+3 > email.length) {
		return false;
	}
	return true;
}
