var MODULE = "ZIP_I_5";var TYPE = "wc";var DEBUG = false;
var DEBUG = false;

function loadJSON() {
    var doc = document.createElement("script");
    doc.type = "text/javascript";
    if (TYPE === "wc") {
        doc.src = "./Scripts/WorkCards/" + MODULE + "/JSON.js";
        document.title = "Karta pracy";
    }

    if (TYPE === "ex") {
        doc.src = "./Scripts/Exams/" + MODULE + "/JSON.js";
        document.title = "Sprawdzian";
    }   
    if (TYPE === "gm") {
        doc.src = "./Scripts/Games/" + MODULE + "/JSON.js";
        document.title = "Gra";
    }

    if (doc.src === undefined || doc.src.length == 0) {
        console.error("TYPE not specified");
    }

    document.getElementsByTagName('head')[0].appendChild(doc);


}

document.onreadystatechange = function () {
    var state = document.readyState;
    if (state == 'interactive') {
        loadJSON();
    } else if (state == 'complete') {
        this.game = new Global.Main();
    }
}; 