I would prefer that the code is in CODE tags and properly indented - I struggle to read it otherwise. (You need to close it with [/ CODE] (without the space).) And try and indicate where the problem is, rather than just supplying a mass of code.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity
." Me Myself & Irene
Validate your HTML