// This tests the browser, and allows us to communicate with the flash movie in ie or firefox
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 // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}

function fullscreen(video,seekTime) {
	FSPath = "flash/fullscreenPlayer.cfm?path=" + video + "&seekTime=" + seekTime;
	theWindow = window.open(FSPath, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,fullscreen=yes,titlebar=no')
}

// This is called by the fullscreenPlayer.swf with the seek time to return to
// uses getFlashMovieObject to communicate with flash movie "theFlashMovie"
function unfullscreen(seekTime,stopPlay) {
	theWindow.close();
	theMovieObject = getFlashMovieObject("theFlashMovie");
	if (typeof(stopPlay) != "undefined" && stopPlay == "1") {
		theMovieObject.SetVariable("stopPlay",1);
	}
	theMovieObject.SetVariable("seekOn",1);
	theMovieObject.SetVariable("seekTime",seekTime);
}

// This is only used on the videos page to pass the path and seek time to the movie on the page
function playVideo(path) {
	theMovieObject = getFlashMovieObject("theFlashMovie");
	theMovieObject.SetVariable("path",path);
	theMovieObject.SetVariable("seekOn",1);
	theMovieObject.SetVariable("seekTime",0);
	theMovieObject.SetVariable("stopPlay",0);
}
