A cross browser event trigger function