function validEmail(email) {
			invalidChars = " /:,;"
	
			if (email == "") {						 
				return false
			}
			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
			}
	

		// Function to check a form field or string for emptiness or a null value.
	 
		function isEmpty(str) {
			return (str == null || str == "");
			return false;
		}
		 

		function validate(contactForm) {
		

			
			// check to see if  first name was entered
			if (isEmpty(contactForm.firstname.value)) {
				alert("Please enter your first name!");	
				contactForm.firstname.focus();
				contactForm.firstname.select();		
				return false;
			}
			
			// check to see if  last name was entered
			if (isEmpty(contactForm.phoneNum.value)) {
				alert("Please enter your phone number!");
				contactForm.phoneNum.focus();
				contactForm.phoneNum.select();
				return false;
			}
			
			// check to see if email address is valid
			if (!validEmail(contactForm.email.value)) {
				alert("Please enter a valid email address!");
				contactForm.email.focus();
				contactForm.email.select();
				return false;
			}
			
		 // check for comments
			if (isEmpty(contactForm.comments.value)) {
				alert("Please fill out questions or commments section!");			  
				return false;
			}
			return true;

			}
