//
//  (ñ) SiteLeader, 2005-2008 | http://www.siteleader.ru
//

var rnd = Math.round(Math.random()*1048576);
var withLink = true;

if (!window.bnFlashUrl && !window.bnImgUrl) withLink = false;

var ie = (navigator.userAgent && (navigator.userAgent.indexOf("MSIE") >= 0) && (navigator.appVersion.indexOf("Win") != -1)) ? 1 : 0;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

if (plugin)
{
  var pluginVersion = parseInt(plugin.description.substring(plugin.description.indexOf(".") - 2));
  var isPlay = (pluginVersion >= flashV);
}
else if (ie)
{
  document.write('<sc'+'ript type="text/vbscript"> \n');
  document.write('on error resume next \n');
  document.write('isPlay = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.' + flashV + '")) \n');
  document.write('</sc'+'ript> \n');
}

if (window.IEonly && (IEonly == 1) && !ie) isPlay = 0;

///////////
isPlay = 1;
///////////

if (isPlay)
{
  document.write('<object id="flash_obj' + bnNumber + '" type="application/x-shockwave-flash" data="' + bnFlash + '?rnd=' + rnd);
  if (withLink) document.write('&link1=' + bnFlashUrl);
  document.write('" width="' + bnW + '" height="' + bnH + '">');
  document.write('<param name="movie" value="' + bnFlash + '?rnd=' + rnd);
  if (withLink) document.write('&link1=' + bnFlashUrl);
  document.write('" />');
  document.write('<param name="quality" value="high" />');
  document.write('<param name="wmode" value="transparent" />');
  document.write('<param name="bgcolor" value="#ffffff" />');
  //document.write('<param name="flashvars" value="extBgImg=' + bnBgImg + '&extHref=' + bnHref + '" />');
  document.write('</object>');
}
else
{
  if (withLink) document.write('<a href="' + bnFlashUrl + '?rnd=' + rnd + '" title="' + bnAlt + '" target="_blank">');
  document.write('<img src="' + bnImg + '?rnd=' + rnd + '" width="' + bnW + '" height="' + bnH + '" alt="' + bnAlt + '" border="0" />');
  if (withLink) document.write('</a>');
}
