function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}

function Contact(theForm)
{

  if (theForm.Vendor.value == "")
  	{alert("Please select a cruise line.");
    theForm.Vendor.focus();
    return (false);}
  if (theForm.DeptDate.value == "")
  	{alert("Please select a departure date.");
    theForm.DeptDate.focus();
    return (false);}
  if (theForm.DeptYear.value == "")
  	{alert("Please select a departure year.");
    theForm.DeptYear.focus();
    return (false);}
  if (theForm.Nights.value == "")
  	{alert("Please select the duration of the cruise.");
    theForm.Nights.focus();
    return (false);}
  if (theForm.Destination.value == "")
  	{alert("Please select a destination.");
    theForm.Destination.focus();
    return (false);}
  if (theForm.Staterooms.value == "")
  	{alert("Please select the number of staterooms.");
    theForm.Staterooms.focus();
    return (false);}
  if (theForm.CabinType.value == "")
  	{alert("Please select the cabin type.");
    theForm.CabinType.focus();
    return (false);}
  if (theForm.Dining.value == "")
  	{alert("Please select the dining preference.");
    theForm.Dining.focus();
    return (false);}
  if (theForm.TimeFrame.value == "")
  	{alert("Please select the time frame.");
    theForm.TimeFrame.focus();
    return (false);}
  if (theForm.Adults.value == "")
  	{alert("Please select the number of adults.");
    theForm.Adults.focus();
    return (false);}    
  if (theForm.Kids.value == "")
  	{alert("Please select the number of children.");
    theForm.Kids.focus();
    return (false);}    
  if (theForm.Passenger1.value == "")
  	{alert("Please type the passenger name.");
    theForm.Passenger1.focus();
    return (false);}    
  if (theForm.Age1.value == "")
  	{alert("Please type the passenger age.");
    theForm.Age1.focus();
    return (false);}    
  if (theForm.Passenger2.value == "")
  	{alert("Please type the passenger name.");
    theForm.Passenger2.focus();
    return (false);}    
  if (theForm.Age2.value == "")
  	{alert("Please type the passenger age.");
    theForm.Age2.focus();
    return (false);}    
  if (theForm.DepartCity.value == "")
  	{alert("Please type the departure city.");
    theForm.DepartCity.focus();
    return (false);}    
  if (theForm.ContactName.value == "")
  	{alert("Please type your full name.");
    theForm.ContactName.focus();
    return (false);}    
  if (theForm.Address.value == "")
  	{alert("Please type your address.");
    theForm.Address.focus();
    return (false);}    
  if (theForm.City.value == "")
  	{alert("Please type your city.");
    theForm.City.focus();
    return (false);}    
  if (theForm.State.value == "")
  	{alert("Please type your state.");
    theForm.State.focus();
    return (false);}    
  if (theForm.Zip.value == "")
  	{alert("Please type your zip.");
    theForm.Zip.focus();
    return (false);}    
  if (theForm.PhoneCode.value == "")
  	{alert("Please type telephone area code.");
    theForm.PhoneCode.focus();
    return (false);}    
  if (theForm.PhoneNumber.value == "")
  	{alert("Please type telephone number.");
    theForm.PhoneNumber.focus();
    return (false);}    
    
  if (theForm.EmailAddress.value == "")
  	{alert("Please enter your email address.");
    theForm.EmailAddress.focus();
    return (false);}

  if (!isEmailAddr(theForm.EmailAddress.value))
  { alert("Sorry, the email address you entered is invalid!\n\ne.g.:     yourname@yourdomain.com");
    theForm.EmailAddress.focus();
    return (false);}

  return (true);
}