Thanks for your suggestions though
As a point of interest, I won't use document.styleSheets in IE because IE has perverted the syntax. I just use document.write, which is always going to be fine, because IE doesn't support XHTML in the first place.
As far as this goes - the question is essentially resolved - mozilla supports document.styleSheets, and the original example now works in Opera. So overall, there's a reliable solution for all.