


// Get Quote Form validation

(function () {
  'use strict';
  var forms = document.querySelectorAll('.needs-validation');
  // Loop over them and prevent submission
  Array.prototype.slice.call(forms).forEach(function (form) {
    form.addEventListener('submit', function (event) {
      if (!form.checkValidity()) {
        event.preventDefault();
        event.stopPropagation();
      }

      form.classList.add('was-validated');
    }, false);
  });
})();


$(document).ready(function () {
  $('.navdesktop').hover(
    function () {
      $(this).addClass('show');
      $(this).find('.dropdown-navdesktop').first().addClass('show');
    },
    function () {
      $(this).removeClass('show');
      $(this).find('.dropdown-navdesktop').first().removeClass('show');
    }
  );
});

// Sticky header

// window.addEventListener("scroll", function () {
//   var header = document.querySelector("header");
//   header.classList.toggle("sticky", window.scrollY > 0);
// })

// end Sticky header




const swiper = new Swiper('.includes-swiper-main', {
  // Optional parameters
  loop: true,
  slidesPerView: "auto",
  spaceBetween: 20,
  autoplay: {
    delay: 3000, // Delay between transitions in milliseconds
    disableOnInteraction: false, // Keeps autoplay running even after user interaction
  }, pagination: {
    el: '.swiper-pagination',
    clickable: true, // Allows clicking on pagination bullets to navigate
  },


  centeredSlides: true,


});

const HeroSwiper = new Swiper('.hero-swiper-main', {
  // Optional parameters
  loop: true,
  slidesPerView: "auto",
  spaceBetween: 0,
  centeredSlides: true,

  autoplay: {
    delay: 3000, // Delay between transitions in milliseconds
    disableOnInteraction: false, // Keeps autoplay running even after user interaction
  }, pagination: {
    el: '.swiper-pagination',
    clickable: true, // Allows clicking on pagination bullets to navigate
  },

  // Pagination parameters
  pagination: {
    el: '.swiper-pagination',
    clickable: true, // Allows clicking on pagination bullets to navigate
  },


});