                $(document).ready(function(){
                $('.btn-one-way').click(function(){
                    $('.return-date-box').removeClass('d-block');
                    $('.return-date-box').addClass('d-none');
                    $('.depart-date-box').removeClass('col-md-3');
                    $('.depart-date-box').addClass('col-md-6');
                    $('.multi-section').addClass('d-none');
                    $('.multi-section').removeClass('d-block');
                    $('.return-rt').removeClass('d-block')
                    $('.return-rt').addClass('d-none')
                    $('.depart-rt').addClass('width-full')
                });
                });


              $(document).ready(function(){
                $('.btn-multi').click(function(){
                    $('.return-date-box').removeClass('d-block');
                    $('.return-date-box').addClass('d-none');
                    $('.depart-date-box').removeClass('col-md-3');
                    $('.depart-date-box').addClass('col-md-6');
                    $('.multi-section').removeClass('d-none');
                    $('.multi-section').addClass('d-block');
                    $('.return-rt').removeClass('d-none')
                    $('.return-rt').addClass('d-block')
                    $('.depart-rt').removeClass('width-full')

                });
                });

              $(document).ready(function(){
                $('.btn-return').click(function(){
                    $('.return-date-box').addClass('d-block');
                    $('.return-date-box').removeClass('d-none');
                    $('.depart-date-box').addClass('col-md-3');
                    $('.depart-date-box').removeClass('col-md-6');
                    $('.multi-section').addClass('d-none');
                    $('.multi-section').removeClass('d-block');
                    $('.return-rt').removeClass('d-none')
                    $('.return-rt').addClass('d-block')
                    $('.depart-rt').removeClass('width-full')
                });
                });


              $(document).ready(function () {
          $('.btn-add-oneway').click(function () {
              var rowsitem = $('.row-one-way.d-none');
              var rowsitemb = $('.row-one-way.d-block');
              if (rowsitem.length > 0) {
                  rowsitem.first().addClass('d-block');
                  rowsitem.first().removeClass('d-none');
              }
              $('.btn-remove-oneway').show();
              if (rowsitemb.length == 2) {
                  $('.btn-add-oneway').hide();
              }
          });
      
          $('.btn-remove-oneway').click(function () {
              var rowsitem = $('.row-one-way.d-block');
              var rowsitemb = $('.row-one-way.d-none');
              if (rowsitem.length > 0) {
                  rowsitem.last().addClass('d-none');
                  rowsitem.last().removeClass('d-block');
              }
              $('.btn-add-oneway').show();
              if (rowsitemb.length == 3) {
                  $('.btn-remove-oneway').hide();
              }
          });
      
          });




var options = {
          shouldSort: true,
          threshold: 0.4,
          maxPatternLength: 32,
          keys: [{
              name: 'iata',
              weight: 0.5
          }, {
              name: 'name',
              weight: 0.3
          }, {
              name: 'city',
              weight: 0.2
          }]
      };
      
      var fuse = new Fuse(airports, options)
      
      
      var ac = $('#getAirport1')
          .on('click', function (e) {
              e.stopPropagation();
          })
          .on('focus keyup', search)
          .on('keydown', onKeyDown);
      
      var wrap = $('<div>')
          .addClass('autocomplete-wrapper')
          .insertBefore(ac)
          .append(ac);
      
      var list = $('<div>')
          .addClass('autocomplete-results')
          .on('click', '.autocomplete-result', function (e) {
              e.preventDefault();
              e.stopPropagation();
              selectIndex($(this).data('index'));
          })
          .appendTo(wrap);
      
      $(document)
          .on('mouseover', '.autocomplete-result', function (e) {
              var index = parseInt($(this).data('index'), 10);
              if (!isNaN(index)) {
                  list.attr('data-highlight', index);
              }
          })
          .on('click', clearResults);
      
      function clearResults() {
          results = [];
          numResults = 0;
          list.empty();
      }
      
      function selectIndex(index) {
          if (results.length >= index + 1) {
              //ac.val(results[index].iata + ' ' + results[index].name + ' ' + results[index].city + ' ' + results[index].country);
              //ac.val(results[index].iata);
      
              $("#getAirport1View").val(results[index].iata);
              $("#getAirport1").val(results[index].iata + ' ' + results[index].name + ' ' + results[index].city + ' ' + results[index].country);
              $("#org").val(results[index].iata);
              clearResults();
          }
      }
      
      var results = [];
      var numResults = 0;
      var selectedIndex = -1;
      
      function search(e) {
          if (e.which === 38 || e.which === 13 || e.which === 40) {
              return;
          }
      
          if (ac.val().length > 0) {
              results = _.take(fuse.search(ac.val()), 7);
              numResults = results.length;
      
              var divs = results.map(function (r, i) {
                  return '<div class="autocomplete-result" data-index="' + i + '">'
                      + '<div><b>' + r.iata + '</b> - ' + r.name + '</div>'
                      + '<div class="autocomplete-location">' + r.city + ', ' + r.country + '</div>'
                      + '</div>';
              });
      
              selectedIndex = -1;
              list.html(divs.join(''))
                  .attr('data-highlight', selectedIndex);
      
          } else {
              numResults = 0;
              list.empty();
          }
      }
      
      function onKeyDown(e) {
          switch (e.which) {
              case 38: // up
                  selectedIndex--;
                  if (selectedIndex <= -1) {
                      selectedIndex = -1;
                  }
                  list.attr('data-highlight', selectedIndex);
                  break;
              case 13: // enter
                  selectIndex(selectedIndex);
                  break;
              case 9: // enter
                  selectIndex(selectedIndex);
                  e.stopPropagation();
                  return;
              case 40: // down
                  selectedIndex++;
                  if (selectedIndex >= numResults) {
                      selectedIndex = numResults - 1;
                  }
                  list.attr('data-highlight', selectedIndex);
                  break;
      
              default: return; // exit this handler for other keys
          }
          e.stopPropagation();
          e.preventDefault(); // prevent the default action (scroll / move caret)
      }




      $(document).ready(function () {
      
      });

//////////////////////////////////////////
/////////////////////////////////////////

//////////////////////////////////////////
/////////////////////////////////////////
      
      
      var optionsTwo = {
          shouldSort: true,
          threshold: 0.4,
          maxPatternLength: 32,
          keys: [{
              name: 'iata',
              weight: 0.5
          }, {
              name: 'name',
              weight: 0.3
          }, {
              name: 'city',
              weight: 0.2
          }]
      };
      
      var fuseTwo = new Fuse(airports, optionsTwo)
      
      
      var acTwo = $('#getAirport2')
          .on('click', function (e) {
              e.stopPropagation();
          })
          .on('focus keyup', searchTwo)
          .on('keydown', onKeyDownTwo);
      
      
      var wrapTwo = $('<div>')
          .addClass('autocomplete-wrapper-two')
          .insertBefore(acTwo)
          .append(acTwo);
      
      var listTwo = $('<div>')
          .addClass('autocomplete-results-two')
          .on('click', '.autocomplete-result-two', function (e) {
              e.preventDefault();
              e.stopPropagation();
              selectIndexTwo($(this).data('index'));
          })
          .appendTo(wrapTwo);
      
      $(document)
          .on('mouseover', '.autocomplete-result-two', function (e) {
              var index = parseInt($(this).data('index'), 10);
              if (!isNaN(index)) {
                  listTwo.attr('data-highlight-two', index);
              }
          })
          .on('click', clearResultsTwo);
      
      function clearResultsTwo() {
          resultsTwo = [];
          numResultsTwo = 0;
          listTwo.empty();
      }
      
      function selectIndexTwo(index) {
          if (resultsTwo.length >= index + 1) {
              //acTwo.val(resultsTwo[index].iata + ' ' + resultsTwo[index].name + ' ' + resultsTwo[index].city + ' ' + resultsTwo[index].country);
              //acTwo.val(resultsTwo[index].iata);
      
              $("#getAirport2View").val(resultsTwo[index].iata);
              $("#getAirport2").val(resultsTwo[index].iata + ' ' + resultsTwo[index].name + ' ' + resultsTwo[index].city + ' ' + resultsTwo[index].country);
              $("#dest").val(resultsTwo[index].iata);
              clearResultsTwo();
          }
      }
      
      var resultsTwo = [];
      var numResultsTwo = 0;
      var selectedIndexTwo = -1;
      
      function searchTwo(e) {
          if (e.which === 38 || e.which === 13 || e.which === 40) {
              return;
          }
      
          if (acTwo.val().length > 0) {
              resultsTwo = _.take(fuseTwo.search(acTwo.val()), 7);
              numResultsTwo = resultsTwo.length;
      
              var divsTwo = resultsTwo.map(function (r, i) {
                  return '<div class="autocomplete-result-two" data-index="' + i + '">'
                      + '<div><b>' + r.iata + '</b> - ' + r.name + '</div>'
                      + '<div class="autocomplete-location-two">' + r.city + ', ' + r.country + '</div>'
                      + '</div>';
              });
      
              selectedIndexTwo = -1;
              listTwo.html(divsTwo.join(''))
                  .attr('data-highlight-two', selectedIndexTwo);
      
          } else {
              numResultsTwo = 0;
              listTwo.empty();
          }
      }
      
      function onKeyDownTwo(e) {
          switch (e.which) {
              case 38: // up
                  selectedIndexTwo--;
                  if (selectedIndexTwo <= -1) {
                      selectedIndexTwo = -1;
                  }
                  listTwo.attr('data-highlight-two', selectedIndexTwo);
                  break;
              case 13: // enter
                  selectIndex(selectedIndexTwo);
                  break;
              case 9: // enter
                  selectIndex(selectedIndexTwo);
                  e.stopPropagation();
                  return;
              case 40: // down
                  selectedIndexTwo++;
                  if (selectedIndexTwo >= numResultsTwo) {
                      selectedIndexTwo = numResultsTwo - 1;
                  }
                  listTwo.attr('data-highlight-two', selectedIndexTwo);
                  break;
      
              default: return; // exit this handler for other keys
          }
          e.stopPropagation();
          e.preventDefault(); // prevent the default action (scroll / move caret)
      }




//////////////////////////////////////////////////////////////////////////////
////////////// getAirport3 script section start here//////////////////////
//////////////////////////////////////////////////////////////////////////////


      $(document).ready(function () {
      
      });
      
      
      var optionsThree = {
          shouldSort: true,
          threshold: 0.4,
          maxPatternLength: 32,
          keys: [{
              name: 'iata',
              weight: 0.5
          }, {
              name: 'name',
              weight: 0.3
          }, {
              name: 'city',
              weight: 0.2
          }]
      };
      
      var fuseThree = new Fuse(airports, optionsThree)
      
      
      var acThree = $('#from_multi_city')
          .on('click', function (e) {
              e.stopPropagation();
          })
          .on('focus keyup', searchThree)
          .on('keydown', onKeyDownThree);
      
      
      var wrapThree = $('<div>')
          .addClass('autocomplete-wrapper-three')
          .insertBefore(acThree)
          .append(acThree);
      
      var listThree = $('<div>')
          .addClass('autocomplete-results-three')
          .on('click', '.autocomplete-result-three', function (e) {
              e.preventDefault();
              e.stopPropagation();
              selectIndexThree($(this).data('index'));
          })
          .appendTo(wrapThree);
      
      $(document)
          .on('mouseover', '.autocomplete-result-three', function (e) {
              var index = parseInt($(this).data('index'), 10);
              if (!isNaN(index)) {
                  listThree.attr('data-highlight-three', index);
              }
          })
          .on('click', clearResultsThree);
      
      function clearResultsThree() {
          resultsThree = [];
          numResultsThree = 0;
          listThree.empty();
      }
      
      function selectIndexThree(index) {
          if (resultsThree.length >= index + 1) {
              //acThree.val(resultsThree[index].iata + ' ' + resultsThree[index].name + ' ' + resultsThree[index].city + ' ' + resultsThree[index].country);
              //acThree.val(resultsThree[index].iata);
      
              $("#from_multi_cityView").val(resultsThree[index].iata);
              $("#from_multi_city").val(resultsThree[index].iata + ' ' + resultsThree[index].name + ' ' + resultsThree[index].city + ' ' + resultsThree[index].country);
              $("#org2").val(resultsThree[index].iata);
              clearResultsThree();
          }
      }
      
      var resultsThree = [];
      var numResultsThree = 0;
      var selectedIndexThree = -1;
      
      function searchThree(e) {
          if (e.which === 38 || e.which === 13 || e.which === 40) {
              return;
          }
      
          if (acThree.val().length > 0) {
              resultsThree = _.take(fuseThree.search(acThree.val()), 7);
              numResultsThree = resultsThree.length;
      
              var divsThree = resultsThree.map(function (r, i) {
                  return '<div class="autocomplete-result-three" data-index="' + i + '">'
                      + '<div><b>' + r.iata + '</b> - ' + r.name + '</div>'
                      + '<div class="autocomplete-location-three">' + r.city + ', ' + r.country + '</div>'
                      + '</div>';
              });
      
              selectedIndexThree = -1;
              listThree.html(divsThree.join(''))
                  .attr('data-highlight-three', selectedIndexThree);
      
          } else {
              numResultsThree = 0;
              listThree.empty();
          }
      }
      
      function onKeyDownThree(e) {
          switch (e.which) {
              case 38: // up
                  selectedIndexThree--;
                  if (selectedIndexThree <= -1) {
                      selectedIndexThree = -1;
                  }
                  listThree.attr('data-highlight-three', selectedIndexThree);
                  break;
              case 13: // enter
                  selectIndex(selectedIndexThree);
                  break;
              case 9: // enter
                  selectIndex(selectedIndexThree);
                  e.stopPropagation();
                  return;
              case 40: // down
                  selectedIndexThree++;
                  if (selectedIndexThree >= numResultsThree) {
                      selectedIndexThree = numResultsThree - 1;
                  }
                  listThree.attr('data-highlight-three', selectedIndexThree);
                  break;
      
              default: return; // exit this handler for other keys
          }
          e.stopPropagation();
          e.preventDefault(); // prevent the default action (scroll / move caret)
      }

//////////////////////////////////////////////////////////////////////////////
////////////// getAirport3 script section End here//////////////////////
//////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////
////////////// getAirport4 script section start here//////////////////////
//////////////////////////////////////////////////////////////////////////////

      $(document).ready(function () {
      
      });
      
      
      var optionsFour = {
          shouldSort: true,
          threshold: 0.4,
          maxPatternLength: 32,
          keys: [{
              name: 'iata',
              weight: 0.5
          }, {
              name: 'name',
              weight: 0.3
          }, {
              name: 'city',
              weight: 0.2
          }]
      };
      
      var fuseFour = new Fuse(airports, optionsFour)
      
      
      var acFour = $('#to_multi_city')
          .on('click', function (e) {
              e.stopPropagation();
          })
          .on('focus keyup', searchFour)
          .on('keydown', onKeyDownFour);
      
      
      var wrapFour = $('<div>')
          .addClass('autocomplete-wrapper-Four')
          .insertBefore(acFour)
          .append(acFour);
      
      var listFour = $('<div>')
          .addClass('autocomplete-results-Four')
          .on('click', '.autocomplete-result-Four', function (e) {
              e.preventDefault();
              e.stopPropagation();
              selectIndexFour($(this).data('index'));
          })
          .appendTo(wrapFour);
      
      $(document)
          .on('mouseover', '.autocomplete-result-Four', function (e) {
              var index = parseInt($(this).data('index'), 10);
              if (!isNaN(index)) {
                  listFour.attr('data-highlight-Four', index);
              }
          })
          .on('click', clearResultsFour);
      
      function clearResultsFour() {
          resultsFour = [];
          numResultsFour = 0;
          listFour.empty();
      }
      
      function selectIndexFour(index) {
          if (resultsFour.length >= index + 1) {
              //acFour.val(resultsFour[index].iata + ' ' + resultsFour[index].name + ' ' + resultsFour[index].city + ' ' + resultsFour[index].country);
              //acFour.val(resultsFour[index].iata);
      
              $("#to_multi_cityView").val(resultsFour[index].iata);
              $("#to_multi_city").val(resultsFour[index].iata + ' ' + resultsFour[index].name + ' ' + resultsFour[index].city + ' ' + resultsFour[index].country);
              $("#dest2").val(resultsFour[index].iata);
              clearResultsFour();
          }
      }
      
      var resultsFour = [];
      var numResultsFour = 0;
      var selectedIndexFour = -1;
      
      function searchFour(e) {
          if (e.which === 38 || e.which === 13 || e.which === 40) {
              return;
          }
      
          if (acFour.val().length > 0) {
              resultsFour = _.take(fuseFour.search(acFour.val()), 7);
              numResultsFour = resultsFour.length;
      
              var divsFour = resultsFour.map(function (r, i) {
                  return '<div class="autocomplete-result-Four" data-index="' + i + '">'
                      + '<div><b>' + r.iata + '</b> - ' + r.name + '</div>'
                      + '<div class="autocomplete-location-Four">' + r.city + ', ' + r.country + '</div>'
                      + '</div>';
              });
      
              selectedIndexFour = -1;
              listFour.html(divsFour.join(''))
                  .attr('data-highlight-Four', selectedIndexFour);
      
          } else {
              numResultsFour = 0;
              listFour.empty();
          }
      }
      
      function onKeyDownFour(e) {
          switch (e.which) {
              case 38: // up
                  selectedIndexFour--;
                  if (selectedIndexFour <= -1) {
                      selectedIndexFour = -1;
                  }
                  listFour.attr('data-highlight-Four', selectedIndexFour);
                  break;
              case 13: // enter
                  selectIndex(selectedIndexFour);
                  break;
              case 9: // enter
                  selectIndex(selectedIndexFour);
                  e.stopPropagation();
                  return;
              case 40: // down
                  selectedIndexFour++;
                  if (selectedIndexFour >= numResultsFour) {
                      selectedIndexFour = numResultsFour - 1;
                  }
                  listFour.attr('data-highlight-Four', selectedIndexFour);
                  break;
      
              default: return; // exit this handler for other keys
          }
          e.stopPropagation();
          e.preventDefault(); // prevent the default action (scroll / move caret)
      }

//////////////////////////////////////////////////////////////////////////////
////////////// getAirport4 script section End here//////////////////////
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
////////////// getAirport5 script section start here//////////////////////
//////////////////////////////////////////////////////////////////////////////
      $(document).ready(function () {
      
      });
      
      
      var optionsfive = {
          shouldSort: true,
          threshold: 0.4,
          maxPatternLength: 32,
          keys: [{
              name: 'iata',
              weight: 0.5
          }, {
              name: 'name',
              weight: 0.3
          }, {
              name: 'city',
              weight: 0.2
          }]
      };
      
      var fusefive = new Fuse(airports, optionsfive)
      
      
      var acfive = $('#from_multi_city2')
          .on('click', function (e) {
              e.stopPropagation();
          })
          .on('focus keyup', searchfive)
          .on('keydown', onKeyDownfive);
      
      
      var wrapfive = $('<div>')
          .addClass('autocomplete-wrapper-five')
          .insertBefore(acfive)
          .append(acfive);
      
      var listfive = $('<div>')
          .addClass('autocomplete-results-five')
          .on('click', '.autocomplete-result-five', function (e) {
              e.preventDefault();
              e.stopPropagation();
              selectIndexfive($(this).data('index'));
          })
          .appendTo(wrapfive);
      
      $(document)
          .on('mouseover', '.autocomplete-result-five', function (e) {
              var index = parseInt($(this).data('index'), 10);
              if (!isNaN(index)) {
                  listfive.attr('data-highlight-five', index);
              }
          })
          .on('click', clearResultsfive);
      
      function clearResultsfive() {
          resultsfive = [];
          numResultsfive = 0;
          listfive.empty();
      }
      
      function selectIndexfive(index) {
          if (resultsfive.length >= index + 1) {
              //acfive.val(resultsfive[index].iata + ' ' + resultsfive[index].name + ' ' + resultsfive[index].city + ' ' + resultsfive[index].country);
              //acfive.val(resultsfive[index].iata);
      
              $("#from_multi_city2View").val(resultsfive[index].iata);
              $("#from_multi_city2").val(resultsfive[index].iata + ' ' + resultsfive[index].name + ' ' + resultsfive[index].city + ' ' + resultsfive[index].country);
              $("#org3").val(resultsfive[index].iata);
              clearResultsfive();
          }
      }
      
      var resultsfive = [];
      var numResultsfive = 0;
      var selectedIndexfive = -1;
      
      function searchfive(e) {
          if (e.which === 38 || e.which === 13 || e.which === 40) {
              return;
          }
      
          if (acfive.val().length > 0) {
              resultsfive = _.take(fusefive.search(acfive.val()), 7);
              numResultsfive = resultsfive.length;
      
              var divsfive = resultsfive.map(function (r, i) {
                  return '<div class="autocomplete-result-five" data-index="' + i + '">'
                      + '<div><b>' + r.iata + '</b> - ' + r.name + '</div>'
                      + '<div class="autocomplete-location-five">' + r.city + ', ' + r.country + '</div>'
                      + '</div>';
              });
      
              selectedIndexfive = -1;
              listfive.html(divsfive.join(''))
                  .attr('data-highlight-five', selectedIndexfive);
      
          } else {
              numResultsfive = 0;
              listfive.empty();
          }
      }
      
      function onKeyDownfive(e) {
          switch (e.which) {
              case 38: // up
                  selectedIndexfive--;
                  if (selectedIndexfive <= -1) {
                      selectedIndexfive = -1;
                  }
                  listfive.attr('data-highlight-five', selectedIndexfive);
                  break;
              case 13: // enter
                  selectIndex(selectedIndexfive);
                  break;
              case 9: // enter
                  selectIndex(selectedIndexfive);
                  e.stopPropagation();
                  return;
              case 40: // down
                  selectedIndexfive++;
                  if (selectedIndexfive >= numResultsfive) {
                      selectedIndexfive = numResultsfive - 1;
                  }
                  listfive.attr('data-highlight-five', selectedIndexfive);
                  break;
      
              default: return; // exit this handler for other keys
          }
          e.stopPropagation();
          e.preventDefault(); // prevent the default action (scroll / move caret)
      }

//////////////////////////////////////////////////////////////////////////////
////////////// getAirport5 script section End here//////////////////////
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
////////////// getAirport6 script section start here//////////////////////
//////////////////////////////////////////////////////////////////////////////



      $(document).ready(function () {
      
      });
      
      
      var optionssix = {
          shouldSort: true,
          threshold: 0.4,
          maxPatternLength: 32,
          keys: [{
              name: 'iata',
              weight: 0.5
          }, {
              name: 'name',
              weight: 0.3
          }, {
              name: 'city',
              weight: 0.2
          }]
      };
      
      var fusesix = new Fuse(airports, optionssix)
      
      
      var acsix = $('#to_multi_city2')
          .on('click', function (e) {
              e.stopPropagation();
          })
          .on('focus keyup', searchsix)
          .on('keydown', onKeyDownsix);
      
      
      var wrapsix = $('<div>')
          .addClass('autocomplete-wrapper-six')
          .insertBefore(acsix)
          .append(acsix);
      
      var listsix = $('<div>')
          .addClass('autocomplete-results-six')
          .on('click', '.autocomplete-result-six', function (e) {
              e.preventDefault();
              e.stopPropagation();
              selectIndexsix($(this).data('index'));
          })
          .appendTo(wrapsix);
      
      $(document)
          .on('mouseover', '.autocomplete-result-six', function (e) {
              var index = parseInt($(this).data('index'), 10);
              if (!isNaN(index)) {
                  listsix.attr('data-highlight-six', index);
              }
          })
          .on('click', clearResultssix);
      
      function clearResultssix() {
          resultssix = [];
          numResultssix = 0;
          listsix.empty();
      }
      
      function selectIndexsix(index) {
          if (resultssix.length >= index + 1) {
              //acsix.val(resultssix[index].iata + ' ' + resultssix[index].name + ' ' + resultssix[index].city + ' ' + resultssix[index].country);
              //acsix.val(resultssix[index].iata);
      
              $("#to_multi_city2View").val(resultssix[index].iata);
              $("#to_multi_city2").val(resultssix[index].iata + ' ' + resultssix[index].name + ' ' + resultssix[index].city + ' ' + resultssix[index].country);
              $("#dest3").val(resultssix[index].iata);
              clearResultssix();
          }
      }
      
      var resultssix = [];
      var numResultssix = 0;
      var selectedIndexsix = -1;
      
      function searchsix(e) {
          if (e.which === 38 || e.which === 13 || e.which === 40) {
              return;
          }
      
          if (acsix.val().length > 0) {
              resultssix = _.take(fusesix.search(acsix.val()), 7);
              numResultssix = resultssix.length;
      
              var divssix = resultssix.map(function (r, i) {
                  return '<div class="autocomplete-result-six" data-index="' + i + '">'
                      + '<div><b>' + r.iata + '</b> - ' + r.name + '</div>'
                      + '<div class="autocomplete-location-six">' + r.city + ', ' + r.country + '</div>'
                      + '</div>';
              });
      
              selectedIndexsix = -1;
              listsix.html(divssix.join(''))
                  .attr('data-highlight-six', selectedIndexsix);
      
          } else {
              numResultssix = 0;
              listsix.empty();
          }
      }
      
      function onKeyDownsix(e) {
          switch (e.which) {
              case 38: // up
                  selectedIndexsix--;
                  if (selectedIndexsix <= -1) {
                      selectedIndexsix = -1;
                  }
                  listsix.attr('data-highlight-six', selectedIndexsix);
                  break;
              case 13: // enter
                  selectIndex(selectedIndexsix);
                  break;
              case 9: // enter
                  selectIndex(selectedIndexsix);
                  e.stopPropagation();
                  return;
              case 40: // down
                  selectedIndexsix++;
                  if (selectedIndexsix >= numResultssix) {
                      selectedIndexsix = numResultssix - 1;
                  }
                  listsix.attr('data-highlight-six', selectedIndexsix);
                  break;
      
              default: return; // exit this handler for other keys
          }
          e.stopPropagation();
          e.preventDefault(); // prevent the default action (scroll / move caret)
      }

//////////////////////////////////////////////////////////////////////////////
////////////// getAirport6 script section End here//////////////////////
//////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////
////////////// getAirport7 script section start here//////////////////////
//////////////////////////////////////////////////////////////////////////////



      $(document).ready(function () {
      
      });
      
      
      var optionsseven = {
          shouldSort: true,
          threshold: 0.4,
          maxPatternLength: 32,
          keys: [{
              name: 'iata',
              weight: 0.5
          }, {
              name: 'name',
              weight: 0.3
          }, {
              name: 'city',
              weight: 0.2
          }]
      };
      
      var fuseseven = new Fuse(airports, optionsseven)
      
      
      var acseven = $('#from_multi_city3')
          .on('click', function (e) {
              e.stopPropagation();
          })
          .on('focus keyup', searchseven)
          .on('keydown', onKeyDownseven);
      
      
      var wrapseven = $('<div>')
          .addClass('autocomplete-wrapper-seven')
          .insertBefore(acseven)
          .append(acseven);
      
      var listseven = $('<div>')
          .addClass('autocomplete-results-seven')
          .on('click', '.autocomplete-result-seven', function (e) {
              e.preventDefault();
              e.stopPropagation();
              selectIndexseven($(this).data('index'));
          })
          .appendTo(wrapseven);
      
      $(document)
          .on('mouseover', '.autocomplete-result-seven', function (e) {
              var index = parseInt($(this).data('index'), 10);
              if (!isNaN(index)) {
                  listseven.attr('data-highlight-seven', index);
              }
          })
          .on('click', clearResultsseven);
      
      function clearResultsseven() {
          resultsseven = [];
          numResultsseven = 0;
          listseven.empty();
      }
      
      function selectIndexseven(index) {
          if (resultsseven.length >= index + 1) {
              //acseven.val(resultsseven[index].iata + ' ' + resultsseven[index].name + ' ' + resultsseven[index].city + ' ' + resultsseven[index].country);
              //acseven.val(resultsseven[index].iata);
      
              $("#from_multi_city3View").val(resultsseven[index].iata);
              $("#from_multi_city3").val(resultsseven[index].iata + ' ' + resultsseven[index].name + ' ' + resultsseven[index].city + ' ' + resultsseven[index].country);
              $("#org4").val(resultsseven[index].iata);
              clearResultsseven();
          }
      }
      
      var resultsseven = [];
      var numResultsseven = 0;
      var selectedIndexseven = -1;
      
      function searchseven(e) {
          if (e.which === 38 || e.which === 13 || e.which === 40) {
              return;
          }
      
          if (acseven.val().length > 0) {
              resultsseven = _.take(fuseseven.search(acseven.val()), 7);
              numResultsseven = resultsseven.length;
      
              var divsseven = resultsseven.map(function (r, i) {
                  return '<div class="autocomplete-result-seven" data-index="' + i + '">'
                      + '<div><b>' + r.iata + '</b> - ' + r.name + '</div>'
                      + '<div class="autocomplete-location-seven">' + r.city + ', ' + r.country + '</div>'
                      + '</div>';
              });
      
              selectedIndexseven = -1;
              listseven.html(divsseven.join(''))
                  .attr('data-highlight-seven', selectedIndexseven);
      
          } else {
              numResultsseven = 0;
              listseven.empty();
          }
      }
      
      function onKeyDownseven(e) {
          switch (e.which) {
              case 38: // up
                  selectedIndexseven--;
                  if (selectedIndexseven <= -1) {
                      selectedIndexseven = -1;
                  }
                  listseven.attr('data-highlight-seven', selectedIndexseven);
                  break;
              case 13: // enter
                  selectIndex(selectedIndexseven);
                  break;
              case 9: // enter
                  selectIndex(selectedIndexseven);
                  e.stopPropagation();
                  return;
              case 40: // down
                  selectedIndexseven++;
                  if (selectedIndexseven >= numResultsseven) {
                      selectedIndexseven = numResultsseven - 1;
                  }
                  listseven.attr('data-highlight-seven', selectedIndexseven);
                  break;
      
              default: return; // exit this handler for other keys
          }
          e.stopPropagation();
          e.preventDefault(); // prevent the default action (scroll / move caret)
      }

//////////////////////////////////////////////////////////////////////////////
////////////// getAirport7 script section End here//////////////////////
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
////////////// getAirport8 script section start here//////////////////////
//////////////////////////////////////////////////////////////////////////////

      $(document).ready(function () {
      
      });
      
      
      var optionseight = {
          shouldSort: true,
          threshold: 0.4,
          maxPatternLength: 32,
          keys: [{
              name: 'iata',
              weight: 0.5
          }, {
              name: 'name',
              weight: 0.3
          }, {
              name: 'city',
              weight: 0.2
          }]
      };
      
      var fuseeight = new Fuse(airports, optionseight)
      
      
      var aceight = $('#to_multi_city3')
          .on('click', function (e) {
              e.stopPropagation();
          })
          .on('focus keyup', searcheight)
          .on('keydown', onKeyDowneight);
      
      
      var wrapeight = $('<div>')
          .addClass('autocomplete-wrapper-eight')
          .insertBefore(aceight)
          .append(aceight);
      
      var listeight = $('<div>')
          .addClass('autocomplete-results-eight')
          .on('click', '.autocomplete-result-eight', function (e) {
              e.preventDefault();
              e.stopPropagation();
              selectIndexeight($(this).data('index'));
          })
          .appendTo(wrapeight);
      
      $(document)
          .on('mouseover', '.autocomplete-result-eight', function (e) {
              var index = parseInt($(this).data('index'), 10);
              if (!isNaN(index)) {
                  listeight.attr('data-highlight-eight', index);
              }
          })
          .on('click', clearResultseight);
      
      function clearResultseight() {
          resultseight = [];
          numResultseight = 0;
          listeight.empty();
      }
      
      function selectIndexeight(index) {
          if (resultseight.length >= index + 1) {
              //aceight.val(resultseight[index].iata + ' ' + resultseight[index].name + ' ' + resultseight[index].city + ' ' + resultseight[index].country);
              //aceight.val(resultseight[index].iata);
      
              $("#to_multi_city3View").val(resultseight[index].iata);
              $("#to_multi_city3").val(resultseight[index].iata + ' ' + resultseight[index].name + ' ' + resultseight[index].city + ' ' + resultseight[index].country);
              $("#dest4").val(resultseight[index].iata);
              clearResultseight();
          }
      }
      
      var resultseight = [];
      var numResultseight = 0;
      var selectedIndexeight = -1;
      
      function searcheight(e) {
          if (e.which === 38 || e.which === 13 || e.which === 40) {
              return;
          }
      
          if (aceight.val().length > 0) {
              resultseight = _.take(fuseeight.search(aceight.val()), 7);
              numResultseight = resultseight.length;
      
              var divseight = resultseight.map(function (r, i) {
                  return '<div class="autocomplete-result-eight" data-index="' + i + '">'
                      + '<div><b>' + r.iata + '</b> - ' + r.name + '</div>'
                      + '<div class="autocomplete-location-eight">' + r.city + ', ' + r.country + '</div>'
                      + '</div>';
              });
      
              selectedIndexeight = -1;
              listeight.html(divseight.join(''))
                  .attr('data-highlight-eight', selectedIndexeight);
      
          } else {
              numResultseight = 0;
              listeight.empty();
          }
      }
      
      function onKeyDowneight(e) {
          switch (e.which) {
              case 38: // up
                  selectedIndexeight--;
                  if (selectedIndexeight <= -1) {
                      selectedIndexeight = -1;
                  }
                  listeight.attr('data-highlight-eight', selectedIndexeight);
                  break;
              case 13: // enter
                  selectIndex(selectedIndexeight);
                  break;
              case 9: // enter
                  selectIndex(selectedIndexeight);
                  e.stopPropagation();
                  return;
              case 40: // down
                  selectedIndexeight++;
                  if (selectedIndexeight >= numResultseight) {
                      selectedIndexeight = numResultseight - 1;
                  }
                  listeight.attr('data-highlight-eight', selectedIndexeight);
                  break;
      
              default: return; // exit this handler for other keys
          }
          e.stopPropagation();
          e.preventDefault(); // prevent the default action (scroll / move caret)
      }
      
//////////////////////////////////////////////////////////////////////////////
////////////// getAirport8 script section End here//////////////////////
//////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////
////////////// getAirport9 script section start here//////////////////////
//////////////////////////////////////////////////////////////////////////////

       $(document).ready(function () {
      
      });
      
      
      var optionsnine = {
          shouldSort: true,
          threshold: 0.4,
          maxPatternLength: 32,
          keys: [{
              name: 'iata',
              wnine: 0.5
          }, {
              name: 'name',
              wnine: 0.3
          }, {
              name: 'city',
              wnine: 0.2
          }]
      };
      
      var fusenine = new Fuse(airports, optionsnine)
      
      
      var acnine = $('#from_multi_city4')
          .on('click', function (e) {
              e.stopPropagation();
          })
          .on('focus keyup', searchnine)
          .on('keydown', onKeyDownnine);
      
      
      var wrapnine = $('<div>')
          .addClass('autocomplete-wrapper-nine')
          .insertBefore(acnine)
          .append(acnine);
      
      var listnine = $('<div>')
          .addClass('autocomplete-results-nine')
          .on('click', '.autocomplete-result-nine', function (e) {
              e.preventDefault();
              e.stopPropagation();
              selectIndexnine($(this).data('index'));
          })
          .appendTo(wrapnine);
      
      $(document)
          .on('mouseover', '.autocomplete-result-nine', function (e) {
              var index = parseInt($(this).data('index'), 10);
              if (!isNaN(index)) {
                  listnine.attr('data-highlight-nine', index);
              }
          })
          .on('click', clearResultsnine);
      
      function clearResultsnine() {
          resultsnine = [];
          numResultsnine = 0;
          listnine.empty();
      }
      
      function selectIndexnine(index) {
          if (resultsnine.length >= index + 1) {
              //acnine.val(resultsnine[index].iata + ' ' + resultsnine[index].name + ' ' + resultsnine[index].city + ' ' + resultsnine[index].country);
              //acnine.val(resultsnine[index].iata);
      
              $("#from_multi_city4View").val(resultsnine[index].iata);
              $("#from_multi_city4").val(resultsnine[index].iata + ' ' + resultsnine[index].name + ' ' + resultsnine[index].city + ' ' + resultsnine[index].country);
              $("#org5").val(resultsnine[index].iata);
              clearResultsnine();
          }
      }
      
      var resultsnine = [];
      var numResultsnine = 0;
      var selectedIndexnine = -1;
      
      function searchnine(e) {
          if (e.which === 38 || e.which === 13 || e.which === 40) {
              return;
          }
      
          if (acnine.val().length > 0) {
              resultsnine = _.take(fusenine.search(acnine.val()), 7);
              numResultsnine = resultsnine.length;
      
              var divsnine = resultsnine.map(function (r, i) {
                  return '<div class="autocomplete-result-nine" data-index="' + i + '">'
                      + '<div><b>' + r.iata + '</b> - ' + r.name + '</div>'
                      + '<div class="autocomplete-location-nine">' + r.city + ', ' + r.country + '</div>'
                      + '</div>';
              });
      
              selectedIndexnine = -1;
              listnine.html(divsnine.join(''))
                  .attr('data-highlight-nine', selectedIndexnine);
      
          } else {
              numResultsnine = 0;
              listnine.empty();
          }
      }
      
      function onKeyDownnine(e) {
          switch (e.which) {
              case 38: // up
                  selectedIndexnine--;
                  if (selectedIndexnine <= -1) {
                      selectedIndexnine = -1;
                  }
                  listnine.attr('data-highlight-nine', selectedIndexnine);
                  break;
              case 13: // enter
                  selectIndex(selectedIndexnine);
                  break;
              case 9: // enter
                  selectIndex(selectedIndexnine);
                  e.stopPropagation();
                  return;
              case 40: // down
                  selectedIndexnine++;
                  if (selectedIndexnine >= numResultsnine) {
                      selectedIndexnine = numResultsnine - 1;
                  }
                  listnine.attr('data-highlight-nine', selectedIndexnine);
                  break;
      
              default: return; // exit this handler for other keys
          }
          e.stopPropagation();
          e.preventDefault(); // prevent the default action (scroll / move caret)
      }


//////////////////////////////////////////////////////////////////////////////
////////////// getAirport9 script section End here//////////////////////
//////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////
////////////// getAirport10 script section start here//////////////////////
//////////////////////////////////////////////////////////////////////////////



      $(document).ready(function () {
      
      });
      
      
      var optionsten = {
          shouldSort: true,
          threshold: 0.4,
          maxPatternLength: 32,
          keys: [{
              name: 'iata',
              wten: 0.5
          }, {
              name: 'name',
              wten: 0.3
          }, {
              name: 'city',
              wten: 0.2
          }]
      };
      
      var fuseten = new Fuse(airports, optionsten)
      
      
      var acten = $('#to_multi_city4')
          .on('click', function (e) {
              e.stopPropagation();
          })
          .on('focus keyup', searchten)
          .on('keydown', onKeyDownten);
      
      
      var wrapten = $('<div>')
          .addClass('autocomplete-wrapper-ten')
          .insertBefore(acten)
          .append(acten);
      
      var listten = $('<div>')
          .addClass('autocomplete-results-ten')
          .on('click', '.autocomplete-result-ten', function (e) {
              e.preventDefault();
              e.stopPropagation();
              selectIndexten($(this).data('index'));
          })
          .appendTo(wrapten);
      
      $(document)
          .on('mouseover', '.autocomplete-result-ten', function (e) {
              var index = parseInt($(this).data('index'), 10);
              if (!isNaN(index)) {
                  listten.attr('data-highlight-ten', index);
              }
          })
          .on('click', clearResultsten);
      
      function clearResultsten() {
          resultsten = [];
          numResultsten = 0;
          listten.empty();
      }
      
      function selectIndexten(index) {
          if (resultsten.length >= index + 1) {
              //acten.val(resultsten[index].iata + ' ' + resultsten[index].name + ' ' + resultsten[index].city + ' ' + resultsten[index].country);
              //acten.val(resultsten[index].iata);
      
              $("#to_multi_city4View").val(resultsten[index].iata);
              $("#to_multi_city4").val(resultsten[index].iata + ' ' + resultsten[index].name + ' ' + resultsten[index].city + ' ' + resultsten[index].country);
              $("#dest5").val(resultsten[index].iata);
              clearResultsten();
          }
      }
      
      var resultsten = [];
      var numResultsten = 0;
      var selectedIndexten = -1;
      
      function searchten(e) {
          if (e.which === 38 || e.which === 13 || e.which === 40) {
              return;
          }
      
          if (acten.val().length > 0) {
              resultsten = _.take(fuseten.search(acten.val()), 7);
              numResultsten = resultsten.length;
      
              var divsten = resultsten.map(function (r, i) {
                  return '<div class="autocomplete-result-ten" data-index="' + i + '">'
                      + '<div><b>' + r.iata + '</b> - ' + r.name + '</div>'
                      + '<div class="autocomplete-location-ten">' + r.city + ', ' + r.country + '</div>'
                      + '</div>';
              });
      
              selectedIndexten = -1;
              listten.html(divsten.join(''))
                  .attr('data-highlight-ten', selectedIndexten);
      
          } else {
              numResultsten = 0;
              listten.empty();
          }
      }
      
      function onKeyDownten(e) {
          switch (e.which) {
              case 38: // up
                  selectedIndexten--;
                  if (selectedIndexten <= -1) {
                      selectedIndexten = -1;
                  }
                  listten.attr('data-highlight-ten', selectedIndexten);
                  break;
              case 13: // enter
                  selectIndex(selectedIndexten);
                  break;
              case 9: // enter
                  selectIndex(selectedIndexten);
                  e.stopPropagation();
                  return;
              case 40: // down
                  selectedIndexten++;
                  if (selectedIndexten >= numResultsten) {
                      selectedIndexten = numResultsten - 1;
                  }
                  listten.attr('data-highlight-ten', selectedIndexten);
                  break;
      
              default: return; // exit this handler for other keys
          }
          e.stopPropagation();
          e.preventDefault(); // prevent the default action (scroll / move caret)
      }

      

//////////////////////////////////////////////////////////////////////////////
////////////// getAirport10 script section End here//////////////////////
//////////////////////////////////////////////////////////////////////////////



       $(document).ready(function () {
      $("#datedepart1").datepicker({
            numberOfMonths: 1,
            showOtherMonths: true,
            dateFormat: 'M-dd-yy',
            minDate: 0,
        });
      $("#datedepart").datepicker({
          numberOfMonths: 1,
          dateFormat: 'M-dd-yy',
          minDate: 0,
          onSelect: function (selected) {
            if($("#datereturn").length >0)
              $("#datereturn").datepicker("option", "minDate", selected);
            if($("#datedepart2").length >0)
              $('#datedepart2').datepicker("option","minDate", selected);
          }
      });
      $("#datereturn").datepicker({
          numberOfMonths: 1,
          dateFormat: 'M-dd-yy',
          minDate: 0,
          onSelect: function (selected) {
              $("#datedepart").datepicker("option", "maxDate", selected)
          }
      });

       $("#datedepart2").datepicker({
          numberOfMonths: 1,
          dateFormat: 'M-dd-yy',
          minDate: 0,
          onSelect: function (selected) {
              $("#datedepart").datepicker("option", "maxDate", selected)
              if(('#date_multi_city').length>0)
                $("#date_multi_city").datepicker("option", "minDate", selected)
          }
      });
       
      
      $("#date_multi_city").datepicker({
          numberOfMonths: 1,
          dateFormat: 'M-dd-yy',
          minDate: 0,
          onSelect: function (selected) {
              $("#datedepart").datepicker("option", "maxDate", selected)
              if(('#date_multi2_city').length>0)
                $("#date_multi2_city").datepicker("option", "minDate", selected)
          }
      });
      
      $("#date_multi2_city").datepicker({
          numberOfMonths: 1,
          dateFormat: 'M-dd-yy',
          minDate: 0,
          onSelect: function (selected) {
              $("#date_multi2_city").datepicker("option", "maxDate", selected)
              if(('#date_multi3_city').length>0)
                $("#date_multi3_city").datepicker("option", "minDate", selected)
          }
      });
      
      $("#date_multi3_city").datepicker({
          numberOfMonths: 1,
          dateFormat: 'M-dd-yy',
          minDate: 0,
          onSelect: function (selected) {
              $("#date_multi3_city").datepicker("option", "maxDate", selected)
              if(('#date_multi_city4').length>0)
                $("#date_multi_city4").datepicker("option", "minDate", selected)
          }
      });
      
      $("#date_multi_city4").datepicker({
          numberOfMonths:1,
          dateFormat: 'M-dd-yy',
          minDate: 0,
          onSelect: function (selected) {
              $("#date_multi_city4").datepicker("option", "maxDate", selected)
              if(('#date_multi_city5').length>0)
                $("#date_multi_city5").datepicker("option", "minDate", selected)
          }
      });

      $("#date_multi_city5").datepicker({
          numberOfMonths:1,
          dateFormat: 'M-dd-yy',
          minDate: 0,
          onSelect: function (selected) {
              $("#date_multi_city5").datepicker("option", "maxDate", selected)
              // if(('#date_multi_city6').length>0)
              //   $("#date_multi_city6").datepicker("option", "minDate", selected)
          }
      });
      
      });







