var MODULE = "OB_II_8";var TYPE = "wc";var DEBUG = false;
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 (TYPE === "gm") {
        doc.src = "./Scripts/Games/" + MODULE + "/JSON.js";
        document.title = "Gra";
    }
    if (TYPE==="fi") {
        doc.src = "./Scripts/Games/" + MODULE + "/JSON.js";
        document.title = "Fiszki";
    }

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