<%
Function Getad(webad)
ad = webad
sql = "SELECT *  FROM  webad WHERE a_top='"& ad &"' ORDER BY a_time DESC"
set rs = Conn.Execute(sql)
If not rs.eof and not  rs.bof Then 
while not rs.eof 
pre = pre&rs("a_content")&"<br>"  
rs.movenext
wend
End If
Getad = pre
End Function
%>

<%
Function Getnews(wtable,worder,typeid,url)
tb=wtable
tw=worder
tid=typeid
turl=url
sql = "SELECT *  FROM "& tb &" WHERE m_top='"& tid &"' ORDER BY "& tw &" DESC"
'response.Write(sql)
'response.End()
set rs = Conn.Execute(sql)
If not rs.eof and not  rs.bof Then 
while not rs.eof 
pre = pre&"<table width=100% border=0 align=center cellpadding=0 cellspacing=0><tr><td width=30 style='border-bottom:#ffffff 1px solid'>&nbsp;<img src='img/list.gif'/>&nbsp;</td><td style='border-bottom:#ffffff 1px solid'><a href='"& turl &".asp?BigClassid="& tid &"&id="& rs("m_name") &"'>"& rs("m_name")&"</a></td></tr></table>"  
rs.movenext
wend
end if
Getnews = pre
End Function
%>
<%
Function InterceptString(txt,length)
  txt=trim(txt)
  x = len(txt)
  y = 0
  if x >= 1 then
    for ii = 1 to x
      if asc(mid(txt,ii,1)) < 0 or asc(mid(txt,ii,1)) >255 then
        y = y + 2
      else
        y = y + 1
      end if
      if y >= length then
        txt = left(trim(txt),ii) & ".."
        exit for
      end if
    next
    InterceptString = txt
  else
    InterceptString = ""
  end if
End Function
%>