﻿function getParametro(url, prmName) {
    var remplaza = /\+/gi;
    url = unescape(url);
    url = url.replace(remplaza, " ");
    var prmUpper = prmName;
    var prmPosic = url.indexOf(prmUpper);
    var sepPos;
    if (prmPosic != -1) {
        var sepPos = url.indexOf("&", prmPosic);
        if (sepPos != -1) {
            return url.substring(prmPosic + prmUpper.length + 1, sepPos);
        } else {
            return url.substring(prmPosic + prmUpper.length + 1, url.length);
        }
    } else {
        return "";
    }
}
function abrirVentana(url, ancho, alto, barras,nombre_ventana) {
    var width = ancho, height = alto;
    var left = (screen.width / 2) - width / 2;
    var top = ((screen.height / 2) - height / 2) - 200;
    var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + barras + ',resizable=no,copyhistory=no,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',screenX=' + left + ',screenY=' + top;
    window.open(url, nombre_ventana, styleStr);
    return false;
}
function maximizar() {
    window.moveTo(0, 0);
    if (document.all) {
        top.window.resizeTo(screen.availWidth, screen.availHeight);
    }
    else if (document.layers || document.getElementById) {
        if (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth) {
            top.window.outerHeight = screen.availHeight;
            top.window.outerWidth = screen.availWidth;
        }
    }
}
