This utility allows you to take a body of HTML code and turn it into a body of JavaScript code. Copy and paste your HTML code into the box on the left. Then click the convert button and in the box on the right you will get JavaScript code. You can then paste this into a JavaScript file. In JavaScript, you could say
menu =
and then paste in the results from the box on the right.

This utility is written in JavaScript. View the source code to see how it works. You might want to create a directory called "utilities" and copy the source from this page into that directory.