<%set rs=server.createobject("adodb.recordset")
set rss=server.createobject("adodb.recordset")

dim RsClass(5)
function listunder(e)
	set RsClass(e)=server.createobject("adodb.recordset")
	RsClass(e).open "select Class_Id,Class_Name from Class where Class_TopClassId="&RsClass(e-1)("Class_Id"),conn,1,3
	while not RsClass(e).eof
		dim topclassname
		topclassname=""
		for x=0 to e-1
			topclassname=topclassname&RsClass(x)("Class_Name")&"£¾"
		next
		if RsClass(e)("Class_Id")=UrlArray(j,4) then
		   response.write "<option value='"&RsClass(e)("Class_Id")&"' selected>"&topclassname&RsClass(e)("Class_Name")&"</option>"&vbCrLf
		else
		   response.write "<option value='"&RsClass(e)("Class_Id")&"'>"&topclassname&RsClass(e)("Class_Name")&"</option>"&vbCrLf
		end if
		if i<Ubound(RsClass) then
			call listunder(e+1)
		end if
		RsClass(e).movenext
	wend
end function
function addlistunder(e)
	set RsClass(e)=server.createobject("adodb.recordset")
	RsClass(e).open "select Class_Id,Class_Name from Class where Class_TopClassId="&RsClass(e-1)("Class_Id"),conn,1,3
	while not RsClass(e).eof
		dim topclassname
		topclassname=""
		for x=0 to e-1
			topclassname=topclassname&RsClass(x)("Class_Name")&"£¾"
		next
        rs.open "select UrlClass_Id from UrlClass where UrlClass_ClassId="&RsClass(e)("Class_Id"),conn,1,3
		if not rs.eof and not rs.bof then
		   response.write "<option value='"&RsClass(e)("Class_Id")&"'>"&topclassname&RsClass(e)("Class_Name")&"</option>"&vbCrLf
		end if
		rs.close
		if i<Ubound(RsClass) then
			call addlistunder(e+1)
		end if
		RsClass(e).movenext
	wend
end function
%>
