///////////////////////////////////////////////////////////////////////////////////////
// Checa consistência do formulário
///////////////////////////////////////////////////////////////////////////////////////
function validaFormContato(formulario)
{	
	if (window.document.formulario.nome.value.length == "")
	{
		window.alert("Por favor, preencha corretamente o campo [ NOME ]");
		formulario.nome.focus();
		return (false);
	}

	if (window.document.formulario.email.value.length == "")
	{
		window.alert("Por favor, preencha corretamente o campo [ E-MAIL ]");
		formulario.email.focus();
		return (false);
	}

	if (window.document.formulario.telefone.value.length == "")
	{
		window.alert("Por favor, preencha corretamente o campo [ TELEFONE ]");
		formulario.telefone.focus();
		return (false);
	}

	if (window.document.formulario.cidade.value.length == "")
	{
		window.alert("Por favor, preencha corretamente o campo [ CIDADE ]");
		formulario.cidade.focus();
		return (false);
	}

	if (window.document.formulario.estado.value == "0")
	{
		window.alert("Por favor, preencha corretamente o campo [ ESTADO ]");
		formulario.estado.focus();
		return (false);
	}

	if (window.document.formulario.modelo.value == "0")
	{
		window.alert("Você esqueceu de especificar a Linha que deseja consultar");
		formulario.modelo.focus();
		return (false);
	}

	if (window.document.formulario.tipo_negocio.value == "0")
	{
		window.alert("Informe o tipo de negócio que você deseja");
		formulario.tipo_negocio.focus();
		return (false);
	}
				
	if (window.document.formulario.mensagem.value.length == "")
	{
		window.alert("Por favor, preencha corretamente o campo [ MENSAGEM ]");
		formulario.mensagem.focus();
		return (false);
	} 
	
	if (window.document.formulario.caption.value != "fmeaqce")
	{
		window.alert("Por favor, preencha o campo de verificação com o texto exato da imagem ao lado.");
		formulario.caption.focus();
		return (false);
			
	}
}


///////////////////////////////////////////////////////////////////////////////////////
// POPUPs produtos
///////////////////////////////////////////////////////////////////////////////////////
function popitup(url)
{
	newwindow = window.open(url,'name','height=400,width=500');
	if (window.focus) 
	{ 
		newwindow.focus()
	}
	return false;
}


///////////////////////////////////////////////////////////////////////////////////////
// POPUPs receitas
///////////////////////////////////////////////////////////////////////////////////////
function receita(url)
{
	newwindow = window.open(url,'name','height=348,width=523');
	if (window.focus) 
	{ 
		newwindow.focus()
	}
	return false;
}


///////////////////////////////////////////////////////////////////////////////////////
// POPUPs Galeria de Fotos
///////////////////////////////////////////////////////////////////////////////////////
function galeria(url)
{
	newwindow = window.open(url,'name','height=388,width=600');
	if (window.focus) 
	{ 
		newwindow.focus()
	}
	return false;
}

function abreSistemaCaldeira(url) 
{
	newwindow = window.open(url,'name','height=499,width=636');
	if (window.focus) 
	{ 
		newwindow.focus()
	}
	return false;
}

function validaFormFicha(formulario)
{	
	if (window.document.formulario.empresa_nome.value.length == "")
	{
		window.alert("Por favor, preencha corretamente o campo [ EMPRESA / NOME]");
		formulario.empresa_nome.focus();
		return (false);
	}

	if (window.document.formulario.nome.value.length == "")
	{
		window.alert("Por favor, preencha corretamente o campo [ NOME]");
		formulario.nome.focus();
		return (false);
	}
	
	if (window.document.formulario.atividade.value.length == "")
	{
		window.alert("Por favor, preencha corretamente o campo [ RAMO DE ATIVIDADE ]");
		formulario.atividade.focus();
		return (false);
	}

	if (window.document.formulario.cnpj.value.length == "")
	{
		window.alert("Por favor, preencha corretamente o campo [ CNPJ / CPF ]");
		formulario.cnpj.focus();
		return (false);
	}

	if (window.document.formulario.rg.value.length == "")
	{
		window.alert("Por favor, preencha corretamente o campo [ I.E. / R.G. ]");
		formulario.rg.focus();
		return (false);
	}
	

	if (window.document.formulario.endereco.value.length == "")
	{
		window.alert("Por favor, preencha corretamente o campo [ ENDEREÇO ]");
		formulario.endereco.focus();
		return (false);
	}


	if (window.document.formulario.bairro.value.length == "")
	{
		window.alert("Por favor, preencha corretamente o campo [ BAIRRO ]");
		formulario.bairro.focus();
		return (false);
	}

	if (window.document.formulario.cidade.value.length == "")
	{
		window.alert("Por favor, preencha corretamente o campo [ CIDADE ]");
		formulario.cidade.focus();
		return (false);
	}


	if (window.document.formulario.estado.value.length == "")
	{
		window.alert("Por favor, preencha corretamente o campo [ ESTADO ]");
		formulario.estado.focus();
		return (false);
	}


	if (window.document.formulario.cep.value.length == "")
	{
		window.alert("Por favor, preencha corretamente o campo [ CEP ]");
		formulario.cep.focus();
		return (false);
	}

	if (window.document.formulario.telefone.value.length == "")
	{
		window.alert("Por favor, preencha corretamente o campo [ TELEFONE ]");
		formulario.telefone.focus();
		return (false);
	}

	if (window.document.formulario.fax.value.length == "")
	{
		window.alert("Por favor, preencha corretamente o campo [ FAX ]");
		formulario.fax.focus();
		return (false);
	}


	if (window.document.formulario.email.value.length == "")
	{
		window.alert("Por favor, preencha corretamente o campo [ E-MAIL ]");
		formulario.email.focus();
		return (false);
	}
	
	if (window.document.formulario.website.value.length == "")
	{
		window.alert("Por favor, preencha corretamente o campo [ WEBSITE ]");
		formulario.website.focus();
		return (false);
	}
}
/*
	if (window.document.formulario.nome.value.length == "")
	{
		window.alert("Por favor, preencha corretamente o campo [ NOME ]");
		formulario.nome.focus();
		return (false);
	}
*/