phptrouble,
I really don't mean to sound condescending, and if it comes off that way, I apologize.
You really need to learn a little more about programming fundamentals and the difference between client-side scripting and server-side scripting.
You do not have to echo a single statement to get a php page to output HTML. Of course, you can't include straight HTML code inside php tags (<?php and ?>), but if you took a complete .html file, and renamed it with a .php extension, it would still work.
You do understand that at least, don't you?
As far as your code goes, you need to take it ALL out of the echo statements, and out of the <?php and ?> tags, and just type it in the same way you would do in an .html file.
Because this is not related in any way to PHP, you need to ask this question in a Javascript forum. There are many around, do a search on google.