// JavaScript Document
    var Overlay = {
        Build : 1,
        Speed : 100,
        FadeOn : 0.8,
        Init : function() {
          $('#overlay').fadeTo(Overlay.Speed, 0);
        },
        Show : function() {
          $('#overlay').show(function() {
            $(this).fadeTo(Overlay.Speed, Overlay.FadeOn);
            });
        },
        Hide : function() {
          $('#overlay').fadeTo(Overlay.Speed, 0, function() {
            $(this).hide();
          })
        }        
      }

// AJAX TERRAINS LISTE
function GetTerrainsList(pos) {
	$.post(
		'/ajax/terrains_liste.html',
		{
			'pos':pos
		}, function(data) {
			$('#content_mod').html(data);
		}, 'html');
}

$(document).ready(function() {
	Overlay.Init();
});

var Formulaire = {
	Send : function() {
		Overlay.Show();
		$.post(
			'formulaire.php',
			{
				'nom' : $('#nom').val(),
				'prenom' : $('#prenom').val(),
				'email' : $('#email').val(),
				'nombre' : $('#nombre').val(),
				'depart' : $('#depart').val(),
				'retour' : $('#retour').val(),
				'commentaires' : $('#commentaires').val(),
			}, function(data) {
				if (data.Code == 1) {
					alert(data.Message);
					Overlay.Hide();
				}
				if (data.Code == 0) {
					$("#overlay_up").show();
				}				
			}, 'json'
		)
		return false;
	}
}
