Basit şekilde aşağıdaki kodu kullanabilirsin;
var banner=new Array()
banner[0]='<a href=http://www.xxx.com target=_new><img src=jhdfkjghdf.jpg border=0></a>'
banner[1]='<a href=http://www.xxx.com target=_new><img src=jhdfkjghdf.jpg border=0></a>'
banner[2]='<a href=http://www.xxx.com target=_new><img src=jhdfkjghdf.jpg border=0></a>'
banner[3]='<a href=http://www.xxx.com target=_new><img src=jhdfkjghdf.jpg border=0></a>'
banner[4]='<a href=http://www.xxx.com target=_new><img src=jhdfkjghdf.jpg border=0></a>'
banner[5]='<a href=http://www.xxx.com target=_new><img src=jhdfkjghdf.jpg border=0></a>'

var hangisi=Math.floor(Math.random()*(banner.length))
document.write(banner[hangisi])
Alternatif olarak;
	
random image .. java script

<HTML>
<head>
<title>rasgele resim</title>
<script>
var resnames=new Array();
resnames[0]='resim00.gif';
resnames[1]='resim01.gif';
var srcurl=resnames[(Math.floor(Math.random()*resnames.length))];
</script>
</head>
<body>

<script>
document.write('<img src="'+srcurl+'">')
</script>

</body>
</HTML>