// JavaScript Document

// Written by Travis Anderson
// To use: simply drop this .js into the site and call the function 
// using <body onLoad="twoColors('tableClassName')">

// ALTERNATE COLORS WITH EVERY OTHER ROW - .even and .odd

function twoColors(id) { 
    if(document.getElementsByTagName)
        var table = document.getElementById(id);
        if (table != null) {
            var rows = table.getElementsByTagName("tr");  

            for(i=0; i <rows.length; i++) {
                // tag the rows with classes so i can style easily
                if(i % 2 == 0) {
                    rows[i].className = "even";
                } else {
                    rows[i].className = "odd";
                } 
        }
    } 
}