function formvalidate()
{
   formobj=document.airbookfrm; 
    var nop=formobj.nop.value;
    var num=parseInt(nop.length)
  if(nop=="")
   {
     alert("Specify No.of persons travelling");
     formobj.nop.focus();
   	 return false;
   }
  else
   {
      for(i=0;i<num;++i)
       {
         var str=nop.substring(i,i+1);
         if(!(str>="0" && str<="9"))
          {
            alert("Number of perosns field will accept only Numbers!!!!");
            formobj.nop.focus();
       		return false;
          }
       }
    }

var namefield=formobj.name.value;
var num=parseInt(namefield.length)

if(namefield=="")
 {
   alert("Specify name of the Passenger");
   formobj.name.focus();
   return false;
 }
 else
 {
    for(i=0;i<num;++i)
     {
        var str=namefield.substring(i,i+2);
        if(!((str>="A" && str<="Z")||(str>="a" &&str<="z")))
         {
           alert("Name Field will accept only Alphabets");
           formobj.name.focus();
           return false; 
         }
     }
  }	
      
 myOption = -1; 
      for (i=0; i<formobj.adult.length; i++) 
       { 
        if (formobj.adult[i].checked) 
         {
           myOption = i;
         }
       }
      if (myOption == -1) 
       { 
        alert("Specify whether Adult/Child/Infant");
       	formobj.adult[0].focus();
        return false; 
       }
       
 if (formobj.nationality.value == "")
	 	{
			alert("Please specify the Nationality");
            		formobj.nationality.focus();
            		return false;
		}


myOption= -1
 for(i=0;i<formobj.mode.length;i++)
  {
     if(formobj.mode[i].checked)
      {
       myOption=i;
      }
   }    
  if(myOption==-1)
    {
      alert("Select the Mode\nTick the CheckBoxes accordingly !!");
      formobj.mode[0].focus();
      return false;
    }   
    
  if(formobj.mode[2].checked && formobj.passportno.value=="")
   {
     alert("Please fill in your Passport Number.\nMandatory for International Bookings");
     formobj.passportno.focus();
     return false;
   }

  if(formobj.mode[3].checked && formobj.passportno.value=="")
   {
     alert("Please fill in your Passport Number.\nMandatory for International Bookings");
     formobj.passportno.focus();
     return false;
   }
  if(formobj.mode[4].checked && formobj.passportno.value=="")
   {
     alert("Please fill in your Passport Number.\nMandatory for International Bookings");
     formobj.passportno.focus();
     return false;
   }
  if(formobj.passportno.value!="" && formobj.doi.value=="" && formobj.poi.value=="")
   {
     alert("Please fill in the\nDate of Issue\nand\nPlace of Issue of the Pasport");
     formobj.doi.focus();
     return false;
   }
  else if (formobj.sectorfrom1.value == "")
	 	{
			alert("Atleast one sector details has to be filled");
            		formobj.sectorfrom1.focus();
            		return false;
		}
		
	else if (formobj.sectorto1.value == "")
		{
			alert("Atleast one sector details has to be filled");
            		formobj.sectorto1.focus();
            		return false;
		}
else if (formobj.sectordate1.value == "")
		{
			alert("Atleast one sector details has to be filled");
            		formobj.sectordate1.focus();
            		return false;
		}

 myOption = -1; 
      for (i=0; i<formobj.cotravel.length; i++) 
       { 
        if (formobj.cotravel[i].checked) 
         {
           myOption = i;
         }
       }
      if (myOption == -1) 
       { 
        alert("Please select the Class of Travel");
       	formobj.cotravel[0].focus();
        return false; 
       }
       
   if(formobj.nameofapp.value==0)
       {
			alert("Specify Name of the Applicant");
            		formobj.nameofapp.focus();
            		return false;
       }
   else if(formobj.mailingaddress.value==0)
       {
			alert("Specify the Mailing Address");
            		formobj.mailingaddress.focus();
            		return false;
       }
       if (formobj.email.value == "")
		{
			alert("Provide E-Mail for immediate assistance.");
            		formobj.email.focus();
            		return false;
		}
		str1=formobj.email.value
		s= str1.lastIndexOf("@");
		if (s == -1 )
		{
			alert("Invalid E-mail Address !");
            		formobj.email.focus();
            		return false;
		}
		s1= str1.lastIndexOf(".");
		if (s1 == -1 )
		{
			alert("Invalid E-mail Address !");
            		formobj.email.focus();
            		return false;
		}
if (document.all||document.getElementById)
{
  for (i=0;i<formobj.length;i++)
   {
     var tempobj=formobj.elements[i]
     if(tempobj.type.toLowerCase()=="submit")
	
	tempobj.disabled=true
	}

  }
  return true;
 }


