An array would probably be easiest as then you'd only need a single statement to do the assignment.
var vals = ["Off","Auto","Manual"];
i = document.getElementById('datamem14').value;
if (i < 0 || i >= vals.length) i = 0;
document.getElementById('mode').value = vals[i];
Just add as many entries to the array as you need, the rest of the code will not need to be changed.