ranimg = new Array(); ranimg[0]="img/top/catchcopy01.jpg"; ranimg[1]="img/top/catchcopy02.jpg"; ranimg[2]="img/top/catchcopy03.jpg"; ranimg[3]="img/top/catchcopy04.jpg"; xx = Math.floor(ranimg.length*Math.random()); ranimg = ranimg[Math.floor(xx)]; document.write ('<style type="text/css"><!--body div.mainbox{background: url('+ ranimg +') no-repeat left top;}--></style>'); 