var currentPlayer=null;
var currentFile;
var currentImage;

function removeOldPlayer() {
	document.getElementById(currentPlayer).innerHTML = '<img src="'+currentImage+'" border="0" style="cursor:pointer" 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("/mediaplayer.swf","thePlayerId","320","260","7");
	s.addParam("allowfullscreen","true");
	s.addVariable("file",theFile);
	s.addVariable("width","320");
	s.addVariable("height","260");
	s.addVariable("displayheight","240");
	s.addVariable("overstretch","fit");
	s.addVariable("image",theImage);
	s.addVariable("showicons","false");
	if (go) { s.addVariable("autostart","true"); }

	s.write(thePlace);
}

function init() {
	createPlayer('placeholder1', '/video/09as201.flv', '/images/09as201.jpg', false);
	createPlayer('placeholder2', '/video/09as401.flv', '/images/09as401.jpg', false);
	createPlayer('placeholder3', '/video/09as402.flv', '/images/09as402.jpg', false);
	createPlayer('placeholder4', '/video/09as602.flv', '/images/09as602.jpg', false);
	createPlayer('placeholder5', '/video/09as702.flv', '/images/09as702.jpg', false);
	}

window.onload=init;
