
function validateForm() 
{
 var okSoFar=true
 with (document.bookingform)
 {

  if (roomtype.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please select your room type.")
    roomtype.focus()
  }
	
	 if (in_month.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please select the check-in date.")
    in_month.focus()
  }
	if (in_day.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please select the check-in date.")
    in_day.focus()
  }

	if (in_year.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please select the check-in date.")
    in_year.focus()
  }

	 if (out_month.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please select the check-out date.")
    out_month.focus()
  }
	if (out_day.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please select the check-out date.")
    out_day.focus()
  }

	if (out_year.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please select the check-out date.")
    out_year.focus()
  }

  if (no_rooms.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please select the number of rooms do you want to book with us")
    no_rooms.focus()
  }

	if (no_guest.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please select the number of guest(s)")
    no_guest.focus()
  }

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

	  var foundAt = email.value.indexOf("@",0)
  if (foundAt < 1 && okSoFar)
  {
    okSoFar = false
    alert ("Please enter a valid email address.")
    email.focus()
  }
  var e1 = email.value
  var e2 = email2.value
  if (!(e1==e2) && okSoFar)
  {
    okSoFar = false
    alert ("Email addresses you entered do not match.  Please re-enter.")
    email.focus()
  }

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