Run your code through here, but back it up first:
HTML Tidy Online
That should at least clean up MOST of the cruft! And if you're wondering why no one's just giving you the answer, it's because there is no way to troubleshoot a page with invalid code. You need to get your code valid first, THEN we can help you.
You might want to give this code editor a try:
Amaya Home Page