function flashINIT(v)
{
	MM_FlashCanPlay = "";
	MM_contentVersion = v;
	var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
	if ( plugin ) {
			var words = navigator.plugins["Shockwave Flash"].description.split(" ");
			for (var i = 0; i < words.length; ++i)
			{
			if (isNaN(parseInt(words[i])))
			continue;
			var MM_PluginVersion = words[i]; 
			}
		MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
	}
	else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {
		document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
		document.write('on error resume next \n');
		document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
		document.write('</SCR' + 'IPT\> \n');
	}
}

function writeFlashVersionDetect(flashName,flashSource,imgSource,w,h,bg,v)
{
  flashINIT(v);
  if (MM_FlashCanPlay) 
  {
    writeFlash(flashName,flashSource,imgSource,w,h,bg,v);
  }else{
	document.location = 'upgrade_flash.htm';
  }
}

function writeFlash(flashName,flashSource,imgSource,w,h,bg,v)//straight flash write no detection
{
		document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
		document.write('  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+ v +',0,0,0" ');
		document.write(' ID="'+ flashName +'" WIDTH="'+ w +'" HEIGHT="'+ h +'" ALIGN="">');
		document.write(' <PARAM NAME=movie VALUE="'+ flashSource +'"><param name="menu" value="false"><param name="wmode" value="transparent"> <PARAM NAME="quality" VALUE="high"> <PARAM NAME=bgcolor VALUE='+ bg +'>  '); 
		document.write(' <EMBED src="'+ flashSource +'" quality=high bgcolor='+ bg +' ');
		document.write(' swLiveConnect=FALSE WIDTH="'+ w +'" HEIGHT="'+ h +'" NAME="'+ flashName +'" ALIGN=""');
		document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" menu="false" wmode="transparent">');
		document.write(' </EMBED>');
		document.write(' </OBJECT>');
}