<!--
function raz_zone(zone)
{
	if (typeof zone == 'string')
	{
		zone = document.getElementById(zone);
	}
	if (zone && zone.value)
	{
		zone.value = '';
	}
	return;
}

function setCrs(appelant, st_crs)
{
	if (appelant)
	{
		appelant.style.cursor = st_crs;
	}
	return;
}

function copie_obj(mon_obj)
{
	var clef;
	var obj_copie = new Object();
	for (clef in mon_obj)
	{
		obj_copie[clef] = mon_obj[clef];
	}
	return obj_copie;
}

function copie_obj_2(mon_obj_orig, mon_obj_desti)
{
	var clef;
	for (clef in mon_obj_orig)
	{
		if (!mon_obj_desti.hasOwnProperty(clef))
		{
			mon_obj_desti[clef] = mon_obj_orig[clef];
		}
	}
	return;
}

function noaccent(chaine)
{
	var temp = chaine.replace(/[àâä]/gi, "a")
	temp = temp.replace(/[éèêë]/gi, "e")
	temp = temp.replace(/[îï]/gi, "i")
	temp = temp.replace(/[ôö]/gi, "o")
	temp = temp.replace(/[ùûü]/gi, "u")
	temp = temp.replace(/[ÈÉÊË]/, "E");
	temp = temp.replace(/[ÛÙ]/, "U");
	temp = temp.replace(/[ÏÎ]/, "I");
	temp = temp.replace(/[ÀÂ]/, "A");
	temp = temp.replace(/Ô/, "O");

	return temp;
}

function log10(x)
{
	return Math.LOG10E * Math.log(x);
}

 function StringBuffer() { 
   this.buffer = []; 
 } 

 StringBuffer.prototype.append = function append(string) { 
   this.buffer.push(string); 
   return this; 
 }; 

 StringBuffer.prototype.toString = function toString() { 
   return this.buffer.join(""); 
 }; 

var PLAIN_ASCII =
      "AaEeIiOoUu"    // grave
    + "AaEeIiOoUuYy"  // acute
    + "AaEeIiOoUuYy"  // circumflex
    + "AaEeIiOoUuYy"  // tilde
    + "AaEeIiOoUuYy"  // umlaut
    + "Aa"            // ring
    + "Cc"            // cedilla
    ;

var UNICODE =
      "\u00C0\u00E0\u00C8\u00E8\u00CC\u00EC\u00D2\u00F2\u00D9\u00F9"             // grave
    + "\u00C1\u00E1\u00C9\u00E9\u00CD\u00ED\u00D3\u00F3\u00DA\u00FA\u00DD\u00FD" // acute
    + "\u00C2\u00E2\u00CA\u00EA\u00CE\u00EE\u00D4\u00F4\u00DB\u00FB\u0176\u0177" // circumflex
    + "\u00C2\u00E2\u00CA\u00EA\u00CE\u00EE\u00D4\u00F4\u00DB\u00FB\u0176\u0177" // tilde
    + "\u00C4\u00E4\u00CB\u00EB\u00CF\u00EF\u00D6\u00F6\u00DC\u00FC\u0178\u00FF" // umlaut
    + "\u00C5\u00E5"                                                             // ring
    + "\u00C7\u00E7"                                                             // cedilla
    ;

function convertNonAscii(s)
{
	var sb = new StringBuffer();
	var n = s.length;
	for (var i = 0; i < n; i++)
	{
		var c = s.charAt(i);
		var pos = UNICODE.indexOf(c);
		if (pos > -1)
		{
			sb.append(PLAIN_ASCII.charAt(pos));
		}
		else
		{
			sb.append(c);
		}
	}
	return sb.toString();
}

function isAlien(a) {
   return isObject(a) && typeof a.constructor != 'function';
}
function isArray(a) {
    return isObject(a) && a.constructor == Array;
}
function isBoolean(a) {
    return typeof a == 'boolean';
}
function isEmpty(o) {
    var i, v;
    if (isObject(o)) {
        for (i in o) {
            v = o[i];
            if (isUndefined(v) && isFunction(v)) {
                return false;
            }
        }
    }
    return true;
}
function isFunction(a) {
    return typeof a == 'function';
}
function isNull(a) {
    return typeof a == 'object' && !a;
}
function isNumber(a) {
    return typeof a == 'number' && isFinite(a);
}
function isObject(a) {
    return (a && typeof a == 'object') || isFunction(a);
}
function isString(a) {
    return typeof a == 'string';
}
function isUndefined(a) {
    return typeof a == 'undefined';
} 

function setAttr(champ, attr, val, fct)
{
	var val_attr, str = '';
	if (champ)
	{
		try
		{
			str = 'champ.getAttribute(\'' + attr + '\')';
			val_attr = eval(str);
			if (val == 'opp')
			{
				str = 'champ.setAttribute(\'' + attr + '\', ' + !val_attr + ')';
			}
			else
				str = 'champ.setAttribute(\'' + attr + '\', \'' + val_attr + '\')';
			eval(str);
			if (fct)
			{
				eval(fct);
			}
		}
		catch(e)
		{
			alert('Erreur !');
		}

	}
	return;
}

function lien_over(mode_navi, noeud, texte, params)
{
	var fct_onmouse, fct_offmouse, fct_event; 
	if (texte && noeud && typeof overlib == 'function')
	{
		fct_onmouse = 'overlib(\'' + texte.replace(/\'/g, String.fromCharCode(180)) + '\', ' + params + ');';
		fct_offmouse = 'return nd();';
		if(mode_navi == 'ie6_pc' || mode_navi == 'ie7_pc')
		{
			fct_event = new Function(fct_onmouse);
			noeud.setAttribute('onmouseover', fct_event);
			fct_event = new Function(fct_offmouse);
			noeud.setAttribute('onmouseout', fct_event);
		}
		else
		{
			noeud.setAttribute('onmouseover', fct_onmouse);
			noeud.setAttribute('onmouseout', fct_offmouse);
		}
	}
	return;
}

function eve_noeud(mode_navi, noeud, evenement, texte_action)
{
	var fct_event; 
	if (texte_action && noeud)
	{
		if(mode_navi == 'ie6_pc' || mode_navi == 'ie7_pc')
		{
			fct_event = new Function(texte_action);
			noeud.setAttribute(evenement, fct_event);
		}
		else
		{
			noeud.setAttribute(evenement, texte_action);
		}
	}
	return;
}

function supprAttr(noeud, attr)
{
	if (typeof noeud == 'string')
	{
		noeud = document.getElementById(noeud);
	}
	if (noeud)
	{
		noeud.removeAttribute(attr);
	}
	return;
}

function setClasse(noeud, classe)
{
	if (typeof noeud == 'string')
	{
		noeud = document.getElementById(noeud);
	}
	if (noeud)
	{
		noeud.setAttribute('class', classe);
		noeud.setAttribute('className', classe);
	}
	return;
}

function setBGCoul(noeud, couleur)
{
	if (typeof noeud == 'string')
	{
		noeud = document.getElementById(noeud);
	}
	if (noeud)
	{
		noeud.style.backgroundColor = couleur;
	}
	return;
}

function replaceSubstring(inputString, fromString, toString)
{
   // Goes through the inputString and replaces every occurrence of fromString with toString
	if(inputString && fromString)
	{
		var temp = inputString;
		if (fromString == "")
		{
			return inputString;
		}

		try
		{
			if (toString.indexOf(fromString) == -1)
			{ // If the string being replaced is not a part of the replacement string (normal situation)
				try
				{
					while (temp.indexOf(fromString) != -1)
					{
						var toTheLeft = temp.substring(0, temp.indexOf(fromString));
						var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length);
						temp = toTheLeft + toString + toTheRight;
					}
				}
				catch(e)
				{
					return inputString;
				}
			}
			else
			{ // String being replaced is part of replacement string (like "+" being replaced with "++") - prevent an infinite loop
				var midStrings = new Array("~", "`", "_", "^", "#");
				var midStringLen = 1;
				var midString = "";
				// Find a string that doesn't exist in the inputString to be used
				// as an "inbetween" string
				while (midString == "")
				{
					for (var i=0; i < midStrings.length; i++)
					{
						var tempMidString = "";
						for (var j=0; j < midStringLen; j++) { tempMidString += midStrings[i]; }
						if (fromString.indexOf(tempMidString) == -1)
						{
							midString = tempMidString;
							i = midStrings.length + 1;
						}
					}
				}
				// Keep on going until we build an "inbetween" string that doesn't exist
				// Now go through and do two replaces - first, replace the "fromString" with the "inbetween" string
				while (temp.indexOf(fromString) != -1)
				{
					var toTheLeft = temp.substring(0, temp.indexOf(fromString));
					var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length);
					temp = toTheLeft + midString + toTheRight;
				}
				// Next, replace the "inbetween" string with the "toString"
				while (temp.indexOf(midString) != -1)
				{
					var toTheLeft = temp.substring(0, temp.indexOf(midString));
					var toTheRight = temp.substring(temp.indexOf(midString)+midString.length, temp.length);
					temp = toTheLeft + toString + toTheRight;
				}
			} // Ends the check to see if the string being replaced is part of the replacement string or not
		}
		catch(e)
		{
			return inputString;
		}
	}
	else
		temp = inputString;
	return temp; // Send the updated string back to the user
} // Ends the "replaceSubstring" function


function ajElemOptionListe(obj_liste, obj_option)
{
	if(obj_liste && obj_option)
	{
		try{
			obj_liste.add(obj_option, obj_liste.length);
		}catch(e){
			obj_liste.add(obj_option, null);
		}
	}
	return;
}

function modifOptionListe(id_liste, valeur, texte, selection, fenetre)
{
	var i=0;
	if(!fenetre)
		fenetre = window.self;
	var liste = fenetre.document.getElementById(id_liste);
	for(i=0;i<liste.length;i++)
	{
		if(liste[i].value == valeur)
		{
			liste[i].text = texte;
			if(selection)
				liste[i].selected=true;
			break;
		}
	}
	return;
}

function SuppressionOptionsListe(liste,val_option,type_id_ou_texte,mode)
{
	var i=0;
	var val_ref;
	var test = false;
	for(i=liste.length-1;i>=0;i--)
	{
		if(type_id_ou_texte == 'id')
			val_ref = liste[i].value;
		else if(type_id_ou_texte == 'texte')
			val_ref = liste[i].text;
		if(mode == 'different')
			test = (val_ref != val_option)
		else if(mode == 'egal' || mode == '')
			test = (val_ref == val_option)
		if(test)
		{
			liste[i].selected=false;
			liste[i]=null;
		}
	}
	return;
}

function Suppression(liste,raz)
{
	var i=0;
	var arret;
	if(!raz) arret = 1;
	else arret = 0;
	for(i=liste.length-1;i>=arret;i--)
	{
		liste[i].selected=false;
		liste[i]=null;
	}
//	liste[0].selected=true;
}

function charge_ChoixListe(num_form, nom_champ_liste, valeur, type_valeur, champ_appelant, id_champ_appelant)
{
	var i=0;
	var compa_valeur;
	if(!champ_appelant && !id_champ_appelant && num_form)
	{
		var nb_elem = window.document.forms[num_form].elements.length;
		for(i=0; i< nb_elem;i++)
		{
			ch = window.document.forms[num_form].elements[i];
			if(ch.name == nom_champ_liste)
				break;
		}
		liste = ch.options;
	}
	else if(id_champ_appelant)
		liste = document.getElementById(id_champ_appelant);
	else
		liste = champ_appelant;
	if(typeof liste != 'undefined' && liste)
	{
		for(i=0;i<liste.length;i++)
		{
			if(type_valeur == 'text')
				compa_valeur = liste[i].text;
			else
				compa_valeur = liste[i].value;
			if(valeur == compa_valeur)
			{
				liste[i].selected=true;
				break;
			}
			else
				liste[i].selected=false;
		}
	}
}

function recup_chx_select(chaine_champ, champ_select, type_ret, pos, fenetre, num_form)
{
	if(!num_form)
	{
		num_form = 1;
	}
	// l'énumération commence à zéro
	// donc la première lettre => charAt(0)
	var i=0, champ, nb_elem, elem, ret;
	if(champ_select)
		champ = champ_select;
	else
		champ = getChampByName2(1, chaine_champ, 'like', fenetre);
	if(champ.type.indexOf('select') != -1)
	{
		var idx = champ.selectedIndex;
		if(idx != -1)
		{
			var val_choix = champ[idx].value;
			var choix = champ[idx].text;
			if(choix != '>')
			{
				if(type_ret == 'prem_lettre')
					ret = choix.charAt(pos-1);
				else if(type_ret == 'val_chx')
					ret = val_choix;
				else if(type_ret == 'txt_chx')
					ret = choix;
			}
		}
	}
	else if(champ.type == 'text' || champ.type == 'textarea')
		ret = champ.value;
	else if(champ.type == 'radio' || champ.type == 'checkbox')
	{
		if(fenetre.document.forms[num_form].elements[champ.name])
		{
			nb_elem = fenetre.document.forms[num_form].elements[champ.name].length;
			if(typeof nb_elem != 'undefined')
			{
				ret = '';
				for(i=0;i<nb_elem;i++)
				{
					elem = fenetre.document.forms[num_form].elements[champ.name][i];
					if(elem.checked)
					{
						ret += elem.value;
						if(i < nb_elem)
							ret += '\n';
					}	
				}
			}
			else
			{
				elem = fenetre.document.forms[num_form].elements[champ.name];
				if(elem.checked)
					ret = elem.value;
			}
		}
		else
		{
			ret = '';
		}
	}
	return ret;
}



 /*
    * This function will not return until (at least)
    * the specified number of milliseconds have passed.
    * It does a busy-wait loop.
    */
    function pause(numberMillis) {
        var now = new Date();
        var exitTime = now.getTime() + numberMillis;
        while (true) {
            now = new Date();
            if (now.getTime() > exitTime)
                return;
        }
    }

    /*
    * This function will not return until (at least)
    * the specified number of milliseconds have passed.
    * It uses a modal dialog.
    */
     function pause2(numberMillis) {
        var dialogScript = 
           'window.setTimeout(' +
           ' function () { window.close(); }, ' + numberMillis + ');';
        var result = 
// For IE5.
         window.showModalDialog(
           'javascript:document.writeln(' +
            '"<script>' + dialogScript + '<' + '/script>")');

/* For NN6, but it requires a trusted script.
         openDialog(
           'javascript:document.writeln(' +
            '"<script>' + dialogScript + '<' + '/script>"',
           'pauseDialog', 'modal=1,width=10,height=10');
 */
     }


function roundFloat(fltValue, intDecimal)
{
	var ret;
	if (isNaN(fltValue))
	{
		ret = 0;
	}
	else
	{
		fltValue = parseFloat(fltValue);
		ret = Math.round(fltValue * Math.pow(10, intDecimal)) / Math.pow(10, intDecimal);
	}
	return ret;
}


function replaceCharacters(chaine, mode)
{
	var indice1=0;
	var indice2=1;
	var ret;

	// Special characters and their HTML equivalent
	var set = [["€","‘","’","’","“","”","–","—","¡","¢","£","£","¤","¥","¦","§","¨","©","ª","«","¬","­","®","¯","°","±","²","³","´","µ","¶","·","¸","¹","º","»","¼","½","¾","¿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ü","ý","þ","ÿ"],
		["&euro;","&lsquo;","&rsquo;","&rsquo;","&ldquo;","&rdquo;","&ndash;","&mdash;","&iexcl;","&cent;","&pound;","&pound;","&curren;","&yen;","&brvbar;","&sect;","&uml;","&copy;","&ordf;","&laquo;","&not;","­","&reg;","&macr;","&deg;","&plusmn;","&sup2;","&sup3;","&acute;","&micro;","&para;","&middot;","&cedil;","&sup1;","&ordm;","&raquo;","&frac14;","&frac12;","&frac34;","&iquest;","&Agrave;","&Aacute;","&Acirc;","&Atilde;","&Auml;","&Aring;","&AElig;","&Ccedil;","&Egrave;","&Eacute;","&Ecirc;","&Euml;","&Igrave;","&Iacute;","&Icirc;","&Iuml;","&ETH;","&Ntilde;","&Ograve;","&Oacute;","&Ocirc;","&Otilde;","&Ouml;","&times;","&Oslash;","&Ugrave;","&Uacute;","&Ucirc;","&Uuml;","&Yacute;","&THORN;","&szlig;","&agrave;","&aacute;","&acirc;","&atilde;","&auml;","&aring;","&aelig;","&ccedil;","&egrave;","&eacute;","&ecirc;","&euml;","&igrave;","&iacute;","&icirc;","&iuml;","&eth;","&ntilde;","&ograve;","&oacute;","&ocirc;","&otilde;","&ouml;","&divide;","&oslash;","&ugrave;","&uacute;","&ucirc;","&uuml;","&uuml;","&yacute;","&thorn;","&yuml;"]];

	// Replace each instance of one of the above special characters with it's HTML or non HTML equivalent
	if (chaine)
	{
		if(mode == 'text2html')
		{
			indice1=0;
			indice2=1;
		}
		else if(mode == 'html2text')
		{
			indice1=1;
			indice2=0;
		}

		for(var j=0; j<set[indice1].length; j++){
			ret = chaine.replace(eval("/"+set[indice1][j]+"/g"),set[indice2][j]);
		}
	}

	// Return the new formated string or an empty string if no entry string was supplied
	return ret || '';
}


function stopTimer(TimerId)
{
   TimerSet=false; 
   clearTimeout (TimerId);
}

function afficher_status(msg)
{
	if(!msg)
		msg = '';
	window.status = msg;
}


function LZ(x)
{
	x = parseInt(x, 10);
	return(x<0||x>9?"":"0")+x
}

function siNull(ch)
{
	if(!ch)
		ch = '';
	return ch;
}

function focus_auto()
{
	window.onblur = function()
	{
		window.focus();
	}
}

function fermeture_auto()
{
	window.onblur = function()
	{
		window.close();
	}
}

function readTableData(tbl)
{
	tbl.tabledata = new Array(); // initialize array 
	bodyrows = tbl.getElementsByTagName('tbody')[0].getElementsByTagName('tr'); // get collection of table body rows.
	for(var i=0; i<bodyrows.length; i++) // iterate through table rows
	{
		tbl.tabledata.push(new Array()); //create new array for row elements and push it in tabledata array
		for(var j=0; j<bodyrows[i].childNodes.length; j++) // iterate through table row child nodes
		{
			var childNode = bodyrows[i].childNodes[j]; // child node to a local variable
			if(/th/i.test(childNode.nodeName) || /td/i.test(childNode.nodeName)) // if the child node is "th" or "td" (gecko throws empty text nodes in)
			{
				if(childNode.firstChild) // make sure it is not an empty node
					tbl.tabledata[i].push(childNode.firstChild.nodeValue) // assume that <td> or <th> element has no other children but the text node containing the data
			}
		}
	}
	return tbl.tabledata;
}

function writeFormat(num, dp, sepString, mode, forcer)
{
	if(!forcer)
		forcer = '';
	if (!dp) dp = 2;
	if (!sepString) sepString = " .";
	if(!mode || mode == 'html')
		str = '&nbsp;';
	else
		str = ' ';
	if(num)
	{
		if(isNaN(num))
			num = num.replace(/,/g, '.');
		if(isNaN(num))
			num = num.replace(/./g, ',');
		num = Math.round(num*Math.pow(10, dp));
		num = num.toString();
		str = sepString.charAt(1)+num.substr(num.length - dp);
		num = num.substr(0,num.length - dp);
		while (num.length > 3)
		{
			str = sepString.charAt(0)+num.substr(num.length-3)+str;
			num = num.substr(0,num.length-3);
		}
		str = num + str;
		if(!forcer)
			str = str.replace(/\.00/,'');
		if(!mode || mode == 'html')
			str = str.replace(/ /,'&nbsp;');
	}
	return str;
}


function fmtMoney(n, c, d, t)
{
	// http://www.bigbold.com/snippets/tag/format
	// pw 2006-06-21 : ajout du signe
	// pw 2006-06-22 : 
	//	-> si 0 renvoyer 0 sans formatage
	//	-> parseFloat de l'expression
	var ret;
	var signe = '';
	if (isNaN(n))
	{
		ret = 0;
	}
	else if (n == 0)
	{
		ret = 0;
	}
	else
	{
		n = parseFloat(n);
		if (n < 0)
		{
			signe = '- ';
		}
		var m = ( c = Math.abs( c ) + 1 ? c : 2, d = d || ",", t = t || ".", /(\d+)(?:(\.\d+)|)/.exec( n + "" ) ), x = m[1].length % 3;
		ret = (x ? m[1].substr( 0, x ) + t : "" ) + m[1].substr( x ).replace( /(\d{3})(?=\d)/g, "$1" + t ) + ( c ? d + ( +m[2] ).toFixed( c ).substr( 2 ) : "");
		ret = signe + ret;
	}
	return (ret);
}

function show(element)
{
	document.getElementById(element).style.visibility = 'visible';
}

function hide(element)
{
	document.getElementById(element).style.visibility = 'hidden';
}

function hideElement(elmID)
{
	for (i = 0; i < document.all.tags(elmID).length; i++)
	{	
		obj = document.all.tags(elmID)[i];
		obj.style.visibility = "hidden";
	}
}

function showElement(elmID)
{
	for (i = 0; i < document.all.tags(elmID).length; i++)
	{
		obj = document.all.tags(elmID)[i];
		obj.style.visibility = "";
	} 
}

function urlEncode(inStr)  {
  outStr=' ';  //not '' for a NS bug!
  for (i=0; i < inStr.length; i++)  {
    aChar=inStr.substring (i, i+1);
    switch(aChar){
      case '%': outStr += "%25"; break; case ',': outStr += "%2C"; break;
      case '/': outStr += "%2F"; break; case ':': outStr += "%3A"; break;
      case '~': outStr += "%7E"; break; case '!': outStr += "%21"; break;
      case '"': outStr += "%22"; break; case '#': outStr += "%23"; break;
      case '$': outStr += "%24"; break; case "'": outStr += "%27"; break;
      case '`': outStr += "%60"; break; case '^': outStr += "%5E"; break;
      case '&': outStr += "%26"; break; case '(': outStr += "%28"; break;
      case ')': outStr += "%29"; break; case '+': outStr += "%2B"; break;
      case '{': outStr += "%7B"; break; case '|': outStr += "%7C"; break;
      case '}': outStr += "%7D"; break; case ';': outStr += "%3B"; break;
      case '<': outStr += "%3C"; break; case '=': outStr += "%3D"; break;
      case '>': outStr += "%3E"; break; case '?': outStr += "%3F"; break;
      case '[': outStr += "%5B"; break; case '\\': outStr += "%5C"; break;
      case ']': outStr += "%5D"; break; case ' ': outStr += "+"; break;
      case '\r': outStr += "%0D"; break;   case '\n': outStr += "%0A"; break;
      default: outStr += aChar;
    }
  }
  return outStr.substring(1, outStr.length);
}

function lissage_accents(inStr)
{
	var i=0;
	outStr=' ';  //not '' for a NS bug!
	for (i=0; i < inStr.length; i++)
	{
		aChar=inStr.substring (i, i+1);
		switch(aChar)
		{
			case 'é': outStr += 'e'; break; case 'è': outStr += 'e'; break;
			case 'ê': outStr += 'e'; break; case 'ë': outStr += 'e'; break;
			case 'à': outStr += 'a'; break; case 'â': outStr += 'a'; break;
			case 'ä': outStr += 'a'; break; case 'î': outStr += 'i'; break;
			case 'ï': outStr += 'i'; break; case 'û': outStr += 'u'; break;
			case 'û': outStr += 'u'; break; case 'ô': outStr += 'o'; break;
			case 'ö': outStr += 'o'; break; case 'ç': outStr += 'c'; break;
			default: outStr += aChar;
		}
  }
  return outStr.substring(1, outStr.length);
}

function estDansLaListe(liste, sep_liste, val_rech)
{
	var i=0;
	var tab_valeurs;
	var ret = false;
	if(! sep_liste)
		sep_liste = ',';
	tab_valeurs = liste.split(sep_liste);
	for (i in tab_valeurs)
	{
		if(val_rech == tab_valeurs[i])
		{
			ret = true;
			break;
		}
	}
	return ret;
}

var CPT_TRACE = 0;
function trace_dd(ip, cpt, cpt_trace_max, msg)
{
	if (ip == '195.200.127.76' && cpt <= cpt_trace_max)
	{
		if(!msg)
			msg='';
		alert("//DD\n" + msg + "\n//DD");
	}
	return;
}

function mefPaveTexte(texte, lim)
{
	var i =0, j = 0;
	var ret = '';
	if (!lim)
	{
		lim = 40;
	}
	if (!texte)
	{
		ret = '';
	}
	else
	{
		ret = '';
		for (i=0; i<texte.length; i++)
		{
			ret += texte.charAt(i);
			if (i % lim == 0 && i > 0)
			{
				// interdire de couper un mot
				if (texte.charAt(i) != ' ')
				{
					for (j=i+1; j<texte.length; j++)
					{
						if (texte.charAt(i) == ' ')
						{
							ret += '\n';
							break;
						}
					}
				}
				else
				{
					ret += '\n';
				}
			}
		}
	}
	return(ret);
}

function SetDisplayDivLoading(val)
{
	var affWindow = window;
	var error = false;

	while(affWindow.name!='affichage')
	{
		if(affWindow != affWindow.parent)
		{
			affWindow = affWindow.parent;
		}
		else
		{
			error = true;
			break;
		}
	}

	if(!error)
	{
		var div = getObjectInDocument('div_loading', affWindow.frames['onglets'].document);
		if(div!=null)
		{
			div.style.display = val;
		}
	}
}
// -->
