<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<xsl:output method="xml" indent="no"/>
	
	<xsl:include href="course_th3_com_link.xsl"/>
	<xsl:include href="course_th3_com_kl.xsl"/>
	<xsl:include href="course_th3_com_gallery.xsl"/>
	<xsl:include href="course_th3_com_news.xsl"/>
		
<!-- COMPONENT -->	
	
	<xsl:template match="component">	
		<xsl:param name="currentcall"><xsl:value-of select="@id"/></xsl:param>
		<xsl:param name="type"><xsl:value-of select="$comptype"/></xsl:param>
			<xsl:choose>
			<xsl:when test="$type = 'callout'">
			<div class="callout {$display}" xmlns="http://www.w3.org/1999/xhtml">
				<h4 class="call"><xsl:if test="icon != 0"><img src="images/call_icon_{icon}.gif" alt="-" class="icon"/></xsl:if><xsl:value-of select="document(concat('com_xml.php?id=', @id))/component/title"/></h4>
				<div class="callshell">	
					<xsl:call-template name="componentcore"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template>
				</div>
			</div>	
			</xsl:when>
			<xsl:otherwise>
				<xsl:call-template name="componentcore"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template>
			</xsl:otherwise>
			</xsl:choose>
	</xsl:template>
	
	<xsl:template name="componentcoretitle">
		<xsl:if test="$comptype != 'callout'">
		<h3 xmlns="http://www.w3.org/1999/xhtml"><xsl:value-of select="document(concat('com_xml.php?id=', $currentcomp))/component/title"/></h3>
		</xsl:if>
	</xsl:template>
	
	<xsl:template name="componentcore">
		<xsl:if test="$manager = 1">
		<xsl:if test="$type != 'callout'">
		<h3 xmlns="http://www.w3.org/1999/xhtml"><xsl:value-of select="title"/></h3>
		</xsl:if>
		</xsl:if>
		<!-- START HTMLAREA -->
		<xsl:value-of select="body" disable-output-escaping="yes"/>
		<!-- END HTMLAREA -->
		<xsl:apply-templates select="complink"/>	
		<xsl:apply-templates select="compkl"/>	
		<xsl:apply-templates select="compgallery"/>
		<xsl:apply-templates select="compnews"/>
		<br/><hr class="on" xmlns="http://www.w3.org/1999/xhtml"/>
	</xsl:template>
	
</xsl:stylesheet>
