/* ================================================================ 
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 ('LI') [i++]) {
		if (e.className == 'channelOn' || e.className == 'channelOff') {
		e.onclick = function () {
			var getEls = document.getElementById('movieBlock').getElementsByTagName('DIV');
			var getElsLi = document.getElementById('gallery').getElementsByTagName ('LI');
				for (var z=0; z<getEls.length; z++) {
				getEls[z].className=getEls[z].className.replace('show', 'hide');
				}
				for (var z=0; z<getElsLi.length; z++) {
				getElsLi[z].className=getElsLi[z].className.replace('briefOn', 'briefOff');
				}
				
			this.className = 'channelOn';
			var max = this.getAttribute('id')+'Block';
			document.getElementById(max).className = "show";
			}
		
		}
		
		
		if (e.className == 'briefOn' || e.className == 'briefOff') {
		e.onclick = function () {
			var getEls = document.getElementById('movieBlock').getElementsByTagName('DIV');
			var getElsLi = document.getElementById('gallery').getElementsByTagName ('LI');
				for (var z=0; z<getEls.length; z++) {
				getEls[z].className=getEls[z].className.replace('show', 'hide');
				}
				for (var z=0; z<getElsLi.length; z++) {
				getElsLi[z].className=getElsLi[z].className.replace('channelOn', 'channelOff');
				}
				
			this.className = 'briefOn';
			var max = this.getAttribute('id')+'Block';
			document.getElementById(max).className = "show";
			}
		
		}
	}
}

supersleight.init();