/* $DOUG: SACL/main.js,v 1.4 2017/06/30 05:10:08 doug Exp $ */ /* When the user clicks on the button, toggle between hiding and showing the dropdown content Each dropdown menu needs its own function pointint to its id. */ function aboutFunction() { document.getElementById("aboutDropdown").classList.toggle("show"); } function resourcesFunction() { document.getElementById("resourcesDropdown").classList.toggle("show"); } function ministriesFunction() { document.getElementById("ministriesDropdown").classList.toggle("show"); } function contactFunction() { document.getElementById("contactDropdown").classList.toggle("show"); } function blogFunction() { document.getElementById("blogDropdown").classList.toggle("show"); } // Close the dropdown if the user clicks outside of it window.onclick = function(event) { if (!event.target.matches('.dropbtn')) { var dropdowns = document.getElementsByClassName("dropdown-content"); var i; for (i = 0; i < dropdowns.length; i++) { var openDropdown = dropdowns[i]; if (openDropdown.classList.contains('show')) { openDropdown.classList.remove('show'); } } } } function set_year () { year = prompt ("Enter desired year.", "%s"); if (year != null) document.getElementById('year').href="year_index?year=" + year; } function window_size (thisForm) { thisForm.WIDTH.value = screen.width; thisForm.HEIGHT.value = screen.height; }