If you don't have CustomEvent at all, this should work as a stand-in