// Temporary JavaScript Document for Generic Table

function addGenericTableListeners(){

	$$("table.generic-table tr").each(function (el, trindex) { 

		if (trindex == 0) { return; }; // Skip the headers

		var tdlist = el.getChildren("td");

		tdlist.each( function(el ) {

			el.addEvent('mouseover', function(e) {
				tdlist.each(function (e) {
					e.setStyle( 'background-color', '#E7B5AE' );
				});
			});

			el.addEvent('mouseout', function(e) {
				tdlist.each(function (e, tdindex) {
					var color = ( tdindex % 2 == 0 ? "#EDEDE1" : "#E4E4D8" );
					e.setStyle( 'background-color', color );
				});
			});

		});

	});
}

window.addEvent('domready', function() { addGenericTableListeners(); });
