var MM_contentVersion = 9;
var str = '';
var MM_FlashCanPlay = 0; 
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

if (document.addEventListener)
{
  document.addEventListener("DOMContentLoaded", FOnLoad, false);
}

var _timer = setInterval(function() {
  if (/loaded|complete/.test(document.readyState))
  {
    clearInterval(_timer);
    delete _timer;
    FOnLoad();
  }
}, 10);

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];
  }
  var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1))
{
  var vbFlash = '<SCR' + 'IPT LANGUAGE="VBScript"> ' +
                'MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))'+
                '</SCR' + 'IPT\> ';
  document.write(vbFlash);
}

function InsertGuaranteedBanner(iflash, flashname, picname, pwidth, pheight, phref)
{
  if (iflash)
  {
    str = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+
          'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" '+
          'WIDTH="' + pwidth + '" HEIGHT="' + pheight + '" ALIGN="">'+
          '<PARAM NAME=movie VALUE="' + flashname + '"> <param name="wmode" value="transparent"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>  '+
          '<EMBED id="oFlash" src="' + flashname +'" quality=high bgcolor=#FFFFFF  '+
          'swLiveConnect=FALSE WIDTH="' + pwidth + '" HEIGHT="' + pheight + '" NAME="test2" ALIGN=""'+
          'TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" wmode="transparent">'+
          '</EMBED>'+
          '</OBJECT>';
  }
  else
  {
     str = '<a href="'+ phref +'" target="_blank"><img src="'+ picname +'" border="0" /></a>';
  }

  return str;
}