
function validateform() {
	
	var okSoFar=true
	
		with (document.contactform) {

			if (sender.value=="" && okSoFar) {
			   okSoFar=false
			   alert("Please enter your name.")
			   sender.focus()
			 }

			if (email.value=="" && okSoFar) {
			   okSoFar=false
			   alert("Please enter your email address.")
			   email.focus()
			 }
			
			var foundAt = email.value.indexOf("@",0)
			if (foundAt < 1 && okSoFar) {
				okSoFar = false
				alert ("Please enter a valid email address. \n Something like \"bob@gmail.com\"")
				email.focus()
			}

			if (message.value=="" && okSoFar) {
			   okSoFar=false
			   alert("Please enter your inquiry or prayer request.")
			   message.focus()
			 }

			if (security_code.value=="" && okSoFar) {
			   okSoFar=false
			   alert("Please enter the security code at the bottom of the form.")
			   security_code.focus()
			 }

			 if (okSoFar==true) submit();
 		}
}
