//<![CDATA[

/*
Procédures JS permettant au lecteur player_flv_js.swf de fonctionner
*/

var vpListener = new Object();

vpListener.addIcon = function()
{
	var url = 'view/img/play.gif';
	var depth = 1;
	var verticalAlign = '';
	var horizontalAlign = '';

	getFlashObject('video_player').SetVariable("method:loadMovieOnTop", url+"|"+depth+"|"+verticalAlign+"|"+horizontalAlign);
};
vpListener.removeIcon = function()
{
	getFlashObject('video_player').SetVariable("method:unloadMovieOnTop", "1");
};
vpListener.onInit = function()
{
	this.playing=0;
	this.addIcon();
};
vpListener.onClick = function()
{
	if (this.playing)
	{
		getFlashObject('video_player').SetVariable('method:pause','');
		this.playing=0;
		this.addIcon();
	}
	else
	{
		getFlashObject('video_player').SetVariable('method:play','');
		this.playing=1;
		this.removeIcon();
	}
};
vpListener.onKeyUp = function(pKey)
{
};
vpListener.onUpdate = function()
{
};
vpListener.onFinished = function()
{
	getFlashObject('video_player').SetVariable('method:stop','');
	this.playing=0;
	this.addIcon();
};

function getFlashObject(movieName) {
	 if (window.document[movieName]) {
		 return window.document[movieName];
	 }
	 if (navigator.appName.indexOf("Microsoft Internet") == -1) {
		 if (document.embeds && document.embeds[movieName])
			 return document.embeds[movieName];
	 } else {
		 return document.getElementById(movieName);
	 }
};

function play(index) {
	 var flash = getFlashObject("video_player");
	 //flash.play();
};

//]]>