function check_int(frm_el, b_mandatory)
{
  var n_val, strip_val ;
  var res = false ;

  if (frm_el.value == null || frm_el.value == '')
    return (!b_mandatory) ;
  // lascia solo 0-9 e ','
  strip_val = frm_el.value.replace(/[^0-9,]/g, '') ;
  // cambia ',' in '.'
  n_val = parseFloat(strip_val.replace(/,/g, '.')) ;
  res = !isNaN(n_val) ;
  frm_el.value = res ? strip_val : 0 ;
  // se e' obbligatorio, check > 0
  if (res && b_mandatory) res = n_val > 0 ;
  return (res) ;
}

