/**
 * stripes.js
 *
 * @version    1.01
 * @updated    2009-08-05
 * @author     takumi osada <http://groovy-times.com>
 * @copyright  Copyright (c) 2009 GROOVY-TIMES
 * @license    MIT License <http://www.opensource.org/licenses/mit-license.php>
 *
 * @requires   addLoadEvent, addClass
 */

/* -----------------------------------------------------------------------*/
// stripeTables
/* -----------------------------------------------------------------------*/
function stripeTables() {
	if(!document.getElementsByTagName) return false;
	
	var tbody = document.getElementsByTagName('tbody');
	for(var i=0; i<tbody.length; i++) {
		var rows = tbody[i].getElementsByTagName('tr');
		var odd = true;
		for(var j=0; j<rows.length; j++) {
			if(odd == true) {
				addClass(rows[j],'odd');
				odd = false;
			} else {
				addClass(rows[j],'even');
				odd = true;
			}
		}
	}
}


/* -----------------------------------------------------------------------*/
// addLoadEvent
/* -----------------------------------------------------------------------*/
addLoadEvent(stripeTables);