var g_bolUseVBDetection = false;

function detectFlash(intVersion) {
  var intDetectedVersion=0;
  var objPluginFlash=navigator.plugins["Shockwave Flash"];
  if(objPluginFlash) {
  	var strFlashDesc = objPluginFlash.description;
  	intDetectedVersion = parseInt(strFlashDesc.charAt(strFlashDesc.indexOf(".") - 1));
	}
  bolFlash=(intDetectedVersion>=intVersion);
  if(!bolFlash && g_bolUseVBDetection) {
	  intDetectedVersion=(detectActiveXControl('ShockwaveFlash.ShockwaveFlash.2'))?2:0;
	  intDetectedVersion=(detectActiveXControl('ShockwaveFlash.ShockwaveFlash.3'))?3:intDetectedVersion;
	  intDetectedVersion=(detectActiveXControl('ShockwaveFlash.ShockwaveFlash.4'))?4:intDetectedVersion;
	  intDetectedVersion=(detectActiveXControl('ShockwaveFlash.ShockwaveFlash.5'))?5:intDetectedVersion;
	  intDetectedVersion=(detectActiveXControl('ShockwaveFlash.ShockwaveFlash.6'))?6:intDetectedVersion;
	  intDetectedVersion=(detectActiveXControl('ShockwaveFlash.ShockwaveFlash.7'))?7:intDetectedVersion;
	  intDetectedVersion=(detectActiveXControl('ShockwaveFlash.ShockwaveFlash.8'))?8:intDetectedVersion;
	  intDetectedVersion=(detectActiveXControl('ShockwaveFlash.ShockwaveFlash.9'))?9:intDetectedVersion;
    bolFlash=(intDetectedVersion>=intVersion);
  }
  g_intFlashVersion=intDetectedVersion;
  return bolFlash;
}

if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)) {
  document.writeln('<script language="VBscript">');
  document.writeln('g_bolUseVBDetection = False');
  document.writeln('If ScriptEngineMajorVersion >= 2 then');
  document.writeln('  g_bolUseVBDetection = True');
  document.writeln('End If');
  document.writeln('Function detectActiveXControl(activeXControlName)');
  document.writeln('  on error resume next');
  document.writeln('  detectActiveXControl = False');
  document.writeln('  If g_bolUseVBDetection Then');
  document.writeln('     detectActiveXControl = IsObject(CreateObject(activeXControlName))');
  document.writeln('  End If');
  document.writeln('End Function');
  document.writeln('</scr' + 'ipt>');
}

function insertFlash(strSrc, intW, intH, strBgC, strID, strAltImg, strAltLink, arrAttributes, arrValues, strQuality, bolTransparent) {
  if (bolTransparent==null) bolTransparent = false;
  if(strQuality==null || strQuality=="") strQuality="best";
  if(arrAttributes==null || arrValues==null){
    arrAttributes=new Array();
    arrValues=new Array();
  }
  if (g_bolFlashOK){
    if (bolTransparent) document.write('<EMBED src="'+strSrc+'" width="'+intW+'" wmode="transparent"');
    else document.write('<EMBED src="'+strSrc+'" width="'+intW+'" ');
    document.write('height="'+intH+'" quality="'+strQuality+'" ');
    if(strBgC!=null){
      document.write('bgcolor="'+strBgC+'" ');
    }
    document.write('name="'+strID+'" type="application/x-shockwave-flash" ');
    document.write('pluginspage="http://www.macromedia.com/go/getflashplayer"');
    for(var i=0;i<arrAttributes.length;i++){
      document.write(' '+arrAttributes[i]+'="'+arrValues[i]+'"');
    }
    document.write('>');
  } else {
    if(strAltImg==null || strAltImg==''){
      strAltImg = '/_images2005/spacer.gif';
    }
    
    
    if(strAltLink)
      document.write('<a href="' + strAltLink + '">');
      
    document.write('<IMG src="'+strAltImg+'" width="'+intW+'" ');
    document.write('height="'+intH+'" alt="" border="0">');
    
    if(strAltLink)
      document.write('</a>');
  }
}

