function alternateRow(id, property, val1, val2) {
	/*
		Alterna atributos de uma TR, baseado no id da table e nos parâmetros passados 
		Para funcionar é necessário que as tags possuam o atributo "alternate":
			"new" = aplica um novo valor
			"span" = aplica o valor anterior novamente
	*/
	var table = document.getElementById(id);
	var lastChange = new String();
	
	if (lastChange == "") lastChange = val1;
	
	for (i = 0; i < table.rows.length; i++) {
		var row = table.rows[i];
		if (row.getAttribute("alternate") != null) {
			if (row.getAttribute("alternate") == "new")
				lastChange = (lastChange == val2) ? val1 : val2;
			cmd = "row.$property = '$value'";
			cmd = cmd.replace("$property", property);
			cmd = cmd.replace("$value", lastChange);
			
			eval(cmd);
		}
	}
}

