A random image is displayed each time this page is reloaded, and each image corresponds to a link. <script language="JavaScript"> function random_imglink(){ var myimages=new Array() //specify random images below. You can have as many as you wish myimages[1]="../gallery/images/1.jpg" myimages[2]="../gallery/images/2.jpg" myimages[3]="../gallery/images/3.jpg" myimages[4]="../gallery/images/4.jpg" myimages[5]="../gallery/images/5.jpg" //specify corresponding links below var imagelinks=new Array() imagelinks[1]="indexjs.html" imagelinks[2]="indexjs.html" imagelinks[3]="indexjs.html" imagelinks[4]="indexjs.html" imagelinks[5]="indexjs.html" var ry=Math.floor(Math.random()*myimages.length) if (ry==0) ry=1 document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" border=0></a>') } random_imglink() //--> </script>