// Scroll to Top
window.onscroll = function() {
  const house_dealer_button = document.querySelector('.scroll-top-btn');
  if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {
    house_dealer_button.style.display = "block";
  } else {
    house_dealer_button.style.display = "none";
  }
};

document.querySelector('.scroll-top-btn a').onclick = function(event) {
  event.preventDefault();
  window.scrollTo({top: 0, behavior: 'smooth'});
};

// Blog Slider
jQuery(document).ready(function($) {
  const section = $('.blog-section');
  const owl = section.find('.owl-carousel').owlCarousel({
    loop: true,
    nav: false,
    dots: false,
    rtl: false,
    autoplay: true,
    responsive: {
      0: {        
        items: 1
      },
      768: {
        margin: 30,
        items: 2
      },
      992: {
        margin: 45,
        items: 3
      }
    }
  });
});