//Inscription
function check_news()
{

    var nom				= document.news.nom;
    var prenom			= document.news.prenom;
    var compagnie		= document.news.compagnie;
    var telephone		= document.news.telephone;
    var email			= document.news.email;
            

    if (nom.value == "")
    {
        window.alert("Indiquez une valeur.");
        nom.focus();
        return false;
    }
    
    if (prenom.value == "")
    {
        window.alert("Indiquez une valeur.");
        prenom.focus();
        return false;
    }

    if (compagnie.value == "")
    {
        window.alert("Indiquez une valeur.");
        compagnie.focus();
        return false;
    }
        
 	if (telephone.value == "")
    {
        window.alert("Indiquez une valeur.");
       telephone.focus();
        return false;
    }
    
  var checkOK = "0123456789- ";
  var checkStr = news.telephone.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum = "";
  
   for (i = 0;  i < checkStr.length;  i++)
   {
     ch = checkStr.charAt(i);
     for (j = 0;  j < checkOK.length;  j++)
       if (ch == checkOK.charAt(j))
         break;
     if (j == checkOK.length)
     {
       allValid = false;
       break;
     }
     if (ch != " ")
       allNum += ch;
   }
   if (!allValid)
   {
     alert("Uniquement du numeric.");
     news.telephone.focus();
     return (false);
   }
   
   
   if (email.value == "")
    {
        window.alert("E-mail invalide.");
        email.focus();
        return false;
    }
    if (email.value.indexOf("@", 0) < 0)
    {
        window.alert("E-mail invalide.");
        email.focus();
        return false;
    }
    if (email.value.indexOf(".", 0) < 0)
    {
        window.alert("E-mail invalide.");
        email.focus();
        return false;
    }

         return true;
}

//desinscription
function check_desc()
{

    var email			= document.desc.email;
              
   if (email.value == "")
    {
        window.alert("E-mail invalide.");
        email.focus();
        return false;
    }
    if (email.value.indexOf("@", 0) < 0)
    {
        window.alert("E-mail invalide.");
        email.focus();
        return false;
    }
    if (email.value.indexOf(".", 0) < 0)
    {
        window.alert("E-mail invalide.");
        email.focus();
        return false;
    }

         return true;
}


//envoyez a un amis
function check_sendafriend()
{

    var nom			= document.url.nom;
    var email		= document.url.email;
    var msg			= document.url.msg;

   if (nom.value == "")
    {
        window.alert("Indiquez une valeur.");
        nom.focus();
        return false;
    }

   if (email.value == "")
    {
        window.alert("E-mail invalide.");
        email.focus();
        return false;
    }
    if (email.value.indexOf("@", 0) < 0)
    {
        window.alert("E-mail invalide.");
        email.focus();
        return false;
    }
    if (email.value.indexOf(".", 0) < 0)
    {
        window.alert("E-mail invalide.");
        email.focus();
        return false;
    }

   if (msg.value == "")
    {
        window.alert("Indiquez une valeur.");
        msg.focus();
        return false;
    }

         return true;
}

//message
function check_sendemail()
{
    var nom		= document.email.nom;
    var email	= document.email.email;
    var msg		= document.email.msg;

   if (nom.value == "")
    {
        window.alert("Indiquez une valeur.");
        nom.focus();
        return false;
    }

   if (email.value == "")
    {
        window.alert("E-mail invalide.");
        email.focus();
        return false;
    }
    if (email.value.indexOf("@", 0) < 0)
    {
        window.alert("E-mail invalide.");
        email.focus();
        return false;
    }
    if (email.value.indexOf(".", 0) < 0)
    {
        window.alert("E-mail invalide.");
        email.focus();
        return false;
    }

   if (msg.value == "")
    {
        window.alert("Indiquez une valeur.");
        msg.focus();
        return false;
    }


         return true;
}
