var EventCenter = { addEventHandler: function (eventName, callback) { if(!this.handles){ this.handles={}; } if(!this.handles[eventName]){ this.handles[eventName]=[]; } this.handles[eventName].push(callback); }, emit: function (eventName) { if(this.handles[arguments[0]]){ for(var i=0;i