//*******************************************************************************************
//	Progiciel :		Profils.net
//	Version :		2.6
//
//	Application :	nom_application_IIS
//	Version :		version_application
//
//	Script :		Client_Library.js
//	Version :		1.0.0
//	MAJ par :		Frédéric Mayot, Julien Bréau,VLE,DYU,XMN
//	MAJ le :		14/01/02
//	Description :	Fonctions de validation clientes
//*******************************************************************************************

//*******************************************************************************************
// inclusion des bibliothèques de fonctions et de constantes
//
// -->IsStringOK (Compare le contenu d'une chaine (stringTape) avec le contenu d'une chaine de référence (StringOk).
//
// -->CountOccurrences (Compte le nombre d'occurrences d'un élément donné dans une chaine de caractères.)
//
// -->IsFirstLastStringOK (Teste la validité du premier et du dernier caractère d'une chaine)
//
// -->ContainOnlySpaces (Détecte si la chaîne ne contient que des espaces)
//
// -->SelectAll (Selectionne toutes les options d'un select multiple)
//
// -->UnSelectAll (Dé-séléctionne toutes les options d'un select multiple)
//
// -->AddItem (Ajoute la sélection d'un combo obj_HTMLListdans un combo obj_HTMLListAdd en tenant compte
//				le cas échéant du choix d'une option de précision dans le combo obj_HTMLListPrecision)	
//
// -->AddItemNew (Ajoute la sélection d'un combo obj_HTMLListdans un combo obj_HTMLListAdd en tenant compte
//				le cas échéant du choix d'une option de précision dans le combo obj_HTMLListPrecision
//
// -->RemoveItem (Supprime les options sélectionées d'un objet select)
//
// -->MoveItem (Déplace une option dans un objet select vers le haut ou le bas suivant str_direction)
//
// -->PutItem ( Met à jour les options d'un objet select multiple
//             en fonction des options sélectionnées dans une autre select multiple)
//
//*******************************************************************************************

//*******************************************************************************************
//  Auteur : Lagrange Virginie
//  Date maj : 14/08/01
//
//	Fonction :	IsStringOK
//
//	Objet :		Compare le contenu d'une chaine (stringTape)
//	            avec le contenu d'une chaine de référence (StringOk).
//
//	Entrées :	- str_tape : Chaine de caractères saisie.
//				- str_ok : Chaine de caractères de référence.
//
//	Sortie :	si non conforme : - False
//									  - affichage d'un message d'erreur avec explications
//									  - focus sur l'élément
//					True sinon
//*******************************************************************************************

function IsStringOK(str_tape, str_ok)
{
	var int_i, int_j;
		// parcours de la chaine de caractères
    	for (int_i = 0; int_i < str_tape.length; int_i++)
	 	{	
	   		var str_Ch = str_tape.charAt(int_i);
	   		for (int_j = 0; int_j < str_ok.length; int_j++)
	     		if (str_Ch == str_ok.charAt(int_j))
					break;
	   			if (int_j == str_ok.length)
				return(false);
	  	}
	 	return (true);
}

 
//*******************************************************************************************
//  Auteur : Lagrange Virginie
//  Date maj : 14/08/01
//
//	Fonction :	CountOccurrences
//
//	Objet :		Compte le nombre d'occurrences d'un élément donné dans une chaine de caractères.
//
//	Entrées :	- str_characters : Chaine de caractères saisie.
//				- var_char : Caractère recherché.
//
//	Sortie :	- int_nbOccur : Nombre d'occurrences.
//*******************************************************************************************

function CountOccurrences(str_characters, var_char) 
{
	var int_length; //Nombre de caractères
	var int_nbOccur; //Nombre d'occurrences

	int_length = str_characters.length;
	int_nbOccur = 0;
	
	//parcours de la chaine de caractères
	for (int_i = 0; int_i <= int_length; int_i++)
	{
		//si le caractère courant correspond au caractère recherché
		//on incrémente le compteur d'occurrences
		if((str_characters.substr(int_i, 1) == var_char))
		{
			int_nbOccur = int_nbOccur + 1;
		}
	}

	return int_nbOccur;  //on retourne le nombre d'occurrences
}


//*******************************************************************************************
//  Auteur : Lagrange Virginie
//  Date maj : 14/08/01
//
//	Fonction :	IsFirstLastStringOK
//
//	Objet :		Teste la validité du premier et du dernier caractère d'une chaine
//
//	Entrées :	- str_mailCharacters : Chaine de caractères saisie.
//
//	Sortie :	si non conforme : - False
//									  - affichage d'un message d'erreur avec explications
//									  - focus sur l'élément
//					True sinon
//*******************************************************************************************

function IsFirstLastStringOK(str_mailCharacters)
{
	var str_FirstCharacter = str_mailCharacters.slice(0,1);
	var str_LastCharacter = str_mailCharacters.slice(str_mailCharacters.length - 1);
	var str_CharactMailOk = "0123456789azertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBN";
			
	//Test si les deux caractères (premier et dernier) sont des caractères autorisés
	//par rapport à la chaine de référence str_CharactMailOk.			
	if (!(IsStringOK(str_FirstCharacter, str_CharactMailOk) && IsStringOK(str_LastCharacter, str_CharactMailOk)))
	{
		return false;
	}
	return true;										
}

//*******************************************************************************************
//	Auteur :  Frédéric Mayot
// 	Date maj : 04/09/01
//	Fonction :	ContainOnlySpaces()
//
//	Objet :		Détecte si la chaîne ne contient que des espaces
//
//	Entrées :	- str_string (type string): chaine de caractères à vérifier
//
//	Sortie :	True si ne contient que des espaces sinon false
//
//*******************************************************************************************

function ContainOnlySpaces(str_string)
{
	// on récupère le nombre d'espaces dans la chaine
	var int_nbEspace = CountOccurrences(str_string,' ');

	// on calcule la longueur de la chaine
	var int_longueur = str_string.length;

	// si les deux sont identiques, c'est que l'on a que des espaces.
	if (int_nbEspace == int_longueur)
	{
		return true;
	}
	
	// sinon tout roule
	return false;
}


//*******************************************************************************************
//	Auteur : BREAU Julien
// 	Date maj : 17/08/01
//
//	Fonction :		SelectAll(obj_HTMLElement)
//
//	Objet :			Selectionne toutes les options d'un select multiple
//
//	Appliquée à :	- select multiple
//
//	Entrées :		- obj_HTMLElement (type objet) : objet HTML à vérifier
//
//	Sortie :		si non conforme : - false
//									  - affichage d'un message d'erreur (debug)
//					true sinon
//******************************************************************************************

function SelectAll(obj_HTMLElement)
{
	if(obj_HTMLElement.type == "select-multiple")
	{
		for(i = 0; i < obj_HTMLElement.length; i++)
		{
			obj_HTMLElement.options[i].selected = true;
		}
		return true;
	}
	else
	{
		alert(err_Object);
		return false;
	}
}

function UnSelectAll(obj_HTMLElement)
//*******************************************************************************************
//	Auteur : David YOU
// 	Date maj : 16/01/2002
//
//	Fonction :		UnSelectAll(obj_HTMLElement)
//
//	Objet :			Dé-séléctionne toutes les options d'un select multiple
//
//	Appliquée à :	- select multiple
//
//	Entrées :		- obj_HTMLElement (type objet) : objet HTML à vérifier
//
//	Sortie :		si non conforme : - false
//									  - affichage d'un message d'erreur (debug)
//					true sinon
//******************************************************************************************
{
	if(obj_HTMLElement.type == "select-multiple")
	{
		for(i = 0; i < obj_HTMLElement.length; i++)
		{
			obj_HTMLElement.options[i].selected = false;
		}
		return true;
	}
	else
	{
		alert(obj_HTMLElement.name + ' ' + err_Object);
		return false;
	}
}

function AddItem (obj_HTMLList, obj_HTMLListAdd, int_AddMax, arr_Options, obj_HTMLListPrecision)
//*******************************************************************************************
//  Auteur :	Laurent Rigal
//  Date maj :	15/01/02
//
//	Fonction :	AddItem
//
//	Objet :		Ajoute la sélection d'un combo obj_HTMLList
//				dans un combo obj_HTMLListAdd en tenant compte le cas échéant
//				du choix d'une option de précision dans le combo obj_HTMLListPrecision		
//
//	Entrées :	- obj_HTMLList (type objet select) : listede choix des options
//          	- obj_HTMLListAdd (type objet select) : liste des options sélectionnées
//        		- obj_HTMLListPrecision (type objet select) : liste des options de précision
//
//	Sortie :	aucune
//*******************************************************************************************
{
	var int_selindex = obj_HTMLList.selectedIndex;
	var int_NbOption = obj_HTMLListAdd.length;
	var arr_index = new Array(int_NbOption);

	// Initialisation des variables s'il existe une option sélectionnée
	// ds le combo obj_HTMLList
	// Sinon return
	if (int_selindex>=0)
	{
		var selvalue = obj_HTMLList.options[int_selindex].value;
		var seltext = obj_HTMLList.options[int_selindex].text;
	}
	else
	{
		return;
	}
	
	// Teste si le nombre maximum d'option sélectionné a été atteint
	if (int_AddMax != 0)
	if (int_NbOption>=int_AddMax)
	{
		alert(err_Limit + int_AddMax + err_Selection + err_Dot);
		obj_HTMLListAdd.focus()
		return;
	}

	// Teste si la valeur n'a pas déja été sélectionnée puis
	// Génère un tableau avec la position initiale de l'option
	var i = 0;
	while (i<int_NbOption)
	{
		var arr_value = obj_HTMLListAdd.options[i].value.split("_");
		// Si la valeur a déja été sélectionnée return
		if (arr_value[0].value == selvalue)
		{
			return;
		}
		
		// Tableau listant les positions initiales des options sélectionnées
		var j=0;
		while(j<arr_Options.length)
		{
			if (arr_Options[j] == obj_HTMLListAdd.options[i].value)
			{
				arr_index[i] = j;
				break;
			}
			j++;
		}		
		i++;
	}
	
	// Position initiale de l'élément à insérer
	i=0;
	while (i<arr_Options.length)
	{
		if (arr_Options[i] == selvalue)
		{
			break;
		}
		i++;
	}
	int_position = i;
	
	// Détermine la position ou insérer la nouvelle option
	i=0;
	while (i<arr_index.length)
	{
		if (int_position<arr_index[i])
		{
			break;
		}
		i++;
	}
	var int_insertpos = i;

	
	// Si sélection d'une option précision (combo obj_HTMLListPrecision),
	// génère la valeur et le texte pour l'option à ajouter
	if (obj_HTMLListPrecision)
	{
		if (obj_HTMLListPrecision.selectedIndex != "")
		{
			var i = 0;
			
			do
				i++;
			while (obj_HTMLListPrecision.value != obj_HTMLListPrecision.options[i].value);
			
			if (obj_HTMLListPrecision.options[i].value != "")
			{
				while(obj_option.text.length < 50)
				{
					obj_option.text += ' ';
				}			
				
				seltext += '|  ' + obj_HTMLListPrecision.options[i].text;
				selvalue += '_' + obj_HTMLListPrecision.value;
				obj_HTMLListPrecision.selectedIndex = 0;
			}
		}
		else
		{
			obj_HTMLListPrecision.focus();
			return;
		}
	}
	

	// Ajoute l'option sélectionnée au combo obj_HTMLListAdd
	if (int_NbOption==int_insertpos)
	{
		var obj_option = new Option (seltext, selvalue);
		obj_HTMLListAdd.options[int_NbOption] = obj_option;
	}
	else
	{
		var obj_option = new Option (obj_HTMLListAdd.options[int_NbOption-1].text,obj_HTMLListAdd.options[int_NbOption-1].value)
		obj_HTMLListAdd.options[int_NbOption] = obj_option;
		
		i = int_NbOption-1;
		// Décale les options pour laisser la position de sélection libre
		while (i>int_insertpos)
		{
			obj_HTMLListAdd.options[i].value = obj_HTMLListAdd.options[i-1].value;
			obj_HTMLListAdd.options[i].text = obj_HTMLListAdd.options[i-1].text;
			i--;
		}
		
		// Insère l'option sélectionnée
		obj_HTMLListAdd.options[i].value = selvalue;
		obj_HTMLListAdd.options[i].text = seltext;
		
	}
	
	// Supprime l'option du combo obj_HTMLList
	obj_HTMLList.options[int_selindex] = null;
	
	// Désactive la sélection du combo obj_HTMLList
	obj_HTMLList.selectedIndex=-1;
	obj_HTMLList.focus();
}


//*******************************************************************************************
//  Auteur : ?
//  Date maj : 14/01/02
//
//	Fonction :	AddItemNew
//
//	Objet :		Ajoute la sélection d'un combo obj_HTMLList
//				dans un combo obj_HTMLListAdd en tenant compte le cas échéant
//				du choix d'une option de précision dans le combo obj_HTMLListPrecision		
//
//	Entrées :	- obj_HTMLList (type objet select) : listede choix des options
//          	- obj_HTMLListAdd (type objet select) : liste des options sélectionnées
//        		- obj_HTMLListPrecision (type objet select) : liste des options de précision
//				- int_AddMax : nombre maximum d'option sélectionné
//				- arr_Options : ?
//	Sortie :	aucune
//*******************************************************************************************

function AddItemNew (obj_HTMLList, obj_HTMLListAdd, int_AddMax, arr_Options, obj_HTMLListPrecision)
{
	bln_changed = true;
	var int_selindex = obj_HTMLList.selectedIndex;
	var int_NbOption = obj_HTMLListAdd.length;
	var arr_index = new Array(int_NbOption);

	// Initialisation des variables s'il existe une option sélectionnée
	// ds le combo obj_HTMLList
	// Sinon return
	if (int_selindex>=0)
	{
		var selvalue = obj_HTMLList.options[int_selindex].value;
		var seltext = obj_HTMLList.options[int_selindex].text;
	}
	else
	{
		return;
	}
	
	// Teste si le nombre maximum d'option sélectionné a été atteint
	if (int_AddMax != 0)
	if (int_NbOption>=int_AddMax)
	{
		alert(int_AddMax + err_MaxSelection);
		obj_HTMLListAdd.focus()
		return;
	}

	// Teste si la valeur n'a pas déja été sélectionnée
	// Génère un tableau avec la position initiale de l'option
	var i = 0;
	while (i<int_NbOption)
	{
		var arr_value = obj_HTMLListAdd.options[i].value.split(";");
		if (arr_value[0] == selvalue)
		{
			return;
		}
		
		var j=0;
		while(j<arr_Options.length)
		{
			if (arr_Options[j] == obj_HTMLListAdd.options[i].value)
			{
				arr_index[i] = j;
				break;
			}
			j++
		}		
		i++;
	}
	
	
	// Position initiale de l'élément à insérer
	i=0;
	while (i<arr_Options.length)
	{
		if (arr_Options[i] == selvalue)
		{
			break;
		}
		i++;
	}
	int_position = i;
	
	
	// Détermine la position ou insérer la nouvelle option
	i=0;
	while (i<arr_index.length)
	{
		if (int_position<arr_index[i])
		{
			break;
		}
		i++;
	}
	var int_insertpos = i;
	
	
	// Si sélection d'une option précision (combo obj_HTMLListPrecision),
	// génère la valeur et le texte pour l'option à ajouter
	if (obj_HTMLListPrecision)
	{
		if (obj_HTMLListPrecision.selectedIndex != "")
		{
			var i = 0;
			
			do
				i++;
			while (obj_HTMLListPrecision.value != obj_HTMLListPrecision.options[i].value);
			
			if (obj_HTMLListPrecision.options[i].value != "")
			{
				while(obj_option.text.length < 50)
				{
					obj_option.text += ' ';
				}			
				
				seltext += '|  ' + obj_HTMLListPrecision.options[i].text;
				selvalue += ';' + obj_HTMLListPrecision.value;
				obj_HTMLListPrecision.selectedIndex = 0;
			}
		}
		else
		{
			obj_HTMLListPrecision.focus();
			return;
		}
	}
	

	// Ajoute l'option sélectionnée au combo obj_HTMLListAdd
	if (int_NbOption==int_insertpos)
	{
		var obj_option = new Option (seltext, selvalue);
		obj_HTMLListAdd.options[int_NbOption] = obj_option;
	}
	else
	{
		var obj_option = new Option (obj_HTMLListAdd.options[int_NbOption-1].text,obj_HTMLListAdd.options[int_NbOption-1].value)
		obj_HTMLListAdd.options[int_NbOption] = obj_option;
		
		i = int_NbOption-1;
		// Décale les options pour laisser la position de sélection libre
		while (i>int_insertpos)
		{
			obj_HTMLListAdd.options[i].value = obj_HTMLListAdd.options[i-1].value;
			obj_HTMLListAdd.options[i].text = obj_HTMLListAdd.options[i-1].text;
			i--;
		}
		
		// Insère l'option sélectionnée
		obj_HTMLListAdd.options[i].value = selvalue;
		obj_HTMLListAdd.options[i].text = seltext;
		
	}
	
	// Supprime l'option du combo obj_HTMLList
	obj_HTMLList.options[int_selindex] = null;
	
	// Désactive la sélection du combo obj_HTMLList
	obj_HTMLList.selectedIndex=-1;
	obj_HTMLList.focus();
}


//*******************************************************************************************
//  Auteur :	Laurent Rigal
//  Date maj :	05/09/01
//
//	Fonction :	RemoveItem
//
//	Objet :		Supprime les options sélectionées d'un objet select		
//
//	Entrées :	- obj_HTMLList (type objet select) : listede choix des options
//
//	Sortie :	aucune
//*******************************************************************************************

function RemoveItem (obj_HTMLList)
{
	if (obj_HTMLList.selectedIndex != -1)
	{
		// Suppression de toutes les options sélectionnées du combo obj_HTMLList
		var i = 0;
		do
		{
			if (obj_HTMLList.options[i].selected)
			{
				obj_HTMLList.options[i]=null;
				if (i != 0)
					i--; 
			}
			else
			{
				i++;
			} 
		}
		while (i < obj_HTMLList.length);
		obj_HTMLList.selectedIndex++;
		obj_HTMLList.focus();
	}
	else
	{
		return;
	}
}


//*******************************************************************************************
//  Auteur :	Laurent Rigal
//  Date maj :	05/09/01
//
//	Fonction :	MoveItem
//
//	Objet :		Déplace une option dans un objet select vers le haut ou le bas suivant str_direction		
//
//	Entrées :	- obj_HTMLList (type objet select) : listede choix des options
//			    - str_direction (type string) : direction dans laquelle déplacer l'option
//
//	Sortie :	aucune
//*******************************************************************************************

function MoveItem(obj_HTMLList, str_direction)
{
	var int_nboption = obj_HTMLList.length;
	var int_selindex = obj_HTMLList.selectedIndex;
	
	//initialistation des variables
	var bln_up = (str_direction == "up");


	// si aucune option sélectionnée
	// ou premier élément à déplacer vers le haut
	// ou dernier élément à déplacer vers le bas
	if (int_selindex == -1 || ((int_selindex == 0) && (bln_up)) || ((int_selindex == int_nboption-1) && (!bln_up)))
	{
		return;
	}
	
	// Si plusieurs options sélectionnées, return
	var int_nbsel = 0;
	var i=0;
	do
	{
		if (obj_HTMLList.options[i].selected)
		{
			int_nbsel++;
		}
		i++;
	}
	while ((i<obj_HTMLList.length) && (int_nbsel <= 1))
	
	if (int_nbsel > 1)
	{
		obj_HTMLList.selectedIndex = -1;
		return;
	}

	var str_value = obj_HTMLList.options[int_selindex].value;
	var str_text = obj_HTMLList.options[int_selindex].text;
	
	if (bln_up) // Déplace l'option vers le haut de la liste
	{
		obj_HTMLList.options[int_selindex].value = obj_HTMLList.options[int_selindex-1].value;
		obj_HTMLList.options[int_selindex].text = obj_HTMLList.options[int_selindex-1].text;
		
		obj_HTMLList.options[int_selindex-1].value = str_value;
		obj_HTMLList.options[int_selindex-1].text = str_text;

		obj_HTMLList.selectedIndex = int_selindex - 1;
	}
	else // Déplace l'option vers le bas de la liste
	{


		obj_HTMLList.options[int_selindex].value = obj_HTMLList.options[int_selindex+1].value;
		obj_HTMLList.options[int_selindex].text = obj_HTMLList.options[int_selindex+1].text;
		
		obj_HTMLList.options[int_selindex+1].value = str_value;
		obj_HTMLList.options[int_selindex+1].text = str_text;

		obj_HTMLList.selectedIndex = int_selindex + 1;
	}
		
	
}

//****************************************************************************************************
//  Auteur :   David YOU
//  Date maj : 21/01/2002
//
//	Fonction : PutItem
//
//	Objet :	   Met à jour les options d'un objet select multiple
//             en fonction des options sélectionnées dans une autre select multiple
//
//	Entrées :  - obj_HTMLList (type objet select)    : Sélection 1er niveau
//			   - obj_HTMLListAdd (type objet select) : Liste 2è niveau
//			   - obj_HTMLAdd (type objet select)     : Sélection 2è niveau
//			   - arr_Puts (type tableau)             : tableau Javascript contenant les valeurs à
//                                                     utiliser par les combos
//			   - bln_displayAll (type booléen)       : affichage (oui/non) en cas de sélection
//                                                     nulle au 1er niveau
//			   - str_requestValues (type string)     : valeur postées (ou issues de la BDD pour modif)
//
//	Sortie :   aucune
//****************************************************************************************************
function PutItem(obj_HTMLList, obj_HTMLListAdd, obj_HTMLAdd, arr_Puts, bln_displayAll, str_requestValues)
{
	// Supprime les options dans obj_HTMLListAdd
	for (var j = obj_HTMLListAdd.length - 1 ; j >= 0 ; j--)
	{
		obj_HTMLListAdd.options[j] = null;
	}

	// Supprime les options dans obj_HTMLAdd
	// En attendant de trouver mieux : càd garder les valeurs préalablement séléctionnées
	// et ne suprrimer que ce qui doit l'être... à suivre.
	for (j = obj_HTMLAdd.length - 1 ; j >= 0 ; j--)
	{
		obj_HTMLAdd.options[j] = null;
	}

	// Sélectionne toutes les options de la combo obj_HTMLList
	SelectAll(obj_HTMLList);

	var str_listValues;
	var int_optionListAdd = 0;
	var arr_ListAdd;
	var str_TextListAdd;
	var str_ValueListAdd;

	// Cas obj_HTMLList vide
	if (obj_HTMLList.length == 0)
	{
		if (bln_displayAll)
		{
			// str_TextListAdd contient toutes les valeurs possibles
			for (var i = 0 ; i < eval(arr_Puts + 'All.length') ; i++)
			{
				arr_ListAdd = eval(arr_Puts + 'All[' + i + '].split(",,")')
				str_ValueListAdd = arr_ListAdd[0];
				str_TextListAdd = arr_ListAdd[1];
				var obj_option = new Option(str_TextListAdd, str_ValueListAdd);
				obj_HTMLListAdd.options[int_optionListAdd] = obj_option;
				int_optionListAdd++;
			}
		}
	}
	// Cas obj_HTMLList non vide
	else
	{
		// Parcours des options de obj_HTMLList
		for (i = 0 ; i < obj_HTMLList.length ; i++)
		{
			// Ajoute les nouvelles options dans obj_HTMLListAdd
			str_listValues = obj_HTMLList.options[i].value;
			for (var k = 0 ; k < eval(arr_Puts + obj_HTMLList.options[i].value + '.length') ; k++)
			{
				arr_ListAdd = eval(arr_Puts + obj_HTMLList.options[i].value + '[' + k + '].split(",,")')
				str_ValueListAdd = arr_ListAdd[0];
				str_TextListAdd = arr_ListAdd[1];
				var obj_option = new Option(str_TextListAdd, str_ValueListAdd);
				obj_HTMLListAdd.options[int_optionListAdd] = obj_option;
				int_optionListAdd++;
			}
		}
	}
	
	// Renvoi des données postées (récupérées) dans l'objet obj_HTMLAdd
	if (str_requestValues != '')
	{
		var arr_Tab = str_requestValues.split(', ');
		var int_indexToAdd = 0;
				
		SelectAll(obj_HTMLAdd);
		
		// Parcours de obj_HTMLListAdd
		for (var int_HTMLAddIndex = 0 ; int_HTMLAddIndex < obj_HTMLListAdd.length ; int_HTMLAddIndex++)
		{
			// Parcours de arr_Tab (données postées)
			for (var int_requestValueIndex = 0 ; int_requestValueIndex < arr_Tab.length ; int_requestValueIndex++)
			{
				// Comparaison : données postées / Combo obj_HTMLListAdd
				// ------------- ==> détermine indice de obj_HTMLListAdd concerné : int_HTMLAddIndex
				if (arr_Tab[int_requestValueIndex] == obj_HTMLListAdd[int_HTMLAddIndex].value)
				{
					// recherche des libellés
					for (var int_optionLib = 0 ; int_optionLib < eval(arr_Puts + 'All.length') ; int_optionLib++)
					{
						var arr_recup = eval(arr_Puts + 'All[int_optionLib]').split(",,");
						if (arr_Tab[int_requestValueIndex] == arr_recup[0])
						{
							// indice concerné
							var obj_option = new Option (arr_recup[1], arr_recup[0]);
							obj_HTMLAdd.options[int_indexToAdd] = obj_option;
							obj_HTMLListAdd[int_HTMLAddIndex] = null;
							int_indexToAdd++;
						}
					}
				}
			}
		}
		
		UnSelectAll(obj_HTMLAdd);
	}

	// Dé-sélectionne toutes les options de la combo obj_HTMLList
	UnSelectAll(obj_HTMLList);
}
