// Code page Contact

// Vérification si le champs est rempli
function fct_is_not_empty(fld) {
	if(fld.value.length > 0) {
		var nonwhitespace = 0;
		var c;
		for (i = 0; i < fld.value.length; i++) {
			c = fld.value.charAt(i);
			if (c.indexOf(" ") == -1) { 
				nonwhitespace++;
			}
		}
		if(nonwhitespace > 0) {
			return true;
		} else {
			return false;
		}
	} else {
	return false;
	}
}


// Affichage d'un message si il y a une erreur
function fct_message(fld,msg) {
alert("Une erreur a ete detectee: \n" + msg);
fld.focus();
}

// Validation du formulaire de contact
function fct_validate_1(frm) {
var nom = frm.Nom;
var prenom = frm.Prenom;
var email = frm.Email;
var adresse = frm.Adresse;
var titre = frm.Titre;
var contenu = frm.Contenu;
var expmail = new RegExp("^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$/g");

if(fct_is_not_empty(nom) == false) {
	fct_message(nom,"Votre nom est obligatoire");
	return false;
	}
if(fct_is_not_empty(prenom) == false) {
	fct_message(prenom,"votre prenom est obligatoire");
	return false;
}
if(fct_is_not_empty(adresse) == false) {
	fct_message(adresse,"votre adresse est obligatoire");
	return false;
}
if(fct_is_not_empty(email) == false) {
	fct_message(email,"Votre e-mail est obligatoire");
	return false;
}
if(email.value.indexOf('@') == -1){
	fct_message(email,"Veuillez entrer un email correct!"); // email doit contenir un @
	return false;
}
/*
if(fct_is_not_empty(confirmation) == false) {
	fct_message(confirmation,"Veuillez confirmer votre e-mail");
	return false;
}
if(confirmation.value.indexOf(email.value) == -1) { // la confirmation doit etre le meme que l'email
	fct_message(confirmation,"Mauvaise confirmation");
	return false;
}
*/
if(fct_is_not_empty(titre) == false) {
	fct_message(titre,"Veuillez entrer le titre de votre message.");
	return false;
}

if(fct_is_not_empty(contenu) == false) {
	fct_message(contenu,"Veuillez entrer votre message.");
	return false;
}

alert("Votre message est envoye !");
frm.submit();
}

//Pop up itinéraire
function fctopenItineraire() {
var w = 640;
var h = 570;
var mywin = window.open('popup_itineraire.html', 'MyPopUp', 'menubar=no,scrollbars=no,width=' + w + ',height=' + h + ',resizable=no');
var posX = (window.screen.width/2) - (w/2);
var posY = (window.screen.height/2) - (h/2);
mywin.moveTo(posX,posY);
}
function fctopenSoinsVisages() {
var w = 560;
var h = 400;
var mywin = window.open('tarif/soins_visages.php', 'MyPopUp', 'menubar=no,scrollbars=yes,width=' + w + ',height=' + h + ',resizable=no');
var posX = (window.screen.width/2) - (w/2);
var posY = (window.screen.height/2) - (h/2);
mywin.moveTo(posX,posY);
}
function fctopenSoinsCorpsAmincissants() {
var w = 560;
var h = 400;
var mywin = window.open('tarif/soins_corps_amincissants.php', 'MyPopUp', 'menubar=no,scrollbars=yes,width=' + w + ',height=' + h + ',resizable=no');
var posX = (window.screen.width/2) - (w/2);
var posY = (window.screen.height/2) - (h/2);
mywin.moveTo(posX,posY);
}
function fctopenSoinsCorpsRelaxants() {
var w = 560;
var h = 400;
var mywin = window.open('tarif/soins_corps_relaxants.php', 'MyPopUp', 'menubar=no,scrollbars=yes,width=' + w + ',height=' + h + ',resizable=no');
var posX = (window.screen.width/2) - (w/2);
var posY = (window.screen.height/2) - (h/2);
mywin.moveTo(posX,posY);
}
function fctopenSoinsMaquillage() {
var w = 560;
var h = 400;
var mywin = window.open('tarif/soins_maquillage.php', 'MyPopUp', 'menubar=no,scrollbars=yes,width=' + w + ',height=' + h + ',resizable=no');
var posX = (window.screen.width/2) - (w/2);
var posY = (window.screen.height/2) - (h/2);
mywin.moveTo(posX,posY);
}
function fctopenSoinsMaquillagePermanent() {
var w = 560;
var h = 400;
var mywin = window.open('tarif/soins_maquillage_permanent.php', 'MyPopUp', 'menubar=no,scrollbars=yes,width=' + w + ',height=' + h + ',resizable=no');
var posX = (window.screen.width/2) - (w/2);
var posY = (window.screen.height/2) - (h/2);
mywin.moveTo(posX,posY);
}
function fctopenSoinsEpilations() {
var w = 560;
var h = 400;
var mywin = window.open('tarif/soins_epilations.php', 'MyPopUp', 'menubar=no,scrollbars=yes,width=' + w + ',height=' + h + ',resizable=no');
var posX = (window.screen.width/2) - (w/2);
var posY = (window.screen.height/2) - (h/2);
mywin.moveTo(posX,posY);
}
function fctopenSoinsBeaute() {
var w = 560;
var h = 400;
var mywin = window.open('tarif/soins_beaute.php', 'MyPopUp', 'menubar=no,scrollbars=yes,width=' + w + ',height=' + h + ',resizable=no');
var posX = (window.screen.width/2) - (w/2);
var posY = (window.screen.height/2) - (h/2);
mywin.moveTo(posX,posY);
}
function fctopenSoins() {
var w = 560;
var h = 400;
var mywin = window.open('tarif/soins.php', 'MyPopUp', 'menubar=no,scrollbars=yes,width=' + w + ',height=' + h + ',resizable=no');
var posX = (window.screen.width/2) - (w/2);
var posY = (window.screen.height/2) - (h/2);
mywin.moveTo(posX,posY);
}
function fctopenPlaisir() {
var w = 560;
var h = 400;
var mywin = window.open('tarif/plaisir.php', 'MyPopUp', 'menubar=no,scrollbars=yes,width=' + w + ',height=' + h + ',resizable=no');
var posX = (window.screen.width/2) - (w/2);
var posY = (window.screen.height/2) - (h/2);
mywin.moveTo(posX,posY);
}
function fctopenRemise() {
var w = 560;
var h = 400;
var mywin = window.open('tarif/remise.php', 'MyPopUp', 'menubar=no,scrollbars=yes,width=' + w + ',height=' + h + ',resizable=no');
var posX = (window.screen.width/2) - (w/2);
var posY = (window.screen.height/2) - (h/2);
mywin.moveTo(posX,posY);
}
function fctopenMariee() {
var w = 560;
var h = 400;
var mywin = window.open('tarif/mariee.php', 'MyPopUp', 'menubar=no,scrollbars=yes,width=' + w + ',height=' + h + ',resizable=no');
var posX = (window.screen.width/2) - (w/2);
var posY = (window.screen.height/2) - (h/2);
mywin.moveTo(posX,posY);
}
function fctopenDetente() {
var w = 560;
var h = 400;
var mywin = window.open('tarif/detente.php', 'MyPopUp', 'menubar=no,scrollbars=yes,width=' + w + ',height=' + h + ',resizable=no');
var posX = (window.screen.width/2) - (w/2);
var posY = (window.screen.height/2) - (h/2);
mywin.moveTo(posX,posY);
}
function fctopenEnergie() {
var w = 560;
var h = 400;
var mywin = window.open('tarif/energie.php', 'MyPopUp', 'menubar=no,scrollbars=yes,width=' + w + ',height=' + h + ',resizable=no');
var posX = (window.screen.width/2) - (w/2);
var posY = (window.screen.height/2) - (h/2);
mywin.moveTo(posX,posY);
}
function fctopenSilhouette() {
var w = 560;
var h = 400;
var mywin = window.open('tarif/silhouette.php', 'MyPopUp', 'menubar=no,scrollbars=yes,width=' + w + ',height=' + h + ',resizable=no');
var posX = (window.screen.width/2) - (w/2);
var posY = (window.screen.height/2) - (h/2);
mywin.moveTo(posX,posY);
}
function fctopenCheque() {
var w = 800;
var h = 333;
var mywin = window.open('cheque.php', 'MyPopUp', 'menubar=no,scrollbars=no,width=' + w + ',height=' + h + ',resizable=no');
var posX = (window.screen.width/2) - (w/2);
var posY = (window.screen.height/2) - (h/2);
mywin.moveTo(posX,posY);
}
function fctopenForfaits() {
var w = 560;
var h = 400;
var mywin = window.open('tarif/forfaits.php', 'MyPopUp', 'menubar=no,scrollbars=yes,width=' + w + ',height=' + h + ',resizable=no');
var posX = (window.screen.width/2) - (w/2);
var posY = (window.screen.height/2) - (h/2);
mywin.moveTo(posX,posY);
}
function fctopenPartenaire() {
window.open('http://www.capequilibre.be', 'MyPopUp', 'menubar=yes,scrollbars=yes,width=' + w + ',height=' + h + ',resizable=yes');
}
function fct_validate_2(frm) {
	window.open('http://www.capequilibre.be');
	frm.submit();
}

