I honestly don't know a good library of functions, but there are engines out there which will do what you want.
Ultrashock has at a couple at least and
Flash Kit always comes to save the day... Other than that... It's not something i've looked into in great detail.