function isBlank(oForm, nomChp) {
  // verifie si la valeur du champ est vide 
  var s = oForm[nomChp].value;

  for (var i=0;i<s.length;i++){
    var c=s.charAt(i);
    if ((c!=' ')&&(c!='\n')&&(c!='\t')) return false;
  }
return true;
}
 
function isNumber(oForm, nomChp)
{
  // verifie si la chaine s est composée exclusivement des caractères suivants
  var l = "1234567890";
  var vsValue = oForm[nomChp].value;
  
  if (vsValue.length==0)
    return false;
  
  for (var i=0;i<vsValue.length;i++)
  {
     var c = vsValue.charAt(i);
     
     //' si le caractère n'est pas de la chaine..
     if ( l.indexOf(c) == -1 )
	return false;
  }
  return true;
}

function isNumberOrEmpty(oForm, nomChp)
{
  // verifie si la chaine s est composée exclusivement des caractères suivants
  var l = "1234567890";
  var vsValue = oForm[nomChp].value;
  
  for (var i=0;i<vsValue.length;i++)
  {
  	var c = vsValue.charAt(i);
     
  	//' si le caractère n'est pas de la chaine..
    if ( l.indexOf(c) == -1 )
			return false;
  }
  return true;
}

function isEmail(oForm, nomChp)
{
	var vsEmail = oForm[nomChp].value;
 	var a = false;
 	var res = false;
 	if (typeof(RegExp) == 'function')
 	{
  	var b = new RegExp('abc');
  	if (b.test('abc') == true)
  		a = true;
  }

 	if (a == true)
 	{
  	reg = new RegExp('^([a-zA-Z0-9\\-\\.\\_]+)'+
                   '(\\@)([a-zA-Z0-9\\-\\.]+)'+
                   '(\\.)([a-zA-Z]{2,4})$');
  	res = (reg.test(vsEmail));
 	}
 	else
 	{
  	res = (vsEmail.search('@') >= 1 &&
         vsEmail.lastIndexOf('.') > vsEmail.search('@') &&
         vsEmail.lastIndexOf('.') >= vsEmail.length-5)
 	}
 	return(res);
}

function winconfirm( psUrl, psMessage )
{
	if ( confirm(psMessage) )
		document.location = psUrl;
}

function formsubmit( oForm, psUrl )
{
	oForm.action = psUrl;
	oForm.submit();
}