﻿function cores(id, m, t, i) {
    var pagina = i;
    
    if (m != '') {

        if (t == 1) {
            if (document.getElementById(id) != null) {
                document.getElementById(id).style.backgroundColor = "#f2f2f2";
            }
            document.getElementById(m).style.backgroundColor = "#72706f";
            document.getElementById(m).style.color = "#ffffff";
        }
        if (t == 2) {
            if (document.getElementById(id) != null) {
                document.getElementById(id).style.backgroundColor = "#ffffff";
            }
            document.getElementById(m).style.backgroundColor = "#ffffff";
            document.getElementById(m).style.color = "#72706f";
            if (i != null) {
                location.href = pagina;
            }
        }
    }
    else {
        if (t == 1) {
            document.getElementById(id).style.backgroundColor = "#f2f2f2";
        }
        if (t == 2) {
            document.getElementById(id).style.backgroundColor = "#ffffff";
            if (i != null) {
                location.href = pagina;
            }
        }
    }
}