function validaContato(){
	
	if (document.formContato.nome.value == ""){
		alert('Campo Nome não pode estar vazio')
		document.formContato.nome.focus();
		return false;
	}
	
	if (document.formContato.cidade.value == ""){
		alert('Campo Cidade não pode estar vazio')
		document.formContato.cidade.focus();
		return false;
	}
	
	if (document.formContato.uf.value == ""){
		alert('Campo UF não pode estar vazio')
		document.formContato.uf.focus();
		return false;
	}
	
	if (document.formContato.residencial.value == ""){
		alert('Campo Tel. Residencial não pode estar vazio')
		document.formContato.residencial.focus();
		return false;
	}
	
	if (document.formContato.email.value == ""){
		alert('Campo E-mail não pode estar vazio')
		document.formContato.email.focus();
		return false;
	}
	
	parte1 = document.formContato.email.value.indexOf("@");
	parte2 = document.formContato.email.value.indexOf(".");
	parte3 = document.formContato.email.value.length;
		if (!(parte1 >= 3 && parte2 >= 6 && parte3 >= 9)) {
		alert ("O campo " + document.formContato.email.name + " deve ser conter um e-mail válido!");
		document.formContato.email.focus();
		return false;
	}
	
	if (document.formContato.mensagem.value == ""){
		alert('Campo mensagem não pode estar vazio')
		document.formContato.mensagem.focus();
		return false;
	}
	
	document.formContato.submit()
	
}



function makevisible(cur,which){
	if (which==0)
		cur.filters.alpha.opacity=50
	else
		cur.filters.alpha.opacity=100
}


function stAba(menu,conteudo)
	{
		this.menu = menu;
		this.conteudo = conteudo;
	}

	var arAbas = new Array();
	arAbas[0] = new stAba('td_centro_medico','div_centro_medico');
	arAbas[1] = new stAba('td_medicina_estetica','div_medicina_estetica');

	function AlternarAbas(menu,conteudo)
	{
		for (i=0;i<arAbas.length;i++)
		{
			m = document.getElementById(arAbas[i].menu);
			m.className = 'menu';
			c = document.getElementById(arAbas[i].conteudo)
			c.style.display = 'none';
		}
		m = document.getElementById(menu)
		m.className = 'menu-sel';
		c = document.getElementById(conteudo)
		c.style.display = '';
	}
var d = new Date()
	var dia = d.getDay()
	var mes = d.getMonth()
	var ano = d.getFullYear()
	
	var nomesDias=new Array("Domingo","Segunda-feira","Terça-feira","Quarta-feira",
		"Quinta-feira","Sexta-feira","Sábado")
	var nomesMeses=new Array("Janeiro","Fevereiro","Março","Abril","Maio","Junho",
		"Julho","Agosto","Setembro","Outubro","Novembro","Dezembro")
	
	var s=""+nomesDias[dia]+", "+d.getDate()
	s+=" de "+nomesMeses[mes]+" de "+ano


function getNumeroRandomico(nroIniItervalo, nroFimItervalo){
	nroFimItervalo++;
	return (Math.floor(Math.random() * (nroFimItervalo-nroIniItervalo))+nroIniItervalo);
}

function getRadonItemArray(arrCompl, qtdeItem){
	var arrTemp = [];
	var achou = 0;
	var str = "";
	while (achou < qtdeItem)
	{
		var indiceTemp = getNumeroRandomico(0, arrCompl.length-1);
		if (str.indexOf("("+indiceTemp+")") == -1)
		{
			arrTemp[arrTemp.length] = arrCompl[indiceTemp];
			str += "("+indiceTemp+")";
			achou++;
		}
	}
	return arrTemp;
}
	
	
// DESTAQUE HOME 1

var currentImg = "one";
var currentDest = 0;
function showDest(dest){
	if ( !document.getElementById("boxDest" + dest) ){
		var objDivTemp = document.getElementById("divDestaque").appendChild(document.createElement("DIV"));
			objDivTemp.id = "boxDest" + dest;
			objDivTemp.className = "off";
			var html = '<img id="imgDestOne" src="'+arrDestques[dest][0]+'" onload="showDest(' + dest + ')" border="0" style="cursor:hand; pointer:hand" onclick="abreFoto('+arrDestques[dest][2]+')" id="' +arrDestques[dest][2]+ ';" width="160">';
			if ( arrDestques[dest][1] != "" ){
				html = '<a href="'+arrDestques[dest][1]+'">' + html + '</a>';
			}
			objDivTemp.innerHTML = html;
	} else {
		document.getElementById("btDest_" + currentDest).className 	= "dest_pagina";
		document.getElementById("btDest_" + dest).className 		= "dest_pagina_sel";
		document.getElementById("boxDest" + currentDest).className 	= "off";
		document.getElementById("boxDest" + dest).className 		= "on";
		currentDest = dest;
		desligaTimeOutDest();
		timeOutDest();
	}
}
function timeOutDest(){
	window.timeOut = window.setTimeout("avancar()", 4000);
}
function desligaTimeOutDest(){
	if(window.timeOut){
		clearTimeout(window.timeOut);
		window.timeOut=null;
	}
}

function getDestaques(){
	document.write('<table width="100%" cellpadding="0" cellspacing="0" height="1"><tr>');
	if ( arrDestques.length > 0 ){
		for ( var i = 0; i < arrDestques.length; i++ ){
			document.write('<td id="btDest_' + i + '" onclick="showDest(' + i + ')"></td>')
		}
		
	}
	document.write('</tr></table>');
	showDest(0);
}


function writeDestaque(){


document.write('<div class="bordaBox" align="center" style="width:172px; margin-right:5px; margin-top:5px">');
	document.write('<b class="b1"></b><b class="b2"></b><b class="b3"></b><b class="b4"></b>');
		document.write('<div class="conteudo" style="text-align:left">');
			
			document.write('<div id="divDestaque" style="padding-left:4px; overflow:hidden">');
			
			document.write('</div>');
		
		document.write('</div>');
	document.write('<b class="b4"></b><b class="b3"></b><b class="b2"></b><b class="b1"></b>');
document.write('</div>');

getDestaques();

document.write('<table align="center" cellpadding="0" cellspacing="0" border="0" width="95%" style="margin-top:4px; margin-right:5px">');
	document.write('<tr>');
		document.write('<td bgcolor="#AAD089" onclick="voltar()"style="cursor:hand; color:white; padding:1px; border:1px solid #86A86B" align="center"><b>Anterior</b></td>');
		document.write('<td width="2%"></td>');
		document.write('<td bgcolor="#AAD089" onclick="avancar()" style="cursor:hand; color:white; padding:1px; border:1px solid #86A86B" align="center"><b>Próximo</b></td>');
	document.write('</tr>');
document.write('</table>');

}






function iniciar(){
	execTimeoutDest();
}
function parar(){
	desligaTimeOutDest();
}
function voltar(){
	var dest = (currentDest == 0)?arrDestques.length-1:(currentDest-1);
	showDest(dest);
}
function avancar(){
	var dest = (currentDest == arrDestques.length-1)?0:(currentDest+1);
	showDest(dest);
}


// DESTAQUE HOME 2



var currentImg2 = "one2";
var currentDest2 = 0;
function showDest2(dest2){
	if ( !document.getElementById("boxDest2" + dest2) ){
		var objDivTemp = document.getElementById("divDestaque2").appendChild(document.createElement("DIV"));
			objDivTemp.id = "boxDest2" + dest2;
			objDivTemp.className = "off2";
			var html2 = '<img id="imgDestOne2" src="'+arrDestques2[dest2][0]+'" onload="showDest2(' + dest2 + ')" border="0" style="" width="120" height="60">';
			if ( arrDestques2[dest2][1] != "" ){
				html2 = '<a href="'+arrDestques2[dest2][1]+'">' + html2 + '</a>';
			}
			objDivTemp.innerHTML = html2;
	} else {
		document.getElementById("btDest2_" + currentDest2).className 	= "dest_pagina2";
		document.getElementById("btDest2_" + dest2).className 		= "dest_pagina_sel2";
		document.getElementById("boxDest2" + currentDest2).className 	= "off2";
		document.getElementById("boxDest2" + dest2).className 		= "on2";
		currentDest2 = dest2;
		desligaTimeOutDest2();
		timeOutDest2();
	}
}
function timeOutDest2(){
	window.timeOut2 = window.setTimeout("avancar2()", 3000);
}
function desligaTimeOutDest2(){
	if(window.timeOut2){
		clearTimeout(window.timeOut2);
		window.timeOut2=null;
	}
}

function getDestaques2(){
	document.write('<table width="100%" cellpadding="0" cellspacing="0" height="1"><tr>');
	if ( arrDestques2.length > 0 ){
		for ( var i = 0; i < arrDestques2.length; i++ ){
			document.write('<td id="btDest2_' + i + '" onclick="showDest2(' + i + ')"></td>')
		}
		
	}
	document.write('</tr></table>');
	showDest2(0);
}


function writeDestaque2(){

document.write('<div class="bordaBox" align="center" style="width:130px; margin-right:5px; margin-top:5px">');
	document.write('<b class="b1"></b><b class="b2"></b><b class="b3"></b><b class="b4"></b>');
		document.write('<div class="conteudo" style="text-align:left">');
			
			document.write('<div id="divDestaque2" style="padding-left:4px; overflow:hidden">');
			
			document.write('</div>');
		
		document.write('</div>');
	document.write('<b class="b4"></b><b class="b3"></b><b class="b2"></b><b class="b1"></b>');
	getDestaques2();
document.write('</div>');



}


function iniciar2(){
	execTimeoutDest2();
}
function parar2(){
	desligaTimeOutDest2();
}
function voltar2(){
	var dest2 = (currentDest2 == 0)?arrDestques2.length-1:(currentDest2-1);
	showDest2(dest2);
}
function avancar2(){
	var dest2 = (currentDest2 == arrDestques2.length-1)?0:(currentDest2+1);
	showDest2(dest2);
}

	
function abreFoto(nroFoto){
  idFoto = nroFoto;
  open("abreFoto.php",idFoto, "toolbar=no,location=no,status=no,menubar=no,resizable=no,scrollbars=no,width=388,height=265,top=220,left=330");
}

function writeProportions(valor1, valor2){
				document.write('<!-- FIM CONTEÚDO ALTERÁVEL -->');
			document.write('</td>');
		document.write('</tr>');
	document.write('</table>');
	
	
	document.write('<table height="5">');
		document.write('<tr>');
			document.write('<td></td>');
		document.write('</tr>');
	document.write('</table>');
	
	document.write('<table cellpadding="0" cellspacing="0" width="100%" style="filter:alpha(opacity=40); opacity: .4">');
		document.write('<tr>');
			document.write('<td width="205" valign="top">');
				
				document.write('<!-- INÍCIO FOTO DESTAQUE -->');
				
				document.write('<div style="margin-right:5px; background-color:white; border:1px solid #83B6B1; height:340px">');
					document.write('<div style="filter:alpha(opacity=90); opacity: .9">');
						document.write('&nbsp;');
						document.write('<img src="img/foto_destaque.gif" width="267" height="400" alt="" border="0" style="alpha(opacity=80); opacity: .8; position:absolute; z-index:-1; margin-top:' + valor1 +'; margin-left:-10px">');
					document.write('</div>');
				document.write('</div>');	
				
				document.write('<!-- FIM FOTO DESTAQUE -->');
			
			document.write('</td>');
			
			document.write('<td width="500">');
				
				document.write('<!-- INÍCIO BLOCO CONTEÚDO -->');
				
				document.write('<div style="background-color:white; border:1px solid #83B6B1; height:' + valor2 + 'px">');
					document.write('<div style="position:absolute">');
						document.write('&nbsp;');
					document.write('</div>');
				document.write('</div>');
				
				document.write('<!-- FIM BLOCO CONTEÚDO -->');
				
				
			document.write('</td>');
		document.write('</tr>');
	document.write('</table>');
}

function rodape(margin){
	document.write('<!-- INÍCIO CURVA RODAPÉ -->');
						
	document.write('<div class="rodape_style" style="margin-top:' + margin + 'px;">');
		document.write('<img src="img/rodape.gif" alt="" border="0" class="rodape">');
	document.write('</div>');
	
	document.write('<!-- FIM CURVA RODAPÉ -->');
}

window.onload = function(){ 
	
	if (document.getElementsByTagName) { 
	// Get all the tags of type object in the page. 
	var objs = document.getElementsByTagName("object"); 
		for (i=0; i<objs.length; i++) { 
		// Get the HTML content of each object tag 
		// and replace it with itself. 
		objs[i].outerHTML = objs[i].outerHTML; 
		} 
	} 
} 

// When the page unloads: 
window.onunload = function() { 
	if (document.getElementsByTagName) { 
	//Get all the tags of type object in the page. 
	var objs = document.getElementsByTagName("object"); 
		for (i=0; i<objs.length; i++) { 
		// Clear out the HTML content of each object tag 
		// to prevent an IE memory leak issue. 
		objs[i].outerHTML = ""; 
		} 
	} 
}
