﻿function querySt(ji) {
    hu = window.location.search.substring(1);
    gy = hu.split('&');
    for (i = 0; i < gy.length; i++) {
        ft = gy[i].split('=');
        if (ft[0] == ji) {
            return ft[1];
        }
    }
}

function zoomText(Accion, Objeto) {
    var obj = document.getElementById(Objeto);
    var max = 200;
    var min = 70;
    var s = 'FontSize=';
    if (obj.style.fontSize == '') {
        obj.style.fontSize = '100%';
    }
    actual = parseInt(obj.style.fontSize);
    incremento = 10;

    if (Accion == 'R') {
        obj.style.fontSize = '100%';
    }
    if (Accion == "A" && ((actual + incremento) <= max)) {
        valor = actual + incremento;
        obj.style.fontSize = valor + '%';
    }
    if (Accion == "D" && ((actual + incremento) >= min)) {
        valor = actual - incremento;
        obj.style.fontSize = valor + '%';
    }
    document.cookie = s + obj.style.fontSize + ';';
}

function TextSizeRec(Objeto) {
    var obj = document.getElementById(Objeto.id);
    var cookieList = document.cookie.split(';');
    for (var i = 0; i < cookieList.length; i++) {
        var cookieParts = cookieList[i].split('=');
        if (cookieParts[0].replace(/^\s*|\s*$/g, "") == 'FontSize') {
            obj.style.fontSize = cookieParts[1];
        }
    }
}

function PopUp(Url) {
    var opciones = 'height=500,width=450,status=yes,toolbar=no,menubar=no,location=no,left = 350,top = 250, resizable=no, scrollbars=no, directories=no';
    window.open(Url, 'Excribame', opciones);
}

function AbrirArchivo(ruta) {
    window.open('/VisualizarArchivos.ashx?r=' + ruta, '_blank', 'resizable=1,location=0,menubar=0,status=0,toolbar=0');
}

function Winopen(ruta)
{
    var opciones = 'height=600,width=800,status=yes,toolbar=yes,menubar=yes,location=no, resizable=yes, scrollbars=yes, directories=yes';
    window.open(ruta, '_blank', opciones);
}

function VentanaDocumento(ruta) {
    alert("El documento no existe.");
}

function ventanaip(ruta) {
    alert("Ya hizo uso de su voto, intentelo otro día");
}

function MouseSobre(name, direction) {
    switch (direction) {
        case 'in':
            name.src = "/images/t4_on.png";
            break;
        case 'out':
            name.src = "/images/t4.png";
            break;
    }
}

function VentanaTermi(ruta) {
    var opciones = 'height=500,width=500,status=yes,toolbar=no,menubar=yes,location=no, resizable=no, scrollbars=yes, directories=no';
    window.open(ruta, '_blank', opciones);
}

function VentaComple(ruta) {
    var opciones = 'status=yes,toolbar=yes,menubar=yes,location=yes, resizable=yes, scrollbars=yes, directories=yes, target=_blank';
    window.open(ruta, '_blank', opciones);
}


