
function verifForm (params) {
	var error = 0;
	var myForm = document.forms["inscription_email"];
	var email_input = document.getElementById('email').value;
	
	if (email_input == "") {
		error = 1;
		msg = "Champ EMAIL obligatoire !\n";
	} else if (!checkEmail(email_input)) {
		error = 1;
		msg = "Champ EMAIL non valide !\n";
	}
	
	if (error == 0) {
		//inscrireEmail(email_input,params);
		return true;
	} else {
		alert(msg);
		return false;
	}
}

// Vérification de la cohérence de l'email saisi dans les formulaires de Contact
function checkEmail(mail) {
	if ((mail.indexOf("@")>=0)&&(mail.indexOf(".")>=0)) {
		return true;
	} else {
		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('email').value;
			document.getElementById('email').value = '';
			text_visible = false;
	 } else {
	    document.getElementById('email').value = text_tmp;
			text_visible = true;
	 }
}

function start_blink() {
   if (document.getElementById('email').value=='@') {
	    text_timer = setInterval('blink()', 500);
	 }
}

function stop_blink() {
   if (text_timer) { clearInterval(text_timer); }
 }
 
function email_focus() {
    stop_blink();
    if (document.getElementById('email').value == '@') document.getElementById('email').value = '';
}

function email_blur() {
   e = document.getElementById('email');
	 if (document.getElementById('email').value == '@' || document.getElementById('email').value == '') {
	    document.getElementById('email').value = '@';
	    start_blink();
	 }
}
