/* ================================================================ 
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.
=================================================================== */


onload = function() {
	var e, i = 0;
	while (e = document.getElementById('gallery').getElementsByTagName ('DIV') [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('show', 'hide');
				getEls[z].className=getEls[z].className.replace('on', 'off');
				}
			this.className = 'on';
			var max = this.getAttribute('title');
			document.getElementById(max).className = "show";
			}
			/*
			var getElsA = e.getElementsByTagName('a');
			alert(getElsA[0].className);
			switch (getElsA[0].className){
				case 'imagen1' : 
				                 if(e.className == 'on')
								 {
								 	window.document['imagen1'].src = 'imagenes/menuv_01.jpg';
								 	break;
								 }
				case 'imagen2' : window.document['imagen2'].src = 'imagenes/menuv_02.jpg';
							 	 break;	
			}
			*/
			/*
			if(e.className == 'on'){
				var getElsA = e.getElementsByTagName('a');
				for (var j=0; j<getElsA.length; j++) {
			  	switch (getElsA[j].className){
					case 'imagen1' : window.document['imagen1'].src = 'imagenes/menuv_01.jpg';
					case 'imagen2' : window.document['imagen2'].src = 'imagenes/menuv_02.jpg'
			  	//}
				}
			}
			*/
		}
	}
}