Loading Form Background using Javascript

I am trying to load a background image onto my form using Javascript. I do this because we want a random image to appear when the form/document opens. However, despite running the appropriate code (which works in other places – like Page backgrounds) in the onLoad event, the form still comes up with a white background.

Any ideas?