
	function doSubmit (toDo, toDoObj)	{
//alert ("doSubmit; toDo: " + toDo);
		toDoObj.value = toDo;

//alert ("valeur du champ: " + document.myForm.toDo.value + ";");
		document.myForm.submit ();
	}

//---------------------------------------------

	function doSort (toDo, toDoObj, sortBy, sortByObj) {
//alert (toDo + ";" + tableName + ";" + recId);
		sortByObj.value = sortBy;
		doSubmit (toDo, toDoObj);
	}

//---------------------------------------------

	function doRecordOperation (toDo, toDoObj, recId, recIdObj) {
//alert (toDo + ";" + recId);
		if (recId != "") {
  		recIdObj.value = recId;
  	}
		doSubmit (toDo, toDoObj);
	}
	
//---------------------------------------------

	function doExpandText (toDo, toDoObj, recId, recIdList) {
//alert (toDo + ";" + recId);
		theList = recIdList.value;
    
    if (toDo == "show") {
      // ajouter ŕ la liste
  		if (theList == "") {
  		  theList = "" + recId;
  		}
  		else {
  		  theList += "," + recId;
  		}
    }
    else {
//alert ("recId: " + recId + "; theList: " + theList);
      // retirer de la liste. Il doit y exister, sinon erreur
  		theListArr = theList.split (",");
  		found = false;
  		for (i=0; found == false && i<theListArr.length; i++) {
//alert ("i: " + i + "; theListArr[i]: " + theListArr[i] + "; recId: " + recId);
  		  if (theListArr[i] == String (recId)) {
  		    found = true;
  		    index = i;
  		  }
  		  else {
//  		    theListArr = theListArr.splice (index, 1);
//  		    theList = theListArr.toString ();
  		  }
  		}
 		  if (found == false) {
 		    alert ("erreur, id pas trouvé dans la liste !!"); 
		  }
		  else {
  	    theListArr.splice (index, 1);
  	    theList = theListArr.toString ();
		  }
//alert (theList);
    }
		recIdList.value = theList;
		doSubmit (toDo, toDoObj);
	}

//-------------------------------------------------------

	function updateList (toDo, toDoObj, selDirObj, selectedDirObj, submitObj, extensionList) {
		var index = selDirObj.selectedIndex;
//alert ("-->" + index);
		var dirChoice = selDirObj.options[index].value;

//alert ("|" + dirChoice + "|");

		selectedDirObj.value = dirChoice;
		doSubmit (toDo, '');
	}

//-------------------------------------------------------

	function selectKw (selObj, textObj) {
		var index = selObj.selectedIndex;
//alert ("-->" + index);
		var text = selObj.options[index].text;
		var currentText = textObj.value;

    if (currentText.search (text) == -1) {
      // pas trouvé, ajouter dans la liste
      if (currentText != "") {
        currentText += ", " + text;
      }
      else {
        currentText = text;
      }
      textObj.value = currentText;
    }
	}
