Well, it was just a suggestion to get you started on the code . You will have to adapt it to your version and make it work for your purpose .
cheers,