/////////////////////////////////////////////////
//Detection du plug-in Macromedia Flash
/////////////////////////////////////////////////
IsFlash  = 0;
IsFlash3 = 0;
IsFlash4 = 0;
IsFlash5 = 0;
IsFlash6 = 0;
IsFlash7 = 0;
IsFlash8 = 0;
IsFlash9 = 0;
IsFlash10 = 0;

if (!IsMac)
  {
  document.writeln( '<' + 'SCRIPT LANGUAGE="VBScript">');
  document.writeln( 'Sub Test()');
  document.writeln( 'on error resume next');
  document.writeln( 'IsFlash3 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3")))');
  document.writeln( 'IsFlash4 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")))');
  document.writeln( 'IsFlash5 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))');
  document.writeln( 'IsFlash6 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))');
  document.writeln( 'IsFlash7 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7")))');
  document.writeln( 'IsFlash8 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8")))');
  document.writeln( 'IsFlash9 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9")))');
  document.writeln( 'IsFlash10 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.10")))');  
  document.writeln( 'IsFlash  = (IsFlash3 or IsFlash4 or IsFlash5 or IsFlash6 or IsFlash7 or IsFlash8 or IsFlash9 or IsFlash10)');
  document.writeln( 'End Sub');
  document.writeln( '<' + '/SCRIPT>');
  }

if (IsIEW&&!IsOpera) {Test();}

if ((IsNS||IsOpera||IsIE5M||IsSafM) && navigator.plugins)
  {  
  numPlugins = navigator.plugins.length;
  if (numPlugins > 0)
    {
    for (i = 0; i < numPlugins; i++)
       {
       plugin = navigator.plugins[i];
       IsFlashPlug=plugin.description.indexOf("Flash")==-1?0:1;
       if (IsFlashPlug)
         {
         IsFlash3=plugin.description.indexOf("Flash 3")==-1?0:1;
         IsFlash4=plugin.description.indexOf("Flash 4")==-1?0:1;
         IsFlash5=plugin.description.indexOf("Flash 5")==-1?0:1;
         IsFlash6=plugin.description.indexOf("Flash 6")==-1?0:1;
	 IsFlash7=plugin.description.indexOf("Flash 7")==-1?0:1;
	 IsFlash8=plugin.description.indexOf("Flash 8")==-1?0:1;
	 IsFlash9=plugin.description.indexOf("Flash 9")==-1?0:1;
	 IsFlash10=plugin.description.indexOf("Flash 10")==-1?0:1;

         numTypes = plugin.length;
         for (j = 0; j < numTypes; j++)
            {
            mimetype = plugin[j];
            if (mimetype)
              {
              if (mimetype.enabledPlugin && (mimetype.suffixes.indexOf("swf") != -1)) {IsFlash = 1;}
              if (navigator.mimeTypes["application/x-shockwave-flash"] == null) {IsFlash = 0;}
              }
            }
         }
       }
    }
  }

// alert de test

alertFlash  = "Resultat de la detection :\n\n"
alertFlash += "IsFlash : "+IsFlash+"\n";
alertFlash += "IsFlash3 : "+IsFlash3+"\n";
alertFlash += "IsFlash4 : "+IsFlash4+"\n";
alertFlash += "IsFlash5 : "+IsFlash5+"\n";
alertFlash += "IsFlash6 : "+IsFlash6+"\n";
alertFlash += "IsFlash7 : "+IsFlash7+"\n";
alertFlash += "IsFlash8 : "+IsFlash8+"\n";
alertFlash += "IsFlash9 : "+IsFlash9+"\n";
alertFlash += "IsFlash10 : "+IsFlash10;
//alert (alertFlash);

FlashShowOk=0;
function FlashShow(FichierFlash,ETX,ETY)
{
FlashShowOk=1;
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0" id="total"  width="'+ETX+'" height="'+ETY+'">');
document.write('<param name="movie" value="'+FichierFlash+'">');
document.write('<param name="loop" value="true">');
document.write('<param name="quality" value="high">');
document.write('<param name="scale" value="exactfit">');
document.write('<embed src="'+FichierFlash+'" scale="exactfit" loop="true" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" width="'+ETX+'" height="'+ETY+'">');
document.write('</object>');
}