Hola, elmeyedor.
<html>
<head>
<title> 4 Imagenes aleatorias... o más</title>
<script language="JavaScript">
var imagenumber = 4;
var randomnumber = Math.random();
var rand1 = Math.round( (imagenumber-1) * randomnumber) + 1;
images = new Array
images[1] = "docs/1.jpg"
images[2] = "docs/2.jpg"
images[3] = "docs/3.jpg"
images[4] = "docs/4.jpg"
var ref = new Array;
ref[1] = 'pagina1.html'
ref[2] = 'pagina2.html'
ref[3] = 'pagina3.html'
ref[4] = 'pagina4.html'
var image = images[rand1]
var refe = ref[rand1]
</script>
</head>
<body>
<script>
document.write('<a href="' +refe+ '">')
document.write('<IMG border="0" SRC=" ' + image + ' "></a>')
</script>
</body>
</html>
Saludos,