﻿function js_showHideMenu() {
    var e = document.getElementById("mAreas");
    try {
        if (e.style.display + "" == "none") {
            js_hideAll();
            e.style.display = "block";
        } else {
            e.style.display = "none";
        }
    } catch (myExc) {
        alert("Error: " + myExc.description);
    }
}
function js_showHideArchivo() {
    var e = document.getElementById("mArchivo");
    try {
        if (e.style.display + "" == "none") {
            js_hideAll();
            e.style.display = "block";
        } else {
            e.style.display = "none";
        }
    } catch (myExc) {
        alert("Error: " + myExc.description);
    }
}
function js_hideAll() {
    var e1 = document.getElementById("mAreas");
    var e2 = document.getElementById("mArchivo");
    try {
        if (e1.style.display + "" == "block") {
           e1.style.display = "none";
       }
       if (e2.style.display + "" == "block") {
           e2.style.display = "none";
       }
    } catch (myExc) {
        alert("Error: " + myExc.description);
    }
}
var min = 8;
var max = 18;
function increaseFontSize() {
    var p = document.getElementsByTagName('p');
    for (i = 0; i < p.length; i++) {
        if (p[i].style.fontSize) {
            var s = parseInt(p[i].style.fontSize.replace("px", ""));
        } else {
            var s = 12;
        }
        if (s != max) {
            s += 1;
        }
        p[i].style.fontSize = s + "px"
    }
}
function decreaseFontSize() {
    var p = document.getElementsByTagName('p');
    for (i = 0; i < p.length; i++) {
        if (p[i].style.fontSize) {
            var s = parseInt(p[i].style.fontSize.replace("px", ""));
        } else {
            var s = 12;
        }
        if (s != min) {
            s -= 1;
        }
        p[i].style.fontSize = s + "px"
    }
}
function get_DateUpdateFromURL() {
    try {
        var aMeses = ["",
                    "Enero", "Febrero", "Marzo", "Abril",
                    "Mayo", "Junio", "Julio", "Agosto",
                    "Septiembre", "Octubre", "Noviembre", "Diciembre"];
        var myUrl = document.location;
        var myEdition = new String(myUrl + "");
        var lstart = myEdition.indexOf("_");
        var myDate = myEdition.substr(lstart - 2, 10);
        var aFecha = myDate.split("_");
        if (parseInt(aFecha[0], 10) + "" == "NaN") {
            var edicion = document.getElementById("edicion");
            document.write(edicion.innerHTML);
        } else {
            document.write("Estas viendo el UPDATE del " + parseInt(aFecha[0], 10) + " de " + aMeses[parseInt(aFecha[1], 10)] + " " + aFecha[2]);
        }
    }catch( myExc ){
    alert(myExc.message);
    }
}
function js_getHistory() {
    try {
        var le = document.getElementById("selHistory");
        document.location = "" + le.options[le.selectedIndex].value;
        
    } catch (myExc) {
        alert(myExc.message);
    }
}
