
function retira_acentos(idcampo,palavra) { 
com_acento = "áàãâäéèêëíìîïóòõôöúùûüçÁÀÃÂÄÉÈÊËÍÌÎÏÓÒÕÖÔÚÙÛÜÇ´~`^'"; 
sem_acento = "aaaaaeeeeiiiiooooouuuucAAAAAEEEEIIIIOOOOOUUUUC"; 
nova=""; 
for(i=0;i<palavra.length;i++) { 
if (com_acento.search(palavra.substr(i,1))>=0) { 
nova+=sem_acento.substr(com_acento.search(palavra.substr(i,1)),1); 
} 
else { 
nova+=palavra.substr(i,1); 
} 
} 
document.getElementById(idcampo).value = nova;
} 

function carrega_cidades(estado){
ajaxGo({url: "carrega_cidade.asp?uf="+estado, elem_return: document.getElementById("frm_cidade"), loading: "Carregando"});
	}
	
function carregaLink(linke,div){
ajaxGo({url: linke, elem_return: document.getElementById(div), loading: "<br><br><div id=carregandopaginas><img src=tiny_red.gif border=0><br><br>Carregando</div><br><br>"});
	}

function checkMail(mail){
        var er = new RegExp(/^[A-Za-z0-9_\-\.]+@[A-Za-z0-9_\-\.]{2,}\.[A-Za-z0-9]{2,}(\.[A-Za-z0-9])?/);
        if(typeof(mail) == "string"){
                if(er.test(mail)){ return true; }
        }else if(typeof(mail) == "object"){
                if(er.test(mail.value)){ 
                                        return true; 
                                }
        }else{
                return false;
                }
}


function mudarclass(idelemento){
document.getElementById(idelemento).setAttribute("class", "FORMULARIO2");
}
function mudarclass2(idelemento){
document.getElementById(idelemento).setAttribute("class", "FORMULARIO");
}


function envianewsletter(){
	
	if (document.getElementById("nomenewsletter").value == "" || document.getElementById("nomenewsletter").value == "Digite seu Nome"){
                     alert("O campo Nome deve ser preenchido!");
                    document.getElementById("nomenewsletter").focus();
                     return false;
           }
if (document.getElementById("emailnewsletter").value == "" || document.getElementById("emailnewsletter").value == "Digite seu Email"){
                     alert("O campo Email deve ser preenchido!");
                     document.getElementById("emailnewsletter").focus();
                     return false;
           }

	if (!checkMail(document.getElementById("emailnewsletter").value)) {
        alert("Email inválido");
		return false;
}
	
ajaxGo({url: "newsletter_cadastra.php?nome="+document.getElementById("nomenewsletter").value+"&email="+document.getElementById("emailnewsletter").value, elem_return: document.getElementById("newsletter_div"), loading: "<img src='highslide/graphics/loader.gif' border='0' >"});

	}
	
	
				  function verificando() {
				d = document.forms['formcontato'];

				
if (d.nomecontato.value == "" || d.nomecontato.value == "Preencha aqui com o seu nome" ) {
                     alert("O campo Nome deve ser preenchido!");
                     d.nomecontato.focus();
                     return false;
           }

if (d.emailcontato.value == "" || d.emailcontato.value == "Digite seu email para contato") {
                     alert("O campo email deve ser preenchido!");
                     d.emailcontato.focus();
                     return false;
           }
if (d.comentariocontato.value == ""  || d.comentariocontato.value == "Digite sua mensagem") {
                     alert("O campo mensagem deve ser preenchido!");
                     d.mensagemcontato.focus();
                     return false;
           }

ajaxGo({url: "contato.php?nome="+document.getElementById("nomecontato").value+"&email="+document.getElementById("emailcontato").value+"&comentario="+document.getElementById("comentariocontato").value, elem_return: document.getElementById("resultadocontato"), loading: "<img src='tiny_red.gif' border='0' >"});
	
			  }

