function fone(obj,prox) {
	switch (obj.value.length) {
		case 1:
				obj.value = "(" + obj.value;
				break;
		case 3:
				obj.value = obj.value + ")";
				break;  
		case 8:
				obj.value = obj.value + "-";
				break;  
		case 13:
				prox.focus();
				break;
	}
}

function formata_data(obj,prox) {
	switch (obj.value.length) {
		case 2:
				obj.value = obj.value + "/";
				break;
		case 5:
				obj.value = obj.value + "/";
				break;
		case 9:
				prox.focus();
				break;
	}
}

function Apenas_Numeros(caracter){
	var nTecla = 0;
	if (document.all) {
		  nTecla = caracter.keyCode;
	} else {
		  nTecla = caracter.which;
	}
	if ((nTecla> 47 && nTecla <58)
	|| nTecla == 8 || nTecla == 127
	|| nTecla == 0 || nTecla == 9  // 0 == Tab
	|| nTecla == 13) { // 13 == Enter
		  return true;
	} else {
		  return false;
	}
}

function validaContato(){
	var nome 	= document.getElementById("txtNome");
	var email 	= document.getElementById("txtMail");
	var mail1 	= email.value.indexOf('@');
	var mail2 	= email.value.indexOf('.');
	var oque 	= document.getElementById("txtOQ");
	var alerta 	= document.getElementById("alerta");
	
	if(nome.value == null || nome.value == ""){
		alerta.style.visibility = "visible";
		alerta.innerHTML = "Informe o Nome.";
		nome.focus();
		return false;
	}else if(email.value == null || email.value == ""){
		alerta.style.visibility = "visible";
		alerta.innerHTML = "Informe o E-mail.";
		email.focus();
		return false;
	}else if(mail1 == -1 || mail2 == -1){
		alerta.style.visibility = "visible";
		alerta.innerHTML = "Informe o E-mail corretamente.";
		email.focus();
		return false;
	}else if(oque.value == null || oque.value == ""){
		alerta.style.visibility = "visible";
		alerta.innerHTML = "Precisamos saber o que lhe aconteceu.";
		oque.focus();
		return false;
	}else{
		alerta.style.visibility = "hidden";
		alerta.innerHTML = "";
		return true;
	}
}

$(document).ready(function() {
	$("#accordion, #accordion div").mouseover(function() {
		$(this).addClass("hover");
	}).mouseout(function() {
		$(this).removeClass("hover");
	});
});
/*accHover = function() {
	var accContainer = document.getElementById("accordion");
	accContainer.onmouseover=function() {
		this.className+=" hover";
	}
	accContainer.onmouseout=function() {
		this.className=this.className.replace(new RegExp(" hover\b"), "");
	}
 
	var accDivs = accContainer.getElementsByTagName("div");
	for (var i=0; i<accDivs.length; i++) {
		accDivs[i].onmouseover=function() {
			this.className+=" hover";
		}
		accDivs[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" hover\b"), "");
		}
	}	
}
if (window.attachEvent) window.attachEvent("onload", accHover);*/

function showInfoEstado(uf){
	lstEstados = new Array('AC', 'AL', 'AP', 'AM', 'BA', 'CE', 'DF', 'ES', 'GO', 'MA', 'MT', 'MS', 'MG', 'PA', 'PB', 'PR', 'PE', 'PI', 'RJ', 'RN', 'RS', 'RO', 'RR', 'SC', 'SP', 'SE', 'TO');
	
	document.getElementById(uf).style.display = "block";
	for(i = 0; i < 27; i++){
		estado = lstEstados[i];
		if(estado !== uf)
			document.getElementById(estado).style.display = "none";
	}
}
