function Game() {

    var plugins = [];
    var temporary_instance = undefined;

    this.addPluginInstance = function(instance) {
        plugins.push(instance);
    }

    this.redraw = function(draw_info) {
        for (p in plugins) {
            plugins[p].redraw(draw_info);
        }

        if (temporary_instance)
            temporary_instance.redraw(draw_info);
    }

    this.setTemporaryPluginInstance = function(instance) {
        temporary_instance = instance;
    }
}

function Game() {

    var plugins = [];
    var active_instance = undefined;

    this.addPluginInstance = function(instance) {
        plugins.push(instance);
    }

    this.redraw = function(draw_info) {
        for (p in plugins) {
            plugins[p].redraw(draw_info);
        }

        if (active_instance)
            active_instance.redraw(draw_info);
    }

    this.setActivePluginInstance = function(instance) {
        active_instance = instance;
    }

    this.getActivePluginInstance = function() {
        return active_instance;
    }
}

Make it possible to have a active object
Make it possible to have a active object

This enables the WebGameMaker to modify a currently
active element.
