  var origins = new Array();
  var routes2 = new Array(144);


  routes2['EDI'] = new Array(); routes2['BLL'] = new Array(); routes2['LCA'] = new Array(); routes2['LGW'] = new Array(); routes2['LHR'] = new Array(); routes2['HAM'] = new Array(); routes2['WRO'] = new Array(); routes2['FDH'] = new Array();
  
  routes2['FMO']=new Array();routes2['BUD']=new Array();routes2['GVA']=new Array();routes2['BCN']=new Array();routes2['MRS']=new Array();routes2['DME']=new Array();routes2['IST']=new Array();routes2['TBS']=new Array();routes2['ATH']=new Array();routes2['MIL']=new Array();routes2['ORY']=new Array();routes2['KRK']=new Array();routes2['LIN']=new Array();routes2['BRU']=new Array();routes2['MOW']=new Array();routes2['ZAG']=new Array();routes2['CFU']=new Array();routes2['LON']=new Array();routes2['CTA']=new Array();routes2['VIE']=new Array();routes2['PAR']=new Array();routes2['BUH']=new Array();routes2['CPH']=new Array();routes2['BGO']=new Array();routes2['LNZ']=new Array();routes2['GRZ']=new Array();routes2['ALG']=new Array();routes2['GOT']=new Array();routes2['MLA']=new Array();routes2['SVG']=new Array();routes2['PAD']=new Array();routes2['BIO']=new Array();routes2['OTP']=new Array();routes2['WAW']=new Array();routes2['BHD']=new Array();routes2['NCE']=new Array();routes2['CDG']=new Array();routes2['ZRH']=new Array();routes2['VRN']=new Array();routes2['LUG']=new Array();routes2['AMS']=new Array();routes2['TSR']=new Array();routes2['TLS']=new Array();routes2['LYS']=new Array();routes2['IEV']=new Array();routes2['DRS']=new Array();routes2['BER']=new Array();routes2['ARN']=new Array();routes2['BLQ']=new Array();routes2['REG']=new Array();routes2['KTW']=new Array();routes2['MAD']=new Array();routes2['MUC']=new Array();routes2['HEL']=new Array();routes2['DUS']=new Array();routes2['HAJ']=new Array();routes2['FCO']=new Array();routes2['MAN']=new Array();routes2['STR']=new Array();routes2['PRG']=new Array();routes2['FRA']=new Array();routes2['CGN']=new Array();routes2['NAP']=new Array();routes2['NUE']=new Array();routes2['BEG']=new Array();routes2['OSL']=new Array();routes2['BER']=new Array();routes2['AUH']=new Array();routes2['BMA']=new Array();routes2['DUB']=new Array();routes2['LEJ']=new Array();routes2['BSL']=new Array();routes2['KLU']=new Array();routes2['ABZ']=new Array();routes2['SVO']=new Array();routes2['SOF']=new Array();routes2['BRE']=new Array();
  routes2['TXL']=new Array();routes2['LED']=new Array();
  //routes2['TRN']=new Array();routes2['GOA']=new Array();routes2['OLB']=new Array();routes2['CAG']=new Array();routes2['GLA']=new Array();routes2['BHX']=new Array();routes2['NYC']=new Array();routes2['MXP']=new Array();
  //routes2['ANK'] = new Array();routes2['PMO'] = new Array();

addRoutesData(routes2);
function addRoutesData(arr) {
    var r = arr, t = 'true', f = 'false'; r.AMS.CTA = [1337434928, 'null', 'null', f]; r.AMS.MLA = [1, 'IPREURP', 'null', f]; r.ARN.MLA = [3, 'IPREURP', 'null', f]; r.ATH.CTA = [1337434929, 'null', 'null', f]; r.ATH.MLA = [4, 'IPREURP', 'null', f]; r.BCN.CTA = [5, 'IPREURP', 'nocategory', f]; r.BCN.MLA = [6, 'IPREURP', 'nocategory', f]; r.BRU.AMS = [115, 'IPREURP', 'null', f]; r.BRU.AMS = [115, 'IPREURP', 'null', f]; r.BRU.AMS = [115, 'IPREURP', 'null', f]; r.BRU.CTA = [302, 'null', 'null', f]; r.BRU.MLA = [10, 'IPREURP', 'null', f]; r.BUD.CTA = [1337434945, 'null', 'null', f]; r.BUD.MLA = [11, 'IPREURP', 'null', f]; r.CGN.CTA = [1337434935, 'null', 'null', f]; r.CGN.MLA = [366, 'null', 'null', f]; r.CTA.AMS = [232, 'IPREURP', 'null', f]; r.CTA.ATH = [329, 'null', 'null', f]; r.CTA.BCN = [15, 'IPREURP', 'null', f]; r.CTA.BRU = [235, 'IPREURP', 'null', f]; r.CTA.BUD = [238, 'IPREURP', 'null', f]; r.CTA.CGN = [240, 'IPREURP', 'null', f]; r.CTA.DUS = [244, 'IPREURP', 'null', f]; r.CTA.FRA = [245, 'IPREURP', 'null', f]; r.CTA.GVA = [17, 'IPREURP', 'null', f]; r.CTA.HAM = [248, 'IPREURP', 'null', f]; r.CTA.LYS = [256, 'IPREURP', 'null', f]; r.CTA.MAD = [257, 'IPREURP', 'null', f]; r.CTA.MLA = [19, 'IPREURP', 'null', f]; r.CTA.MRS = [333, 'null', 'null', f]; r.CTA.MUC = [20, 'IPREURP', 'null', f]; r.CTA.PRG = [262, 'IPREURP', 'null', f]; r.CTA.SOF = [263, 'IPREURP', 'null', f]; r.CTA.TLS = [265, 'IPREURP', 'null', f]; r.CTA.VIE = [266, 'IPREURP', 'null', f]; r.CTA.ZRH = [334, 'null', 'null', f]; r.CTA.BER = [330, 'null', 'null', f]; r.CTA.MOW = [332, 'null', 'null', f]; r.CTA.PAR = [338, 'null', 'null', f]; r.CTA.BRE = [236, 'IPREURP', 'null', f]; r.CTA.HAJ = [247, 'IPREURP', 'null', f]; r.CTA.DRS = [242, 'IPREURP', 'null', f]; r.CTA.LEJ = [254, 'IPREURP', 'null', f]; r.CTA.BEG = [233, 'IPREURP', 'null', f]; r.CTA.IEV = [251, 'IPREURP', 'null', f]; r.CTA.CPH = [241, 'IPREURP', 'null', f]; r.CTA.HEL = [249, 'IPREURP', 'null', f]; r.CTA.ALG = [327, 'null', 'null', f]; r.CTA.KRK = [252, 'IPREURP', 'null', f]; r.CTA.NCE = [258, 'IPREURP', 'null', f]; r.CTA.NUE = [259, 'IPREURP', 'null', f]; r.CTA.STR = [264, 'IPREURP', 'null', f]; r.CTA.WAW = [267, 'IPREURP', 'null', f]; r.CTA.IEV = [335, 'null', 'null', f]; r.CTA.BUH = [1345575957, 'null', 'null', f]; r.DME.MLA = [21, 'IPREURP', 'null', f]; r.DUB.MLA = [285, 'null', 'null', f]; r.DUS.CTA = [1337434940, 'null', 'null', f]; r.DUS.MLA = [22, 'IPREURP', 'null', f]; r.FCO.MLA = [24, 'IPREURP', 'null', f]; r.FCO.REG = [25, 'IPREURP', 'null', f]; r.FRA.CTA = [388, 'null', 'null', f]; r.FRA.MLA = [26, 'IPREURP', 'null', f]; r.GOT.MLA = [368, 'null', 'null', f]; r.GVA.CTA = [28, 'IPREURP', 'null', f]; r.GVA.MLA = [29, 'IPREURP', 'null', f]; r.HAM.CTA = [1337434933, 'null', 'null', f]; r.HAM.MLA = [30, 'IPREURP', 'null', f]; r.IST.MLA = [31, 'IPREURP', 'null', f]; r.LCA.MLA = [32, 'IPREURP', 'null', f]; r.LGW.MLA = [34, 'IPREURP', 'null', f]; r.LHR.MLA = [35, 'IPREURP', 'null', f]; r.LYS.CTA = [1337434948, 'null', 'null', f]; r.LYS.MLA = [37, 'IPREURP', 'null', f]; r.MAD.CTA = [1337434943, 'null', 'null', f]; r.MAD.MLA = [38, 'IPREURP', 'null', f]; r.MAN.MLA = [39, 'IPREURP', 'null', f]; r.MLA.AMS = [40, 'IPREURP', 'null', f]; r.MLA.ARN = [41, 'IPREURP', 'null', f]; r.MLA.ATH = [42, 'IPREURP', 'null', f]; r.MLA.BCN = [43, 'IPREURP', 'null', f]; r.MLA.BRU = [47, 'IPREURP', 'null', f]; r.MLA.BUD = [48, 'IPREURP', 'null', f]; r.MLA.CGN = [223, 'IPREURP', 'null', f]; r.MLA.CTA = [51, 'IPREURP', 'null', f]; r.MLA.DME = [52, 'IPREURP', 'null', f]; r.MLA.DUB = [195, 'IPREURP', 'null', f]; r.MLA.DUS = [53, 'IPREURP', 'null', f]; r.MLA.FCO = [55, 'IPREURP', 'null', f]; r.MLA.FRA = [56, 'IPREURP', 'null', f]; r.MLA.GOT = [197, 'IPREURP', 'null', f]; r.MLA.GVA = [58, 'IPREURP', 'null', f]; r.MLA.HAM = [59, 'IPREURP', 'null', f]; r.MLA.IST = [60, 'IPREURP', 'null', f]; r.MLA.LCA = [61, 'IPREURP', 'null', f]; r.MLA.LGW = [62, 'IPREURP', 'null', f]; r.MLA.LHR = [63, 'IPREURP', 'null', f]; r.MLA.LYS = [65, 'IPREURP', 'null', f]; r.MLA.MAD = [66, 'IPREURP', 'null', f]; r.MLA.MAN = [67, 'IPREURP', 'null', f]; r.MLA.MRS = [68, 'IPREURP', 'null', f];r.MLA.MUC = [69, 'IPREURP', 'null', f]; r.MLA.NAP = [71, 'IPREURP', 'null', f]; r.MLA.ORY = [74, 'IPREURP', 'null', f]; r.MLA.OSL = [75, 'IPREURP', 'null', f]; r.MLA.PRG = [77, 'IPREURP', 'null', f]; r.MLA.REG = [78, 'IPREURP', 'null', f]; r.MLA.SOF = [79, 'IPREURP', 'null', f]; r.MLA.SVO = [81, 'IPREURP', 'null', f]; r.MLA.TLS = [83, 'IPREURP', 'null', f]; r.MLA.BER = [85, 'IPREURP', 'null', f]; r.MLA.VIE = [87, 'IPREURP', 'null', f]; r.MLA.ZRH = [88, 'IPREURP', 'null', f]; r.MLA.BER = [116, 'IPREURP', 'null', f]; r.MLA.LON = [173, 'IPREURP', 'null', f]; r.MLA.MIL = [1303396287, 'null', 'null', f]; r.MLA.MOW = [299, 'IPREURP', 'null', f]; r.MLA.PAR = [288, 'null', 'null', f]; r.MLA.BLQ = [118, 'IPREURP', 'null', f]; r.MLA.LIN = [129, 'IPREURP', 'null', f]; r.MLA.BRE = [138, 'IPREURP', 'null', f]; r.MLA.HAJ = [132, 'IPREURP', 'null', f]; r.MLA.DRS = [156, 'IPREURP', 'null', f]; r.MLA.LEJ = [165, 'IPREURP', 'null', f]; r.MLA.CFU = [178, 'IPREURP', 'null', f]; r.MLA.BEG = [181, 'IPREURP', 'null', f]; r.MLA.ABZ = [190, 'IPREURP', 'null', f]; r.MLA.EDI = [191, 'IPREURP', 'null', f]; r.MLA.CPH = [196, 'IPREURP', 'null', f]; r.MLA.BGO = [198, 'IPREURP', 'null', f]; r.MLA.SVG = [200, 'IPREURP', 'null', f]; r.MLA.HEL = [204, 'IPREURP', 'null', f]; r.MLA.DBV = [210, 'IPREURP', 'null', f];
    r.LED.MLA=[1340040077,'null','null',f];  r.MLA.LED=[226,'IPREURP','null',f];
    r.MLA.ALG = [221, 'IPREURP', 'null', f]; r.MLA.KRK = [225, 'IPREURP', 'null', f]; r.MLA.NCE = [228, 'IPREURP', 'null', f]; r.MLA.NUE = [229, 'IPREURP', 'null', f]; r.MLA.STR = [230, 'IPREURP', 'null', f]; r.MLA.WAW = [231, 'IPREURP', 'null', f]; r.MLA.CDG = [269, 'IPREURP', 'null', f]; r.MLA.LUG = [268, 'IPREURP', 'null', f]; r.MLA.BHD = [286, 'null', 'null', f]; r.MLA.VRN = [297, 'IPREURP', 'null', f]; r.MLA.IEV = [303, 'null', 'null', f]; r.MLA.KTW = [304, 'null', 'null', f]; r.MLA.TBS = [307, 'null', 'null', f]; r.MLA.KLU = [309, 'null', 'null', f]; r.MLA.GRZ = [310, 'null', 'null', f]; r.MLA.LNZ = [314, 'null', 'null', f]; r.MLA.BSL = [311, 'null', 'null', f]; r.MLA.FDH = [312, 'null', 'null', f]; r.MLA.FMO = [317, 'null', 'null', f]; r.MLA.PAD = [315, 'null', 'null', f]; r.MLA.BLL = [316, 'null', 'null', f]; r.MLA.WRO = [321, 'null', 'null', f]; r.MLA.TSR = [324, 'null', 'null', f]; r.MLA.ZAG = [322, 'null', 'null', f]; r.MLA.BIO = [323, 'null', 'null', f]; r.MLA.OTP = [1341520975, 'null', 'null', f]; r.MLA.AUH = [1254695152, 'null', 'null', f]; r.MRS.CTA = [1337434942, 'null', 'null', f]; r.MRS.MLA = [89, 'IPREURP', 'null', f]; r.MUC.CTA = [90, 'IPREURP', 'null', f]; r.MUC.MLA = [91, 'IPREURP', 'null', f]; r.NAP.MLA = [95, 'IPREURP', 'null', f]; r.ORY.MLA = [96, 'IPREURP', 'null', f]; r.OSL.MLA = [98, 'IPREURP', 'null', f]; r.PRG.MLA = [100, 'IPREURP', 'null', f]; r.PRG.CTA = [1337434930, 'null', 'null', f]; r.REG.FCO = [101, 'IPREURP', 'null', f]; r.REG.MLA = [102, 'IPREURP', 'null', f]; r.SOF.MLA = [103, 'IPREURP', 'null', f]; r.SOF.CTA = [1337434931, 'null', 'null', f]; r.SVO.MLA = [105, 'IPREURP', 'null', f]; r.TLS.CTA = [354, 'null', 'null', f]; r.TLS.MLA = [107, 'IPREURP', 'null', f]; r.BER.MLA = [109, 'IPREURP', 'null', f]; r.VIE.MLA = [111, 'IPREURP', 'null', f]; r.VIE.CTA = [1337434944, 'null', 'null', f]; r.ZRH.CTA = [1337434949, 'null', 'null', f]; r.ZRH.MLA = [112, 'IPREURP', 'null', f]; r.BER.MLA = [133, 'IPREURP', 'null', f]; r.BER.CTA = [1337434936, 'null', 'null', f]; r.LON.MLA = [166, 'IPREURP', 'null', f]; r.MIL.MLA = [1303396288, 'null', 'null', f]; r.MOW.MLA = [298, 'IPREURP', 'null', f]; r.PAR.MLA = [289, 'null', 'null', f]; r.PAR.CTA = [353, 'null', 'null', f]; r.BLQ.MLA = [117, 'IPREURP', 'null', f]; r.LIN.MLA = [125, 'IPREURP', 'null', f]; r.BRE.CTA = [360, 'null', 'null', f]; r.BRE.MLA = [137, 'IPREURP', 'null', f]; r.HAJ.MLA = [120, 'IPREURP', 'null', f]; r.HAJ.CTA = [1337434950, 'null', 'null', f]; r.DRS.MLA = [153, 'IPREURP', 'null', f]; r.DRS.CTA = [359, 'null', 'null', f]; r.LEJ.MLA = [164, 'IPREURP', 'null', f]; r.LEJ.CTA = [1337434947, 'null', 'null', f]; r.CFU.MLA = [1134329348, 'null', 'null', f]; r.BEG.CTA = [1337434946, 'null', 'null', f]; r.BEG.MLA = [364, 'null', 'null', f]; r.ABZ.MLA = [281, 'null', 'null', f]; r.EDI.MLA = [282, 'null', 'null', f]; r.CPH.MLA = [301, 'IPREURP', 'null', f]; r.CPH.CTA = [1337434937, 'null', 'null', f]; r.BGO.MLA = [383, 'null', 'null', f]; r.SVG.MLA = [382, 'null', 'null', f]; r.HEL.CTA = [358, 'null', 'null', f]; r.HEL.MLA = [295, 'IPREURP', 'null', f];
    r.CTA.TXL = [99991, 'null', 'null', f]; r.MLA.TXL = [99992, 'IPREURP', 'null', f]; r.TXL.MLA = [99993, 'IPREURP', 'null', f];r.TXL.CTA = [9994, 'null', 'null', f]; 
  r.ALG.CTA=[1337430695,'null','null',f];r.ALG.MLA=[340,'null','null',f];r.KRK.MLA=[373,'null','null',f];r.KRK.CTA=[1337434932,'null','null',f];r.NCE.MLA=[376,'null','null',f];r.NCE.CTA=[1337434941,'null','null',f];r.NUE.CTA=[1337434939,'null','null',f];r.NUE.MLA=[377,'null','null',f];r.STR.CTA=[1337434938,'null','null',f];r.STR.MLA=[294,'IPREURP','null',f];r.WAW.MLA=[1341520976,'null','null',f];r.CDG.MLA=[290,'null','null',f];r.LUG.MLA=[1091122896,'null','null',f];r.BHD.MLA=[284,'null','null',f];r.VRN.MLA=[296,'IPREURP','null',f];r.IEV.MLA=[341,'null','null',f];r.KTW.MLA=[371,'null','null',f];r.TBS.MLA=[379,'null','null',f];r.KLU.MLA=[372,'null','null',f];r.GRZ.MLA=[369,'null','null',f];r.LNZ.MLA=[374,'null','null',f];r.BSL.MLA=[363,'null','null',f];r.FDH.MLA=[367,'null','null',f];r.FMO.MLA=[375,'null','null',f];r.PAD.MLA=[378,'null','null',f];r.BLL.MLA=[347,'null','null',f];r.WRO.MLA=[348,'null','null',f];r.TSR.MLA=[1341520973,'null','null',f];r.ZAG.MLA=[349,'null','null',f];r.BIO.MLA=[1341520977,'null','null',f];r.OTP.MLA=[1341520978,'null','null',f];r.BUH.CTA=[362,'null','null',f];r.BMA.CTA=[356,'null','null',f];r.AUH.MLA=[1254688498,'null','null',f];r.CTA.OTP=[1349590663,'null','null',f];r.OTP.CTA=[1349590541,'null','null',f];r.CTA.BER=[234,'IPREURP','null',f];r.BER.CTA=[1349585535,'null','null',f];r.ATH.SOF=[1420641084,'null','null',f];r.SOF.ATH=[1420641083,'null','null',f];r.MLA.TIP=[82,'IPREURP','null',f];
  }
  
//r.MLA.TRN=[160,'IPREURP','null',f];r.TRN.MLA=[122,'IPREURP','null',f];r.MLA.GOA=[159,'IPREURP','null',f];r.GOA.MLA=[134,'IPREURP','null',f];r.MLA.OLB=[387,'null','null',f];r.OLB.MLA=[386,'null','null',f];r.MLA.CAG=[163,'IPREURD','null',f];r.CAG.MLA=[155,'IPREURP','null',f];r.GLA.MLA=[27,'IPREURP','null',f];r.MLA.GLA=[57,'IPREURP','null',f];r.BHX.MLA=[8,'IPREURP','null',f];r.MLA.BHX=[45,'IPREURP','null',f];r.MLA.NYC = [306, 'null', 'null', f]; r.NYC.MLA=[344,'null','null',f];
//r.ANK.MLA = [1341520974, 'null', 'null', f];r.MLA.ANK = [217, 'IPREURP', 'null', f];r.MLA.PMO=[76,'IPREURP','null',f];r.PMO.MLA=[99,'IPREURP','null',f]; r.MLA.MXP = [70, 'IPREURP', 'null', f]; 

/*
--Malpensa--
r.MXP.MLA = [92, 'IPREURP', 'null', f]; 
*/
// define default origin airport here

 
 var ttselectedOriginAirport = '';



 
 var ttselectedDestAirport = '';


// LIST AVAILABLE CABIN CLASSES

 
 var ttselectedService = '';




/* routes.js 
  for managing origin-destination dropdown
  requires routes.jsp to be imported first
*/

function ttpopulateOriginAirports() {
  var selectedOrigin = document.getElementById("ttselectedOriginAirport");
  var originAirports = document.getElementById("ttoriginAirports");
  if (selectedOrigin.value !== '') {
      ttdefaultOriginAirport = selectedOrigin.value;	
  }
  var origins2 = new Array();
  for (var origin in routes2)
  {
     origins2.push(new Array(origin, airports2[origin]));
  }
  origins2.push(new Array('', ttselectOriginAirportLabel));
  origins2.sort(sortOptionsByText);
  
  for (i=0; i < origins2.length; i++) {
    createOption('ttoriginAirports', i, origins2[i][0], origins2[i][1]);
    if (ttdefaultOriginAirport == originAirports[i].value) {
      originAirports[i].selected = true;
    }
  }
  
  if (selectedOrigin.value !== '') {
  	ttpopulateDestinationAirports();
  } 
}

function ttpopulateDestinationAirports() {
  var selectedDestination = document.getElementById("ttselectedDestinationAirport");
  var originAirports = document.getElementById("ttoriginAirports");
  var destinationAirports = document.getElementById("ttdestinationAirports");
  var selectedDestinationAirport = destinationAirports.value; // populate with current selected airport
  if (ttselectedDestAirport !== '') {
    selectedDestinationAirport = ttselectedDestAirport;	
  }
  var destinations = new Array();
  for (var destination in routes2[originAirports.value]) {
    destinations.push(new Array(destination, airports2[destination]));
  }
  destinations.push(new Array('', ttselectDestinationAirportLabel));
  destinations.sort(sortOptionsByText);
  
  while (destinationAirports.options.length > 0) {
    destinationAirports.options[0] = null;
  }
  
  for(i=0; i < destinations.length; i++) {
    createOption('ttdestinationAirports', i, destinations[i][0], destinations[i][1]);
    if (selectedDestination.value == destinationAirports[i].value) {
      destinationAirports[i].selected = true;
    }
  }
  
  destinationAirports.disabled = false;
}

function ttdeselectDestinationAirports() {
  var selectedOrigin = document.getElementById("ttselectedOriginAirport");
  var destinationAirports = document.getElementById("ttdestinationAirports");
  if (selectedOrigin === '') {
    destinationAirports.value = '';
    destinationAirports.disabled = true;
  }
}

function ttgetRouteCategory() {
  var originAirport = document.getElementById("ttoriginAirports");
  var destinationAirport = document.getElementById("ttdestinationAirports");
  if (originAirport.value && destinationAirport.value) {
    var route = routes2[originAirport.value][destinationAirport.value];
  }
  var routeCategory = (route ? route[2] : null);
  return routeCategory;
}

function ttupdatePassengerTypeSelection() {
  var routeCategory = ttgetRouteCategory();
  var numYouths = document.getElementById("numYouths");
  var numSeniors = document.getElementById("numSeniors");
  if (routeCategory !== null) {
    if (routeCategory == 'A') {
      if (numYouths) { numYouths.value = 0; }
      if (numSeniors) { numSeniors.value = 0; }
      hideDiv("youthAndSeniorOptions");
    } else {
      showDiv("youthAndSeniorOptions");
    }
  }
}
