<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="html"
    indent="yes"
    omit-xml-declaration="yes"
    encoding="utf-8"
    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
  <xsl:template match="/d">
    <html>
      <head>
        <title>Classements <xsl:value-of select="courses/c[string(@sel)='1' or count(/d/courses/c[@id!='T'])=1]/@nc"/> - HOKA LES TEMPLIERS - LiveTrail®</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="pragma" content="no-cache"/>
  <meta http-equiv="cache-control" content="no-cache, must-revalidate"/>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
  <link rel="stylesheet" type="text/css" media="screen" href="js/theme-ui/ui.all.css"/>
  <link rel="stylesheet" type="text/css" media="screen" href="st.css?v=20240403"/>
  <link rel="stylesheet" type="text/css" media="screen" href="style.css?y=2025-3"/>
  <link rel="icon" type="image/png" href="im/favicon.png" />
  <!--[if IE]>
  <link rel="shortcut icon" type="image/x-icon" href="im/favicon.ico" />
  <![endif]-->
  	<script type="text/javascript">
		var isIframeMode=false;
	</script>
		<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/mob_swipe.js"></script>
	<script type="text/javascript" src="js/raphael.js"></script>
	<script type="text/javascript" src="js/aplweb.scrollbars.js"></script>
	<script type="text/javascript" src="js/jquery-ui.js"></script>
	<script type="text/javascript" src="js/util.js?v20231003"></script>
	<script type="text/javascript" src="js/jquery.countdown.js"></script>
	<script type="text/javascript" src="js/httpReq.js"></script>
	  <script type="text/javascript" src="js/gm.js"></script>
    
<!-- Google tag (gtag.js) -->
<script async="1" src="https://www.googletagmanager.com/gtag/js?id=G-TK9N9GRYWX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-TK9N9GRYWX');
</script>

<!-- Google tag (gtag.js) -->
<script async="1" type="text/javascript" src="https://www.googletagmanager.com/gtag/js?id=G-9B5975ZT9G"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-9B5975ZT9G');
</script>
<script type="text/javascript">
  
	/* Hotjar */
	(function(h,o,t,j,a,r){
		h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
		h._hjSettings={hjid:2201953,hjsv:6};
		a=o.getElementsByTagName('head')[0];
		r=o.createElement('script');r.async=1;
		r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
		a.appendChild(r);
	})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');

</script>
</head>
<body>
	<script type="text/javascript">
	!function(f,b,e,v,n,t,s)
	{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
	n.callMethod.apply(n,arguments):n.queue.push(arguments)};
	if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
	n.queue=[];t=b.createElement(e);t.async=!0;
	t.src=v;s=b.getElementsByTagName(e)[0];
	s.parentNode.insertBefore(t,s)}(window, document,'script', 'https://connect.facebook.net/en_US/fbevents.js');
	fbq('init', '176863753641136');
		fbq('track', 'PageView');
</script>
<noscript>
	<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=176863753641136&amp;ev=PageView&amp;noscript=1" />
	</noscript>
			<script src="js/jspdf.debug.js"></script>
			<script src="js/jspdf.plugin.autotable.js"></script>
			<script type="text/javascript">
				var logoimg=null;
				<xsl:text>var logo='</xsl:text><xsl:value-of select="classement/@logo"/><xsl:text>';</xsl:text>
				<xsl:text>var ttb='</xsl:text><xsl:value-of select="classement/@txtbas"/><xsl:text>';</xsl:text>
				var logoratio=0;
			</script>
			<script src="js/classement.js"></script>
          <div id="main" >
	<div id="bandeau" ></div>
		<div id="lg" >
	<label>LANGUE	&#160;</label>
	<span class="sel" title="Français">FR</span>		|	<a href="javascript:setCookie('langue_affich','_en');unsetCookie('homeTip');unsetCookie('runnerTip');location.reload(true);" title="English">EN</a>		|	<a href="javascript:setCookie('langue_affich','_es');unsetCookie('homeTip');unsetCookie('runnerTip');location.reload(true);" title="Español">ES</a>		|	<a href="javascript:setCookie('langue_affich','_it');unsetCookie('homeTip');unsetCookie('runnerTip');location.reload(true);" title="Italiano">IT</a>		|	<a href="javascript:setCookie('langue_affich','_de');unsetCookie('homeTip');unsetCookie('runnerTip');location.reload(true);" title="Deutsch">DE</a>				</div>
	<div id="main2"  >
		<table id="tmenu">
	  <thead>
		<tr>
		  		  <td width="200">
			<form class="rech" name="recherch" method="POST" style="margin:0;white-space:nowrap;" action="coureur.php" onsubmit="return getValue(document.recherch.rech)!='';">
			  <input type="text" name="rech" value="{@rech}" onfocus="this.select();"/>
			  <input type="submit" value="" class="btnfd"/>
			</form>
		  </td>
		  <td><span><a href="./">Accueil</a></span></td>
		  <td style="cursor:pointer" onclick="dispMenu();"><div>Infos</div></td>
		  <td style="cursor:pointer" onclick="dispMenu();"><div>Coureurs</div></td>
		  <td style="cursor:pointer" onclick="dispMenu();"><div>Suivis</div></td>
		  		  			  <td style="text-align:right;width:180px;">
								<span><a href="javascript:winlog()">S'identifier...</a></span>
							  </td>
			  		</tr>
	  </thead>
	  <tbody>
		<tr id="tbmenu" style="display:none" >
		  <td><div id="menulogo">&#160;</div></td>
		  <td>
			&#160;		  </td>
		  <td>
			<ul>
			  <li><a href="stats.php">Stat.</a></li>			  <li><a href="parcours.php">Parcours</a></li>			</ul>
		  </td>
		  <td>
			<ul>
			  <li><a href="coureur.php">Fiche coureur</a></li>
			  <li><a href="favoris.php">Mes coureurs favoris</a></li>
			  <li><a href="lstfavoris.php">Liste des favoris</a></li>			  <li><a href="compare.php">Comparaison de coureurs</a></li>			  			  <li><a href="gps.php">Suivi GPS ou prédictif</a></li>			  					<li><a href="lstCoureurs.php">Liste des coureurs</a></li>
				  					<li><a href="lstPartants.php">Liste des partants</a></li>
								</ul>
		  </td>
		  <td>
			<ul>
			  <li><a href="teteCourse.php">Tête de course</a></li>			  <li><a href="prochains.php">Prochains arrivants</a></li>			  <li><a href="passages.php">Tableau des passages</a></li>			  <li class="sel"><a href="classement.php">Classements</a></li>			  			  			  <li><a href="classementPoint.php">Classements par point</a></li>			  			  			  <li><a href="tabAbd.php">Tableau Abandons</a></li>			  			  			  <li>&#160;</li>
			</ul>
		  </td>
		  <td>&#160;</td>		</tr>
	  </tbody>
	</table>
			<div id="poplogin" title="S'identifier..." style="display:none" >
		  <form id="FormLog" name="FormLog" method="post" onsubmit="return false;" >
			<div>Amis organisateurs, identifiez-vous pour accéder à vos services réservés.<br/>Amis spectateurs, le suivi de course est en libre accès : pas besoin de vous identifier...<br/></div>
			<div><span>Login : </span><input type="text" name="login" value="" maxlength="256" size="20"/></div>
			<div><span>Mot de passe : </span><input type="password" name="pass" maxlength="256" size="15"/></div>
			<label><input name="keepConn" value="1" type="checkbox" checked="checked"/>Rester connecté</label>
			<div id="btnUser"><input type="submit" value="Valider" onclick="setUser();"/></div>
		  </form>
		</div>
			<div id="layhelprech" class="helper" style="display:none" >
	  <div class="br">
		<strong>RECHERCHE PAR :</strong><br/>&#160; - Le <strong>dossard</strong> d'un coureur<br/>    &#160; - Le <strong>nom</strong> d'un coureur, d'une équipe, ou d'un club<br/>    &#160; - Le <strong>prénom</strong> d'un coureur<br/>	  </div>
	</div>
		<style>
	.v3link {
		display:block;
		width: 99%;
		margin: auto;
		text-align:center;
		font-family: Calibri, "DejaVu Sans Condensed", Roboto, Arial, Verdana, sans-serif;
		font-weight: 400;
		font-size: 1rem;
		line-height: 1.5;
		color: #568498;
		text-decoration: none;
		text-transform: uppercase;
		background-color: white;
		border: 2px solid #568498;
		border-top: none;
		border-radius: 0px 0px 10px 10px;
		cursor: pointer;
		padding: 8px 0px 4px 0px;
	}
	.v3link:hover {
		color: black;
		text-decoration: underline;
	}
	</style>
	<a href="https://templiers.v3.livetrail.net/fr/2025" class="v3link">Découvrez la nouvelle version LiveTrail v3 &gt;</a>
	          <div id="gtete">
	<div id="ictete"/>
	<h1>Classements		<a href="#" onclick="openSearch(); return false;" style="text-decoration:none">🔍</a></h1>
	<xsl:if test="count(courses/c) &gt; 0">		<script type="text/javascript">
			<xsl:if test="@export != ''">
				function expTo(mode) {
					<xsl:if test="count(courses/c) &gt; 0">
						if($("#chxCourse").val()=="") {
							alert("Veuillez choisir une course pour obtenir le fichier.");
							return;
						}
					</xsl:if>
					<xsl:if test="count(cat/c) &gt; 0">
						if($("#chxCat").val()=="") {
							alert("Veuillez choisir une catégorie pour obtenir le fichier.");
							return;
						}
					</xsl:if>
					<xsl:if test="count(pts/p) &gt; 0">
						if($("#chxPt").val()=="") {
							alert("Veuillez choisir un point pour obtenir le fichier.");
							return;
						}
					</xsl:if>
					<xsl:if test="count(etp/e) &gt; 0">
						if($("#chxEtp").val()=="") {
							alert("Veuillez choisir une étape pour obtenir le fichier.");
							return;
						}
					</xsl:if>
					document.Chx.target="_blank";
					document.Chx.mode.value=mode;
					document.Chx.submit();
					document.Chx.target="";
					document.Chx.mode.value="";
				}
			</xsl:if>
			<xsl:if test="count(cat/c) &gt; 0">
				var _allcats={};
				<xsl:for-each select="courses/c">
					<xsl:variable name="selcatcourse" select="@id"/>
					_allcats["<xsl:value-of select="@id"/>"]=[''
						<xsl:for-each select="/d/cat/c">
							<xsl:if test="$selcatcourse = 'T' or (string(@c) = '' and (string(@id)='scratch' or string(@id)='all')) or contains(@c, concat('|',$selcatcourse,'|'))">
								,{id:"<xsl:value-of select="@id"/>", n:"<xsl:call-template name="getCategName">
											<xsl:with-param name="id" select="@id" />
											<xsl:with-param name="n" select="@n" />
										</xsl:call-template><xsl:if test="string(@descat)!=''"> (<xsl:value-of select="string(@descat)"/>)</xsl:if>", sel:"<xsl:value-of select="string(@sel)"/>" }
							</xsl:if>
						</xsl:for-each>
					];
				</xsl:for-each>
			</xsl:if>
			<xsl:if test="count(etp/e) &gt; 0">
				var _alletps={};
				<xsl:for-each select="courses/c">
					<xsl:variable name="seletpcourse" select="@id"/>
					_alletps["<xsl:value-of select="@id"/>"]=[''
						<xsl:for-each select="/d/etp/e">
							<xsl:if test="$seletpcourse = 'T' or string(@c) = '' or @c=$seletpcourse">
								,{id:"<xsl:value-of select="@id"/>", n:"<xsl:value-of select="@n"/>", sel:"<xsl:value-of select="string(@sel)"/>"}
							</xsl:if>
						</xsl:for-each>
					];
				</xsl:for-each>
			</xsl:if>
			<xsl:if test="count(pts/p) &gt; 0">
				var _allpts={};
				<xsl:for-each select="courses/c">
					<xsl:variable name="selptscourse" select="@id"/>
					_allpts["<xsl:value-of select="@id"/>"]=[''
						<xsl:for-each select="/d/pts/p">
							<xsl:if test="$selptscourse = 'T' or contains(@c, concat('|',$selptscourse,'|'))">
								,{id:"<xsl:value-of select="@idpt"/>", n:"<xsl:value-of select="@n"/>", sel:"<xsl:value-of select="string(@sel)"/>", sel2:"<xsl:value-of select="string(@sel2)"/>"}
							</xsl:if>
						</xsl:for-each>
					];
				</xsl:for-each>
			</xsl:if>
			<xsl:if test="count(pays/p) &gt; 0">
				var _allpays={};
				<xsl:for-each select="courses/c">
					<xsl:variable name="selpayscourse" select="@id"/>
					_allpays["<xsl:value-of select="@id"/>"]=[''
						<xsl:for-each select="/d/pays/p">
							<xsl:variable name="selpayspays" select="@id"/>
							<xsl:if test="$selpayscourse = 'T' or contains(@c, concat('|',$selpayscourse,'|'))">
								,{id:"<xsl:value-of select="@id"/>", n:"<xsl:choose>
										<xsl:when test="$selpayspays='all'">Toutes les nationalités</xsl:when>
										<xsl:otherwise>
											<xsl:value-of select="@n"/>
										</xsl:otherwise></xsl:choose>", sel:"<xsl:value-of select="string(@sel)"/>"}
							</xsl:if>
						</xsl:for-each>
					];
				</xsl:for-each>
			</xsl:if>
		</script>
		<form name="Chx" id="Chx" method="POST">
			<div style="float:left;min-width:300px;">
				<xsl:if test="count(courses/c) &gt; 0">
				<div class="chx">
					<div>Choisir la course</div>
					<xsl:choose>
						<xsl:when test="count(courses/c[string(@id)!='T'])&gt;1">
							<select id="chxCourse" name="course">
								<xsl:choose>
									<xsl:when test="count(cat/c) &gt; 0 and count(pts/p) &gt; 0 and count(pays/p) &gt; 0"><xsl:attribute name="onchange">selCat();selPts();selPays();</xsl:attribute></xsl:when>
									<xsl:when test="count(cat/c) &gt; 0 and count(etp/e) &gt; 0 and count(pays/p) &gt; 0"><xsl:attribute name="onchange">selCat();selEtp();selPays();</xsl:attribute></xsl:when>
									<xsl:when test="count(cat/c) &gt; 0 and count(pays/p) &gt; 0"><xsl:attribute name="onchange">selCat();selPays();</xsl:attribute></xsl:when>
									<xsl:when test="count(pts/p) &gt; 0 and count(pays/p) &gt; 0"><xsl:attribute name="onchange">selPts();selPays();</xsl:attribute></xsl:when>
									<xsl:when test="count(etp/e) &gt; 0 and count(pays/p) &gt; 0"><xsl:attribute name="onchange">selEtp();selPays();</xsl:attribute></xsl:when>
									<xsl:when test="count(cat/c) &gt; 0 and count(etp/e) &gt; 0"><xsl:attribute name="onchange">selCat();selEtp();</xsl:attribute></xsl:when>
									<xsl:when test="count(cat/c) &gt; 0 and count(pts/p) &gt; 0"><xsl:attribute name="onchange">selCat();selPts();</xsl:attribute></xsl:when>
									<xsl:when test="count(cat/c) &gt; 0"><xsl:attribute name="onchange">selCat();</xsl:attribute></xsl:when>
									<xsl:when test="count(pays/p) &gt; 0"><xsl:attribute name="onchange">selPays();</xsl:attribute></xsl:when>
									<xsl:when test="count(pts/p) &gt; 0"><xsl:attribute name="onchange">selPts();</xsl:attribute></xsl:when>
									<xsl:when test="count(etp/e) &gt; 0"><xsl:attribute name="onchange">selEtp();</xsl:attribute></xsl:when>
								</xsl:choose>
								<xsl:if test="string(courses/c[1]/@id) != 'T'">
									<option value="">-</option>
								</xsl:if>
								<xsl:for-each select="courses/c">
									<xsl:choose>
										<xsl:when test="string(@id) = 'T'">
											<option value="T">
												<xsl:if test="string(@sel) = '1'"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>
												Toutes les courses											</option>
										</xsl:when>
										<xsl:otherwise><option value="{@id}"><xsl:if test="string(@sel) = '1'"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:value-of select="@nc"/></option></xsl:otherwise>
									</xsl:choose>
								</xsl:for-each>
							</select>
						</xsl:when>
						<xsl:otherwise>
							<input type="hidden" id="chxCourse" name="course" value="{courses/c[string(@id)!='T'][1]/@id}"/>
							<xsl:value-of select="courses/c[string(@id)!='T'][1]/@nc"/>
						</xsl:otherwise>
					</xsl:choose>
					<span style="display:block;position:relative;">
						<a href="javascript:keepMem();" class="keep" id="keeplink">&gt; Garder mes choix en mémoire</a>
						<span id="keepok" class="keep">&gt; Choix mémorisés... &lt;</span>
					</span>
				</div>
				</xsl:if>
				<xsl:if test="count(cat/c) &gt; 0">
					<div class="chx">
						<div>Choisir la catégorie</div>
						<select id="chxCat" name="cat"></select>
					</div>
				</xsl:if>
				<xsl:if test="count(etp/e) &gt; 0">
					<div class="chx">
						<div>Choisir l'étape</div>
						<select id="chxEtp" name="etp"></select>
					</div>
				</xsl:if>
				<xsl:if test="count(pts/p) &gt; 0">
					<div class="chx">
						<div>
							Choisir le point							<xsl:if test="string(pts/@pt2) = '1'">&#160;1</xsl:if>
						</div>
						<select id="chxPt" name="pt">
							<xsl:if test="string(pts/@pt2) = '1'">
								<xsl:attribute name="onchange">
									if(this.selectedIndex&gt;this.form.pt2.selectedIndex) this.form.pt2.selectedIndex=this.selectedIndex;
								</xsl:attribute>
							</xsl:if>
						</select>
					</div>
				</xsl:if>
				<xsl:if test="count(pays/p) &gt; 0">
					<div class="chx">
						<div>Choisir la nationalité CIO</div>
						<select id="chxPays" name="pays">
												</select>
					</div>
				</xsl:if>
				<xsl:if test="string(pts/@pt2) = '1'">
					<div class="chx">
						<div>
							Choisir le point 2
						</div>
						<select name="pt2" id="chxPt2">
							<xsl:attribute name="onchange">
								if(this.selectedIndex&lt;this.form.pt.selectedIndex) this.form.pt.selectedIndex=this.selectedIndex;
							</xsl:attribute>
						</select>
					</div>
				</xsl:if>
				<xsl:if test="string(@fromto) = '1'">
					<div class="chx">
						<div>
							Afficher les coureurs						</div>
						<p>
							du &#160;<input type="text" id="chxFrom" name="from" value="{string(@from)}" maxlength="6" style="width:35px;"/>e							&#160;au &#160;<input type="text" id="chxTo" name="to" value="{string(@to)}" maxlength="6" style="width:35px;"/>e						</p>
					</div>
				</xsl:if>
				<xsl:if test="string(@byhour) != ''">
					<div class="chx">
						<div>
							Afficher en						</div>
						<p>
							<label>
								<input type="radio" name="byhour" id="chxByhour0" value="0">
									<xsl:if test="string(@byhour)!='1'"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if>
								</input>
								Temps							</label><br/>
							<label>
								<input type="radio" name="byhour" id="chxByhour1" value="1">
									<xsl:if test="string(@byhour)='1'"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if>
								</input>
								Heures							</label>
						</p>
					</div>
				</xsl:if>
								<div style="clear:both;text-align:right;padding-top:10px;">
					<a class="btn" style="padding-left:40px; text-align:right;">
						<xsl:attribute name="href">
							<xsl:choose>
								<xsl:when test="string(courses/@submit) = ''">javascript:document.Chx.submit();</xsl:when>
								<xsl:otherwise>javascript:<xsl:value-of select="string(courses/@submit)"/></xsl:otherwise>
							</xsl:choose>
						</xsl:attribute>
						Valider					</a>
				</div>
			</div>
							<xsl:if test="@export != ''">
					<input type="hidden" name="mode" value=""/>
					<div style="float:right;margin-right:10px;">
						<div class="chx" style="float:right;width:auto;max-width:150px;text-align:right;">
							<div>Télécharger au format</div>
							<p>
								<xsl:if test="contains(@export,'pdf')"><a href="javascript:expTo('pdf')">PDF</a> | </xsl:if>
															</p>
							<xsl:if test="contains(@export,'lotpdf') and count(cat/c) &gt; 0">
								<div style="float:right;width:auto;margin-top:8px;">
									<a href="javascript:" onclick="$('#lotpdfCourse').val($('#chxCourse').val());$('#lotpdfEtp').val($('#chxEtp').val());$('#lotpdfModetemps').val($('.custom input[name=modetemps]:checked').val());$('#popLotpdf').dialog('open');return false;">Téléchargement Multi-PDF</a>
								</div>
							</xsl:if>
							<xsl:if test="contains(@export,'pdfwithinter') ">
								<div style="clear:both;float:right;width:auto;margin-top:8px;">
									<input type="hidden" value="" name="dispCP" />
									Avec Intermédiaires : <a href="javascript:addInter('html')" >View</a>, <a href="javascript:addInter('pdf')" >PDF</a><xsl:if test="contains(@export,'xlswithinter') ">, <a href="javascript:addInter('xls')" >XLS</a></xsl:if>
								</div>
							</xsl:if>
							<xsl:if test="contains(@export,'totalxls')">
								<div style="clear:both;float:right;width:auto;margin-top:8px;">
									<a href="javascript:expTo('totalxls')">Téléchargement Total Excel</a>
								</div>
							</xsl:if>
						</div>
					</div>
				</xsl:if>
							<xsl:if test="count(pub)&gt;0">
				<div style="float:right;margin-right:10px;width:350px;padding:10px 10px 0 0;">
					<xsl:copy-of select="pub/child::node()"/>
				</div>
			</xsl:if>
		</form>
	</xsl:if></div>
<xsl:if test="contains(@export,'lotpdf') and count(cat/c) &gt; 0">
	<div class="pop" id="popLotpdf" title="Téléchargement Multi-PDF">
		<div style="text-align:center">
			<form name="lotpdf" target="_blank" method="post" onsubmit="$('#popLotpdf').dialog('close');">
				<input type="hidden" name="mode" value="lotpdf"/>
				<input type="hidden" name="course" id="lotpdfCourse" value=""/>
				<input type="hidden" name="etp" id="lotpdfEtp" value=""/>
				<input type="hidden" name="modetemps" id="lotpdfModetemps" value=""/>
				<table border="1" id="catlotpdf">
				</table>
				<input type="submit" value="Valider"/>
			</form>
		</div>
	</div>
</xsl:if>
<div id="endgtete"></div>
          <style>
           #scrollZone table td, #fullScrollZone table td, .fixedCol table td{
			   padding:0 5px !important;
		   }
          </style>
                    <div id="content">
			<xsl:if test="count(classement)&gt;0">
				<xsl:variable name="cltmainscratch" select="contains(cat/c[string(@sel)='1']/@id,'scratch')"/>
				<h3>
					<xsl:value-of select="courses/c[string(@sel)='1' or count(/d/courses/c[@id!='T'])=1]/@nc"/> - Classements<xsl:text> </xsl:text> 
					<xsl:call-template name="getCategName">
					   <xsl:with-param name="id" select="cat/c[string(@sel)='1']/@id" />
					   <xsl:with-param name="n" select="cat/c[string(@sel)='1']/@n" />
					</xsl:call-template>
					<xsl:text> </xsl:text> 
					<xsl:value-of select="pays/p[string(@sel)='1']/@n"/>
				</h3>
				<div style="margin-top: -20px;margin-bottom: 20px; font-size: 10px;">
					<a href="reclam.php">Reclamation</a>
				</div>
				<div id="scrollZone">
					<table id="resultTable">
						<xsl:variable name="noclass" select="string(classement/c[1]/@class)!=''"/>
						<xsl:variable name="nocat" select="count(classement/c[@cat != '']) = 0"/>
						<xsl:variable name="noclasscat" select="not($nocat) and count(classement/c[string(@classcat) != '']) &gt; 0"/>
						<thead>
							<tr>
								<xsl:if test="$noclass">
									<th>
										Clas.										<xsl:if test="not($cltmainscratch)"><br/><xsl:value-of select="cat/c[string(@sel)='1']/@n"/></xsl:if>
									</th>
								</xsl:if>
								<xsl:if test="string(/d/classement/c/@doss)!=''">
									<th class="nopdf">Doss.</th>
								</xsl:if>
								<th>
									<xsl:if test="count(classement/c/eq)&gt;0">Equipe / </xsl:if>
									Prénom Nom								</th>
								<xsl:if test="string(/d/classement/c[@club!='']/@club)!=''">
									<th class="nopdf" >Club <xsl:if test="count(classement/c/comm)&gt;0"> / Remarques</xsl:if></th>
								</xsl:if>
								<xsl:if test="string(/d/classement/c[@entrp!='']/@entrp)!=''">
									<th>Enterprise</th>
								</xsl:if>
								<xsl:if test="not($nocat)">
									<th>Cat.</th>
								</xsl:if>
								<xsl:if test="$noclass and $noclasscat">
									<th>
										<xsl:choose>
											<xsl:when test="not($cltmainscratch) or count(/d/pays/p[string(@sel)='1'])=1">Clas.<br/>scratch</xsl:when>
											<xsl:otherwise>Clas.<br/>cat.</xsl:otherwise>
										</xsl:choose>
									</th>
								</xsl:if>						
								<xsl:if test="count(/d/points/p)&gt;0">
										<xsl:for-each select="/d/points/p">
											<th><xsl:value-of select="@name"/></th>
										</xsl:for-each>
									</xsl:if>
								<xsl:choose>
									<xsl:when test="number(classement/@bypts) = 1"><th>Points</th></xsl:when>
										<xsl:otherwise>
										<th>											
											<xsl:if test="string(classement/c[1]/@tpsr)!=''">
												Temps<br/>  (Officiel // Réel)											</xsl:if>
											
											<xsl:if test="string(classement/c[1]/@tpsr)=''">
												Temps											</xsl:if>
										</th>
										</xsl:otherwise>
								</xsl:choose>
								<xsl:if test="$noclass">
									<th>Ecart /<br/>1er</th>
								</xsl:if>
								<xsl:if test="string(/d/classement/c[@cio!='']/@cio)!='' or string(/d/classement/c[@pays!='']/@pays)!=''">
									<th class="nopdf">Nationalité</th>
								</xsl:if>
							</tr>
						</thead>
						<tbody>
							<xsl:if test="count(classement/c) = 0">
								<tr><td colspan="9">
									Pas de coureur trouvé dans cette catégorie								</td></tr>
							</xsl:if>
							<xsl:for-each select="classement/c">
								<tr>
									<xsl:if test="position()=1"><xsl:attribute name="class">first</xsl:attribute></xsl:if>
									<xsl:if test="(position() mod 2) != 1"><xsl:attribute name="class">even</xsl:attribute></xsl:if>
									<xsl:if test="$noclass">
										<td>
											<xsl:choose>
												<xsl:when test="not($noclasscat) or $cltmainscratch and count(/d/pays/p[string(@sel)='1'])=0"><xsl:value-of select="@class"/></xsl:when>
												<xsl:otherwise><xsl:value-of select="@classcat"/></xsl:otherwise>
											</xsl:choose>
										</td>
									</xsl:if>
									<xsl:if test="string(/d/classement/c/@doss)!=''">
										<td class="nopdf">
											<xsl:call-template name="getLinkDoss">
												<xsl:with-param name="doss" select="@doss"/>
											</xsl:call-template>
										</td>
									</xsl:if>
									<td>
										<xsl:choose>
											<xsl:when test="string(@sx)='F' or string(@sx)='W'">
												<div style="color:#d90e7d;float:right;width:15px;">♀</div>
											</xsl:when>
																					</xsl:choose>
										<span class="bibforpdf" style="display:none"><xsl:value-of select="@doss"/> - </span>
																					<xsl:value-of select="@prenom"/><xsl:text> </xsl:text><xsl:value-of select="@nom"/>
																					<xsl:if test="string(@nomSuite)!=''">
											<xsl:text> - </xsl:text><xsl:value-of select="@nomSuite"/>
										</xsl:if>
										<xsl:if test="count(eq)&gt;0">
											<span style="font-size:0.9em;">
												<xsl:for-each select="eq">
													<br/><span style="padding-left:10px">
														<xsl:value-of select="@pos"/> - 
																													<xsl:value-of select="@prenom"/><xsl:text> </xsl:text><xsl:value-of select="@nom"/>
																												</span>
												</xsl:for-each>
											</span>
										</xsl:if>
										<span class="clubforpdf" style="display:none">
											<xsl:value-of select="@club"/>
										</span>
									</td>
									<xsl:if test="string(/d/classement/c[@club!='']/@club)!=''">
										<td class="nopdf" style="white-space:normal">
											<xsl:value-of select="@club"/>											<xsl:if test="count(comm)&gt;0">
												<xsl:if test="string(@club)!=''"><br/></xsl:if>												<xsl:value-of select="comm/child::node()"/>
											</xsl:if>
										</td>
									</xsl:if>
									<xsl:if test="string(/d/classement/c[@entrp!='']/@entrp)!=''">
										<td><xsl:value-of select="@entrp"/></td>
									</xsl:if>
									<xsl:if test="not($nocat)">
										<td><xsl:value-of select="@cat"/></td>
									</xsl:if>
									<xsl:if test="$noclass and $noclasscat">
										<td>
											<xsl:choose>
												<xsl:when test="$cltmainscratch and count(/d/pays/p[string(@sel)='1'])=0 and string(@cat) != ''"><xsl:value-of select="@classcat"/></xsl:when>
												<xsl:when test="$cltmainscratch and count(/d/pays/p[string(@sel)='1'])=0 and string(@cat) = ''"></xsl:when>
												<xsl:otherwise><xsl:value-of select="@class"/></xsl:otherwise>
											</xsl:choose>
										</td>
									</xsl:if>
									<xsl:if test="count(/d/points/p)&gt;0">
										<xsl:variable name="curr" select="." />	
										<xsl:for-each select="/d/points/p">
											<xsl:variable name="pid" select="@id" />
											<td><xsl:value-of select="$curr/inter[@id=$pid]/@tps"/></td>
										</xsl:for-each>
									</xsl:if>
									
									<td>
										<xsl:if test="string(@ptn)!=''">
											<i>(<xsl:value-of select="@ptn"/>)</i><br/>
										</xsl:if>
										
										<xsl:if test="string(@tpsr)!=''">
											<xsl:value-of select="@tps"/> // <xsl:value-of select="@tpsr"/>
											<xsl:if test="count(tpi)&gt;0">
												<span style="font-size:0.9em;">
													<xsl:for-each select="tpi">
														<br/><xsl:if test="@t!=''">(<xsl:value-of select="@t"/>)</xsl:if>
													</xsl:for-each>
												</span>
											</xsl:if>
										</xsl:if>
											
										<xsl:if test="string(@tpsr)=''">
											<xsl:value-of select="@tps"/>
											<xsl:if test="count(tpi)&gt;0">
											<span style="font-size:0.9em;">
												<xsl:for-each select="tpi">
													<br/><xsl:if test="@t!=''">(<xsl:value-of select="@t"/>)</xsl:if>
												</xsl:for-each>
											</span>
											</xsl:if>
										</xsl:if>
										
									</td>
									<xsl:if test="$noclass">
										<td><xsl:value-of select="@ecart"/></td>
									</xsl:if>
									<xsl:if test="string(/d/classement/c[@cio!='']/@cio)!='' or string(/d/classement/c[@pays!='']/@pays)!=''">
										<td class="nopdf" >
											<xsl:choose>
												<xsl:when test="string(@cio)!='' and string(@pays)!=''"><xsl:value-of select="@cio"/> (<xsl:value-of select="@pays"/>)</xsl:when>
												<xsl:when test="string(@cio)!=''"><xsl:value-of select="@cio"/></xsl:when>
												<xsl:when test="string(@pays)!=''"><xsl:value-of select="@pays"/></xsl:when>
											</xsl:choose>
										</td>
									</xsl:if>
								</tr>
							</xsl:for-each>
						</tbody>
					</table>
				</div>
			</xsl:if>
          </div>
          <xsl:if test="count(/d/error)&gt;0 and string(/d/@rech)=''">
<div id="content"><h3>Une erreur est survenue :
<xsl:copy-of select="/d/error/child::node()"/>
</h3></div>
</xsl:if>
				  <div id="parten">
			<span class="l"></span>
			<div>PARTENAIRES</div>
			<img src="images/parten_horiz.jpg"/>
			<span class="r"></span>
		  </div>
				<div id="botmain">
						<div style="float:right;">
				Powered by <a href="https://livetrail.net" target="_blank"><img style="position:relative; top:3px;" src="im/miniLogo.png"/></a>&#160;
			</div>
			<a href="reclam.php">Contact</a>		</div>
	</div>
</div>
      </body>
    </html>
  </xsl:template>
  <xsl:template name="getLinkDoss">
    <xsl:param name="doss"/>
    <xsl:choose>
		<xsl:when test="contains($doss,',')">
			<a href="coureur.php?rech={substring-before($doss,',')}"><xsl:value-of select="substring-before($doss,',')"/></a>, 
			<xsl:call-template name="getLinkDoss">
				<xsl:with-param name="doss" select="substring-after($doss,',')"/>
			</xsl:call-template>
		</xsl:when>
		<xsl:otherwise><a href="coureur.php?rech={$doss}"><xsl:value-of select="$doss"/></a></xsl:otherwise>
    </xsl:choose>
  </xsl:template>
  <!-- Renvoie le nom d'une categ potentiellement générique -->
<xsl:template name="getCategName">
	<xsl:param name="id"/>
	<xsl:param name="n"/>
	<xsl:choose>
		<xsl:when test="string($id)='scratch'">Scratch</xsl:when>
		<xsl:when test="string($id)='scratchH'">Scratch Hommes</xsl:when>
		<xsl:when test="string($id)='scratchF'">Scratch Femmes</xsl:when>
		<xsl:when test="string($id)='scratchMx'">Equipes Mixtes</xsl:when>
		<xsl:when test="string($id)='all'">Toutes catégories</xsl:when>
		<xsl:when test="string($id)='onlyH'">Hommes</xsl:when>
		<xsl:when test="string($id)='onlyF'">Femmes</xsl:when>
		<xsl:when test="string($id)='Mx'">Equipes Mixtes</xsl:when>
		<xsl:when test="string($id)='H'">Equipes Hommes</xsl:when>
		<xsl:when test="string($id)='F'">Equipes Femmes</xsl:when>
		
		<xsl:when test="string($n)!=''"><xsl:value-of select="$n"/></xsl:when>
		<xsl:otherwise><xsl:value-of select="$id"/></xsl:otherwise>
	</xsl:choose>
</xsl:template>

<!-- Format de time avec jour/heure Jr. hh:mm -->
<xsl:template name="fmt-dtjt">
    <xsl:param name="j"/>
    <xsl:param name="t"/>
    <xsl:choose>
      <xsl:when test="$j=1">Lu</xsl:when>
      <xsl:when test="$j=2">Ma</xsl:when>
      <xsl:when test="$j=3">Me</xsl:when>
      <xsl:when test="$j=4">Je</xsl:when>
      <xsl:when test="$j=5">Ve</xsl:when>
      <xsl:when test="$j=6">Sa</xsl:when>
      <xsl:when test="$j=7">Di</xsl:when>
    </xsl:choose>. <xsl:value-of select="concat(substring-before($t,':'),':',substring-before(substring-after($t,':'),':'))" />
  </xsl:template>
  
  <!-- Format de date jj/mm/aaaa -->
  <xsl:template name="fmt-d">
    <xsl:param name="d"/>
    <xsl:value-of select="substring-after(substring-after($d,'-'),'-')" />/<xsl:value-of select="substring-before(substring-after($d,'-'),'-')" />/<xsl:value-of select="substring-before($d,'-')" />
  </xsl:template>
  <!-- Format de datetime jj/mm/aaaa hh:mm:ss -->
  <xsl:template name="fmt-dt">
    <xsl:param name="dt"/>
    <xsl:value-of select="substring-after(substring-after(substring-before($dt,' '),'-'),'-')" />/<xsl:value-of select="substring-before(substring-after($dt,'-'),'-')" />/<xsl:value-of select="substring-before($dt,'-')" /><xsl:text> </xsl:text>
    <xsl:value-of select="substring-after($dt,' ')" />
  </xsl:template>
  
  <!-- Format de nombre -->
  <xsl:template name="fmt-f">
    <xsl:param name="v"/>
    <xsl:param name="format"/>
    <xsl:variable name="fmt"><xsl:choose><xsl:when test="string($format)=''">#,##0</xsl:when><xsl:otherwise><xsl:value-of select="$format"/></xsl:otherwise></xsl:choose></xsl:variable>
    <xsl:choose>
		<xsl:when test="string($v) = 'Infinity'">-</xsl:when>
					<xsl:otherwise><xsl:value-of select="translate(translate(format-number($v, $fmt),',',' '),'.',',')" /></xsl:otherwise>
		    </xsl:choose>
  </xsl:template>

  <xsl:template name="fmt-i">
	<xsl:param name="v"/>
			<xsl:value-of select="translate(format-number($v, '#,##0'), ',', ' ')" />
	  </xsl:template>

<!-- convertit un temps en secondes en hh:mm -->
  <xsl:template name="sec2time">
    <xsl:param name="sec"/>
    <xsl:if test="$sec&lt;0">-</xsl:if><xsl:value-of select="format-number(floor(($sec*($sec&gt;=0)-$sec*($sec&lt;0)) div 3600), '0')" />:<xsl:value-of select="format-number(floor((($sec*($sec&gt;=0)-$sec*($sec&lt;0)) mod 3600) div 60), '00')" />
  </xsl:template>
  
  <xsl:template name="sec2timefull">
    <xsl:param name="sec"/>
    <xsl:if test="$sec&lt;0">-</xsl:if><xsl:value-of select="format-number(floor(($sec*($sec&gt;=0)-$sec*($sec&lt;0)) div 3600), '0')" />:<xsl:value-of select="format-number(floor((($sec*($sec&gt;=0)-$sec*($sec&lt;0)) mod 3600) div 60), '00')" />:<xsl:value-of select="format-number($sec mod 60, '00')" />
  </xsl:template>

<!-- convertit un temps numérique en heures en hh:mm:ss -->
<xsl:template name="hour2time">
    <xsl:param name="h"/>
	<xsl:choose>
    <xsl:when test="$h&lt;0">-</xsl:when>
	<xsl:otherwise>
		<xsl:value-of select="format-number(floor($h), '00')" />:<xsl:value-of select="format-number(floor( ($h - floor($h))*60 ), '00')" />:<xsl:value-of select="format-number(round( ($h*60 - floor($h*60))*60 ), '00')" />
	</xsl:otherwise>
	</xsl:choose>
  </xsl:template>
  
<!-- convertit un temps en minutes en mm:ss -->  
  <xsl:template name="minutes2pace">
    <xsl:param name="minutes"/>
    <xsl:if test="$minutes&lt;0">-</xsl:if><xsl:value-of select="format-number(floor($minutes), '00')" />:<xsl:value-of select="format-number(round(($minutes - floor($minutes)) * 60), '00')" />
  </xsl:template>

  
  <xsl:template name="calc-vit">
    <xsl:param name="dist"/>
    <xsl:param name="tps"/>
    <xsl:param name="pace"/>
	<xsl:choose>
		<xsl:when test="string($pace)='1'">
			<xsl:call-template name="minutes2pace">
				<xsl:with-param name="minutes" select="60 div (($dist) div $tps)"/>
			</xsl:call-template>
		</xsl:when>
		<xsl:when test="string($pace)='2'">
			<xsl:call-template name="minutes2pace">
				<xsl:with-param name="minutes" select="60 div ((10 * $dist) div $tps)"/>
			</xsl:call-template>
		</xsl:when>
		<xsl:otherwise>
			<xsl:call-template name="fmt-f">
				<xsl:with-param name="v" select="($dist) div $tps"/>
				<xsl:with-param name="format" select="'0.00'"/>
			</xsl:call-template>
		</xsl:otherwise>
	</xsl:choose>
  </xsl:template>
  
</xsl:stylesheet>
