background image swap full screen
<p>I'm using a background image swap that changes every refresh.
It works fine, the body tag has the onLoad function. But I want the image to be scaled correctly, now I only get a piece of the image. Anyone any ideas for the scaling?</p>

<pre><code>&lt;script type="text/javascript"&gt;
    function randomize(min, max) {
        if (!min)
            min = 0;
        if (!max)
            max = 1;
        return Math.floor(Math.random()*(max+1)+min);
    }
    function randomBg() {
        var bgs = new Array();
        bgs.push("images/bg/bg1.jpg");
        bgs.push("images/bg/bg2.jpg");
        bgs.push("images/bg/bg3.jpg");
        bgs.push("images/bg/bg4.jpg");
        bgs.push("images/bg/bg5.jpg");
        bgs.push("images/bg/bg6.jpg");
        bgs.push("images/bg/bg7.jpg");
        bgs.push("images/bg/bg8.jpg");
        bgs.push("images/bg/bg9.jpg");
        bgs.push("images/bg/bg10.jpg");
        document.body.style.backgroundImage = "url(" + bgs[randomize(0, bgs.length-1)] + ")";
    }
&lt;/script&gt;
</code></pre>

<p>thanks!</p>
