// some variables to save
	var playerid;
	var currentPosition;
	var currentVolume;
	var currentItem;

	// these functions are caught by the JavascriptView object of the player.
	
	
	function getUpdate(typ,pr1,pr2,pid)
	{
		playerid = pid;
		if(typ == "time") { currentPosition = pr1; }
		else if(typ == "volume") { currentVolume = pr1; }
		else if(typ == "item") { currentItem = pr1; setTimeout("getItemData(currentItem)",100); }
		var id = document.getElementById(typ);
		id.innerHTML = typ+ ": "+Math.round(pr1);
		pr2 == undefined ? null: id.innerHTML += ", "+Math.round(pr2);
		if(pid != "null") {
			document.getElementById("pid").innerHTML = "(received from the player with id <i>"+pid+"</i>)";
		}
		
	};
	// edited to allow for multiple players on a page with the playerid
	function sendEvent(playerid,typ,prm)
	{
		
		thisMovie(playerid).sendEvent(typ,prm);
		
	};

	// These functions are caught by the feeder object of the player.
	function loadFile(playerid,obj)
	{
		thisMovie(playerid).loadFile(obj);
	};
	
	
	
	//function loadFile(obj) { thisMovie("mpl").loadFile(obj); };
	
	//function loadFile(playerid,file,title,link,id,image,author,captions,category,start,type) {thisMovie(playerid).loadFile(file,title,link,id,image,author,captions,category,start,type); };
	
	function addItem(obj,idx)
	{
		thisMovie(playerid).addItem(obj,idx);
	}
	
	function removeItem(idx)
	{
		thisMovie(playerid).removeItem(idx);
	}
	
	function getItemData(idx)
	{
		try {
			var obj = thisMovie(playerid).itemData(idx);
			var nodes = "";
			for(var i in obj) { 
				nodes += "<li>"+i+": "+obj[i]+"</li>"; 
			}
			document.getElementById("data").innerHTML = nodes;
		} catch(err) {
			// Catch the error so that the javascript message doesn't display.
			// Uncomment to view the error description
			//alert(err.description);
		}
	}

	// 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];
		}
	}