see bug 733339 comment 7
Created attachment 604722 [details] [diff] [review]
This should do it, although I haven't tested it yet.
I kept the 'data' attribute since fillPopup would need to escape the value if put directly in oncommand.
The code handling _nostyle appears to be dead, so I removed it.
Comment on attachment 604722 [details] [diff] [review]
Nice cleanup! r+ assuming it works. :)