isn't switch one of the bad parts in javascript? A couple of "if" statements should be just enough considering that the value was already validated/preset.