What do you want to get out of random distribution of treasure? From a player's perspective, it adds nothing and can often subtract a lot from the game ("Why didn't this superintelligent bad guy use this powerful magic item against the party that was trying to kill him?" etc.)
I know I mentioned this in another thread, but I'll say it again. I've worked up a random treasure generator for my own use. It works perfectly, but I'm having some database issues (namely the connection string), that I'm kinda lazy to fix, as it works for me. Now that I see other people are looking for something similar, I may go back and see if I can fix it up for other to use. Either that or make a web version. I've got next week off, so I'll see what I can do, maybe.
I found this link today, I think this is what you are looking for?
http://home.dralenan.com/dscript/rodent.html
At first I thought I had been completely beaten to the punch. But mine is a little more "advanced". Mine builds the complete treasure list, including gold and potions, and compiles it all into a list of parcels. I guess I can't continue to be lazy if you guys/gals want something a little more "complete".