function WatchersHandler(element){
    this.element = element;
    this.watchersRemoved = false;
    var lastState = null;

    this.onActivated = function(active){
        if(!stateChanged(active)) return;
        
        if(active || !this.watchersRemoved){
            toggleChildrenWatchers(this.element, !active);
            this.watchersRemoved = !active;
        }
    }

    function stateChanged(curState){
        if(lastState == null || curState != lastState){
            lastState = curState;
            return true;
        }
        return false;
    }
}