// Function to update the content function updateLocationContent(locationKey) { const location = locationData[locationKey]; if (location) { document.getElementById('location-text').innerText = location.text; document.getElementById('location-img').src = location.imageUrl; document.getElementById('location-direction').href = location.direction; } } document.querySelectorAll('.location-button').forEach(button => { button.addEventListener('click', (event) => { const index = event.currentTarget.getAttribute('data-location'); const locInfo = window.locInfo; // We'll inject this below const location = locInfo[index]; if (location) { document.getElementById('location-text').innerText = location.directions; document.getElementById('location-img').src = location.image; document.getElementById('location-direction').href = location.url; } }); });