<?xml version="1.0" encoding="windows-1251" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<!-- Applying root template -->
	<xsl:template match="/"><xsl:apply-templates/></xsl:template>
	
	<!-- 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:variable>

	<!-- Page content -->
	<xsl:template match="content">
	<table><tr>
	<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">admin_menus.php</xsl:with-param>
	</xsl:call-template>
	<xsl:if test="MaxCount=-1 or MaxCount&gt;count(menus/menu)">
	<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_item.php?menuId=<xsl:value-of select="MenuId"/></xsl:with-param>
	</xsl:call-template>
	</xsl:if>
	</tr></table><br/>

	<table border="0" cellpadding="0" cellspacing="0">
	<tr><td><p class="heading1"><xsl:value-of select="//content/Messages/List"/></p></td></tr>
	<tr><td><img src="images/pix.gif" width="1" height="7"/></td></tr>
	<tr><td><xsl:value-of select="//content/Messages/Edit"/>&amp;nbsp;"<a href="admin_menu.php?Id={MenuId}"><xsl:value-of select="MenuName"/></a>".</td></tr>
	<tr><td><img src="images/pix.gif" width="1" height="7"/></td></tr>
	<xsl:if test="error-messages">
	<tr><td><img src="images/pix.gif" width="1" height="7"/></td></tr>
	<tr><td><xsl:for-each select="error-messages/message"><p class="error"><xsl:value-of select="."/></p></xsl:for-each></td></tr>
	</xsl:if>
	</table>
	<br/>
	<xsl:choose><xsl:when test="menus/menu"><xsl:apply-templates select="menus"/></xsl:when><xsl:otherwise><p class="error"><xsl:value-of select="//content/Messages/NoList"/></p></xsl:otherwise></xsl:choose>
	</xsl:template>

	<xsl:template match="menus">
	<table border="0" cellpadding="2" cellspacing="0" width="650">
	<xsl:apply-templates select="menu"/>
	</table>
	</xsl:template>

	<xsl:template match="menu">
                <tr>
                    <td nowrap="">
					<xsl:attribute name="style">
					<xsl:choose>
						<xsl:when test="not(../../menu)">border: 1px solid #5A7EDC;</xsl:when>
						<xsl:otherwise>border: 1px solid #000000;</xsl:otherwise>
					</xsl:choose>
					<xsl:if test="Id=//page/content/Moved">background: #FFCDA4;</xsl:if>
					</xsl:attribute>
					<table border="0" cellpadding="0" cellspacing="0">
                    <tr>
                    	<td width="250" nowrap=""><a class="tableElements" href="{//page/@server-path}{//page/@app-path}/{Link}" title="Menu link is: {//page/@server-path}{//page/@app-path}/{Link}" target="_blank"><b><xsl:value-of select="Name"/></b></a><!--  <br/>(<a target="_blank" class="tableElements" href=""><xsl:value-of select="Link"/></a>) --></td>
                    </tr>
                    </table>
					</td>
					
					<xsl:if test="not(position()=1 and position()=last())">
						<td nowrap="" width="37">
						<xsl:if test="position()&gt;1"><xsl:attribute name="align">right</xsl:attribute></xsl:if>
						<xsl:attribute name="style">
							<xsl:choose>
								<xsl:when test="not(../../menu)">border: 1px solid #5A7EDC;border-left:none;</xsl:when>
								<xsl:otherwise>border: 1px solid #000000;border-left:none;</xsl:otherwise>
							</xsl:choose>
						<xsl:if test="Id=//page/content/Moved">background: #FFCDA4;</xsl:if>
						</xsl:attribute>
						<xsl:if test="position()&lt;last()"><a class="tableElements" href="admin_menu_item.php?event=MoveDown&amp;menuId={MenuId}&amp;Id={Id}&amp;ParentId={ParentId}"><img src="images/backward.gif" width="17" height="17" border="0" alt="{//content/Messages/GlobalDown}"/></a>&amp;nbsp;</xsl:if>
						<xsl:if test="position()&gt;1"><a class="tableElements" href="admin_menu_item.php?event=MoveUp&amp;menuId={MenuId}&amp;Id={Id}&amp;&amp;ParentId={ParentId}"><img src="images/forward.gif" width="17" height="17" border="0" alt="{//content/Messages/GlobalUp}"/></a></xsl:if>
						</td>
					</xsl:if>
					
					<td nowrap="">
					<xsl:attribute name="style">
					<xsl:choose>
						<xsl:when test="not(../../menu)">border: 1px solid #5A7EDC;border-left:none;</xsl:when>
						<xsl:otherwise>border: 1px solid #000000;border-left:none;</xsl:otherwise>
					</xsl:choose>
					</xsl:attribute>
					<xsl:call-template name="StandartOptions"><xsl:with-param name="EditLink">admin_menu_item.php</xsl:with-param><xsl:with-param name="Id" select="Id"/><xsl:with-param name="AndValue">&amp;menuId=<xsl:value-of select="MenuId"/></xsl:with-param></xsl:call-template>
					</td>
					<td width="50%"><img src="images/pix.gif" width="1" height="1"/></td>
                </tr>
				<xsl:choose>
				<xsl:when test="menu">
				<tr>
					<td colspan="4">
					<table border="0" cellpadding="0" cellspacing="0">
                    <tr>
                    	<td><img src="images/pix.gif" width="34" height="1"/></td>
                    	<td width="100%">
						<table border="0" cellpadding="2" cellspacing="0">
						<xsl:apply-templates select="menu"/>
	                    </table>
						</td>
                    </tr>
                    </table>
					</td>
				</tr>
				</xsl:when>
				<xsl:otherwise>
				<xsl:if test="not(../../menu)"><tr><td></td></tr></xsl:if>
				</xsl:otherwise>
				</xsl:choose>
	</xsl:template>
	
</xsl:stylesheet>
