
//  returns the embedded flash movie object
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 that does the biz:

//  checks the TITLETXT var in the flash movie.
//  If the flash object is already playing a sound then TITLETXT will be the name of the playing sound.
//		in this case set var to 'stop' and play movie - this will stop any audio.

//  If it's not playing an mp3 then sets TITLETXT to the name of the mp3 and tells it to play!

//  "player" in the line 29 here refers to the flashObject - this must reflect the name of the flashObject in the html page.
function PlayFlashMovie(txt) {
		
	var flashMovie=getFlashMovieObject("player");
	
	var playing=flashMovie.GetVariable("titleTxt")
	
	if (playing != txt) {
		
		flashMovie.Rewind();
		flashMovie.SetVariable("titleTxt", txt);
		flashMovie.Play();
		
	} else {
		
		flashMovie.Rewind();
		flashMovie.SetVariable("titleTxt", 'stop');
		flashMovie.Play();
		
	}	
}

