I've found what I need here:
http://jsfiddle.net/jtbowden/UNZR5/1/