<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<xsl:template match="MENU-PANEL">
		<xsl:param name="panelId"><xsl:value-of select="@ID"/></xsl:param>
        <table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
			<xsl:attribute name="id"><xsl:value-of select="$panelId"/></xsl:attribute>				
			<tr style="cursor: pointer; height: 21px;">
				<xsl:attribute name="onclick">javascript:SBPanelToggle('<xsl:value-of select="$panelId"/>','<xsl:value-of select="$skinPath"/>/images/show.gif','<xsl:value-of select="$skinPath"/>/images/hide.gif' );</xsl:attribute>	
			
				<td class="SB_LeftMenu_panel_corner">
					<img src="/images/blank.gif" class="SB_LeftMenu_panel_corner"/>
				</td> 	
				<td class="SB_LeftMenu_panel_header" style="padding-bottom:;padding-top:;padding-left:;padding-right:;">
					<table cellpadding="0" cellspacing="0" border="0" style="width:100%;height:100%;">
						<tr>
							<td align="Left" class="SB_LeftMenu_panel_header_text"><xsl:value-of select="@TITLE"/></td>
							<td align="Right" valign="Middle">
								<img src="{$skinPath}/images/hide.gif">
									<xsl:attribute name="id"><xsl:value-of select="$panelId"/>_image</xsl:attribute>		
								</img>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td class="SB_LeftMenu_panel_content" colspan="2" valign="top" style="padding: 5px 0px;">
					<xsl:if test="MENU-PANEL-ITEM">				
						<table width="100%" border="0" cellpadding="0" cellspacing="0" >
							<xsl:for-each select="MENU-PANEL-ITEM">
							<tr><td align="left">
								<table cellpadding="0" cellspacing="0" border="0" style="height: 25px;">
<!--									<xsl:attribute name="onclick"><xsl:value-of select="@ACTION"/></xsl:attribute> -->
									<tr>
										<td class="SB_LeftMenuIcon">
											<xsl:if test="@SELECTED">
												<xsl:attribute name="class">SB_LeftMenuIconSelected</xsl:attribute>
											</xsl:if>
											<a>
												<xsl:choose>
													<xsl:when test="substring-before(@ACTION,':')='javascript'">
														<xsl:attribute name="onclick"><xsl:value-of select="@ACTION"/></xsl:attribute>
														<xsl:attribute name="href">#</xsl:attribute>
													</xsl:when>
													<xsl:otherwise>
														<xsl:attribute name="href"><xsl:value-of select="@ACTION"/></xsl:attribute>
													</xsl:otherwise>
												</xsl:choose>
												<img border="0" width="16" height="16" alt="">
													<xsl:attribute name="src"><xsl:value-of select="$skinPath"/>/<xsl:value-of select="@ICON"/></xsl:attribute>		
												</img>
											</a>
										</td>
										<td>
											<xsl:if test="@SELECTED">
												<xsl:attribute name="class">SB_LeftMenuItemBgSelected</xsl:attribute>
											</xsl:if>
											<a>
												<xsl:choose>
													<xsl:when test="@SELECTED">
														<xsl:attribute name="class">SB_LeftMenuItemTitleSelected</xsl:attribute>
													</xsl:when>
													<xsl:otherwise>
														<xsl:attribute name="class">SB_LeftMenuItemTitle</xsl:attribute>
													</xsl:otherwise>
												</xsl:choose>
												<xsl:choose>
													<xsl:when test="substring-before(@ACTION,':')='javascript'">
														<xsl:attribute name="onclick"><xsl:value-of select="@ACTION"/></xsl:attribute>
														<xsl:attribute name="href">#</xsl:attribute>
													</xsl:when>
													<xsl:otherwise>
														<xsl:attribute name="onclick">javascript:sbNavigationObject.go('<xsl:value-of select="@ACTION"/>');</xsl:attribute>
														<xsl:attribute name="href">#</xsl:attribute>
													</xsl:otherwise>
												</xsl:choose>
												<xsl:value-of select="@TITLE"/>
											</a>
										</td>
									</tr>	
								</table>
							</td></tr>
							</xsl:for-each>
						</table>
					</xsl:if>
				</td>
			</tr>
		</table>
		<input type="hidden" value="true" ><xsl:attribute name="name"><xsl:value-of select="$panelId"/>_hidden</xsl:attribute><xsl:attribute name="id"><xsl:value-of select="$panelId"/>_hidden</xsl:attribute></input>
		<br class="SB_LeftMenu_PanelsBreak"/>
	</xsl:template>

</xsl:stylesheet>

