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

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