/*
This script causes the rows in a table to alternate in colour. The colours, "odd1", "odd2" etc. are applied to alternate rows. The rows in between are left unchanged and given by the corresponding  colours "set1bg", set2bg" etc. respectively. All the colours used are specified in walkextra.css.
*/    
function stripeTables() {
  // This code is necessary for browsers that don't reflect the DOM constants
  if (document.ELEMENT_NODE == null) { //if 1
    document.ELEMENT_NODE = 1;
    document.TEXT_NODE = 3;
  }  //end of if 1
  if (!document.getElementsByTagName) return false;
  var tables = document.getElementsByTagName("table");
  
  for (var i=0; i<tables.length; i++) {
    label = tables[i].getAttribute("id");
    var colr = "";
    if ((label == "1")||(label=="5")||(label=="9")){ colr = "odd1";}
    if ((label=="2")||(label=="6")||(label=="10")){colr = "odd2"; }
    if ((label == "3")||(label=="7")||(label=="11")){ colr ="odd3";}
    if ((label == "4")||(label=="8")||(label=="12")){ colr ="odd4";}
    var oddboul = false;
    var rows = tables[i].getElementsByTagName("tr");
   for (var j=0; j<rows.length; j++) {
          if (oddboul == true) { //if 8
              addClass(rows[j],colr);
              oddboul = false;
          } else {  //else 1
             oddboul = true;
          } //end of else 1
   }   //end of for j
  }     // end of for i
}       // end of function

function modulo(x,n){  //not used
while (x>=0){
x=x - n;
}
x=x+n;
return x;
} //eof modulo

addLoadEvent(stripeTables);


