function submitForm(formName) { if (checkEmail(document.forms[formName].email.value)) { document.forms[formName].submit() ; } else { start_clignotte('email'); } } function checkEmail(email) { if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))) { return false; } return true; } // Ajouté par Andrei var couleurOff='white'; var couleurOn='red'; var champOn = 0; function changeColor(couleur, champ) { document.getElementById(champ).style.background=couleur; } var blink_timer; var text_visible = 1; var text_tmp; var nbr_max_clignotte = 3; var nbr_clignotte=1; function clignotte(champ) { if (champOn) { nbr_clignotte++; champOn=0; changeColor(couleurOff, champ); if (nbr_clignotte>nbr_max_clignotte) { clearInterval(clignotte_timer); } } else { champOn=1; changeColor(couleurOn, champ); } } function start_clignotte(champ) { nbr_clignotte=1; clignotte_timer = setInterval('clignotte(\'' + champ + '\')', 200); } function blink() { if (text_visible) { text_tmp = document.email_catcher.email.value; document.email_catcher.email.value = ''; text_visible = 0; } else { document.email_catcher.email.value = text_tmp; text_visible = 1; } } function start_blink() { if (document.email_catcher.email.value=='entre ton e-mail') { blink_timer = setInterval('blink()', 500); } } function stop_blink() { if (blink_timer) { clearInterval(blink_timer); } } function email_focus(this_form, blink) { if (blink == 1) { stop_blink(); } e = this_form.email; if (e.value == 'entre ton e-mail') { e.value = ''; } } function email_blur(this_form, blink) { var e = this_form.email; if (e.value == 'entre ton e-mail' || e.value == '') { e.value = 'entre ton e-mail'; if (blink == 1) { start_blink(); } } }