<!-- hide script from older browsers
function validateForm(mainform)
{

var x=document.forms["mainform"]["name"].value;
if (x==null || x=="")
  {
  alert("First name must be filled out");
  return false;
  }
  
  
var x=document.forms["mainform"]["email"].value;
var atpos=x.indexOf("@");
var dotpos=x.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
  {
  alert("Not a valid e-mail address");
  return false;
  }
  
var x=document.forms["mainform"]["phone"].value;

if (x==null || x=="")
  {
  alert("Please Enter Phone Number.");
  return false;
  }


if(x.length!=10)
  {
alert("Invalid phone number length! Please try again.")
      return false;
 }
var num = "0123456789";
for (var i=0; i < x.length; i++)
    {
         //put in temp variable each character, one at a time.
         temp = "" + x.substring(i, i+1);
    //check index of a phone character in the "valid" variable.
    // if temp contains a character which is not in "valid" variable,
    //then valid.indexOf(temp) will be -1, otherwise it may be 0.1.2.3.4.5.6.7.8 or 9

    if (num.indexOf(temp) == "-1")
      {
       alert("Invalid characters in your phone. Please try again.")
       return false;
      }
	}
	


var x=document.forms["mainform"]["city"].value;
if (x==null || x=="")
  {
  alert("Please fill the departure city name.");
  return false;
  }
 
var x=document.forms["mainform"]["destination_city"].value;
if (x==null || x=="")
 {
  alert("Please enter destination city.");
  return false;
 }
 
}
