function ArbiterClass() { this.events = new Object(); // events (event based data access and communication) this.offers = new Object(); // offers (public-anytime data access) } ArbiterClass.prototype.subscribe = function(type, callback) { if (this.events[type] == null) { this.events[type] = new Array(); } var token = Math.round(Math.random()*100000)+"-"+Math.round(Math.random()*100000); this.events[type].push({ callback: callback, token: token }); return token; } ArbiterClass.prototype.unsubscribe = function(token) { for (var type in this.events) { for (var i=0;i