function validEmail(inEmail) {
	invalidChars = "/:,;"
	if (inEmail == "") {
		return false; }
	for (i=0; i<invalidChars.length; i++) {
		badChar = invalidChars.charAt(i)
		if (inEmail.indexOf(badChar,0) > -1) {
			return false; }
		}
		atPos = inEmail.indexOf("@",1)
		if (atPos == -1) {
			return false; }
		if (inEmail.indexOf("@",atPos+1) > -1) {
			return false; }
		periodPos = inEmail.indexOf(".",atPos)
		if (periodPos == -1) {
			return false; }
		if (periodPos+3 > inEmail.length) {
			return false; }
		else {
			return true; }
}

function validForm(form1) {

		var d = document.form1;

		if (d.first_name.value == "") {
			alert("You must enter your first name.")
			d.first_name.focus()
			return false; }
			
		if (d.last_name.value == "") {
			alert("You must enter your last name.")
			d.last_name.focus()
			return false; }			

		if (d.email.value == "") {
			alert("You must enter your email address")
			d.email.focus()
			return false; }
			
		
		if (!validEmail(d.email.value)) {
			alert("You must enter a valid email address")
			d.email.focus()
			return false; }
			
		if (d.subject.value == "") {
			alert("You must enter a subject.")
			d.subject.focus()
			return false; }	
			
		if (d.message.value == "") {
			alert("You must leave a comment.")
			d.message.focus()
			return false; }	


		else {
			return true; }
	}
