function setuplinks(urltoload) {
    
      // Set the parent div's height to avoid jumpin
      $("#media_new").height($("#media_listing").height());
    
      $(".pager a").click(function() {
          
          myregexp = new RegExp(/^(.*)page([0-9]+)\.html/);
          page_number = myregexp.exec(this.href);
          //alert(page_number[2]);
          
          
          $("#media_listing").fadeOut("normal", function() {
              
              $.ajax({
                url: urltoload,
                data: "page="+page_number[2],
                success: function(html){
                  $("#media_listing").html(html);
                   $("#media_listing").fadeIn("normal", function() {
                       setuplinks(urltoload);
                       
                   });
                }
              });
              
          });
          
          return false;
      });
      
  }
