if (document.getElementById) { window.onload = swap };

function swap() {
var numimages=3;
rndimg = new Array("img/layout/bg1.gif", "img/layout/bg2.gif", "img/layout/bg3.gif"); 
x=(Math.floor(Math.random()*numimages));
randomimage=(rndimg[x]);
document.body.style.backgroundImage = "url("+ randomimage +")"; 
}