var MM_contentVersion = 4;
var MM_FlashCanPlay = false;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

if ( plugin ) 
{
		
		if (navigator.plugins["Shockwave Flash"]) {
		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'); 
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}

function afficheFlash(idFlash, nomFichierFlash, nomImage, width, height) {

	if ( MM_FlashCanPlay) 
	{		
		document.write('<div id="' + idFlash + '">');
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
		document.write('  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
		document.write(' height="'+height+'" width="'+ width + '" id="flash_' + idFlash + '">');
		document.write(' <param name="movie" value="images/' + nomFichierFlash + '.swf"><param name="quality" value="high"><param name="wmode" value="transparent">'); 
		document.write(' <embed id="flash_' + idFlash + '" src="images/' + nomFichierFlash + '.swf" quality=high   ');
		document.write(' swLiveConnect="FALSE" name="' + idFlash + '" width="'+ width + '" height="' + height + '"');
		document.write(' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent">');
		document.write(' </embed>');
		document.write('</object>');
		document.write('</div>');	

	}
	else
	{
		document.write('<img alt="Visuel" src="images/' + nomImage +'" />');
	}

}

function genereFlash(idFlash, nomFichierFlash, width, height) {

	var buf = "";
	if ( MM_FlashCanPlay && flashPage) {
		buf = '<div class="teaserFlash" id="' + idFlash + '">' +
			'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' +
			'  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ' +
			' height="'+height+'" width="'+ width + '" id="flash_' + idFlash + '">' +
			' <param name="movie" value="flash/' + nomFichierFlash + '.swf"><param name="quality" value="high">' + 
			' <embed id="flash_' + idFlash + '" src="flash/' + nomFichierFlash + '.swf" quality=high   ' +
			' swLiveConnect="FALSE" name="' + idFlash + '" width="'+ width + '" height="' + height + '"' +
			' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">' +
			' </embed>' +
			'</object>' +
			'</div>';
	}
	return buf;
}
