/* ================================================================ 
This copyright notice must be untouched at all times.

The original version of this script and the associated (x)html
is available at http://www.stunicholls.com/various/tabbed_pages.html
Copyright (c) 2005-2007 Stu Nicholls. All rights reserved.
This script and the associated (x)html may be modified in any 
way to fit your requirements.
=================================================================== */

 function raz(){
  var e, i = 0;
	while (e = document.getElementById('gallery1').getElementsByTagName ('DIV') [i++]) {
		if (e.className == 'on1' || e.className == 'off1') {
		e.onclick = function () {
			var getEls = document.getElementsByTagName('DIV');
			//var max = this.getAttribute('title');
        for (var z=0; z<getEls.length; z++) {
				getEls[z].className=getEls[z].className.replace('show1', 'hide1');
				getEls[z].className=getEls[z].className.replace('on1', 'off1');
				
				}
			this.className = 'on1';
			var max = this.getAttribute('title');
			document.getElementById(max).className = "show1";
			}
		}
	}
}
 function dwa(){
  var e, i = 0;
	while (e = document.getElementById('gallery2').getElementsByTagName ('DIV') [i++]) {
		if (e.className == 'on2' || e.className == 'off2') {
		e.onclick = function () {
			var getEls = document.getElementsByTagName('DIV');
			//var max = this.getAttribute('title');
        for (var z=0; z<getEls.length; z++) {
				getEls[z].className=getEls[z].className.replace('show2', 'hide2');
				getEls[z].className=getEls[z].className.replace('on2', 'off2');
				
				}
			this.className = 'on2';
			var max = this.getAttribute('title');
			document.getElementById(max).className = "show2";
			}
		}
	}
}

function trzy(){
  var e, i = 0;
	while (e = document.getElementById('gallery3').getElementsByTagName ('DIV') [i++]) {
		if (e.className == 'on3' || e.className == 'off3') {
		e.onclick = function () {
			var getEls = document.getElementsByTagName('DIV');
			//var max = this.getAttribute('title');
        for (var z=0; z<getEls.length; z++) {
				getEls[z].className=getEls[z].className.replace('show3', 'hide3');
				getEls[z].className=getEls[z].className.replace('on3', 'off3');
				
				}
			this.className = 'on3';
			var max = this.getAttribute('title');
			document.getElementById(max).className = "show3";
			}
		}
	}
}

function cztery(){
  var e, i = 0;
	while (e = document.getElementById('gallery4').getElementsByTagName ('DIV') [i++]) {
		if (e.className == 'on4' || e.className == 'off4') {
		e.onclick = function () {
			var getEls = document.getElementsByTagName('DIV');
			//var max = this.getAttribute('title');
        for (var z=0; z<getEls.length; z++) {
				getEls[z].className=getEls[z].className.replace('show4', 'hide4');
				getEls[z].className=getEls[z].className.replace('on4', 'off4');
				
				}
			this.className = 'on4';
			var max = this.getAttribute('title');
			document.getElementById(max).className = "show4";
			}
		}
	}
}
	
onload = function() 
{
	raz(); 
  dwa();
  trzy();
  cztery();
}
