added javascript function for event creation