
	// form validation
		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
		}// end of email validation				
		
		
		function validName(name) {
		    if (name == "") {
		  return false
		 }
		 return true
		 } 

		 function validNights(nights) {
		    if (nights == "") {
		  return false
		 }
		 return true
		 }

		 function validAdults(adults) {
		    if (adults == "") {
		  return false
		 }
		 return true
		 }

		 function validChildren(children) {
		    if (children == "") {
		  return false
		 }
		 return true
		 }
		 
		 function validVerif_box(verif_box) {
		    if (verif_box == "") {
		  return false
		 }
		 return true
		 } 

        function submitIt(booking) {			
			
			if (!validName(booking.name.value)) {
			     alert("Please enter your full name")
				 booking.name.focus()
				 booking.name.select()
				 return false
			}

			if (!validEmail(booking.email.value)) {
				alert("Please enter a valid email address")
				booking.email.focus()
				booking.email.select()
				return false
			}

			dayarrChoice = booking.arrivalday.selectedIndex
			if (booking.arrivalday.options[dayarrChoice].value == "") {
				alert("Please select your day of arrival")
				return false
			}

			montharrChoice = booking.arrivalMonth.selectedIndex
			if (booking.arrivalMonth.options[montharrChoice].value == "") {
				alert("Please select your month of arrival")
				return false
			}

			yeararrChoice = booking.arrivalYear.selectedIndex
			if (booking.arrivalYear.options[yeararrChoice].value == "") {
				alert("Please select your year of arrival")
				return false
			}

			daydepChoice = booking.departDay.selectedIndex
			if (booking.departDay.options[daydepChoice].value == "") {
				alert("Please select your day of departure")
				return false
			}

			monthdepChoice = booking.departMonth.selectedIndex
			if (booking.departMonth.options[monthdepChoice].value == "") {
				alert("Please select your month of departure")
				return false
			}

			yeardepChoice = booking.departYear.selectedIndex
			if (booking.departYear.options[yeardepChoice].value == "") {
				alert("Please select your year of departure")
				return false
			}

			if (!validNights(booking.nights.value)) {
			     alert("Please enter the number of nights staying")
				 booking.nights.focus()
				 booking.nights.select()
				 return false
			}

			if (!validAdults(booking.adults.value)) {
			     alert("Please enter the number of adults")
				 booking.adults.focus()
				 booking.adults.select()
				 return false
			}

			if (!validChildren(booking.children.value)) {
			     alert("Please enter the number of children")
				 booking.children.focus()
				 booking.children.select()
				 return false
			}
			
			if (!validVerif_box(booking.verif_box.value)) {
			     alert("Please enter the verification code")
				 booking.verif_box.focus()
				 booking.verif_box.select()
				 return false
			}	

			return true
		}
//End of form validation-->
              

