// JavaScript Document
function validateFrom(){
var thisform = document.fromairport;
var airport = thisform.airport.selectedIndex;
if (airport==0){alert ("What airport do you want to be picked up from?"); document.fromairport.airport.focus(); return false;}

// validate address info
var dropoffaddress = thisform.dropoffaddress.value;
var dropoffcity = thisform.dropoffcity.value;
var dropoffstate = thisform.dropoffstate.selectedIndex;
var dropoffzip = thisform.dropoffzip.value;

if (dropoffaddress.length<5){alert ("What\'s the destination street address?"); document.fromairport.dropoffaddress.focus(); return false;}
if (dropoffcity.length<2){alert ("What\'s the destination city?"); document.fromairport.dropoffcity.focus(); return false;}
if (dropoffstate==0){alert ("What\'s the destination state?"); document.fromairport.dropoffstate.focus(); return false;}
if (dropoffzip.length<5){alert ("What\'s the destination zip code?"); document.fromairport.dropoffzip.focus(); return false;}

document.fromairport.pointA.value = thisform.airport.options[thisform.airport.selectedIndex].text; 
document.fromairport.pointB.value = dropoffaddress+", "+dropoffcity+", "+thisform.dropoffstate.options[thisform.dropoffstate.selectedIndex].text+" "+dropoffzip;
	
}

//////////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////////

function validateTo(){
var thisform = document.toairport;
var pickupaddress = thisform.pickupaddress.value;
var pickupcity = thisform.pickupcity.value;
var pickupstate = thisform.pickupstate.selectedIndex;
var pickupzip = thisform.pickupzip.value;

if (pickupaddress.length<5){alert ("What\'s the pickup street address?"); document.toairport.pickupaddress.focus(); return false;}
if (pickupcity.length<2){alert ("What\'s the pickup city?"); document.toairport.pickupcity.focus(); return false;}
if (pickupstate==0){alert ("What\'s the pickup state?"); document.toairport.pickupstate.focus(); return false;}
if (pickupzip.length<5){alert ("What\'s the pickup zip code?"); document.toairport.pickupzip.focus(); return false;}


var airport = thisform.airport.selectedIndex;

if (airport==0){alert ("What airport do you want to be dropped off?"); document.toairport.airport.focus(); return false;}
document.toairport.pointA.value =  pickupaddress+", "+pickupcity+", "+thisform.pickupstate.options[thisform.pickupstate.selectedIndex].text+" "+pickupzip;
document.toairport.pointB.value = thisform.airport.options[thisform.airport.selectedIndex].text;
	
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function validateInter(){
var thisform = document.interairport;
var airport = thisform.airport.selectedIndex;
var airport2 = thisform.airport2.selectedIndex;

if (airport==0){alert ("What airport do you want to be picked up from?"); document.interairport.airport.focus(); return false;}

if (airport2==0){alert ("What airport do you want to be dropped off?"); document.interairport.airport2.focus(); return false;}
if (airport2==airport){alert ("The arrival and destination airports cannot be the same"); document.interairport.airport2.focus(); return false;}

document.interairport.pointA.value = thisform.airport.options[thisform.airport.selectedIndex].text;
document.interairport.pointB.value = thisform.airport2.options[thisform.airport2.selectedIndex].text;

}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function validateNon(){
	var thisform = document.nonairport;
	var pickupaddress = thisform.pickupaddress.value;
var pickupcity = thisform.pickupcity.value;
var pickupstate = thisform.pickupstate.selectedIndex;
var pickupzip = thisform.pickupzip.value;

if (pickupaddress.length<5){alert ("What\'s the pickup street address?"); document.nonairport.pickupaddress.focus(); return false;}
if (pickupcity.length<2){alert ("What\'s the pickup city?"); document.nonairport.pickupcity.focus(); return false;}
if (pickupstate==0){alert ("What\'s the pickup state?"); document.nonairport.pickupstate.focus(); return false;}
if (pickupzip.length<5){alert ("What\'s the pickup zip code?"); document.nonairport.pickupzip.focus(); return false;}
	
var dropoffaddress = thisform.dropoffaddress.value;
var dropoffcity = thisform.dropoffcity.value;
var dropoffstate = thisform.dropoffstate.selectedIndex;
var dropoffzip = thisform.dropoffzip.value;

if (dropoffaddress.length<5){alert ("What\'s the destination street address?"); document.nonairport.dropoffaddress.focus(); return false;}
if (dropoffcity.length<2){alert ("What\'s the destination city?"); document.nonairport.dropoffcity.focus(); return false;}
if (dropoffstate==0){alert ("What\'s the destination state?"); document.nonairport.dropoffstate.focus(); return false;}
if (dropoffzip.length<5){alert ("What\'s the destination zip code?"); document.nonairport.dropoffzip.focus(); return false;}

document.nonairport.pointA.value =  pickupaddress+", "+pickupcity+", "+thisform.pickupstate.options[thisform.pickupstate.selectedIndex].text+" "+pickupzip;
document.nonairport.pointB.value = dropoffaddress+", "+dropoffcity+", "+thisform.dropoffstate.options[thisform.dropoffstate.selectedIndex].text+" "+dropoffzip;

	
}