non perderti per così poco: modifica così


codice:
function setvars() {
  A = window.document.getElementById('mq');
  B = window.document.getElementById('euromq');
  C = window.document.getElementById('coefficienteeta');
  R = window.document.getElementById('result');    
}
e poi nelle altre funzioni leggi i valori con A.value, B.value ecc ecc.