<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xslc="http://xslcomponents.org/TR/WD-xslc">
	<xsl:import href="../xslc.xsl"/>
	<xsl:import href="../Common.xsl"/>
	<xsl:import href="CalendarLayout.xsl"/>
	<xsl:template match="/">
		<xsl:apply-templates select="document"/>
	</xsl:template>
	<xsl:template match="document">
		<xsl:call-template name="xslc:Page">
			<xsl:with-param name="Title" select="/document/Locales/XMLC_Calendar"/>
			<xsl:with-param name="PageTitle">
				<img align="absmiddle" alt="{/document/Locales/XMLC_CalendarTitle}" border="0" src="{$XMLC_PictosPath}button_Calendar.gif"/>&#160;<xsl:value-of select="/document/Locales/XMLC_CalendarTitle"/>
			</xsl:with-param>
			<xsl:with-param name="Head">
				<link rel="stylesheet" type="text/css" href="{$XMLC_SkinPath}DelosPlanning.css"/>
			</xsl:with-param>
			<xsl:with-param name="ToolbarButtonsLeft">
				<ToolbarButton>
					<xsl:call-template name="ToolButtonRefresh"/>
				</ToolbarButton>
			</xsl:with-param>
			<xsl:with-param name="ToolbarButtonsRight">
				<xsl:call-template name="CommonToolbarButtonsRight"/>
			</xsl:with-param>
			<xsl:with-param name="ActivePageName">YearCalendar</xsl:with-param>
			<xsl:with-param name="Tabs">
				<Item Name="YearCalendar" Caption="{/document/Locales/XMLC_Calendar}" Hint="{/document/Locales/XMLC_Calendar}" HRef="{/document/Aliases/DelosPlanningDLL}XMLC_Calendar" ImagePath="{$XMLC_PictosPath}button_Calendar.gif"/>
			</xsl:with-param>
			<xsl:with-param name="Body">
				<xsl:apply-templates select="/document/Calendars"/>
				<xsl:call-template name="xslc:PoweredBy"/>
			</xsl:with-param>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Calendars">
		<xsl:variable name="Column">3</xsl:variable>
		<table cellpadding="2" cellspacing="0">
			<tr>
				<td>
					<a href="{/document/Aliases/DelosPlanningDLL}XMLC_Calendar?XMLC_DateValue={DateSteps/PrevYear}">
						<img alt="{/document/Locales/PreviousYear}" border="0" src="{$XMLC_PictosPath}ico_stepdouble_left.gif"/>
					</a>&#160;<a href="{/document/Aliases/DelosPlanningDLL}XMLC_Calendar?XMLC_DateValue={DateSteps/PrevYear}">
						<xsl:value-of select="/document/Locales/PreviousYear"/>
					</a>
				</td>
				<td colspan="{$Column - 2}">&#160;</td>
				<td align="right">
					<a href="{/document/Aliases/DelosPlanningDLL}XMLC_Calendar?XMLC_DateValue={DateSteps/NextYear}">
						<xsl:value-of select="/document/Locales/NextYear"/>
					</a>&#160;<a href="{/document/Aliases/DelosPlanningDLL}XMLC_Calendar?XMLC_DateValue={DateSteps/NextYear}">
						<img alt="{/document/Locales/NextYear}" border="0" src="{$XMLC_PictosPath}ico_stepdouble_right.gif"/>
					</a>
				</td>
			</tr>
			<xsl:for-each select="Calendar">
				<xsl:variable name="Position" select="position()"/>
				<xsl:if test="($Position - 1) mod $Column = 0">
					<tr>
						<xsl:apply-templates select="/document/Calendars/Calendar[(position() &gt;= $Position) and (position() &lt; $Position + $Column)]"/>
					</tr>
				</xsl:if>
			</xsl:for-each>
		</table>
	</xsl:template>
</xsl:stylesheet>
