if(!VVF.validation) {
	VVF.validation = {};
}

VVF.validation['sendtofriendForm'] = {
	header: 'Le formulaire contient au moins une erreur (champ omis ou non valide). Toute erreur est indiquée en italique et en rouge à côté du champ concerné.',
	SendToFirstnameFrom: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	SendToFirstnameTo: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	SendToMessage: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	SendToEmailFrom: {
		rule: /^\s*[\w-]+(\.[\w-]+)*@([\w-]+\.)+[A-Za-z]{2,7}\s*$/,
		msg: 'Le format de l\'email n\'est pas valide'
	},	
	SendToEmailTo: {
		rule: /^\s*[\w-]+(\.[\w-]+)*@([\w-]+\.)+[A-Za-z]{2,7}\s*$/,
		msg: 'Le format de l\'email n\'est pas valide'
	}	
};

VVF.validation['parrainageForm'] = {
	header: 'Le formulaire contient au moins une erreur (champ omis ou non valide). Toute erreur est indiquée en italique et en rouge à côté du champ concerné.',
	ParrainNomFilleul: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	ParrainPrenomFilleul: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	ParrainEmailFilleul: {
		rule: /^\s*[\w-]+(\.[\w-]+)*@([\w-]+\.)+[A-Za-z]{2,7}\s*$/,
		msg: 'Le format de l\'email n\'est pas valide'
	}	
};

VVF.validation['bookingForm'] = {
	header: 'Le formulaire contient au moins une erreur (champ omis ou non valide). Toute erreur est indiquée en italique et en rouge à côté du champ concerné.',
	BookingConsiderNextDateDay: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	BookingConsiderStayLength: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	BookingConsiderLocation1: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	BookingCivility: {
		msg: 'Champ obligatoire'
	},
	BookingSurName: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	BookingFirstName: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	BookingAddress: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	BookingCity: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	BookingZipCode: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	BookingCountry: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},	
	BookingEmail: {
		rule: /^\s*[\w-]+(\.[\w-]+)*@([\w-]+\.)+[A-Za-z]{2,7}\s*$/,
		msg: 'Le format de l\'email n\'est pas valide'
	}
};

VVF.validation['bookingPhase3Form'] = {
	header: 'Le formulaire contient au moins une erreur (champ omis ou non valide). Toute erreur est indiquée en italique et en rouge à côté du champ concerné.'
};

VVF.validation['contactForm'] = {
	header: 'Le formulaire contient au moins une erreur (champ omis ou non valide). Toute erreur est indiquée en italique et en rouge à côté du champ concerné.',
	ContactIdQuestion: {
		msg: 'Champ obligatoire'
	},
	ContactQuestionObj: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	ContactQuestionMsg: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	ContactCivility: {
		msg: 'Champ obligatoire'
	},
	ContactSurName: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	ContactFirstName: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	ContactAddress: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	ContactCity: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	ContactZipCode: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	ContactCountry: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},	
	ContactEmail: {
		rule: /^\s*[\w-]+(\.[\w-]+)*@([\w-]+\.)+[A-Za-z]{2,7}\s*$/,
		msg: 'Le format de l\'email n\'est pas valide'
	}
};

VVF.validation['accountCreationForm'] = {
	header: 'Le formulaire contient au moins une erreur (champ omis ou non valide). Toute erreur est indiquée en italique et en rouge à côté du champ concerné.',
	CustomerCivility: {
		msg: 'Champ obligatoire'
	},
	CustomerSurName: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	CustomerFirstName: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	CustomerAddress: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	CustomerBirthDay: {
	    rule: /^(([0-2]?[0-9])|(3[0-1]))$/,
		msg: 'Champ obligatoire'
	},
	CustomerBirthMonth: {
	    rule: /^([0-1]?[0-9])$/,
		msg: 'Champ obligatoire'
	},
	CustomerBirthYear: {
	    rule: /^(19[0-9]?[0-9])$/,
		msg: 'Champ obligatoire'
	},
	CustomerCity: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	CustomerZipCode: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	CustomerNickName: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	CustomerPassword: {
		rule: /^.{7,}$/,
		msg: 'Champ obligatoire'
	},
	CustomerPasswordConfirm: {
		rule: function(value) {
		    return value != document.forms[0].elements['CustomerPassword'].value;
		},
		msg: 'La confirmation du mot de passe est incorrecte'
	},
	CustomerCountry: {
		rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},	
	CustomerEmail: {
		//rule: /^\s*[\w-]+(\.[\w-]+)*@([\w-]+\.)+[A-Za-z]{2,7}\s*$/,
		rule: /^[a-z0-9._-]+@[a-z0-9.-]{2,}[.][a-z]{2,3}$/,
		msg: 'Le format de l\'email n\'est pas valide'
	}
};

VVF.validation['accountCreationStep2Form'] = {
	CustomerTelMobile2: {
	    rule: function(value) {
	        if (document.getElementById('fSMSOffers').checked) {
	            return /^\s*$/.test(value);
	        }
	        return false;
	    },
	    msg: 'Numéro de mobile obligatoire pour l\'envoi par SMS'
	}
};

VVF.validation['bookingToolForm'] = {
	DevisClubRegion: {
	    rule: /^\S+.*\S+$/,
		msg: 'Champ obligatoire'
	},
	DevisStartDateDay: {
	    rule: /^\d{1,2}$/,
		msg: 'Champ obligatoire'
	},
	DevisStartDateMonth: {
	    rule: /^\d{1,2}$/,
		msg: 'Champ obligatoire'
	},
	DevisStartDateYear: {
	    rule: /^\d{4}$/,
		msg: 'Champ obligatoire'
	}
};
