//BLINK - IE does not understand the blink css
var text_timer;
var text_visible = 1;
var text_tmp;


function blink()
{
if(!document.formulaire.mot) return false;
   if (text_visible)
	 {
	    text_tmp = document.formulaire.mot.value;
			document.formulaire.mot.value = '';
			text_visible = false;
	 }
   else
	 {
	    document.formulaire.mot.value = text_tmp;
			text_visible = true;
	 }
}

function start_blink()
{
if(!document.formulaire.mot) return false;
   if (document.formulaire.mot.value=='votre recherche ici')
	 {
	    text_timer = setInterval('blink()', 500);
	 }
}

function stop_blink()
{
   if (text_timer)
    {
	    clearInterval(text_timer);
	 }
 }
 
 
function mot_focus()
{
if(!document.formulaire.mot) return false;
   stop_blink();
	 e = document.formulaire.mot;
	 if (e.value == 'votre recherche ici') e.value = '';
}

function mot_blur()
{
if(!document.formulaire.mot) return false;
   e = document.formulaire.mot;
	 if (e.value == 'votre recherche ici' || e.value == '')
	 {
	    e.value = 'votre recherche ici';
	    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;

//Clignotement du formulaire du catcheur

var clignotte = true;
var OldValue='Entre ton email ici';
var EmptyValue = 'Entre ton email ici'; 
function clignoteArobase(nbr) {
	if(clignotte == true) {
		if(nbr == 0) {
			if(OldValue!='') OldValue = document.formulaire.form_email.value;
			document.formulaire.form_email.value = OldValue;
			nbr = 1;
		} else {
			document.formulaire.form_email.value = '';
			nbr = 0;
		}
		if('@' =='@'){
			setTimeout("clignoteArobase("+nbr+")",500);
		}
	}
}
function StopClignotte() {
	clignotte = false;
	return clignotte;
}

function clickee() {
	clickeeRun(0,0);
}

function clickeeRun(nbr,maxNbr) {
	if(document.formulaire.form_email.value == ''){
		document.formulaire.form_email.value = EmptyValue;
	}
	if(maxNbr < 10 ) {
		if(nbr == 0 ) {
			document.getElementById("form_email").style.backgroundColor = '#c00500';
			document.getElementById("form_email").style.color = '#FFF';
			nbr = 1;
		} else {
			document.getElementById("form_email").style.backgroundColor = '#fff';
			document.getElementById("form_email").style.color = '#000';
			nbr = 0;
		}
		maxNbr++;
		setTimeout("clickeeRun("+nbr+","+maxNbr+")",100);
	}
}
