function surligne(champ, erreur)
{
   if (erreur)
      champ.style.borderColor = "#ff8c8c";
   else
      champ.style.borderColor = "#8fff8c";
}

function check_XSS(champ)
{
	var i = 0;
	var xss = 0;
	while (champ.value[i])
	{
	if (champ.value[i] == '>' || champ.value[i] == '<')
		xss = 1;
	i++;
	}
   if (champ.value.length < 1 || xss == 1)
   {
      surligne(champ, true);
      return false;
   }
   else
   {
      surligne(champ, false);
      return true;
   }
}

function check_form(f)
{
   var nom = check_XSS(f.nom);
   var avis = check_XSS(f.avis);
   
   if (nom && avis)
   {
	  MM_openBrWindow('mail-newsletter.php','Newsletter','width=600,height=230') 
      return true;
   }
   else
   {
      alert("Veuillez remplir correctement tous les champs");
      return false;
   }
}

