
String.prototype.trim = function()
{ return this.replace(/(^\s*)|(\s*$)/g, ""); }

function fctLimiter(zoneTexte,nbMax)
{
	nbMax=parseInt(nbMax);
	if (zoneTexte.value.length>nbMax) 
	{ 
		alert("Pas plus de "+nbMax+" caractères dans ce champ");
		zoneTexte.value=txt.substring(0,nbMax-1);
		nb=nbMax;
	};
}

function verifierEntierPositif(obj)
{
	if(!estEntierPositif(obj.value))
	{
		if(isNaN(Math.abs(parseInt(obj.value)))) 
			obj.value=0;
		else 
			obj.value=Math.abs(parseInt(obj.value));
	}
}

function verifierDate(obj)
{
	if(!isDate(obj.value))
	{
		alert("vous devez saisir une date au format jj/mm/aa ou jj/mm/aaaa");
		obj.focus();
		obj.select();
		return false;
	}
	else
	{ return true; }
}



function estVide(objTXT)
{
	if (objTXT.value.length == 0)
	{
		alert("vous devez saisir une valeur (champ obligatoire)");
		objTXT.focus();
		objTXT.select();
		return false;
	}
	else
	{
		return true;
	}
}



