+// Set up event listeners
+window.addEventListener("resize", setHeights, true);
+slideshow.addEventListener("mouseenter", mouseEnter, true);
+slideshow.addEventListener("mouseleave", mouseLeave, true);
+document.getElementById("prev").addEventListener("click", prevSlide);
+document.getElementById("next").addEventListener("click", nextSlide);
+document.getElementById("state").addEventListener("click", changeState);
+if (dots.length - 1 != maxIndex) {
+ console.log("Number of control dots does not match number of slides");
+}
+for (i = 0; i <= dots.length - 1; i++) {
+ dots[i].addEventListener("click", goToSlide);
+ dots[i].slide = i;
+}
+
+