/* ------------------------------------------------------------------------
	Send mail
------------------------------------------------------------------------- */

	$(document).ready(function(){
		$('#newsletter').submit(function(){
			if(validateEmail($(this).find('#email').val())){
				$.post($(this).attr('action'),$(this).serialize(),function(data,status){
					if(status == 'success'){
						$('.error').hide();
						$('#newsletter #email').val('Merci!');
					}else{
						$('.error').show();
					}
				});
			}else{
				$('.error').show();
			}
		}).find('#email').focus(function(){ $(this).val(''); });
	});
	
	function validateEmail(email){
	 	var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
	 	return email.match(re)
	}