<!--

function mascara(o,f){
    v_obj=o
    v_fun=f
    setTimeout("execmascara()",1)
}

function numero(v){
    v=v.replace(/\D/g,"")                    //Remove tudo o que não é dígito
    return v
}

function telefone(v){
    v=v.replace(/\D/g,"")                    //Remove tudo o que não é dígito
    v=v.replace(/(\d{4})(\d)/,"$1-$2")       //Coloca um ponto entre o terceiro e o quarto dígitos
    return v
}

function execmascara(){
    v_obj.value=v_fun(v_obj.value)
}

function soNumeros(v){
    return v.replace(/\D/g,"")
}



function jump(campo,tamanho,campo2) {
	with (document.Form)
	{
		if (campo.value.length == tamanho){
			eval(campo2).focus();
		}
	
	}
}




function validar()
{	

	msgErros = '';
	cntErros = 0;
	with (document.Form)
	{


		
		
		if (isNaN(DDD.value)) {
			msgErros += "-> Informe o DDD\n";
			cntErros++;
		}
		
		if (DDD.value.length < 2)
		{
			msgErros += "-> Informe o DDD\n";
			cntErros++;
		}
		
		if (Telefone.value.length < 8)
		{
			msgErros += "-> Informe o telefone\n";
			cntErros++;
		}
		

		
		if (cntErros > 0)
		{
			alert("Você precisa preencher corretamente o(s) campo(s)\n abaixo para poder enviar o formulário:\n" + msgErros);
		}
		else
		{

				action = "az2mails.asp";
				submit();

		}
	}

}


function validarContato()
{
	msgErros = '';
	cntErros = 0;
	with (document.formContato)
	{
		if (Nome.value.length < 3)
		{
			msgErros += "-> Nome\n";
			cntErros++;
		}
		
			
		if (Endereco.value.length < 5)
		{
			msgErros += "-> Endereço\n";
			cntErros++;
		}
		
		
		
		if (Cidade.value.length < 3)
		{
			msgErros += "-> Cidade\n";
			cntErros++;
		}
		
		
		
		if (UF.value.length < 2)
		{
			msgErros += "-> UF\n";
			cntErros++;
		}
		
	
		if (Telefone.value.length < 6)
		{
			msgErros += "-> Fone\n";
			cntErros++;
		}
		
		
		if (Email.value.length < 6)
		{
			msgErros += "-> Email\n";
			cntErros++;
		}
		else
		{
			if (Email.value.indexOf('@',0)==-1 ||
				Email.value.indexOf('@',0)== 0 ||
				Email.value.indexOf('.',0)==-1)
      	{
            msgErros += "-> Email (é inválido)\n";
				cntErros++;
      	}
		}
		
		if (Mensagem.value.length < 5)
		{
			msgErros += "-> Mensagem\n";
			cntErros++;
		}
	
		if (cntErros > 0)
		{
			alert("Você precisa preencher corretamente o(s) campo(s)\n abaixo para poder enviar o formulário:\n" + msgErros);
		}
		else
		{
			if (confirm("Você está de acordo com as informações contidas no formulário?"))
			{
				submit();
			}
		}
	}

}


//-->
