function	valider_test (url)
{
	if (lettre_choisie[1] == 'X')
	{
		alert ("Vous n'avez pas choisi votre 1ére compétence");
		return;
	}
	if (lettre_choisie[2] == 'X')
	{
		alert ("Vous n'avez pas choisi votre 2ème compétence");
		return;
	}
	if (lettre_choisie[3] == 'X')
	{
		alert ("Vous n'avez pas choisi votre 3ème compétence");
		return;
	}

	if ((lettre_choisie[1] == lettre_choisie[2]) || (lettre_choisie[1] == lettre_choisie[3]) || (lettre_choisie[2] == lettre_choisie[3]))
	{
		alert ("Vous devez choisir 3 compétences différentes");
		return;
	}

	formulaire = document.forms.test;
	formulaire.enregistrement_tricam.value = "OK";
	formulaire.val_l1.value = lettre_choisie[1];
	formulaire.val_l2.value = lettre_choisie[2];
	formulaire.val_l3.value = lettre_choisie[3];
	//formulaire.submit ();
	document.location =''+url+''+lettre_choisie[1]+''+lettre_choisie[2]+''+lettre_choisie[3];
}

var step = 1;
var lettre_choisie = new Array (3);




lettre_choisie[1] = 'X';
lettre_choisie[2] = 'X';
lettre_choisie[3] = 'X';

function	reset_test (media_path)
{
	change_step (3,media_path);
	change_step (2,media_path);
	change_step (1,media_path);
}

function	change_back (img,media_path)
{
	window.document.img_test.src = media_path + "/test_" + img + ".gif";
}

function	record (lettre,media_path)
{
	if (step == 4)
		return;
	switch (step)
	{
		case 1 :
		window.document.pos_1.src = media_path + "/lettre_" + lettre + ".gif";
		lettre_choisie[1] = lettre;
		break;
		case 2 :
		window.document.pos_2.src = media_path + "/lettre_" + lettre + ".gif";
		lettre_choisie[2] = lettre;
		break;
		case 3 :
		window.document.pos_3.src = media_path + "/lettre_" + lettre + ".gif";
		lettre_choisie[3] = lettre;
		break;
	}
	step++;
}

function	change_step (position,media_path)
{
	step = position;
	switch (step)
	{
		case 1 :
		window.document.pos_1.src = media_path + "/pos_" + position + ".gif";
		lettre_choisie[1] = 'X';
		break;
		case 2 :
		window.document.pos_2.src = media_path + "/pos_" + position + ".gif";
		lettre_choisie[2] = 'X';
		break;
		case 3 :
		window.document.pos_3.src = media_path + "/pos_" + position + ".gif";
		lettre_choisie[3] = 'X';
		break;
	}
}




function doPassVar(){
	if (is_detected == true)
	{
	   var lettre_1 = lettre_choisie[1];
	   var lettre_2 = lettre_choisie[2];
	   var lettre_3 = lettre_choisie[3];
	   //var sendText = args.value;
	   //window.document.monDocument.SetVariable("lettre_1", lettre_1);
	   window.document.monDocument.SetVariable("lettre_1", lettre_1);
	   window.document.monDocument.SetVariable("lettre_2", lettre_2);
	   window.document.monDocument.SetVariable("lettre_3", lettre_3);
	}
}
 

  // Flash Detection 
  var MM_contentVersion = 5; 
  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'); 
     document.write('on error resume next \n'); 
     document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n'); 
     document.write('</SCR' + 'IPT\> \n'); 
    
  } 
  
  
function flash_detection(){
  if ( !MM_FlashCanPlay ){   
  	alert("Le plug in flash n'a pas été détecté");  
  	is_detected =false;
  	document.getElementById('monflash').style.display="none";
  	document.getElementById('version_html').style.display="block";
  }else{
	is_detected =true;

  }
}  
function monDocument_DoFSCommand(commande, args) {
  if (commande == "fenêtreMessage") {
  	document.test.enregistrement_tricam.value = "OK";
	
	document.test.val_l1.value = args.substr(0,1);
	document.test.val_l2.value = args.substr(1,1);
	document.test.val_l3.value = args.substr(2,1);
	document.test.submit();
  }
  
}
