/********************************************
**    VERIFICATION DU CONTENU DU MAIL      **
********************************************/
  function verifSelection()
  {
    if (document.mail_form.champ1.value == "") 
    {
      alert("Champ Nom obligatoire !")
      return false
    }
    if (document.mail_form.champ2.value == "")
    {
      alert("Champ Prénom obligatoire !")
      return false
    }
    if (document.mail_form.champ3.value == "")
    {
      alert("Champ Société obligatoire !")
      return false
    }
   if (document.mail_form.zone_email.value == "") 
    {
      alert("Adresse email obligatoire !")
      return false
    }

    invalidChars = " /:,;'"

    for (i=0; i<invalidChars.length; i++)
    {
// does it contain any invalid characters?
      badChar = invalidChars.charAt(i)
 
      if (document.mail_form.zone_email.value.indexOf(badChar,0) > -1) 
      {
        alert("Votre adresse e-mail contient des caract&egrave;res invalides. Veuillez v&eacute;rifier.")
        document.mail_form.zone_email.focus()
        return false
      }
    }

    atPos = document.mail_form.zone_email.value.indexOf("@",1)                     
// there must be one "@" symbol
    if (atPos == -1) 
    {
      alert('Votre adresse e-mail ne contient pas le signe "@". Veuillez v&eacute;rifier.')
      document.mail_form.zone_email.focus()
      return false
    }

    if (document.mail_form.zone_email.value.indexOf("@",atPos+1) != -1)
    {
// and only one "@" symbol
      alert('Il ne doit y avoir qu\'un signe "@". Veuillez v&eacute;rifier.')
      document.mail_form.zone_email.focus()
      return false
    }

    periodPos = document.mail_form.zone_email.value.indexOf(".",atPos)

    if (periodPos == -1)
    {
// and at least one "." after the "@"
      alert('Vous avez oubli&eacute; le point "." apr&egrave;s le signe "@". Veuillez v&eacute;rifier.')
      document.mail_form.zone_email.focus()
      return false
    }

    if (periodPos+3 > document.mail_form.zone_email.value.length)
    {
// must be at least 2 characters after the .
      alert('Il doit y avoir au moins deux caract&egrave;res après le signe ".". Veuillez v&eacute;rifier.')
      document.mail_form.zone_email.focus()
      return false
    }
   if (document.mail_form.zone_texte.value == "") 
   {
      alert("Contenu du message obligatoire")
      return false
   }
  } 
// Fin de la fonction verifSelection


/********************************************
*****    VERIFICATION DE  FLASHPLAYER   *****
********************************************/
function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;
      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}


/********************************************
**    JAVASCRIPT DE LA PAGE CONTACT.PHP    **
********************************************/
function validerFormulaire() {
	
var color_red = '#FF0033';
var color_black = '#333333';
var is_ok = true;

var champ = getObject('formulaire_nom');
if(champ.value == '')
{
	champ.style.borderColor= color_red;
	is_ok= false;
}
else
champ.style.borderColor= color_black;	

champ = getObject('formulaire_prenom');
if(champ.value == '')
{
	champ.style.borderColor= color_red;
	is_ok= false;
}
else
champ.style.borderColor= color_black;

champ = getObject('formulaire_email');  
if (champ.value.indexOf('@') == '-1' ||
    champ.value.indexOf('.') == '-1' ||
    champ.value == '')
{
	champ.style.borderColor= color_red;
	is_ok= false;
}
else
champ.style.borderColor= color_black;

champ = getObject('formulaire_message');
if(champ.value == '')
{
	champ.style.borderColor= color_red;
	is_ok= false;
}
else
champ.style.borderColor= color_black;

if(is_ok)
document.forms[0].submit();
}

function getObject(idObjet){
	return document.getElementById(idObjet);
}