User:Matt2905/common.js

var changeTab = function( event ) { var tabberTab = document.getElementsByClassName('tabbertab'); var tabberNav = document.querySelector('.tabbernav li'); for (i = 0; i < tabberTab.length; ++i) { if (tabberTab[i].title == this.title) { tabberTab[i].style.display = 'block'; } else { tabberTab[i].style.display = 'none'; }   }    for (i = 0; i < tabberNav.length; ++i) { if (tabberNav[i].classList.contains("tabberactive")) { $(tabberNav[i]).toggleClass("tabberactive"); }       if (tabberNav[i].getElementsByTagName("a")[0].title == this.title) { $(tabberNav[i]).toggleClass("tabberactive"); }   } };

imageTabber = document.getElementById('imageTabber'); if (imageTabber) { var images = imageTabber.getElementsByTagName("a"); for (i = 0; i < images.length; ++i) { images[i].addEventListener("click", changeTab); } }