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;
    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,intH,intW,strBgC,strID,strAltImg,arrAttributes,arrValues,strQuality) {
  if(strQuality==null || strQuality=="") strQuality="high";
  if(arrAttributes==null || arrValues==null){
    arrAttributes=new Array();
    arrValues=new Array();
  }
  if (g_bolFlashOK){
    if(!lay)document.write('<div style="position:relative;top:0;left:0;">');
    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('>');
    if(!lay)document.write('</div>');
  } else {
    if(strAltImg==null || strAltImg==''){
      strAltImg = '/_images/spacer.gif';
    }
    document.write('<IMG src="'+strAltImg+'" width="'+intW+'" ');
    document.write('height="'+intH+'" alt="">');
  }
}
