// on stocke valeur dans le champs chps avant de poster vers page si chps et valeur sont définis
function page_suivante(page, Tchps, Tvaleurs, confirmation)
{
	if (confirmation)
		if (!confirm(confirmation))
			return;
	if (Tchps && Tvaleurs)
	{
		if (Tchps.length != Tvaleurs.length)
			alert ("Il n'y a pas le même nombre de champs et de valeurs en paramètres d'entrée !!!");
		else
		{
			for (cptchps=0; cptchps<Tchps.length; cptchps++)
				eval("document.forme."+Tchps[cptchps]+".value = '"+Tvaleurs[cptchps]+"'");
		}
	}
	document.forme.action = page;
	document.forme.submit();
}

function creation_select_nombre(nom, annee1, annee2, selection)
{
	document.write('<select name="'+nom+'" size="1" id="'+nom+'">');
	for (cpt=annee1; cpt<=annee2; cpt++)
	{
		document.write('<option value="'+cpt+'"'+((cpt == selection)?' selected':'')+'>'+cpt+'</option>');
	}
	document.write('</select>');
}

function textarea_limit(champ, limite)
{
	if (champ.value.length >= limite)
		event.returnValue = false;
}

function affichage_compteur(champ, limite, champ_texte)
{
	champ.value = (limite - champ_texte.value.length);
}

function verif_saisie_email() {
	if (String.fromCharCode(event.keyCode).search(/[^0-9a-zA-Z@\.\-_]/) != -1) {
		event.returnValue = false;
	}
	if (String.fromCharCode(event.which).search(/[^0-9a-zA-Z@\.\-_]/) != -1) {
		return false;
	}
}

function verif_validite_email(champs) {
	if (champs.value.search(/^([0-9a-zA-Z_\-\.]+)@([0-9a-zA-Z\-]+)\.([a-zA-Z]{2,3})$/) == -1)
		return(false);
	else
		return(true);
}

