Create JavaScript event model