Honestly, I'd just suggest you start by reading a tutorial on CGI, or something like that.
That is not a CGI script, that's plain HTML.
That is not a .js (Javascript) file, that's Perl, except with <p> tags before each line. It appears to be meant to generate your javascript, but then I'd ask why. It's static anyway, right? Then there's no need for it.