I'm trying to randomly select a background image for a table cell. I've got the array set up, and I can select a random element out of it. My question is, what's the best way to write the css to include the randomly selected image? Can you do a js document.write within <style> tags? Should I just document.write the entire table cell line, and write out the style within the table cell? Any advice would be greatly appreciated. Thanks.

P.S. I already had this working in perl, but since most of my pages on my site aren't perl, I need to be able to do it in js. Unless someone can convince our IT group to enable XSSI."...there's some good in this world, Mr. Frodo, and it's worth fighting for." - Samwise Gamgee, The Two Towers

It's probably not the most elegant solution, but it works for my purposes. It totally screws up in Netscape 4.7, but it did that before, since Netscape likes to tile td background images. And usage of Netscape around here is declining, and is almost nil in our department. (This is not intended to start a flame war on browsers, it's just my opinion.) Anyway, here's the code: