// This script detects the id/name of the Flash object (i.e. in this case, the ESA HD Video Player SWF) as defined in the object/embed tags
function getFlashMovieObject(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);
  }
}
// This script sends data to the ESA HD Video Player, so it can load new media in real-time
function SendDataToFlashMovie(param) {
	var flashMovie=getFlashMovieObject("myFlashMovie");
	flashMovie.SetVariable("videopath.text", param);
	// videopath.text is equal to the path/filename in the "onclick=SendDataToFlashMovie('path/filename')" events
	// By default, the specified path/filename must reference files with *.xml or *.flv extensions, or if loading a single streaming file there should be no extension
	// If you want to specify a dynamic path/filename (e.g. *.php or *.asp) you will have to modify the associated script in the player FLA so it looks for the extension you're using
}
// This script receives data from the ESA HD Video Player, so you can display it on the page, or work with it in some other way (e.g. to construct an email or embed script)
function ReceiveDataFromFlashMovie() {
	var flashMovie=getFlashMovieObject("myFlashMovie");
	var message=flashMovie.GetVariable("mediaVar");
	// mediaVar is equal to the path/filename of the current video
	document.controller.Data.value=message;
}