function moQuickTimeButton(theId) {
	if (!isQTInstalled()) {
		return;
	}
	var container = MO.$(theId);
	var movieUrl = container.getElementsByTagName('a')[0].getAttribute('href');
	var image = container.getElementsByTagName('img')[0];
	var clickToPlayUrl = image.getAttribute('src');
	var width = image.getAttribute('width');
	var height = image.getAttribute('height');
		
	var qt = new QTObject (clickToPlayUrl,theId+'_movie',width,height);
	qt.addParam("target","quicktimeplayer");
	qt.addParam("href",movieUrl);
	qt.addParam("autoplay",true);
	qt.addParam("controller",false);
	qt.addParam("cache",true);
	qt.addParam("saveembedtags",true);
	qt.addParam("bgcolor","#ffffff");
	
	container.innerHTML = qt.getHTML();
}

// Insert appropriate movies

var moUseFlash = MO.flash.hasVersion("8.0.24");

if (moUseFlash) {
	/*document.write(
	'<div style="clear:both;text-align:right"><div id="watchHDFlash" style="margin: 0px 0px 3px 0px"><a href="http://resources.masterobjects.com/movies/questobjects/questfields/0-full-hd.mov"><img src="/images/button-watch-hd.gif" width="259" height="23" border="0" alt="Watch Presentation in HD" /></a></div><span class="footertext">(Requires <a href="http://www.apple.com/quicktime/download/" target="_blank">QuickTime</a>)</span></div>'
	);*/
}

function moShowMovies() {
	if (moUseFlash) {
		MO.$("questFieldsMovieFlash").style.display="block";
		//moQuickTimeButton("watchHDFlash");
	} else if (MO.env.mac && MO.env.mobile) {
		MO.$("questFieldsMovieIPhone").style.display="block";
		//moQuickTimeButton("watchIPhone");	
	} else {
		MO.$("questFieldsMovieQuickTime").style.display="block";
		//moQuickTimeButton("watchNormal");
		//moQuickTimeButton("watchHD");
	}
}

MO.util.addOnload(moShowMovies);

// end of script