Code added. Mostly transplanted from my pony button mini-site. :P