level1=trim(rs("level1"))
level2=trim(rs("level2"))
level3=trim(rs("level3"))
level4=trim(rs("level4"))
if level4"" then
condition="where level1='"&level1&"' and level2='"&level2&"' and level3='"&level3&"' and level4='"&level4&"' "
else if level3"" then
condition="where level1='"&level1&"' and level2='"&level2&"' and level3='"&level3&"' "
else if level2"" then
condition="where level1='"&level1&"' and level2='"&level2&"' "
else
condition="where level1='"&level1&"' "
end if
end if
end if
session.Timeout=999
session("condition")=condition
session("level1")=level1
session("level2")=level2
session("level3")=level3
session("level4")=level4
%>