function muda_cor (num_colunas, linha, cor)
{
	if (num_colunas <= 0)
	{
		alert ("Erro de programação.\nO número de células deve ser maior que zero.");
	}
	else
	{
		if (linha < 0)
		{
			alert("Erro de programação.\nO número da linha deve ser maior ou igual a zero.")
		}
		else
		{
			if (num_colunas == 1)
			{
				if (typeof(cel0) == "undefined")
				{
					alert("Erro de programação.\nObjeto não encontrado");
				}
				else
				{
					if (typeof(cel0[linha]) == "undefined")
					{
						cel0.bgColor = cor;
						cel0.style.cursor = "hand";
					}
					else
					{
						cel0[linha].bgColor = cor;
						cel0[linha].style.cursor = "hand";
					}
				}
			}
			else
			{
				erro = false;
				for (i=0; i<num_colunas; i++)
				{
					celula = document.all("cel" + i);
					if (typeof(celula) == "undefined")
					{
						erro = true
					}
				}
				if (erro == true)
				{
					alert("Erro de programação.\nObjeto não encontrado");
				}
				else
				{
					if (typeof(cel0[linha]) == "undefined")
					{
						for (i=0; i<num_colunas; i++)
						{
							celula = document.all("cel" + i);
							celula.bgColor = cor;
							celula.style.cursor = "hand";
						}
					}
					else
					{
						for (i=0; i<num_colunas; i++)
						{
							celula = document.all("cel" + i);
							celula[linha].bgColor = cor;
							celula[linha].style.cursor = "hand";
						}
					}
				}
			}
		}
	}
}

function muda_top(i)
{
	celtop[i].bgColor = "#774600";
	celtop[i].style.cursor = "hand";
}

function volta_top(i)
{
	celtop[i].bgColor = "#A35F00";
}