First thing I'd suggest is turn off "generate HTML for all fields". In fact,
This has nothing to do with the JS erroe you're seeing though. What is the
<span>, which contains the <img>, inside of? A <p>, <div> etc?
The offsetParent bit is trying to work out where to place the picker layer on
the page. It's the one bit of the code that caused me the most problems as it's
a behaviour that's differs between not only browsers but depending on what
contains the img that was clicked.
Try placing the <img> inside different tags to see what happens.