// About var visionButton = document.querySelector(".read-more-vision"); var visionSection = document.querySelector(".section-vision"); var constitutionButton = document.querySelector(".read-more-constitution"); var constitutionSection = document.querySelector(".section-constitution"); var officeButton = document.querySelector(".read-more-office"); var officeSection = document.querySelector(".section-office-bearers"); var memoryButton = document.querySelector(".read-more-memory"); var memorySection = document.querySelector(".section-memory"); var presidentsButton = document.querySelector(".read-more-presidents"); var presidentsSection = document.querySelector(".section-past-presidents"); visionButton.addEventListener("click", function() { visionSection.scrollIntoView({behavior: "smooth", block: "start", inline: "nearest"}); }); constitutionButton.addEventListener("click", function() { constitutionSection.scrollIntoView({behavior: "smooth", block: "start", inline: "nearest"}); }); officeButton.addEventListener("click", function() { officeSection.scrollIntoView({behavior: "smooth", block: "start", inline: "nearest"}); }); memoryButton.addEventListener("click", function() { memorySection.scrollIntoView({behavior: "smooth", block: "start", inline: "nearest"}); }); presidentsButton.addEventListener("click", function() { presidentsSection.scrollIntoView({behavior: "smooth", block: "start", inline: "nearest"}); }); // Membership var benefitsButton = document.querySelector(".read-more-benefits"); var benefitsSection = document.querySelector(".section-benefits"); var classesButton = document.querySelector(".read-more-classes"); var classesSection = document.querySelector(".section-classes"); var formsButton = document.querySelector(".read-more-forms"); var formsSection = document.querySelector(".section-forms"); var registrationButton = document.querySelector(".read-more-registration"); var registrationSection = document.querySelector(".section-registration"); benefitsButton.addEventListener("click", function() { benefitsSection.scrollIntoView({behavior: "smooth", block: "start", inline: "nearest"}); }); classesButton.addEventListener("click", function() { classesSection.scrollIntoView({behavior: "smooth", block: "start", inline: "nearest"}); }); formsButton.addEventListener("click", function() { formsSection.scrollIntoView({behavior: "smooth", block: "start", inline: "nearest"}); }); registrationButton.addEventListener("click", function() { registrationSection.scrollIntoView({behavior: "smooth", block: "start", inline: "nearest"}); }); // Documentation var cpdButton = document.getElementById("cpd-download"); var cecButton = document.getElementById("cec-download"); var actionButton = document.getElementById("action-download"); var miscButton = document.getElementById("misc-download"); var sectionDocumentation = document.querySelector(".section-documentation"); var coursewareButton = document.getElementById("courseware-button"); var sectionCourseware = document.querySelector(".section-courseware"); var calendarButton = document.getElementById("calendar-button"); var sectionCalendar = document.querySelector(".section-calendar"); cpdButton.addEventListener("click", function() { sectionDocumentation.style.height = (sectionDocumentation.style.height == "500px") ? "350px" : "500px"; }); cecButton.addEventListener("click", function() { sectionDocumentation.style.height = (sectionDocumentation.style.height == "700px") ? "350px" : "700px"; }); actionButton.addEventListener("click", function() { sectionDocumentation.style.height = (sectionDocumentation.style.height == "1300px") ? "350px" : "1300px"; }); coursewareButton.addEventListener("click", function() { sectionCourseware.scrollIntoView({behavior: "smooth", block: "start", inline: "nearest"}); }); calendarButton.addEventListener("click", function() { sectionCalendar.scrollIntoView({behavior: "smooth", block: "start", inline: "nearest"}); }); // Publications var bursaryButton = document.querySelector(".read-more-bursary"); var sectionBursary = document.querySelector(".bursary-scheme"); var sectionPublications = document.querySelector(".section-publications"); var trfButton = document.getElementById("trf-download"); var innovationButton = document.getElementById("innovation-download"); var technicalButton = document.getElementById("technical-download"); var newsletterButton = document.getElementById("newsletter-download"); bursaryButton.addEventListener("click", function() { sectionBursary.scrollIntoView({behavior: "smooth", block: "start", inline: "nearest"}); }); trfButton.addEventListener("click", function() { sectionPublications.style.height = (sectionPublications.style.height == "525px") ? "300px" : "525px"; }); innovationButton.addEventListener("click", function() { sectionPublications.style.height = (sectionPublications.style.height == "470px") ? "300px" : "470px"; }); technicalButton.addEventListener("click", function() { sectionPublications.style.height = (sectionPublications.style.height == "630px") ? "300px" : "630px"; }); newsletterButton.addEventListener("click", function() { sectionPublications.style.height = (sectionPublications.style.height == "850px") ? "300px" : "850px"; }); // Feedback var otherBrowser = document.querySelector(".other-browser"); var sectionFeedback = document.querySelector(".section-feedback"); var inputBrowser = document.querySelector("#input-browser"); otherBrowser.style.display = "none"; inputBrowser.addEventListener("change", function() { if (inputBrowser.value == "other") { otherBrowser.style.display = "block"; sectionFeedback.style.height = "900px"; } else { otherBrowser.style.display = "none"; sectionFeedback.style.height = "830px"; } });