function toggle() {$('#fbox_cont').slideToggle();}

function loadall() {

  $.ajax({
     type: "POST",
     url: "ajax.php",
     timeout: 8000,
     data: "action=loadflyer&url=all",
     dataType: "json",
     error: function(){
       
       $("#flist").addClass("clean-error");
       $("#list").html("Error displaying previous flyers, please try again");
       $("#flist").fadeIn();
       
     },  
     success: function(jsonObj){
       
       $("#flist").hide();
       $("#flist").html(jsonObj.html);
       $("#flist").fadeIn("slow");
     }
   });
}

function loadFlyer(url) {
  
  $.ajax({
     type: "POST",
     url: "ajax.php",
     timeout: 8000,
     data: "action=loadflyer&url=" + url,
     dataType: "json",
     error: function(){
       
       $("#fbox_cont").addClass("clean-error");
       $("#fbox_cont").html("Error displaying flyer");
       $("#fbox_cont").fadeIn();
       
     },  
     success: function(jsonObj){
            
       $("#fbox_cont").show();
       $("#fbox").html(jsonObj.html);
       $("#fbox").fadeIn("slow");

     }
   });
}



