Event Observer code.
Final code of prototype.