addEvent(window, "onload", alternateTableRows);
addEvent(window, "onload", initAccordian);


function initAccordian() {
	new Accordian('basic-accordian',5,'header_highlight');
}

function alternateTableRows() {
	var tables = getElementsByClass('', document, 'table');
	
	// jede zweite Zeile in TBODY
	for(var i in tables) {
		var tbody = tables[i].getElementsByTagName('tbody');
		var trows = tbody[0].getElementsByTagName('tr');
		
		for(var j in trows) {
			if(j % 2 == 0) trows[j].className = "odd";
			else trows[j].className = "even";
		}
	}
	
	// jede zweite Zeile in THEAD mit der Klasse 'thead-tworows'
	var theadtworows = getElementsByClass('thead-tworows', document, 'thead');
	
	for(var i in theadtworows) {
		var trows_tmp = theadtworows[i].getElementsByTagName('tr');
		var trows = new Array();
		
		// nur wenn es nicht die Kopfzeile TH ist
		for(var j in trows_tmp) {
			if(trows_tmp[j].getElementsByTagName && trows_tmp[j].getElementsByTagName('td').length > 0) {
				trows.push(trows_tmp[j]);
			}
		}
		
		for(var j in trows) {
			if(j % 2 == 0) trows[j].className = "odd";
			else trows[j].className = "even";
		}
	}
}
