(function() {
window.TED = window.TED || {};
window.TED["extend"] = G;
window.TED["EventDispatcher"] = E;
function G(L, M, H) {
function J() {}
J.prototype = M.prototype;
var K = new J();
K.constructor = L;
L.superclass = M;
for (var I in H) {
K[I] = H[I]
}
L.prototype = K
}
function E() {
this._events = {}
}
E.prototype = {
on: function(J, K, I, H) {
I = I || this;
this._events[J] = this._events[J] || [];
this._events[J].push({
listener: K,
scope: I,
args: H
})
},
fireEvent: function(M, L, I) {
var N, K, H, J = this._events[M];
if (!J) {
return false
} else {
for (K = 0, H = J.length; K < H; K++) {
N = J[K];
L = N.scope;
I = I || N.args || [];
N.listener.apply(L, I)
}
}
},
remove: function(K, L) {
if (!this._events[K]) {
return false
}
var J = this._events[K],
I,
H;
for (I = 0, H = J.length; I < H; I++) {
if (J[I].listener === L) {
J.splice(I, 1);
break
}
}
if (J.length === 0) {
delete this._events[K]
}
}
};
var B = {