// JavaScript Document

var scroller  = null;
var scrollbar = null;

window.onload = function () {
  scroller  = new jsScroller(document.getElementById("VideoList"), 204, 385);
  scrollbar = new jsScrollbar (document.getElementById("Scrollbar-Container"), scroller, true, scrollbarEvent);
}

function scrollbarEvent (o, type) {
	if (type == "mousedown") {
		if (o.className == "Scrollbar-Track") o.style.backgroundColor = "#E3E3E3";
		else o.style.backgroundColor = "#BBB";
	} else {
		if (o.className == "Scrollbar-Track") o.style.backgroundColor = "#EEE";
		else o.style.backgroundColor = "#CCC";
	}
}

function swapIt(o) {
	o.blur();
	if (o.className == "current") return false;
  
	var list = document.getElementById("Navigation").getElementsByTagName("a");
	for (var i = 0; i < list.length; i++) {
		if (list[i].className == "current") {
			list[i].className = "";
			document.getElementById(list[i].title).y = -scroller._y;
		}
		if (list[i].title == o.title) o.className = "current";
	}
  
	list = document.getElementById("Container").childNodes;
	for (var i = 0; i < list.length; i++) {
		if (list[i].tagName == "DIV") list[i].style.display = "none";
	}
  
	var top = document.getElementById(o.title);
	top.style.display = "block";
	scrollbar.swapContent(top);
	if (top.y) scrollbar.scrollTo(0, top.y);
  
	return false;
}

/*function playMovie(num) {	
	var so = new SWFObject("../../images/video/flvplayer.swf?appName=deltaedu&streamName="+videoDirectory+"/"+videoArray[num]+"&serverName=flash.streamingmediahosting.com&skinName=../../images/video/flvplayer_skin&autoPlay=true&autoRewind=true&bufferTime=2", "sotester", "480", "360", "9", "#000000");
	so.write("flashcontent");
	document.getElementById('videotitle').innerHTML = videoTitles[num];
}*/

function playMovie(num) {	
	var so = new SWFObject("flvplayer.swf?appName=deltaedu&streamName="+videoDirectory+"/"+videoArray[num]+"&serverName=flash.streamingmediahosting.com&skinName=flvplayer_skin&autoPlay=true&autoRewind=true&bufferTime=2", "sotester", "480", "360", "9", "#000000");
	so.write("flashcontent");
	document.getElementById('videotitle').innerHTML = videoTitles[num];
}

