minor changes to javascript to fix defect for eventtype jquery