onload = function() {
	var e,f, i = 0,j=0,k=0;
	var a,b,c;
	
	while (f = document.getElementById('gallery3').getElementsByTagName ('DIV') [k++]) {
		if (f.className == 'on3' || f.className == 'off3' || f.className == 'on-FC3' ||f.className == 'off-FC3' ) {
			if(f.className == 'on3' || f.className == 'on-FC3')
			{
				a =f;
			}
		f.onclick = function () {
			
					if(a == this)
					{
						return;
					}
			
					a.className= a.className.replace('show3','hide3');
					a.className= a.className.replace('on3','off3');
					a.className= a.className.replace('on-FC3','off-FC3');
					
					
					this.className= this.className.replace('hide3','show3');
					this.className= this.className.replace('off3','on3');
					this.className= this.className.replace('off-FC3','on-FC3');					
							
					var max = this.getAttribute('title');
					document.getElementById(max).className = "show3";
					max =a.getAttribute('title');
					document.getElementById(max).className = "hide3";
					a = this;
			
			}
		}
		
	}

	while (f = document.getElementById('gallery').getElementsByTagName ('DIV') [i++]) {
		if (f.className == 'on2' || f.className == 'off2' || f.className == 'on-FC2' ||f.className == 'off-FC2' ) {
			if(f.className == 'on2' || f.className == 'on-FC2')
			{
				b =f;
			}
		f.onclick = function () {
			
					if(b == this)
					{
						return;
					}
			
					b.className= b.className.replace('show2','hide2');
					b.className= b.className.replace('on2','off2');
					b.className= b.className.replace('on-FC2','off-FC2');
					
					
					this.className= this.className.replace('hide2','show2');
					this.className= this.className.replace('off2','on2');
					this.className= this.className.replace('off-FC2','on-FC2');					
							
					var max = this.getAttribute('title');
					document.getElementById(max).className = "show2";
					max =b.getAttribute('title');
					document.getElementById(max).className = "hide2";
					b = this;
			
			}
		}
		
	}
	

	while (f = document.getElementById('gallery1').getElementsByTagName ('DIV') [j++]) {
		if (f.className == 'on1' || f.className == 'off1' || f.className == 'on-FC1' ||f.className == 'off-FC1' ) {
			if(f.className == 'on1' || f.className == 'on-FC1')
			{
				c =f;
			}
		f.onclick = function () {
			
					if(c == this)
					{
						return;
					}
					c.className= c.className.replace('show1','hide1');
					c.className= c.className.replace('on1','off1');
					c.className= c.className.replace('on-FC1','off-FC1');
					
					
					
					this.className= this.className.replace('hide1','show1');
					this.className= this.className.replace('off1','on1');
					this.className= this.className.replace('off-FC1','on-FC1');					
							
					var max = this.getAttribute('title');
					document.getElementById(max).className = "show1";
					max = c.getAttribute('title');
					document.getElementById(max).className = "hide1";
					c = this;
			
			}
		}
		
	}
}
