function checkchar(pass){
if (pass==1)
{
field=document.incoming.name.value;
target=incoming.name;
var msg="Please remove numbers & special characters from the name field!"
}

if (pass==2)
{
field=document.incoming.surname.value;
target=incoming.surname;
var msg="Please remove numbers & special characters from the surname field!"
}

		var notvalid;
		for (var i=0, notvalid="0123456789!@#$%^&*()+=-[]\\\';,./{}|\":<>?"; i<field.length; i++)
		{
       		if (notvalid.indexOf(field.charAt(i)) != -1)
		{
			alert(msg);
			target.focus(); 
			return false;
		}
		}
		

}
//************************************************************************************
function checknum(num){
if (num==1)
{
field=document.incoming.telmob.value;
target=incoming.telmob;
var msg="Please use only numbers in the tel/mobile field!"
}

if (num==2)
{
field=document.incoming.adult.value;
target=incoming.adult;
var msg="Please use only numbers in the adult field!"
}

if (num==3)
{
field=document.incoming.child.value;
target=incoming.child;
var msg="Please use only numbers in the child field!"
}

if (num==4)
{
field=document.incoming.student.value;
target=incoming.student;
var msg="Please use only numbers in the student field!"
}

var notvalid;
		for (var i=0, notvalid="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()=-[]\\\';,./{}|\":<>?"; i<field.length; i++)
		{
       		if (notvalid.indexOf(field.charAt(i)) != -1)
		{
			alert(msg);
			target.focus(); 
			return false;
		}
		}

}
//***************************************************************************************************
function checkemail(){
var cemail=document.incoming.email.value;
if (cemail.length > 1 )
{

if(cemail.indexOf('_@')!=-1 || cemail.indexOf('@_')!=-1 || cemail.indexOf('_.')!=-1 || cemail.indexOf('-@')!=-1 || cemail.indexOf('@-')!=-1 || cemail.indexOf('-.')!=-1)
{
alert("Please input a valid email address!\n\n Ex: me@noname.com");
incoming.email.focus();
return false;
}

var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i

if (filter.test(cemail))
return true;
else
{
alert("Please input a valid email address!\n\nEx: me@noname.com");
incoming.email.focus();
return false;
}
}
}

//**********************************************************************************

function opendis(){
if (document.incoming.trb[0].checked)
{
document.incoming.airport.disabled=false;
document.incoming.flightno.disabled=false;
document.incoming.dhr.disabled=false;
document.incoming.dmin.disabled=false;
document.incoming.ahr.disabled=false;
document.incoming.amin.disabled=false;
document.incoming.airlines.disabled=false;
}
else if (document.incoming.trb[1].checked)
{
document.incoming.airport.disabled=true;
document.incoming.flightno.disabled=true;
document.incoming.dhr.disabled=true;
document.incoming.dmin.disabled=true;
document.incoming.ahr.disabled=true;
document.incoming.amin.disabled=true;
document.incoming.airlines.disabled=true;
}

}


//**********************************************************************************
function checkall()
{

var msg="(*)Please enter the mandatory fields...\n\n";
if ( document.incoming.name.value.length < 1 ) {
				msg +="- Your name!\n";
				}

if ( document.incoming.surname.value.length < 1 ) {
				msg +="- Your surname!\n";
				}
				
var ctelmob=document.incoming.telmob.value.length;
var cemail=document.incoming.email.value.length;
	
if (cemail < 1 && ctelmob <1) {
				msg +="- One of your contact information!\n";
				}

if ( document.incoming.address.value.length < 1 ) {
				msg +="- Address!\n";
				}

//Passenger Details***

var a=document.incoming.adult.value.length;
var c=document.incoming.child.value.length;
var s=document.incoming.student.value.length;

if (a <1 && c <1 && s <1){
				msg +="- Please enter the number of the passenger type!\n  (adult-child-student)\n";
				}

if ( document.incoming.cindate.value.length < 1) {
				msg +="- Check in Date!\n";
				}

if ( document.incoming.coutdate.value.length < 1) {
				msg +="- Check out Date!\n";
				}

var fb=document.incoming.hrb[0].checked;
var hb=document.incoming.hrb[1].checked;
var bb=document.incoming.hrb[2].checked;
			
if ( fb==false && hb==false && bb==false)
			{
			msg +="- Please select one of type'FB,HB,BB'!\n";		
			}						

if (document.incoming.trb[0].checked)
{
if ( document.incoming.airport.value=='Airport') {
				msg +="- Airport!\n";
				}	
if ( document.incoming.flightno.value.length < 1) {
				msg +="- Flight No!\n";
				}	
if ( document.incoming.dhr.value=='hr') {
				msg +="- Departure Time(hr)!\n";
				}	
if ( document.incoming.dmin.value=='min') {
				msg +="- Departure Time(min)!\n";
				}	
if ( document.incoming.ahr.value=='hr') {
				msg +="- Arrival Time(hr)!\n";
				}	
if ( document.incoming.amin.value=='min') {
				msg +="- Arrival Time(min)!\n";
				}	
				
if ( document.incoming.airlines.value.length < 1) {
				msg +="- Arrival Time(min)!\n";
				}					
}

			if(msg=="(*)Please enter the mandatory fields...\n\n") 
        { 
			return true;
            
        } 
        else 
        { 
			
            alert(msg); 
            return false; 
        } 		

}