function doValidate(Form)

{

//for contact name

  if (Form.pi_name.value == "")

  {

    alert("Please enter your Name");

    Form.pi_name.focus();

    return (false);

  }

//for organization
  if (Form.pi_organization.value == "")

  {

    alert("Please enter your Organization Name");

    Form.pi_organization.focus();

    return (false);

  }


//for address

  if (Form.pi_address.value == "")

  {

    alert("Please fill in your address.");

    Form.pi_address.focus();

    return (false);

  }

//for city

  if (Form.pi_city.value == "")

  {

    alert("Please enter your city name.");

    Form.pi_city.focus();

    return (false);

  }

//for state

  if (Form.pi_state.value == "")

  {

    alert("Please enter your state name.");

    Form.pi_state.focus();

    return (false);

  }

// for zip code

  if (Form.pi_zip.value == "")

  {

    alert("Please enter your zipcode.");

    Form.pi_zip.focus();

    return (false);

  }

 //for phone validation

     if(Form.pi_phone.value=="")

    {

    alert("Please enter your telephone number")

    Form.pi_phone.focus();

    return false;

    }

        if(Form.pi_phone.value!='')

    {

      s=Form.pi_phone.value;

      isnot="!@#$%^&*()=|\~`?/><,':;{[}]";

 var  inval= false;

 var x;

 isnot=isnot+'"'

 for (var i=0; i<s.length; i++)

 {

 for (x=0; x<isnot.length; x++)

 {

 if (s.charAt(i) == isnot.charAt(x))

 inval = true

 }

 }

 if (inval == true)

 {

	alert("Please do not enter special characters in the telephone field.");

                Form.pi_phone.focus();

                return false;

       }

    }

if (Form.pi_phone.value!= '')

{

 s=Form.pi_phone.value ;

 isnot="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

 var  inval= false;

 var x;

 for(var i=0; i<s.length; i++)

 {

 for (x=0; x<isnot.length; x++)

 {

 if (s.charAt(i) == isnot.charAt(x))

 inval = true

 }

 }

 if (inval ==true)

 {

	alert("Please enter only numericals for telephone number");

                Form.pi_phone.focus ();

                 return false;

       }

    }

 //this is for fax number

    if(Form.pi_fax.value!='')

    {

      s=Form.pi_fax.value;

      isnot="!@#$%^&*()=|\~`?/><,':;{[}]";

 var  inval= false;

 var x;

 isnot=isnot+'"'

 for (var i=0; i<s.length; i++)

 {

 for (x=0; x<isnot.length; x++)

 {

 if (s.charAt(i) == isnot.charAt(x))

 inval = true

 }

 }

 if (inval == true)

 {

	alert("Please do not enter special characters in the Fax number field.");

                thForm.pi_fax.focus();

                return false;

       }

    }

if (Form.pi_fax.value!= '')

{

 s=Form.pi_fax.value ;

 isnot="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

 var  inval= false;

 var x;

 for(var i=0; i<s.length; i++)

 {

 for (x=0; x<isnot.length; x++)

 {

 if (s.charAt(i) == isnot.charAt(x))

 inval = true

 }

 }

 if (inval ==true)

 {

	alert("Please enter only numericals for the Fax number");

                Form.pi_fax.focus ();

                 return false;

       }

    }

//this is email validation

 if (Form.pi_email.value == "")

  {

    alert("Please enter your E-mail.");

    Form.pi_email.focus();

    return (false);

  }



  if ((Form.pi_email.value.indexOf("@") == -1) ||

     (Form.pi_email.value.indexOf("@") > Form.pi_email.value.lastIndexOf(".")))

  {

     alert("Please enter your email address in this format(johnmike@hotmail.com)");

     Form.pi_email.focus();

	  return (false);

  }



  if ((Form.pi_email.value.lastIndexOf(".") - Form.pi_email.value.indexOf("@") < 2) ||

		(Form.pi_email.value.lastIndexOf(".") - Form.pi_email.value.indexOf("@") > 65))

  {

     alert("Please enter your email address in this format(johnmike@hotmail.com)");

     Form.pi_email.focus();

	  return (false);

  }

  //for destinationt name

 /* if (Form.pi_destination.value == "")

  {

    alert("Please enter your Destination");

    Form.pi_destination.focus();

    return (false);

  }

  //for destinationt name

  if (Form.pi_deptdate.value == "")

  {

    alert("Please enter your Departure Date");

    Form.pi_deptdate.focus();

    return (false);

  }

  //for destinationt name

  if (Form.pi_depttime.value == "")

  {

    alert("Please enter your Departure Time");

    Form.pi_depttime.focus();

    return (false);

  }

  //for destinationt name

  if (Form.pi_deptloc.value == "")

  {

    alert("Please enter your Departure Location");

    Form.pi_deptloc.focus();

    return (false);

  }

   //for destinationt name

  if (Form.pi_deptloc.value == "")

  {

    alert("Please enter your Departure Location");

    Form.pi_deptloc.focus();

    return (false);

  }

   //for destinationt name

  if (Form.pi_deptloc.value == "")

  {

    alert("Please enter your Departure Location");

    Form.pi_deptloc.focus();

    return (false);

  }

   //for destinationt name

  if (Form.pi_deptloc.value == "")

  {

    alert("Please enter your Departure Location");

    Form.pi_deptloc.focus();

    return (false);

  }

   //for destinationt name

  if (Form.pi_deptloc.value == "")

  {

    alert("Please enter your Departure Location");

    Form.pi_deptloc.focus();

    return (false);

  }*/

 if (Form.pi_deptdate.value == "")
	{

	alert("Please Select Departure Date from Calender");
	Form.pi_deptdate.focus();
	return (false);

	}
if (Form.pi_retdate.value == "")
	{

	alert("Please Select Return Date from Calender");
	Form.pi_retdate.focus();
	return (false);

	}


}