// Alertas (mensagens) /////////////////////////////
function alerta(msg, obj, foco, topo)
{
	alert(msg);
	if (!foco)
		obj.focus();
	if (topo)
		document.location = '#' + topo;
	return false;
}
////////////////////////////////////////////////////

// Confere valor padrão do campo ///////////////////
function confValorCampo(campo, valorpadrao)
{
	if (document.getElementById(campo).value == valorpadrao)
	{
		document.getElementById(campo).value = '';
	}
	else
	if (document.getElementById(campo).value == '')
	{
		document.getElementById(campo).value = valorpadrao;
	}
}
////////////////////////////////////////////////////

// Contato /////////////////////////////////////////
function enviarContato()
{
	with(document.contato)
	{
		if (strNome.value == "")
		{
			return alerta("Digite o seu nome.", strNome);
		}
		else
		if (strEmail.value == "")
		{
			return alerta("Digite o seu e-mail.", strEmail);
		}
		else
		if (strEmail.value.indexOf('@') < 1 || strEmail.value.indexOf('.') < 1)
		{
			return alerta("Digite um e-mail válido.", strEmail);
		}
		else
		if (strCidade.value == "")
		{
			return alerta("Digite a sua cidade.", strCidade);
		}
		else
		if (strEstado.value == "")
		{
			return alerta("Selecione o seu estado.", strEstado, "N");
		}
		else
		if (strMensagem.value == "")
		{
			return alerta("Digite a mensagem.", strMensagem);
		}
		else
		{
			return true;
		}
	}
}
