// JavaScript Document
function checkMail (mail)
{
var egrave = String.fromCharCode(232);
var eacute = String.fromCharCode(233);
var ecirc = String.fromCharCode(234);
var ocirc = String.fromCharCode(244);
if (mail.value == "")
	{
		if (errfound) return;
		window.alert("Veuillez indiquer votre adresse e-mail");
		mail.select();
		mail.focus();
		errfound = true;
	}
if ((mail.value.length <= 6) || (mail.value.indexOf('@',0) == -1) || (mail.value.indexOf('.',0) == -1))
	{
		if (errfound) return;
		window.alert("Votre adesse e-mail ne pr"+eacute+"sente pas un format valide. Merci de la contr"+ocirc+"ler");
		mail.select();
		mail.focus();
		errfound = true;

	}
}

function checkEstRempli (element, champ)
{
var egrave = String.fromCharCode(232);
var eacute = String.fromCharCode(233);
var ecirc = String.fromCharCode(234);
var ocirc = String.fromCharCode(244);
if (element.value == "")
	{
		if (errfound) return;
		window.alert("Le champ "+champ+" est obligatoire, merci de le compl"+eacute+"ter");
		element.select();
		element.focus();
		errfound = true;
	}
	
}
function checkEstRempliFile (element, champ)
{
var egrave = String.fromCharCode(232);
var eacute = String.fromCharCode(233);
var ecirc = String.fromCharCode(234);
var ocirc = String.fromCharCode(244);
if (element.value == "")
	{
		if (errfound) return;
		window.alert(champ+" est manquant. Ce champ doit contenir un fichier, merci de le compl"+eacute+"ter");
		element.select();
		element.focus();
		errfound = true;
	}
	
}

function checkEstNombre (element, champ)
{
var egrave = String.fromCharCode(232);
var eacute = String.fromCharCode(233);
var ecirc = String.fromCharCode(234);
var ocirc = String.fromCharCode(244);
if (isNaN(element.value))
	{
		if (errfound) return;
		window.alert("Le champ "+champ+" ne peut contenir que des chiffres, merci de le contr"+ocirc+"ler");
		element.select();
		element.focus();
		errfound = true;
	}
	
}
function checkEstSpecial (element, champ)
{
var egrave = String.fromCharCode(232);
var eacute = String.fromCharCode(233);
var ecirc = String.fromCharCode(234);
var ocirc = String.fromCharCode(244);
if (element.value == 0)
	{
		if (errfound) return;
		window.alert("Le "+champ+" indique une valeur de 0. Merci de v"+eacute+"rifier les montants saisis.");
		element.select();
		element.focus();
		errfound = true;
	}
	
}

function checkEstSelectionne (element, champ)
{
var egrave = String.fromCharCode(232);
var eacute = String.fromCharCode(233);
var ecirc = String.fromCharCode(234);
var ocirc = String.fromCharCode(244);
if (element[0].selected == true)
	{
		if (errfound) return;
		window.alert("Un "+eacute+"l"+eacute+"ment de la liste "+champ+" doit "+ecirc+"tre indiqu"+eacute+". Merci de faire votre choix");
		element[0].selected = true;
		element.focus();
		errfound = true;
	}
	
}

function checkEstCoche (element, nombre, champ)
{
var egrave = String.fromCharCode(232);
var eacute = String.fromCharCode(233);
var ecirc = String.fromCharCode(234);
var ocirc = String.fromCharCode(244);
var count = 0;
for (var i=0; i<nombre;i++)
	{
		if (document.getElementById(element+parseInt(i+1)).checked==true)
			{
				count = parseInt(count+1);
			}
	}
if (count == 0)	
	{
		if (errfound) return;
		window.alert("Au moins un "+eacute+"l"+eacute+"ment de type "+champ+" doit "+ecirc+"tre coch"+eacute+". Merci de compl"+eacute+"ter votre saisie");
		document.getElementById(element+"1").selected = true;
		document.getElementById(element+"1").focus();
		errfound = true;	
	}
}
function checkEstCocheV1 (element, nombre, champ)
{
var egrave = String.fromCharCode(232);
var eacute = String.fromCharCode(233);
var ecirc = String.fromCharCode(234);
var ocirc = String.fromCharCode(244);
var count = 0;
for (var i=0; i<nombre;i++)
	{
		if (document.getElementById(element+parseInt(i+1)).checked==true)
			{
				count = parseInt(count+1);
			}
	}
if (count == 0)	
	{
		if (errfound) return;
		window.alert("Merci de confirmer que tous les renseignements sont complets et exacts.");
		document.getElementById(element+"1").selected = true;
		document.getElementById(element+"1").focus();
		errfound = true;	
	}
}