/*==========================================
 flash VerCheck 1.0
==========================================*/

function DetectFlash(swfObj) {

//==========================================
  var swfVer = swfObj.swfVer;
  var swfPass = swfObj.swfPass;
  var swfId = swfObj.swfId;
  var swfWidth = swfObj.swfWidth;
  var swfHeight = swfObj.swfHeight;
  var swfMenu = swfObj.swfMenu;
  var swfWmode = swfObj.swfWmode;
  var swfSalign = swfObj.swfSalign;
  var swfScale = swfObj.swfScale;
  var swfBg = swfObj.swfBg;
  var swfStyle = swfObj.swfStyle;
  var swfSubst = swfObj.swfSubst;
//==========================================

/* Detect FlashPlugin */

var FlashVersion = swfVer;
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 PluginVersion = words[i];
    }
    var FlashCanPlay = PluginVersion >= FlashVersion;
  } else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {
    var PluginVersion = new ActiveXObject("ShockwaveFlash.ShockwaveFlash").FlashVersion();
    PluginVersion = Math.floor(PluginVersion / 0x10000);
    var FlashCanPlay = PluginVersion >= FlashVersion;
  }

/* swfObject Writing */

  if (FlashCanPlay) {
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ');
  document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
  document.write('id="'+swfId+'" width="'+swfWidth+'" height="'+swfHeight+'"> ');
  document.write('<param name="movie" value="'+swfPass+'">');
  document.write('<param name="quality" value="high">');
  document.write('<param name="scale" value="'+swfScale+'">');
  document.write('<param name="bgcolor" value="'+swfBg+'">');
  document.write('<param name="wmode" value="'+swfWmode+'">');
  document.write('<param name="menu" value="'+swfMenu+'">');
  document.write('<param name="salign" value="'+swfSalign+'">');
  document.write('<embed id="'+swfId+'_embed" width="'+swfWidth+'" height="'+swfHeight+'" src="'+swfPass+'" quality="high" scale="'+swfScale+'" bgcolor="'+swfBg+'" wmode="'+swfWmode+'" swLiveConnect="false" salign="'+swfSalign+'" ');
  document.write('type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" style="'+swfStyle+'">');
  document.write('</embed>');
  document.write('</object>');
   } else {document.write(swfSubst);
  }
}

