<table border="0" align="center" cellpadding="0" cellspacing="0" class="slideshow">
<tr>
<td rowspan="2" nowrap class="menu"><%
'//USE ASP FILE SYSTEM OBJECT TO POPULATE JAVASCRIPT VARIABLES WITH FOLDERS AND FILE NAMES.//
Dim strPicArray
Dim strFolderArray
'//URL path to GALLERY FOLDER//
galleryFolderPath = "[URL unfurl="true"]http://www.downtoearthsites.com/admin/assets/gallery/"[/URL]
'//PHYSICAL PATH TO GALLERY FOLDERS//
galleryPhysicalPath = "c:\Site_DownToEarthSites\admin\assets\gallery"
'//INSTATIATE THE FILE SYSTEM OBJECT
Set fso = CreateObject("Scripting.FileSystemObject")
'//GET INSTANCE OF THE GALLERYFOLDER
Set galleryfolder = fso.GetFolder(galleryPhysicalPath)
'//COLLECT ALL THE SUBFOLDERS IN THE GALLERYFOLDER
Set foldercollection = galleryfolder.SubFolders
intTotFolders = -1
For Each subfolder in foldercollection
intTotFolders = intTotFolders + 1
SubFolderName = SubFolder.Name
ReDim strFolderArray(intTotFolders)
'WRITE THE JAVASCRIPT ARRAY FOR THE FOLDER SELECTION LINKS
For s = intTotFolders to UBound(strFolderArray)
Response.Write("<a href='javascript:setslide(" & intTotFolders & ")'>" & SubFolderName & "</a><br>")
Next
Next
%>
</td>
<td class="navigation"><a href="javascript:previous();">Previous</a> <a href="javascript:start();">Start</a> <a href="javascript:stop();">Stop</a> <a href="javascript:next();">Next</a></td>
</tr>
<tr>
<td class="imagewindow"><script language="JavaScript1.2">
/*Multi image slideshow script- by javascriptkit.com
Visit JavaScript Kit ([URL unfurl="true"]http://javascriptkit.com)[/URL] for script
Credit must stay intact for use*/
//#1 SPECIFY number of slideshows
var number_of_slideshows=10
//#2 SPECIFY interval between slide (2000=2 seconds)
var interval=2000
//#3 SHOULD each slide be linked to a unique URL?
var linked=0
var slideshows=new Array(number_of_slideshows)
for (i=0; i <number_of_slideshows; i++)
slideshows[i]=new Array()
<%
'//THIS ASP CODE WRITES THE JAVASCRIPT ARRAY OF THE SUBFOLDERS OF THE GALLERY AND THE IMAGES INSIDE THE
'//SUBFOLDERS. THIS ALLOWS FOR SIMPLY UPLOADING THE IMAGES INTO THE APPROPRIATE FOLDER ON THE SERVER.
'//USE ASP FILESYSTEM OBJECT TO CAPTURE SUBFOLDER NAMES UNDER THE GALLERY FOLDER//
intTotFolders = 0
For Each subfolder in foldercollection
intTotFolders = intTotFolders + 1
SubFolderName = SubFolder.Name
'//CAPTURE IMAGE FILE NAMES WITHIN THE SUBFOLDER//
set imagesfolder=fso.GetFolder(galleryfolder & "/" & SubFolderName)
Set filecollection = imagesfolder.Files
intTotPics = 0
For Each file in filecollection
intTotPics = intTotPics + 1
Next
Redim strPicArray(intTotPics)
'STORE PICTURE FILE NAMES IN AN ARRAY
x = 0
For Each file in filecollection
strPicArray(x) = SubFolderName & "/" & file.Name
x = x + 1
Next
Redim strFolderArray(intTotFolders)
'WRITE THE JAVASCRIPT ARRAY FOR THE FILES IN THE SUBFOLDER
intFolderNo = 0
For s = 0 to UBound(strFolderArray)-2
intFolderNo = intFolderNo + 1
Next
intPicNo = 0
For x = 0 to UBound(strPicArray)-1
Response.Write("slideshows[" & intFolderNo & "][" & intPicNo & "]='" & GalleryFolderPath & strPicArray(x) & "'" & vbCrLf)
intPicNo = intPicNo + 1
Next
Next
%>
<!--THIS NEXT SECTION HAS NOT BEEN MODIFIED FOR fso FUNCTIONALITY YET-->
<!--Remove the below portion if "var linked" above is set to 0-->
var slidelinks=new Array(number_of_slideshows)
for (i=0; i <number_of_slideshows; i++)
slidelinks[i]=new Array()
//#5 SPECIFY urls of 1st slideshow
slidelinks[0][0]='[URL unfurl="true"]http://mysite.com/car1.htm'[/URL]
slidelinks[0][1]='[URL unfurl="true"]http://mysite.com/car2.htm'[/URL]
slidelinks[0][2]='[URL unfurl="true"]http://mysite.com/car3.htm'[/URL]
//SPECIFY urls of 2nd slideshow (remove if number_of_slides=1)
slidelinks[1][0]='[URL unfurl="true"]http://mysite.com/house1.htm'[/URL]
slidelinks[1][1]='[URL unfurl="true"]http://mysite.com/house2.htm'[/URL]
slidelinks[1][2]='[URL unfurl="true"]http://mysite.com/house3.htm'[/URL]
//SPECIFY urls of 3rd slideshow (remove if number_of_slides less than 3)
slidelinks[2][0]='[URL unfurl="true"]http://mysite.com/boat1.htm'[/URL]
slidelinks[2][1]='[URL unfurl="true"]http://mysite.com/boat2.htm'[/URL]
slidelinks[2][2]='[URL unfurl="true"]http://mysite.com/boat3.htm'[/URL]
function clickredir(){
window.location=slidelinks[maininc][subinc]
}
<!-- END removal ---------------------------------->
<!--THE PREVIOUS SECTION HAS NOT BEEN MODIFIED FOR fso FUNCTIONALITY YET-->
<!--Run the script-->
var maininc=0
var subinc=0
if (linked)
document.write('<a href="javascript:clickredir()"><img src="'+slideshows[0][0]+'" name="multislide" border=0></a>')
else
document.write('<img src="'+slideshows[0][0]+'" name="multislide">')
function slideit(){
subinc= (subinc<slideshows[maininc].length-1)? subinc+1: 0
document.images.multislide.src=slideshows[maininc][subinc]
}
function setslide(which){
clearInterval(runit)
maininc=which
subinc=0
runit=setInterval("slideit()",interval)
}
function start(){
runit=setInterval("slideit()",interval)
}
function stop(){
clearTimeout(runit)
}
function next(){
stop()
subinc= (subinc<slideshows[maininc].length-1)? subinc+1: 0
document.images.multislide.src=slideshows[maininc][subinc]
}
function previous(){
stop()
subinc= (subinc>0)? subinc-1: slideshows[maininc].length-1
document.images.multislide.src=slideshows[maininc][subinc]
}
runit=setInterval("slideit()",interval)
</script></td>
</tr>
</table>