function coloreMenu(rub, sColor)
{
	document.getElementById("menu" + rub).style.borderBottom = "solid 3px #" + sColor;
}

function isEmail(str)
{
  // are regular expressions supported?
  var supported = 0;
  if (window.RegExp) 
  {
	var tempStr = "a";
	var tempReg = new RegExp(tempStr);
	if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported) return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
	var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
	var r2 = new
	RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
	return (!r1.test(str) && r2.test(str));
}


function Validation(theForm)
{
  if (theForm.societe.value == "")
  {
	alert("Veuillez saisir votre sociéte");
	theForm.societe.focus();
	return false;
  }

  if (theForm.nom.value == "")
  {
	alert("Veuillez saisir votre nom");
	theForm.nom.focus();
	return false;
  }
  if (theForm.prenom.value == "")
  {
	alert("Veuillez saisir votre prenom");
	theForm.prenom.focus();
	return false;
  }
  if (theForm.fonction.value == "")
  {
	alert("Veuillez saisir votre fonction");
	theForm.fonction.focus();
	return false;
  }

  if (!isEmail(theForm.email.value))
  {
	alert("Veuillez saisir votre email");
	theForm.email.focus();
	return false;
  }

  if (theForm.sujet.value == "")
  {
	alert("Veuillez saisir votre sujet");
	theForm.sujet.focus();
	return false;
  }

  if (theForm.message.value == "")
  {
	alert("Veuillez saisir votre message");
	theForm.message.focus();
	return false;
  }
  
	return true;
}

function aboNews()
{
	var sEmail = document.getElementById("aboEmail").value;
	var sLg = document.getElementById("aboLangue").value;
	
	if (sLg != "" && isEmail(sEmail))
	{
		var aj_Abo = new sack();
		url = "../_common/aboNewsletter.php?lg=" + sLg + "&email=" + sEmail;
		aj_Abo.requestFile = url;
		aj_Abo.onCompletion = function(){ aboOk(); };
		aj_Abo.onError = function(){ aboNok(); };
		aj_Abo.runAJAX();
	}
}

function aboOk()
{
	window.open("aboOk.htm", "", "menubar=no, status=no, scrollbars=no, menubar=no, width=239, height=204");
	document.getElementById("aboEmail").value = "";
}			

function aboNok()
{
	window.open("aboNok.htm", "", "menubar=no, status=no, scrollbars=no, menubar=no, width=239, height=204");
}			