function openModal(m, s, c, d) { document.getElementById(m).style.display = "block"; h_current_modal = m; h_current_slides = s; h_current_captions = c; h_current_dots = d; } function closeModal() { document.getElementById(h_current_modal).style.display = "none"; } var slideIndex = 1; var h_current_modal; var h_current_slides; var h_current_captions; var h_current_dots; function plusSlides(n) { showSlides(slideIndex += n); } function currentSlide(n) { showSlides(slideIndex = n); } function showSlides(n) { var i; var slides = document.getElementsByClassName(h_current_slides); var dots = document.getElementsByClassName(h_current_dots); var captionText = document.getElementById(h_current_captions); if (n > slides.length) {slideIndex = 1} if (n < 1) {slideIndex = slides.length} for (i = 0; i < slides.length; i++) { slides[i].style.display = "none"; } for (i = 0; i < dots.length; i++) { dots[i].className = dots[i].className.replace(" active", ""); } slides[slideIndex-1].style.display = "block"; dots[slideIndex-1].className += " active"; captionText.innerHTML = dots[slideIndex-1].alt; }