Let me know if this works.

I notice you have a bit of what appears to be javascript mixed in there of which I have virtually zero knowledge of, so I may have escaped too many quotes.


<?php...