// script adapté et écrit par Marc Fiasse
// http://users.skynet.be/mafiasse
// origine : étude du Javascript
// la meilleure façon de comprendre, c'est de s'intéresser ! 
// une bonne adresse: http://www.ungi.nirvanet.net/javascri.htm

// Intitialisation des variables

  var appname='';
  var version='';
  var useragent='';
  var vrs=''; 
  var nvrs=0;
  var p1='';
  var s1='';
  var p2='';
  var music='';
  
// Détection du Browser 

// On recupere le nom du logiciel de navigation

  var appname =   navigator.appName;
  var version =   navigator.appVersion;
  var useragent = navigator.userAgent;

// On recupere les infos specifiques du logiciel de navigation Opera

  if (useragent.indexOf('Opera') != -1) {appname = 'Opera';}
 
// Donne le numero de la version du Navigateur

  if (appname == 'Netscape') {
    var p1 = version.indexOf('[') - 1;
    if (p1 < 0) {p1 = version.indexOf('(') - 1;}
    if (p1 > 0) {vrs = ' ' + version.substring(0,p1);}
  }
  if (appname == 'Microsoft Internet Explorer') {
    var p1 = version.indexOf('MSIE') + 5;
    var s1 = version.substring(p1,p1+8);
    var p2 = s1.indexOf(';');
    if (p2 > 0) {vrs = ' ' + s1.substring(0,p2);}
  }
  if (appname == 'Opera') {
    var p1 = useragent.indexOf('Opera') + 6;
    var s1 = useragent.substring(p1,p1+8);
    var p2 = s1.indexOf('[');
    if (p2 > 0) {vrs = ' ' + s1.substring(0,p2-2);}
  }
  if (vrs != '') {nvrs = parseFloat(vrs.substring(1,vrs.length));}

// Conditions spécifiques des Navigateurs

// pour le Media Player d'Explorer
  
	if ( (appname == "Microsoft Internet Explorer") && (nvrs >= 5.0)) {var music='<br><table border=3 bgcolor="#1b0b43"><td><embed SRC="fonds/midis/55.mid" width="145" height="72" autostart="true" volume="0" Loop="2" ShowPositionControls="false" ShowStatusBar="true" ShowControls="true" ShowDisplay="false" DisplayBackColor="9963024" DisplayForeColor="65535"></embed></td></table>';}
	
	else if ( (appname == "Microsoft Internet Explorer") && (nvrs < 5.0)) {var music='<br><table border=3 bgcolor="#1b0b43"><td><embed SRC="fonds/midis/55.mid" width="145" height="72" autostart="true" volume="90" ShowDisplay="true" Loop="2" DisplayBackColor="9963024" DisplayForeColor="65535"></embed></td></table>';}
		
// et le plugin de Netscape

	else if ( (appname == "Netscape") && (nvrs >= 3)) {var music='<br><table border=3 bgcolor="#1b0b43" bordercolor="#c0c0c0"><td><embed SRC="fonds/midis/55.mid" width="145" height="59" volume="90" autostart="true" loop="2"></embed></td></table>';}    	

// sur Opera avec le plugin de Netscape

	else if ( (appname == "Opera") && (nvrs >= 3.6)) {var music='<br><table border=3 bgcolor="#1b0b43" bordercolor="#c0c0c0"><td><embed SRC="fonds/midis/55.mid" width="145" height="59" volume="90" autostart="true" loop="2"></embed></td></table>';}

// sur Opera 3.21 version française     

        else if ( (appname == 'Opera') && (nvrs == 0)) {var music='<bgsound src="fonds/midis/55.mid">';}

// Conditions spécifique par défaut

	else {var music='<embed SRC="fonds/midis/55.mid" width="0" height="0" autostart="true"></embed>';}


// Ecriture

document.write(music);
