F.eks.
<script type="text/javascript">
var mappe = "
http://www.ditDomaine.dk/billedmappe/";var billeder = ["billed1.jpg","billed2.jpg","billed3.jpg","billed4.jpg","billed5.jpg","billed6.jpg", "billed7.jpg","billed8.jpg","billed9.jpg","billed10.jpg","billed11.jpg"];
var act = new Array(billeder.length,billeder.length,billeder.length,billeder.length);
function showPics(){
for(i=0;4>i;i++){
var num = Math.floor(Math.random()*billeder.length);
var used = num==act[0]||num==act[1]||num==act[2]||num==act[3];
while(used){
num = Math.floor(Math.random()*billeder.length);
used = num==act[0]||num==act[1]||num==act[2]||num==act[3];
}
act[i] = num;
document.getElementById("pic"+i).src = billeder[num];
}
}
window.onload = showPics;
</script>
<img src="billed1.jpg" style="width:100px" id="pic0"><br>
<img src="billed2.jpg" style="width:100px" id="pic1"><br>
<img src="billed3.jpg" style="width:100px" id="pic2"><br>
<img src="billed4.jpg" style="width:100px" id="pic3"><br>
-- absolut utestet og kun lavet for at du kan se princippet, for der er masser af muligheder for at tænke anderledes !-)