<%

dim ndim,nnum,nsort_name
nnum=2
'call dim_ndim()

function nsort_type(ns,nn)
  dim ni,nss
  nss=ns
  for ni=1 to nnum
    if nss=ndim(0,ni) then
      nsort_type=nss
      exit function
    end if
  next
  nsort_type=ndim(0,nn)
end function

function nsort_value(ns)
  dim ni,nss
  nss=ns
  for ni=1 to nnum
    if nss=ndim(0,ni) then
      nsort_value=ndim(1,ni)
      exit function
    end if
  next
  nsort_value=ndim(1,0)
end function

function nsort_select(ns,ntt)
  dim ni,nss
  nss=ns
  nsort_select="<select name=nsort size=1>"
  for ni=1 to nnum
    nsort_select=nsort_select&"<option value='"&ndim(0,ni)&"'"
    if nss=ndim(0,ni) then nsort_select=nsort_select&" selected"
    nsort_select=nsort_select&">"&ndim(1,ni)&ntt&"</option>"
  next
  nsort_select=nsort_select&"</select>"
end function

sub dim_ndim()
  '分类中不可出现：function
  redim ndim(1,nnum)
  ndim(0,0)=""
  ndim(1,0)="所有"
  ndim(0,1)="forum"
  ndim(0,2)="other"
  ndim(1,1)="论坛"
  ndim(1,2)="其它"
  
  nsort=nsort_type(trim(request.querystring("nsort")),0)
  nsort_name=nsort_value(nsort)
end sub

sub erase_ndim()
  if isarray(ndim) then erase ndim
end sub
%>