function initialisezone(){
document.contact.civilite[0].style.background='#FFFFFF';
document.contact.civilite[1].style.background='#FFFFFF';
document.contact.civilite[2].style.background='#FFFFFF';
document.contact.nom.style.background='#FFFFFF';
document.contact.email.style.background='#FFFFFF';
document.contact.sujet.style.background='#FFFFFF';
document.contact.message.style.background='#FFFFFF';
document.contact.antibot.style.background='#FFFFFF';
}
function initialisezone2(){
document.fiche.nom.style.background='#FFFFFF';
document.fiche.prenom.style.background='#FFFFFF';
document.fiche.email.style.background='#FFFFFF';
}
function initialisezone3(){
document.parametres.ftp_server.style.background='#FFFFFF';
document.parametres.ftp_user.style.background='#FFFFFF';
document.parametres.ftp_pass.style.background='#FFFFFF';
document.parametres.sql_server.style.background='#FFFFFF';
document.parametres.sql_bdd.style.background='#FFFFFF';
document.parametres.sql_user.style.background='#FFFFFF';
document.parametres.sql_pass.style.background='#FFFFFF';
document.parametres.nom.style.background='#FFFFFF';
document.parametres.email.style.background='#FFFFFF';
}

function envoimessage(){
flag=0;
initialisezone();
if(!document.contact.civilite[0].checked&&!document.contact.civilite[1].checked&&!document.contact.civilite[2].checked){
	flag=1;
	document.contact.civilite[0].style.background='#CCCCCC';
	document.contact.civilite[1].style.background='#CCCCCC';
	document.contact.civilite[2].style.background='#CCCCCC';
}
if(!document.contact.nom.value){
	flag=1;
	document.contact.nom.style.background='#CCCCCC';
}
if(!document.contact.email.value){
	flag=1;
	document.contact.email.style.background='#CCCCCC';
	}
if(!document.contact.sujet.value){
	flag=1;
	document.contact.sujet.style.background='#CCCCCC';
}
if(!document.contact.message.value){
	flag=1;
	document.contact.message.style.background='#CCCCCC';
}
if(!document.contact.antibot.value){
	flag=1;
	document.contact.antibot.style.background='#CCCCCC';
}
if(flag){
	alert('Il manque certains renseignements.');
	}
else{
	if(document.contact.email.value){
		adresse_email=document.contact.email.value;
		arobase=adresse_email.indexOf("@");
		point=adresse_email.indexOf(".",arobase);
		mauvais_endroit_point=arobase+1;
		double_point=adresse_email.indexOf("..",arobase);
		nbre_carac=adresse_email.length-point;
		double_arobase=adresse_email.indexOf("@",arobase+1);
		if ((arobase<1)||(point<=mauvais_endroit_point)||(adresse_email.length<7)||(double_point>=0)||(nbre_carac<3)||(nbre_carac>6)||(double_arobase>=0)){
			flag=1;
			document.contact.email.style.background='#CCCCCC';
		}
	}
	if(flag){
		alert('L\'adresse e-mail n\'est pas valide.');
	}
	else{
		document.contact.method="POST";
		document.contact.action="contact.php";
		document.contact.submit();
	}
}
}
function verifier_abonne(){
flag=0;
initialisezone2();
if(!document.fiche.nom.value){
	flag=1;
	document.fiche.nom.style.background='#CCCCCC';
}
if(!document.fiche.prenom.value){
	flag=1;
	document.fiche.prenom.style.background='#CCCCCC';
}
if(!document.fiche.email.value){
	flag=1;
	document.fiche.email.style.background='#CCCCCC';
	}
if(flag){
	alert('Il manque certains renseignements.');
	}
else{
	if(document.fiche.email.value){
		adresse_email=document.fiche.email.value;
		arobase=adresse_email.indexOf("@");
		point=adresse_email.indexOf(".",arobase);
		mauvais_endroit_point=arobase+1;
		double_point=adresse_email.indexOf("..",arobase);
		nbre_carac=adresse_email.length-point;
		double_arobase=adresse_email.indexOf("@",arobase+1);
		if ((arobase<1)||(point<=mauvais_endroit_point)||(adresse_email.length<7)||(double_point>=0)||(nbre_carac<3)||(nbre_carac>6)||(double_arobase>=0)){
			flag=1;
			document.fiche.email.style.background='#CCCCCC';
		}
	}
	if(flag){
		alert('L\'adresse e-mail n\'est pas valide.');
	}
	else{
		document.fiche.method="POST";
		document.fiche.action="newsletter.php";
		document.fiche.submit();
	}
}
}
function verifier_install(){
flag=0;
initialisezone3();
if(!document.parametres.ftp_server.value){
	flag=1;
	document.parametres.ftp_server.style.background='#CCCCCC';
}
if(!document.parametres.ftp_user.value){
	flag=1;
	document.parametres.ftp_user.style.background='#CCCCCC';
}
if(!document.parametres.ftp_pass.value){
	flag=1;
	document.parametres.ftp_pass.style.background='#CCCCCC';
}
if(!document.parametres.sql_server.value){
	flag=1;
	document.parametres.sql_server.style.background='#CCCCCC';
}
if(!document.parametres.sql_bdd.value){
	flag=1;
	document.parametres.sql_bdd.style.background='#CCCCCC';
}
if(!document.parametres.sql_user.value){
	flag=1;
	document.parametres.sql_user.style.background='#CCCCCC';
}
if(!document.parametres.sql_pass.value){
	flag=1;
	document.parametres.sql_pass.style.background='#CCCCCC';
}
if(!document.parametres.nom.value){
	flag=1;
	document.parametres.nom.style.background='#CCCCCC';
}
if(!document.parametres.email.value){
	flag=1;
	document.parametres.email.style.background='#CCCCCC';
	}
if(flag){
	alert('Il manque certains renseignements.');
	}
else{
	adresse_email=document.parametres.email.value;
	arobase=adresse_email.indexOf("@");
	point=adresse_email.indexOf(".",arobase);
	mauvais_endroit_point=arobase+1;
	double_point=adresse_email.indexOf("..",arobase);
	nbre_carac=adresse_email.length-point;
	double_arobase=adresse_email.indexOf("@",arobase+1);
	if ((arobase<1)||(point<=mauvais_endroit_point)||(adresse_email.length<7)||(double_point>=0)||(nbre_carac<3)||(nbre_carac>6)||(double_arobase>=0)){
		flag=1;
		document.parametres.email.style.background='#CCCCCC';
	}
	if(flag){
		alert('L\'adresse e-mail n\'est pas valide.');
	}
	else{
		document.parametres.method="POST";
		document.parametres.action="index.php";
		document.parametres.submit();
	}
}
}
