<?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>
		<p class="heading1">Ratings</p>
		<table border="0" cellpadding="0" cellspacing="0">
        <tr>
			<td rowspan="6" valign="top">Status:&amp;nbsp;&amp;nbsp;</td>
        	<td bgcolor="#EBF6E4" height="15" width="15" style="border:solid 1px #000000;">&amp;nbsp;</td>
			<td>&amp;nbsp; No new comments</td>
        </tr>
		<tr><td colspan="2" height="2"></td></tr>
		<tr>
        	<td bgcolor="Ivory" height="15" width="15" style="border:solid 1px #000000;">&amp;nbsp;</td>
			<td>&amp;nbsp; New comments from last visit to the interface</td>
		</tr>
		<tr><td colspan="2" height="2"></td></tr>
		<tr>
        	<td bgcolor="#FFC1C1" height="15" width="15" style="border:solid 1px #000000;">&amp;nbsp;</td>
			<td>&amp;nbsp; All comments is New</td>
		</tr>
        </table><br/>
		<xsl:choose>
			<xsl:when test="Ratings/row">
				<xsl:apply-templates select="Ratings/pager"/>
				<table border="0" cellpadding="4" cellspacing="1"  bgcolor="#3D5E74">
					<form name="pagerForm" action="ratings.php" method="post">
						<input type="hidden" name="page" value="{Form/row[@name='pager']/page}"/>
					</form>
					<tr bgcolor="#587AAE">
						<td><p class="navigation"><xsl:value-of select="//content/Messages/Item"/></p></td>
						<td><p class="navigation"><xsl:value-of select="//content/Messages/NotApprovedCount"/></p></td>
						<td><p class="navigation"><xsl:value-of select="//content/Messages/CountVote"/></p></td>
						<td><p class="navigation">New</p></td>
						<!--td><p class="navigation"><xsl:value-of select="//content/Messages/MiddleRating"/></p></td-->
						<td><p class="navigation"><xsl:value-of select="//content/Messages/Rating"/></p></td>
					</tr>
					<xsl:apply-templates select="Ratings/row"/>				
				</table><br/>
				<xsl:apply-templates select="Ratings/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="Ratings/row">
		<tr bgcolor="#EBF6E4"> 
			<xsl:choose>			
				<xsl:when test="HasNew = CountVote">
					<xsl:attribute name="bgcolor">#FFC1C1</xsl:attribute>
				</xsl:when>
				<xsl:when test="HasNew > 0">
					<xsl:attribute name="bgcolor">#FFFFF0</xsl:attribute>
				</xsl:when>
			</xsl:choose>
			
			<!--xsl:if test="position() mod 2 != 0">
				<xsl:attribute name="bgcolor">#F7F7F7</xsl:attribute>
			</xsl:if-->
			<td>
				<a class="tableElements" href="comments.php?Item={Item}">
					<xsl:value-of select="Item"/>
				</a>
			</td>
			<td align="center">
				<xsl:value-of select="NotApprovedCount"/>
			</td>
			<td align="center">
				<xsl:value-of select="CountVote"/>
			</td>
			<td align="center">
				<xsl:if test="HasNew = CountVote"><xsl:attribute name="style">font-weight:bold;</xsl:attribute></xsl:if>			
				<xsl:value-of select="HasNew"/>
			</td>
			<!--td align="center">
				<xsl:value-of select="MiddleRating"/>
			</td-->
			<td align="center" bgcolor="#ffffff">
				<img src="images/stars{RoundRating}.gif" border="0" alt="{MiddleRating}"/>
			</td>
		</tr>
	</xsl:template>
	
</xsl:stylesheet>
