Ahhh I see, sorry I thought you just meant the type needed to be in alphabetical order (as you did not specify).
I'm sure you could modify the code I posted to incorporate such functionality but I am not quite sure how and I'm afraid I havent got time at the moment to have a play around