<link href="topnav.css" rel="stylesheet" type="text/css" />
<link href="layout/stylesheet.css" rel="stylesheet" type="text/css" />
<!--#include file="funcoes.asp"-->
<%
set produto = conexao.execute("SELECT * FROM produtos WHERE status <> 'ok' AND estoque='s' order by rand() limit 9 ;")
 %>
 <%
pagina ="http://"& Request.ServerVariables("HTTP_HOST")&Request.ServerVariables("url")&"?"& request.ServerVariables("QUERY_STRING")
%>
<%set rs = conexao.execute("SELECT * FROM sessoes WHERE id='"&request("id")&"'")%>
<table width="145" border="0" cellpadding="0" cellspacing="0" background="design/menu_direita_fundo.gif">
  <!--DWLayoutTable-->
  <tr> 
    <td width="145" valign="top" bgcolor="#016F01"><img src="design/layout_r5_c1.GIF" width="145" height="61"></td>
  </tr>
  <tr> 
    <td valign="top"> <table  width="95%" border="0" align="center" cellpadding="0" cellspacing="0" id="menu">
        <!--DWLayoutTable-->
        <%
if request("id") = "" then%>
        <% 
sql = "SELECT * FROM sessoes WHERE ver = 's' ORDER by nome;"
Set sessoes = conexao.Execute(sql)
While Not sessoes.EOF
set semcateg = conexao.execute("SELECT * FROM categoria WHERE idsessao='"&sessoes("id")&"' and nome='Todos'")
if semcateg.eof or semcateg.bof then%>
        <tr> 
          <td width="10" height="19">&nbsp;</td>
          <td width="128" valign="top" <%If loja("retratil") = "Sim" then 
	response.write "style=""cursor:pointer"" onclick=""SwitchMenu('"&sessoes("nome")&"')""" 
	end if%>><strong><%=sessoes("nome")%></strong> </td>
        </tr>
        <TR> 
          <TD height="38">&nbsp;</TD>
          <TD valign="top"> 
            <%
set categ = conexao.execute("SELECT * FROM categoria WHERE idsessao='"&sessoes("id")&"' ORDER by nome LIMIT 3;")%>            <span class="submenu" id="<%=sessoes("nome")%>" 
<%	If loja("retratil") = "Nao" then
				response.write "style=""display:block"""
else
		if  1 + request("id") -1 =  1 + sessoes("id") - 1 then
		response.write "style=""display:block"""
		else
				response.write "style=""display:none"""
				end if
end if%>> 
            <%while not categ.eof%>
            <a  href="sessoes.asp?id=<%=sessoes("id")%>&categoria=<%=categ("idcategoria")%>"><%=categ("nome")%></a><Br />
            <%
categ.movenext%>
            <%wend%>
            <a  href="sessoes.asp?id=<%=sessoes("id")%>" class="vermais">+ Veja mais...</a> </span></TD>
        </TR>
        <TR> 
          <TD colspan="2" align="center"  style="font-size:3PX; color:#FFFFFF">a</TD>
          <%else%>
        <TR> 
          <TD height="18"></TD>
          <TD valign="top"> <a href="sessoes.asp?id=<%=sessoes("id")%>&categoria=<%=semcateg("idcategoria")%>"><%=sessoes("nome")%></a></TD>
        </TR>
        <%
end if
sessoes.MoveNext
wend









'AQUI É PARA QUANDO ESTÁ SOLICITANDO A SESSÃO
else










set categoria = conexao.execute("SELECT * FROM categoria WHERE idsessao='"&request("id")&"' ORDER BY nome")
while not categoria.eof
set subcategoria = conexao.execute("SELECT * FROM subcategoria WHERE idcategoria='"&categoria("idcategoria")&"' ORDER by nome ")
if subcategoria.eof or subcategoria.bof then%>
        <TR> 
          <TD height="18"></TD>
          <TD valign="top"> <a href="sessoes.asp?id=<%=request("id")%>&categoria=<%=categoria("idcategoria")%>"><strong><%=categoria("nome")%></strong></a></TD>
        </TR>
        <%else%>
        <tr> 
          <td height="18"></td>
          <td valign="top" <%If loja("retratil") = "Sim" then 
	response.write "style=""cursor:pointer"" onclick=""SwitchMenu('"&categoria("nome")&"')""" 
	end if%>><strong><%=categoria("nome")%></strong> </td>
        </tr>
        <TR> 
          <TD height="37"> 
          <TD valign="top"> 
            <%while not subcategoria.eof%>
            <a  href="sessoes.asp?id=<%=request("id")%>&categoria=<%=categoria("idcategoria")%>&subcategoria=<%=subcategoria("idsubcategoria")%>"><%=subcategoria("nome")%></a><Br />	
            <%
subcategoria.movenext%>
            <%wend%>
        <TR> 
          <TD colspan="2" align="center"  style="font-size:3PX; color:#FFFFFF">a</TD>
          <%end if
categoria.movenext
wend

end if
%>
      </table></td>
  </tr>
  <tr> 
    <td valign="top" bgcolor="#FFFFFF"><img src="design/menu_direita_baixo.gif" width="145" height="12"></td>
  </tr>
  <tr> 
    <td><table border=0 align=center width=137 cellspacing="0" cellpadding="0">
        <!--DWLayoutTable-->
        <tr> 
          <td height="55" colspan=4 valign="top"> <table border=0 cellspacing=0 width=95% cellpadding=0>
              <!--DWLayoutTable-->
              <tr> 
                <td width="145" height=49 valign="top" bgcolor="#016F01"><img src="design/layout_r5_c1111.gif" width="145" height="49"></td>
              </tr>
              <tr> 
                <td height=6></td>
              </tr>
            </table></td>
        </tr>
        <%
				if VersaoDb = 1 then		
			
				set produto = conexao.execute("SELECT TOP 5 idprod, nome, preco FROM produtos ORDER BY contador DESC")
				end if
				cont = 1
				if not produtos.eof then
				  for x = 1 to 5%>
        <tr> 
          <td width="3" height="70">&nbsp;</td>
          <td width="8" valign=top><!--DWLayoutEmptyCell-->&nbsp;</td>
          <td width="131" valign="top"><a href= "detalhes.asp?id=<%=produto("idsessao")%>&amp;produto=<%=produto.fields("idprod")%>"  onmouseout="window.status='';return true;" onmouseover="window.status='+ Detalhes';return true;" style="text-decoration: none;"><font face="<%=fonte%>" style="font-size:11px;color:000000;"><br />
                  <%= produto("nome")%><br />
                  <b><font color="#333333"><%= strlgMoeda & " " & formatnumber(produto("preco"),2)%></font></b></font></a><br />
            ............................ </td>
          <td width="3">&nbsp;</td>
        </tr>
        <tr> 
          <td height="0"></td>
          <td></td>
          <td></td>
          <td></td>
        </tr>
        <%cont = cont + 1%>
        <%produto.movenext%>
        <%next%>
        <%end if%>
    </table></td>
  </tr>
  <tr> 
    <td height="13" valign="top"><img src="design/menu_direita_baixo.gif" width="145" height="12"></td>
  </tr>
</table>

