cook = document.cookie;
dateExp = new Date(2020,11,11);
dateExp = dateExp.toGMTString();

function recup(libelle)
{
	libelle += "=";

	plac = cook.indexOf(libelle,0);
	if (plac <= -1) 
	{
		return "";
	}
	else 
	{
		end = cook.indexOf(";",plac);
		if (end <= -1)
			{return cook.substring(plac+8,cook.length);}
		else
			{return cook.substring(plac+8,end);}
	}
}

function SendForm()
{
	if (document.envmail.Email.value != "") {
		document.cookie = 'adrmail=' + document.envmail.Email.value + '; expires=' + dateExp + ';';
	} else {
		document.envmail.Email.value = recup("adrmail");
	}
	if (document.envmail.Nom.value != "") {
		document.cookie = 'nompers=' + document.envmail.Nom.value + '; expires=' + dateExp + ';';
	} else {
		document.envmail.Nom.value = recup("nompers");
	}
	if (document.envmail.Prenom.value != "") {
		document.cookie = 'prenomp=' + document.envmail.Prenom.value + '; expires=' + dateExp + ';';
	} else {
		document.envmail.Prenom.value = recup("prenomp");
	}
	document.envmail.provenance.value = recup("provena");
	document.envmail.nbvisite.value = recup("pagearr");
	document.envmail.pagearrive.value = recup("nbvisit");
}

