User:Matt2905/common.js

$(document).ready(function {    var changeTab = function( event ) {        var tabberTab = document.getElementsByClassName('tabbertab');        var tabberNav = document.querySelector('ul.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';            }        }            console.log(tabberNav.length);        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");            }        }    };

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

});