<%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")=ClassArray(j,0) 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 UrlClasslistunder(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")=UrlClassArray(j,3) 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
		   response.write "<option value='"&RsClass(e)("Class_Id")&"'>"&topclassname&RsClass(e)("Class_Name")&"</option>"&vbCrLf
		if i<Ubound(RsClass) then
			call addlistunder(e+1)
		end if
		RsClass(e).movenext
	wend
end function
function Dellistunder(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")=Class_Id 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 Dellistunder(e+1)
		end if
		RsClass(e).movenext
	wend
end function
%>
