﻿//function insertFlash(MM_contentVersion,flName,objName,flColor, flWidth, flHeight) 
//{

    //Default Flash Version
    if(! MM_contentVersion)
    {
	    var MM_contentVersion = 7;
    }

    //Default Flash Path
    if(! flName)
    {
	    var flName = '/_media/no_flash.swf';
    }

    //Default Flash Object Name
    if(! objName)
    {
	    var objName = 'myFlash';
    }

    //Default Flash BG Color
    if(! flColor)
    {
	    var flColor = '#FFFFFF';
    }

    //Default Flash Width
    if(! flWidth)
    {
	    var flWidth = '500';
    }

    //Default Flash Height
    if(! flHeight)
    {
	    var flHeight = '400';
    }

    //Default Tranparency / IE Only
    if(flWmode)
    {
		var flWmode = '<param name="wmode" value="transparent">';
	    //var flWmodeFirefox= ' WMODE= "transparent"';
    }else{
		var flWmode = '';
	    //var flWmodeFirefox= '';
    }

    if(flWmodeFirefox)
    {
        var flWmodeFirefox = ' WMODE= "transparent"';
    } else{
	    var flWmodeFirefox= '';
    }
    
    
    //Fix 100% size issue in Mozilla
    if (navigator.appName.indexOf('Microsoft')==-1 && flWidth=='100%' && flHeight=='100%')
    {
	    function WindowResize()
	    {
		    flWidth = window.innerWidth;
		    flHeight = window.innerHeight;
	    }
    	
	    //Call the function
	    WindowResize();
    }

    var flashie4 = document.all;
    var flashns4 = document.layers;
    var flashns6 = document.getElementById && !document.all;

    queryStr = this.document.location.search.substr(1, String(this.document.location.search).length);

    function refreshPage(){
	    this.document.location = this.document.location + "?nodetect";	
    }

    var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
    if ( plugin ) {
		    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'); //FS hide this from flashie4.5 Mac by splitting the tag
	    document.write('on error resume next \n');
	    document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	    document.write('</SCR' + 'IPT\> \n');
    }
    if ( MM_FlashCanPlay || queryStr == "nodetect") {

    document.write('<OBJECT '
          +  'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
          + ' codebase="http://active.macromedia.com/flash2/'
          + 'cabs/swflash.cab#version=' + MM_contentVersion + ',0,0,0"'
          + ' ID="' + objName + '"'
          + ' WIDTH=' + flWidth
          + ' HEIGHT=' + flHeight + '>'
          + ' <PARAM NAME=movie VALUE="' + flName + '">'
          + ' <PARAM NAME=quality VALUE=best>'
	      + ' <param name="allowScriptAccess" value="sameDomain" />'
          + ' <PARAM NAME=bgcolor VALUE=' + flColor + '>'
	      + flWmode
          + '<EMBED src="' + flName  + '"'
          + ' name="' + objName + '"'
          + ' quality=best bgcolor=' + flColor
          + ' WIDTH=' + flWidth
          + ' HEIGHT=' + flHeight
          + flWmodeFirefox
          + ' TYPE="application/x-shockwave-flash"'
	      + ' allowScriptAccess="sameDomain"'
          + ' PLUGINSPAGE="http://www.macromedia.com/shockwave/'
          + 'download/index.cgi?P1_Prod_Version=ShockwaveFlash">'
          + '</EMBED></OBJECT>'
    )

    } else{
		    //document.location = "http://www.tfo.org/cfmx/tfoorg/tfo/erreurs/index.cfm?type=flash&flVersion=" + MM_contentVersion;
    		
		    document.write(
			    '<div style="width:'+180+'px; height:'+150+'px; padding:5px; background-color:red; color:white; font-family:Arial; font-size:12px;">'
			    +'<div style="font-size:18px; font-weight:bold;">Flash ' + MM_contentVersion + ' est requis</div>'
			    + ''
			    + 'Vous ne disposez pas d&rsquo;une version assez récente du plugiciel Flash pour utiliser ce site. '
			    + 'Cliquez sur le lien suivant pour télécharger le lecteur...'
			    + '<br><br>'
			    + '<a href="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" target="_new"><img src="http://www.tfo.org/erreurs/_images/getflash.gif" border=0></a>'
			    + '</div>'
		    )
    }



//}