function validateRegistration (d) {

  d.submit.disabled = true;
  var errorTable="";
  var firstError="";
  var fieldError=false;
  var errorColor="#ff0000";
  var normalColor="#404040";

  fieldError=false;
  if (d.rtUserId.value == "") {
    errorTable+="Debe escribir el 'Nombre de usuario'\n";
    fieldError=true;
  } else if (d.rtUserId.value.length < 6 || d.rtUserId.value.length > 16) {
    errorTable+="El 'Nombre de usuario' debe tener entre 6-16 caracteres\n";
    fieldError=true;
  }
  if (fieldError) {
    if (!firstError) firstError=d.rtUserId;
    setColors('fidUserId', errorColor);
  } else {
    setColors('fidUserId', normalColor);
  }

  setColors('fidPassword', normalColor);
  setColors('fidPassword2', normalColor);
  var passwordError=false;
  fieldError=false;

  if (d.rtPassword.value == "") {
    errorTable+="Debe escribir la 'Contraseña'\n";
    fieldError=true;
  } else if (d.rtPassword.value.length < 6 || d.rtPassword.value.length > 16) {
    errorTable+="La 'Contraseña' debe tener entre 6-16 caracteres\n";
    fieldError=true;
  }
  if (fieldError) {
    passwordError=true;
    if (!firstError) firstError=d.rtPassword;
    setColors('fidPassword', errorColor);
  } else {
    setColors('fidPassword', normalColor);
  }

  fieldError=false;
  if (d.rtPassword2.value == "") {
    errorTable+="Debe re-escribir la 'Contraseña'\n";
    fieldError=true;
  } else if (d.rtPassword2.value.length < 6 || d.rtPassword2.value.length > 16) {
    errorTable+="'Re-escribir la contraseña' debe tener entre 6-16 caracteres\n";
    fieldError=true;
  }

  if (fieldError) {
    passwordError=true;
    if (!firstError) firstError=d.rtPassword2;
    setColors('fidPassword2', errorColor);
  } else {
    setColors('fidPassword2', normalColor);
  }

  // check password match only if no other errors
  if (!passwordError) {
    if (d.rtPassword.value != d.rtPassword2.value) {
      errorTable+=" Las 'Contraseñas' no son iguales\n";
      if (!firstError) firstError=d.rtPassword;
      setColors('fidPassword', errorColor);
      setColors('fidPassword2', errorColor);
    }
  }

  fieldError=false;
  if (d.rtEmail.value == "") {
    errorTable+="Debe escribir el 'Correo electrónico'\n";
    fieldError=true;
  } else if (!validEmail(d.rtEmail.value)) {
    errorTable+="El 'Correo electrónico' no es válido\n";
    fieldError=true;
  }
  if (fieldError) {
    if (!firstError) firstError=d.rtEmail;
    setColors('fidEmail', errorColor);
  } else {
    setColors('fidEmail', normalColor);
  }

  if (d.rtNameFirst.value == "") {
    errorTable+="Debe escribir el 'Primer nombre'\n";
    if (!firstError) firstError=d.rtNameFirst;
    setColors('fidNameFirst', errorColor);
  } else { setColors('fidNameFirst', normalColor); }

  if (d.rtNameLast.value == "") {
    errorTable+="Debe escribir el 'Apellido'\n";
    if (!firstError) firstError=d.rtNameLast;
    setColors('fidNameLast', errorColor);
  } else { setColors('fidNameLast', normalColor); }

  if (d.rtAddress1.value == "") {
    errorTable+="Debe escribir la 'Dirección 1'\n";
    if (!firstError) firstError=d.rtAddress1;
    setColors('fidAddress1', errorColor);
  } else { setColors('fidAddress1', normalColor); }

  if (d.rtCity.value == "") {
    errorTable+="Debe escribir la 'Ciudad'\n";
    if (!firstError) firstError=d.rtCity;
    setColors('fidCity', errorColor);
  } else { setColors('fidCity', normalColor); }

  if (d.rtState.value == "") {
    errorTable+="Debe seleccionar el 'Estado'\n";
    if (!firstError) firstError=d.rtState;
    setColors('fidState', errorColor);
  } else { setColors('fidState', normalColor); }

  if (d.rtPostalcode.value == "") {
    errorTable+="Debe escribir el 'Código postal'\n";
    if (!firstError) firstError=d.rtPostalcode;
    setColors('fidPostalcode', errorColor);
  } else { setColors('fidPostalcode', normalColor); }

  if (!d.rtSex[0].checked && !d.rtSex[1].checked) {
    errorTable+="Debe marcar el 'Sexo'\n";
    if (!firstError) firstError=d.rtSex[0];
    setColors('fidSex', errorColor);
  } else { setColors('fidSex', normalColor); }

  if (d.rtAge.value == "") {
    errorTable+="Debe escribir la 'Edad'\n";
    if (!firstError) firstError=d.rtAge;
    setColors('fidAge', errorColor);
  } else { setColors('fidAge', normalColor); }

  if (d.rtBirthMonth.value == "") {
    errorTable+="Debe seleccionar el 'Mes de nacimiento'\n";
    if (!firstError) firstError=d.rtBirthMonth;
    setColors('fidBirthday', errorColor);
  } else { setColors('fidBirthday', normalColor); }

  if (d.rtBirthDay.value == "") {
    errorTable+="Debe seleccionar el 'Día de nacimiento'\n";
    if (!firstError) firstError=d.rtBirthDay;
    setColors('fidBirthday', errorColor);
  } else { setColors('fidBirthday', normalColor); }

  if (!d.rtMaritalStatus[0].checked && !d.rtMaritalStatus[1].checked) {
    errorTable+="Debe marcar su 'Estado civil'\n";
    if (!firstError) firstError=d.rtMaritalStatus[0];
    setColors('fidMaritalStatus', errorColor);
  } else { setColors('fidMaritalStatus', normalColor); }

  if (d.rtCountry.value == "") {
    errorTable+="Debe seleccionar el 'País'\n";
    if (!firstError) firstError=d.rtCountry;
    setColors('fidCountry', errorColor);
  } else { setColors('fidCountry', normalColor); }

  if (d.rtYearsUsa.value == "") {
    errorTable+="Debe seleccionar los 'Años en los Estados Unidos'\n";
    if (!firstError) firstError=d.rtYearsUsa;
    setColors('fidYearsUsa', errorColor);
  } else { setColors('fidYearsUsa', normalColor); }

  if (d.rtLanguage.value == "") {
    errorTable+="Debe seleccionar su 'Idioma principal'\n";
    if (!firstError) firstError=d.rtLanguage;
    setColors('fidLanguage', errorColor);
  } else { setColors('fidLanguage', normalColor); }

  if (d.rtNumberChildren.value == "") {
    errorTable+="Debe escribir el 'Número de hijos'\n";
    if (!firstError) firstError=d.rtNumberChildren;
    setColors('fidNumberChildren', errorColor);
  } else { setColors('fidNumberChildren', normalColor); }

  if (d.rtEducation.value == "") {
    errorTable+="Debe seleccionar su 'Educación'\n";
    if (!firstError) firstError=d.rtEducation;
    setColors('fidEducation', errorColor);
  } else { setColors('fidEducation', normalColor); }

  if (d.rtOccupation.value == "") {
    errorTable+="Debe seleccionar su 'Ocupación'\n";
    if (!firstError) firstError=d.rtOccupation;
    setColors('fidOccupation', errorColor);
  } else { setColors('fidOccupation', normalColor); }

  if (d.rtHoursRadio.value == "") {
    errorTable+="Debe seleccionar las 'Horas de radio'\n";
    if (!firstError) firstError=d.rtHoursRadio;
    setColors('fidHoursRadio', errorColor);
  } else { setColors('fidHoursRadio', normalColor); }

  if (d.rtHoursTv.value == "") {
    errorTable+="Debe seleccionar las 'Horas de TV'\n";
    if (!firstError) firstError=d.rtHoursTv;
    setColors('fidHoursTv', errorColor);
  } else { setColors('fidHoursTv', normalColor); }

  if (d.rtIncomeLevel.value == "") {
    errorTable+="Debe seleccionar su 'Nivel de ingreso'\n";
    if (!firstError) firstError=d.rtIncomeLevel;
    setColors('fidIncomeLevel', errorColor);
  } else { setColors('fidIncomeLevel', normalColor); }

  if (errorTable) {
    alert (errorTable);
    firstError.focus();
    d.submit.disabled = false;
    return false;
  } else { return true; }

}