This problem has been seen and solved many times. You could begin by looking at this thread and modifying it for your needs.
This problem has been seen and solved many times. You could begin by looking at this thread and modifying it for your needs.