//fonction  de contrôle de validité des inputs :				
			function inputControl(id)
				{
				var d = id.getAttribute('name') + 'Control';
				if ((id.getAttribute('name') != 'email') && (id.getAttribute('name') != 'code_postal'))
					{
					if (id.value == '')
						{
						id.style.background = '#ff8888';
						document.getElementById(d).style.display = 'block';
						return false;
						}
					else
						{
						id.style.background = '#ffffff';
						document.getElementById(d).style.display = 'none';
						return true;
						}
					}
				else
					{
					if (id.getAttribute('name') == 'email')
						{
						var mail = id.value;
						var re = new RegExp("^([a-zA-Z0-9_-])+([.]?[a-zA-Z0-9_-]{1,})*@([a-zA-Z0-9_-]{2,}[.])+[a-zA-Z]{2,3}$");
						if (!re.test(mail))
							{
							id.style.background = '#ff8888';
							document.getElementById(d).style.display = 'block';
							return false;
							}
						else
							{
							id.style.background = '';
							document.getElementById(d).style.display = 'none';
							return true;
							}
						}
					else
						{
						var cp = id.value;
						var re = new RegExp("^[0-9]{5}$");
						if (!re.test(cp))
							{
							id.style.background = '#ff8888';
							document.getElementById(d).style.display = 'block';
							return false;
							}
						else
							{
							id.style.background = '';
							document.getElementById(d).style.display = 'none';
							return true;
							}
						}
					}
				}

//fontion de contrôle de validité du formualaire et soumission :				
			function submitForm()
				{
				var validName = (inputControl(document.forms[0]['nom']));
				var validMail = (inputControl(document.forms[0]['email']));
				var validMessage = (inputControl(document.forms[0]['code_postal']));
				var validForm = validName && validMail && validMessage;
				return validForm;
				}