﻿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 HideFlashMovies() {
    document.getElementById('flash1').style.display = 'none';
    document.getElementById('flash1Block').style.display = 'block';

    document.getElementById('flash2').style.display = 'none';
    document.getElementById('flash2Block').style.display = 'block';        
}

function ShowFlashMovies() {
    document.getElementById('flash1').style.display = 'block';
    document.getElementById('flash1Block').style.display = 'none';

    document.getElementById('flash2').style.display = 'block';
    document.getElementById('flash2Block').style.display = 'none';    
}

function OpenPopup(url, w, h) {
    var t = parseInt((screen.availHeight - h) / 2);
    var l = parseInt((screen.availWidth - w) / 2);    
    window.open(url, 'Galeria', 'width=' + w + ', height=' + h + ', status=0, toolbar=0, scrollbars=yes, left=' + l + ', top=' + t);
}

function abrirGaleriaFotos() {
    window.open('http://www.triade-ti.com.br/galeriafotos/galeriafotos.aspx?Codigo=ER%2b%2fCsQRPnQ%3d&H=' + new Date().getTime(), 'Galeria', 'width=940px, height=630px, status=0, toolbar=0; left=' + ((screen.availWidth - 940) / 2) + '; top=' + ((screen.availHeight - 630) / 2));
}
