document.addEventListener('DOMContentLoaded', () => { // Initialize tooltips const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')); tooltipTriggerList.map(function (tooltipTriggerEl) { return new bootstrap.Tooltip(tooltipTriggerEl); }); // External link handler document.querySelectorAll('a[target="_blank"]').forEach(link => { link.addEventListener('click', (e) => { e.preventDefault(); window.open(link.href, '_blank', 'noopener,noreferrer'); }); }); }); function trackSimulationCompletion(simulationId) { const completed = JSON.parse(localStorage.getItem('completedSimulations')); if (!completed.includes(simulationId)) { completed.push(simulationId); localStorage.setItem('completedSimulations', JSON.stringify(completed)); } }