<?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 background="images/menu_bg.gif" style="border: 1px solid #CBCBCB">
					<table cellpadding="0" cellspacing="0" border="0" height="28">
						<tr>
							<td width="20" style="padding-left: 5px;"><img src="images/lbullet.gif" border="0" alt=""/></td>
							<td width="8" style="background-image: url('images/bbullet.gif'); background-position: bottom; background-repeat: repeat-x;"><a href="{@HREF}"><img src="images/bullet.gif" border="0" alt=""/></a></td>
							<td style="background-image: url('images/bbullet.gif'); background-position: bottom; background-repeat: repeat-x;"><a href="{@HREF}" class="amenu"><xsl:value-of select="@TITLE" disable-output-escaping="yes"/></a></td>
							<td width="18" style="padding: 2px;" align="right" valign="top"><img src="images/bullet2.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 background="images/menu_bg.gif" style="border: 1px solid #CBCBCB">
					<table cellpadding="0" cellspacing="0" border="0" height="28">
						<tr>
							<td width="20" style="padding-left: 5px;"><img src="images/lbullet.gif" border="0" alt=""/></td>
							<td width="8" style="background-image: url('images/bbullet.gif'); background-position: bottom; background-repeat: repeat-x;"><img src="images/bullet.gif" border="0" alt=""/></td>
							<td class="amenu" style="background-image: url('images/bbullet.gif'); background-position: bottom; background-repeat: repeat-x;"><xsl:value-of select="@TITLE" disable-output-escaping="yes"/></td>
							<td width="18" style="padding: 2px;" align="right" valign="top"><img src="images/bullet2.gif" border="0" alt=""/></td>
						</tr>
					</table>
				</td>	
            </xsl:when>
            <xsl:otherwise>				
				<td background="images/menu_bg.gif" style="border: 1px solid #CBCBCB">
					<table cellpadding="0" cellspacing="0" border="0" height="28">
						<tr>
							<td width="20" style="padding-left: 5px;"><img src="images/lbullet.gif" border="0" alt=""/></td>
							<td width="8" style="background-image: url('images/bbullet.gif'); background-position: bottom; background-repeat: repeat-x;"><a href="{@HREF}"><img src="images/bullet.gif" border="0" alt=""/></a></td>
							<td style="background-image: url('images/bbullet.gif'); background-position: bottom; background-repeat: repeat-x;"><a href="{@HREF}" class="menu"><xsl:value-of select="@TITLE" disable-output-escaping="yes"/></a></td>
							<td width="18" style="padding: 2px;" align="right" valign="top"><img src="images/bullet2.gif" border="0" alt=""/></td>
						</tr>
					</table>
				</td>	
            </xsl:otherwise>
	    </xsl:choose>
		<xsl:if test="position()!=last()"> 		
			<td width="2"></td>
	</xsl:if>
	</xsl:template>	

</xsl:stylesheet>

