function submit_error() {
    var email = document.formulaire.mail.value;
    longueur = document.formulaire.mail.value.length;
    index = document.formulaire.mail.value.indexOf("@");
    index2 = document.formulaire.mail.value.indexOf(";");

    if ((index < 1) || (index==(longueur-1))) {
            alert("Vous devez entrer un email de type nom@fournisseur.com");
            document.formulaire.mail.focus();
    return false;
    }
    if (index2 > 0){
            alert("Vous ne devez pas avoir de ; dans votre email");
            document.formulaire.mail.focus();
      		return false;
    }
    domaine = document.formulaire.mail.value.substring(index+1,longueur);
    longueur = domaine.length;
    index = domaine.indexOf(".");
    if ((index < 1) || (index==(longueur-1))){
            alert("Vous devez entrer un email de type nom@fournisseur.com");
            document.formulaire.mail.focus();
        	return false;
    }
}

function ConfirmEmailLegit()
{
    var MailValue = document.getElementById('mail').value; 
    if (!MailValue) 
    {
        alert('Vous devez inscrire une adresse courriel!'); 
        return FALSE;
    }
    var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
    var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
    if (!reg1.test(MailValue) && reg2.test(MailValue)) { // if syntax is valid
        AddEmail();
        document.getElementById('CB30Link').submit();
        return true;
    }
    alert ('Vous devez inscrire une adresse couriel valide!');
    return FALSE;
}
//BLINK - IE does not understand the blink css
var text_timer;
var text_visible = 1;
var text_tmp;
function blink()
{
   if (text_visible)
	 {
	    text_tmp = document.getElementById('mail').value;
			document.getElementById('mail').value = '';
			text_visible = false;
	 }
   else
	 {
	    document.getElementById('mail').value = text_tmp;
			text_visible = true;
	 }
}
function start_blink()
{
   if (document.getElementById('mail').value=='@')
	 {
	    text_timer = setInterval('blink()', 500);
	 }
}
function stop_blink()
{
   if (text_timer)
    {
	    clearInterval(text_timer);
	 }
 }
function email_focus()
{
    stop_blink();
    if (document.getElementById('mail').value == '@') document.getElementById('mail').value = '';
}
function email_blur()
{
   e = document.getElementById('mail');
	 if (document.getElementById('mail').value == '@' || document.getElementById('mail').value == '')
	 {
	    document.getElementById('mail').value = '@';
	    start_blink();
	 }
}
if (window.addEventListener) window.addEventListener("load", start_blink, false);
else if (window.attachEvent) window.attachEvent("onload", start_blink);
else if (document.getElementById) window.onload=start_blink;