function getMovieObject(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 // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}


function StopMovie(movieName)
{
	this.id = movieName;
	var flashMovie=getMovieObject(this.id);
	flashMovie.StopPlay();
}

function PlayMovie(movieName)
{
	this.id = movieName;
	var flashMovie=getMovieObject(this.id);
	flashMovie.Play();
	//embed.nativeProperty.anotherNativeMethod();
}

function RewindMovie(movieName)
{
	this.id = movieName;
	var flashMovie=getMovieObject(this.id);
	flashMovie.Rewind();
}

function NextFrameMovie(movieName)
{
	this.id = movieName;
	var flashMovie=getMovieObject(this.id);
	// 4 is the index of the property for _currentFrame
	var currentFrame=flashMovie.TGetProperty("/", 4);
	var nextFrame=parseInt(currentFrame);
	if (nextFrame>=10)
		nextFrame=0;
	flashMovie.GotoFrame(nextFrame);		
}


function ZoominMovie(movieName)
{
	this.id = movieName;
	var flashMovie=getMovieObject(this.id);
	flashMovie.Zoom(90);
}

function ZoomoutMovie(movieName)
{
	this.id = movieName;
	var flashMovie=getMovieObject(this.id);
	flashMovie.Zoom(110);
}


function SendDataToMovie(movieName)
{
	this.id = movieName;
	var flashMovie=getMovieObject(this.id);
	flashMovie.SetVariable("/:message", document.controller.Data.value);
}

function ReceiveDataFromMovie(movieName)
{
	this.id = movieName;
	var flashMovie=getMovieObject(this.id);
	var message=flashMovie.GetVariable("/:message");
	document.controller.Data.value=message;
}


/* ====================================
 * French comment 1/1 :
 *
 * Ces fonctions  StopMovie(movieName)  PlayMovie(movieName)  etc.  permettent tous les <object id="_"> d'une page : 
 *	<object id="movie1" ...>...</object> ... <a onclick="PlayMovie('movie1');">PLAY 1</a> <a onclick="StopMovie('movie1');">STOP 1</a>
 *	<object id="movie2" ...>...</object> ... <a onclick="PlayMovie('movie2');">PLAY 2</a> <a onclick="StopMovie('movie2');">STOP 2</a>
 *	<object id="movie3" ...>...</object> ... <a onclick="PlayMovie('movie3');">PLAY 3</a> <a onclick="StopMovie('movie3');">STOP 3</a>
 *	etc...
 * et autant de play, stop et rewind en identifiant a chaque fois les id des movies envisages.
 *
 * Pour un usage etendu (1 container, 1 jeu de commandes => toutes les video .swf), visitez http://sentrais.fr/le-chat/lechat.htm
 *
 * Compatible tous navigateurs.
==================================== */




