<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:template match="/">		
			<xsl:apply-templates select="menubar" />		
	</xsl:template>
	<xsl:template match="menubar">		
	<TABLE cellSpacing="0" class="TopMenu">
			<TR ALIGN='left' VALIGN='center'>			
				<xsl:for-each select="menu">				
					<A ID='start'>
						<TD align='left'>
						<DIV class='clsMenuBarCell'>
							<xsl:choose>
								<xsl:when test="item">
									<xsl:attribute name="ONMOUSEOVER">startIt('menu<xsl:value-of select="position()"/>',this,0)</xsl:attribute>
									<xsl:value-of select="name" />
								</xsl:when>
								<xsl:when test="link">
									<xsl:attribute name="ONMOUSEOVER">hideDiv(0);</xsl:attribute>
									<xsl:attribute name="ONMOUSEOUT">stateChange('',this,'')</xsl:attribute>
									<xsl:attribute name="ONCLICK">Select('<xsl:value-of select="link" />','<xsl:value-of select="VisitedMenu" />','<xsl:value-of select="MId" />','<xsl:value-of select="name" />','<xsl:value-of select="AccessRights" />','<xsl:value-of select="menuname" />','<xsl:value-of select="MyMenu" />','<xsl:value-of select="HelpPath" />','<xsl:value-of select="ScrId" />','<xsl:value-of select="MenuPath" />','<xsl:value-of select="ScreenType" />')</xsl:attribute>
									<xsl:value-of select="name" />
								</xsl:when>
							</xsl:choose>
						 </DIV>	
						</TD>
					</A>					
				</xsl:for-each>
			</TR>
		</TABLE>
		<!-- write out the hidden divs for submenus -->
		<xsl:for-each select="menu">
			<xsl:call-template name="submenu">
				<xsl:with-param name="parent">menu</xsl:with-param>
				<xsl:with-param name="level">0</xsl:with-param>								
			</xsl:call-template>
		</xsl:for-each>
	</xsl:template>
	<xsl:template name="submenu">
		<xsl:param name="parent" />
		<xsl:param name="level" />		
		<xsl:variable name="name">
			<xsl:value-of select="$parent" />
			<xsl:value-of select="position()" />
		</xsl:variable>
		<DIV ID='submenu' CLASS='clsMenu'>					
			<xsl:attribute name='ID'>
				<xsl:value-of select="$name" />
			</xsl:attribute>			
			<xsl:for-each select="item">			
				<xsl:choose>					
					<xsl:when test="item"> <!-- submenu -->															
					<xsl:if test="position() &lt;= last()">																					
							<SPAN CLASS='cellOff' ONMOUSEOUT="stateChange('',this,'')">													
									<xsl:attribute name="ID"><xsl:value-of select="$name" />_span<xsl:value-of select="position()" /></xsl:attribute>
									<xsl:attribute name="Tag"><xsl:value-of select="position()" /></xsl:attribute>
								<!-- Commented BY RPR 03-06-05 For Disable Submenu Click Event -->
								<!--	<xsl:attribute name="ONCLICK">Select('<xsl:value-of select="link" />','<xsl:value-of select="VisitedMenu" />','<xsl:value-of select="MId" />','<xsl:value-of select="name" />','<xsl:value-of select="AccessRights" />','<xsl:value-of select="menuname" />','<xsl:value-of select="MyMenu" />','<xsl:value-of select="HelpPath" />','<xsl:value-of select="ScrId" />','<xsl:value-of select="MenuPath" />','<xsl:value-of select="ScreenType" />')</xsl:attribute> --> 
									<xsl:attribute name="ONMOUSEOVER">stateChange('<xsl:value-of select="$name" /><xsl:value-of select="position()" />',this, '<xsl:value-of select="$level+1" />');</xsl:attribute>
									<IMG ALIGN="right" VSPACE="2" HEIGHT="10" WIDTH="10" BORDER="0" SRC="/Images/rarrow.gif" NAME='arrow' />							
									<xsl:value-of select="name" />							
							</SPAN>
							<BR />
						</xsl:if>										
					</xsl:when>
					<xsl:otherwise> <!-- leaf -->
					<xsl:if test="position() &lt;= last()">																										
						<SPAN CLASS='cellOff' onMouseOut="stateChange('',this,'')">							
							<xsl:attribute name="Tag"><xsl:value-of select="position()" /></xsl:attribute>		
							<xsl:attribute name="ONMOUSEOVER">stateChange('',this,'',<xsl:value-of select="position()" />);hideDiv(<xsl:value-of select="$level+1" />)</xsl:attribute>
							<xsl:attribute name="ID"><xsl:value-of select="$name" />_span<xsl:value-of select="position()" /></xsl:attribute>							
							<xsl:attribute name="ONCLICK">Select('<xsl:value-of select="link" />','<xsl:value-of select="VisitedMenu" />','<xsl:value-of select="MId" />','<xsl:value-of select="name" />','<xsl:value-of select="AccessRights" />','<xsl:value-of select="menuname" />','<xsl:value-of select="MyMenu" />','<xsl:value-of select="HelpPath" />','<xsl:value-of select="ScrId" />','<xsl:value-of select="MenuPath" />','<xsl:value-of select="ScreenType" />')</xsl:attribute>							
							<xsl:value-of select="name" />												
						</SPAN>											
						<BR />	
					</xsl:if>								
					</xsl:otherwise>
				</xsl:choose>				
			</xsl:for-each>
		</DIV>
		<!-- recurse submenus -->
		<xsl:for-each select="item">
			<xsl:if test="item">
				<xsl:call-template name="submenu">
					<xsl:with-param name="parent">
						<xsl:value-of select="$name" />
					</xsl:with-param>
					<xsl:with-param name="level">
						<xsl:value-of select="$level+1" />
					</xsl:with-param>					
				</xsl:call-template>
			</xsl:if>
		</xsl:for-each>		
	<link rel="stylesheet" type="text/css" href="/Styles/NewMenu.css"></link>
	<script language="javascript" src="/Scripts/NewMenu.js"></script>
	</xsl:template>		
</xsl:stylesheet>
