/* FILE ARCHIVED ON 21:00:44 Jan 17, 2009 AND RETRIEVED FROM THE AN OPENWAYBACK INSTANCE ON 2:14:32 Jul 30, 2024. JAVASCRIPT APPENDED BY OPENWAYBACK, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ var browser_type = navigator.appName; function getClientWidth() { if(document.compatMode){ if(document.compatMode == 'CSS1Compat' && !window.opera){ return document.documentElement.clientWidth; }else{ return document.body.clientWidth; } } } function getClientScrollLeft() { if(document.compatMode){ if(document.compatMode == 'CSS1Compat' && !window.opera){ return document.documentElement.scrollLeft; }else{ return document.body.scrollLeft; } } } function launchCalendar(calForm, formName, event){ eval('document.'+formName+'.currentCalForm.value = calForm'); /*QH: whit that we obtein the selected date in the combo*/ var month = ''; var day = ''; for (i=0;i we used before*/ background.innerHTML=" 
"; } background.style.height = document.body.scrollHeight + 'px'; background.style.width = document.body.scrollWidth + 'px'; background.style.position = "absolute"; background.style.top = 0; background.style.left = 0; background.style.zIndex=10000; background.onclick=function() { closeCalendarDiv(false); }; /* * ER#22784 - If the combos show DAY or MONTH, we set the current date and set a attribute so the date is not shown */ var highLigthDate = true; //if true, is needed to highligth the date in the calendar. We send this value via parameter to the calendar.jsp(view) if(day <= 0 || month <= 0) { var currentDate = new Date(); month = currentDate.getMonth()+1; day = currentDate.getDate(); highLigthDate = false; } var calendarDiv = document.createElement("div"); calendarDiv.id="calendarDiv"; var redir='/aa/common/calendar.jsp?qh_combo_month=' + month + '&qh_combo_day=' + day + '&qh_form_name=' + formName + '&qh_highLigth_date=' + highLigthDate; calendarDiv.innerHTML = ""; calendarDiv.visibility = true; calendarDiv.style.zIndex=11000; calendarDiv.style.position = "absolute"; /*We catch the mouse position to display the calendar DIV according that*/ var xMousePosition; var yMousePosition; if (!event) var event = window.event; if (event.pageX || event.pageY) { xMousePosition = event.pageX; yMousePosition = event.pageY; } else if (event.clientX || event.clientY) { xMousePosition = event.clientX; yMousePosition = event.clientY; } calendarDiv.style.height = '175px'; calendarDiv.style.width = '425px'; var offset = 0; var browser_version = parseInt(navigator.appVersion); var clientWidthVal = getClientWidth(); var clientScrollLeftVal = getClientScrollLeft(); if(browser_type == 'Microsoft Internet Explorer' && (browser_version >= 4)) { if (document.documentElement && document.documentElement.scrollTop) { offset = document.documentElement.scrollTop; } else if (document.body) { offset = document.body.scrollTop; } yMousePosition = yMousePosition + offset; } //IF CALENDAR WILL OPEN UP BEYOND BROWSER WIDTH ADJUST TO THE LEFT TAKING ANY LEFT SCROLL INTO CONSIDERATION// if( xMousePosition + 425 >= clientWidthVal + clientScrollLeftVal ){ xMousePosition = clientWidthVal + clientScrollLeftVal - 450; } calendarDiv.style.top = yMousePosition + 20 + 'px'; calendarDiv.style.left = xMousePosition - 50 + 'px'; calendarDiv.style.border = "1px solid #000000"; /* * This variable solves the problem that is rised in IE that considers combo boxes as native components */ var selectBlocker = document.createElement("IFRAME"); selectBlocker.id = "selectBlocker"; //TS # 23844: begings here //selectBlocker.src = "javascript:void(0);"; selectBlocker.src = "javascript:'';"; //TS # 23844:ends here selectBlocker.height = '175px'; selectBlocker.width = '425px'; selectBlocker.style.position = "absolute"; selectBlocker.style.top = yMousePosition + 20 + 'px'; selectBlocker.style.left = xMousePosition - 50 + 'px'; /*Create the BLUR */ var backgroundBlur = document.createElement("div"); backgroundBlur.id="backgroundDiv_Blur"; backgroundBlur.visibility = true; backgroundBlur.style.background = "#CCC"; backgroundBlur.style.zIndex=10500; backgroundBlur.style.position = "absolute"; backgroundBlur.style.border = "1px solid #CCC"; backgroundBlur.style.height = parseInt(calendarDiv.style.height) + 4 + 'px'; backgroundBlur.style.width = parseInt(calendarDiv.style.width) + 4 + 'px'; backgroundBlur.style.top = parseInt(calendarDiv.style.top) + 4 + 'px'; backgroundBlur.style.left = parseInt(calendarDiv.style.left) + 4 + 'px'; document.body.appendChild(selectBlocker); document.body.appendChild(background); document.body.appendChild(backgroundBlur); document.body.appendChild(calendarDiv); disabledSelects(true, false); } /* * This function have the responsability of disabling or enabling all the comboboxes (SELECT TAG) included in every page which calls the calendar */ function disabledSelects(disabled, fromView) { var selectsArray; if(fromView) { selectsArray = parent.document.getElementsByTagName("SELECT"); } else { selectsArray = document.getElementsByTagName("SELECT"); } for(var i=0 ; i limitDate ){ rDay = limitDate.getDate(); rMonth = limitDate.getMonth(); } if(rDyElement.changed == null && formName.changed == null){ eval (rDyElement.selectedIndex = rDay); } if( rMonElement.changed == null && formName.changed == null){ eval (rMonElement.selectedIndex = rMonth); } return; } function validateDate(theForm){ var d = new Date(); var dYear = d.getFullYear(); var formName = eval('document.' + theForm); var dMonth; var dDay; var dDayElement = getElement(document.getElementById(formName.name + '.flightParams.flightDateParams.travelDay'), '.flightParams.flightDateParams.travelDay', formName); dDay = dDayElement.selectedIndex; var dMonthElement = getElement(document.getElementById(formName.name + '.flightParams.flightDateParams.travelMonth'), '.flightParams.flightDateParams.travelMonth', formName); dMonth = dMonthElement.selectedIndex; // For Months with 31 days if ( (dMonth == '0' || dMonth == '2' || dMonth == '4' || dMonth == '6' || dMonth == '7' || dMonth == '9' || dMonth == '11' )){ if (dDay == '30' || dDay == '31') { dDay = '29'; //eval (dDayElement.selectedIndex = dDay); } // For Months with 30 days }else if ((dMonth == '3' || dMonth == '5' || dMonth == '8' || dMonth == '10' )) { if (dDay == '30' || dDay == '31') { dDay = '29'; eval (dDayElement.selectedIndex = dDay); } // For February, check for leapyear. }else if (dMonth == '1') { if ((!leapYear(dYear) && dDay == '28') || dDay == '29' || dDay == '30') { dDay = '27'; eval (ddDayElement.selectedIndex = dDay); } } } function validateReturn(theForm){ var d = new Date(); var dYear = d.getFullYear(); var formName = eval('document.' + theForm); var dMonth = document.getElementById(formName.name + '.returnDate.travelMonth').selectedIndex; var dDay = document.getElementById(formName.name + '.returnDate.travelDay').selectedIndex; var rDyElement = getElement(document.getElementById(formName.name + '.returnDate.travelDay'), '.returnDate.travelDay', formName); dDay = rDyElement.selectedIndex; var rMonElement = getElement(document.getElementById(formName.name + '.returnDate.travelMonth'), '.returnDate.travelMonth', formName); dMonth = rMonElement.selectedIndex; // For Months with 31 days if ( (dMonth == '0' || dMonth == '2' || dMonth == '4' || dMonth == '6' || dMonth == '7' || dMonth == '9' || dMonth == '11' )){ if (dDay == '30' || dDay == '31') { dDay = '29'; //eval (rDyElement.selectedIndex = dDay); } // For Months with 30 days }else if ((dMonth == '3' || dMonth == '5' || dMonth == '8' || dMonth == '10' )) { if (dDay == '30' || dDay == '31') { dDay = '29'; eval (rDyElement.selectedIndex = dDay); } // For February, check for leapyear. }else if (dMonth == '1') { if ((!leapYear(dYear) && dDay == '28') || dDay == '29' || dDay == '30') { dDay = '27'; eval (rDyElement.selectedIndex = dDay); } } } function validateMulti(theForm, num){ var d = new Date(); var dYear = d.getFullYear(); var formName = eval('document.' + theForm); var dMonth = document.getElementById(formName.name+'.flightSearchParam' +num + '.flightDateParams.travelMonth').selectedIndex; var dDay = document.getElementById(formName.name+'.flightSearchParam' +num + '.flightDateParams.travelDay').selectedIndex; var dMonthElement = document.getElementById(formName.name+'.flightSearchParam' +num + '.flightDateParams.travelMonth'); if(!dMonthElement) dMonthElement = 'formName.departure' + num + 'Month'; dMonth = dMonthElement.selectedIndex; var dDayElement = document.getElementById(formName.name+'.flightSearchParam' +num + '.flightDateParams.travelDay'); if(!dDayElement) dDayElement = 'formName.departure' + num + 'Day'; dDay = dDayElement.selectedIndex; // For Months with 31 days if ( (dMonth == '0' || dMonth == '2' || dMonth == '4' || dMonth == '6' || dMonth == '7' || dMonth == '9' || dMonth == '11' )){ if (dDay == '30' || dDay == '31') { dDay = '29'; //eval ('dDayElement.selectedIndex = dDay'); } // For Months with 30 days }else if ((dMonth == '3' || dMonth == '5' || dMonth == '8' || dMonth == '10' )) { if (dDay == '30' || dDay == '31') { dDay = '29'; eval (dDayElement.selectedIndex = dDay); } // For February, check for leapyear. }else if (dMonth == '1') { if ((!leapYear(dYear) && dDay == '28') || dDay == '29' || dDay == '30') { dDay = '27'; eval (dDayElement.selectedIndex = dDay); } } } function updateChangedDate(selectObject){ selectObject.changed = true; if(selectObject.form.dateChanged) selectObject.form.dateChanged.value = true; } function getElement(elem, elemName, formName){ if(!elem) { if(elemName == '.flightParams.flightDateParams.travelDay') return formName.departureDay; else if(elemName == '.flightParams.flightDateParams.travelMonth') return formName.departureMonth; else if(elemName == '.returnDate.travelDay') return formName.returnDay; else if(elemName == '.returnDate.travelMonth') return formName.returnMonth; } return elem; }