/*
ATTENTION !!!!  LE NOM barroux CORRESPOND EN APPARENCE AU NAME ET A L'ID DU FORMULAIRE DE LA PAGE DE SAISIE
METTRE LES FICHIER JAVASCRIPT AU MEME NIVEAU QUE CETTE PAGE
*/


function checkForm(theform) {
	var t1 = 0;
	var errors = '';
	var numErrors = 0;
	var nb = 0;
	
/*	nb = fsspx.montant.value;
	nbb=parseFloat(nb)
	if (isNaN(nbb)) {
		errors += '- Veuillez saisir le montant du règlement, svp.\n';
		numErrors++;
	}
*/	if (!isname(fsspx.nom.value)) {
		errors += '- Veuillez saisir votre nom, svp.\n';
		numErrors++;
	}
	if (!isname(fsspx.prenom.value)) {
		errors += '- Veuillez saisir votre prénom, svp.\n';
		numErrors++;
	}
	if (!isValidEmail(fsspx.email.value)) {
		errors += '- Veuillez saisir votre adresse e-mail, svp.\n';
		numErrors++;
	}
	if (!isadresse(fsspx.adr1.value)) {
		errors += '- Veuillez saisir votre adresse postale, svp.\n';
		numErrors++;
	}
/*	if (!isadresse(fsspx.codepostal.value)) {*/
	if (!isValidZipcode(fsspx.codepostal.value)) {
		errors += '- Veuillez saisir votre code postal, svp.\n';
		numErrors++;
	}
	if (!isville(fsspx.ville.value)) {
		errors += '- Veuillez saisir votre ville, svp.\n';
		numErrors++;
	}
	if (!isname(fsspx.pays.value)) {
		errors += '- Veuillez saisir votre pays, svp.\n';
		numErrors++;
	}
	if (document.fsspx.montant.value == 0) {
		errors += '- Le montant total du versement est nul.\n';
		numErrors++;
	}
	if ((document.fsspx.montant.value > 0) && (document.fsspx.montant.value< 10)) {
		errors += '- Dans le cas d\'un versement en ligne,\n   le montant de celui-ci doit être supérieur à 10€.\n';
		numErrors++;
	}
	if (numErrors) {
		errors = 'Formulaire incorrect à cause de' + ((numErrors > 1) ? 's' : '') + ((numErrors < 2) ? ' l\'' : '')+ ' omission'+ ((numErrors > 1) ? 's' : '') + ' ci-dessous ' + ':\n' + errors + 'Veuillez, svp, corriger ' + ((numErrors > 1) ? 'ces' : 'cette') + ' ommission' + ((numErrors > 1) ? 's' : '') + ' et reprendre le questionnaire... merci.';
	alert(errors);
	return false;
	}
	return true;
}

