maxPAX=4;var param2='width=1,height=1,titlebar=no';var param='width=235,height=270,titlebar=no';var W=new Object();var wX;var wY;var X;var dF=new Object();function init(){dF=document.thisForm;var verbr='Browser: ';verbr+=navigator.appName;verbr+='  ';verbr+=navigator.appVersion;dF.browserDetails.value=verbr;}function showOutboundCalendar(){wX=(screen.width-235)/2;wY=(screen.height-270)/2;if(dF.returnDate.value==''){X=showCalendar(minAllowedDate,maxAllowedDate,dF.outboundDate,dF.obD);}else{X=showCalendar(minAllowedDate,dF.returnDate.value,dF.outboundDate,dF.obD);}W=window.open("../HTML/calendar.html","calWin",param+",top="+wY+",left="+wX);W.focus();}function showReturnCalendar(){if(dF.direction[1].checked){wX=(screen.width-235)/2;wY=(screen.height-270)/2;if(dF.outboundDate.value==''){X=showCalendar(minAllowedDate,maxAllowedDate,dF.returnDate,dF.rtD);}else{X=showCalendar(dF.outboundDate.value,maxAllowedDate,dF.returnDate,dF.rtD);}W=window.open("../HTML/calendar.html","calWin",param+",top="+wY+",left="+wX);W.focus();}}function updateAirport(depOrDest){var i;var dFb=new Object();var dFo=new Object();var airportCode;var board;var dep;var dest;dFb=dF.boardPoint;dFo=dF.offPoint;if(dFb.selectedIndex==-1){dep=dF.boardBase.value;}else{dF.boardIndex.value=dFb.selectedIndex;dep=dFb.options[dFb.selectedIndex].value;}if(dFo.selectedIndex==-1){dest=dF.offBase.value;}else{dF.offIndex.value=dFo.selectedIndex;dest=dFo.options[dFo.selectedIndex].value;}if(depOrDest+''=='dest'){board=dep.substr(0,3);}else{board=dest.substr(0,3);}switchOn(board);if(depOrDest+''=='dest'){dF.boardBase.value=dep;dFo.options.length=1;for(i=0;i<(routes.length)/3;i++){airportCode=routes.substr(i*3,3);if(airportCode=='XXX'){dFo.options[i]=new Option('To');}else{dFo.options[i]=new Option(values[(codes.indexOf(airportCode))/3]);}dFo.options[i].value=airportCode;}dFo.selectedIndex=(routes.indexOf(dest.substr(0,3)))/3;}else{dF.offBase.value=dest;dFb.options.length=1;for(i=0;i<(routes.length)/3;i++){airportCode=routes.substr(i*3,3);if(airportCode=='XXX'){dFb.options[i]=new Option('From');}else{dFb.options[i]=new Option(values[(codes.indexOf(airportCode))/3]);}dFb.options[i].value=airportCode;}dFb.selectedIndex=(routes.indexOf(dep.substr(0,3)))/3;}}function owRt(){var dF=new Object();dF=document.thisForm;if(dF.direction[0].checked){dF.returnDate.value='';dF.rtDM.disabled=true;dF.rtDD.disabled=true;}else{dF.rtDM.disabled=false;dF.rtDD.disabled=false;rtDMChange();}}function updatePax(){var i;var adult;var child;var infant;if(dF.selAdult.selectedIndex==-1){if(dF.adultIndex.value!=-1){adult=parseInt(dF.adultIndex.value);}else{adult=1;}}else{adult=dF.selAdult.options[dF.selAdult.selectedIndex].value;dF.adultIndex.value=dF.selAdult.selectedIndex+1;}if(dF.selChild.selectedIndex==-1){if(dF.childIndex!=-1){child=parseInt(dF.childIndex.value);}else{child=0;}}else{child=dF.selChild.options[dF.selChild.selectedIndex].value;dF.childIndex.value=dF.selChild.selectedIndex;}if(dF.selInfant.selectedIndex==-1){if(dF.infantIndex!=-1){infant=parseInt(dF.infantIndex.value);}else{infant=0;}}else{infant=dF.selInfant.options[dF.selInfant.selectedIndex].value;dF.infantIndex.value=dF.selInfant.selectedIndex;}dF.selAdult.options.length=0;if(isADS()){dF.selAdult.options[0]=new Option(1);dF.selAdult.options[0].value=1;}else{for(i=0;i<=maxPAX-child-1;i++){dF.selAdult.options[i]=new Option(i+1);dF.selAdult.options[i].value=i+1;}}dF.selAdult.selectedIndex=--adult<i?adult:0;adult++;dF.selChild.options.length=1;for(i=1;i<=maxPAX-adult;i++){dF.selChild.options[i]=new Option(i);dF.selChild.options[i].value=i;}dF.selChild.selectedIndex=parseInt(child)<i?parseInt(child):0;dF.selInfant.options.length=1;for(i=1;i<=adult;i++){dF.selInfant.options[i]=new Option(i);dF.selInfant.options[i].value=i;}dF.selInfant.selectedIndex=parseInt(infant)<i?parseInt(infant):0;}function cS(){var dF=new Object();var dFb=new Object();var dFo=new Object();dF=document.thisForm;dFb=dF.boardPoint;dFo=dF.offPoint;var dep=dFb.options[dFb.selectedIndex].value;var depDate=dF.outboundDate.value;var dest=dFo.options[dFo.selectedIndex].value;var destDate=dF.returnDate.value;var adult=dF.selAdult.options[dF.selAdult.selectedIndex].value;var child=dF.selChild.options[dF.selChild.selectedIndex].value;var infant=dF.selInfant.options[dF.selInfant.selectedIndex].value;if(dep=='XXX'){alert('Please Select your Departure Airport.');dFb.focus();return;}if(dest=='XXX'){alert('Please Select your Destination Airport.');dFo.focus();return;}if((destDate=='')&&(parseInt(dF.fareType.value)==2)){alert('Selected Fare Type\nOnly Available with Return Bookings');return;}if(depDate==''||depDate=='Click Here...'){alert('Please Select your Departure Date.');return;}if(dF.direction[1].checked&&dF.returnDate.value==''){alert('Please Select your Return Date or Select a One Way Flight');dF.rtD.focus();return;}document.thisForm.submit();}function isADS(){if(dF.adsNumber.value!='XXX')return true;return false;}function setADSDetails(){dF.adsNumber.value=adsCard;dF.adsTranCode.value=adsTran;}