// Go through all tables on the page, number the rows, and "stripe" the
// table (color every other row) for readability

var creditsTables = document.getElementsByTagName("table");
var numTables = creditsTables.length;

for (tableNum = 0; tableNum < numTables; tableNum++)
{
   var rows = creditsTables[tableNum].getElementsByTagName("tr");
   var numCredits = rows.length;
   var numberRows = false;
   var odd = true;
   var oddColor = "#181818";

   if (numCredits > 1)
   {
      //Initialize row number
      row = 1;

      for (i=1; i < numCredits; i++)
      {
         // Number the rows, if required
         if (rows[i].childNodes[0].className == "number")
         {
            rows[i].childNodes[0].childNodes[0].nodeValue = row + ". ";
            row++;
         }

         // Change color of every other row
         if (odd)
         {
            rows[i].style.backgroundColor = oddColor;
         }

         // swap even and odd
         odd = !odd;
      }
   }
}

