function form_decimal_change(t, decimals) {
  t.value = t.value.replace(",", ".");
  //alert('sans');
  if(decimals) t.value = Number(t.value).toFixed(decimals);
  if(isNaN(Number(t.value))) {
    t.style.backgroundColor = '#F00';
  } else {
    t.style.backgroundColor = '';
  }
}

function form_check_email_list(t) {
  var emails = String(t.value).split(/[, ]+/);
  t.style.backgroundColor = '';
  for(i in emails)
    if(!RegExp('[a-zA-Z0-9_+.-]+@[a-zA-Z0-9_+.-]+').test(emails[i]))
      t.style.backgroundColor = '#F00';
      
}

