document.addEventListener("DOMContentLoaded", function () { const tocToggle = document.getElementById("toc-toggle"); const tocContainer = document.getElementById("toc-container"); if (tocToggle && tocContainer) { tocToggle.addEventListener("click", function () { if (tocContainer.style.display === "none") { tocContainer.style.display = "block"; tocToggle.textContent = "Tartalomjegyzék elrejtése"; } else { tocContainer.style.display = "none"; tocToggle.textContent = "Tartalomjegyzék megjelenítése"; } }); } });