1. You have to use Code tags while posting code snippets. Otherwise your code is unreadable.
  2. What problem with this code (and where) do you have?