//Secretaría de Alumnos
var defCellBgColor = "#F0F0F0"
var isIE = (window.navigator.userAgent.indexOf("MSIE") >= 0);

function lineColorToTable(table) {
  var i, j;
  
  for (i=1; i<table.rows.length; i++) {
    for (j=0; j<table.rows.item(i).cells.length; j++) {
      if ((i % 2) == 0) {
        if (table.rows.item(i).cells(j).bgColor == '')
          table.rows.item(i).cells(j).style.backgroundColor = defCellBgColor;
        else {
          table.rows.item(i).cells(j).style.filter = "alpha(opacity=70)";
//          table.rows.item(i).cells(j).style.fontWeight = "bold";
        }
      }
    }
  }
}

function tipoCalificacion(nota) {
  var resParse
  resParse = parseFloat(nota);
  if (resParse < 4)
    return -1;
  else
    if (resParse < 7)
      return 0;
    else
      return 1;
}

function buenaCalificacion(nota) {
  var resParse
  resParse = parseFloat(nota);
  if (resParse <= 4)
    return false;
  else
    return true;
}

function lineColorToBoletin(table) {
  var i, j, typCal;
  
  for (i=1; i<table.rows.length; i++) {
    for (j=0; j<table.rows.item(i).cells.length; j++) {
      if ((i % 2) == 0) {
        if (j > 0) {
          typCal = tipoCalificacion(table.rows.item(i).cells(j).innerText);
          if (typCal < 0)
            table.rows.item(i).cells(j).style.color = "#FF0000";
          else if (typCal == 0)
            table.rows.item(i).cells(j).style.color = "#FF00FF";
          else
            table.rows.item(i).cells(j).style.color = "#000000";
        }
        if (table.rows.item(i).cells(j).bgColor == '')
          table.rows.item(i).cells(j).style.backgroundColor = defCellBgColor;
        else {
          table.rows.item(i).cells(j).style.filter = "alpha(opacity=70)";
//          table.rows.item(i).cells(j).style.fontWeight = "bold";
        }
      }
      else {
        if (j > 0) {
          typCal = tipoCalificacion(table.rows.item(i).cells(j).innerText);
          if (typCal < 0)
            table.rows.item(i).cells(j).style.color = "#FF0000";
          else if (typCal == 0)
            table.rows.item(i).cells(j).style.color = "#FF00FF";
          else
            table.rows.item(i).cells(j).style.color = "#000000";
        }
      }
    }
  }
}