Event handler javascript library