var Timer;

function moveLayer(Zone,Cadre,Sens) {
	Objet=document.getElementById(Zone);
    if(parseInt(Objet.style.top) + (5*Sens)>0)  {
		clearTimeout(Timer);
	}
	else if(parseInt(Objet.style.top) + (5*Sens)<-(Objet.offsetHeight-document.getElementById(Cadre).offsetHeight)) {
		clearTimeout(Timer);
	}
    else {
        Objet.style.top = (parseInt(Objet.style.top) + (5*Sens)) + "px";
	}
	Timer = setTimeout("moveLayer('"+ Zone +"','"+ Cadre +"'," + Sens + ");", 30);
}



function open_popup(page,hauteur,largeur,nom) 
{ 
	window.open(page,nom,"status=no,scrollbars=no,resizable=no,height="+hauteur+",width="+largeur+",top=0,left=0"); 
} 

function clignotement(i,couleur1,couleur2,frequence,champ){
	i++;
	if (i==1) C = couleur1;
	if (i==2){
		C = couleur2;
		i=0;
	}
	document.getElementById(champ).style.color = C;
	
	timer=setTimeout('clignotement('+ i +',"'+ couleur1 +'","'+ couleur2 +'",'+ frequence +',"'+ champ +'")', frequence);
}



function open_fiche(elem) 
{ 
    if (elem.options[elem.selectedIndex].value != '') 
    { 
        //window.open("./pdf/" + elem.options[elem.selectedIndex].value);
		window.location=('./pdf/' + elem.options[elem.selectedIndex].value);
    } 
} 

function verifEmail(email,champ) {
var place = email.indexOf("@",1);
var point = email.indexOf(".",place+1);
if ((place > -1)&&(email.length >2)&&(point > 1))
	{
		return(true);
	}
else
	{
		alert('Champ '+champ+' non valide !');
		return(false);
	}
}

function submitContact(argForm) {
				
	if(argForm.nom.value == "") {
		alert("Veuillez entrer votre Nom"); 
	}

	else 	if(argForm.tel.value == "") {
		alert("Veuillez entrer votre numéro de Téléphone (10 chiffres minimum)"); 
	}
	
	else if((verifEmail(argForm.email.value,"email"))) {
		argForm.submit();
	}
}
				

function SelectVisible(v,elem) {
	for (var i=0;i<elem.length;i++) elem[i].style.visibility=v;
}


