function applyTableStyle() {

    var tables = document.getElementsByTagName('table');
    for (i=0; i<tables.length; i++) {
        
        this_tbl = tables[i];
        
        if (thead = this_tbl.getElementsByTagName('thead')[0]) {
            if (firstrow = thead.getElementsByTagName('tr')[0]) {
               if (firstth = firstrow.getElementsByTagName('th')[0]) {
                  firstth.style.border = 'none';
               }
            }
        }
        
        tbody = this_tbl.getElementsByTagName('tbody')[0];
        rows = tbody.getElementsByTagName('tr');
        
        for (j=0; j<rows.length; j++) {
			add_class = (rows[j].className != '') ? ' ' : '';
			add_class += (j%2 == 0)? 'r_odd' : 'r_pair';
			rows[j].className += add_class;
            //var td = rows[j].getElementsByTagName('td')[0];
            //td.setAttribute('nowrap', "nowrap");
        }
        
        tfoot = this_tbl.getElementsByTagName('tfoot')[0];
        
        if (tfoot) {
            lastrow = tfoot.getElementsByTagName('tr')[0];
            lastrow.className = 'r_final';
        }
        
    }


}

WindowOnload(applyTableStyle);