var flashVersion = 0
var isIE = (navigator.appVersion.indexOf('MSIE') >= 0) ? true : false;
var isWin = (navigator.appVersion.indexOf('Win') >= 0) ? true : false;

if(isIE && isWin)
{
  document.write('<' + 'SCRIPT LANGUAGE="VBScript">\r\n');
  document.write('On Error Resume Next\r\n');
  document.write('If IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")) Then\r\n');
  document.write('  flashVersion = 5\r\n');
  document.write('ElseIf IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")) Then\r\n');
  document.write('  flashVersion = 6\r\n');
  document.write('ElseIf IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7")) Then\r\n');
  document.write('  flashVersion = 7\r\n');
  document.write('End If\r\n');
  document.write('On Error Goto 0 \n');
  document.write('<' + '/SCRIPT>\r\n');
}

function detectFlash()
{
  if(navigator.plugins.length > 0)
  {
    if (navigator.plugins['Shockwave Flash 2.0'] || navigator.plugins['Shockwave Flash'])
    {
      flashVersion = 5;
    }
  }
  else if (navigator.mimeTypes.length > 0)
  {
    x = navigator.mimeTypes['application/x-shockwave-flash'];
    if (x && x.enabledPlugin)
      flashVersion = 5;
    else
      flashVersion = 0;
  }

  if (flashVersion > 4)
    return true;
  else
    return false;
}

function showFlash(flashurl, width, height, bgcolor, transparent, sNoFlash)
{

  var bShowFlash = true;
  var sFlashCode = '';
  bShowFlash = detectFlash();
  if(bShowFlash)
  {
    sFlashCode = '<OBJECT id="inside" name="inside" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"';
    sFlashCode += ' WIDTH=' + width + ' HEIGHT=' + height + '>\r\n';
    if(transparent) sFlashCode += '<param name="wmode" value="transparent">\r\n';
    sFlashCode += '<PARAM NAME="movie" VALUE="' + flashurl + '">\r\n';
    sFlashCode += '<PARAM NAME="quality" VALUE="high">\r\n';
    if(bgcolor > '') sFlashCode += '<PARAM NAME="bgcolor" VALUE=' + bgcolor + '>\r\n';
    sFlashCode += '<PARAM NAME="scale" VALUE="showall">\r\n';
    sFlashCode += '<PARAM NAME="menu" VALUE="false">\r\n';
    sFlashCode += '<EMBED src="' + flashurl + '"';
    if(transparent) sFlashCode += ' wmode="transparent"';
    sFlashCode += ' scale="showall" menu="false" quality="high"';
    if(bgcolor > '') sFlashCode += ' bgcolor="' + bgcolor + '"' 
    sFlashCode += '  WIDTH="' + width + '" HEIGHT="' + height + '" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">\r\n';
    sFlashCode += '</EMBED>\r\n</OBJECT>\r\n';
  }
  else
  {
    sFlashCode = sNoFlash;
  }
  document.write(sFlashCode);
}