+ var chapter_li = $('<li/>').append(
+ $('<a/>').attr({
+ href: chapter_url,
+ title: chapter_title
+ }).text(chapter_id + '. ' + chapter_title), $('<ul/>').hide()).appendTo($ul);
+ });
+
+ $('#toc img').fadeIn('slow', function () {
+ // Add the main list back to the DOM
+ $ul.removeClass('hidden').css('visibility', 'hidden').appendTo('#toc').css('left', '-' + $ul.width() + 'px').css('visibility', 'visible');
+ $('#toc > img').mousedown(click_func);
+ $('#toc > ul').click(click_func);
+ $('#toc a').click(function (e) {
+ e.stopPropagation()
+ });
+ });
+ });
+})(jQuery);
\ No newline at end of file