function ivalue(id)
{
	return(document.getElementById(id).value);
}

function formCheck()
{
	var errors = "";
	
	if(!ivalue("civ"))
	{
		errors += "Civilité\n";
	}
	if(!ivalue("name"))
	{
		errors += "Nom\n";
	}
	if(!ivalue("firstname"))
	{
		errors += "Prénom\n";
	}
	if(!ivalue("promo"))
	{
		errors += "Promotion\n";
	}
	if(!ivalue("ville"))
	{
		errors += "Ville\n";
	}
	if(!ivalue("departement"))
	{
		errors += "Code postal\n";
	}
	if(!ivalue("pays"))
	{
		errors += "Pays\n";
	}
	if(!ivalue("mail"))
	{
		errors += "Adresse e-mail\n";
	}
	if(!ivalue("password"))
	{
		errors += "Mot de passe\n";
	}
	if(!ivalue("pass_confirm"))
	{
		errors += "Confirmation du mot de passe\n";
	}
	
	if(errors)
	{
		alert("Attention, les champs suivants sont obligatoires : \n\n"+errors);
		return(false);
	}
	else
	{
		if(ivalue("password") != ivalue("pass_confirm"))
		{
			alert("Le mot de passe et sa confirmation ne correspondent pas.");
			return(false);
		}
	}
	
	return(true);
}

function formCheck2()
{
	var errors = "";
	
	if(!ivalue("civ"))
	{
		errors += "Civilité\n";
	}
	if(!ivalue("name"))
	{
		errors += "Nom\n";
	}
	if(!ivalue("firstname"))
	{
		errors += "Prénom\n";
	}
	if(!ivalue("promo"))
	{
		errors += "Promotion\n";
	}
	if(!ivalue("ville"))
	{
		errors += "Ville\n";
	}
	if(!ivalue("departement"))
	{
		errors += "Code postal\n";
	}
	if(!ivalue("pays"))
	{
		errors += "Pays\n";
	}
	if(!ivalue("mail"))
	{
		errors += "Adresse e-mail\n";
	}
	
	if(errors)
	{
		alert("Attention, les champs suivants sont obligatoires : \n\n"+errors);
		return(false);
	}
	else
	{
		if(ivalue("password") != ivalue("pass_confirm"))
		{
			alert("Le mot de passe et sa confirmation ne correspondent pas.");
			return(false);
		}
	}
	
	return(true);
}
