/*
Eric Sadit Tellez Avila

DOM3K related issues related with Styles, and that not fill in any other 
category

*/

/*
function DOM3K_BackgroundRowColors(idTag, listofcolors)

Set background colors to rows elements in |idTag| element (it can contain several tables and each table will me modified).
|listofcolors| are the list of colors to be used

*/
function DOM3K_BackgroundRowColors(idTag, listofcolors)
{
    var elem = DOM3K_getElement(idTag);
    var rows = elem.getElementsByTagName('tr');
    var i;
    for (i = 0; i < rows.length; i++) {
	try {
	    rows.item(i).style.backgroundColor = listofcolors[i % listofcolors.length];
	} catch(e) {
	}
    }
}

/*
function DOM3K_BackgroundColumnColors(idTag, listofcolors)

Set background colors to td elements in the |idTag| element (it can contain several tables and each table will me modified).
|listofcolors| are the list of colors to be used

*/
function DOM3K_BackgroundColumnColors(idTag, listofcolors)
{
    var elem = DOM3K_getElement(idTag);
    var rows = elem.getElementsByTagName('td');
    var i;
    for (i = 0; i < rows.length; i++) {
	try {
	    rows.item(i).style.backgroundColor = listofcolors[i % listofcolors.length];
	} catch(e) {
	}
    }
}
