function Compter(id1,id2,max,nomchamp,msg,texte)
{
	StrLen		= document.getElementById(id1).value.length;
	StrLen2		= 0 
	StrLenModif	= max;

	if(id2 !='') {
		StrLen2		= document.getElementById(id2).value.length
		StrLen		= StrLen + StrLen2
		StrLenModif	= max - document.getElementById(id2).value.length ;
	}

	CharsLeft = StrLen;

	if (StrLen > max ) {
		document.getElementById(id1).value = document.getElementById(id1).value.substring(0,StrLenModif);
		CharsLeft = max;
		if(msg=='Y') alert(texte);
	}

	nomchamp.value = CharsLeft;
}

function Compter2(Target, max, nomchamp)
{
	StrLen = Target.value.length
	if (StrLen > max )
	{
		Target.value = Target.value.substring(0,max);
		CharsLeft = max;
	}
	else
	{
		CharsLeft = StrLen;
	}
	nomchamp.value = CharsLeft;
}

function CompterSimple(Target, max, nomchamp)
{
	try {
		StrLen = Target.value.length;
		if (StrLen > max ) {
			Target.value = Target.value.substring(0,max);
			CharsLeft = max;
		} else {
			CharsLeft = StrLen;
		}
		nomchamp.value = CharsLeft;
	}catch(e){}
}

function CompterWithAlert(Target, max, nomchamp, msgAlert){
	CompterSimple(Target, max, nomchamp);
	if(StrLen > max && msgAlert!=false) alert(msgAlert);
}
