var MM_contentVersion = 8;
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 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)) {
  document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
  document.write('on error resume next \n');
  document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
  document.write('</SCR' + 'IPT\> \n');
}

function util_getFlashMovieObject(movieName) {
  if (window.document[movieName])  {
    return window.document[movieName];
    }
    if (navigator.appName.indexOf("Microsoft Internet")==-1) {
      if (document.embeds && document.embeds[movieName])
        return document.embeds[movieName]; 
    } else {
      return document.getElementById(movieName);
    }
}

function util_getFlash(id, url, params, urlparams, alternativeURL) {
  if ( MM_FlashCanPlay ) {
    if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
      util_getFlashIE(id, url, params, urlparams);
    } else {
      util_getFlashMoz(id, url, params, urlparams);
    }
  } else {
    if ( alternativeURL ) {
      document.write('<a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&amp;promoid=BIOW">');
      document.write('<img border="0" alt="Click to download the flash player." src="' + alternativeURL + '">');
      document.write('</a>');
    }
  }
}

function util_getFlashIE(id, url, params, urlparams) {
  if ( urlparams ) {
    url += "?";
    for ( var i in urlparams )
      url += i + "=" + urlparams[i] + "&"; 
  }
  var html = "";
  html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';
  html += 'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ';  
  html += 'id="' + id + '" ';
  html += 'name="' + id + '" ';
  html += 'width="' + params['width'] + '" ';
  html += 'height="' + params['height'] + '">';  
  html += '<param name="movie" value="' + url + '">';
  html += '<param name="play" value="true">';
  html += '<param name="quality" value="hight">';
  html += '<param name="wmode" value="transparent">';
  html += '<param name="menu" value="false">';
  for (var i in params)
    html += '<params name="' + i + '" value="' + params[i] + '"> ';
  html += '</object>';
  document.write(html);
}

function util_getFlashMoz(id, url, params, urlparams) {
  if ( urlparams ) {
    url += "?";
    for ( var i in urlparams )
      url += i + "=" + urlparams[i] + "&"; 
  }
  var html = "";
  html += '<embed ';
  html += 'name="' + id + '" ';
  html += 'pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"';
  html += 'swLiveConnect="true" ';
  html += 'type="application/x-shockwave-flash" ';
  for (var i in params)
    html += ' ' + i + '="' + params[i] + '" ';
  html += 'src="' + url + '" quality="high" ';
  html += 'swLiveConnect="true" ';
  html += 'wmode="transparent" ';
  html += 'quality="hight" ';
  html += 'allowscriptaccess="samedomain" ';
  html += 'movie="' + url + '" >';
  html += '</embed>';
  document.write(html);
}


