function transitarColor(id) {
	var yo = document.getElementById(id);
	var _n = parseInt(yo.getAttribute("cambiandoColor"));
	var n = parseInt(yo.getAttribute("vamosPor"));
	var vamosPor = n + _n;
	document.getElementById(id).setAttribute("vamosPor", vamosPor);
	if (n > 0 && n < fondos.length) {
		yo.style.backgroundColor = fondos[n];
		yo.style.color = fondos[(fondos.length) - n];
		var linea = "transitarColor('" + id + "')";
		setTimeout(linea, 30);
	}
	else	{
		document.getElementById(id).setAttribute("cambiandoColor", "0");
	}		
}

function cambiaColor(id) {
	var yo = document.getElementById(id);
	var estado = yo.getAttribute("cambiandoColor");
	yo.setAttribute("cambiandoColor", "-1");
	if (estado == "0" || estado == null)
		yo.setAttribute("vamosPor", (fondos.length - 1).toString());
	transitarColor(id);
}

function recuperaColor(id)	{
	var yo = document.getElementById(id);
	var estado = yo.getAttribute("cambiandoColor");
	yo.setAttribute("cambiandoColor", "1");
	yo.setAttribute("vamosPor", "1");
	transitarColor(id);
}

