<%
sub main_down_pic(nnhead,dsql,nt,n_num,c_num)
  dim temp1,nid,name,nhead:nhead=nnhead
  temp1="<table border=0 width='100%' cellspacing=0 cellpadding=2><tr align=center valign=top>"
  sql="select top "&n_num&" id,name,tim,pic from down where hidden=1"&dsql
  select case nt
  case "hot"
    sql=sql&" order by counter desc,id desc"
    if nhead="" then nhead="热点排行"
  case "good"
    sql=sql&" and types=5 order by id desc"
    if nhead="" then nhead="酷软推荐"
  case else
    sql=sql&" order by id desc"
    if nhead="" then nhead="最新软件"
  end select
  set rs=conn.execute(sql)
  do while not rs.eof
    name=rs("name"):nid=rs("id")
    name=objv7.code_html(name,1,c_num)
    temp1=temp1&vbcrlf&"<td width='"&int(100\n_num)&"%'><table border=0 cellspacing=0 cellpadding=2 width='100%' class=tf><tr><td align=center><a href='javascript:;' onclick=""javascript:open_view('down_view.asp?id="&nid&"',1);""><script language=javascript>pic_url('"&rs("pic")&"',1)</script></a></td></tr>" & _
	  vbcrlf&"<tr><td align=center><a href='javascript:;' onclick=""javascript:open_view('down_view.asp?id="&nid&"',1);"" class=time><b>"&name&"</b></a></td></tr></table></td>"
    rs.movenext
  loop
  temp1=temp1&"</tr></table>"
  response.write kong&main_bar(0,nhead,temp1,1,"98%","")
end sub

sub main_down(n_jt,nnhead,nt,n_num,n_m,c_num,et,tt)
  dim temp1,njt,nid,name,tim,counter,nhead:nhead=nnhead
  njt=img_skins()
  temp1=vbcrlf&"<table border=0 width='100%' cellspacing=0 cellpadding=2 class=tf>"
  sql="select top "&n_num+n_m&" id,name,username,tim,counter from down where hidden=1"
  select case nt
  case "hot"
    sql=sql&" order by counter desc,id desc"
    if nhead="" then nhead="下载排行"
  case "good"
    sql=sql&" and types=5 order by id desc"
    if nhead="" then nhead="软件推荐"
  case else
    sql=sql&" order by id desc"
    if nhead="" then nhead="软件更新"
  end select
  set rs=conn.execute(sql)
  if n_m>0 then rs.move(n_m)
  do while not rs.eof
    name=rs("name"):tim=rs("tim"):counter=rs("counter")
    temp1=temp1&vbcrlf&"<tr><td height="&space_mod&" class=bw>"&njt&"<a href='javascript:;' onclick=""javascript:open_view('down_view.asp?id="&rs("id")&"',1);"" title='"&objv7.code_html(name,1,0)&"'>"&objv7.code_html(name,1,c_num)&"</a><font class=time>"
    if et>-1 then temp1=temp1&" "&objv7.time_type(rs("tim"),et)
    if tt=1 then temp1=temp1&" <font class=hit>"&rs("counter")&"</font>"
    temp1=temp1&"</font></td></tr>"
    rs.movenext
  loop
  rs.close
  temp1=temp1&vbcrlf&"</table>"
  response.write kong&main_bar(1,nhead,temp1,1,"100%","<a href='down.asp'>"&morepic&"</a>")&"</td>"
end sub
%>