<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xslc="http://xslcomponents.org/TR/WD-xslc">
	<xsl:import href="../../xslc.xsl"/>
	<xsl:import href="../../Common.xsl"/>
	<xsl:template match="/">
		<xsl:apply-templates select="document"/>
	</xsl:template>
	<xsl:template match="document">
		<xsl:call-template name="xslc:Page">
			<xsl:with-param name="DisplayToolbar">1</xsl:with-param>
			<xsl:with-param name="DisplayTabControl">0</xsl:with-param>
			<xsl:with-param name="DisplayTabs">0</xsl:with-param>
			<xsl:with-param name="DisplayActionMenu">
				<xsl:if test="/document/OutParams/AmMode='0'">2</xsl:if>
				<xsl:if test="/document/OutParams/AmMode!='0'">1</xsl:if>
			</xsl:with-param>
			<xsl:with-param name="Head">
				<script text="text/javascript" src="{$XMLC_Portal}js/infobulle.js"/>
				<style type="text/css">.infobulle{ 
color: #145aa2; 
position: absolute; 
visibility : hidden; 
border: 1px solid #B1DBF3; 
padding: 10px; 
font-family: Comic sans MS; 
align: center; 
font-size: 9pt; 
background-color: #dbeaf5; 
} </style>
				<script language="javascript">
					<![CDATA[var apLastValue='x';
function VOapShowHide_dark(ID) {
  if (apLastValue!='') apShowHide_dark(ID); 
  apLastValue='x';
}
function VOapShowHide(ID) {
  if (apLastValue!='') apShowHide(ID); 
  apLastValue='x';
}
function VOShowHideActionMenu() {
  ShowHideActionMenu(); 
  goSubmit();
}]]>
				</script>
				<script language="javascript">
					<![CDATA[// Valider les paramètres d'appel et lancement Service
// 
function goService(nService) {
  if (nService != '') {
     if ((nService.search('http://www')==-1) && (nService.search('/projHistoBin')==-1)) nService=XMLC_BaseHRef+nService ;
     if (nService.search('/projHistoBin')>-1) nService='http://'+XMLC_Host+nService ;
     document.location =  nService ;}
  return false;
}

function goSubmit() {
  SetField('aMainForm', 'AmMode',  (getObjectById('xslcActionMenu').style.display == 'none') ? '0' : '1');
  document.aMainForm.submit(); 
  return false;
}]]>
				</script>
				<script language="javascript">
					<![CDATA[function handleKeyPress(e) {
  var keyCode = GetEventKeyCode(e);
// sur Entrer : Valider
  if (keyCode == 13) {
    goSubmit('PDF'); return false; }
  if (keyCode == 27) {
    parent.ShowHide('SelPrint'); return false;}
  return false;
}]]>
					<![CDATA[// 
// Gestion des dates des mois suivant et précédent
// 
var adate;
var datedeb;
var datefin;

function prevMonth() {
 if (verifdate('MainForm', 'DATEFieldDeb')) {
  SetDate(-15);
  SetField('MainForm', 'DATEFieldDeb', vdateFormat(datedeb));
  SetField('MainForm', 'DATEFieldFin', vdateFormat(datefin));
 }
}

function nextMonth() {
 if (verifdate('MainForm', 'DATEFieldDeb')) {
  SetDate(+32);
  SetField('MainForm', 'DATEFieldDeb', vdateFormat(datedeb));
  SetField('MainForm', 'DATEFieldFin', vdateFormat(datefin));
 }
}]]>
					<![CDATA[// 
// Vérification d'une date
// 
function verifdate(FormID, FieldName) {
    var datetest = GetField(FormID, FieldName);
    var format = /^(\d{1,2}\/){2}\d{4}$/;
    if(!format.test(datetest)){ return false;}
    else{
        var date_temp = datetest.split('/');
        date_temp[1] -=1;        // On rectifie le mois car de 0 à 11 !!!
        adate = new Date();
        adate.setFullYear(date_temp[2]);
        adate.setMonth(date_temp[1]);
        adate.setDate(date_temp[0]);
        return true;
    }
}]]>
					<![CDATA[// 
// Calculer la date de début et de fin de mois 
// 
function SetDate(aVal)
{
 var monHeure = adate.getTime();
 var jourPlus1 = monHeure + 86400 * 1000 * aVal; // 1 jour = 86400 secondes
 datedeb = new Date(); datedeb.setTime (jourPlus1);
 while (datedeb.getDate() != 1) { jourPlus1 = jourPlus1-86400*1000; datedeb.setTime (jourPlus1); }

    jourPlus1 = jourPlus1+28*86400*1000; 
    datefin = new Date(); datefin.setTime (jourPlus1);
    while (datefin.getDate() != 1) { jourPlus1 = jourPlus1 +86400*1000; datefin.setTime (jourPlus1); };
    jourPlus1 = jourPlus1 -86400*1000; datefin.setTime (jourPlus1); 
}
]]>
					<![CDATA[// 
// retourner le format d'une date "dd/mm/yyyy"
// 
function vdateFormat(vdate)
{
dy = vdate.getFullYear();
dm = vdate.getMonth() + 1;
dd = vdate.getDate();
if ( dy < 100 ) dy = dy + 1900; 	
ys = new String(dy);
ms = new String(dm);
ds = new String(dd);
if ( ms.length == 1 ) ms = "0" + ms;
if ( ds.length == 1 ) ds = "0" + ds;
vres = ds + "/" + ms + "/" + ys;
    return vres;
}]]>// 
// Afficher la fenêtre popup pour le calendrier XMLC_Calendar
// 
function PopCalendar(PopID, FieldName, yOffset) {
  if (Pop = getObjectById(PopID)) {
    if (obj = getObjectById(FieldName)) {
      ShowHide(PopID, 'WIDTH', 180, 'HEIGHT', 130); 
      aPos=GetObjectPosY(FieldName)+yOffset;
      if (Pop.style.top != aPos) {
        Pop.style.top = aPos;
      }
      CalendarURL = XMLC_BaseHRef+'XMLC_PopupCalendar?XMLC_FieldName='+FieldName;
      CalendarURL += '&amp;XMLC_DateValue=' + obj.value;
      CalendarURL += '&amp;XMLC_PopID=' + PopID;
      Pop.src = CalendarURL;
    }
  }
}</script>
			</xsl:with-param>
			<xsl:with-param name="ActionMenu">
				<xsl:if test="/document/XMLC_Params/XMLC_UserName != '' ">
					<xsl:call-template name="xslc:VOActionPanel">
						<xsl:with-param name="Expanded">1</xsl:with-param>
						<xsl:with-param name="Dark">1</xsl:with-param>
						<xsl:with-param name="Name">FiltAffichage</xsl:with-param>
						<xsl:with-param name="Title">Paramètres</xsl:with-param>
						<xsl:with-param name="Content">
							<xsl:variable name="idAffSel">
								<xsl:if test="/document/OutParams/AffSel=''">0</xsl:if>
								<xsl:value-of select="/document/OutParams/AffSel"/>
							</xsl:variable>
							<table cellpadding="2" cellspacing="0">
								<xsl:for-each select="/document/ListFiltersS/ListFilters">
									<xsl:variable name="apOver">
										<xsl:if test="idAffichage='-1' or nService=''">apRowNoSelected</xsl:if>
										<xsl:if test="idAffichage!='-1'">apRowSelected</xsl:if>
									</xsl:variable>
									<xsl:variable name="apAttr">
										<xsl:if test="idAffichage='-1' or nService=''">color:#A0A0A0;</xsl:if>
										<xsl:if test="/document/XMLC_Params/XMLC_Action=nService">
											<xsl:if test="AttrColor!=''">color:#<xsl:value-of select="AttrColor"/>; font-weight: bold;</xsl:if>
											<xsl:if test="AttrColor=''">color:#3f3dfd; </xsl:if>
										</xsl:if>
										<xsl:if test="idAffichage!='-1' and /document/XMLC_Params/XMLC_Action!=nService and nService!=''">
											<xsl:if test="AttrColor=''">color:#145aa2; </xsl:if>
											<xsl:if test="AttrColor!=''">color:#<xsl:value-of select="AttrColor"/>; </xsl:if>
										</xsl:if>
									</xsl:variable>
									<xsl:variable name="nServ">
										<xsl:value-of select="nService"/>
									</xsl:variable>
									<xsl:if test="idAffichage!='-2'">
										<tr>
											<td class="apLink" onmouseover="oldClass=this.className; this.className='{$apOver}';" onmouseout="this.className=oldClass;" onclick="javascript: goService('{$nServ}'); return false;" align="left" style="{$apAttr} width:200px;">
												<span style="color:#d0d0ff;">
													<xsl:if test="AttrIndent='1'">» </xsl:if>
													<xsl:if test="AttrIndent='2'">»» </xsl:if>
													<xsl:if test="AttrIndent='3'">»»» </xsl:if>
												</span>
												<xsl:if test="/document/XMLC_Params/XMLC_Action=nService">
													<img border="0" src="{$XMLC_PictosPath}ico_run.gif"/> - </xsl:if>
												<xsl:value-of select="FilterName"/>
											</td>
										</tr>
									</xsl:if>
								</xsl:for-each>
							</table>
						</xsl:with-param>
					</xsl:call-template>
				</xsl:if>
			</xsl:with-param>
			<xsl:with-param name="Title">
				<xsl:value-of select="/document/ListFiltersS/ListFilters[nService=/document/XMLC_Params/XMLC_Action]/FilterName"/>
			</xsl:with-param>
			<xsl:with-param name="ToolbarButtonsLeft">
				<ToolbarButton>
					<xsl:call-template name="ToolButtonRefresh">
						<xsl:with-param name="URL">OptContacts?tVOContacts_StartingRow=<xsl:value-of select="/document/tVOContactsS/@StartingRow"/>&amp;SelGroup=<xsl:value-of select="/document/OutParams/SelGroup"/>&amp;SelOptTypeVO=<xsl:value-of select="/document/OutParams/SelOptTypeVO"/>&amp;SelOptMarque=<xsl:value-of select="/document/OutParams/SelOptMarque"/>
						</xsl:with-param>
					</xsl:call-template>
				</ToolbarButton>
				<ToolbarButton>
					<img border="0" src="{$XMLC_SkinPath}toolbar_separator.gif"/>
				</ToolbarButton>
				<xsl:call-template name="CommonToolbarButtonsLeft"/>
			</xsl:with-param>
			<xsl:with-param name="ToolbarButtonsRight">
				<xsl:call-template name="VOLineToolbarButtonsRight"/>
			</xsl:with-param>
			<xsl:with-param name="Body">
				<script language="javascript">
					<![CDATA[
var questionDeleteContact = "Etes vous sûr de vouloir supprimer ce contact commercial?\nCliquez OK pour confirmer.";
]]>
				</script>
				<xsl:call-template name="xslc:ApplicationMessages"/>
				<xsl:call-template name="VOZoneTab">
					<xsl:with-param name="nService">OptParams</xsl:with-param>
				</xsl:call-template>
				<xsl:apply-templates select="tVOContactsS"/>
				<xsl:call-template name="xslc:PoweredBy"/>
			</xsl:with-param>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="tVOContactsS">
		<div id="bulle" nowrap="nowrap" style="width: 2px; height: 200px;" class="infobulle"/>
		<div id="zoneTOP">
			<p style="font-size:16px">
				<xsl:value-of select="/document/ListFiltersS/ListFilters[nService=/document/XMLC_Params/XMLC_Action]/FilterName"/>
			</p>
		</div>
		<table width="100%">
			<tr>
				<td width="85px">Groupe : </td>
				<td>
					<xsl:choose>
						<xsl:when test="/document/XMLC_Params/XMLC_Supervisor != '1'">
							<xsl:value-of select="/document/OutParams/SelGroup"/>
						</xsl:when>
						<xsl:otherwise>
							<select id="CBGROUPE" style="width:150px" onchange="javascript: document.aMainForm.SelGroup.value=getObjectById('CBGROUPE').value; goSubmit(); return false;">
								<xsl:for-each select="/document/ListGroupsS/ListGroups">
									<xsl:sort select="cGroup"/>
									<option value="{cGroup}">
										<xsl:if test="/document/OutParams/SelGroup=cGroup">
											<xsl:attribute name="selected"/>
										</xsl:if>
										<xsl:value-of select="cGroup"/>
									</option>
								</xsl:for-each>
							</select>
						</xsl:otherwise>
					</xsl:choose>
				</td>
			</tr>
			<tr>
				<td width="85px">Sélection : </td>
				<td>
					<select id="CBTypeVO" name="CBTypeVO" onchange="javascript: document.aMainForm.SelOptTypeVO.value=getObject('CBTypeVO').value; goSubmit(); return false;" style="width:150px" onkeypress="return handleKeyPress(event);">
						<option value="0">
							<xsl:if test="/document/OutParams/SelOptTypeVO='' or /document/OutParams/SelOptTypeVO='0'">
								<xsl:attribute name="selected"/>
							</xsl:if>Tous Véhicules</option>
						<option value="2">
							<xsl:if test="/document/OutParams/SelOptTypeVO='2'">
								<xsl:attribute name="selected"/>
							</xsl:if>Diffusion VD</option>
						<option value="1">
							<xsl:if test="/document/OutParams/SelOptTypeVO='1'">
								<xsl:attribute name="selected"/>
							</xsl:if>Diiffusion VO</option>
					</select>
				</td>
			</tr>
			<tr>
				<td width="85px">Marque : </td>
				<td>
					<select id="CBMarque" name="CBMarque" onchange="javascript: document.aMainForm.SelOptMarque.value=getObject('CBMarque').value; goSubmit(); return false;" style="width:150px" onkeypress="return handleKeyPress(event);">
						<option value="">
							<xsl:if test="/document/OutParams/SelOptMarque=''">Choix Marque</xsl:if>
							<xsl:if test="/document/OutParams/SelOptMarque!=''">Toutes Marques</xsl:if>
						</option>
						<xsl:for-each select="/document/tVOMarquesS/tVOMarques">
							<xsl:sort select="RubricText"/>
							<option value="{RubricText}">
								<xsl:if test="/document/OutParams/SelOptMarque=RubricText">
									<xsl:attribute name="selected"/>
								</xsl:if>
								<xsl:value-of select="RubricText"/>
							</option>
						</xsl:for-each>
					</select>
				</td>
			</tr>
		</table>
		<table border="0" cellpadding="2" cellspacing="0" class="clFlatTable" width="100%">
			<form name="aMainForm" method="POST" action="{/document/Aliases/bdVODLL}OptContacts">
				<input type="hidden" name="tVOContacts_STARTINGROW" value="{@StartingRow}"/>
				<input type="hidden" name="AmMode" value="{/document/OutParams/AmMode}"/>
				<input type="hidden" name="SelGroup" value="{/document/OutParams/SelGroup}"/>
				<input type="hidden" name="SelOptTypeVO" value="{/document/OutParams/SelOptTypeVO}"/>
				<input type="hidden" name="SelOptMarque" value="{/document/OutParams/SelOptMarque}"/>
			</form>
			<form name="FormDeletetVOContacts" method="POST" action="{/document/Aliases/bdVODLL}DeletetVOContacts">
				<input type="hidden" name="tVOContacts_STARTINGROW" value="{@StartingRow}"/>
				<input type="hidden" name="idContact"/>
				<input type="hidden" name="SelGroup" value="{/document/OutParams/SelGroup}"/>
				<input type="hidden" name="SelOptTypeVO" value="{/document/OutParams/SelOptTypeVO}"/>
				<input type="hidden" name="SelOptMarque" value="{/document/OutParams/SelOptMarque}"/>
				<input type="hidden" name="NextAction" value="OptContacts"/>
			</form>
			<form name="FormUpdatetVOContacts" method="POST" action="{/document/Aliases/bdVODLL}UpdatetVOContacts">
				<input type="hidden" name="XMLC_Pivot" value="tVOContacts"/>
				<input type="hidden" name="tVOContacts_STARTINGROW" value="{@StartingRow}"/>
				<input type="hidden" name="SelGroup" value="{/document/OutParams/SelGroup}"/>
				<input type="hidden" name="SelOptTypeVO" value="{/document/OutParams/SelOptTypeVO}"/>
				<input type="hidden" name="SelOptMarque" value="{/document/OutParams/SelOptMarque}"/>
				<input type="hidden" name="NextAction" value="OptContacts"/>
				<tr class="clRowHeader">
					<xsl:if test="/document/XMLC_Profile/XMLC_DisplayHeaderGradient = '1'">
						<xsl:attribute name="style">background-image: url('<xsl:value-of select="$XMLC_SkinPath"/>rowHeader_Gradient.gif');</xsl:attribute>
					</xsl:if>
					<td style="width: 12px;">
						<input type="image" border="0" src="{$XMLC_PictosPath}ico_Check.gif" alt="Save"/>
					</td>
					<td style="width: 150px;">Site</td>
					<td style="width: 50px;">Type</td>
					<td style="width: 135px;">Diffusion vers</td>
					<td style="width: 135px;">Tracking vers</td>
					<td style="width: 180px;">Contact(s)</td>
					<td style="width: 240px;">Mail </td>
					<td style="width: 50px;">SRMail</td>
					<td style="width: 150px;">Téléphone </td>
					<td nowrap="nowrap" style="width: 50px; ">SRTel</td>
				</tr>
				<xsl:apply-templates select="tVOContacts"/>
			</form>
			<form name="FormInserttVOContacts" method="POST" action="{/document/Aliases/bdVODLL}InserttVOContacts">
				<input type="hidden" name="tVOContacts_STARTINGROW" value="{@StartingRow}"/>
				<input type="hidden" name="SelGroup" value="{/document/OutParams/SelGroup}"/>
				<input type="hidden" name="SelOptTypeVO" value="{/document/OutParams/SelOptTypeVO}"/>
				<input type="hidden" name="SelOptMarque" value="{/document/OutParams/SelOptMarque}"/>
				<input type="hidden" name="NextAction" value="OptContacts"/>
				<tr class="clDataGridLight">
					<td class="clRowHeader">
						<a href="." onclick="document.FormInserttVOContacts.submit(); return false;">
							<img border="0" src="{$XMLC_PictosPath}ico_xplus.gif" alt="Insert this new record"/>
						</a>
					</td>
					<td>
						<select name="idSite" id="idSite" style="width:140px">
							<option value="0">..</option>
							<xsl:for-each select="/document/tVOSitesS/tVOSites">
								<xsl:sort select="LibelleSociete"/>
								<option value="{idSite}">
									<xsl:value-of select="LibelleSociete"/>
								</option>
							</xsl:for-each>
						</select>
					</td>
					<td>
						<select name="TypeVO" id="TypeVO">
							<option value="1">Vo</option>
							<xsl:for-each select="/document/tVOMarquesS/tVOMarques">
								<xsl:sort select="RubricText"/>
								<option value="{RubricIndex}">
									<xsl:value-of select="RubricText"/>
								</option>
							</xsl:for-each>
						</select>
					</td>
					<td>
						<select name="idSiteSubst" id="idSiteSubst" style="width:140px">
							<option value="0">..</option>
							<xsl:for-each select="/document/tVOSitesS/tVOSites">
								<xsl:sort select="LibelleSociete"/>
								<option value="{idSite}">
									<xsl:value-of select="LibelleSociete"/>
								</option>
							</xsl:for-each>
						</select>
					</td>
					<td>
						<select name="idSiteTrack" id="idSiteTrack" style="width:140px">
							<option value="0">..</option>
							<xsl:for-each select="/document/tVOSitesS/tVOSites">
								<xsl:sort select="LibelleSociete"/>
								<option value="{idSite}">
									<xsl:value-of select="LibelleSociete"/>
								</option>
							</xsl:for-each>
						</select>
					</td>
					<td>
						<input type="text" name="contact"/>
					</td>
					<td>
						<input type="text" name="email"/>
					</td>
					<td/>
					<td>
						<input type="text" name="telephone"/>
					</td>
					<td/>
				</tr>
			</form>
			<xsl:call-template name="xslc:ListFooter">
				<xsl:with-param name="colspan">10</xsl:with-param>
			</xsl:call-template>
		</table>
	</xsl:template>
	<xsl:template match="tVOContacts">
		<xsl:variable name="clValue">
			<xsl:choose>
				<xsl:when test="(position() mod 2)=0">clDataGridDark</xsl:when>
				<xsl:otherwise>clDataGridLight</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<xsl:variable name="clType">
			<xsl:value-of select="TypeVO"/>
		</xsl:variable>
		<xsl:variable name="clidContact">
			<xsl:value-of select="idContact"/>
		</xsl:variable>
		<xsl:variable name="clSite">
			<xsl:value-of select="idSite"/>
		</xsl:variable>
		<xsl:variable name="clSiteSubst">
			<xsl:value-of select="idSiteSubst"/>
		</xsl:variable>
		<xsl:variable name="clSiteTrack">
			<xsl:value-of select="idSiteTrack"/>
		</xsl:variable>
		<xsl:variable name="clMail">
			<xsl:value-of select="email"/>
		</xsl:variable>
		<xsl:variable name="clTel">
			<xsl:value-of select="telephone"/>
		</xsl:variable>
		<xsl:variable name="clSRMail">
			<xsl:for-each select="/document/SRMailS/SRMail">
				<xsl:if test="$clSite=idSite and $clType=TypeVO and $clMail=email and $clidContact=idContact">
					<xsl:value-of select="nbSRMail"/>
				</xsl:if>
			</xsl:for-each>
		</xsl:variable>
		<xsl:variable name="clSRMailInfos">
			<xsl:value-of select="nbSRMail"/> redirection(s) Mail : <xsl:for-each select="/document/SRInfosS/SRInfos">
				<xsl:sort select="Annonceur"/>
				<xsl:if test="$clSite=idSite and $clType=TypeVO and $clMail=Mail and $clidContact=idContact">&lt;br&gt;<xsl:value-of select="Annonceur"/> .. <xsl:value-of select="SRMail"/>
				</xsl:if>
			</xsl:for-each>
		</xsl:variable>
		<xsl:variable name="clSRTel">
			<xsl:for-each select="/document/SRTelS/SRTel">
				<xsl:if test="$clSite=idSite and $clType=TypeVO and $clTel=telephone and $clidContact=idContact">
					<xsl:variable name="vnbSRTel">
						<xsl:value-of select="nbSRTel - SIP"/>
					</xsl:variable>
					<xsl:value-of select="$vnbSRTel"/>
					<xsl:if test="SIP!='0' or SRSIP!='0' ">[<xsl:value-of select="SIP"/>,<xsl:value-of select="SRSIP"/>]</xsl:if>
				</xsl:if>
			</xsl:for-each>
		</xsl:variable>
		<xsl:variable name="clSRTelInfos">redirection(s) Téléphone : <xsl:for-each select="/document/SRInfosS/SRInfos">
				<xsl:sort select="Annonceur"/>
				<xsl:if test="$clSite=idSite and $clType=TypeVO and $clMail=Mail and $clidContact=idContact">&lt;br&gt;<xsl:value-of select="Annonceur"/> .. <xsl:value-of select="SRTel"/>
					<xsl:if test="LigneSIP!=''">(<xsl:value-of select="LigneSIP"/>)</xsl:if>
				</xsl:if>
			</xsl:for-each>
		</xsl:variable>
		<tr class="{$clValue}">
			<input type="hidden" name="tVOContacts[{position()}].idContact" value="{idContact}"/>
			<td class="clRowHeader">
				<a href="." onclick="document.FormDeletetVOContacts.idContact.value='{idContact}'; submitForm('FormDeletetVOContacts', 'CONFIRM', questionDeleteContact); return false;">
					<img border="0" src="{$XMLC_PictosPath}ico_xminus.gif" alt="Delete this record"/>
				</a>
			</td>
			<td>
				<select name="tVOContacts[{position()}].idSite" id="tVOContacts[{position()}].idSite" style="width:140px">
					<xsl:for-each select="/document/tVOSitesS/tVOSites">
						<xsl:sort select="LibelleSociete"/>
						<option value="{idSite}">
							<xsl:if test="$clSite=idSite">
								<xsl:attribute name="selected"/>
							</xsl:if>
							<xsl:value-of select="LibelleSociete"/>
						</option>
					</xsl:for-each>
				</select>
			</td>
			<td>
				<select name="tVOContacts[{position()}].TypeVO" id="tVOContacts[{position()}].TypeVO">
					<option value="1">
						<xsl:if test="$clType=1">
							<xsl:attribute name="selected"/>
						</xsl:if>Vo</option>
					<xsl:for-each select="/document/tVOMarquesS/tVOMarques">
						<xsl:sort select="RubricText"/>
						<option value="{RubricIndex}">
							<xsl:if test="$clType=RubricIndex">
								<xsl:attribute name="selected"/>
							</xsl:if>
							<xsl:value-of select="RubricText"/>
						</option>
					</xsl:for-each>
				</select>
			</td>
			<td>
				<select name="tVOContacts[{position()}].idSiteSubst" id="tVOContacts[{position()}].idSiteSubst" style="width:140px">
					<option value="0">..</option>
					<xsl:for-each select="/document/tVOSitesS/tVOSites">
						<xsl:sort select="LibelleSociete"/>
						<option value="{idSite}">
							<xsl:if test="$clSiteSubst=idSite">
								<xsl:attribute name="selected"/>
							</xsl:if>
							<xsl:value-of select="LibelleSociete"/>
						</option>
					</xsl:for-each>
				</select>
			</td>
			<td>
				<select name="tVOContacts[{position()}].idSiteTrack" id="tVOContacts[{position()}].idSiteTrack" style="width:140px">
					<option value="0">..</option>
					<xsl:for-each select="/document/tVOSitesS/tVOSites">
						<xsl:sort select="LibelleSociete"/>
						<option value="{idSite}">
							<xsl:if test="$clSiteTrack=idSite">
								<xsl:attribute name="selected"/>
							</xsl:if>
							<xsl:value-of select="LibelleSociete"/>
						</option>
					</xsl:for-each>
				</select>
			</td>
			<td>
				<input type="text" name="tVOContacts[{position()}].contact" value="{contact}"/>
			</td>
			<td>
				<xsl:for-each select="/document/ErrContactsS/ErrContacts">
					<xsl:if test="$clidContact=idContact">
						<img alt="Ce commercial ne figure plus dans la liste des commerciaux" border="0" src="{$XMLC_PictosPath}warning.gif" width="18" height="18"/>
					</xsl:if>
				</xsl:for-each>
				<input type="text" name="tVOContacts[{position()}].email" value="{email}"/>
			</td>
			<td onmouseover="ib_montre('Liste des {$clSRMail} \r\n\r\n{$clSRMailInfos}'); return false;" onmouseout="ib_cache();" align="center" style="color:blue">
				<xsl:if test="$clSRMail=''">..</xsl:if>
				<xsl:if test="$clSRMail!=''">
					<xsl:value-of select="$clSRMail"/>
				</xsl:if>
			</td>
			<td>
				<xsl:for-each select="/document/cntCommerciauxS/cntCommerciaux">
					<xsl:if test="$clMail=email and $clTel!=Telephone">
						<img alt="Le téléphone diffère de celui indiqué dans la liste des commerciaux et utilisateurs ProFid" border="0" src="{$XMLC_PictosPath}warning.gif" width="18" height="18"/>
					</xsl:if>
				</xsl:for-each>
				<input type="text" name="tVOContacts[{position()}].telephone" value="{telephone}"/>
			</td>
			<td onmouseover="ib_montre('Liste des {$clSRTel} {$clSRTelInfos}'); return false;" onmouseout="ib_cache();" align="center" style="color:blue">
				<xsl:if test="$clSRTel=''">..</xsl:if>
				<xsl:if test="$clSRTel!=''">
					<xsl:value-of select="$clSRTel"/>
				</xsl:if>
			</td>
		</tr>
	</xsl:template>
</xsl:stylesheet>
