var MODULE = "OS_I_10";
var TYPE = "wc";
var DEBUG = true;

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 (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();
    }
}; 