<TABLE align="center" cellSpacing=0 cellPadding=0 width=100% border=0   bgcolor="<% = bgclr3 %>">
  <TBODY>
    <TR> 
      <TD valign="top">

        <TABLE height=28 cellSpacing=0 cellPadding=0 width=100% border=0 background="skin/skin1/classmenu/mnu<% = webbg6 %>_bg.png">
          <TBODY>
            <TR> 
			  <td align="center"><font color="<% = bgclr6 %>" ><b>产品分类</b></font></td>
			 
            </TR>
			
          </TBODY>
			 </TABLE>
        <table cellspacing=0 cellpadding=0 width="100%" border=0 STYLE="BORDER-RIGHT: <% = bgline2 %>px solid <% = bgclr19 %>;  BORDER-LEFT: <% = bgline2 %>px solid <% = bgclr19 %>; BORDER-BOTTOM: <% = bgline2 %>px solid <% = bgclr19 %>;">
          <tbody>
            <%
	  set rs = server.CreateObject("adodb.recordset")
	  rs.open "select categoryid,category from category  order by categoryorder",conn,1,1
	  if rs.eof and rs.bof then
	  response.Write "<tr><td align=center>还没有商品分类</td></tr>"
	  else
	  do while not rs.eof %>
            <tr> 
              <td  height=30  STYLE="PADDING-left: 10px" bgcolor="<% = bgclr10 %>"> 
              <a href=proclass.asp?bid=<% = rs("categoryid") %>><span STYLE="PADDING-bottom: 10px;color:<%=bgclr8%>;font-size: 13px;font-weight: 800;line-height: 26px;"><% = rs("category") %></b></span></A></td>
            </tr>
			<tr><td  background=images/bg_04.gif border=0></td></tr>
            <% 
	  Dim rs1
	  set rs1 = server.CreateObject("adodb.recordset")
	  rs1.open "select categoryid,sortsid,sorts from sorts where sorts.categoryid="&rs("categoryid")&" order by sortsorder",conn,1,1
	 do while not rs1.eof
          sortslen=0
         %>
            <tr> 
              <td  STYLE="PADDING-left: 10px;line-height:22px;" bgcolor="<% = bgclr11 %>">  <A href="proclass.asp?bid=<% = rs1("categoryid") %>&sid=<% = rs1("sortsid") %>" ><font color="<%=bgclr9%>"> <% = rs1("sorts") %></font></A>&nbsp;|
              <%
     sortslen= sortslen+len(trim(rs1("sorts")))
	  rs1.movenext  %>
              <% if rs1.eof then %>
              <%
	  exit do
	  else %>
               <A href="proclass.asp?bid=<% = rs1("categoryid") %>&sid=<% = rs1("sortsid") %>" ><font color="<%=bgclr9%>"> <% = rs1("sorts") %></font></A>
               <%
         sortslen= sortslen+len(trim(rs1("sorts")))
	  rs1.movenext 
         
         %>
           <%
end if
 if  sortslen<7 then

           
 if rs1.eof then %>
              <%
	  exit do
	  else %>
|<A href="proclass.asp?bid=<% = rs1("categoryid") %>&sid=<% = rs1("sortsid") %>" > <font color="<%=bgclr9%>"><% = rs1("sorts") %></font> </A>
            
           <%	
        
        rs1.movenext 
	end if  
         %>
            </td>
            </tr>
            <%	  
	    end if
	  loop
	  rs1.close
	  set rs1 = nothing %>
            <%
	  rs.movenext
	  loop
	  rs.close
	  set rs = nothing
	  end if
	  %>
          </tbody>
        </table> </TD>
    </TR>
  </TBODY>
</TABLE>
