The code you've posted is virtually unreadable. Please format your code with line breaks and indentations to make it more readable. Once you have formatted it, surround it with UBB code tags. By this, I mean [ c o d e ] and [ / c o d e ]. This will preserve the formatting in the post.
*Note, I put extra spaces in the tags above so they wouldn't be interpretted as real UBB tags. You should remove them when you put them in your post.