Scripts = {
    _list: [],
    _loaded: false,
    _placeholder: null,
    _inject: function(src) {
        var script = document.createElement("SCRIPT");
        script.type = "text/javascript";
        script.src = src;
        this._placeholder.appendChild(script);
    },
    Generate: function(jsSource) {
        alert(jsSource);
        var script = document.createElement("SCRIPT");
        script.type = "text/javascript";
        script.appendChild(document.createTextNode(jsSource));
        this._placeholder.appendChild(script);
        this._list = null;
        this._loaded = true;
    },
    Load: function() {
        if (this._loaded || !this._list) return;
        if (!this._placeholder) this._placeholder = document.getElementsByTagName("body")[0];
        for (var i = 0; i < this._list.length; i++) this._inject(this._list[i]);
        this._list = null;
        this._loaded = true;
    },
    Attach: function(src, order) {
        if (src) {
            if (this._loaded) this._inject(src);
            else if (order) this._list.splice(order, 0, src);
            else this._list.push(src);
        }
    }
};