Javascript switch library.