var player = null;
	function playerReady(theId) {
	player = window.document[theId.id];
	addListeners();
}



function addListeners() {
	if (player) {
		var tmp = document.getElementById("rdy");
		if (tmp) { tmp.innerHTML = "Player Ready"; }
		} else {
		setTimeout("addListeners()",10);
	}
}



function createPlayer(theId, theContainer, theWidth, theHeight, theFile, theImage, theSkin, thePlugins, closedCaptions, audioDescriptions, shareUrl) {
	var flashvars = {
	file:theFile,
	/*
	file: "http://www.longtailvideo.com/jw/upload/corrie.flv",
	image: "http://www.longtailvideo.com/jw/upload/corrie.jpg",
	*/
	file: theFile,
	image: theImage,
	skin: theSkin,
	dock: false,
	
	/*
	PLUGINS
	Captions (http://www.longtailvideo.com/AddOns/get-examples.html?addon=84&vid=271&q=)
	Audio Descriptions (http://www.longtailvideo.com/addons/plugins/85/Audio-Description)
	*/
	plugins: thePlugins,
	// Plugin options:
	
	// Captions (http://www.longtailvideo.com/AddOns/get-plugin.html?addon=84&vid=271&q=)
	'captions.file': closedCaptions,
	'captions.fontsize': 16,
	'captions.back': true,
	'captions.state': false,
	
	// Audio Description (http://www.longtailvideo.com/AddOns/get-plugin.html?addon=85&vid=272    -    http://www.longtailvideo.com/support/addons/audio-description/15136/audio-description-reference-guide)
	//'audiodescription.file': audioDescriptions,
	//'audiodescription.ducking':'true',
	//Ducking: permite que el volumen del vídeo baje para que el del audio description se oiga bien.
	//'audiodescription.debug':'true'//Para ver las ondas del volumen del vídeo respecto al del audio description
	
	// Sharing 2
	'sharing.code': true,
	'sharing.link': shareUrl
	}

	var params = {
		menu: "false",
		allowfullscreen: "true",
		allowscriptaccess: "always",
		allownetworking: "all",
		movie: "jwplayer/player.swf",
		wmode: "transparent"
	}

	var attributes = {
		id:theId,
		name:theId
	}

	swfobject.embedSWF("jwplayer/player.swf", theContainer, theWidth, theHeight, "9.0.0", "swf/expressInstall.swf", flashvars, params, attributes);
}
