/*	Selects a method to fetch the movie object.
	The favorite (getElementById) doesn't work well with Flash Obj/Embed duality
*/

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 NOT (document.embeds && document.embeds[movieName])
			return document.getElementById(movieName);
	}
	}
	else { // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
		return document.getElementById(movieName);
	}
}
function playFlash(targetMovieName) {
	var movie = getFlashMovieObject(targetMovieName);
	if (movie) {
		if (movie.PercentLoaded()) {
			if (movie.PercentLoaded()==100) {
				// movie object created & flash is 100% loaded, we are go for Play!
				movie.Play();
			}
			else {
				// Not yet loaded, give it some time then try again.
				timerID=setTimeout("playFlash(" + targetMovieName + ")",1000);
			}
		}
		else {
			// alert("PercentLoaded() not valid for 'movie' object");
			// Not yet loaded, give it some time then try again.
			timerID=setTimeout("playFlash(" + targetMovieName + ")",500);
		}
	}
	else { alert("Movie object not found, unable to start flash.\nYou may have flash blocked."); }
}
