
// to use this madness, add onload="PlayFlashMovie('YourMovieId');" 
// to the body tag of the page.
var flashMovie	= null;
var interval	= null;

function getFlashMovieObject(movieName) {
	var movieObject = null;
	
	if (window.document[movieName]) {
		movieObject = window.document[movieName];
	}
	
	if (navigator.appName.indexOf("Microsoft Internet") == -1) {
		if (document.embeds && document.embeds[movieName])
			movieObject =  document.embeds[movieName]; 
	} else { // if (navigator.appName.indexOf("Microsoft Internet")!=-1) 
		movieObject =  document.getElementById(movieName);
	}
	
	return movieObject;
}

function PlayFlashMovie(movieName) {
	flashMovie = getFlashMovieObject(movieName);
	interval = setInterval('testLoadComplete();', 50);
}

function testLoadComplete()
{
	if(flashMovie.PercentLoaded() == 100) {
		clearInterval(interval);
		flashMovie.Play();				
	}
}

