      <div id="lastest-products-2" class="widget widget_lastest_products">
        <h3 class="widget-title"><span>最新产品</span></h3>
        <ul class="p-list clearfix">
<%=IndexProducts("0,", 6)%>
        </ul>
      </div>
      <div id="lastest-news-3" class="widget widget_lastest_news">
        <h3 class="widget-title"><span>最新动态</span></h3>
        <ul>
          <%=IndexNews("0,", 10)%>
        </ul>
      </div>
      <div id="tag_cloud-2" class="widget widget_tag_cloud">
        <h3 class="widget-title"><span>标签</span></h3>
        <div class="tagcloud">
		<%
		tmpKeywords =  Split(Keywords, ",")
		For i = 0 To UBound(tmpKeywords)
			Response.Write("<a href=""/Search.Asp?KeyWord=" & tmpKeywords(i) & """ title=""" & tmpKeywords(i) & """ style=""font-size: " & RndNum(8, 18) & "pt;"">" & tmpKeywords(i) & "</a>")
		Next

		Function RndNum(Min, Max)
			Randomize
			RndNum = Min + Int((Max - Min + 1) * Rnd)
		End Function
		%>
        </div>
      </div>
<%
Function IndexProducts( SortPath, ProCount)
    Set rs = Server.CreateObject("Adodb.Recordset")
    sql = "Select Top " & ProCount & " * From Qianbo_Products Where ViewFlag And Instr(SortPath,'" & SortPath & "') > 0 Order By ID Desc"
    rs.Open sql, conn, 1, 1
    If Not rs.EOF Then
        While Not rs.EOF
            If ISHTML = 1 Then
                AutoLink = "" & ProName & Separated & rs("ID") & "." & HTMLName & ""
            Else
                AutoLink = "ProductView.Asp?ID=" & rs("ID") & ""
            End If
            Response.Write"        <li class=""col-xs-12 col-md-6 p-item"">" & vbCrLf
            Response.Write"          <div class=""p-item-wrap""><a class=""thumb"" href=""" & AutoLink & """ title=""" & rs("ProductName") & """><img src=""" & rs("BigPic") & """ width=""480"" height=""320"" alt=""" & rs("ProductName") & """></a>" & vbCrLf
            Response.Write"            <h4 class=""title""><a href=""" & AutoLink & """ title=""" & rs("ProductName") & """>" & rs("ProductName") & "</a></h4>" & vbCrLf
            Response.Write"          </div>" & vbCrLf
            Response.Write"        </li>" & vbCrLf
            rs.movenext
        Wend
    End If
    rs.Close
    Set rs = Nothing
End Function

Function IndexNews(SortPath, ArticleNum)
    Set rs = Server.CreateObject("Adodb.Recordset")
    sql = "Select Top " & ArticleNum & " * From Qianbo_News Where ViewFlag And Instr(SortPath,'" & SortPath & "') > 0 Order By ID Desc"
    rs.Open sql, conn, 1, 1
    If Not rs.EOF Then
        Do While Not rs.EOF
            If ISHTML = 1 Then
                AutoLink = "" & NewName & Separated & rs("ID") & "." & HTMLName & ""
            Else
                AutoLink = "NewsView.Asp?ID=" & rs("ID") & ""
            End If
            Response.Write"          <li><a href=""" & AutoLink & """ title=""" & rs("NewsName") & """>" & rs("NewsName") & "</a></li>"
            rs.movenext
        Loop
    End If
    rs.Close
    Set rs = Nothing
End Function
%>