function puxaCont(qString,pagina,local) {
	qString 			= (qString)?qString:'rnd=' + Math.random();
	var ajax 			= new sack( pagina );
	ajax.element		= local; 
	ajax.onError		= function(){ this.elementObj.innerHTML = this.response; };
	ajax.onLoading 		= function(){ this.elementObj.innerHTML = "Buscando..." };
	ajax.onLoaded 		= function(){ this.elementObj.innerHTML = this.response; };
	ajax.onInteractive	= function(){ this.elementObj.innerHTML = "Carregando..." }; 
	ajax.onCompletion	= function(){ this.elementObj.innerHTML = this.response; };
	ajax.runAJAX( qString );
}

function abrirPag(estado){
	puxaCont(0,"detalhes.php?estado=" + estado,"detalhesRepre");
}

// JavaScript Document

function troca(){
	document.getElementById("btn1").style.background = "url(imagens/btn1_hover.jpg) no-repeat";
}

function troca2(){
	document.getElementById("btn1").style.background = "url(imagens/btn1.jpg) no-repeat";
}

function troca3(){
	document.getElementById("btn2").style.background = "url(imagens/btn1_hover.jpg) no-repeat";
}

function troca4(){
	document.getElementById("btn2").style.background = "url(imagens/btn1.jpg) no-repeat";
}

function limpaNome(){
	if(document.getElementById("nome").value == "Seu nome...")
		document.getElementById("nome").value = "";
}

function retornaNome(){
	if(document.getElementById("nome").value == "")
		document.getElementById("nome").value = "Seu nome...";
}

function limpaEmail(){
	if(document.getElementById("email").value == "Seu email...")
		document.getElementById("email").value = "";
}

function retornaEmail(){
	if(document.getElementById("email").value == "")
		document.getElementById("email").value = "Seu email...";
}

function limpaNomeEsp(){
	if(document.getElementById("nome").value == "Su nombre...")
		document.getElementById("nome").value = "";
}

function retornaNomeEsp(){
	if(document.getElementById("nome").value == "")
		document.getElementById("nome").value = "Su nombre...";
}

function limpaEmailEsp(){
	if(document.getElementById("email").value == "Su e-mail...")
		document.getElementById("email").value = "";
}

function retornaEmailEsp(){
	if(document.getElementById("email").value == "")
		document.getElementById("email").value = "Su e-mail...";
}

function validaNews(){
	
	if(document.getElementById("nome").value == "" || document.getElementById("nome").value == "Seu nome...")
		alert("Preencha o campo nome!");
	else
	{
	if(document.getElementById("email").value == "" || document.getElementById("email").value == "Seu email...")
		alert("Preencha o campo email!");
		else
	return true;
	}
	return false;
}

function formLogin(){
   d = document.form_login;
   
   if (d.email_login.value == ""){
			 alert("O E-mail deve ser preenchido!");
			 d.email_login.focus();
			 return false;
   }
   if (d.senha_login.value == ""){
			 alert("A Senha deve ser preenchida!");
			 d.senha_login.focus();
			 return false;
   }
	else
		return true;	
	

}

/* Validador email: */

function validaEmail(elemento){
 		var str = document.getElementById(elemento).value;
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		
		if (str.indexOf(at)==-1){
		   alert("Email Inválido!")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Email Inválido!")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		   alert("Email Inválido!")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		   alert("Email Inválido!")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		   alert("Email Inválido!")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		   alert("Email Inválido!")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		   alert("Email Inválido!")
		    return false
		 }

 		 return true					
}
function echeck() {

 		var str = document.getElementById("email").value;
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		
		if (str.indexOf(at)==-1){
		   alert("Email Inválido!")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Email Inválido!")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		   alert("Email Inválido!")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		   alert("Email Inválido!")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		   alert("Email Inválido!")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		   alert("Email Inválido!")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		   alert("Email Inválido!")
		    return false
		 }

 		 return true					
}

function carregaBusca(endereco)
{
	var categoria = endereco + document.getElementById("Scategoria").value;
	window.open(categoria, "_parent");
}

function validaBusca()
{
	if(document.getElementById("Scategoria").value == "0")
	{
		alert("Selecione uma categoria");
		return false;
	}else
	{
		if(document.getElementById("produto").value == "0")
		{
			alert("Selecione o produto");
			return false;
		}else
			return true;
	}
}

function validaBuscaNome()
{
   d = document.buscaNome;
   if (d.nome.value == ""){
			 alert("O campo " + d.nome.name + " deve ser preenchido!");
			 d.nome.focus();
			 return false;
   }
	else
		return true;	
	
}

function validaBuscaCategoria()
{
   d = document.buscaCategoria;
   if (d.categoriaBusca.value == "0"){
			 alert("Selecione uma categoria!");
			 d.categoriaBusca.focus();
			 return false;
   }
	else
		return true;	
	
}

function validaBuscaCodigo()
{
   d = document.buscaCodigo;
   if (d.codigo.value == ""){
			 alert("O campo " + d.codigo.name + " deve ser preenchido!");
			 d.codigo.focus();
			 return false;
   }
	else
		return true;	
	
}

function validaBuscaNome()
{
   d = document.buscaNome;
   if (d.nome.value == ""){
			 alert("O campo " + d.nome.name + " deve ser preenchido!");
			 d.nome.focus();
			 return false;
   }
	else
		return true;	
	
}

function validaLogin(){
	d = document.loginForm;
	if (d.login.value == "" || d.senha.value == "")
	{
		alert("Preencha o login e senha!");
		return false;	
	}
	else
		return true;
}

function funcSelectIdioma(){
			
	if(document.getElementById("selectIdioma").value == "portugues")
		document.getElementById("login-fundo").style.background = " url(imagens/brasil_g.jpg) 10px no-repeat";		

	if(document.getElementById("selectIdioma").value == "espanhol")
		document.getElementById("login-fundo").style.background = " url(imagens/espanha_g.jpg) 10px no-repeat";		
}

function validaProdutos(){
	d = document.inserirProduto;
	if (d.inserirCategoria.value == "0")
	{
		alert("Selecione uma categoria!");
		return false;	
	}
	if (d.inserirCodigo.value == "")
	{
		alert("Preencha um código para o produto!");
		return false;	
	}
	if (d.inserirNome.value == "")
	{
		alert("Preencha o nome do produto!");
		return false;	
	}
	if (d.inserirDescricao.value == "")
	{
		alert("Preencha uma descrição para o produto!");
		return false;	
	}
	if (d.arquivo.value == "")
	{
		alert("Anexe um PDF para o produto!");
		return false;	
	}
	else
		return true;
}

function validaMsg(){
	d = document.mensagem;
	if (d.data.value == "")
	{
		alert("Preencha uma data para a mensagem!");
		d.data.focus();
		return false;	
	}
	if (d.mensagem.value == "")
	{
		alert("Preencha a mensagem!");
		d.mensagem.focus();
		return false;	
	}
	return true;	
}

function validaNoticias(){
	d = document.inserirProduto;
	if (d.data.value == "")
	{
		alert("Preencha uma data para a noticia!");
		return false;	
	}
	if (d.titulo.value == "")
	{
		alert("Preencha um titulo para a noticia!");
		return false;	
	}
	if (d.conteudo.value == "")
	{
		alert("Preencha um conteudo para a noticia!");
		return false;	
	}
	else
		return true;
}

function SomenteNumero(e){
    var tecla=(window.event)?event.keyCode:e.which;
    if((tecla > 47 && tecla < 58)) return true;
    else{
    if (tecla != 8) return false;
    else return true;
    }
}

function verFile(){
	document.getElementById("file").style.display = "block";
	document.getElementById("btnTrocar").style.display = "none";
}

function verFileImg(){
	document.getElementById("file").style.display = "block";
	document.getElementById("btnTrocar").style.display = "none";
	document.getElementById("imagem").style.display = "none";
}

function abreDiv(elemento){
	if(document.getElementById(elemento).style.display == "none")
	{
		document.getElementById(elemento).style.display="block";
	
		for(i = 0; i < 28; i++)
		{
			if(elemento != "duvida"+(i+1))
			{
				if(document.getElementById("duvida"+(i+1)).style.display == "block")
					document.getElementById("duvida"+(i+1)).style.display = "none";
			}
		}
		
	}
	else
	{
		if(document.getElementById(elemento).style.display == "block")
			document.getElementById(elemento).style.display="none";
	}
}

function calculos()
{
	var sv = document.f1.btnesp.value*  document.f1.btnepu.value
	var toteu = sv / document.f1.btnsv.value
	document.f1.btneu.value = toteu
}

function limpar()
{
	document.f1.btnesp.value = ""
	document.f1.btnepu.value = ""
	document.f1.btnsv.value = ""
	document.f1.btneu.value = ""
}


function calculo()
{
	document.f1.vlipi.value = document.f1.preco.value * 0.05
	document.f1.tot_ipi.value = Number(document.f1.preco.value) + Number(document.f1.vlipi.value)
	document.f1.vlipi1.value = document.f1.preco1.value * 0.1
	document.f1.tot_ipi1.value = Number(document.f1.preco1.value) + Number(document.f1.vlipi1.value)
	document.f1.rendt.value = (document.f1.solt.value * 10)/(document.f1.espseca.value)
	document.f1.rendp.value = (document.f1.rendt.value)-((document.f1.rendt.value)*(document.f1.perda.value/100))
	document.f1.qtdt.value = ((document.f1.area.value / document.f1.rendp.value)/document.f1.embt.value*document.f1.demaos.value)
	document.f1.qtds.value = ((document.f1.qtdt.value * document.f1.embt.value * (document.f1.dils.value/100))/document.f1.embs.value)
	var precolit = ((document.f1.tot_ipi1.value/document.f1.embs.value)*(document.f1.embt.value*(document.f1.dils.value/100)))
	var precolit1 = precolit+Number(document.f1.tot_ipi.value)
	var precolit2 = precolit1/Number(document.f1.embt.value)
	var precolit3 = precolit2/Number(document.f1.rendp.value)
	document.f1.cusm2.value = precolit3*Number(document.f1.demaos.value)
	document.f1.custoar.value = document.f1.cusm2.value * document.f1.area.value 
}


function calculo2()
{
	document.f1.vlipi.value = document.f1.preco.value * 0.1
	document.f1.tot_ipi.value = Number(document.f1.preco.value) + Number(document.f1.vlipi.value)
	document.f1.vlipi1.value = document.f1.preco1.value * 0.1
	document.f1.tot_ipi1.value = Number(document.f1.preco1.value) + Number(document.f1.vlipi1.value)
	document.f1.rendt.value = (document.f1.solt.value * 10)/(document.f1.espseca.value)
	document.f1.rendp.value = (document.f1.rendt.value)-((document.f1.rendt.value)*(document.f1.perda.value/100))
	document.f1.qtdt.value = ((document.f1.area.value / document.f1.rendp.value)/document.f1.embt.value*document.f1.demaos.value)
	document.f1.qtds.value = ((document.f1.qtdt.value * document.f1.embt.value * (document.f1.dils.value/100))/document.f1.embs.value)
	var precolit = ((document.f1.tot_ipi1.value/document.f1.embs.value)*(document.f1.embt.value*(document.f1.dils.value/100)))
	var precolit1 = precolit+Number(document.f1.tot_ipi.value)
	var precolit2 = precolit1/Number(document.f1.embt.value)
	var precolit3 = precolit2/Number(document.f1.rendp.value)
	document.f1.cusm2.value = precolit3*Number(document.f1.demaos.value)
	document.f1.custoar.value = document.f1.cusm2.value * document.f1.area.value 
}

function calculo3()
{
	var svvalor = document.f1.sv.value* document.f1.constante.value
	var tot = svvalor / document.f1.esp.value
	document.f1.total.value = tot
	var tot1 = document.f1.emb.value* document.f1.total.value
	document.f1.totemb.value = tot1
	var totund = document.f1.area.value/ document.f1.totemb.value
	document.f1.embala.value = totund
}

function validaContato(){
	d = document.form_contato;
	if (d.nome.value == "")
	{
		alert("Preencha o campo Nome!");
		d.nome.focus();
		return false;	
	}
	if (d.ddd.value == "")
	{
		alert("Preencha o campo DDD!");
		d.ddd.focus();
		return false;	
	}
		if (d.tel.value == "")
	{
		alert("Preencha o campo Telefone!");
		d.tel.focus();
		return false;	
	}
		var str = d.email_contato.value;
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		
		if (str.indexOf(at)==-1){
		   alert("Email Inválido!")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Email Inválido!")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		   alert("Email Inválido!")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		   alert("Email Inválido!")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		   alert("Email Inválido!")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		   alert("Email Inválido!")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		   alert("Email Inválido!")
		    return false
		 }
		 
	if (d.empresa.value == "")
	{
		alert("Preencha o campo Empresa!");
		d.empresa.focus();
		return false;	
	}
	
	if (d.departamento.value == "0")
	{
		alert("Selecione um dos Departamentos!");
		d.departamento.focus();
		return false;	
	}
	
	if (d.assunto.value == "")
	{
		alert("Preencha o campo Assunto!");
		d.assunto.focus();
		return false;	
	}

	if (d.mensagem.value == "")
	{
		alert("Preencha o campo Mensagem!");
		d.mensagem.focus();
		return false;	
	}

		 
	else
		return true;
	
}

function mudaCor(atual, total){
  fadeIn('ampliar', 0.2);
  document.getElementById("ampliar").style.background = document.getElementById(atual).style.background;
  for(i = 1; i < total; i++){
	  cor = "cor" + i;
	  voltaCor(cor);
	  apagaTexto(cor);
	  }
  
  document.getElementById(atual).style.border = "6px #fff solid";	
  document.getElementById(atual).style.width = "88px";	
  document.getElementById(atual).style.height = "38px";	
 
  document.getElementById(atual+"-texto").style.display = "block";	
}

function mudaCorBranco(atual, total){
  fadeIn('ampliar', 0.2);
  document.getElementById("ampliar").style.background = document.getElementById(atual).style.background;
  for(i = 1; i < total; i++){
	  cor = "cor" + i;
	  voltaCor(cor);
	  apagaTexto(cor);
	  }
  
  document.getElementById(atual).style.border = "1px #ccc solid";	
  document.getElementById(atual).style.width = "88px";	
  document.getElementById(atual).style.height = "38px";	
  document.getElementById(atual).style.margin = "5px 5px 10px 5px";	
 
  document.getElementById(atual+"-texto").style.display = "block";	
}

function voltaCor(cor){
  document.getElementById(cor).style.border = "0px";	
  document.getElementById(cor).style.width = "100px";	
  document.getElementById(cor).style.height = "50px";
}

function apagaTexto(cor){
	document.getElementById(cor + "-texto").style.display = "none";			
}


function fadeIn(id, time) {
  target = document.getElementById(id);
  alpha = 0;
  timer = (time*1000)/50;
  var i = setInterval(
	  function() {
		  if (alpha >= 100)
			  clearInterval(i);
		  setAlpha(target, alpha);
		  alpha += 2;
	  }, timer);
}

function setAlpha(target, alpha) {
  target.style.filter = "alpha(opacity="+ alpha +")";
  target.style.opacity = alpha/100;
}

function validaOrcamento(){
	d = document.form_orcamento;
	if (d.razao.value == "")
	{
		alert("Preencha o campo Razão Social!");
		d.razao.focus();
		return false;	
	}
	if (d.nomef.value == "")
	{
		alert("Preencha o campo Nome Fantasia!");
		d.nomef.focus();
		return false;	
	}
		if (d.conheceu.value == "")
	{
		alert("Preencha o campo Como Conheceu!");
		d.conheceu.focus();
		return false;	
	}
	
		if (d.endereco.value == "")
	{
		alert("Preencha o campo Endereço!");
		d.endereco.focus();
		return false;	
	}
	
		if (d.numero.value == "")
	{
		alert("Preencha o campo Numero!");
		d.numero.focus();
		return false;	
	}
	
		if (d.bairro.value == "")
	{
		alert("Preencha o campo Bairro!");
		d.bairro.focus();
		return false;	
	}
	
		if (d.cep.value == "")
	{
		alert("Preencha o campo CEP!");
		d.cep.focus();
		return false;	
	}
	
		if (d.cep2.value == "")
	{
		alert("Preencha o campo CEP!");
		d.cep2.focus();
		return false;	
	}
	
		if (d.cp.value == "")
	{
		alert("Preencha o campo Caixa Postal!");
		d.cp.focus();
		return false;	
	}
	
		if (d.cidade.value == "")
	{
		alert("Preencha o campo Cidade!");
		d.cidade.focus();
		return false;	
	}
	
		if (d.estado.value == "")
	{
		alert("Preencha o campo Estado!");
		d.estado.focus();
		return false;	
	}
	
		if (d.cnpj.value == "")
	{
		alert("Preencha o campo CNPJ!");
		d.cnpj.focus();
		return false;	
	}
		
		if (d.ie.value == "")
	{
		alert("Preencha o campo I.E.!");
		d.ie.focus();
		return false;	
	}
	
		if (d.ddd.value == "")
	{
		alert("Preencha o campo DDD!");
		d.ddd.focus();
		return false;	
	}
		if (d.tel.value == "")
	{
		alert("Preencha o campo Telefone!");
		d.tel.focus();
		return false;	
	}
	
		if (d.dddcel.value == "")
	{
		alert("Preencha o campo DDD do Celular!");
		d.dddcel.focus();
		return false;	
	}
		if (d.celular.value == "")
	{
		alert("Preencha o campo Celular!");
		d.cel.focus();
		return false;	
	}
	
		if (d.comprador.value == "")
	{
		alert("Preencha o campo Comprador!");
		d.comprador.focus();
		return false;	
	}

		var str = d.email_orcamento.value;
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		
		if (str.indexOf(at)==-1){
		   alert("Email Inválido!")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Email Inválido!")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		   alert("Email Inválido!")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		   alert("Email Inválido!")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		   alert("Email Inválido!")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		   alert("Email Inválido!")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		   alert("Email Inválido!")
		    return false
		 }
		 
	if (d.ramo.value == "")
	{
		alert("Preencha o campo Ramo de Atividade!");
		d.ramo.focus();
		return false;	
	}
	
	if (d.superficie.value == "0")
	{
		alert("Preencha o campo Tipo de Superfície!");
		d.superficie.focus();
		return false;	
	}
	
	if (d.tamanho.value == "")
	{
		alert("Preencha o campo Tamanho da Área!");
		d.tamanho.focus();
		return false;	
	}

	if (d.preparacao.value == "")
	{
		alert("Preencha o campo Preparação que sera Realizada!");
		d.preparacao.focus();
		return false;	
	}
	
	if (d.area.value == "")
	{
		alert("Preencha o campo Área!");
		d.area.focus();
		return false;	
	}

	if (d.produtoaplicado.value == "")
	{
		alert("Preencha o campo Produto Aplicado!");
		d.produtoaplicado.focus();
		return false;	
	}
	
	if (d.altatemperatura.value == "")
	{
		alert("Preencha o campo Alta Temperatura!");
		d.altatemperatura.focus();
		return false;	
	}
	
	if (d.produtoaplicado.value == "")
	{
		alert("Preencha o campo Equipamento utilizado na aplicação!");
		d.produtoaplicado.focus();
		return false;	
	}

	if (d.agressividade.value == "")
	{
		alert("Preencha o campo Agressividade Química!");
		d.agressividade.focus();
		return false;	
	}
	
	if (d.trafego.value == "")
	{
		alert("Preencha o campo Tráfego!");
		d.trafego.focus();
		return false;	
	}

	
	else
		return true;
	
}

function abreDivs(elemento){
	document.getElementById(elemento).style.display="block";
}

function fechaDivs(elemento){
	document.getElementById(elemento).style.display="none";	
}

function escondeTodas(){
	fechaDivs('div1');
	fechaDivs('div2');
	fechaDivs('div3');
	fechaDivs('div4');
	fechaDivs('div5');
}

function areaRestrita(){
	window.open("representantes.php","_parent");	
}

function selecionaCores(n){
	window.open("cores.php?id=" + n + "&#cores","_parent");
}

function validaSenha(){
	d = document.formSenha;
	if (d.senha.value == "")
	{
		alert("Preencha o campo 'Senha atual'!");
		d.senha.focus();
		return false;	
	}	
	if (d.novaSenha.value == "")
	{
		alert("Preencha o campo 'Nova Senha'!");
		d.novaSenha.focus();
		return false;	
	}	
	if (d.novaSenha2.value == "")
	{
		alert("Preencha o campo 'Repita Senha'!");
		d.novaSenha2.focus();
		return false;	
	}
	if (d.novaSenha.value.length < 5)
	{
		alert("Sua Senha deve ter mais de 5 caracteres!");
		d.novaSenha.focus();
		return false;	
	}	
	if (d.novaSenha.value != d.novaSenha2.value)
	{
		alert("As senhas não são iguais!");
		d.novaSenha.value = "";
		d.novaSenha2.value = "";
		d.novaSenha.focus();
		return false;	
	}
	return true;
}

function validaRepre(){
	d = document.form_representante;
	if (d.mensagem.value == "")
	{
		alert("Digite sua mensagem!");
		d.mensagem.focus();
		return false;	
	}
	return true;
}

function validaRepresentantes(){
	d = document.inserirRepresentante;
	if (d.nome.value == "")
	{
		alert("Preencha o campo 'Nome'!");
		d.nome.focus();
		return false;	
	}	
	if (d.email.value == "")
	{
		alert("Preencha o campo 'E-mail'!");
		d.email.focus();
		return false;	
	}	
	if (d.senha.value == "")
	{
		alert("Preencha o campo 'Senha'!");
		d.senha.focus();
		return false;	
	}	
	if (d.estado.value == "")
	{
		alert("Preencha o campo 'Estado'!");
		d.estado.focus();
		return false;	
	}	
	if (d.cidade.value == "")
	{
		alert("Preencha o campo 'Cidade'!");
		d.cidade.focus();
		return false;	
	}	
	if (d.telefone.value == "")
	{
		alert("Preencha o campo 'Telefone'!");
		d.telefone.focus();
		return false;	
	}	
	return true;
}