function ToutCocher(field) {	for (i = 0; i < field.length; i++) {		field[i].checked = true;	}}function implode(tableau) {  var txt='';  for(var i=0;i<tableau.length;i++) {		if(i==0) txt=tableau[i]		else txt=txt+','+tableau[i]  }  return txt}//Fonction d'affichage d'une PopUp//exemple : fille=Popup('WEBCHXGAB?OpenForm','CHXGAB','500','200',0);function Popup(url,nomPopup,largeur,hauteur, ascenceur){	var win = null;  	settings = 'dependent=yes,toolbar=0,location=0,directories=0,status=1,scrollbars='+ascenceur+',resizable=1,menuBar=0,height='+hauteur+',width='+largeur+',top=10,left=10'; 	win = window.open(url,nomPopup,settings);  	if(win.window.focus){  		win.window.focus();	}}function Imprimer(){	win = window.open(window.location+'&PRINT=1','Imprimer','dependent=yes,toolbar=1,location=0,directories=0,status=0,scrollbars=1,resizable=yes,menuBar=1,height=500,width=600,top=10,left=10');  	if(win.window.focus){  		//if (win.getObject('TABLEBOUTTON')) alert(true)		win.window.print();	}}function getSelectedCheckbox(buttonGroup) {   // Go through all the check boxes. return an array of all the ones   // that are selected (their position numbers). if no boxes were checked,   // returned array will be empty (length will be zero)   var retArr = new Array();   var lastElement = 0;   if (buttonGroup[0]) { // if the button group is an array (one check box is not an array)      for (var i=0; i<buttonGroup.length; i++) {         if (buttonGroup[i].checked) {            retArr.length = lastElement;            retArr[lastElement] = i;            lastElement++;         }      }   } else { // There is only one check box (it's not an array)      if (buttonGroup.checked) { // if the one check box is checked         retArr.length = lastElement;         retArr[lastElement] = 0; // return zero as the only array value      }   }   return retArr;} // Ends the "getSelectedCheckbox" functionfunction getSelectedCheckboxValue(buttonGroup) {   // return an array of values selected in the check box group. if no boxes   // were checked, returned array will be empty (length will be zero)   var retArr = new Array(); // set up empty array for the return values   var selectedItems = getSelectedCheckbox(buttonGroup);   if (selectedItems.length != 0) { // if there was something selected      retArr.length = selectedItems.length;      for (var i=0; i<selectedItems.length; i++) {         if (buttonGroup[selectedItems[i]]) { // Make sure it's an array            retArr[i] = buttonGroup[selectedItems[i]].value;         } else { // It's not an array (there's just one check box and it's selected)            retArr[i] = buttonGroup.value;// return that value         }      }   }   return retArr;}// efface dans la cha\u00EEne analys\u00E9e mainStr la portion qui pr\u00E9c\u00E8de la cha\u00EEne recherch\u00E9e searchStrfunction getFront(mainStr,searchStr){	foundOffset = mainStr.indexOf(searchStr)	if (foundOffset == -1) {		return null	}	return mainStr.substring(0,foundOffset)}// extrait de la cha\u00EEne analys\u00E9e mainStr la portion qui suit la cha\u00EEne recherch\u00E9e searchStrfunction getEnd(mainStr,searchStr) {	foundOffset = mainStr.indexOf(searchStr)	if (foundOffset == -1) {		return null	}	return mainStr.substring(foundOffset+searchStr.length,mainStr.length)}// ins\u00E8re la cha\u00EEne insertStr juste avant la cha\u00EEne recherch\u00E9e searchStrfunction insertString(mainStr,searchStr,insertStr) {	var front = getFront(mainStr,searchStr)	var end = getEnd(mainStr,searchStr)	if (front != null && end != null) {		return front + insertStr + searchStr + end	}	return null}// remplace la cha\u00EEne recherch\u00E9e searchStr par la cha\u00EEne de remplacement replaceStrfunction replaceString(mainStr,searchStr,replaceStr) {	var front = getFront(mainStr,searchStr)	var end = getEnd(mainStr,searchStr)	if (front != null && end != null) {		return front + replaceStr + end	}	return null}// efface dans mainStr la cha\u00EEne deleteStrfunction deleteString(mainStr,deleteStr) {	return replaceString(mainStr,deleteStr,"")}function getObject(objName) {		if (document.getElementById)		{ return document.getElementById(objName); }		//W3C;	else if (document.all)		{ return document.all[objName]; }			// IE;	else if (document.layers) 		{ return document.layers[objName]; }			// NS4;}function ValueMC (NomChamp){   for ( i = 0 ; i < document.forms[0].length ; i ++ )   {      if (document.forms[0].elements[i].name == NomChamp)      {          if (document.forms[0].elements[i].selectedIndex >= 0)         {             value = document.forms[0].elements[i].options[document.forms[0].elements[i].selectedIndex].value;             break;         }         else         {             value = "";             break;          }     }   }   return value;}function ValueMCT (NomChamp){   for ( i = 0 ; i < document.forms[0].length ; i ++ )   {      if (document.forms[0].elements[i].name == NomChamp)      {          if (document.forms[0].elements[i].selectedIndex >= 0)         {             value = document.forms[0].elements[i].options[document.forms[0].elements[i].selectedIndex].text;             break;         }         else         {             value = "";             break;          }     }   }   return value;}
