﻿function SelectItemByValue(selectHTML, value) {
    
    var select = document.getElementById(selectHTML);
    var i;
    for (i = select.length - 1; i >= 0; i--) 
    {
        select.options[i].selected = 'false'; 
    }

    for (i = select.length - 1; i >= 0; i--) 
    {
        if (select.options[i].value == value) 
        { 
            select.options[i].selected = 'true'; 
        } 
    }
}

function Verificar(event) 
{
    var alt = event.altKey;
    var tecla = event.keyCode;
    if (alt == true && tecla == 121) 
    {
        __doPostBack('__Page', 'Admin');
    }
}

function OpenPopup(url, w, h, scrollbars, resizable) {

    if (w == 0)
        w = screen.availWidth;

    if (h == 0)
        h = screen.availHeight;

    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);
}