/*----------------------------------------------------------------------*/
/*  Script for validating fields in common to booking form screens      */
/*----------------------------------------------------------------------*/
	function validateForm() {
		
/*  validate name entered                                                       */
		if (bookingForm.name.value == '') {
			alert("Please enter a contact name")
		   	bookingForm.name.focus()
		  	return false
		}
/*  validate email                                                              */
		if ( bookingForm.email.value != '' 
		   & !validEmail(bookingForm.email.value ) ) {
			alert("Please enter a valid email address")
		   	bookingForm.email.focus()
		  	return false
		}
		return true
	}  /* end validateForm function */

/*----------------------------------------------------------------------*/
/*  validate email address
/*----------------------------------------------------------------------*/
	function validEmail(email) {
		atPos = email.indexOf("@",1)
		if (atPos == -1) {                         // must be a @
		  	return false
		}
		if (email.indexOf("@",atPos+1) != -1) { // must be only 1 x @
		  	return false
		}
		periodPos = email.indexOf(".",atPos)
		if (periodPos == -1) {                     // must be a . after @
		  	return false
		}
		if (periodPos + 3 > email.length) {        // must be at least 2 chars after . 
		  	return false
		}
	  	return true
	}
	  
	
