Assuming all of the images are of the same dimensions, this should do nicely. Use as many entries to the randomImages array as you like, the more entries, the less likely accidental repeats will be (additions/changes red):
Code:
/*
DHTML puzzle script (By Davey Erwin, daverwin@hotmail.com, http://daverwin.homepage.com/)
Modified slightly/ permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/
randomImages=new Array()
randomImages[0]='photo1.jpg'
randomImages[1]='photo2.jpg'
randomImages[2]='photo3.jpg'
randomImages.sort(function() {return 0.5 - Math.random();})
//1) Specify whether puzzle should be rendered in NS 4.
// "0" disables it (for use when you wish to place the puzzle inside table)
var display_in_NS=1
//2) Configure second and third parameter below for puzzle image/size
//Make width and height divisible by 3
myPuz=new Puzzle('myPuz',randomImages[0],141,255)
Bookmarks