﻿<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0">
	
	<xsl:output method="html" indent="yes"/>

	<xsl:template name="EmitRows">
		<xsl:param name="MenuItemList" />
	
		<xsl:if test="count($MenuItemList) != 0">
	    	<tr>
	        	<xsl:for-each select="$MenuItemList[position() &lt; 7]">
	            	<td width="80"><a href="{@frameurl}"><div class="Header" style="border-style:none"><xsl:value-of select="@disp"/></div>
		    		<div><img class="DBImage" src="{@imgurl}" alt="" width="60" height="55"/></div></a></td>
	        	</xsl:for-each>
	    	</tr>
	    	<xsl:call-template name="EmitRows">
	        	<xsl:with-param name="MenuItemList" select="$MenuItemList[position() &gt; 8]"/>
	    	</xsl:call-template>
		</xsl:if>
	
	</xsl:template> 
	
	<xsl:template match="/">
        <table width="100%" border="0" cellspacing="1" cellpadding="1">
            <xsl:apply-templates select="menu"/>
        </table>
	</xsl:template>
	
	<xsl:template match="menu">
	    <xsl:call-template name="EmitRows">
	        <xsl:with-param name="MenuItemList" select="./menuitem[@showdb='true']"/>
	    </xsl:call-template>
	</xsl:template> 
	
</xsl:stylesheet>