/**
 * TableDCI
// */
var info = "";
function TableDCI(datos, noElementos, eventsJS, discrim) {
    this.datos = datos;
    this.noElementos = noElementos;
    this.selected = "";
    this.generaTabla = getTable ;
    this.eventsJS = eventsJS;
    this.discriminador = discrim;
}

var selected = "";

function getTable(estilo) {
    var strHtml = "<div id='eleccion" + this.discriminador + "' style='font-family:Verdana;font-size:small;text-align:center'>" +
                  "&nbsp; &nbsp; &nbsp; &nbsp; Eleccion: </div>";
    strHtml += "<table align='right' ";
    strHtml += "style='" + estilo + "' >";
    strHtml += "<tr><td valign='top'>";
    var tam = this.datos.length;
    var indCols = 0;
    for(var i = 0; i < tam; i++){
        strHtml += "<li id='l" + i + this.discriminador + "' onmouseover='toIn(" + i + ", \"" + this.discriminador + "\")' onmouseout='toOut(" + i + ", \"" + this.discriminador + "\")'" +
                   "style='cursor:pointer;font-size:13px' onclick='" + this.eventsJS + "' >" +
                   this.datos[i] +
                   "</li>";
        indCols = (i+1) % this.noElementos;
        if(indCols == 0){
            strHtml += "</td><td valign='top'>"
        }
    }
    strHtml += "</td></tr></table>"
    return strHtml;
}

function toIn(x, disc){
    selected = $("l" + x + disc).innerHTML;
    $("l" + x + disc).style.color = "#FFEEAA";
    $("l" + x + disc).style.backgroundColor = "#90B0DA";
    $('eleccion' + disc).innerHTML = " &nbsp; &nbsp; &nbsp; &nbsp; Seleccione un " + disc +": " + selected;
}

function toOut(x, disc){
    $("l" + x + disc).style.color = "";
    $("l" + x + disc).style.backgroundColor = "";
}

