function animal_wildlife_openCity(evt, cityName) { var animal_wildlife_i, animal_wildlife_tabcontent, animal_wildlife_tablinks; animal_wildlife_tabcontent = document.getElementsByClassName("tabcontent"); for (animal_wildlife_i = 0; animal_wildlife_i < animal_wildlife_tabcontent.length; animal_wildlife_i++) { animal_wildlife_tabcontent[animal_wildlife_i].style.display = "none"; } animal_wildlife_tablinks = document.getElementsByClassName("tablinks"); for (animal_wildlife_i = 0; animal_wildlife_i < animal_wildlife_tablinks.length; animal_wildlife_i++) { animal_wildlife_tablinks[animal_wildlife_i].className = animal_wildlife_tablinks[animal_wildlife_i].className.replace(" active", ""); } document.getElementById(cityName).style.display = "block"; evt.currentTarget.className += " active"; }