var canPlayFlash      = false;
var MM_contentVersion = 6;
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]; 
  }

	 canPlayFlash = 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('canPlayFlash = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
  document.write('</SCR' + 'IPT\> \n');
}

function writeFlashTag( id, movie, moviewidth, movieheight, altimage, altwidth, altheight )
{
  var tag = "";

  if ( canPlayFlash )
  {
    tag += '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
    tag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" ';
    tag += 'WIDTH="' + moviewidth + '" ';
    tag += 'HEIGHT="' + movieheight + '" '; 
    tag += 'id="' + id + '">';
    tag += '<PARAM NAME="movie" VALUE="' + movie + '">';
    tag += '<PARAM NAME="quality" VALUE="high">';
    tag += '<PARAM NAME="bgcolor" VALUE="#102030">';
    tag += '<EMBED src="' + movie + '" quality="high" bgcolor="#102030" WIDTH="' + moviewidth + '" HEIGHT="' + movieheight + '" NAME="' + id + '" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>';
    tag += '</OBJECT>';
  }
  else
  {
    tag = "<img src=\"" + altimage + "\" width=\"" + altwidth + "\" height=\"" + altheight + "\" alt=\"\" border=\"0\">";
  }

  return tag;
}


