Opening Hours:
${store.hours.replace(/;/g,'
')}
Contact: ${store.contact}
`;
});
// Toggle Individual Store Section
function toggleStore(element, id) {
const content = document.getElementById(id);
element.classList.toggle('active');
if (content.style.maxHeight) {
content.style.maxHeight = null;
content.classList.remove('show');
} else {
content.style.maxHeight = content.scrollHeight + "px";
content.classList.add('show');
}
}
// Expand All Stores
function expandAllStores() {
const headings = document.querySelectorAll('.store-page h2');
headings.forEach(h => {
const id = h.getAttribute('onclick').match(/'([^']+)'/)[1];
const content = document.getElementById(id);
h.classList.add('active');
content.classList.add('show');
content.style.maxHeight = content.scrollHeight + "px";
});
}
// Collapse All Stores
function closeAllStores() {
const headings = document.querySelectorAll('.store-page h2');
headings.forEach(h => {
const id = h.getAttribute('onclick').match(/'([^']+)'/)[1];
const content = document.getElementById(id);
h.classList.remove('active');
content.classList.remove('show');
content.style.maxHeight = null;
});
}