<% dim x(1000) 'The directory of all my pictures... Const mypath="/images/scenarios/king" 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) = "biography.gif" then urltag="/biography.htm" if x(whichNO) = "forum.gif" then urltag="/forum.htm" if x(whichNO) = "imagegalery.gif" then urltag="/imagegallery.htm" if x(whichNO) = "richardbachman.gif" then urltag="/richardbachman.htm" if x(whichNO) = "aboutking.gif" then urltag="/aboutstephenking.htm" 'Display the image! response.write "" response.write " & x(whichNo) & " response.write "" %>