<table width="100%" border="0" align="center" cellSpacing="1" cellPadding="0" bgColor="#CCCCCC"> 
<%set rs=server.createobject("adodb.recordset")
		rs.open "select Top 8 * from shop_books where bestbook=1 order by bookid desc",conn,1,1
		if rs.recordcount=0 then 
		%> <tr bgcolor="#CCCCCC"> <%
		else
		while not rs.eof
%> <%
					set rs2=server.createobject("adodb.recordset")
					rs2.open "select * from shop_nclass where nclassid="&rs("nclassid"),conn,1,1
					if rs2.recordcount>0 then
					%> 
    <td width="35%" height="24" bgcolor="#FFFFFF">&nbsp;<img border="0" src="img/14.gif"> 
      <%if rs.eof then%> <%else%> <%response.write "<a href=list.asp?id="&rs("bookid")&" target=_blank>"
				if len(trim(rs("bookname")))>15 then
				response.write left(trim(rs("bookname")),13)&".."
				else
				response.write trim(rs("bookname"))
				end if
				response.write "</a>"
				%> <%rs.movenext%> <%end if%> </td><td width="15%" height="24" align="center" bgcolor="#FFFFFF"> 
<%response.write "<a href=class.asp?lx=small&anid="&rs2("anclassid")&"&nid="&rs2("nclassid")&" targer=_blank>"&rs2("nclass")%> 
<%end if
	rs2.close
	set rs2=nothing%> </td></tr> <%wend
end if%> </table>
