function validateReservation(theForm) {
	
     if(trim(theForm.reservation_first_name.value) == ""){
		alert ('You have not entered a first name');
		theForm.reservation_first_name.focus();
		return false;
     }
	 
     if(trim(theForm.reservation_last_name.value) == ""){
		alert ('You have not entered a last name');
		theForm.reservation_last_name.focus();
		return false;
     }
	 
     if(trim(theForm.reservation_email.value) == ""){
		alert ('You have not entered an email address');
		theForm.reservation_email.focus();
		return false;
     }
	 
     if(trim(theForm.reservation_phone.value) == ""){
		alert ('You have not entered a phone number');
		theForm.reservation_phone.focus();
		return false;
     }
	 
     if(theForm.reservation_hotel.value == "Other" && trim(theForm.reservation_pickup_other.value) == ""){
		alert ('You must give further pickup instructions.');
		theForm.reservation_pickup_other.focus();
		return false;
     }
     if(theForm.reservation_hotel.value == "None" && trim(theForm.reservation_pickup_other.value) == ""){
		alert ('You have not entered a pickup location');
		theForm.reservation_hotel.focus();
		return false;
     }
}

function validateCCForm(theForm) {
	
     if(trim(theForm.x_cc_name.value) == ""){
		alert ('You have not entered a name');
		theForm.reservation_name.focus();
		return false;
     }
	 
     if(trim(theForm.x_cc_type.value) == ""){
		alert ('You have not entered a credit card type');
		theForm.reservation_name.focus();
		return false;
     }
	 
     if(trim(theForm.x_cc_num.value) == ""){
		alert ('You have not entered a credit card number');
		theForm.reservation_email.focus();
		return false;
     }
	 
     if(trim(theForm.x_cc_exp.value) == ""){
		alert ('You have not entered an expiration date');
		theForm.reservation_phone.focus();
		return false;
     }
	 
     if(trim(theForm.x_cc_vvn.value) == ""){
		alert ('You have not entered a VVN (Verification number) The VVN is on the back of your card near your signature.');
		theForm.reservation_phone.focus();
		return false;
     }
}

function trim(sString) {
	while (sString.substring(0,1) == ' '){
		sString = sString.substring(1, sString.length);
	}
	while (sString.substring(sString.length-1, sString.length) == ' '){
		sString = sString.substring(0,sString.length-1);
	}
	return sString;
}