<?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"/>
	
<!-- HOMEPAGE -->
	
	<xsl:template match="home">
		<div id="header" xmlns="http://www.w3.org/1999/xhtml">
			<div>		
				<h1 id="homeheader"><span class="note">Welcome to the</span><br/><xsl:value-of select="document(concat('sit_xml.php?id=', /page/@siteid))/site/name"/></h1>		
			</div>						
		</div>	
		
		<div id="homesplash" xmlns="http://www.w3.org/1999/xhtml">
			<div id="actidbot" class="clearfix">			
				<xsl:if test="document(concat('sit_xml.php?id=', /page/@siteid ))/site/course/image/@filename">
					<img src="{document(concat('sit_xml.php?id=', /page/@siteid ))/site/course/image/@filename}" alt="{document(concat('sit_xml.php?id=', /page/@siteid))/site/course/image/description}" id="homeimage"/>
				</xsl:if>
				<xsl:call-template name="homenav"/>
			</div>
			<div id="homeutilnav">
				<xsl:element name="a">
					<xsl:attribute name="href"><xsl:choose><xsl:when test="document(concat('sit_xml.php?id=', /page/@siteid ))/site/course/navigation/globalnav/page">page.php?id=<xsl:value-of select="document(concat('sit_xml.php?id=', /page/@siteid ))/site/course/navigation/globalnav/page/@id"/></xsl:when><xsl:otherwise>nocontent.html</xsl:otherwise></xsl:choose></xsl:attribute>
					<xsl:attribute name="onmouseover">MM_swapImage('start','','images/start_over.gif',1)</xsl:attribute>
					<xsl:attribute name="onmouseout">MM_swapImgRestore()</xsl:attribute>
					<xsl:attribute name="id">startbut</xsl:attribute>
					<img src="images/start.gif" alt="Start" id="start"/>
					</xsl:element>
				<div>
					<xsl:for-each select="document(concat('sit_xml.php?id=', /page/@siteid ))/site/course/navigation/utilitynav/page">
					<xsl:element name="a">
					<xsl:attribute name="href">page.php?id=<xsl:value-of select="@id"/></xsl:attribute>
					<xsl:attribute name="rel">subsection</xsl:attribute>
					<xsl:attribute name="class">homeutil</xsl:attribute>
					<xsl:if test="@id = $currentpage"><xsl:attribute name="style">display: none;</xsl:attribute></xsl:if>
					<img src="images/util_{name(document(concat('pag_xml.php?id=', @id))/page/*[3])}_icon.gif" alt="-"/>
					<xsl:choose>
						<xsl:when test="document(concat('pag_xml.php?id=', @id ))/page/name = 'Sitemap' and $condensed = 1">
							Table of Contents
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="document(concat('pag_xml.php?id=', @id ))/page/name"/>
						</xsl:otherwise>
					</xsl:choose>
					</xsl:element>
					</xsl:for-each>
					<a href="#" class="homeutil" onclick="window.print(); return false;" rel="print"><img src="images/util_print_icon.gif" alt="-"/>Print</a>
				</div>
			</div>
		</div>		
		<br xmlns="http://www.w3.org/1999/xhtml"/>
		<br xmlns="http://www.w3.org/1999/xhtml"/>		
		<xsl:for-each select="component">
			<xsl:call-template name="componentshell"/>	
		</xsl:for-each>
	</xsl:template>
	
</xsl:stylesheet>

