<?xml version="1.0" encoding="windows-1251"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<!-- Administrator section layout stylesheet -->
	<xsl:include href="layout.xsl"/>

	<!-- Variable for page title -->
	<xsl:variable name="page-title"><xsl:value-of select="//content/Messages/Title"/> "<xsl:value-of select="//content/Form/row[@name='setting']/Description"/>"</xsl:variable>

	<!-- Applying root template -->
	<xsl:template match="/"><xsl:apply-templates/></xsl:template>

	<!-- Page content -->
	<xsl:template match="content">
		<script language="JavaScript">
			function ChangePage(page) {
				document.pagerForm.elements['page'].value = page;
				document.pagerForm.submit();
			}
		</script>
		<xsl:if test="Votes/row"><p class="heading1">Comments for <b style="color:#000000">"<xsl:value-of select="Votes/row/Item"/>"</b> product</p></xsl:if>
		<table border="0" cellpadding="0" cellspacing="0"><tr><td>
			<xsl:call-template name="StandartButton">
				<xsl:with-param name="description" select="//content/Messages/Back" />
				<xsl:with-param name="src">ico_back.gif</xsl:with-param>
				<xsl:with-param name="action">ratings.php</xsl:with-param>
			</xsl:call-template>
			<!--xsl:call-template name="StandartButton">
				<xsl:with-param name="description" select="//content/Messages/Add" />
				<xsl:with-param name="src">ico_add_menu.gif</xsl:with-param>
				<xsl:with-param name="action">admin_menu.php</xsl:with-param>
			</xsl:call-template-->
		</td></tr></table><br/>
		<xsl:choose>
			<xsl:when test="Votes/row">
				<xsl:apply-templates select="Votes/pager"/>
				<table border="0" cellpadding="0" cellspacing="0" width="500">
					<form name="pagerForm" action="comments.php" method="post">
						<input type="hidden" name="Item" value="{Ratings/row/Item}"/>
						<input type="hidden" name="page" value="{Form/row[@name='pager']/page}"/>
					</form>
					<xsl:apply-templates select="Votes/row"/>				
				</table>
				<xsl:apply-templates select="Votes/pager"/>
			</xsl:when>
			<xsl:otherwise>
				<p class="error"><xsl:value-of select="//content/Messages/NoList"/></p>
			</xsl:otherwise>	
		</xsl:choose>
	</xsl:template>
	
	<xsl:template match="Votes/row">
		<tr>
			<td>
				<table border="0" cellpadding="4" cellspacing="1"  bgcolor="#3D5E74" width="100%">
                	<tr bgcolor="#587AAE">
						<xsl:if test="Approved = 0"><xsl:attribute name="bgcolor">#7f0000</xsl:attribute></xsl:if>
						<td width="100%">
							<p class="navigation">
								&amp;nbsp;<xsl:value-of select="User"/>
							</p>
						</td>
						<td nowrap="" width="170">
							<p class="navigation">
								<xsl:call-template name="MakeDate">
									<xsl:with-param name="Date" select="Date"/>
									<xsl:with-param name="NeedHours">1</xsl:with-param>
								</xsl:call-template>
							</p>
						</td>
						<td nowrap="" width="40">
							<p class="navigation" align="center">
								<xsl:value-of select="Vote"/>
							</p>
						</td>
						<td nowrap="" bgcolor="#ffffff">
							<xsl:call-template name="StandartOptions">
								<xsl:with-param name="EditLink">comment.php</xsl:with-param>
								<xsl:with-param name="Id" select="Id"/>
							</xsl:call-template>
							<img src="images/pix.gif" width="5" height="1"/>
							<a class="tableElements" href="comment.php?Id={Id}&amp;event=Approve">
								<xsl:choose>
									<xsl:when test="Approved = 0"><img src="images/ico_add_sm.gif" border="0" alt="Approve" vspace="1" hspace="1"/></xsl:when>
									<xsl:otherwise><img src="images/ico_remove_sm.gif" border="0" alt="Hide" vspace="1" hspace="1"/></xsl:otherwise>
								</xsl:choose>
							</a>
						</td>
                	</tr>
					<xsl:if test="Message != ''">
						<tr bgcolor="#ffffff">
							<td colspan="100%">
								<p class="tableElements">
									<xsl:value-of select="Message" disable-output-escaping="yes" />
								</p>
							</td>
						</tr>
					</xsl:if>
                </table>	
			
			</td>
		</tr>
		<xsl:if test="position() != last()">
			<tr><td><br/></td></tr>
		</xsl:if>
	</xsl:template>
	
</xsl:stylesheet>
