// these functions is called by the JavascriptView object of the player.
function getUpdate(typ,pr1,pr2,swf) { 
	if(typ == "time") { currentPosition = pr1; pr2 == undefined ? null: currentRemaining = Math.round(pr2); }
	else if(typ == "volume") { currentVolume = pr1; } 
	else if(typ == "item") { currentItem = pr1; setTimeout("getItemData(currentItem)",100);}
	else if(typ == "state") { currentState = pr1; }
	else if(typ == "load") { currentLoad = pr1; }
	else if(typ == "size") { currentXsize = "X=" + pr1; pr2 == undefined ? null: currentYsize = "Y=" + Math.round(pr2); } 
};

function getItemData(idx) {
	var obj = thisMovie("mediaplayer").itemData(idx);
	var tmp = document.getElementById("title"); if (tmp) { tmp.innerHTML = "<span>NOW PLAYING:</span>&nbsp;&nbsp;<em>" +  obj["title"] + "</em>"; } 
};



// This is a javascript handler for the player and is always needed.
function thisMovie(movieName) {
	if(navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName];
	} else {
		return document[movieName];
	}
};

// Build the player
var flashvars = {
	file: "../home.xml",
	width: "462",
	height: "20",
	displayheight: "0",
	backcolor: "false",
	screencolor: "false",
	frontcolor: "0xffffff",
	lightcolor: "0xffffff",
	usefullscreen: "false",
	showstop: "false",
	enablejs: "true"
};
var params = {
	wmode: "transparent"
};
var attributes = {
  id: "mediaplayer",
  name: "mediaplayer"
};
swfobject.embedSWF("mediaplayer.swf", "player", "462", "20", "8.0.0", "expressInstall.swf", flashvars, params, attributes);
