
function validar(form){
	if (form.nome.value==""){
		alert ("O campo nome é obrigatório.");
		form.nome.focus();
		return false;
	}
    if (form.email.value==""){
		alert ("O campo e-mail é obrigatório.");
		form.email.focus();
		return false;
	}
	if ((form.email.value.indexOf("@") == -1) || (form.email.value.indexOf(".") == -1)){
		alert ("Digite um endereço de e-mail válido.");
		form.email.focus();
		return false;
	}
	if (form.cidade.value==""){
		alert ("O campo cidade é obrigatório.");
		form.cidade.focus();
		return false;
	}
	if (form.estado.value==""){
		alert ("O campo estado é obrigatório.");
		form.estado.focus();
		return false;
	}
	if (form.fone.value==""){
		alert ("O campo telefone é obrigatório.");
		form.fone.focus();
		return false;
	}
	if (form.departamento.value==""){
		alert ("O campo Falar com é obrigatório.");
		form.departamento.focus();
		return false;
	}
	
	if (form.cliente[0].checked == false && 
	    form.cliente[1].checked == false) {
        alert ("Por favor, marque se você já é cliente Prodama.");
        return false;
    }
	
	if (form.cliente[0].checked == true){
		
	if (form.empresa.value==""){
		alert ("O campo empresa é obrigatório.");
		form.empresa.focus();
		return false;
	}
	}
	if (form.mensagem.value==""){
		alert ("O campo mensagem é obrigatório.");
		form.mensagem.focus();
		return false;
	}
	return true;
}
