
function detectBrowser() {
	
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //Test if using MSIE
		return true;
		}
		else {
		return false;
		}
	
	
}



function getTime() {
	objMovie = document.getElementById('MediaPlayer');
	
	if (detectBrowser()) {
		var objMovie_pos = objMovie.CurrentPosition;
		if (objMovie_pos > 90)
			{
			objMovie.pause();
			
			}
		}
		else {
		var objMovie_pos = objMovie.controls.currentPosition;
		if (objMovie_pos > 90)
			{
			objMovie.controls.pause();
		
			}
		}
	
}
	



// Launches Apollo Dart Mobile Demo Video MP4 if user is on Apple Mobile product.  Otherise, WMV is launched.

function openMovie() {
var embed_video = "";
var movie_width=611;
var movie_height=525;
if (detectBrowser()) {
	movie_width=640;
	movie_height=525;
	}
if((navigator.userAgent.match(/iPhone/i)) || 
 (navigator.userAgent.match(/iPod/i))|| (navigator.userAgent.match(/iPad/i))) {
   if (document.cookie.indexOf("iphone_redirect=false") == -1)
   {
		embed_video+="<OBJECT CLASSID=\"clsid\:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\"";
		embed_video+=" CODEBASE=\"http\:\/\/www.apple.com\/qtactivex\/qtplugin.cab\" WIDTH=\"640\" HEIGHT=\"525\" >";
		embed_video+="<PARAM NAME=\"src\" VALUE=\"img\/ApolloDartDemo.mp4\" >";
		embed_video+="<PARAM NAME=\"autoplay\" VALUE=\"true\" >";
		embed_video+="<EMBED SRC=\"img\/ApolloDartDemo.mp4\" TYPE=\"image\/x-macpaint\"";
		embed_video+=" PLUGINSPAGE=\"http\:\/\/www.apple.com\/quicktime\/download\" WIDTH=\"640\" HEIGHT=\"525\" AUTOPLAY=\"true\"><\/EMBED>";
		embed_video+="<\/OBJECT>";
		
		document.getElementById('content_home').style.height="640px";
		document.getElementById('flash').innerHTML=embed_video;
   }
}
else
{

	

	
	embed_video+="<OBJECT name=\"MediaPlayer\" ID=\"MediaPlayer\" WIDTH=\"" + movie_width + "\" HEIGHT=\"" + movie_height + "\"";
	if (detectBrowser()) {
	embed_video+="  CLASSID=\"CLSID\:22D6F312-B0F6-11D0-94AB-0080C74C7E95\"";
	}
	embed_video+=" STANDBY=\"Loading Windows Media Player components...\" TYPE=\"video\/x-ms-wmv\">";
	embed_video+="<PARAM NAME=\"FileName\" VALUE=\"img\/ApolloDartDemo.wmv\">";
	embed_video+="<PARAM name=\"autostart\" VALUE=\"true\">";
	embed_video+="<PARAM name=\"ShowControls\" VALUE=\"true\">";
	embed_video+="<PARAM name=\"ShowStatusBar\" value=\"false\">";
	embed_video+="<PARAM name=\"ShowDisplay\" VALUE=\"false\">";
	embed_video+="<PARAM name=\"loop\" value=\"0\">";
	embed_video+="<EMBED TYPE=\"video\/x-ms-wmv\" SRC=\"img\/ApolloDartDemo.wmv\" NAME=\"MediaPlayer\"";
	embed_video+=" WIDTH=\"" + movie_width + "\" HEIGHT=\"" + movie_height + "\" ShowControls=\"1\" ShowStatusBar=\"0\" ShowDisplay=\"0\" autostart=\"1\" loop=\"0\"> <\/EMBED>";
	embed_video+="<\/OBJECT>";
	
	document.getElementById('content_home').style.height="640px";
	document.getElementById('flash').innerHTML=embed_video;
	



	
}

setInterval ( "getTime()", 5000 );

}


