$().ready(function() {
		$('.kwicks').kwicks({
		min: 50,
		duration: 200,
		sticky: true
		});
});

var currentPlayer=null;
var currentFile;
var currentImage;

function removeOldPlayer() {
	document.getElementById(currentPlayer).innerHTML = '<img src="'+currentImage+'" border="0" 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","playerID","320","250","9");
	s.addParam("allowfullscreen","true");
	s.addVariable("file",theFile);
	s.addVariable("bufferlength","10");
	s.addVariable("width","320");
	s.addVariable("height","250");
	s.addVariable("displayheight","240");
	s.addVariable("overstretch","false");
	s.addVariable("image",theImage);
	s.addVariable("showicons","false");
	if (go) { s.addVariable("autostart","true"); }

	s.write(thePlace);
}