Privacy Policy & Terms of Service | Fair Pay Leasing
// Tab functionality const tabBtns = document.querySelectorAll('.tab-btn'); const sections = document.querySelectorAll('.legal-section'); tabBtns.forEach(btn => { btn.addEventListener('click', () => { const tabId = btn.dataset.tab; // Update buttons tabBtns.forEach(b => b.classList.remove('active')); btn.classList.add('active'); // Update sections sections.forEach(s => s.classList.remove('active')); document.getElementById(tabId).classList.add('active'); // Update URL hash window.location.hash = tabId; // Scroll to top of content document.querySelector('.legal-content').scrollIntoView({ behavior: 'smooth' }); }); }); // Handle hash on page load window.addEventListener('load', () => { const hash = window.location.hash.replace('#', ''); if (hash && document.getElementById(hash)) { tabBtns.forEach(b => b.classList.remove('active')); sections.forEach(s => s.classList.remove('active')); document.querySelector(`[data-tab="${hash}"]`)?.classList.add('active'); document.getElementById(hash)?.classList.add('active'); } });