<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="html" indent="no"/>
<xsl:strip-space elements="*"/>
	<!--MENU-->
	<xsl:template match="MENU" mode="top">
		<xsl:apply-templates select="MENU-ITEM"  mode="top"/>
	</xsl:template>





	<!--MENU-ITEM-->
	<xsl:template match="MENU-ITEM"  mode="top">
   		<xsl:choose>
           <!-- active menu with link-->
           	<xsl:when test="MENU-ITEM[@ID=/LAYOUT/@ID]" >
				<td>
					<table cellpadding="0" cellspacing="0" border="0" summary="" bgcolor="#333333" style="height: 18px;">
						<tr>
							<td valign="bottom" style="background-image: url('images/amenu_tl.gif'); background-repeat: no-repeat;"><img src="images/amenu_bl.gif" border="0" alt=""/></td>
							<td><a href="{@HREF}" class="amenu"><xsl:value-of select="@TITLE" disable-output-escaping="yes"/></a></td>
							<td valign="bottom" style="background-image: url('images/amenu_tr.gif'); background-repeat: no-repeat;"><img src="images/amenu_br.gif" border="0" alt=""/></td>
						</tr>
					</table>
				</td>
            </xsl:when>
            <!-- active menu without link-->
            <xsl:when test="MENU-ITEM[@ID=/LAYOUT/@ID] or @ID=/LAYOUT/@ID" >
				<td>
					<table cellpadding="0" cellspacing="0" border="0" summary="" bgcolor="#333333" style="height: 18px;">
						<tr>
							<td valign="bottom" style="background-image: url('images/amenu_tl.gif'); background-repeat: no-repeat;"><img src="images/amenu_bl.gif" border="0" alt=""/></td>
							<td class="amenu"><xsl:value-of select="@TITLE" disable-output-escaping="yes"/></td>
							<td valign="bottom" style="background-image: url('images/amenu_tr.gif'); background-repeat: no-repeat;"><img src="images/amenu_br.gif" border="0" alt=""/></td>
						</tr>
					</table>
				</td>
            </xsl:when>
            <xsl:otherwise>
				<td><a href="{@HREF}" class="menu"><xsl:value-of select="@TITLE" disable-output-escaping="yes"/></a></td>
            </xsl:otherwise>
	    </xsl:choose>
		<xsl:if test="position()!=last()">
			<td width="10"><div style="width:5px; height:1px;"><spacer type="block" width="5" height="1"/></div></td>
			<td><img src="images/separator.gif" border="0" alt=""/></td>
			<td width="10"><div style="width:5px; height:1px;"><spacer type="block" width="5" height="1"/></div></td>
	</xsl:if>
	</xsl:template>	

</xsl:stylesheet>
