﻿function S4() {
    return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
}

function guid() {
    return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4());
}

function querystring(ji) {
    hu = window.location.search.substring(1);
    gy = hu.split("&");
    for (i = 0; i < gy.length; i++) {
        ft = gy[i].split("=");
        if (ft[0].toLowerCase() == ji.toLowerCase()) {
            return ft[1];
        }
    }
}

function OpenPopup(url, w, h, scrollbars, resizable) {

    if (w == 0)
        w = screen.availWidth;

    if (h == 0)
        h = screen.availHeight;

    if (h > screen.availHeight) {
        scrollbars = 1;
        w = w + 15;
    }

    var t = parseInt((screen.availHeight - h) / 2);
    var l = parseInt((screen.availWidth - w) / 2);

    window.open(url, '', 'width=' + w + ', height=' + h + ', status=0, toolbar=0, resizable=' + resizable + ', scrollbars=' + scrollbars + ', left=' + l + ', top=' + t);
}

function Verificar(event) {
    var alt = event.altKey;
    var tecla = event.keyCode;
    if (alt == true && tecla == 121) {
        var prm = Sys.WebForms.PageRequestManager.getInstance();
        var id = $("#1EF1A993-5F96-43ae-A60A-8C08EBE78379 > div").attr("Id");                
        prm._doPostBack(id, 'Admin')
    }
}

function VerificarCache(event) {
    var alt = event.altKey;
    var tecla = event.keyCode;
    if (alt == true && tecla == 121) {
        return true;
    }
    else {
        return false;
    }
}

