a simple javascript to generate table of contents in webpages