First of all, look here:
Look especially at rule 1.5.
If you make some realistic effort at doing your homework and come here asking for help getting past a bug or two, you'll likely get help.
But in this case... There's just no real code there that we can critique. We'd have to start all over.
I'm sorry, but it looks to me like you are just throwing code against a wall hoping that some of it may stick.