function NewWindow(mypage, myname, w, h, scroll){
	var winl;
	var wint;
	if(w==0)
		winl = w;
	else
		winl = (screen.width - w) / 2;
	
	if(h==0)
		wint = h;
	else
		wint = (screen.height - h) / 2;
	
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+wint+',scrollbars='+scroll+',status=no';

	win = window.open(mypage, myname, winprops);
	if (parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
function texto(){
	document.write ('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="770" height="125"><param name="movie" value="index2.swf">		<param name="quality" value="high">		<embed src="index2.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="770" height="125"></embed>	</object>')
}

function mapa(){
	document.write ('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="440" height="500"><param name="movie" value="mapa.swf"><param name="quality" value="high"><embed src="mapa.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="440" height="500"></embed></object>')
}

function home(){
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="770" height="430" id="index" align="middle">  <param name="allowScriptAccess" value="sameDomain" />  <param name="movie" value="index.swf" />  <param name="quality" value="high" />  <param name="bgcolor" value="#ffffff" />  <embed src="index.swf" quality="high" bgcolor="#ffffff" width="770" height="430" name="index" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />    </object>');
}

function dir(){
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="301.9" height="230" id="index" align="middle">  <param name="allowScriptAccess" value="sameDomain" />  <param name="movie" value="anima_right.swf" />  <param name="quality" value="high" />  <param name="bgcolor" value="#ffffff" />  <embed src="anima_right.swf" quality="high" bgcolor="#ffffff" width="300" height="230" name="index" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />    </object>');
}

function fotos(){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="379" height="116"><param name=movie value="imagens/logo.swf"><param name=quality value=best><embed src="imagens/logo.swf" quality=best pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="379" height="116"></embed></object>');
}

to=new Array()
function over(n){
	if(typeof(to[n])!="undefined")clearTimeout(to[n])
	document.getElementById("o"+n).style.display="block";
	document.getElementById("c"+n).style.background="url('imagens/hovermenu.jpg')";
}
function out(n){
	to[n]=document.getElementById('o'+n).style.display="none"
	document.getElementById('c'+n).style.background=""

}

	function menuprincipal()
{
	var menu = "";
	
	menu += '<table cellpadding="0" cellspacing="0" background="imagens/fundoMenu.jpg">';
	menu += '<tr>';
	menu += '<td nowrap><a href="home.html">Home</a></td>';
	menu += '<td class="barra"><img src="imagens/barra.gif" height="20"></td>';
	menu += '<td nowrap><a href="empresa.html" >A Empresa</a></td>';
	menu += '<td class="barra"><img src="imagens/barra.gif" height="20"></td>';
	menu += '<td nowrap><a href="tecnologia.html" >Tecnologia</a></td>';
	menu += '<td class="barra"><img src="imagens/barra.gif" height="20"></td>';
	menu += '<td nowrap><a href="#" onmouseover="over(1);" onmouseout="out(1);" id="c1">Servi&ccedil;os</a></td>';
	menu += '<td class="barra"><img src="imagens/barra.gif" height="20"></td>';
	menu += '<td nowrap><a href="filial.html">Filiais</a></td>';
	menu += '<td class="barra"><img src="imagens/barra.gif" height="20"></td>';
	menu += '<td nowrap><a href="credenciados.html" >Credenciados</a></td>';
	menu += '<td class="barra"><img src="imagens/barra.gif" height="20"></td>';
	menu += '<td nowrap><a href="cliente.html" >Clientes</a></td>';
	menu += '<td class="barra"><img src="imagens/barra.gif" height="20"></td>';
	menu += '<td nowrap><a href="clube.html" >Clube de Sa&uacute;de</a></td>';
	menu += '<td class="barra"><img src="imagens/barra.gif" height="20"></td>';
	menu += '<td nowrap><a href="legislacao.html" >Legisla&ccedil;&atilde;o</a></td>';
	menu += '<td class="barra"><img src="imagens/barra.gif" height="20"></td>';
	menu += '<td nowrap><a href="faq.html" >FAQ</a></td>';
	menu += '<td class="barra"><img src="imagens/barra.gif" height="20"></td>';
	menu += '<td nowrap><a href="link.html" >Links</a></td>';//Outros Exames e Atendimentos
	menu += '<td class="barra"><img src="imagens/barra.gif" height="20"></td>';//Tecnologia & Sistemas
	menu += '<td nowrap><a href="contato.html" >Contato</a></td>';
	menu += '<td class="barra"><img src="imagens/barra.gif" height="20"></td>';//Tecnologia & Sistemas
	menu += '<td nowrap><a href="login.php" >Login</a></td>';
	menu += '</tr>';
	menu += '</table>';
	document.write(menu);
}
	
function submenu(itemMenu){
	var subm = "";
	switch (itemMenu)
	{
		case 'o1' :
			subm += '<a href="servico.html">Servi&ccedil;os</a> | ';
			subm += '<a href="medicina.html">Medicina do Trabalho</a> | ';
			subm += '<a href="seguranca.html">Seguran&ccedil;a do Trabalho</a> | ';
			subm += '<a href="ambiente.html">Meio Ambiente</a> | ';
			subm += '<a href="cursos.html">Cursos Diversos</a> | ';
			subm += '<a href="laudopredial.html">Laudo de Saúde Predial</a> | ';
			subm += '<a href="vacinas.html">Vacinas</a>';
			break;
		case "o2" :
			subm += '<a href="rh.html">Como Atuamos</a> | ';
			subm += '<a href="oportunidade.html">Oportunidades</a> ';
			break;
	}
	document.write(subm);
}

function validaClinica(){
	if(document.getElementById("nome").value == "")	{
		alert("Campo Nome é obrigatório");
		document.getElementById("nome").focus();
		return false;
	}
	
	if(document.getElementById("endereco").value == "")	{
		alert("Campo Endereço é obrigatório");
		document.getElementById("endereco").focus();
		return false;
	}
	
	if(document.getElementById("n_end").value == "")	{
		alert("Campo Número é obrigatório");
		document.getElementById("n_end").focus();
		return false;
	}
	
	if(document.getElementById("bairro").value == "")	{
		alert("Campo Bairro é obrigatório");
		document.getElementById("bairro").focus();
		return false;
	}
	

	if(document.getElementById("telefone").value == "")	{
		alert("Campo Telefone é obrigatório");
		document.getElementById("telefone").focus();
		return false;
	}
	
	if(document.getElementById("codEspecialidade").value == "")	{
		alert("Campo Especialidade é obrigatório");
		document.getElementById("codEspecialidade").focus();
		return false;
	}
	
	document.cad_clinica.action = "conf.php?acao=c&tabela=clinica";
	return true;
		
}

function carregaZona(){
	if(document.getElementById("cidade").value == ""){
		document.getElementById("flag").value = "";
	}
	else{
		document.getElementById("flag").value = "true";
	}
	
	
	document.getElementById("codZona").value = "";
	document.cad_clinica.action = "cad_clinica.php";
	//alert(document.cad_clinica.action);
	document.cad_clinica.submit();
}

function validaEspecialidade(){
	alerta = "";
	if(document.cad_especialidade.nomeEspecialidade.value == ""){
		alert("Campo de Especialidade é obrigatório");
		alerta = 1;
		document.cad_especialidade.focus();
	}	
	
	if(alerta == ""){
		document.cad_especialidade.submit();	
	}
}

function validaBusca(){
	if((document.clinicas.por[0].checked) || 
	   (document.clinicas.por[1].checked) || 
	   (document.clinicas.por[2].checked) || 
	   (document.clinicas.por[3].checked))
		{
		
			if((document.clinicas.por[0].checked) || (document.clinicas.por[1].checked)){
				if(document.getElementById("busca1").value == ""){
					alert("Favor preencher o campo Busca");
					document.getElementById("busca1").focus();
					return false;
				}
			}
			
			if(document.clinicas.por[2].checked){
				if(document.getElementById("busca2").value == ""){
						alert("Favor preencher o campo Busca");
						document.getElementById("busca2").focus();
						return false;
					}		
			}
		}else{
			alert("Favor selecionar um meio de Busca");
			return false;
		}
	return true;
}