Sort:  

Sorry about the poor quality but here is a picture image of the code. I found it through a google search months ago. There is probably better/easier ways but this works for me and I haven't had the inclination to look for anything better. Good luck. :)

pic.png