this is the function i have been looking for. thanks a lot for sharing this. i will download it for future