﻿<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:rs='urn:schemas-microsoft-com:rowset'
 	 xmlns:z='#RowsetSchema'
	xmlns:date="http://www.ora.com/XSLTCookbook/NS/dates"
   xml:space="default"
	version="1.0">

	<xsl:param name="category"></xsl:param>
	<xsl:param name="title"></xsl:param>
	<xsl:param name="path"></xsl:param>
	<xsl:param name="url"></xsl:param>
	<xsl:param name="items"></xsl:param>
	<xsl:param name="height"></xsl:param>
	<xsl:param name="citates"></xsl:param>
	<xsl:param name="limit" select="100"/>
	<xsl:param name="titleLimit" select="30"/>
	<xsl:strip-space elements="true"/>
	<xsl:output omit-xml-declaration="yes" />
	<xsl:variable name="quot" select="'&quot;'"/>

	<xsl:template match='//rs:data'>
		<script type='text/javascript'>
			function ShowNewsOverlay(title, text) {
			document.getElementById('nieuwsoverlaytitel').firstChild.innerHTML = title;
			document.getElementById('nieuwsoverlaytitelruimte').firstChild.innerHTML = title;
			document.getElementById('nieuwsoverlaytekst').innerHTML = text;
			document.getElementById('nieuwsoverlaytekstruimte').innerHTML = text;
			document.getElementById('nieuwsoverlay').style.visibility = 'visible';
			}
		</script>
		<div id="nieuwsoverlay" style="position: absolute; width: 521; visibility: hidden">
			<div style="background-color: white; position: absolute; top: 30px; left: 30px; width: auto;">
				<table cellpadding="15" cellspacing="15" width="461">
					<tr>
						<td>
							<div id="nieuwsoverlaytitel">
								<h1></h1>
							</div>
							<div id="nieuwsoverlaytekst">
							</div>
						</td>
					</tr>
				</table>
			</div>
			<a style="position: absolute; top: 35px; right: 32px" onclick="javascript:document.getElementById('nieuwsoverlay').style.visibility = 'hidden'">
				<table style="cursor: pointer">
					<tr>
						<td valign="middle">
							<h3>
								SLUITEN
							</h3>
						</td>
						<td>
							<img border="0" src="/_layouts/images/exitedit.gif"></img>
						</td>
					</tr>
				</table>
			</a>
			<table cellpadding="30" cellspacing="30" width="521" style="background-color: gray; filter: alpha(opacity=75)">
				<tr>
					<td>
						<div id="nieuwsoverlaytitelruimte">
							<h1></h1>
						</div>
						<div id="nieuwsoverlaytekstruimte">
						</div>
					</td>
				</tr>
			</table>
		</div>
		<table border='0' cellpadding='2' cellspacing='0' width='100%'>
			<tbody>
				<tr>
					<td>
						<div class="wccNewsOneTwo">
							<xsl:apply-templates select='z:row'>
								<xsl:sort select="@ows_Datum" order="descending"/>
							</xsl:apply-templates>
						</div>
						<xsl:variable name="rows" select="z:row" />
						<xsl:if test="count($rows) &lt; 1">
							<div style="padding:10px;">Er zijn geen nieuwsberichten aanwezig in deze categorie.</div>
						</xsl:if>
					</td>
				</tr>
			</tbody>
		</table>
	</xsl:template>

	<xsl:template match='z:row'>
		<xsl:if test="position() &lt; 3">
			<div class="wccNewsText"
			 onmouseover="this.className='wccNewsTextHover';" onmouseout="this.className='wccNewsText';">
				<xsl:attribute name="onclick">
					<!--<xsl:value-of select="concat('document.location=', $apos, '/Lists/Nieuwsberichten/DispFormWindexCC.aspx?ID=', @ows_ID, '&amp;Source=', $path, $apos)" />-->
					<xsl:value-of select="concat('ShowNewsOverlay(', $quot, @ows_LinkTitle, $quot, ', this.lastChild.innerHTML)')"/>
				</xsl:attribute>
				<xsl:choose>
					<xsl:when test="position() = 1">
						<xsl:attribute name="id">wccNewsOne</xsl:attribute>
						<xsl:attribute name="style">width: 246px;</xsl:attribute>
					</xsl:when>
					<xsl:otherwise>
						<xsl:attribute name="id">wccNewsTwo</xsl:attribute>
						<xsl:attribute name="style">width: 246px;</xsl:attribute>
					</xsl:otherwise>
				</xsl:choose>
				<xsl:value-of select='number(substring(@ows_Datum,9,2))'/>
				<xsl:variable name="mo">
					<xsl:value-of select='substring(@ows_Datum,6,2)'/>
				</xsl:variable>
				<xsl:choose>
					<xsl:when test="$mo = '01'"> januari </xsl:when>
					<xsl:when test="$mo = '02'"> februari </xsl:when>
					<xsl:when test="$mo = '03'"> maart </xsl:when>
					<xsl:when test="$mo = '04'"> april </xsl:when>
					<xsl:when test="$mo = '05'"> mei </xsl:when>
					<xsl:when test="$mo = '06'"> juni </xsl:when>
					<xsl:when test="$mo = '07'"> juli </xsl:when>
					<xsl:when test="$mo = '08'"> augustus </xsl:when>
					<xsl:when test="$mo = '09'"> september </xsl:when>
					<xsl:when test="$mo = '10'"> oktober </xsl:when>
					<xsl:when test="$mo = '11'"> november </xsl:when>
					<xsl:when test="$mo = '12'"> december </xsl:when>
				</xsl:choose>
				<xsl:value-of select='substring(@ows_Datum,1,4)'/>
				<br/>
				<span class="wccNewsHeader">
					<xsl:value-of select="@ows_LinkTitle"/>
				</span>
				<br />
				<div class="wccNewsBody">
					<xsl:value-of select="@ows_Body" disable-output-escaping="yes"/>
				</div>
			</div>
		</xsl:if>

		<xsl:if test="position() > 2 and position() &lt;= $items">
			<table width="100%">
				<tr>
					<td>
						<div class="wccNewsText"
							 onmouseover="this.className='wccNewsTextHover';" onmouseout="this.className='wccNewsText';">
							<xsl:attribute name="onclick">
								<!--<xsl:value-of select="concat('document.location=', $apos, '/Lists/Nieuwsberichten/DispFormWindexCC.aspx?ID=', @ows_ID, '&amp;Source=', $path, $apos)" />-->
								<xsl:value-of select="concat('ShowNewsOverlay(', $quot, @ows_LinkTitle, $quot, ', this.lastChild.innerHTML)')"/>
							</xsl:attribute>
							<xsl:choose>
								<xsl:when test="position() = 3">
									<xsl:attribute name="id">wccNewsThree</xsl:attribute>
								</xsl:when>
								<xsl:otherwise>
									<xsl:attribute name="id">wccNewsFour</xsl:attribute>
								</xsl:otherwise>
							</xsl:choose>
							<table border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td class="wccNewsTd1">
										<xsl:attribute name="style">vertical-align: top</xsl:attribute>
										<xsl:value-of select='number(substring(@ows_Datum,9,2))'/>
										<xsl:variable name="mo">
											<xsl:value-of select='substring(@ows_Datum,6,2)'/>
										</xsl:variable>
										<xsl:choose>
											<xsl:when test="$mo = '01'"> januari </xsl:when>
											<xsl:when test="$mo = '02'"> februari </xsl:when>
											<xsl:when test="$mo = '03'"> maart </xsl:when>
											<xsl:when test="$mo = '04'"> april </xsl:when>
											<xsl:when test="$mo = '05'"> mei </xsl:when>
											<xsl:when test="$mo = '06'"> juni </xsl:when>
											<xsl:when test="$mo = '07'"> juli </xsl:when>
											<xsl:when test="$mo = '08'"> augustus </xsl:when>
											<xsl:when test="$mo = '09'"> september </xsl:when>
											<xsl:when test="$mo = '10'"> oktober </xsl:when>
											<xsl:when test="$mo = '11'"> november </xsl:when>
											<xsl:when test="$mo = '12'"> december </xsl:when>
										</xsl:choose>
									</td>
									<td class="wccNewsTd2">
										<span class="wccNewsHeader">
											<xsl:value-of select="@ows_LinkTitle"/>
										</span>
									</td>
								</tr>
							</table>
							<div class="wccNewsBody" style="display: none">
								<xsl:value-of select="@ows_Body" disable-output-escaping="yes"/>
							</div>
						</div>
					</td>
				</tr>
			</table>
		</xsl:if>
	</xsl:template>
</xsl:stylesheet>
