String.prototype.repeat = function(l){
    return new Array(1+l).join(this);
};

function debugObj(obj){
    for(var i in obj)
        log(i);
}

var Notifier = function() {
    // requires base class to define 
    this.listeners = [];
};

Notifier.prototype.addListener = function(callback) {
    this.listeners.push(callback);
}

Notifier.prototype.notifyAll = function(eventName, args) {
        for (var i in this.listeners) {
            var listener = this.listeners[i];
            try {
                if(typeof(listener[eventName]) == "function"){
                    listener[eventName](args, this);
                }
            } catch (e) {
                //no listener for event
            }
        }
}

function ElementWrapper(){
}

ElementWrapper.prototype  = update(new Notifier,{
    getElement: function(){
        return this.element;
    }
});