var index = 0; function write_figure_footer() { document.write("Figure " + ++index + ". "); } function write_footer() { document.write("