/*
	JavaScript
	@creator Boris Biserov Delev
	@finished 15.12.2006
	@thanks Tihomir Georgiev
*/

// Observ event and add functions to elements
Event.observe( window, 'load', 
	function() {
		colourTables();
	}
)

// Function to add class for tables
function colourTables() {
	$$('table tbody').each(function(tbody) {
		var trs = tbody.getElementsByTagName('tr');
		for(var i = 0; i < trs.length; i++)
		{
			if(i%2)
				$(trs[i]).addClassName('alternate-row');
		
			var tds = trs[i].getElementsByTagName('td');
			for(var j=0; j<tds.length; j++)
			{
				if(j%2)
					$(tds[j]).addClassName('alternate-column');
			}
		}
	});
}
