function validEspaceProprietaires() {
	var errors = new Array();
	
	var nom = document.formEspaceProprietaires.elements['p_nom'].value;
	if(nom=="") {
		errors.push("Please specify your name");
	}

	var prenom = document.formEspaceProprietaires.elements['p_prenom'].value;
	if(prenom=="") {
		errors.push("Please specify your first name");
	}

	var telephone = document.formEspaceProprietaires.elements['p_tel_domicile'].value;
	if(telephone=="") {
		errors.push("Please specify your phone number");
	}

	var email = document.formEspaceProprietaires.elements['p_email'].value;
	if ( isValidEmail(email) == false ) {
		errors.push("Please specify a valid Email.");
	}

	var quartier = document.formEspaceProprietaires.elements['a_nom_quartier'].value;
	if(quartier=="") {
		errors.push("Please specify the name area");
	}

	var num_rue = document.formEspaceProprietaires.elements['a_numero_rue'].value;
	if(num_rue=="") {
		errors.push("Please specify the number in the street");
	}
	
	var rue = document.formEspaceProprietaires.elements['a_adresse'].value;
	if(rue=="") {
		errors.push("Please specify the street");
	}

	var cp = document.formEspaceProprietaires.elements['a_cp'].value;
	if(cp=="") {
		errors.push("Please specify the ZIP code");
	}

	var ville = document.formEspaceProprietaires.elements['a_ville'].value;
	if(ville=="") {
		errors.push("Please specify the city");
	}

	var nb_piece = document.formEspaceProprietaires.elements['a_nb_pieces'].value;
	if(nb_piece=="") {
		errors.push("How many rooms ?");
	}
	
	var surface = document.formEspaceProprietaires.elements['a_surface_fr'].value;
	if(surface=="") {
		errors.push("How many m2 ?");
	}

	var etage = document.formEspaceProprietaires.elements['a_etage'].value;
	if(etage=="") {
		errors.push("Please specify the floor");
	}
	
	if (errors.length>0) {

		var stringToDisplay="We can't accept this request : \n";

		for (var i=0;i<errors.length;i++) {
			stringToDisplay = stringToDisplay + "\n" + errors[i];
		}
		alert(stringToDisplay);
		return false;
	} 
	
	return true;
}

function isValidEmail(str) {
   return (str.indexOf(".") >= 1) && (str.indexOf("@") > 0);
}
