﻿function confronto(foto_m, foto_v, foto_c, jogo, local, data_hora) {
    this.foto_m = foto_m;
    this.foto_v = foto_v;
    this.foto_c = foto_c;
    this.jogo = jogo;
    this.local = local;
    this.data_hora = data_hora;
}

function mudarParaTab(id, prefix) {

    var alltabs = ["prof", "sub20", "sub18", "sub15", "basquete", "futsal", "handebol"];
    var pjs = [pj_prof, pj_sub20, pj_sub18, pj_sub15, pj_basquete, pj_futsal, pj_handebol];
    var ujs = [uj_prof, uj_sub20, uj_sub18, uj_sub15, uj_basquete, uj_futsal, uj_handebol];
    
    jid = -1;
    for (i = 0; i < 7; i++) {
        if (alltabs[i] == id) {
            jid = i;
            break;
        }
    }

    var pj = pjs[jid];
    var uj = ujs[jid];

    var tab = document.getElementById("tab_" + id);
    tab.style.backgroundImage = "url(/2009/Imagens/Confrontos/conf_" + id + "_on.png)";
    tab.style.cursor = "auto";
    
    document.getElementById(prefix + "uj_foto_mandante").style.backgroundImage = "url(" + uj.foto_m + ")";
    document.getElementById(prefix + "uj_foto_visitante").style.backgroundImage = "url(" + uj.foto_v + ")";
    document.getElementById(prefix + "uj_foto_campeonato").style.backgroundImage = "url(" + uj.foto_c + ")";
    document.getElementById(prefix + "uj_jogo").innerText = uj.jogo;
    document.getElementById(prefix + "uj_jogo").innerHTML = uj.jogo;
    document.getElementById(prefix + "uj_local").innerText = uj.local;
    document.getElementById(prefix + "uj_local").innerHTML = uj.local;
    document.getElementById(prefix + "uj_data_hora").innerText = uj.data_hora;
    document.getElementById(prefix + "uj_data_hora").innerHTML = uj.data_hora;
    document.getElementById(prefix + "pj_foto_mandante").style.backgroundImage = "url(" + pj.foto_m + ")";
    document.getElementById(prefix + "pj_foto_visitante").style.backgroundImage = "url(" + pj.foto_v + ")";
    document.getElementById(prefix + "pj_foto_campeonato").style.backgroundImage = "url(" + pj.foto_c + ")";
    document.getElementById(prefix + "pj_jogo").innerText = pj.jogo;
    document.getElementById(prefix + "pj_jogo").innerHTML = pj.jogo;
    document.getElementById(prefix + "pj_local").innerText = pj.local;
    document.getElementById(prefix + "pj_local").innerHTML = pj.local;
    document.getElementById(prefix + "pj_data_hora").innerText = pj.data_hora;
    document.getElementById(prefix + "pj_data_hora").innerHTML = pj.data_hora;
        
    for (i = 0; i < 7; i++) {

        if (alltabs[i] != id) {
            var outra_tab = document.getElementById("tab_" + alltabs[i]);
            outra_tab.style.backgroundImage = "url(/2009/Imagens/Confrontos/conf_" + alltabs[i] + "_off.png)";
            outra_tab.style.cursor = "pointer";
        }
        
    }

}

function tabClick(id) {
    mudarParaTab(id, "");
}

function aspnet_tabClick(id) {
    mudarParaTab(id, "ctl00_template_conteudo_fec_confrontos_");
}