$(window).load( function(){
    
    $("#pole a").click(function() {
        
        var page = $(this).attr("href");
        
        $.ajax ({
           
           url:"poles/"+page,
           cache:false,
           success:function(html) {
                afficher(html);
           },
            error:function(XMLHttpRequest, textStatus, errorThrown) {
                alert(textStatus);
            }
           
            
        })
        
        return false;
    });
    
    $("#pougne a").click(function() {
        
       var ecole = $(this).parent("p").attr("id");
       var cat = $(this).attr("href");
       
       $.get("pougne.php", {ecole:ecole, cat:cat}, function(data) {
            afficherP(data);
        
       });
       
       
       
        
        return false;
    });
        
    
});

function afficherP(data) {
    $("#pougne .droite").fadeOut(200, function() {
            $("#pougne .droite").empty();
            $("#pougne .droite").append(data);
            $("#pougne .droite").fadeIn(400);
        })
    
}

function afficher(data) {
    $("#liste .contenu").fadeOut(200, function() {
            $("#liste .contenu").empty();
            $("#liste .contenu").append(data);
            $("#liste .contenu").fadeIn(400);
        })
    
}

