// JavaScript to interpolate random images into a page. var ic = 9; // Number of alternative images var pic1 = new Array(ic); // Array to hold filenames pic1[0] = "/docs/IO/1604/photo01.gif"; pic1[1] = "/docs/IO/1604/photo02.gif"; pic1[2] = "/docs/IO/1604/photo03.gif"; pic1[3] = "/docs/IO/1604/photo04.gif"; pic1[4] = "/docs/IO/1604/photo05.gif"; pic1[5] = "/docs/IO/1604/photo06.gif"; pic1[6] = "/docs/IO/1604/photo07.gif"; pic1[7] = "/docs/IO/1604/photo08.gif"; pic1[8] = "/docs/IO/1604/photo09.gif"; function pickRandom(range) { if (Math.random) return Math.round(Math.random() * (range-1)); else { var now = new Date(); return (now.getTime() / 1000) % range; } } // Write out an IMG tag, using a randomly-chosen image name. var choice1 = pickRandom(ic); document.writeln('');