$(document).ready(function () {
    $("a.footnote-reference").click(function() {
        var index = parseInt($(this).text());
        var noterow = $('table.footnote tr')[index-1];
        var notetd = $(noterow).children('td')[1];
        var note = $(notetd).html();
        var newnote = $("<div/>").addClass("inline-footnote").hide().html(note);
        $(this).parent().after(newnote);
        newnote.slideDown();
        $(this).unbind("click");
    });
    $("table.footnote").hide();
});