function validateSignup (d) {

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

  if (d.fmName.value == "") {
    errorTable+="'Name' must be entered\n";
    if (!firstError) firstError=d.fmName;
    setColors('fidName', errorColor);
  } else { setColors('fidName', normalColor); }

  fieldError=false;
  if (d.fmEmail.value == "") {
    errorTable+="'E-Mail' must be entered\n";
    fieldError=true;
  } else if (!validEmail(d.fmEmail.value)) {
    errorTable+="'E-Mail' appears to be invalid\n";
    fieldError=true;
  }
  if (fieldError) {
    if (!firstError) firstError=d.fmEmail;
    setColors('fidEmail', errorColor);
  } else {
    setColors('fidEmail', normalColor);
  }

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

  if (d.fmPassword.value == "") {
    errorTable+="'Password' must be entered\n";
    fieldError=true;
  } else if (d.fmPassword.value.length < 8 || d.fmPassword.value.length > 16) {
    errorTable+="'Password' must be between 8-16 characters long\n";
    fieldError=true;
  } else if (!validpwchars(d.fmPassword.value)) {
    errorTable+="'Password' cannot contain quote marks or spaces\n";
    fieldError=true;
  }
  if (fieldError) {
    passwordError=true;
    if (!firstError) firstError=d.fmPassword;
    setColors('fidPassword', errorColor);
  } else {
    setColors('fidPassword', normalColor);
  }

  fieldError=false;
  if (d.fmConfirmPassword.value == "") {
    errorTable+="'Confirm Password' must be entered\n";
    fieldError=true;
  } else if (d.fmConfirmPassword.value.length < 8 || d.fmConfirmPassword.value.length > 16) {
    errorTable+="'Confirm Password' must be between 8-16 characters long\n";
    fieldError=true;
  } else if (!validpwchars(d.fmConfirmPassword.value)) {
    errorTable+="'Confirm Password' cannot contain quote marks or spaces\n";
    fieldError=true;
  }

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

  // check password match only if no other password errors
  if (!passwordError) {
    if (d.fmPassword.value != d.fmConfirmPassword.value) {
      errorTable+="'Password and Confirm Password' do not match\n";
      if (!firstError) firstError=d.fmPassword;
      setColors('fidPassword', errorColor);
      setColors('fidConfirmPassword', errorColor);
    }
  }

  if (d.fmPhone.value == "") {
    errorTable+="'Phone' must be entered\n";
    if (!firstError) firstError=d.fmPhone;
    setColors('fidPhone', errorColor);
  } else { setColors('fidPhone', normalColor); }

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

}

