1.40 update

- css separated from codes
- added few additional events
- refactored/rewrite sample codes