e.keyCode changed to e.which for crossbrowser compatibility