Er, one of the main problems is that you're echoing the <script> stuff before the DOCTYPE there. That's going to generate some god-awful mess for the HTML parser. You need to echo that <script> stuff somewhere in the <head>.

Also, don't use the "language" attribute for the <script> element.

And the <center> and <font> tags are deprecated (plus they're markup for display, so should end up in the <body>). So is the "align" attribute.

Once you fix all these issues then your problem may go away, otherwise we can only take it from there.