
onload = function() {
	var e, i = 0;
	if ($('gallery') == null) return;
	while (e = $('gallery').getElementsByTagName('A') [i++]) {
		//if (e.className == 'on' || e.className == 'off') {
		e.onclick = function () {
			var getEls = document.getElementsByTagName('DIV');
			for (var z=0; z<getEls.length; z++) {
				getEls[z].className=getEls[z].className.replace('tab show', 'tab hide');
				getEls[z].className=getEls[z].className.replace('tablink current', 'tablink');
			}
			var getEls = document.getElementsByTagName('A');
			for (var z=0; z<getEls.length; z++) {
				getEls[z].className=getEls[z].className.replace('tablink current', 'tablink');
			}
			
			this.className = 'tablink current';
			var max = this.getAttribute('title');
			document.getElementById(max).className = "tab show";
			return false;
			}
		//}
	}
}
