What you want isn't that simple, you see. I have suggested you the basics that you should try tackle first. Split the problem into smaller ones. See my previous post.
Or... if anyone is reading this and got some free time, could you please give this gentleman here a hand?