<?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>
          <xsl:choose>
            <xsl:when test="count(fiche)=0">Pas de fiche trouvée</xsl:when>
            <xsl:when test="count(fiche)=1 and count(fiche/pts)=1">Coureur <xsl:value-of select="fiche/@doss"/> - 
									<xsl:value-of select="fiche/identite/@prenom"/><xsl:text> </xsl:text><xsl:value-of select="fiche/identite/@nom"/>
									- <xsl:value-of select="courses/c[@id=/d/fiche/@c]/@nc"/>
			</xsl:when>
            <xsl:otherwise>Recherche : <xsl:value-of select="@rech"/></xsl:otherwise>
          </xsl:choose>
          - LiveTrail®
        </title>
        <xsl:if test="string(fiche/state/@code) = 'f'">
			<meta property="og:title"><xsl:attribute name="content"><xsl:value-of select="fiche/@doss"/> - 
									<xsl:value-of select="fiche/identite/@prenom"/><xsl:text> </xsl:text><xsl:value-of select="fiche/identite/@nom"/>
									- <xsl:value-of select="courses/c[@id=/d/fiche/@c]/@nc"/> - LiveTrail®</xsl:attribute>
			</meta>
			<meta property="og:description">
				<xsl:attribute name="content">
											<xsl:value-of select="fiche/identite/@prenom"/><xsl:text> </xsl:text><xsl:value-of select="fiche/identite/@nom"/>
											- Finisher ! - <xsl:value-of select="courses/c[@id=/d/fiche/@c]/@nc"/>
				</xsl:attribute>
			</meta>
		</xsl:if>
        <xsl:if test="count(fiche)=1 and number(fiche/@nocarto)!=1">
			<script type="text/javascript" src="data/gmData_{fiche/@c}.js?v=3"></script>
			<script type="text/javascript" src="data/kmData_{fiche/@c}.js?v=3"></script>
			<link rel="stylesheet" href="js/leaflet1.3.css" />
			<script src="js/leaflet1.3.js"></script>
										<script src="js/leaflet-layers/IGN.js"></script>
						<script src="js/leaflet-layers/OSM.js"></script>
			<script src="js/leaflet-layers/TileLayer.collection.js"></script>
        </xsl:if>
          <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 type="text/javascript" src="js/morris.min.js"></script>
		<script type="text/javascript" src="js/lt.chart.js"></script>
        <script type="text/javascript" src="js/fc.js?v=20231003"></script>
        <script type="text/javascript" src="js/blowfish.js"></script>
        <script type="text/javascript">
          var carte=null;
          			var is_carto_SwissTopo=false;
		  		  			var key={
				ign:"2xyxfx0ztk5667ii7kc82eh3"
			};
		            var lastidpt='<xsl:value-of select="/d/fiche/pass/e[position()=last()]/@idpt"/>';
          <xsl:if test="count(fiche)=1 and number(fiche/@nocarto)!=1">
	          var kmpts=kmxy_<xsl:value-of select="/d/fiche/@c"/>;
          </xsl:if>
          var lastLoc=null;
          <xsl:if test="count(/d/fiche/loc)>=1">
			lastLoc={crypt:'<xsl:value-of select="/d/fiche/loc/@crypt"/>',lon:'<xsl:value-of select="/d/fiche/loc/@lon"/>',lat:'<xsl:value-of select="/d/fiche/loc/@lat"/>',vit:'<xsl:value-of select="/d/fiche/loc/@vit"/>',acc:'<xsl:value-of select="/d/fiche/loc/@acc"/>',bat:'<xsl:value-of select="/d/fiche/loc/@bat"/>',o:'<xsl:value-of select="/d/fiche/loc/@o"/>',minago:'<xsl:value-of select="/d/fiche/loc/@minago"/>',dt:'<xsl:call-template name="fmt-dtjt"><xsl:with-param name="j" select="/d/fiche/loc/@j" /><xsl:with-param name="t" select="/d/fiche/loc/@h" /></xsl:call-template>'};
          </xsl:if>
          var textminago='il y a xx min';
          var bib='<xsl:value-of select="fiche/@doss"/>';
          var pts=[
            <xsl:variable name="pts" select="fiche/pts/pt" />
		<xsl:variable name="__lastpt" select="fiche/pts/pt[position()=last()]/@idpt" />
            <xsl:for-each select="$pts">
              <xsl:variable name="_idpt" select="@idpt"/>
              <xsl:variable name="pospt" select="position()"/>
              <xsl:variable name="_pass" select="/d/fiche/pass/e[@idpt = $_idpt]"/>
              <xsl:variable name="_heurepass" >
                <xsl:if test="string($_pass/@ha) != ''">
                  <xsl:call-template name="fmt-dtjt">
                    <xsl:with-param name="j" select="$_pass/@ja" />
                    <xsl:with-param name="t" select="$_pass/@ha" />
                  </xsl:call-template>
                </xsl:if>
		<xsl:if test="@idpt!=$__lastpt">
                <xsl:if test="string($_pass/@ha) != '' and string($_pass/@hd) != ''">&lt;br/&gt;</xsl:if>
                <xsl:if test="string($_pass/@hd) != ''">
                  <xsl:call-template name="fmt-dtjt">
                    <xsl:with-param name="j" select="$_pass/@jd" />
                    <xsl:with-param name="t" select="$_pass/@hd" />
                  </xsl:call-template>
                </xsl:if>
		</xsl:if>
              </xsl:variable>	  
              <xsl:if test="$pospt&gt;1">,</xsl:if>
              {idpt:'<xsl:value-of select="@idpt"/>',kmt:'<xsl:call-template name="fmt-f"><xsl:with-param name="v" select="10 * ((@km div 10))" /><xsl:with-param name="format" select="'0.0'"/></xsl:call-template> km',kmp:'<xsl:call-template name="fmt-f"><xsl:with-param name="v" select="10 * (((@km - $pts[$pospt - 1]/@km) div 10))" /><xsl:with-param name="format" select="'0.0'"/></xsl:call-template> km',dt:'<xsl:call-template name="fmt-i"><xsl:with-param name="v" select="@d"/></xsl:call-template> m',dp:'<xsl:call-template name="fmt-i"><xsl:with-param name="v" select="(@d - $pts[$pospt - 1]/@d)"/></xsl:call-template> m',p:"<xsl:value-of select="$pts[$pospt - 1]/@n"/>",a:'<xsl:call-template name="fmt-i"><xsl:with-param name="v" select="@a"/></xsl:call-template> m',n:"<xsl:value-of select="$pts[$pospt]/@n"/>",lon:'<xsl:value-of select="$pts[$pospt]/@lon"/>',lat:'<xsl:value-of select="$pts[$pospt]/@lat"/>',meet:'<xsl:value-of select="$pts[$pospt]/@meet"/>',hp:'<xsl:if test="/d/fiche/state/@code != 'nl' and /d/fiche/state/@code != 'np'"><xsl:value-of select="$_heurepass"/></xsl:if>',tc:'<xsl:value-of select="$_pass/@tps"/>',clt:'<xsl:value-of select="$_pass/@clt"/>',vit:'<xsl:call-template name="calc-kmh"><xsl:with-param name="idpt" select="$_idpt" /><xsl:with-param name="pts" select="/d/fiche/pts/pt" /><xsl:with-param name="pass" select="/d/fiche/pass/e" /><xsl:with-param name="pace" select="'0'" /></xsl:call-template>km/h'}
            </xsl:for-each>
          ];
          $(function() {
            $('.tpass a').click(function(event) {
              var i=$('.tpass a').index(event.target);
              var p=pts[i];
              var t=$(event.target).position().top;
              $('#tab .postit').animate({top:(t-10)}).show().html('&lt;img src="im/ptdr.png" id="ptdr" /&gt;'+
                '&lt;div&gt;&lt;b&gt;Distance depuis&lt;/b&gt;&lt;br/&gt;- Le départ : '+p['kmt']+'&lt;br/&gt;'+(p['p']==''||i==1?'':'- '+p['p']+' : '+p['kmp']+'&lt;/div&gt;')+'&lt;br/&gt;'+
                '&lt;div&gt;&lt;b&gt;Dénivelé positif depuis&lt;/b&gt;&lt;br/&gt;- Le départ : '+p['dt']+'&lt;br/&gt;'+(p['p']==''||i==1?'':'- '+p['p']+' : '+p['dp'])+'&lt;/div&gt;');
              event.preventDefault();
              event.stopPropagation();
            });
            $('.tpass a[data=0]').click();
            $('.tpass a').each(function() {
              if($(this).attr('data')=='<xsl:value-of select="/d/fiche/pass/e[last()]/@idpt"/>') {
                $(this).click();
              }
            });
            				if(isFav(<xsl:value-of select="fiche/@doss"/>)) {
				  $(".fav").show(); $(".nofav").hide();
				}
								<xsl:for-each select="fiche">
					if(isComp(<xsl:value-of select="@doss"/>)) { $(".comp[data-dos=<xsl:value-of select="@doss"/>]").show(); $(".nocomp[data-dos=<xsl:value-of select="@doss"/>]").hide(); }
				</xsl:for-each>
									$.ajax({
						url: 'ws_api.php?mode=AjaxGetRunnerPhotos&amp;val=<xsl:value-of select="fiche/@doss"/>&amp;lg=fr&amp;race=<xsl:value-of select="fiche/@c"/>',
						success: function(data) {
							var res=data;
							if (res &amp;&amp; res.length &gt; 0){
								$("#contLstPhotosMain2").show();
								$("#sepZone").hide();
								
								
								for (var i=0;i&lt;res.length;i++){
									
									img = new Image();
									img.onload = function () {
										if (this.height&gt;this.width){
											$(this).addClass("vert");
										} else {
											$(this).addClass("hori");
										}
										
										if($('#lstPhotos2').height()&lt;100){
											$('#morepho').hide();$('#lstPhotos2').css('justify-content','flex-start');
										} else {
											$('#morepho').show();$('#lstPhotos2').css('justify-content','space-evenly');
										}	
							
									};
									img.src = res[i].mini;
									img.title=(res[i].cp?res[i].cp+" ":"")+res[i].dt;
									
																			var a=$('&lt;a href="#" onclick="popPhoto(this,\''+res[i].lnk+'\',\''+(res[i].med?res[i].med:res[i].mini)+'\''+(res[i].name?', \''+res[i].name+'\'':'')+');return false;" /&gt;');	
																		
									a.append(img);
									$("#lstPhotos2").append(a);
								}
								if($('#lstVideos2').height()&gt;100){$('#morevid').show();}
							} else {
								$("#contLstPhotosMain2").hide();
								$("#sepZone").show();
							}
						}
					});
									<xsl:if test="string(fiche/identite/@gdpr) != '1'">
				$.ajax({
					url: 'ws_api.php?mode=AjaxGetRunnerVideos&amp;val=<xsl:value-of select="fiche/@doss"/>&amp;lg=fr&amp;race=<xsl:value-of select="fiche/@c"/>',
					success: function(data) {
						showRunnerVideos(data, "MA VIDEO SOUVENIR EN HD 720p", false <xsl:if test="/d/fiche/state/@code='f' or /d/fiche/state/@code='f2'">, true</xsl:if>);
					}
				});
				</xsl:if>
				          });
          
          		          </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 class="sel"><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><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>
	          <xsl:choose>
            <xsl:when test="count(fiche)=0">
              <div id="ictete"/>
              <div id="tete">
                <div class="np" style="margin-top:10px;text-transform:uppercase">Rechercher un coureur</div>
              </div>
              <div id="fintete"/>
              <xsl:choose>
				<xsl:when test="count(error)&gt;0">
					<div class="noresult">Une erreur s'est produite lors de la génération de la fiche coureur.</div>
				</xsl:when>
                <xsl:when test="@rech!=''">
                  <div class="noresult">
                  Aucun concurrent trouvé correspondant à la recherche : "<xsl:value-of select="@rech"/>"
                  </div>
                </xsl:when>
                <xsl:otherwise>
                  <div class="noresult">Pour rechercher un concurrent, utilisez la recherche en haut à gauche de cette page.</div>
                </xsl:otherwise>
              </xsl:choose>
                          </xsl:when>
            <xsl:when test="count(fiche)=1 and count(fiche/pts)=1">
				<xsl:variable name="lastpass" select="/d/fiche/pass/e[position()=last()]" />
				 					<link rel="stylesheet" type="text/css" media="screen" href="//vjs.zencdn.net/4.12/video-js.css" />
					<script type="text/javascript" src="//vjs.zencdn.net/4.12/video.js"></script>
					<script type="text/javascript" src="js/videojs.adlt.js"></script>
					<link rel="stylesheet" type="text/css" media="screen" href="js/videojs.adlt.css" />
					<script type="text/javascript" src="js/videojs-overlay.js"></script>
					<script type="text/javascript" src="js/videojs.ga.js"></script>
								<xsl:if test="count(fiche/state)=0">
					<script type="text/javascript">location.href="?rech=<xsl:value-of select="fiche/@doss"/>"</script>
				</xsl:if>
              <div id="ictete"/>
                            <div id="tete">
                <div class="np">
											<span class="pnom"><xsl:value-of select="fiche/identite/@prenom"/></span><xsl:text> </xsl:text><span class="nom"><xsl:value-of select="fiche/identite/@nom"/></span>
											&#160; 
				  				  <a href="javascript:setFav({fiche/@doss},true)" class="nofav" data-dos="{fiche/@doss}" title="Ajouter ce concurrent à ma liste de favoris"></a><a href="javascript:setFav({fiche/@doss},false)" class="fav" data-dos="{fiche/@doss}" title="Retirer ce concurrent de ma liste de favoris" style="display:none"></a>
				  					  <a href="javascript:setComp({fiche/@doss},true)" data-dos="{fiche/@doss}" class="nocomp" title="Ajouter ce concurrent à ma liste de comparaison"></a><a href="javascript:setComp({fiche/@doss},false)" data-dos="{fiche/@doss}" class="comp" title="Retirer ce concurrent de ma liste de comparaison" style="display:none"></a>
				  				  <xsl:if test="fiche/state/@code='nl'">
					<a href="tableauFantome.php?bib={fiche/@doss}" target="ghost" class="ghost" title="Voir mon tableau fantôme LiveRun"></a>
				  </xsl:if>
				  	
                </div>
                <div class="cat">
                  <div class="onglets">
					                    <div class="onglet"><span class="l"/><span class="r"/><div class="fl"/><a href="#detfc"><b id="txtfc1">Infos coureur</b><xsl:if test="count(fiche/palm/e)!=0"><b id="txtfc2" style="display:none">Palmarès</b></xsl:if></a></div>
                                        <xsl:choose>
						<xsl:when test="string(fiche/identite/@photo)!=''"><img src="{fiche/identite/@photo}" style="width:46px;height:46px;margin:2px;"/></xsl:when>
						<xsl:when test="string(fiche/identite/@ph)!=''"><img src="https://res.cloudinary.com/utmb-world/image/upload/q_auto/f_auto/c_fill,g_auto/c_scale,w_200/v1/worldseries/Members/{fiche/identite/@ph}" style="width:46px;height:46px;margin:2px;"/></xsl:when>
					</xsl:choose>
                  </div>
                  Dossard 
                  <xsl:choose>
                  	<xsl:when test="string(fiche/@nd)=''">
	                  <xsl:value-of select="fiche/@doss"/>
	                </xsl:when>
	                <xsl:otherwise>Non affecté</xsl:otherwise>
                  </xsl:choose>
                  &#160; <xsl:value-of select="courses/c[@id=/d/fiche/@c]/@nc"/> - <xsl:value-of select="fiche/identite/@cat"/>
                                      <xsl:if test="string(fiche/identite/@club)!=''"> &#160; &#160;/&#160; &#160; <span id="club">Club : <xsl:value-of select="string(fiche/identite/@club)"/></span></xsl:if>
                                  </div>
              </div>
              <div id="fintete"/>
              <div id="detfc">
                <div class="col2">
                  <table>
                    <tr>
                      <th colspan="2"><span class="pnom"><xsl:value-of select="fiche/identite/@prenom"/></span><xsl:text> </xsl:text><span class="nom"><xsl:value-of select="fiche/identite/@nom"/></span></th>
                    </tr>
                    <xsl:if test="string(fiche/identite/@relai) != ''">
                      <tr>
                        <td>Co-équipiers :</td>
                        <td>
                          <xsl:for-each select="fiche/relai/c">
                            <xsl:variable name="fccoeq">
							  								<span class="pnom"><xsl:value-of select="@prenom"/></span><xsl:text> </xsl:text><span class="nom"><xsl:value-of select="@nom"/></span>
								                            </xsl:variable>
                            <xsl:choose>
                              <xsl:when test="string(@running)='1'"><b><xsl:value-of select="$fccoeq"/></b></xsl:when>
                              <xsl:otherwise><xsl:value-of select="$fccoeq"/></xsl:otherwise>
                            </xsl:choose>
                            <br/>
                          </xsl:for-each>&#160;
                        </td>
                      </tr>
                    </xsl:if>
                    <tr>
                      <td>Sexe :</td>
                      <td>
						<xsl:choose>
							<xsl:when test="fiche/identite/@sx='F'">Femme</xsl:when>
							<xsl:when test="fiche/identite/@sx='H'">Homme</xsl:when>
						</xsl:choose>
                      </td>
                    </tr>
                    <tr>
                      <td>Catégorie :</td>
                      <td><xsl:value-of select="fiche/identite/@cat"/> <xsl:if test="string(fiche/identite/@descat)!=''"> (<xsl:value-of select="fiche/identite/@descat"/>)</xsl:if></td>
                    </tr>
                                          <tr>
                        <td>Club :</td>
                        <td><xsl:value-of select="string(fiche/identite/@club)"/></td>
                      </tr>
                                                                                  <tr>
                        <td>Nationalité :</td>
                        <td>
															<xsl:if test="string(fiche/identite/@a3)!=''">
									<span style="font-size:0.5em;text-align:center;font-weight:normal">
										<img src="im/flags/{translate(fiche/identite/@a2, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')}.png" height="40"/>
									</span><br/>
								</xsl:if>
															<xsl:choose>
								<xsl:when test="string(fiche/identite/@cio)!='' and string(fiche/identite/@nat)!=''"><xsl:value-of select="fiche/identite/@cio"/> (<xsl:value-of select="fiche/identite/@nat"/>)</xsl:when>
								<xsl:when test="string(fiche/identite/@cio)!=''"><xsl:value-of select="fiche/identite/@cio"/></xsl:when>
								<xsl:when test="string(fiche/identite/@nat)!=''"><xsl:value-of select="fiche/identite/@nat"/></xsl:when>
							</xsl:choose>
						</td>
                      </tr>
                                        					  <xsl:if test="string(fiche/identite/@ville)!=''">
						<tr>
							<td>Ville :</td>
							<td>
								<xsl:if test="string(fiche/identite/@cp)!=''">
									<xsl:value-of select="string(fiche/identite/@cp)"/><xsl:text> </xsl:text>
								</xsl:if>
								<xsl:value-of select="string(fiche/identite/@ville)"/>
							</td>
						</tr>
					  </xsl:if>
					  <xsl:if test="string(fiche/identite/@pays)!=''">
						<tr>
							<td>Pays :</td>
							<td>
								<xsl:value-of select="string(fiche/identite/@pays)"/>
							</td>
						</tr>
					  </xsl:if>
                                        		    <xsl:if test="string(fiche/antecedents) != ''">
                      <tr>
                        <td>Antécédents :<br/><span class="pt">(indicatifs et non exhaustifs)</span></td>
                        <td><xsl:value-of select="string(fiche/antecedents)"/></td>
                      </tr>
		    </xsl:if>
                    								                                                              </table>
                    </div>
                    <div class="col2">
						<xsl:choose>
							<xsl:when test="string(fiche/identite/@photo)!=''">
								<xsl:attribute name="style">min-height:280px;</xsl:attribute>
								<img src="{fiche/identite/@photo}" id="photoident"/>
							</xsl:when>
							<xsl:when test="string(fiche/identite/@ph)!=''">
								<xsl:attribute name="style">min-height:280px;</xsl:attribute>
								<img id="photoident" src="https://res.cloudinary.com/utmb-world/image/upload/q_auto/f_auto/c_fill,g_auto/c_scale,w_200/v1/worldseries/Members/{fiche/identite/@ph}"/>
							</xsl:when>
						</xsl:choose>
                      <table>
                                                              <xsl:if test="count(fiche/palm/e)!=0">
                      <tr><th colspan="2">Palmarès <xsl:if test="string(fiche/palm/@cote)!=''"><span class="utmbindex" style="float:right;"><xsl:value-of select="fiche/palm/@cote"/></span></xsl:if></th></tr>
                      <tr><td colspan="2">
                        <div id="palm" class="sb" >
                          <ul>
                            <xsl:for-each select="fiche/palm/e">
                              <li><span class="crefpos"><xsl:value-of select="@pos" />e</span><xsl:if test="string(@cltsx)!=''"><xsl:text> </xsl:text><span class="crefpos">(<xsl:value-of select="@cltsx" />e dame)</span></xsl:if><xsl:text> </xsl:text><span class="creftps">(<xsl:value-of select="@tps" />)</span> sur <span class="crefcrs" style="text-transform:capitalize"><xsl:value-of select="@race" /><xsl:text> </xsl:text><xsl:value-of select="@year" /><xsl:if test="number(@dist)&gt;0"><xsl:text> </xsl:text>(<xsl:value-of select="@dist" />km)</xsl:if></span></li>
                            </xsl:for-each>
                          </ul>
                        </div>
                      </td></tr>
                      </xsl:if>                
                      <xsl:for-each select="fiche/relai/c">
						  <xsl:if test="count(palm/e)!=0">
							  <tr><th colspan="2">
								Palmarès 											<xsl:value-of select="@prenom"/><xsl:text> </xsl:text><xsl:value-of select="@nom"/>
																					<xsl:if test="string(@cot)!=''"><span class="utmbindex" style="float:right;"><xsl:value-of select="@cot"/></span></xsl:if>
							  </th></tr>
							  <tr><td colspan="2">
								<div id="palm" class="sb" >
								  <ul>
									<xsl:for-each select="palm/e">
									  <li><span class="crefpos"><xsl:value-of select="@pos" />e</span><xsl:if test="string(@cltsx)!=''"><xsl:text> </xsl:text><span class="crefpos">(<xsl:value-of select="@cltsx" />e dame)</span></xsl:if><xsl:text> </xsl:text><span class="creftps">(<xsl:value-of select="@tps" />)</span> sur <span class="crefcrs" style="text-transform:capitalize"><xsl:value-of select="@race" /><xsl:text> </xsl:text><xsl:value-of select="@year" /><xsl:if test="number(@dist)&gt;0"><xsl:text> </xsl:text>(<xsl:value-of select="@dist" />km)</xsl:if></span></li>
									</xsl:for-each>
								  </ul>
								</div>
							  </td></tr>
							</xsl:if>
					  </xsl:for-each>  
                                        </table>
                  		                  </div>
                <div class="degbas"></div>
              </div>
                            <div id="fc">
			<div id="addon">
								<a href="#" class="info" onclick="$('#tete .onglet').first().click();return false;">
					<xsl:attribute name="title">Infos coureur<xsl:if test="count(fiche/palm/e)!=0"> / Palmarès</xsl:if></xsl:attribute>
					Infos					<xsl:if test="count(fiche/palm/e)!=0">Palmares</xsl:if>
				</a>
				
				<xsl:if test="fiche/state/@code='nl'">
					<a href="tableauFantome.php?bib={fiche/@doss}" target="ghost" class="iconGhost" title="Voir mon tableau fantôme LiveRun">Tableau Fantôme</a>
				</xsl:if>
				
				
				<xsl:if test="string(fiche/@dipl)!=''">
						<a>
							<xsl:attribute name="href">
								<xsl:choose>
									<xsl:when test="string(fiche/@dipl) = '1'">coureurDiplome.php?dossard=<xsl:value-of select="fiche/@doss"/></xsl:when>
									<xsl:otherwise><xsl:value-of select="string(fiche/@dipl)"/>&amp;language=FR</xsl:otherwise>
								</xsl:choose>
							</xsl:attribute>
							<xsl:if test="string(fiche/@dipl) != '1'"><xsl:attribute name="target">_blank</xsl:attribute></xsl:if>
							<div id="dipl"></div>
							Diplôme						</a>
				</xsl:if>
									<xsl:if test="fiche/state/@code = 'f'">
						<script type="text/javascript">
							
						(function (d, s, id) {
							var js, fjs = d.getElementsByTagName(s)[0];
							if (d.getElementById(id)) { return; }
							js = d.createElement(s); js.id = id;
							js.src = "//connect.facebook.net/en_US/sdk.js";
							fjs.parentNode.insertBefore(js, fjs);
						}(document, 'script', 'facebook-jssdk'));

						window.fbAsyncInit = function () {
							var appId = '230991323691676';
							FB.init({
								appId: appId,
								xfbml: true,
								version: 'v2.9'
							});
						};
						function repl(txt) {
							txt=txt.replace(/#eventName#/g,"HOKA LES TEMPLIERS");
							txt=txt.replace(/#courseName#/g,"<xsl:value-of select="/d/courses/c[@id=/d/fiche/@c]/@n"/>");
							txt=txt.replace(/#courseShortName#/g,"<xsl:value-of select="/d/courses/c[@id=/d/fiche/@c]/@nc"/>");
							txt=txt.replace(/#nom#/g,"<xsl:value-of select="fiche/identite/@nom"/>");
							txt=txt.replace(/#prenom#/g,"<xsl:value-of select="fiche/identite/@prenom"/>");
							txt=txt.replace(/#clt#/g,"<xsl:value-of select="fiche/state/@clt"/>");
							txt=txt.replace(/#cltcat#/g,"<xsl:value-of select="fiche/state/@cltcat"/>");
							txt=txt.replace(/#tps#/g,"<xsl:value-of select="fiche/pass/e[position()=last()]/@tps"/>");
							txt=txt.replace(/#cat#/g,"<xsl:value-of select="fiche/identite/@cat"/>");
							return txt;
						}
						function pub_fb(){
							var ll=window.location.href;
							if (ll.indexOf("?") &gt; 0)
								ll=ll.substr(0,ll.indexOf("?"));
							ll+="?rech=<xsl:value-of select="fiche/@doss"/>";
							var texte=repl("#prenom# #nom# a terminé la course en #clt#e position (#cltcat#e #cat#), après #tps# d\'efforts !");
							var titre=repl("#eventName# - #courseName# : #prenom# #nom# est Finisher !");
							
							
							
							var FBDesc      = texte;
							var FBTitle     = titre;
							var FBLink      = ll;
							var FBPic       = 'http://livetrail.net/live/templiers/images/fbimage.png';

							// Open FB share popup
							FB.ui({
								method: 'share_open_graph',
								action_type: 'og.shares',
								action_properties: JSON.stringify({
									object: {
										'og:url': FBLink,
										'og:title': FBTitle,
										'og:description': FBDesc,
										'og:image': FBPic
									}
								})
							})
							
							//window.open("https://www.facebook.com/dialog/share?app_id=230991323691676&amp;description="+encodeURIComponent(texte)+"&amp;redirect_uri=http://www.livetrail.net/autoclose.php&amp;name="+encodeURIComponent(titre)+"&amp;title="+encodeURIComponent(titre)+"&amp;display=popup&amp;message="+encodeURIComponent(texte)+"&amp;link="+encodeURIComponent(ll)+"&amp;picture="+encodeURIComponent("http://livetrail.net/live/templiers/images/fbimage.png"),"Share","toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no,width=640,height=340");
						}
						function pub_tw() {
							var ll=window.location.href;
							if (ll.indexOf("?") &gt; 0) ll=ll.substr(0,ll.indexOf("?")-1);
							ll+="?rech=<xsl:value-of select="fiche/@doss"/>";
							var texte=repl("#eventName# : #prenom# #nom# a terminé la course #courseShortName# en #clt#e position (#cltcat#e #cat#) ; #tps# d\'efforts !");
							window.open("https://twitter.com/intent/tweet?text="+encodeURIComponent(texte+"\n")+"&amp;url="+encodeURIComponent(ll),"Share","toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no,width=640,height=340");
						}
												</script>
						<div id="fb" onclick="pub_fb();" title="Partager l'info sur Facebook."></div>
						<div id="twitter" onclick="pub_tw();" title="Partager l'info sur Twitter."></div>
											</xsl:if>
													<a>
					<xsl:attribute name="href">reclam.php</xsl:attribute>
					<xsl:attribute name="title">Rédiger une réclamation</xsl:attribute>
					<xsl:attribute name="id">reclamation</xsl:attribute>
					Contact
				</a>
			</div>
                <table class="resume">
                  <tr>
                    <td>
                      <div style="font-weight:bold">
                        <label>Etat</label><br/>
                        <xsl:choose>
                          <xsl:when test="fiche/state/@code = 'f'"><b>Finisher</b></xsl:when>
                          <xsl:when test="fiche/state/@code = 'f2'"><b>Arrivant</b></xsl:when>
                          <xsl:when test="fiche/state/@code = 'fe'">Fin&#160;d'étape</xsl:when>
                          <xsl:when test="fiche/state/@code = 's'">Arrêté par l'organisation</xsl:when>
                          <xsl:when test="fiche/state/@code = 'hd'">Hors délai</xsl:when>
                          <xsl:when test="fiche/state/@code = 'a'">Arrêté</xsl:when>
                          <xsl:when test="fiche/state/@code = 'd'">Disqualifié par l'organisation</xsl:when>
                          <xsl:when test="fiche/state/@code = 'u'">Non classé</xsl:when>
                          <xsl:when test="fiche/state/@code = 'np'">Non partant</xsl:when>
                          <xsl:when test="fiche/state/@code = 'nl'">Départ&#160;non&#160;donné</xsl:when>
                          <xsl:otherwise>En&#160;course...</xsl:otherwise>
                        </xsl:choose>
                                              </div>
                    </td>
                    <xsl:if test="count(fiche/infopub)&gt;0 or count(fiche/pena/e)&gt;0">
                      <td><div>
                        <xsl:if test="string(fiche/infopub/@pena)!=''">
                          <xsl:choose>
                            <xsl:when test="number(fiche/infopub/@pena) &gt; 0"><label>Pénalité</label><br/></xsl:when>
                            <xsl:otherwise><label>Bonus</label><br/></xsl:otherwise>
                          </xsl:choose>
						  <xsl:choose>
                            <xsl:when test="fiche/infopub/@pena &gt; 0"><xsl:value-of select="format-number(number(fiche/infopub/@pena) div 60, '#.##')"/></xsl:when>
                            <xsl:otherwise><xsl:value-of select="format-number(0 - number(fiche/infopub/@pena) div 60, '#.##')"/></xsl:otherwise>
                          </xsl:choose> minutes<br/>
                        </xsl:if>
                        <xsl:if test="count(fiche/pena/e)&gt;0">
						  <ul class="subpena">
                          <xsl:for-each select="fiche/pena/e">
						  	<xsl:variable name="penaidpt" select="@idpt"/>
							<li><xsl:value-of select="/d/fiche/pts/pt[number(@idpt) = $penaidpt]/@nc"/>
								:
								<xsl:choose>
									<xsl:when test="@p &gt; 0">+<xsl:call-template name="hour2time"><xsl:with-param name="h" select="@p div 3600"/></xsl:call-template></xsl:when>
									<xsl:otherwise>-<xsl:call-template name="hour2time"><xsl:with-param name="h" select="0 - @p div 3600"/></xsl:call-template></xsl:otherwise>
								</xsl:choose>
							</li>
						  </xsl:for-each>
						  </ul>
                        </xsl:if>
                        <xsl:copy-of select="fiche/infopub/child::node()"/>
                      </div></td>
                    </xsl:if>
                    <xsl:if test="fiche/state/@code != 'np' and fiche/state/@code != 'nl'">
						 <xsl:if test="fiche/state/@code != 'u' and fiche/state/@code != 'd'">
						  <xsl:choose>
							<xsl:when test="string(fiche/state/@clt)!=''">
								  <td><div>
									<label>Class.</label><br/>
									<xsl:value-of select="fiche/state/@clt"/>
																	  </div></td>
							  <xsl:if test="string(fiche/state/@cltsx)!=''">
								  <td><div>
									<label>Class. <xsl:value-of select="fiche/identite/@sx"/></label><br/>
									<xsl:value-of select="fiche/state/@cltsx"/>
																	  </div></td>
							  </xsl:if>
							  <xsl:if test="string(fiche/identite/@cat)!=''">
								  <td><div>
									<label>Class. <xsl:value-of select="fiche/identite/@cat"/></label><br/>
									<xsl:value-of select="fiche/state/@cltcat"/>
																	  </div></td>
							  </xsl:if>
							</xsl:when>
							<xsl:when test="string(/d/fiche/pass/e[last()]/@clt)!=''">
								<td><div>
									<label>Class.</label><br/>
									<xsl:value-of select="/d/fiche/pass/e[last()]/@clt"/>
								</div></td>
							</xsl:when>
						  </xsl:choose>
						 </xsl:if>
                      <td><div>
                        <label>Dernier point</label><br/>
                        <xsl:call-template name="fmt-dtjt">
                          <xsl:with-param name="j" select="$lastpass/@ja" />
                          <xsl:with-param name="t" select="$lastpass/@ha" />
                        </xsl:call-template>
                        &#160;
                        <xsl:value-of select="fiche/pts/pt[number(@idpt) = number($lastpass/@idpt)]/@n"/>
                      </div></td>
                      <td><div>
                        <label>Temps de course</label><br/>            
							<xsl:choose>
								<xsl:when test="(fiche/state/@code = 'c' ) and (number(fiche/@finishc) = 0 or fiche/@finishc='')" >
									<xsl:if test="string($lastpass/@tpsr)!=''">Officiel&#160;:&#160;</xsl:if>
									<span class="timer" style="background-color:transparent" ><span id="tim1"></span></span>
									<xsl:if test="string($lastpass/@tpsr)!=''"><br/>Réel&#160;:&#160;<span class="timer" style="background-color:transparent"><span id="tim2"></span></span></xsl:if>
									<script type="text/javascript">
										$(function() {
											<xsl:choose>
												<xsl:when test="count(fiche/resumeEtp/e)">
													var dt=dtsql2js("<xsl:value-of select="fiche/resumeEtp/e[string(@dthd)][last()]/@dthd"/>");
													var timePreviousStages = 0 <xsl:for-each select="fiche/resumeEtp/e">+<xsl:value-of select="@tn"/></xsl:for-each>;
													dt = new Date(dt.getTime() - timePreviousStages * 3600000);
												</xsl:when>
												<xsl:otherwise>
													var dt=dtsql2js("<xsl:value-of select="concat(fiche/pass/e[number(@idpt)=0]/@date,' ')"/> <xsl:value-of select="fiche/pass/e[number(@idpt)=0]/@hd"/>");
												</xsl:otherwise>
											</xsl:choose>
											
											$("#tim1").countdown({since:dt,format:'HMS', layout:'{hn}{sep}{mnn}{sep}{snn}', timezone:<xsl:value-of select="fiche/pass/e[number(@idpt)=0]/@tz"/>});
											<xsl:if test="string($lastpass/@tpsr)!=''">
											var dt2=dtsql2js("<xsl:value-of select="concat(fiche/pass/e[number(@idpt)=0]/@date,' ')"/> <xsl:value-of select="fiche/pass/e[number(@idpt)=0]/@hdr"/>");
											$("#tim2").countdown({since:dt2,format:'HMS', layout:'{hn}{sep}{mnn}{sep}{snn}', timezone:<xsl:value-of select="fiche/pass/e[number(@idpt)=0]/@tz"/>});
											</xsl:if>
										});
									</script>
							
								</xsl:when>
								<xsl:otherwise>
									<xsl:if test="string($lastpass/@tpsr)!=''">Officiel&#160;:&#160;</xsl:if>
									<xsl:choose>
										<xsl:when test="(fiche/state/@code = 'f') or count(fiche/pena/e) = 0">
											<xsl:value-of select="$lastpass/@tps"/>
										</xsl:when>
										<xsl:otherwise>
											<xsl:call-template name="hour2time"><xsl:with-param name="h" select="$lastpass/@tn + (sum(/d/fiche/pena/e/@p) div 3600)"/></xsl:call-template>
										</xsl:otherwise>
									</xsl:choose>
									
									<xsl:if test="string($lastpass/@tpsr)!=''"><br/>Réel&#160;:&#160;<xsl:value-of select="$lastpass/@tpsr"/></xsl:if>
								</xsl:otherwise>
							</xsl:choose>       
                      </div></td>
                      <xsl:if test="(fiche/state/@code = 'c' or fiche/state/@code = 'u') and count(fiche/prev/e[number(@idpt) &gt; number($lastpass/@idpt)])&gt;0">
                        <td><div>
                          <label>Prochain(s) pass.</label><br/>
                          <xsl:variable name="nextp" select="fiche/prev/e[number(@idpt) &gt; number($lastpass/@idpt)][1]" />
                          <xsl:choose>
                            <xsl:when test="count($nextp) = 0">
                              <span title="Coureur non reparti du dernier point de contrôle. L'information sera disponible dès qu'il sera reparti.">Non disponible</span>
                            </xsl:when>
                            <xsl:otherwise>
                              <span title="Estimation basée sur le temps mis pour le tronçon précédent">
																	<xsl:for-each select="fiche/prev/e">
										<xsl:variable name="nidpt" select="@idpt" />
										<xsl:call-template name="fmt-dtjt">
										  <xsl:with-param name="j" select="@j" />
										  <xsl:with-param name="t" select="@h" />
										</xsl:call-template>
										&#160;
										<xsl:value-of select="/d/fiche/pts/pt[@idpt = $nidpt]/@n"/>
										<br/>
									</xsl:for-each>
								                              </span>
                            </xsl:otherwise>
                          </xsl:choose>
                        </div></td>
                                              </xsl:if>
                      						  <xsl:if test="fiche/state/@code = 'f'">
							  <td><div>
								<label>Vitesse</label><br/>
								<span>
								<xsl:variable name="kmall"><xsl:call-template name="getoverallkm"><xsl:with-param name="pts" select="fiche/pts" /><xsl:with-param name="idx" select="1" />
								</xsl:call-template></xsl:variable>
								  <xsl:call-template name="calc-vit">
									<xsl:with-param name="dist"  select="$kmall" />
									<xsl:with-param name="tps" select="number($lastpass/@tn)" />
									<xsl:with-param name="pace" select="'0'" />
								  </xsl:call-template> km/h								  <xsl:if test="string($lastpass/@tpsr)!=''">
									<br/>
									<xsl:call-template name="calc-vit">
										<xsl:with-param name="dist"  select="$kmall" />
										<xsl:with-param name="tps" select="number($lastpass/@tnr)" />
										<xsl:with-param name="pace" select="'0'" />
									</xsl:call-template> km/h								  </xsl:if>  
								</span>
							  </div></td>
						  </xsl:if>
						                      </xsl:if>
                                      </tr>
                  <xsl:if test="count(fiche/resumeEtp/e) &gt; 0">
                  <xsl:if test="count(fiche/resumeEtp/e) &gt; 6">
                  	<tr id="detStageBtn"><td colspan="6" style="text-align:center">
                  		<a href="#" onclick="$('#detailStages').slideDown(); $('#detStageBtn').hide(); return false;">Display stages details</a>
                  	</td></tr>
                  </xsl:if>
                  <tfoot id="detailStages">
                  <xsl:if test="count(fiche/resumeEtp/e) &gt; 6">
                  	<xsl:attribute name="style">display: none;</xsl:attribute>
                  </xsl:if>
                  <xsl:for-each select="fiche/resumeEtp/e">
                  <tr>
					<td>
                      <div style="font-weight:bold;font-size:1em;border-top-width:1px;font-style:italic">
						  <xsl:value-of select="@name"/>
                      </div>
                    </td>
                    <xsl:if test="count(/d/fiche/infopub)&gt;0"><td>&#160;</td></xsl:if>
                    
                    <xsl:if test="/d/fiche/state/@code != 'np' and /d/fiche/state/@code != 'nl'">
                      <xsl:choose>
						<xsl:when test="string(/d/fiche/state/@clt)!='' and /d/fiche/state/@code !='u'">
							<td><div style="font-size:1em;border-top-width:1px;font-style:italic">
								<xsl:value-of select="@clt"/>
							</div></td>
							<xsl:if test="string(/d/fiche/state/@cltsex)!=''">
								<td><div style="font-size:1em;border-top-width:1px;font-style:italic">
									<xsl:value-of select="@cltsex"/>
								</div></td>
							</xsl:if>
							<xsl:if test="string(/d/fiche/identite/@cat)!=''">
								<td><div style="font-size:1em;border-top-width:1px;font-style:italic">
									<xsl:value-of select="@cltcat"/>
								</div></td>
							</xsl:if>
						</xsl:when>
						<xsl:when test="string(/d/fiche/pass/e[last()]/@clt)!='' and /d/fiche/state/@code !='u'">
							<td><div style="font-size:1em;border-top-width:1px;font-style:italic">
								<xsl:value-of select="@clt"/>
							</div></td>
						</xsl:when>
                      </xsl:choose>
                      <xsl:if test="string(/d/fiche/state/@cltsex)!=''">
							<td> </td>
					  </xsl:if>
                      <td> </td>
                      <td><div style="font-size:1em;border-top-width:1px;font-style:italic">
                        <xsl:value-of select="@tps"/>
                      </div></td>
                      						  	  <td><div style="font-size:1em;border-top-width:1px;font-style:italic">
								  <xsl:if test="string(@tps)!=''">
									<xsl:call-template name="calc-vit">
										<xsl:with-param name="dist" select="10 * ((@dist div 10))" />
										<xsl:with-param name="tps" select="number(@tn)" />
										<xsl:with-param name="pace">
											<xsl:choose>
												<xsl:when test="@unit='minp100'">2</xsl:when>
												<xsl:when test="@unit='minpkm'">1</xsl:when>
												<xsl:otherwise>0</xsl:otherwise>
											</xsl:choose>
										</xsl:with-param>
									  </xsl:call-template>
									  <xsl:choose>
										<xsl:when test="@unit='minp100'"><xsl:text> / 100m</xsl:text></xsl:when>
										<xsl:when test="@unit='minpkm'"> / km</xsl:when>
										<xsl:otherwise> km/h</xsl:otherwise>
									  </xsl:choose>
									  
								  </xsl:if>
							  </div></td>
						                      </xsl:if>
                  </tr>
                </xsl:for-each>
                </tfoot>
                </xsl:if>
                  
                </table>
                
                <div id="mediaCont">
                					<div id="contLstPhotosMain2" style="display:none">
						<div class="phototitle color" ><span id="photopicto" class="bgcol"></span><h2>PHOTOS</h2>
							<span><a href="https://www.maindruphoto.com/fr/events/list.html" target="_blank" >Flas Sport...</a>							</span>
						</div>
						<div id="contLstPhotos2">
							<div id="lstPhotos2"></div>
						</div>
						<div class="bot" >
							<div id="morepho" class="more tit" onclick="$('#contLstPhotos2,#contLstVideos2').toggleClass('open',500);$(this).toggleClass('open');$('#morevid').toggleClass('open');" />
						</div>
					</div>
								<div id="contLstVideosMain2" style="display:none">
					<div class="videotitle color">
						<span id="videopicto" class="bgcol"></span><h2>VIDEOS</h2><span id="videovstitle"></span>
					</div>
					<div id="contLstVideos2">
						<div id="lstVideos2"></div>
					</div>
					<div class="bot">
												<div id="morevid" class="more tit" onclick="$('#contLstPhotos2,#contLstVideos2').toggleClass('open',500);$(this).toggleClass('open');$('#morepho').toggleClass('open');" />
					</div>
				</div>
								  <div id="sepZone"></div>
				  			  </div>
			  <div class="vues">
					<xsl:if test="string(fiche/@nocarto)!='1'">
						<div class="sel">
							<a class="prof bgcol" href="javascript:chgvue('prof')" title="Vue du profil de la course"/><a class="color" href="javascript:chgvue('prof')">PROFIL</a>
						</div>
					</xsl:if>
					<div>
						<xsl:if test="string(fiche/@nocarto)='1'"><xsl:attribute name="class">sel</xsl:attribute></xsl:if>
						<a class="tab bgcol" href="javascript:chgvue('tab')" title="Vue du tableau des points de passage"/><a class="color" href="javascript:chgvue('tab')">TABLEAU</a>
					</div>
					<xsl:if test="string(fiche/@nocarto)!='1'">
						<xsl:if test="string(fiche/ybtrack)!=''">
							<style>
								#fc .vues a.carto {
								  background:url(im/ybtrack.png) center center no-repeat #cccccc;
								  background-color:transparent !important;
								}
								#fc .vues a.carto:hover, #fc .vues .sel a.carto {
									background-color:white;
									background-position:center center;
								}
							</style>
						</xsl:if>
						<xsl:if test="string(fiche/dotvision)!=''">
							<style>
								#fc .vues a.carto {
								  background-position:-164px -48px;
								  background-color:transparent !important;
								}
								#fc .vues a.carto:hover, #fc .vues .sel a.carto {
									background-color:white;
									background-position:-164px -48px;
								}
							</style>
						</xsl:if>
						<div><a class="carto bgcol" href="javascript:chgvue('carto')" title="Vue cartographique de la course"/><a class="color" href="javascript:chgvue('carto')">CARTE</a></div>
					</xsl:if>
														</div>
                <div id="contvues"><div>
		  <xsl:if test="string(fiche/@nocarto)!='1'">
                  <div id="prof" class="vue">
					<div style="position:relative" >
						<div id="beforeProf"></div>
						<div id="infosProfilFlech"></div>
						<div id="infosProfil">
						  <table data="details_pass" class="sumup up rmargin">
							<tr>
							  <th>Jour/heure de passage</th>
							  <td data="hp"></td>
							  </tr>
							  <tr>
							  <th>Temps de course</th>
							  <td data="tc"></td>
							  </tr>
							  <xsl:if test="string(fiche/state/@clt)!=''">				  <tr>
							  <th>Classement au point</th>
							  <td data="clt"></td>
							  </tr>
				  </xsl:if>				  							  <tr>
							  <th>Vitesse</th>
							  <td data="vit"></td>
							  </tr>
				  						  </table>
						  <table class="sumup up">
							<tr>
							<th>Altitude</th>
							<td data="a" ></td>
							</tr>
							<tr>
							<th>Dist. depuis le départ</th>
							<td data="kmt" ></td>
							</tr>
						  <tr>
							<th><input type="hidden" data="n-1km" value="Dist. depuis " /><label data="n-1km"></label></th>
							<td data="kmp" ></td>
						  </tr>
							<tr>
							<th>D+ depuis le départ</th>
							<td data="dt" ></td>
							</tr>
							<tr>
							  <th><input type="hidden" data="n-1d" value="D+ depuis " /><label data="n-1d"></label></th>
							  <td data="dp" ></td>
							</tr>
						  </table>
						  <div class="title" ></div>
						</div>
						<div id="profil">
						  <img src="images/profil_{/d/fiche/@c}.png?v=3"/>
						  <xsl:for-each select="fiche/pts/pt">
							<xsl:variable name="profidpt" select="@idpt"/>
							<xsl:variable name="profpassc" select="/d/fiche/pass/e[@idpt=$profidpt]"/>
							  <div data="{$profidpt}" style="top:{number(@py)}%;left:{number(@px)}%;transform:translate(-7px,-7px);">
								<xsl:attribute name="class">
								  <xsl:choose>
									<xsl:when test="@meet = 1">pts meet </xsl:when>
									<xsl:otherwise>pts </xsl:otherwise>
								   </xsl:choose>
								   <xsl:if test="/d/fiche/state/@code != 'nl' and /d/fiche/state/@code != 'np' and count($profpassc) &gt; 0"> passedPt </xsl:if>
								   <xsl:variable name="proflastpass" select="/d/fiche/pass/e[position()=last()]" />
								   <xsl:if test="(/d/fiche/state/@code != 'np' and /d/fiche/state/@code != 'nl' and $profidpt =$proflastpass/@idpt ) and not((/d/fiche/state/@code = 'c' or /d/fiche/state/@code = 'u' ) and count(/d/fiche/prev/e[number(@idpt) &gt; number($lastpass/@idpt)])&gt;0)"> lastPt</xsl:if>
								</xsl:attribute>
							  </div>
						  </xsl:for-each>
						  <xsl:choose>
							  <xsl:when test="(fiche/state/@code = 'c' or fiche/state/@code = 'u' ) and count(fiche/prev/e[number(@idpt) &gt; number($lastpass/@idpt)])&gt;0">
								  <xsl:variable name="nextpdist" select="fiche/prev/e[number(@idpt) &gt; number($lastpass/@idpt)][1]" />
								  <div class='lastPoint' data="{$nextpdist/@km}" ></div>
							  </xsl:when>
							 
						  </xsl:choose>
						</div>
                    </div>
                    
						<xsl:variable name="crs" select="/d/fiche/@c"/>
							
						<script type="text/javascript">
							
							var lstcrs=["<xsl:value-of select="$crs"/>"];
							var mypts={};
							var coureurs={};
							var data={};
							var lines={};
							var tmp,tmp2;
							//var lastidpt=0;
							isGraphFC=true;
												
							lines["<xsl:value-of select="$crs"/>"]=Array();
							lines["<xsl:value-of select="$crs"/>"].push(0);
							mypts["<xsl:value-of select="$crs"/>"]=Array();
							mypts["<xsl:value-of select="$crs"/>"]["0"]="<xsl:value-of select="/d/fiche/pts/pt[1]/@nc"/>";
							data["<xsl:value-of select="$crs"/>"]=Array();
							data["<xsl:value-of select="$crs"/>"].push({ x:0 });
							<xsl:for-each select="/d/fiche/pts/pt">
								<xsl:variable name="pospt" select="position()"/>
								<xsl:variable name="idpt" select="@idpt"/>
								<xsl:if test="$pospt &gt; 1">
									<xsl:variable name="ptprec" select="/d/fiche/pts/pt[($pospt - 1)]"/>
									<xsl:variable name="curpt" select="/d/fiche/pts/pt[($pospt)]"/>
									lines["<xsl:value-of select="$crs"/>"].push(<xsl:value-of select="10 * ((@km div 10))"/>);
									mypts["<xsl:value-of select="$crs"/>"][""+(<xsl:value-of select="10 * (($ptprec/@km div 10))"/>+(<xsl:value-of select="10 * ((@km div 10))"/>-<xsl:value-of select="10 * (($ptprec/@km div 10))"/>)/2)]="<xsl:value-of select="$ptprec/@nc"/> - <xsl:value-of select="@nc"/>";
									mypts["<xsl:value-of select="$crs"/>"]["<xsl:value-of select="10 * ((@km div 10))"/>"]="<xsl:value-of select="@nc"/>";
									tmp={x:(<xsl:value-of select="10 * (($ptprec/@km div 10))"/>+(<xsl:value-of select="10 * ((@km div 10))"/>-<xsl:value-of select="10 * (($ptprec/@km div 10))"/>)/2)};
									tmp2={x:<xsl:value-of select="10 * (($curpt/@km div 10))"/>};
									
									<xsl:if test="count(/d/fiche/pass/e[@idpt=$idpt]) &gt; 0">
																				<xsl:if test="(10 * (($curpt/@km div 10)) - 10 * (($ptprec/@km div 10))) &gt; 0">
											<xsl:variable name="pospt2">
											  <xsl:for-each select="/d/fiche/pass/e">
												<xsl:if test="@idpt = $idpt"><xsl:value-of select="position()"/></xsl:if>
											  </xsl:for-each>
											</xsl:variable>
											<xsl:if test="number(/d/fiche/pass/e[position()=$pospt2]/@tnp) != 0">
												tmp.s0=<xsl:call-template name="calc-kmh">
																				<xsl:with-param name="idpt" select="$idpt" />
																				<xsl:with-param name="pts" select="/d/fiche/pts/pt" />
																				<xsl:with-param name="pass" select="/d/fiche/pass/e" />
																				<xsl:with-param name="js" select="'1'" />
																			</xsl:call-template>;
											</xsl:if>
										</xsl:if>
																				tmp2.r0=<xsl:value-of select="/d/fiche/pass/e[@idpt=$idpt]/@clt"/>;
									</xsl:if>
									
									data["<xsl:value-of select="$crs"/>"].push(tmp);
									data["<xsl:value-of select="$crs"/>"].push(tmp2);
								</xsl:if>
							</xsl:for-each>
							coureurs["<xsl:value-of select="$crs"/>"]=Array();
							coureurs["<xsl:value-of select="$crs"/>"].push("<xsl:value-of select="/d/fiche/identite/@prenom"/><xsl:text> </xsl:text><xsl:value-of select="/d/fiche/identite/@nom"/>");
							
							var libs={r:[],s:[],a:[]};
							libs["r"][0]=" ";
							libs["r"][1]=" : ";
							libs["r"][2]="e";
							libs["s"][0]=" ";
							libs["s"][1]=" : ";
							libs["s"][2]="km/h";
							libs["a"][0]=" ";
							libs["a"][1]=" : ";
							libs["a"][2]="min/km";
							
							var labfmt={r:[],s:[],a:[]};
							labfmt["r"][0]=" ";
							labfmt["r"][1]="e";
							labfmt["s"][0]=" ";
							labfmt["s"][1]="km/h";
							labfmt["a"][0]=" ";
							labfmt["a"][1]="min";
							
							$(function() {
								initAllGraph("s");
							});
						</script>
						<style>
							div.choiceChart {
								text-align:left;
								padding-left:50px;
							}
							div.choiceChart input:empty {
								opacity:0.001;
								position:absolute;
							}
							div.choiceChart label {
								display:relative;
								display:inline-block;
								padding-right:20px;
								border:none;
								font-size:1.2em;
								line-height: 1.2em;
								cursor:pointer;
								font-weight:normal;
								color:black;
								-webkit-user-select: none;
								-moz-user-select: none;
								-ms-user-select: none;
								user-select: none;
							}
							div.choiceChart input:checked + label {
								font-weight:bold;
								text-decoration:underline;
							}
							div.choiceChart input:not(:checked):hover + label {
								text-decoration:underline;
								color:black;
							}
							#tmpGPS { visibility:hidden; }
						</style>
						<div id="chart{$crs}" style="height:120px; width:850px;"></div>
						<div class="choiceChart">
							<input id="tcs" type="radio" name="typChart" value="s" checked="checked" onclick="initAllGraph(this.value);"/><label for="tcs">Vitesse</label>
							<input id="tca" type="radio" name="typChart" value="a" onclick="initAllGraph(this.value);"/><label for="tca">Allure</label>
							<input id="tcr" type="radio" name="typChart" value="r" onclick="initAllGraph(this.value);"/><label for="tcr">Place</label>
						</div>
						                  </div>
		  </xsl:if>
                  <div id="tab" class="vue">
                    <div class="postit" style="top:40px;display:none;"></div>
                    <table class="tpass">
                      <tr class="up">
                        <th>Point de passage</th>
                        							<th>Vitesse</th>
						                        <xsl:if test="string(fiche/pass/e[1]/@clt)!=''"><th>Class.</th></xsl:if>                                                <th>Jour/heure de passage</th>
                        <th>
							Temps de course							<xsl:if test="string(fiche/pass/e[1]/@tpsr)!=''">
								<br/>Officiel // Réel                            </xsl:if>
                        </th>
                                              </tr>
                      <xsl:for-each select="fiche/pts/pt">
                        <tr>
						  <xsl:attribute name="class">
							<xsl:if test="position() mod 2">odd </xsl:if>
							<xsl:if test="string(@sep)='1' and position()!=last()">sep</xsl:if>
                          </xsl:attribute>
                          <xsl:variable name="idpt" select="@idpt"/>
                          <xsl:variable name="passc" select="/d/fiche/pass/e[@idpt=$idpt]"/>
                                                    <td><span class="rig">
							  								<xsl:call-template name="fmt-i"><xsl:with-param name="v" select="@a"/></xsl:call-template> m							  							  </span><a href="#" data="{$idpt}"><xsl:value-of select="@n"/></a></td>
                          
                          							  <td><span class="rig">
								<xsl:if test="/d/fiche/state/@code != 'nl' and /d/fiche/state/@code != 'np'">																<xsl:call-template name="calc-kmh">
									<xsl:with-param name="idpt" select="$idpt" />
									<xsl:with-param name="pts" select="/d/fiche/pts/pt" />
									<xsl:with-param name="pass" select="/d/fiche/pass/e" />
									<xsl:with-param name="pace">
										<xsl:choose>
											<xsl:when test="/d/fiche/pts/pt[number(@idpt) = $idpt]/@unit='minp100'">2</xsl:when>
											<xsl:when test="/d/fiche/pts/pt[number(@idpt) = $idpt]/@unit='minpkm'">1</xsl:when>
											<xsl:otherwise>0</xsl:otherwise>
										</xsl:choose>
									</xsl:with-param>								
								</xsl:call-template>
								<xsl:choose>
									<xsl:when test="/d/fiche/pts/pt[number(@idpt) = $idpt]/@unit='minp100'"><xsl:text> / 100m</xsl:text></xsl:when>
									<xsl:when test="/d/fiche/pts/pt[number(@idpt) = $idpt]/@unit='minpkm'"> / km</xsl:when>
									<xsl:otherwise> km/h</xsl:otherwise>
								  </xsl:choose>
								
								</xsl:if>							  </span></td>
						  						  <xsl:if test="string(/d/fiche/pass/e[1]/@clt)!=''">                          <td><span class="rig">
                          <xsl:choose>
                            <xsl:when test="/d/fiche/state/@code != 'nl' and /d/fiche/state/@code != 'np' and count($passc) &gt; 0">
                              <xsl:value-of select="$passc/@clt"/>
                            </xsl:when>
                            <xsl:otherwise>-</xsl:otherwise>
                          </xsl:choose>
                          </span></td>
			</xsl:if>                                                    <td>
                            <xsl:choose>
                              <xsl:when test="/d/fiche/state/@code != 'nl' and /d/fiche/state/@code != 'np' and count($passc) &gt; 0">
                                <xsl:if test="string($passc/@ha) != ''">
                                  <xsl:call-template name="fmt-dtjt">
                                    <xsl:with-param name="j" select="$passc/@ja" />
                                    <xsl:with-param name="t" select="$passc/@ha" />
                                  </xsl:call-template>
                                </xsl:if>
                                <xsl:if test="position()!=last() and string($passc/@ha) != '' and string($passc/@hd) != ''"> / </xsl:if>
                                <xsl:if test="position()!=last() and string($passc/@hd) != ''">
                                  <xsl:call-template name="fmt-dtjt">
                                    <xsl:with-param name="j" select="$passc/@jd" />
                                    <xsl:with-param name="t" select="$passc/@hd" />
                                  </xsl:call-template>
                                </xsl:if>
                                                              </xsl:when>
                                                            <xsl:otherwise>-</xsl:otherwise>
                            </xsl:choose>
                          </td>
                          <td><span class="rig">
                            <xsl:choose>
                              <xsl:when test="/d/fiche/state/@code != 'nl' and /d/fiche/state/@code != 'np' and count($passc) &gt; 0">
								<xsl:choose>
									<xsl:when test="count(/d/fiche/pena/e)&gt;0">
										<xsl:if test="count(/d/fiche/pena/e[@idpt = $idpt])&gt;0">
											<xsl:choose>
												<xsl:when test="/d/fiche/pena/e[@idpt = $idpt]/@p &lt; 0">
																										<span title="Bonus" style="color:#00bc0f;margin-right:20px;">-<xsl:call-template name="hour2time"><xsl:with-param name="h" select="0 - /d/fiche/pena/e[@idpt = $idpt]/@p div 3600"/></xsl:call-template></span>
												</xsl:when>
												<xsl:otherwise>
																										<span title="Pénalité" style="color:#e11111;margin-right:20px;">+<xsl:call-template name="hour2time"><xsl:with-param name="h" select="/d/fiche/pena/e[@idpt = $idpt]/@p div 3600"/></xsl:call-template></span>
												</xsl:otherwise>
											</xsl:choose>
										</xsl:if>
										<xsl:choose>
							  				<xsl:when test="$idpt != /d/fiche/pts/pt[last()]/@idpt">
												<xsl:call-template name="hour2time"><xsl:with-param name="h" select="$passc/@tn + (sum(/d/fiche/pena/e[@idpt &lt;= $idpt]/@p) div 3600)"/></xsl:call-template>
											</xsl:when>
											<xsl:otherwise>
												<xsl:value-of select="$passc/@tps"/>
											</xsl:otherwise>
										</xsl:choose>
									</xsl:when>
									<xsl:otherwise>
										<xsl:value-of select="$passc/@tps"/>
									</xsl:otherwise>
								</xsl:choose>
								<xsl:if test="string($passc/@tpsr)!=''">
								// <xsl:value-of select="$passc/@tpsr"/>
								</xsl:if>
                              </xsl:when>
                              <xsl:otherwise>-</xsl:otherwise>
                            </xsl:choose>
                          </span></td>
							                        </tr>
                      </xsl:for-each>
                    </table>
                  </div>
		  <xsl:if test="string(fiche/@nocarto)!='1'">
                  <div id="carto" class="vue">
					  <xsl:choose>
						<xsl:when test="string(fiche/dotvision)!=''">
							<div id="div" class="divWindow">
								<iframe id="ifr" style="width:100%;height:100%" data-src="{fiche/dotvision}" src="about:blank"></iframe>
								<div id="fullscr"><a href="javascript:fullToggle();" title="full"><img src="im/fullScreen.png" border="0"/></a></div>
							</div>
						</xsl:when>
						<xsl:when test="string(fiche/ybtrack)!=''">
							<div id="div" class="divWindow">
								<iframe id="ifr" style="width:100%;height:100%" data-src="{fiche/ybtrack}" src="about:blank"></iframe>
								<div id="fullscr"><a href="javascript:fullToggle();" title="full"><img src="im/fullScreen.png" border="0"/></a></div>
							</div>
						</xsl:when>
						<xsl:when test="string(fiche/othergps)!=''">
							<div id="div" class="divWindow">
								<iframe id="ifr" style="width:100%;height:100%" data-src="{fiche/othergps}" src="about:blank"></iframe>
								<div id="fullscr"><a href="javascript:fullToggle();" title="full"><img src="im/fullScreen.png" border="0"/></a></div>
							</div>
						</xsl:when>
						<xsl:when test="string(fiche/nexxtep)!=''">
							<div id="div" class="divWindow">
								<iframe id="ifr" style="width:100%;height:100%" data-src="{fiche/nexxtep}" src="about:blank"></iframe>
								<div id="fullscr"><a href="javascript:fullToggle();" title="full"><img src="im/fullScreen.png" border="0"/></a></div>
							</div>
						</xsl:when>
						<xsl:otherwise>
							<script type="text/javascript">
								$(function(){
									$("#posTyp span").click(function(){
										var tt=$(this).data("typ");
										displayLoc(tt);
									});
								});
								function initMap() {
									initMap_<xsl:value-of select="/d/fiche/@c"/>();
									setTimeout('initOneMap(p_<xsl:value-of select="/d/fiche/@c"/>,b_<xsl:value-of select="/d/fiche/@c"/>);carte.on("click",function(event){$("#posTyp").hide();$("#posCode").hide();}); if(lastLoc &amp;&amp; lastLoc.minago&lt;30) {displayLoc("pg");}',1000); //test(event);
								}
								function choosePosTyp(e){
									$("#posTyp").show();
									e.stopPropagation();
								}
								function displayLoc(mode){
									<xsl:if test="count(/d/fiche/loc)&lt;=0">return false;</xsl:if>
									
									$("#posTyp span").removeClass("sel").removeClass("bgcol").addClass("color");
									var ms=$("#posTyp span[data-typ='"+mode+"']");
									ms.removeClass("color").addClass("sel").addClass("bgcol");
									$("#posTypBtn").val(ms.html());
										
									if (mode=="dpo") { //affiche dpo
										showDPO();
										hideGP();
										hideHisto();
										$("#posCode").hide();
									} else {
										hideDPO();
										if (mode=="pg"){
											showGP();
											hideHisto();
										}else {
											if (!histosloc){ //on a pas encore recup les data
												//crypte ?
												if (lastLoc.crypt=="1"){
													var code=getCookie('gpscode'+bib);
													if (code==null){
														$("#posCode").show();
														return;
													}
												}
												$.post("_gpshisto.php", "mode=getHistoLoc&amp;doss=<xsl:value-of select="fiche/@doss" />", function(resp) {
												  eval(resp);
												  showHisto(loc);
												  showGP();
											  });
										  } else {
											  showHisto(histosloc);
											  showGP();
										  }
										}
									}
								}
							</script>
							
							<div id="mapBox" style="position:relative">			
								<div id="map" class="_{/d/fiche/@c}">
									<xsl:if test="count(/d/fiche/loc)>=1">
										 <div class="leaflet-top leaflet-left " style="margin-left:50px">
											<input class="leaflet-control leaflet-bar mapBtn" type="button" id="posTypBtn" value="Dernière position officielle" onclick="choosePosTyp(event)" />
										</div>
	
									</xsl:if>
								</div>
									<div id="posTyp" style="display:none" class="leaflet-bar mapDialog" >
										<span data-typ="dpo" class="sel bgcol">Dernière position officielle</span>
										<hr/>
										<span data-typ="pg" class="color" >Position GPS</span>
										<hr/>
										<span data-typ="hpg" class="color" >Historique positions GPS</span>
									</div>
									<div id="posCode" style="display:none" class="leaflet-bar mapDialog">
										<span class="help bgcol">?</span>
										<h3 class="color" >Suivi GPS privé</h3>
										<label>code accès</label>
										<input id="gpscodeInput" />
										<input type="button" onclick='enregGPSCode();' value="Valider" class="bgcol valid" />
									</div>
							</div>
							<div id="profil2" class="profil">
							  <img src="images/profil_{/d/fiche/@c}.png"/>
							  <xsl:for-each select="fiche/pts/pt">
								<xsl:variable name="profidpt" select="@idpt"/>
								<xsl:variable name="profpassc" select="/d/fiche/pass/e[@idpt=$profidpt]"/>
								  <div data="{$profidpt}" style="top:{number(@py)}%;left:{number(@px)}%;transform:translate(-7px,-7px);">
									<xsl:attribute name="class">
									  <xsl:choose>
										<xsl:when test="@meet = 1">pts meet </xsl:when>
										<xsl:otherwise>pts </xsl:otherwise>
									   </xsl:choose>
									   <xsl:if test="/d/fiche/state/@code != 'nl' and /d/fiche/state/@code != 'np' and count($profpassc) &gt; 0"> passedPt </xsl:if>
									   <xsl:variable name="proflastpass" select="/d/fiche/pass/e[position()=last()]" />
									   <xsl:if test="(/d/fiche/state/@code != 'np' and /d/fiche/state/@code != 'nl' and $profidpt =$proflastpass/@idpt ) and not((/d/fiche/state/@code = 'c' or /d/fiche/state/@code = 'u' ) and count(/d/fiche/prev/e[number(@idpt) &gt; number($lastpass/@idpt)])&gt;0)"> lastPt</xsl:if>
									</xsl:attribute>
								  </div>
							  </xsl:for-each>
							  <xsl:choose>
							  <xsl:when test="(fiche/state/@code = 'c' or fiche/state/@code = 'u' ) and count(fiche/prev/e[number(@idpt) &gt; number($lastpass/@idpt)])&gt;0">
								  <xsl:variable name="nextpdist" select="fiche/prev/e[number(@idpt) &gt; number($lastpass/@idpt)][1]" />
								  <div class='lastPoint' data="{$nextpdist/@km}" ></div>
							  </xsl:when>
							 
						  </xsl:choose>
							</div>
						</xsl:otherwise>
					  </xsl:choose>
					                    </div>
		  </xsl:if>
		                  </div>
                </div>
              </div>
              
            </xsl:when>
            <xsl:otherwise>
                            <div id="ictete"/>
              <div id="tete">
                <div class="np" style="margin-top:10px;text-transform:uppercase">Rechercher un coureur</div>
              </div>
              <div id="fintete"/>
              <div id="content">
				  <h3>Choisissez le coureur parmi la liste suivante (<xsl:value-of select="count(fiche)"/>)</h3>
				  <div id="scrollZone">
					<table>
					  <thead>
						<tr>
						  <th>Course</th>
						  <th>Dossard</th>
						  <th>Nom</th>
						  <th>Prénom</th>
						  						  <th>Etat</th>
						  <th>Catégorie</th>
						  <th>Club</th>
						   						   							<th>Nationalité</th>
						   						</tr>
					  </thead>
					  <tbody>
						<xsl:for-each select="fiche">
						  <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:variable name="idc" select="@c"/>
							<td>
								<a href="javascript:setFav({@doss},true)" data-dos="{@doss}" class="nofav" title="Ajouter ce concurrent à ma liste de favoris"></a><a href="javascript:setFav({@doss},false)" data-dos="{@doss}" class="fav" title="Retirer ce concurrent de ma liste de favoris" style="display:none"></a>
																	<a href="javascript:setComp({@doss},true)" data-dos="{@doss}" class="nocomp" title="Ajouter ce concurrent à ma liste de comparaison"></a><a href="javascript:setComp({@doss},false)" data-dos="{@doss}" class="comp" title="Retirer ce concurrent de ma liste de comparaison" style="display:none"></a>
																<xsl:value-of select="/d/courses/c[@id=$idc]/@nc"/>
							</td>
							<td><a href="coureur.php?rech={@doss}">
								<xsl:choose>
									<xsl:when test="string(@nd)=''"><xsl:value-of select="@doss"/></xsl:when>
									<xsl:otherwise>Non affecté</xsl:otherwise>
								</xsl:choose>
							</a></td>
							<xsl:choose>
							  <xsl:when test="count(relai)&gt;0">
								<td><xsl:value-of select="relai/@n"/></td>
								<td>
								  <xsl:for-each select="relai/c">
									<xsl:if test="string(@doss)!=''"><xsl:value-of select="@doss"/> - </xsl:if>
																			<span class="pnom"><xsl:value-of select="@prenom"/></span><xsl:text> </xsl:text>
										<span class="nom"><xsl:value-of select="@nom"/></span><br/>
																			
								  </xsl:for-each>
								</td>
							  </xsl:when>
							  <xsl:otherwise>
								<td><xsl:value-of select="identite/@nom"/></td>
								<td><xsl:value-of select="identite/@prenom"/></td>
								
															  </xsl:otherwise>
							</xsl:choose>
							<td>
								<xsl:choose>
									<xsl:when test="state/@code = 'f'"><b>Finisher</b></xsl:when>
									<xsl:when test="state/@code = 'f2'"><b>Arrivant</b></xsl:when>
									<xsl:when test="state/@code = 'fe'">Fin&#160;d'étape</xsl:when>
									<xsl:when test="state/@code = 's'">Arrêté par l'organisation</xsl:when>
									<xsl:when test="state/@code = 'hd'">Hors délai</xsl:when>
									<xsl:when test="state/@code = 'a'">Arrêté</xsl:when>
									<xsl:when test="state/@code = 'd'">Disqualifié par l'organisation</xsl:when>
									<xsl:when test="state/@code = 'u'">Non classé</xsl:when>
									<xsl:when test="state/@code = 'np'">Non partant</xsl:when>
									<xsl:when test="state/@code = 'nl'">Départ&#160;non&#160;donné</xsl:when>
									<xsl:otherwise>En&#160;course...</xsl:otherwise>
								</xsl:choose>
							</td>
							<td><xsl:value-of select="identite/@cat"/></td>
							<td><xsl:value-of select="identite/@club"/></td>
													   							<td><xsl:value-of select="identite/@cio"/></td>
						   						  </tr>
						</xsl:for-each>
					  </tbody>
					</table>
				  </div>
              </div>
            </xsl:otherwise>
          </xsl:choose>
          <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="calc-kmh">
    <xsl:param name="idpt"/>
    <xsl:param name="pts"/>
    <xsl:param name="pass"/>
    <xsl:param name="js"/>
    <xsl:param name="pace"/>
    <xsl:choose>
      <xsl:when test="count($pass[@idpt = $idpt]) = 0 or number($idpt) = 0">-</xsl:when>
      <xsl:otherwise>
        <xsl:variable name="pospt">
          <xsl:for-each select="$pass">
            <xsl:if test="@idpt = $idpt"><xsl:value-of select="position()"/></xsl:if>
          </xsl:for-each>
        </xsl:variable>
        <xsl:variable name="idptprec" select="$pass[position()=($pospt - 1)]/@idpt" />
        <xsl:variable name="kmprec" select="10 * ((number($pts[@idpt = $idptprec]/@km) div 10))" />
        <xsl:variable name="km" select="10 * ((number($pts[@idpt = $idpt]/@km) div 10))" />
        <xsl:variable name="tps" select="number($pass[position()=$pospt]/@tnp)" />

        <xsl:choose>
			<xsl:when test="($km - $kmprec)=0">-</xsl:when>
			<xsl:otherwise>
				 <xsl:choose>
					<xsl:when test="string($js)=1">
						<xsl:value-of select="format-number(($km - $kmprec) div $tps, '0.00')"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:choose>
							<xsl:when test="string($pace)='1'">
								<xsl:call-template name="minutes2pace">
									<xsl:with-param name="minutes" select="60 div (($km - $kmprec) 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 * ($km - $kmprec)) div $tps)"/>
								</xsl:call-template>
							</xsl:when>
							<xsl:otherwise>
								<xsl:call-template name="fmt-f">
									<xsl:with-param name="v" select="($km - $kmprec) div $tps"/>
									<xsl:with-param name="format" select="'0.00'"/>
								</xsl:call-template>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:otherwise>
				</xsl:choose>	
			</xsl:otherwise>
        </xsl:choose>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
  <xsl:template name="getoverallkm">
	<xsl:param name="pts"/>
	<xsl:param name="idx"/>
	<xsl:if test="count($pts/pt) &lt;= number($idx)"><xsl:value-of select="10 * (($pts/pt[last()]/@km div 10))"/></xsl:if>
	<xsl:variable name="idxsmax"><xsl:for-each select="$pts/pt">
		<xsl:variable name="pos" select="position()"/>
		<xsl:choose>
			<xsl:when test="$pos &lt;= number($idx)"></xsl:when>
			<xsl:when test="$pos &gt; number($idx)"><xsl:if test="$pts/pt[$pos]/@km &lt; $pts/pt[$pos - 1]/@km"><xsl:value-of select="$pos - 1"/>,</xsl:if></xsl:when>
		</xsl:choose>
	</xsl:for-each></xsl:variable>
	<xsl:choose>
		<xsl:when test="string($idxsmax) != ''">
			<xsl:variable name="idxmax" select="number(substring-before($idxsmax, ','))"/>
			<xsl:variable name="val1" select="10 * (($pts/pt[$idxmax]/@km div 10))"/>
			<xsl:variable name="val2"><xsl:call-template name="getoverallkm"><xsl:with-param name="pts" select="$pts"/><xsl:with-param name="idx" select="$idxmax + 1"/></xsl:call-template></xsl:variable>
			<xsl:value-of select="number($val1) + number($val2)"/>
		</xsl:when>
		<xsl:otherwise>
			<xsl:value-of select="10 * (($pts/pt[last()]/@km div 10))"/>
		</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>
