javascript fires on clicking the calendar view-event