//write out VB script for IE flash detection
if(navigator.appName.indexOf("Microsoft") != -1){
	document.writeln('<SCR'+'IPT LANGUAGE="VBScript">');
	document.writeln('Function VBGetFlashControlVersion()');
	document.writeln(' REM detect if IE has flash');
	document.writeln(' on error resume next');
	document.writeln(' Dim theversion');
	document.writeln(' set theversion = 0');
	document.writeln(' Dim Control');
	document.writeln(' set Control = CreateObject("ShockwaveFlash.ShockwaveFlash")');
	document.writeln(' if (IsObject(Control)) then');
	document.writeln('  theversion = int(Control.FlashVersion()/ 65536)');
	document.writeln(' end if');
	document.writeln(' VBGetFlashControlVersion = theversion');
	document.writeln('End Function');
	document.writeln('</SCR'+'IPT>');
}

//Netscape flash detection
function NetscapeFlash(){//detect if netscape has the right version of flash
	var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0);
	if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 3) return parseInt(plugin.description.substring(plugin.description.indexOf(".")-1));
	else return 0;
}

var versionNeeded = 7;

var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
var browser_version3 = parseInt(navigator.appVersion) < 4 ? true:false

//Detect for 
if (InternetExplorer == true) var hasFlash = VBGetFlashControlVersion();
else var hasFlash = NetscapeFlash()

// Draw flash objects to the screen 
if (hasFlash >= versionNeeded&&browser_version3!=true){
	if(InternetExplorer ==true){
		document.writeln('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="video" width="451" height="257">');
		document.writeln('<param name="movie" value="riosFSvideo.swf" />');
		document.writeln('<param name="quality" value="high" />');
		document.writeln('<param name="bgcolor" value="#5a26db" />');
		document.writeln('<param name="wmode" value="transparent" />');
		document.writeln('<param name="quality" value="autohigh" />');
		document.writeln('<param name="scale" value="exactfit" />');
		document.writeln('</object>');
	}else{
		document.writeln('<embed src="riosFSvideo.swf" name="feature_video" quality="high" bgcolor="#5a26db" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="451" height="257" quality="autohigh" scale="exactfit" wmode="transparent" />');
	}
}