Please surround your code with highlight tags. If you don't know how to, see my signature block.

Have you tried this on a simpler webpage/javascript program? Try to get it working on a smaller...