<% dim x(1000) 'The directory of all my pictures... Const mypath="/images/scenarios/shop" Set filesystem = CreateObject("Scripting.FileSystemObject") Set folder = filesystem.GetFolder(server.mappath(mypath)) Set filecollection = folder.Files 'Step through the files list, keeping track of 'the number of files.... idx=0 For Each file in filecollection idx=idx+1 x(idx)=file.name Next 'Choose a random picture randomize timer whichNo=int(rnd()*idx)+1 'Clean up... set filesystem=nothing set folder=nothing set filecollection=nothing if x(whichNO) = "bookcovers.gif" then urltag="/bookcovers.htm" if x(whichNO) = "wallpapers.gif" then urltag="/wallpapers.htm" if x(whichNO) = "books.gif" then urltag="/books/king" if x(whichNO) = "best.gif" then urltag="/bestofstephenking.htm" if x(whichNO) = "audiocd.gif" then urltag="/books/king/audio/index.htm" if x(whichNO) = "booksequels.gif" then urltag="/sequels/Books/sequels.htm" if x(whichNO) = "dvd.gif" then urltag="/movies" if x(whichNO) = "ebooks.gif" then urltag="/books/king/ebooks/microsoft/index.htm" if x(whichNO) = "moviesequels.gif" then urltag="/sequels/Movies/sequels.htm" 'Display the image! response.write "" response.write " & x(whichNo) & " response.write "" %>