// Main JavaScript functionality document.addEventListener('DOMContentLoaded', function() { // Initialize tooltips const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')); if (tooltipTriggerList.length > 0) { tooltipTriggerList.map(function (tooltipTriggerEl) { return new bootstrap.Tooltip(tooltipTriggerEl); }); } // Smooth scroll for anchor links document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); document.querySelector(this.getAttribute('href')).scrollIntoView({ behavior: 'smooth' }); }); }); // Age calculator for demonstration purposes const currentYear = new Date().getFullYear(); const targetYear = 2025; const cutoffAge = 42; const ageCalcForm = document.getElementById('age-calculator'); if (ageCalcForm) { ageCalcForm.addEventListener('submit', function(e) { e.preventDefault(); const birthYear = parseInt(document.getElementById('birth-year').value); const ageIn2025 = targetYear - birthYear; const resultElement = document.getElementById('age-result'); resultElement.innerHTML = `
In 2025, you will be ${ageIn2025} years old.
${ageIn2025 > cutoffAge ? 'This exceeds the standard cutoff age, but waiver options may be available.' : 'You meet the standard age requirements!'}