// JavaScript Document
  function ctr_form_main(theForm) 
  {  
	if (theForm.date_depart.value.length == 0)
	{
		alert("Les champs marqué * sont obligatoires !");
		theForm.date_depart.focus();
		return false;
	}
	if ( !isValidDate(theForm.date_depart.value) )
	{
		alert(theForm.date_depart.value);
		alert("Format date invalide !\n\nExemple de date : 01/02/2003\nLes jours et les mois sont sur deux chiffres.");
		theForm.date_depart.focus();
		return false;
	}
	if (theForm.heure_depart.value == -1 )
	{
		alert("Les champs marqué * sont obligatoires !");
		theForm.heure_depart.focus();
		return false;
	}
	if (theForm.heure_depart.value < 0 || theForm.heure_depart.value >23)
	{
		alert("Heure de départ incorrecte");
		theForm.heure_depart.focus();
		return false;
	}
	if (theForm.minute_depart.value == -1)
	{
		alert("Les champs marqué * sont obligatoires !");
		theForm.minute_depart.focus();
		return false;
	}
	if (theForm.minute_depart.value < 0 || theForm.minute_depart.value > 59)
	{
		alert("Minute de départ incorrecte");
		theForm.minute_depart.focus();
		return false;
	}
	if (theForm.type_lieu_source.value == -1)
	{
		alert("Les champs marqué * sont obligatoires !");
		theForm.type_lieu_source.focus();
		return false;
	}
	
	if (theForm.ville_source.value == -1)
	{
		alert("Les champs marqué * sont obligatoires !");
		theForm.ville_source.focus();
		return false;
	}
	
	//###source
	//#####aeroport
	//provenance src
	if (theForm.prov_aero_source && theForm.prov_aero_source.value.length == 0)
	{
		alert("Les champs marqué * sont obligatoires !");
		theForm.prov_aero_source.focus();
		return false;
	}
	//heure arrive src
	if (theForm.heur_arrv_aeuro_source && theForm.heur_arrv_aeuro_source.value.length == 0)
	{
		alert("Les champs marqué * sont obligatoires !");
		theForm.heur_arrv_aeuro_source.focus();
		return false;
	}
	//minute arrive src
	if (theForm.mm_arrv_aeuro_source && theForm.mm_arrv_aeuro_source.value.length == 0)
	{
		alert("Les champs marqué * sont obligatoires !");
		theForm.mm_arrv_aeuro_source.focus();
		return false;
	}
	//###gare
	//provenance
	if (theForm.prov_garre_source && theForm.prov_garre_source.value.length == 0)
	{
		alert("Les champs marqué * sont obligatoires !");
		theForm.prov_garre_source.focus();
		return false;
	}
	//heure arrive src
	if (theForm.heur_arrv_garre_source && theForm.heur_arrv_garre_source.value.length == 0)
	{
		alert("Les champs marqué * sont obligatoires !");
		theForm.heur_arrv_garre_source.focus();
		return false;
	}
	//minute arrive src
	if (theForm.mm_arrv_garre_source && theForm.mm_arrv_garre_source.value.length == 0)
	{
		alert("Les champs marqué * sont obligatoires !");
		theForm.mm_arrv_garre_source.focus();
		return false;
	}
	//##defence
	//####
	if (theForm.rais_sos_source && theForm.rais_sos_source.value.length == 0)
	{
		alert("Les champs marqué * sont obligatoires !");
		theForm.rais_sos_source.focus();
		return false;
	}

if (theForm.type_lieu_destination.value == -1)
	{
		alert("Les champs marqué * sont obligatoires !");
		theForm.type_lieu_destination.focus();
		return false;
	}
	if (theForm.ville_destination.value == -1)
	{
		alert("Les champs marqué * sont obligatoires !");
		theForm.ville_destination.focus();
		return false;
	}
	return calculDistance(getValFormElemnt('ville_source'),getValFormElemnt('ville_destination'));
  }

