in reply to JS in a CGI: unable to find a solution
Though I am not a CGI expert, I have some recommendations. Firstly, you can try to edit your html code manually, to split your effort into getting your html-knowledge better and into your CGI knowledge. Secondly, your html problem is not really too much difficult, when you read something about SCRIPT element and /^onmouse/ events. I am using following spec,
http://www.w3.org/TR/REC-html40/
which is, imho, exact and human readable :) I prefer and advice to read a lot of specs rather than apply quick hack without real knowledge about it, because the spec reading lead us to know what we are doing...