// Scroll to Top
var carpet_services_scrollBtn = document.querySelector('.scroll-top-btn');
var carpet_services_scrollBtnLink = document.querySelector('.scroll-top-btn a');

if ( carpet_services_scrollBtn ) {
  window.onscroll = function() {
    if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {
      carpet_services_scrollBtn.style.display = 'block';
    } else {
      carpet_services_scrollBtn.style.display = 'none';
    }
  };
}

if ( carpet_services_scrollBtnLink ) {
  carpet_services_scrollBtnLink.onclick = function(event) {
    event.preventDefault();
    window.scrollTo({top: 0, behavior: 'smooth'});
  };
}