I have a javascript that works perfectly when I executed on a static HTML page.

That same javascript, placed in an external JS file, and js link imbedded in the <head> of a wordpress page it doesn't work.

I've tried removing Whitespace. Also disabled wordpress auto formatting. Still no luck.

The code works perfectly outside of Wordpress.

Any ideas how to fix?

P.S. I posted the code here: