<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	
	<xsl:template match="TOOLBAR" name="TOOLBAR"> 
<!--		<fieldset class="sb-toolbar-fieldset">
			<legend class="sb-label-toolbar-title"><xsl:value-of select="@TITLE"/></legend>-->
			<xsl:if test="TOOLBAR-ITEM">
				<table cellspacing="0" border="0" style="border-collapse:collapse;">
					<tr>
						<xsl:apply-templates select="TOOLBAR-ITEM"/>
					</tr>
				</table>
			</xsl:if>
			<xsl:if test="TOOLBAR-FIELD">
				<table cellspacing="0" border="0" style="border-collapse:collapse;width:100%;">
					<xsl:for-each select="TOOLBAR-FIELD">
						<tr>
							<td valign="top">
								<xsl:apply-templates select="."/>
							</td>
						</tr>
					</xsl:for-each>
				</table>
			</xsl:if>
			<xsl:if test="OPERATIONS">
				<table cellspacing="0" border="0" style="border-collapse:collapse;width:100%;">
					<tr>
						<td valign="top" align="right">
							<xsl:apply-templates select="OPERATIONS"/>
						</td>
					</tr>
				</table>
			</xsl:if>
		<!--</fieldset>-->
	</xsl:template>

	<xsl:template match="TOOLBAR/TOOLBAR-ITEM/@ACTION">
		<xsl:choose>
			<xsl:when test="substring-before(.,':')='javascript'">
				<xsl:attribute name="onclick"><xsl:value-of select="."/></xsl:attribute>
				<xsl:attribute name="href">#</xsl:attribute>
			</xsl:when>
			<xsl:otherwise>
				<xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<xsl:template match="TOOLBAR/TOOLBAR-ITEM">
		<td valign="top">
			<table cellpadding="0" cellspacing="0" border="0" type="button" style="cursor:pointer;width:80px;">
				<tr>
					<td rowspan="2" style="width:0px;">
					</td>
					<td align="center" valign="middle">
						<a>
							<xsl:apply-templates select="@ACTION"/>
							<img border="0" alt="" width="32" height="32">
								<!--xsl:attribute name="src"><xsl:value-of select="$skinPath"/>/icons/<xsl:value-of select="@ICON"/></xsl:attribute-->
								<xsl:choose>
									<xsl:when test="@ICON">
										<xsl:attribute name="src"><xsl:value-of select="$skinPath"/>/icons/<xsl:value-of select="@ICON"/></xsl:attribute>
									</xsl:when>
									<xsl:otherwise>
										<xsl:attribute name="src"><xsl:value-of select="$skinPath"/>/images/<xsl:value-of select="@IMAGE"/></xsl:attribute>
									</xsl:otherwise>
								</xsl:choose>
								
							</img>
						</a>
					</td>
				</tr>
				<tr>
					<td align="center" class="sb-label-toolbar-title">
						<a style="color: Black; text-decoration: none;">
							<xsl:apply-templates select="@ACTION"/>
							<xsl:value-of select="@TITLE"/>
						</a>
					</td>
				</tr>
			</table>
		</td>	
	</xsl:template>
	
	<xsl:template match="TOOLBAR/OPERATIONS">
	<!--<xsl:if test="count(../../LIST/ITEM) &gt; 0">-->
		<table cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;" >
		<tr>
		<xsl:for-each select="OPERATION">
			<td style="padding-right: 4px;">
					<a href="#">
						<xsl:attribute name="onclick"><xsl:value-of select="@ACTION"/></xsl:attribute>
						<img border="0" alt="" width="16" height="16">
							<xsl:attribute name="src"><xsl:value-of select="$skinPath"/>/icons/<xsl:value-of select="@ICON"/></xsl:attribute>
						</img>
					</a>
			</td>
			<td style="padding-right: 8px;">
				<a href="#" style="color: Black;">
					<xsl:attribute name="onclick"><xsl:value-of select="@ACTION"/></xsl:attribute>
					<xsl:value-of select="@TITLE"/>
				</a>
			</td>
		</xsl:for-each>
		</tr>
		</table>
	<!--</xsl:if>-->
	</xsl:template>
	
</xsl:stylesheet>	