$(document).ready(function($) {
    
  var page = 1;
  var items_per_page = 15;
  $pagenum = $("#pagenum");
  
  $("#scrollable").scrollable();
  
  $(".tn").click(function(e) {
    e.preventDefault();
    var $t = $(this);
    var href = $t.attr("href");
    if ( href.indexOf("http") != -1 ) href = href.replace(/^[^\/]*(?:\/[^\/]*){2}/, "")
    var $p = $(".post:first");
    $p.append("<div class='newentry'></div>");
    $(".newentry:last").load(href + " .entry:first", function(e){
        $p.find("div:first").fadeOut("slow", function(){
            $(this).remove();
            $p.find("div:first").fadeIn("slow");
        });
        try {
            history.replaceState("", "", href);
        } catch (err) {
            return false;
        }
    });

  });
  

})
