Polyglot-Pinyin is a project mainly written in JavaScript, it's free.
A chrome extension to help you build your foreign language vocabulary–now with pinyin!
This is a fork of http://code.google.com/p/chrome-polyglot/, the only change being the addition of pinyin romanizations of chinese characters.