// JavaScript Document
function checkPage1(theForm){
	var firstError = null;
	var count 	= 0;
	var why 	= "";

	if (theForm.studyhours.value == ''){
		why += "- Vous n'avez pas spécifié un nombre d'heures d'étude par semaine.\n";
		if (firstError == null) firstError = theForm.studyhours;
	}
	if (theForm.prenom.value == ''){
		why += "- Vous n'avez pas spécifié votre prénom.\n";
		if (firstError == null) firstError = theForm.prenom;
	}
	if (theForm.nom.value == ''){
		why += "- Vous n'avez pas spécifié votre nom.\n";
		if (firstError == null) firstError = theForm.nom;
	}
	if (!theForm.sexe[0].checked && !theForm.sexe[1].checked){
		why += "- Vous n'avez pas spécifié votre sexe.\n";
		if (firstError == null) firstError = theForm.sexe[0];
	}
	if (theForm.ville.value == ''){
		why += "- Vous n'avez pas spécifié votre ville.\n";
		if (firstError == null) firstError = theForm.ville;
	}
	if (theForm.tel_maison.value == '' && theForm.tel_travail.value == ''){
		why += "- Vous n'avez pas spécifié votre numéro de téléphone.\n";
		if (firstError == null) firstError = theForm.tel_maison;
	}
	if (theForm.profession.value == ''){
		why += "- Vous n'avez pas spécifié votre profession.\n";
		if (firstError == null) firstError = theForm.profession;
	}
	if (theForm.resume.value == ''){
		why += "- Vous n'avez pas fourni un résumé de vos études.\n";
		if (firstError == null) firstError = theForm.resume;
	}
	if (!checkEmail(theForm.courriel.value)){
		why += "- Vous n'avez pas spécifié un courriel valide.\n";
		if (firstError == null) firstError = theForm.courriel;
   	}
	if (theForm.courriel.value != theForm.courriel2.value){
		why += "- Vous n'avez pas rentré la même adresse email deux fois.\n";
		if (firstError == null) firstError = theForm.courriel;
   	}
	if (why != ""){
		errorMsg = "Les erreurs suivantes on été détectées:\n\n" + why;
		alert(errorMsg);
		if (firstError != null) firstError.focus();
		return false;
	}
	return true;
}
