It is reccommended that you DO NOT put javascript or a great amount of HTML within the PHP tags and echoing it.

I would use RV's first example