function populateDroplists(dropList) { // Also in phpinc/Constant.php var FAREOFFICE_LINK = "/FareofficeLink"; var dynaURL = FAREOFFICE_LINK + "/ContentManager/Components/portalsearchcar_alamo/Criterion/listUpdate.php" dynaURL = dynaURL + "?company_id=" + document.standard.company_id.value; dynaURL = dynaURL + "&formTrackNo=" + document.standard.formTrackNo.value; // Pickup if (dropList=="pickup_location_type_city" || dropList=="pickup_location_type_airport") { if (dropList=="pickup_location_type_city") dynaURL = dynaURL + "&pickup_location_type=CITY"; if (dropList=="pickup_location_type_airport") dynaURL = dynaURL + "&pickup_location_type=AIRPORT"; dynaURL = dynaURL + "&update_pickup_stations=true"; } else { if (document.standard.pickup_location_type[0].checked) dynaURL = dynaURL + "&pickup_location_type=AIRPORT"; else dynaURL = dynaURL + "&pickup_location_type=CITY"; } // Dropoff if (dropList=="dropoff_location_type_city" || dropList=="dropoff_location_type_airport") { if (dropList=="dropoff_location_type_city") dynaURL = dynaURL + "&dropoff_location_type=CITY"; if (dropList=="dropoff_location_type_airport") dynaURL = dynaURL + "&dropoff_location_type=AIRPORT"; dynaURL = dynaURL + "&update_dropoff_stations=true"; } else { if (document.standard.dropoff_location_type[0].checked) dynaURL = dynaURL + "&dropoff_location_type=AIRPORT"; else dynaURL = dynaURL + "&dropoff_location_type=CITY"; } dynaURL = dynaURL + "&pickup_country_code=" + document.standard.pickup_country_code.value; if (dropList!="pickup_country_code") { dynaURL = dynaURL + "&pickup_station_code=" + document.standard.pickup_station_code.value; if (dropList!="pickup_station_code") { dynaURL = dynaURL + "&dropoff_country_code=" + document.standard.dropoff_country_code.value; if (dropList!="dropoff_country_code") { dynaURL = dynaURL + "&dropoff_station_code=" + document.standard.dropoff_station_code.value; } } try { if (dropList == "pickup_station_code") { vacpickupdiv = parent.document.getElementById("vacances_pu_station_code"); vacdropoffdiv = parent.document.getElementById("vacances_do_station_code"); if(vacpickupdiv != null) { vacpickupdiv.innerHTML = document.standard.pickup_station_code.value; } if(vacdropoffdiv != null) { vacdropoffdiv.innerHTML = document.standard.pickup_station_code.value; } } if (dropList == "dropoff_station_code") { vacdropoffdiv = parent.document.getElementById("vacances_do_station_code"); if(vacdropoffdiv != null) { vacdropoffdiv.innerHTML = document.standard.dropoff_station_code.value; } } } catch (e) { } } try { if (dropList == "pickup_country_code") { vacpickupdiv = parent.document.getElementById("vacances_pu_station_code"); vacdropoffdiv = parent.document.getElementById("vacances_do_station_code"); if(vacpickupdiv != null) { vacpickupdiv.innerHTML = ''; } if(vacdropoffdiv != null) { vacdropoffdiv.innerHTML = ''; } } else if (dropList == "dropoff_country_code") { vacdropoffdiv = parent.document.getElementById("vacances_do_station_code"); if(vacdropoffdiv != null) { vacdropoffdiv.innerHTML = ''; } } } catch (e) { } dynaURL = encodeURI(dynaURL); document.getElementById("dynaFrame").src = dynaURL; } // function addOption(droplist, name, value) { droplist.options[droplist.options.length] = new Option(name, value); } // function alterDropoffTime(pickupYear1, pickupDay) { pickupYear = pickupYear1.options[pickupYear1.selectedIndex].value; pickupMonthIndex = pickupYear1.selectedIndex; var currentDate = new Date(); var currentMonth = currentDate.getMonth(); var pickupDate = new Date(); var dropoffDate = new Date(); //pickupMonth can be 14 - then March next year is intended var pickupMonth = pickupMonthIndex + currentMonth; // Set dateobject to selected pickup date dropoffDate.setFullYear(pickupYear.substr(3), pickupMonth, (pickupDay + 8)); var dropoffMonth = dropoffDate.getMonth(); var dropoffDay = dropoffDate.getDate(); dropoffMonthIndex = dropoffMonth - currentMonth; var dropoffYear = dropoffDate.getFullYear();//ex2010 var currentYear = currentDate.getFullYear();//ex2009 if(dropoffYear != currentYear) { // Example: dropoff is next year, February (1), current Month is November (10). // Dropoffmonth index = 1 - 10 = -9. Add 12 to get the correct 3 month offset, from current month. if (dropoffMonthIndex <= 0) dropoffMonthIndex = dropoffMonthIndex + 12; if (dropoffMonthIndex > (document.getElementById('dropoff_month').length - 1)) { // Dropoff is greater than the max display range. Show latest possible date. dropoffMonthIndex = pickupMonthIndex; dropoffDay = document.getElementById('dropoff_day').length - 1; } } document.getElementById('dropoff_day').options[dropoffDay-1].selected = true; document.getElementById('dropoff_month').options[dropoffMonthIndex].selected = true; } function checkStationOpenHrs1() { var pickup_time_allowed = false; var dropoff_time_allowed = false; try { var monthArr = {"jan":0, "feb":1, "mar":2, "apr":3, "may":4, "jun":5, "jul":6, "aug":7, "sep":8, "oct":9, "nov":10, "dec":11}; var weekArr = {1:"mo", 2:"tu" , 3:"we", 4:"th", 5:"fr", 6:"sa", 0:"su" }; // pickup time pm = document.getElementById("pickup_month"); pd = document.getElementById("pickup_day"); pt = document.getElementById("pickup_time"); pd1 = pd.options[pd.selectedIndex].value; pm1 = pm.options[pm.selectedIndex].value; pt1 = pt.options[pt.selectedIndex].value; y = pm1.substr(3); m = pm1.substr(0,3); day = new Date(y,monthArr[m],pd1).getDay(); day = weekArr[day]; //alert(day); pt1 = pt1.replace(":", ""); if(pt1.substr(0,1) == '0') { pt1 = pt1.substr(1,3); } time_range = week_pickup[day]; for (j=0; j= time_range[j]['open'] && pt1 <= time_range[j]['close']) { pickup_time_allowed = true; break; } } if (pickup_time_allowed == false) { alert("Pickup Station closed at this day/time.\nPlease get the info from the info (i) button."); return false; } } catch (e) { } return submitWithProgress(); }