Updates to javascript switch.