function init(){
	document.getElementById("botTratamentos").onmouseover = function(){document.getElementById("subTratamentos").style.display = 'block';}
	document.getElementById("botTratamentos").onmouseout = function(){document.getElementById("subTratamentos").style.display = 'none';}
	document.getElementById("subTratamentos").onmouseover = function(){document.getElementById("subTratamentos").style.display = 'block';}
	document.getElementById("subTratamentos").onmouseout = function(){document.getElementById("subTratamentos").style.display = 'none';}
	/*document.getElementById("btn_est").onmouseover = function(){document.getElementById("estetic_sub").style.display = 'block';}
	document.getElementById("btn_est").onmouseout = function(){document.getElementById("estetic_sub").style.display = 'none';}
	document.getElementById("estetic_sub").onmouseover = function(){document.getElementById("estetic_sub").style.display = 'block';}
	document.getElementById("estetic_sub").onmouseout = function(){document.getElementById("estetic_sub").style.display = 'none';}
	*/
	document.getElementById("botParceiros").onmouseover = function(){document.getElementById("subParceiros").style.display = 'block';}
	document.getElementById("botParceiros").onmouseout = function(){document.getElementById("subParceiros").style.display = 'none';}
	document.getElementById("subParceiros").onmouseover = function(){document.getElementById("subParceiros").style.display = 'block';}
	document.getElementById("subParceiros").onmouseout = function(){document.getElementById("subParceiros").style.display = 'none';}
}
function verFoto(url,largura,altura){
	var fotos = window.open(url,'fotos','width='+(largura + 20)+',height='+(altura + 20));
	fotos.document.title = "A Clínica";
	fotos.document.body.innerHTML += "<style type='text/css'>body{margin-top:10px;background-color: #F0F9FD;text-align:center}img{width:"+largura+"px;height:"+altura+"px;border:2px solid #999999 }</style></head>"
}
function mostraDepoimento(obj){
	base = document.getElementById("tabelaDepoimentos").getElementsByTagName("ul")
	for(i=0;i<base.length;i++){
		base[i].style.display="none";
	}
	document.getElementById(obj).style.display = "block";
}
function Mascara(objeto, evt, mask) {
	var LetrasU = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
	var LetrasL = 'abcdefghijklmnopqrstuvwxyz';
	var Letras  = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
	var Numeros = '0123456789';
	var Fixos  = '().-:/ '; 
	var Charset = " !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_/`abcdefghijklmnopqrstuvwxyz{|}~";
	
	evt = (evt) ? evt : (window.event) ? window.event : "";
	var value = objeto.value;
	if (evt) {
	 var ntecla = (evt.which) ? evt.which : evt.keyCode;
	 tecla = Charset.substr(ntecla - 32, 1);
	 if (ntecla < 32) return true;
	
	 var tamanho = value.length;
	 if (tamanho >= mask.length) return false;
	
	 var pos = mask.substr(tamanho,1); 
	 while (Fixos.indexOf(pos) != -1) {
	  value += pos;
	  tamanho = value.length;
	  if (tamanho >= mask.length) return false;
	  pos = mask.substr(tamanho,1);
	 }
	
	 switch (pos) {
	   case '#' : if (Numeros.indexOf(tecla) == -1) return false; break;
	   case 'A' : if (LetrasU.indexOf(tecla) == -1) return false; break;
	   case 'a' : if (LetrasL.indexOf(tecla) == -1) return false; break;
	   case 'Z' : if (Letras.indexOf(tecla) == -1) return false; break;
	   case '*' : objeto.value = value; return true; break;
	   default : return false; break;
	 }
	}
	objeto.value = value; 
	return true;
}
function validaForm(formulario){
	if(formulario == "contato"){
		if(document.getElementById("contato_nome").value == ""){
			document.getElementById("contato_nome").focus()
			window.alert("Preencha seu nome.")
			return false;
		}
		if(document.getElementById("contato_tel").value == ""){
			document.getElementById("contato_tel").focus()
			window.alert("Preencha seu telefone.")
			return false;
		}
		if(document.getElementById("contato_email").value == ""){
			document.getElementById("contato_email").focus()
			window.alert("Preencha seu email.")
			return false;
		}
		if(document.getElementById("contato_email").value.indexOf("@") == -1){
			document.getElementById("contato_email").focus();
			window.alert("Preencha seu Email corretamente.");
			return false;
		}
		if(document.getElementById("contato_msg").value == ""){
			document.getElementById("contato_msg").focus()
			window.alert("Preencha sua mensagem.")
			return false;
		}
	}
	if(formulario == "indique"){
		if(document.getElementById("indique_nome").value == ""){
			document.getElementById("indique_nome").focus()
			window.alert("Preencha seu nome.")
			return false;
		}
		if(document.getElementById("indique_email").value == ""){
			document.getElementById("indique_email").focus()
			window.alert("Preencha o email do seu amigo.")
			return false;
		}
		if(document.getElementById("indique_email").value.indexOf("@") == -1){
			document.getElementById("contato_email").focus();
			window.alert("Preencha o email do seu amigo corretamente.");
			return false;
		}
	}
	if(formulario == "avaliacao"){
		if(document.getElementById("agende_nome").value == ""){
			document.getElementById("agende_nome").focus()
			window.alert("Preencha seu nome.")
			return false;
		}
		if(document.getElementById("agende_tel").value == ""){
			document.getElementById("agende_tel").focus()
			window.alert("Preencha seu telefone.")
			return false;
		}
		if(document.getElementById("agende_email").value == ""){
			document.getElementById("agende_email").focus()
			window.alert("Preencha seu email.")
			return false;
		}
		if(document.getElementById("agende_email").value.indexOf("@") == -1){
			document.getElementById("agende_email").focus();
			window.alert("Preencha seu email corretamente.");
			return false;
		}
		if(document.getElementById("agende_data").value == ""){
			document.getElementById("agende_data").focus()
			window.alert("Preencha a data desejada.")
			return false;
		}
		if(document.getElementById("agende_hora").value == ""){
			document.getElementById("agende_hora").focus()
			window.alert("Preencha a hora desejada.")
			return false;
		}
		if(document.getElementById("agende_tratamento_desejado").value == ""){
			document.getElementById("agende_tratamento_desejado").focus()
			window.alert("Preencha o tratamento desejado.")
			return false;
		}
	}
}

window.onload = init;
