$(document).ready(function () {
      $(".calendar").load("calendar/index.php");
      $("#btn_create").click(function(){
        $(".match").load("calendar/creer_match.php",{},function(){
          $("#datepicker").datepicker($.extend({}, 
          $.datepicker.regional["fr"], { 
              firstDay: 1, 
              changeFirstDay: false, 
              showStatus: true, 
              dateFormat: "yy-mm-dd",
              showOn: "both", 
              buttonImage: "calendar/images/calendar.png", 
              buttonImageOnly: true 
          }));
        });       
      });
      $("#btn_modif").click(function(){
        $(".match").load("calendar/modif_match.php",{},function(){
            $("form.modif").submit(function() {    
              alert("av submit");
              s = $(this).serialize(); 
              $.ajax({ 
                  type: "POST", 
                  data: s, 
                  url: $(this).attr("action"), 
                  success: function(retour){ 
                      $("match").empty().append(retour); 
                  } 
              }); 
              return false; 
          });
        }
        )});
        $("#btn_stat").click(function(){
        $(".match").load("calendar/stat.php",{},function(){
        }
        )});
});

function affichMatch(id) {
	$(".match").load("calendar/match.php?id="+id);
}

