include("swfobject.js");
var curImage = null;
var curDivid = null;
function runVideo(img,divid,title,name)
{
	if(curImage!=null)
	{
		if(false) {
			curImage.style.borderColor = "white";
		}
		else {
			var e = document.getElementById(curDivid);
			if(e) {
				e.style.backgroundColor = '#ffffff';
			}
		}
	}
	curImage = img;
	curDivid = divid;
	if(false) {
			curImage.style.borderColor = "blue";
	}
	else {
		var e = document.getElementById(divid);
		if(e) {
			e.style.backgroundColor = '#9bcee6';//'#87cee6';
		}
	}
	var nowplaying = document.getElementById("nowPlaying");
	if(nowplaying)
	{
		nowplaying.innerHTML = "<b>Now playing:</b> " + title;
	}
	//720x480
	var so = new SWFObject('betterchoices/player.swf','ply','600','400','9','#ffffff');
	so.addParam('allowfullscreen','true');
	so.addParam('quality','high');
	so.addParam('allowScriptAccess','sameDomain');
	so.addParam('bgcolor','#869ca7');
	so.addVariable('file','videos/'+name); 
	so.addVariable('bufferlength','10');
	so.addVariable('autostart','true');
	//so.addVariable('streamer','xmoov.php');
	so.write('VideoId');

}

function overImage(img,divid,over)
{
	if(curImage==img) return;
	if(false)
	{
	if(over) img.style.borderColor='#ff0000';
	else img.style.borderColor='#ffffff';
	}
	else {
		var e = document.getElementById(divid);
		if(e) {
			if(over) e.style.backgroundColor = '#9bcee6';//'#aaffff';
			else e.style.backgroundColor = '#ffffff';
		}
	}
}