<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:output method="html"/>

	<xsl:template match="/">
		<div id="EventsCalendar">
			<xsl:apply-templates select="@name" />
			<xsl:apply-templates select="//calendar" />
		</div>
	</xsl:template>

	<xsl:template match="calendar">
		<table class="cal">
			<xsl:apply-templates select="//weekdays" />
			<xsl:apply-templates select="week" />
		</table>
		<table class="nav">
			<tr>
				<td onclick="_EventsCalendar.backOneMonth();"><a href="javascript:void(0);">&lt;</a></td>
				<td>
					<h4><xsl:value-of select="@name" /></h4>
					<center>
						<a id="EventsCalendar_thisdate" href="javascript:_EventsCalendar.toTodaysDate();">(return to today's date)</a>
					</center>
				</td>
				<td onclick="_EventsCalendar.forwardOneMonth();"><a href="javascript:void(0);">&gt;</a></td>
			</tr>
		</table>
	</xsl:template>

	<xsl:template match="week">
		<tr>
		<xsl:apply-templates select="date" />
		</tr>
	</xsl:template>

	<xsl:template match="date">
		<td onmouseover="if (this.className!='outOfMonth') this.className='on';">
			<xsl:attribute name="onmouseout">
				if (this.className=='on') this.className='<xsl:value-of select="@type" />';
			</xsl:attribute>
			<xsl:attribute name="class"><xsl:value-of select="@type" /></xsl:attribute>
			<xsl:if test="not(string(@day))">&#160;</xsl:if>
			<xsl:value-of select="@day" disable-output-escaping="yes" />
			<xsl:apply-templates select="event" />
		</td>
	</xsl:template>

	<xsl:template match="event">
		<p class="event">
			<xsl:value-of select="name" disable-output-escaping="yes" />
		</p>
	</xsl:template>
			

	<xsl:template match="weekdays">
		<thead>
			<xsl:apply-templates select="day" />
		</thead>
	</xsl:template>

	<xsl:template match="day">
		<td>
			<xsl:if test="not(string(@abbr))">&#160;</xsl:if>
			<xsl:value-of select="@abbr" disable-output-escaping="yes" />
		</td>
	</xsl:template>

</xsl:stylesheet>
