This also would work, and probably less code. Check out my other post for the code I had, I implemented what jafal had sent.