It probably does not matter much but I would you CSS instead of JavaScript because some people, including me, browse with JavaScript disabled by default.
To add a background using CSS in Kompozer...
1) Go to "Format" in the menu bar and click "Page Colors and Background".
2) Click "Advanced Edit" and go to the "Inline Style" tab.
3) In the attribute field, type "background" and in the "Value" field, type "url('background_image.png') repeat-x".
In the value, "background_image.png" should be replaced with the image you choose and "repeat-x" will tile the image horizontally.
More information on the background attribute can be found
here.