var currentPlayer=null;
var currentFile;
var currentImage;

function removeOldPlayer() {
	document.getElementById(currentPlayer).innerHTML = '<img src="'+currentImage+'" border="0" height="20" onclick="createPlayer(\''+currentPlayer+'\', \''+currentFile+'\', \''+currentImage+'\', true)">';
}

function createPlayer(thePlace, theFile, theImage, go) {
	if (currentPlayer!=null) { removeOldPlayer(); }

	currentPlayer=thePlace;
	currentFile=theFile;
	currentImage=theImage;
 	
var s = new SWFObject("/flash/mediaplayer.swf","playerID", "200" ,"20","7", "#eeeeee");
	s.addParam("allowscriptaccess", "always");
	s.addParam("wmode", "transparent");
	s.addVariable("file", theFile);
	s.addVariable("width", "200");
	s.addVariable("height", "20");
	//s.addVariable("displayheight","130");
	//s.addVariable("overstretch","fit");
	s.addVariable("image", theImage);
	s.addVariable("usefullscreen","false");
	s.addVariable("showicons", "false");
	s.addVariable("frontcolor", "0xffffff");
	s.addVariable("backcolor", "0x6666ff");
	s.addVariable("lightcolor", "0x000000");
	s.addVariable("screencolor", "0xeeeeee");
	s.addVariable("showdigits", "true");
	if (go) { s.addVariable("autostart", "true"); }
	if (theFile=="cm.xml") { s.addVariable("shuffle", "false"); }
	if (thePlace=="s0") { s.addVariable("repeat", "list"); }
	s.write(thePlace);
}