// Smooth scroll to contact section function scrollToContact() { const contactSection = document.getElementById('contact-section'); if (contactSection) { contactSection.scrollIntoView({ behavior: 'smooth', block: 'start' }); } } // Smooth scroll to FAQ section function scrollToFAQ() { const faqSection = document.getElementById('faq-section'); if (faqSection) { faqSection.scrollIntoView({ behavior: 'smooth', block: 'start' }); } } // Smooth scroll to tracking section function scrollToTracking() { const trackingSection = document.getElementById('tracking-section'); if (trackingSection) { trackingSection.scrollIntoView({ behavior: 'smooth', block: 'start' }); } } // Initialize the page function init() { // Make scroll functions available globally window.scrollToContact = scrollToContact; window.scrollToFAQ = scrollToFAQ; window.scrollToTracking = scrollToTracking; // Add success message handling for form submissions const forms = document.querySelectorAll('form[data-landingsite-contact-form]'); forms.forEach(form => { form.addEventListener('submit', function(e) { // Show a success message after form submission setTimeout(() => { const submitButton = form.querySelector('button[type="submit"]'); if (submitButton) { const originalText = submitButton.innerHTML; submitButton.innerHTML = 'Message Sent!'; submitButton.style.backgroundColor = '#2B8A3E'; setTimeout(() => { submitButton.innerHTML = originalText; submitButton.style.backgroundColor = ''; form.reset(); }, 3000); } }, 100); }); }); } // Cleanup function function teardown() { // Remove global functions if (window.scrollToContact) delete window.scrollToContact; if (window.scrollToFAQ) delete window.scrollToFAQ; if (window.scrollToTracking) delete window.scrollToTracking; } // Export functions for the landingsite system export { init, teardown };