function checkMail(nomId)
{
	var mail = document.getElementById(nomId);

	var flag;

	if(mail.value !="")
	flag = checkEmailFormat(mail.value);
	else
	flag = false;



	if(!flag)
	{
		if(nomId == "aNewsletterInscription[email]")
		{
			setMandatoryGlobalError(mail, "inputNewsletterError","");
			returnMessageErreur();
		}
		else
			setMandatoryCustomError(mail, flag);
		
	}
	else
	{
		if(nomId == "aNewsletterInscription[email]")
			setMandatoryGlobalError(mail, "inputNewsletter","none");
		else
			setMandatoryCustomError(mail, flag);

	}

	return flag;

}

function checkMailCartouche()
{
	return checkMail('aNewsletterInscription[email]');
}

function checkMailInscription()
{
	return checkMail('aUser[mailuser]');
}


