// a bug in IE related to element attributes
function hasClass(obj) {
 var result = false;
 if (obj.getAttributeNode("class") != null) {
 result = obj.getAttributeNode("class").value;
 }
 return result;
}

function stripeTable(tableref)
{
 var table = tableref;
 var even = false;
 var evenClass = 'even';
 var oddClass = 'odd';

 var tbodies = table.getElementsByTagName("tbody");

for (var h = 0; h < tbodies.length; h++) {

 // find all the <tr> elements...
 var trs = tbodies[h].getElementsByTagName("tr");

 // ... and iterate through them
 for (var i = 0; i < trs.length; i++) {

 // avoid rows that have a class attribute
 // or backgroundColor style
 if (! hasClass(trs[i]) &&
 ! trs[i].style.backgroundColor) {

 // get all the cells in this row...
 var tds = trs[i].getElementsByTagName("td");

 // and iterate through them...
 for (var j = 0; j < tds.length; j++) {

 var mytd = tds[j];

 // avoid cells that have a class attribute
 // or backgroundColor style
 if (! hasClass(mytd) &&
 ! mytd.style.backgroundColor) {

 mytd.className = even ? evenClass : oddClass;

 }
 }
 }
 // flip from odd to even, or vice-versa
 even = ! even;
 }
 }
}


