ASP Source Code: Mulvey Family Photo Album - navTree.inc
<%
Sub navTree(level, startLevel)
	Dim Path
	Dim Folders
	dim SubFolders
	Dim SubFolder
	Dim Level1

	Pass = startLevel

	i = InStrRev(level,"\")
	Path = mid(level,i+1)
	FolderTitle = Path

	i = InStrRev(Path,"\")
	if i > 0 then
		FolderTitle = mid(Path,i+1)
	end if

	Set FSO = CreateObject("Scripting.FileSystemObject")
	set Folders=FSO.GetFolder(level)
	Set SubFolders = Folders.SubFolders

	getCaption level,FolderTitle,0

	if Pass = 1 then
		response.write "<ul>" & vbNewLine
		Level1 = level
	end if
	Pass = Pass + 1

	response.write "<li><A href="
	response.write chr(34) & "gallery.asp?subPath="& Server.URLEncode(level) & chr(34)
	response.write ">" & Caption & "</A>" & vbNewLine

	'Recursively check for subfolders
	If SubFolders.Count > 0 Then
		response.write "<ul>" & vbNewLine
		For Each SubFolder In SubFolders
			navTree SubFolder,Pass
		next
		response.write "</ul>" & vbNewLine
	end if
	set Folders = nothing
	set SubFolders = nothing
	set FSO = nothing
	if Level1 = level then
		response.write "</ul>" & vbNewLine
	end if
End Sub
%>