function aboutUs_class() { this.init(); } aboutUs_class.prototype.init = function() { this.items = WSDOM.Element.parseSelector('#diagram-action>div'); this.attachEvents(); }; aboutUs_class.prototype.attachEvents = function() { var els = WSDOM.Element.parseSelector('#diagram>area'); for (var i = 0; i < 2; i++) { WSDOM.Events.add( { element: els[i], context: this, type: 'mouseover', handler: this.overHandler, data: i } ); WSDOM.Events.add( { element: els[i], context: this, type: 'mouseout', handler: this.outHandler, data: i } ); } }; aboutUs_class.prototype.overHandler = function(e, el, data) { WSDOM.Element.addClass(this.items[data], 'active'); }; aboutUs_class.prototype.outHandler = function(e, el, data) { WSDOM.Element.removeClass(this.items[data], 'active'); }; var aboutUsJS = new aboutUs_class();