// ******************************** Pour la gestion des flash ******************************** //


// Variables globales
// Version majeure de Flash requise
var requiredMajorVersion = 9;
// Version mineure de Flash requise
var requiredMinorVersion = 0;
// Révision de Flash requise
var requiredRevision = 0;
// Version de javascript prise en charge
var jsVersion = 1.0;

var msg_deja_affiche = false;

var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function aff_bal(ch)
{
	document.write(ch);
}

function insert_flash(p_src,p_name,p_width,p_height) {

	if (p_src.indexOf(".flv")>=0){
		var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
		if(hasRightVersion) {  // if we've detected an acceptable version
			// embed the flash movie

			AC_FL_RunContent(
				'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,45,0',
				'width', p_width,
				'height', p_height,
				'src', 'PlayerVideo',
				'quality', 'high',
				'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
				'align', 'middle',
				'play', 'false',
				'loop', 'false',
				'scale', 'showall',
				'wmode', 'window',
				'devicefont', 'false',
				'id', 'PlayerVideo',
				'bgcolor', '#ffffff',
				'name', 'PlayerVideo',
				'menu', 'true',
				'allowScriptAccess','sameDomain',
				'allowFullScreen','true',
				'movie', 'PlayerVideo',
				'salign', '',
				'flashvars', 'nomflv='+p_src
				); //end AC code
		}
		else{
			// flash is too old or we can't detect the plugin
			var alternateContent = 'Alternate HTML content should be placed here.'
				+ 'This content requires the Adobe Flash Player.'
				+ '<a href=http://www.macromedia.com/go/getflash/>Get Flash</a>';
			document.write(alternateContent);  // insert non-flash content
		}
	}
	else{
		var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
		if(!hasRightVersion) {  // si nous avons détecté une version acceptable
			if (!msg_deja_affiche)
			{
				msg_deja_affiche = true;

				var alternateContent = 'Pour visualiser correctement cette page vous avez besoin du Flash&nbsp;Player&nbsp;'+requiredMajorVersion+'.'
				+ '<br /><a href="http://www.macromedia.com/go/getflash/" class="text-normal-lien" target="_blank">T&eacute;l&eacute;charger Flash&nbsp;Player</a><br />';
				document.write(alternateContent);  // Insérer contenu non-Flash
			}
		}
		document.write('<embed src="' + p_src + '" name="' + p_name + '" width="' + p_width + '" height="' + p_height + '" wmode="transparent" quality="high"  align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	}
}




// ****************************** Fin pour la gestion des flash ****************************** //


function dcd_m(val) {
	var l_val = val.length;
	var code = "";
	var result = "";
	
	for(i=0; i<l_val; i+=3)
	{
		code = val.substr(i, 3)-3;
		result += String.fromCharCode(code);
	}
	
	return result;
}

