There is a thread on random orders random sorting perhaps you can adapt some of the remarks to your requirements.