function pixel_transport_mobile_menu_open() {
  jQuery(".side_nav").addClass('show');
}
function pixel_transport_mobile_menu_close() {
  jQuery(".side_nav").removeClass('show');
}

jQuery(function($){
  $('.toggle').click(function () {
        pixel_transport_Keyboard_loop($('.side_nav'));
    });
});

var pixel_transport_Keyboard_loop = function (elem) {
  var pixel_transport_tabbable = elem.find('select, input, textarea, button, a').filter(':visible');
  var pixel_transport_firstTabbable = pixel_transport_tabbable.first();
  var pixel_transport_lastTabbable = pixel_transport_tabbable.last();
  pixel_transport_firstTabbable.focus();

  pixel_transport_lastTabbable.on('keydown', function (e) {
    if ((e.which === 9 && !e.shiftKey)) {
      e.preventDefault();
      pixel_transport_firstTabbable.focus();
    }
  });

  pixel_transport_firstTabbable.on('keydown', function (e) {
    if ((e.which === 9 && e.shiftKey)) {
      e.preventDefault();
      pixel_transport_lastTabbable.focus();
    }
  });

  elem.on('keyup', function (e) {
    if (e.keyCode === 27) {
      elem.hide();
    };
  });
};

jQuery(document).ready(function () {
  jQuery( ".tablinks" ).first().addClass( "active" );
  jQuery( ".tabcontent" ).first().addClass( "active" );
});

function pixel_transport_projects_tab(evt, cityName) {
  var i, tabcontent, tablinks;
  tabcontent = document.getElementsByClassName("tabcontent");
  for (i = 0; i < tabcontent.length; i++) {
    tabcontent[i].style.display = "none";
  }
  tablinks = document.getElementsByClassName("tablinks");
  for (i = 0; i < tablinks.length; i++) {
    tablinks[i].className = tablinks[i].className.replace(" active", "");
  }
  jQuery('#'+ cityName).show()
  evt.currentTarget.className += " active";
}

jQuery(window).scroll(function () {
    if (jQuery(this).scrollTop() >= 200) {
        jQuery("#return-to-top").fadeIn();
    } else {
        jQuery("#return-to-top").fadeOut();
    }
});

jQuery("#return-to-top").click(function () {
    jQuery("html, body").animate({ scrollTop: 0 }, 600);
});

jQuery(document).ready(function($) {
  $(window).scroll(function() {
      if ($('.sticky-header').length) {
          if ($(this).scrollTop() > 50) {
              $('header.sticky-header').addClass('sticky-active');
          } else {
              $('header.sticky-header').removeClass('sticky-active');
          }
      }
  });
});