


function changeMenu(obj, numMenu) {
    switch (numMenu) {

        case 0:
            clearInterval(interval);
            $(".wrapper").fadeOut(1000,
                    function() {
                        $(".wrapper").remove();

                        $("#mainMenu").fadeIn(1000, function(
                                ) {
                            $("body").css("background-image", "url(img/background.gif)");


                        }

                        );
                    }
            );
            break;
        case 0.1:
            $("#mainMenu").fadeOut(1000, function() {
                $("#firstMenu").fadeIn(1000);
            });

            break;
        case 1:
            $("#mainMenu").fadeOut(1000, function() {
                $("#secondMenu").fadeIn(1000);
            });
            break;
        case 2:
            $("#mainMenu").fadeOut(1000, function() {
                $("#thirdMenu").fadeIn(1000);
            });
            break;
        case 3:
            $("#mainMenu").fadeOut(1000, function() {
                $("#fourthMenu").fadeIn(1000);
            });
            break;
        case -1:
            var e = $($(obj).parent());
            e.fadeOut(1000, function() {
                $("#mainMenu").fadeIn(1000);
            });
            break;
        case 4:
            $("#mainMenu").fadeOut(1000, function() {
                $("#creditos").fadeIn(1000);
            });
            break;
        case 3.1:
            $("#thirdMenu").fadeOut(1000, function() {
                $("#marcadores").fadeIn(1000);
            });
            break;

    }
}
function setLang(jsonFile) {
    for (var prop in jsonFile) {
        if (jsonFile.hasOwnProperty(prop)) {
            $("#" + prop).text(jsonFile[prop]);
        }
    }
}
function loadLang(lang) {
    if (lang == "es") {
        loadGameLang("wordLib_es.json");
        $.getJSON("json/es.json", function(data) {
            setLang(data);
        });
    } else if (lang == "en") {
        loadGameLang("wordLib_en.json");
        $.getJSON("json/en.json", function(data) {
            setLang(data);
        });
    } else if (lang == "ita") {
        loadGameLang("wordLib_ita.json");
        $.getJSON("json/ita.json", function(data) {
            setLang(data);
        });
    }
}

