﻿$(document).ready(function() {

    $('h3').each(function (i) {
        // add link to the current header
        $('#anchor_links').append('<li><a href="#h3' + i + '">' + this.innerHTML + '</a></li>');
        
        // add an anchor to the header to link to
        $(this).append('<a name="h3' + i + '"/>');
    });

});