<!--

function goto_URL(object) {
    window.location.href = object.options[object.selectedIndex].value;
}

function Pick_Loc() {
   Pickup_Loc = document.rental.Pick_Location.value;
   document.rental.Drop_Location.value = Pickup_Loc;
}

function Drop_Loc() {
   Dropoff_Loc = document.rental.Drop_Location.value;
 /*  if(Dropoff_Loc == "Maui - Kahului Airport") {
      document.rental.Pick_Location.value = Dropoff_Loc;
   }
   if(Dropoff_Loc == "Maui - Kaanapali") {
      document.rental.Pick_Location.value = Dropoff_Loc;
   }*/
   if(Dropoff_Loc == "Kauai - Lihue Airport") {
      document.rental.Pick_Location.value = Dropoff_Loc;
   }
}

function Pi_Month() {
   Pickup_Month = document.rental.Pick_Month.value;
   document.rental.Drop_Month.value = Pickup_Month;
}
function Pi_Day() {
   Pickup_Day = document.rental.Pick_Day.value;
   document.rental.Drop_Day.value = Pickup_Day;
}
function Pi_Year() {
   Pickup_Year = document.rental.Pick_Year.value;
   document.rental.Drop_Year.value = Pickup_Year;
}


function validate() {

   now = new Date;
   day2 = addDays(new Date(),2);
   
      
   date0 = "01/01/2011";
   date1 = document.rental.Pick_Month.value+"/"+document.rental.Pick_Day.value+"/"+document.rental.Pick_Year.value;
   date2 = document.rental.Drop_Month.value+"/"+document.rental.Drop_Day.value+"/"+document.rental.Drop_Year.value;
   date3 = (now.getMonth()+1)+"/"+now.getDate()+"/"+now.getFullYear();
   date4 = (day2.getMonth()+1)+"/"+day2.getDate()+"/"+day2.getFullYear();

   date_lim  = Date.parse(date0);
   date_num1 = Date.parse(date1);
   date_num2 = Date.parse(date2);
   date_num3 = Date.parse(date3);
   date_num4 = Date.parse(date4);
   
   date_diff = date_num2 - date_num1;
   date_diff2 = date_num1 - date_num4;
  
   rtime1 = document.rental.Pick_Time.value;
   rtime2 = document.rental.Drop_Time.value;   
   
   rtime_diff = rtime2 - rtime1;
	 
/*	 if (document.rental.Pick_Month.value) < (now.getMonth()) {
	    Pickup_Year = document.rental.Pick_Year.value+1;
      document.rental.Drop_Year.value = Pickup_Year;
	 } */
   if (document.rental.Pick_AP[0].checked) {
      ptime1 = document.rental.Pick_AP[0].value;   	   
   }	   
   if (document.rental.Pick_AP[1].checked) {
      ptime1 = document.rental.Pick_AP[1].value;   	   
   }	   
   if (document.rental.Drop_AP[0].checked) {
      ptime2 = document.rental.Drop_AP[0].value;   	   
   }	   
   if (document.rental.Drop_AP[1].checked) {
      ptime2 = document.rental.Drop_AP[1].value;   	   
   }	   

   if (date_num1 >= date_lim) {
      alert("We are sorry, but at this point we are not able to process car pick-up dates beyond December 31, 2010."); 
      return false;
   }


   if (date_diff < 0) {
      alert("Your rental period needs to be at least 1 day in duration. Please check your pick-up and drop-off date."); 
      return false;
   }
   
   if (date_diff2 < 0) {
      alert("Your pick-up date needs to be at least 2 days later than today's date in order to book through our system.\n\nIf you wish to reserve a car with less than 2 days lead time, we may be able to help you right away if you call us at 1-866-300-7116, but we can't guarantee it!\n\nYou will also get this message if you have entered a date earlier than today's date. Perhaps you need to increment the year."); 
      return false;
   }

   if (date_diff == 0 && rtime_diff < 0) {
   	  if ((ptime1 == 'PM' && ptime2 == 'AM') || (ptime1 == 'AM' && ptime2 == 'AM') || (ptime1 == 'PM' && ptime2 == 'PM')) {
         alert("Your drop-off time cannot be earlier than your pick-up time on the same day!\n Please change your pick-up or drop-off date."); 
         return false;
      }   
   }
	 
	 
/*/-------------------------------------	 
	 if(Pickup_Loc == "Big Island - Kona Airport" || Pickup_Loc == "Big Island - Hilo Airport") {
		 if ( (date1 >= "12/24/2009" && date1 <= "12/29/2009") AND (date2 >= "12/24/2009" && date2 <= "12/29/2009") ) {
       alert("ALL CARS ARE SOLD OUT AT THIS LOCATION for Alamo, Budget, Thrifty, Avis, Dollar. We can try to arrange a car for Dec 30th or even cheaper for January 1st at regular non-Xmas Rates. For special arrangements call us at 1-888-300-7116."); 
       return true;
     }		 
	 }
//--------------------------------------	*/ 
   
   Pickup_Loc = document.rental.Pick_Location.value;
   Dropoff_Loc = document.rental.Drop_Location.value;
      
   if(Pickup_Loc == "Big Island - Kona Airport" || Pickup_Loc == "Big Island - Hilo Airport") {
      if(Dropoff_Loc != "Big Island - Kona Airport" && Dropoff_Loc != "Big Island - Hilo Airport") {
         alert("Only Big Island - Kona Airport and Hilo Airport are possible for drop off location.");
         return false;
      }
   }
  
   if(Dropoff_Loc == "Big Island - Kona Airport" || Dropoff_Loc == "Big Island - Hilo Airport") {
      if(Pickup_Loc != "Big Island - Kona Airport" && Pickup_Loc != "Big Island - Hilo Airport") {
        /* alert("Only Big Island - Kona Airport and Hilo Airport are possible for pick-up location.");*/
				 alert("You must pick-up and drop-off the car on the same island.");
         return false;
      }
   }
  
	 if(Pickup_Loc == "Oahu - Honolulu Airport" || Pickup_Loc == "Oahu - Honolulu City") {
      if(Dropoff_Loc != "Oahu - Honolulu Airport" && Dropoff_Loc != "Oahu - Honolulu City") {
         alert("Only Oahu - Honolulu Airport and Honolulu City are possible for drop off location.");
         return false;
      }
   }
  
   if(Dropoff_Loc == "Oahu - Honolulu Airport" || Dropoff_Loc == "Oahu - Honolulu City") {
      if(Pickup_Loc != "Oahu - Honolulu Airport" && Pickup_Loc != "Oahu - Honolulu City") {
         alert("You must pick-up and drop-off the car on the same island.");
         return false;
      }
   }
	
	 if(Pickup_Loc == "Maui - Kaanapali" || Pickup_Loc == "Maui - Kahului Airport") {
      if(Dropoff_Loc != "Maui - Kaanapali" && Dropoff_Loc != "Maui - Kahului Airport") {
         alert("Only Maui - Kaanapali and Kahului Airport are possible for drop off location.");
         return false;
      }
   }
  
   if(Dropoff_Loc == "Maui - Kaanapali" || Dropoff_Loc == "Maui - Kahului Airport") {
      if(Pickup_Loc != "Maui - Kaanapali" && Pickup_Loc != "Maui - Kahului Airport") {
         alert("You must pick-up and drop-off the car on the same island.");
         return false;
      }
   }
	
	
   /*Car_Select = document.rental.Car_Class.value;
   if(Car_Select == "PREF") {
      alert("Please select the vehicle class before you do the price check.");
      return false;
   }*/
}

function addDays(myDate,days) {
    return new Date(myDate.getTime() + days*24*60*60*1000);
}

//-->
