<%
'PROCS.INC
Sub WriteProductRow
  'Write a table row for the current record of rsProducts
  %>
<table width="100%">
  <tr><%=vbcrlf%>
  <%
  
  'First cell for picture
  sTemp = trim("" & rsproducts("itempicturefile"))
  if sTemp = "" then
    sTemp = "Picture Not Available"
  else
    sTemp = "<img src='./images/products/" & sTemp & "' border=0 alt=''>"
  end if
  %>
  <td align='center' width="10%">
  <font face='Verdana, Arial' color='#008000' size='-1'>
  <%=sTemp%></font></td><%=vbcrlf%>
  <%'Second cell for Item #, name, description%>
  <td valign='top' width="80%">
  <font face='Verdana, Aria' color='#000000' size='-1'>
  <i><u>Item #<%=rsProducts("itemproductnumber")%>
  </u></i></font><br>
  <font face='Verdana, Arial' color='#0000ff' size='-1'>
  <b><a href="./applications/prod-detail.asp?SKU=<%=rsProducts("itemproductnumber")%>"><%=rsProducts("itemname")%></a></b> - 
  <font face='Verdana, Arial' color='#008000' size='-1'>
  <%=rsProducts("itemdescription")%><br><br>
  </font></td><%=vbcrlf%>
  <%
  'Third cell for price and "add to cart" link
  
  if rsproducts("itemsaleprice") > 0 then
    sTemp = "SALE: " & formatcurrency(rsProducts("itemsaleprice")) & _
      "<br>(Regular " & _
      formatcurrency(rsProducts("itemregularprice")) & ")"
  else
    sTemp = "Price: " & formatcurrency(rsProducts("itemregularprice")) 
  end if
  %>
  <td align='center' valign='middle' nowrap width="10%">
  <font face='Verdana, Arial' color='#0000ff' size='-1'>
  <%=sTemp%>
  <a href='./shoppingcart/shopcart.asp?mode=add&itemno=<%=rsproducts("itemproductnumber")%>'><img src='./images/order.gif' border='0'></a></font></td>
  <%=vbcrlf%>
  </tr><%=vbcrlf%>
  <%
End Sub
Sub WriteProductRow2
  'Write a table row for the current record of rsProducts
  %>
<table width="100%">
  <tr><%=vbcrlf%>
  <%
  
  'First cell for picture
  sTemp = trim("" & rsproducts("itempicturefile"))
  if sTemp = "" then
    sTemp = "Picture Not Available"
  else
    sTemp = "<img src='../images/products/" & sTemp & "' border=0 alt=''>"
  end if
  %>
  <td align='center' width="10%">
  <font face='Verdana, Arial' color='#008000' size='-1'>
  <%=sTemp%></font></td><%=vbcrlf%>
  <%'Second cell for Item #, name, description%>
  <td valign='top' width="80%">
  <font face='Verdana, Aria' color='#000000' size='-1'>
  <i><u>Item #<%=rsProducts("itemproductnumber")%>
  </u></i></font><br>
  <font face='Verdana, Arial' color='#0000ff' size='-1'>
  <b><a href="../applications/prod-detail.asp?SKU=<%=rsProducts("itemproductnumber")%>"><%=rsProducts("itemname")%></a></b> - 
  <font face='Verdana, Arial' color='#008000' size='-1'>
  <%=rsProducts("itemdescription")%><br><br>
  </font></td><%=vbcrlf%>
  <%
  'Third cell for price and "add to cart" link
  
  if rsproducts("itemsaleprice") > 0 then
    sTemp = "SALE: " & formatcurrency(rsProducts("itemsaleprice")) & _
      "<br>(Regular " & _
      formatcurrency(rsProducts("itemregularprice")) & ")"
  else
    sTemp = "Price: " & formatcurrency(rsProducts("itemregularprice")) 
  end if
  %>
  <td align='center' valign='middle' nowrap width="10%">
  <font face='Verdana, Arial' color='#0000ff' size='-1'>
  <%=sTemp%>
  <a href='../shoppingcart/shopcart.asp?mode=add&itemno=<%=rsproducts("itemproductnumber")%>'><img src='../images/order.gif' border='0'></a></font></td>
  <%=vbcrlf%>
  </tr><%=vbcrlf%>
  <%
End Sub

Sub FrontPage

 'First cell for picture
  sTemp = trim("" & rsproducts("itempicturefile"))
  if sTemp = "" then
    sTemp = "Picture Not Available"
  else
    sTemp = "<img src='images/products/" & sTemp & "' border=0 alt=''>"
  end if
 %>
  <table border="0" width="100%">
  <tr>
    <td width="20%" rowspan="3" valign="middle" align="center"><%=sTemp%></td>
    <td width="80%"><b><font size="2" face="Verdana"><a href="./applications/prod-detail.asp?SKU=<%=rsProducts("itemproductnumber")%>"><%=rsProducts("itemname")%></a></font></b></td>
  </tr>
  <tr>
    <td width="80%"><font size="2" face="Verdana"><%=rsProducts("ItemDescription")%></font></td>
  </tr>
  <tr>
    <td width="80%"><b><font size="2" face="Verdana" color="#FF0000"><a href="./shoppingcart/shopcart.asp?mode=add&itemno=<%=rsProducts("ItemProductNumber")%>"><%=FormatCurrency(rsProducts("ItemRegularPrice"))%></a></font></b></td>
  </tr>
  </table>
<%
rsProducts.moveNext
If NOT rsProducts.EOF Then

 'First cell for picture
  sTemp = trim("" & rsproducts("itempicturefile"))
  if sTemp = "" then
    sTemp = "Picture Not Available"
  else
    sTemp = "<img src='images/products/" & sTemp & "' border=0 alt=''>"
  end if
%>
  <table border="0" width="100%">
  <tr>
    <td width="82%"><b><font size="2" face="Verdana"><%=rsProducts("ItemName")%></font></b></td>
    <td width="18%" rowspan="3" valign="middle" align="center"><%=sTemp%></td>
  </tr>
  <tr>
    <td width="82%"><font size="2" face="Verdana"><%=rsProducts("ItemDescription")%></font></td>
  </tr>
  <tr>
    <td width="82%"><font color="#FF0000" size="2" face="Verdana"><b><a href="shoppingcart/shopcart.asp?mode=add&itemno=<%=rsProducts("ItemProductNumber")%>"><%=FormatCurrency(rsProducts("ItemRegularPrice"))%></a></b></font></td>
  </tr>
  </table>
<%
Else
	rsProducts.MovePrevious
End If
End Sub

Function RemoveQuotes(s)
  dim i, s2
  s = trim(s)
  
  if len(s) = 0 then 
    RemoveQuotes = ""
    exit function
  end if
  
  s2 = ""
  for i = 1 to len(s)
    if mid(s,i,1) = "'" then
      s2 = s2 & "''"
    else
      s2 = s2 & mid(s, i, 1)
    end if
  next
  RemoveQuotes = s2
End Function
%>
  </table>
