<?xml version='1.0' encoding='ISO-8859-1' ?>
<!--	/*
	 *(C) Copyright 2000-2001 by Web2CAD AG.  All rights reserved.
	 *
	 * WEB2CAD PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 
	 * WEB2CAD SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
	 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.  
	 * WEB2CAD AG DOES NOT WARRANT THAT THE OPERATION OF THE
	 * PROGRAM WILL BE UNINTERRUPTED OR ERROR FREE.
         */
	 
        /*
	 * This is an example stylesheet for CatalogCreator 2.1.4 or later
	 */
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 
<xsl:output method="html" indent="no" encoding='utf-16' />

<xsl:template match="/"> 

<HTML>
  <HEAD>
  <TITLE>Navigation</TITLE>
  <link rel="stylesheet" type="text/css" href="../common/css/mainstyle.css" />
<SCRIPT language="JavaScript" src="textscripts/text.js"></SCRIPT>
</HEAD>
<BODY class="menuecolor" scroll="auto">
		<BR/>
		<!-- header -->
		<DIV class="navigationhead">
			<xsl:value-of select="//CATALOG/@name"/>
			<xsl:if test="//NAVIGATION/SEARCH/@id[.='content']">
				<a href="featuresearch.htm" target="cont">
					<xsl:attribute name="onMouseOver">status='';return true;</xsl:attribute>
					<script language="JavaScript">
					<xsl:comment>
						<![CDATA[
						document.writeln('<img src="../common/pic/search.gif" border="0" name="searchImg" alt="' + str_sm_whole_catalog + '"/>');
						]]>
					//</xsl:comment>
					</script>
				</a>
			</xsl:if>
		</DIV>
		<BR/>
		
		<!-- navigation -->
		<TABLE><xsl:apply-templates select="//ORGANISATION/CATALOG"/></TABLE>
</BODY>
</HTML>
</xsl:template>

<!-- outer template -->
<xsl:template match="ORGANISATION/CATALOG">
      <xsl:apply-templates/>
</xsl:template>


<!-- Categories -->
<xsl:template match="NAVIGATION/PRODUCT_CATEGORY|SELECT/PRODUCT_CATEGORY">
	<DIV class="einrueckung">
		<TR>	
			<xsl:choose>
            			<!-- an expanded category: display - and text --> 
				<xsl:when test="@category[.='open']">
					<A><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute>
					<TD>
					<A ondragstart="return false;">
					<xsl:attribute name="HREF"><xsl:value-of select="../@file" />.xml#<xsl:value-of select="@id" /></xsl:attribute>
					<xsl:attribute name="onMouseOver">status='<xsl:value-of select="SELECT/@name" />';return true;</xsl:attribute>
               				<IMG SRC="../common/pic/minus.gif" border="0"/></A></TD> 
               
			   		<TD><A ondragstart="return false;">
					<xsl:attribute name="id">
						<xsl:choose>
							<xsl:when test="../@file[.='navigation']">ebene1</xsl:when>
							<xsl:otherwise>ebene2-x</xsl:otherwise>
						</xsl:choose></xsl:attribute>
               				<xsl:attribute name="HREF"><xsl:value-of select="../@file" />.xml#<xsl:value-of select="@id" /></xsl:attribute>
					<xsl:attribute name="onMouseOver">status='<xsl:value-of select="SELECT/@name" />';return true;</xsl:attribute>
               				<xsl:value-of select="SELECT/@name"/></A>
					</TD>
					<TD>
					<xsl:if test="@id[.=//NAVIGATION/SEARCH/@id]">
						<a href="featuresearch.htm" target="cont">
							<xsl:attribute name="onMouseOver">status='';return true;</xsl:attribute>
							<script language="JavaScript">
							<xsl:comment>
								var tooltip_text = ' <xsl:value-of select="SELECT/@name"/>'
								<![CDATA[
								document.writeln('<img src="../common/pic/search.gif" border="0" name="searchImg" alt="' + str_sm_category + tooltip_text + '"/>');
								]]>
							//</xsl:comment>
							</script>
						</a>
					</xsl:if>
					</TD>
					</A>
				</xsl:when>

				<!-- a collapsed category: display + and text -->
            			<xsl:otherwise>
					<A><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute>
            				<TD>
					<A ondragstart="return false;"><xsl:attribute name="HREF"><xsl:value-of select="SELECT/@file" />.xml#<xsl:value-of select="@id" /></xsl:attribute>
					<xsl:attribute name="onMouseOver">status='<xsl:value-of select="SELECT/@name" />';return true;</xsl:attribute>
              				<IMG SRC="../common/pic/plus.gif" border="0"/></A>
					</TD>
              				<TD><A ondragstart="return false;">
					<xsl:attribute name="id">
						<xsl:choose>
							<xsl:when test="../@file[.='navigation']">ebene1</xsl:when>
							<xsl:otherwise>ebene2-x</xsl:otherwise>
						</xsl:choose>
					</xsl:attribute>
					<xsl:attribute name="HREF"><xsl:value-of select="SELECT/@file" />.xml#<xsl:value-of select="@id" /></xsl:attribute>
					<xsl:attribute name="onMouseOver">status='<xsl:value-of select="SELECT/@name" />';return true;</xsl:attribute>
              				<xsl:value-of select="SELECT/@name"/></A>
					</TD>
					</A>
				</xsl:otherwise>                  
			</xsl:choose>
		</TR>
		
		<!-- process subelements -->
		<TR>
			<TD></TD><TD><TABLE><xsl:apply-templates select="node()"/></TABLE></TD>
		</TR>
	</DIV>
</xsl:template>


<!-- Products -->
<xsl:template match="SELECT/SELECT|NAVIGATION/SELECT">
	<DIV>
		<TR>
			<!-- +/-/-> image & link to page/another navigation page -->
			<TD>
			<xsl:choose>
				<xsl:when test="@category">
					<!-- this is an element with subelements, could be an assembly with subassemblies -->							
					<xsl:choose>	
						<!-- if element is open, show - and set link to navigation page of parent element -->
						<xsl:when test="@category[.='open']">
							<A ondragstart="return false;">
							<xsl:attribute name="onMouseOver">status='<xsl:value-of select="@name" />';return true;</xsl:attribute>
							<xsl:attribute name="HREF"><xsl:value-of select="../@navfile" />.xml</xsl:attribute><IMG SRC="../common/pic/minus.gif" border="0" /></A>
						</xsl:when>
								
						<!-- if element is closed, show + and set link to navigation page of element -->
						<xsl:otherwise>
							<A ondragstart="return false;">
							<xsl:attribute name="onMouseOver">status='<xsl:value-of select="@name" />';return true;</xsl:attribute>
							<xsl:attribute name="HREF"><xsl:value-of select="@navfile" />.xml</xsl:attribute><IMG SRC="../common/pic/plus.gif" border="0" /></A>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:when>
				<xsl:otherwise>
					<!-- element has no child elements in navigation -->
					<A target="cont" ondragstart="return false;">
					<xsl:attribute name="onMouseOver">status='<xsl:value-of select="@name" />';return true;</xsl:attribute>
					<xsl:attribute name="HREF"><xsl:value-of select="@file" />.xml</xsl:attribute><IMG SRC="../common/pic/li.gif" border="0" /></A>
				</xsl:otherwise>	
			</xsl:choose>
			</TD>
             
			<!-- name of product --> 
			<TD>
             		<A target="cont" ondragstart="return false;" id="linkproduct">
			<xsl:attribute name="onMouseOver">status='<xsl:value-of select="@name" />';return true;</xsl:attribute>
			<xsl:attribute name="HREF"><xsl:value-of select="@file" />.xml</xsl:attribute><xsl:value-of select="@name"/></A></TD>
		</TR>
		
		<!-- process subelements -->
		<TR>
			<TD></TD><TD><TABLE><xsl:apply-templates select="node()"/></TABLE></TD>
		</TR>
	</DIV>
</xsl:template>


<!-- Links -->
<xsl:template match="LINK">
		<TR>
			<!-- +/-/-> image & link to page/another navigation page -->
			<TD>
					<!-- element has no child elements in navigation -->
					<A target="cont" ondragstart="return false;">
					<xsl:attribute name="target"><xsl:value-of select="@linktarget"/></xsl:attribute>
					<xsl:attribute name="onMouseOver">status='<xsl:value-of select="@name" />';return true;</xsl:attribute>
					<xsl:attribute name="href"><xsl:value-of select="@file" /></xsl:attribute><IMG SRC="../common/pic/li.gif" border="0" /></A>
			</TD>

			<TD>
             		<A  id="linkproduct" ondragstart="return false;"><xsl:attribute name="target"><xsl:value-of select="@linktarget"/></xsl:attribute>
					<xsl:attribute name="onMouseOver">status='<xsl:value-of select="@name" />';return true;</xsl:attribute>
					<xsl:attribute name="href"><xsl:value-of select="@file" /></xsl:attribute><xsl:value-of select="@name"/></A></TD>
		</TR>
</xsl:template>

</xsl:stylesheet>
