// Common

var totalItems = 0;

function InitItems(maxnum) {
	totalItems = maxnum;
}

function OpenVideo(name) {
	window.open('videos/'+name+'.htm','video',"directories='no',height=280,width=320,resizeable='no',scrollbars='no',status='no',titlebar='no',toolbar='no'");
}

function Hilite(who, state) {
	if (who.getAttribute("active")!="1") {
		var isLast = (who.className.indexOf("SCL_Last")!=-1);
		who.className = ((state==1)?"SCL_Selected":"SCL_Item") + ((isLast)?" SCL_Last":"");
	}
}

function ItemClick(who) {
	for (var i=1;i<=totalItems;i++) {
		var theItem = document.getElementById("item"+i);
		var theImage = document.getElementById("img"+i);
		var theText = document.getElementById("text"+i);
		var isLast = (theItem.className.indexOf("SCL_Last")!=-1);
		if (theItem != who) {
			theItem.className = "SCL_Item"+((isLast)?" SCL_Last":"");
			theItem.setAttribute("active","0");
			if (theImage != null) {
				theImage.style.display = "none";
			}
			if (theText != null) {
				theText.style.display = "none";
			}
		} else {
			theItem.className = "SCL_Selected"+((isLast)?" SCL_Last":"");
			theItem.setAttribute("active","1");
			if (theImage != null) {
				theImage.style.display = "inline";
			}
			if (theText != null) {
				theText.style.display = "block";
			}
		}
	}
}