jQuery( document ).ready(function($) {
  $("link[media=\"1\"]").attr("media", "all"); // load css async

  $('#nav').Stickyfill(); // NAV

  $(document).on("click", "nav.navbar #ams-topnav[aria-expanded=\"true\"] a", function() {
    $('.navbar-toggler').click();
  });

  $(document).on('click', 'a.scroll-link[href^="#"]', function(e){
    e.preventDefault();

    $('html, body').animate({
      scrollTop: $( $.attr(this, 'href') ).offset().top
    }, 500);
  });

  /** TdA Carousel **/

  $('.owl-carousel').slick({
      dots: false,
      infinite: true,
      variableWidth: true,
      autoplay: true,
      lazyLoad: 'progressive',
      swipeToSlide: true,
      waitForAnimate: false,
      nextArrow: '<span class="icon-next" aria-hidden="true"><i class="fa fa-chevron-right" aria-hidden="true"></i></span>',
      prevArrow: '<span class="icon-prev" aria-hidden="true"><i class="fa fa-chevron-left" aria-hidden="true"></i></span>',
  });

});