window.addEventListener?window.addEventListener("load",randImg,false):window.attachEvent("onload",randImg);

function randImg() {

imgs = 6; //Set the total number of image to pic from

rand = 1 + Math.floor(Math.random() * imgs)

//pictures have to be named pic_#.gif, you can change that below

target = "url(../image/illustration_"+ rand +".jpg)";

document.getElementById ('illustration').style.backgroundImage = target;
return false;
}

