build demo file.

Added cross browser event hander functions.