
function checkTopFlash() {
  //var hasFlash = false;

  if (opera) {
    hasFlash = false;
  }
  else if (konq) {
    hasFlash = false;
  }
  else if (navigator && navigator.platform && navigator.platform.indexOf("Mac") > -1) {
    hasFlash = false;
  }
  else if (ie) {
    document.write('<scr' + 'ipt language="VBScript"\> \n');
    document.write('on error resume next \n');
    document.write('dim obFlash \n');
    document.write('set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.5") \n');
    document.write('if IsObject(obFlash) then \n');
    document.write('hasFlash = true \n');
    document.write('end if');
    document.write('</scr' + 'ipt\> \n');

    if (!this.hasFlash) {
      hasFlash = false;
    }
  }
  else if (navigator != null) {
    hasFlash = false;
    if (navigator.plugins != null && navigator.plugins.length > 0) {
      var flashPlugin = navigator.plugins['Shockwave Flash'];
      if (typeof flashPlugin == 'object') {
        var version = flashPlugin.description.split(' ')[2];
        if (version >= 7 && navigator.platform.indexOf("Win") > -1) {
          hasFlash = true;
        }
      }
    }
  }
  else hasFlash = false;

  return hasFlash;
}

function outputTopFlash(imgSrc, swfSrc, width, height) {
  if (checkTopFlash()) {
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="' + width + '" height="' + height + '"><param name=movie value="' + swfSrc + '"><param name=quality value="high"><param name="wmode" value="transparent"><embed src="' + swfSrc + '" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed></object>');
  }
  else if (imgSrc.length > 0) {
    document.write('<img src="' + imgSrc + '" width="' + width + '" height="' + height + '">');
  }
}