// JavaScript Document
window.onload=montre;
function montre(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
if (d) {d.style.display='block';}
}

function ValidaCliente() {


		if ((document.formulario.nome.value=="") || (document.formulario.nome.value=="LOGIN")){ 
		alert("Digite o seu Nome"); 
		document.formulario.nome.select(); 
	return false;
	}
  
		if (document.formulario.email.value=="") { 
		alert("Digite o seu Email"); 
		document.formulario.email.select(); 
		return false;
	}
		parte1 = document.formulario.email.value.indexOf("@");
		parte2 = document.formulario.email.value.indexOf(".");
		parte3 = document.formulario.email.value.length;
		if (!(parte1 >= 3 && parte2 >= 6 && parte3 >= 9)) {
			alert("O campo login deve ser conter um endereco eletronico!");
			document.formulario.email.select();
			return false;
		}

	return true;
}

function objectSwf(swf,width,height) {
	document.write('<object type="application/x-shockwave-flash" width="' + width + '" height="' + height + '" data="' + swf + '">');
	document.write('<param name="movie" value="' + swf + '" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="menu" value="false" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<embed src="' + swf + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '" wmode="transparent"></embed>');
	document.write('</object>');
}

function Empreendimento() 
{

if(document.getElementById("lazer").style.display = "block"){
document.getElementById("lazer").style.display = "none";
}

if(document.getElementById("localizacao").style.display = "block"){
document.getElementById("localizacao").style.display = "none";
}

if(document.getElementById("plantas").style.display = "block"){
document.getElementById("plantas").style.display = "none";
}

if(document.getElementById("outras").style.display = "block"){
document.getElementById("outras").style.display = "none";
}

if(document.getElementById("downloads").style.display = "block"){
document.getElementById("downloads").style.display = "none";
}

if(document.getElementById("obra").style.display = "block"){
document.getElementById("obra").style.display = "none";
}

document.getElementById("empreendimento").style.display = "block";
document.getElementById("foto").style.display = "none";
document.getElementById("foto_pequena").style.display = "block";
}



function Lazer() 
{
	
if(document.getElementById("empreendimento").style.display = "block"){
document.getElementById("empreendimento").style.display = "none";
}

if(document.getElementById("localizacao").style.display = "block"){
document.getElementById("localizacao").style.display = "none";
}

if(document.getElementById("plantas").style.display = "block"){
document.getElementById("plantas").style.display = "none";
}

if(document.getElementById("outras").style.display = "block"){
document.getElementById("outras").style.display = "none";
}

if(document.getElementById("downloads").style.display = "block"){
document.getElementById("downloads").style.display = "none";
}

if(document.getElementById("obra").style.display = "block"){
document.getElementById("obra").style.display = "none";
}

document.getElementById("lazer").style.display = "block";
document.getElementById("foto").style.display = "none";
document.getElementById("foto_pequena").style.display = "block";
}



function Localizacao() 
{
	
if(document.getElementById("empreendimento").style.display = "block"){
document.getElementById("empreendimento").style.display = "none";
}

if(document.getElementById("lazer").style.display = "block"){
document.getElementById("lazer").style.display = "none";
}

if(document.getElementById("plantas").style.display = "block"){
document.getElementById("plantas").style.display = "none";
}

if(document.getElementById("outras").style.display = "block"){
document.getElementById("outras").style.display = "none";
}	

if(document.getElementById("downloads").style.display = "block"){
document.getElementById("downloads").style.display = "none";
}

if(document.getElementById("obra").style.display = "block"){
document.getElementById("obra").style.display = "none";
}
	
document.getElementById("localizacao").style.display = "block";
document.getElementById("foto").style.display = "none";
document.getElementById("foto_pequena").style.display = "block";
}



function Plantas() 
{
	
if(document.getElementById("empreendimento").style.display = "block"){
document.getElementById("empreendimento").style.display = "none";
}

if(document.getElementById("lazer").style.display = "block"){
document.getElementById("lazer").style.display = "none";
}

if(document.getElementById("localizacao").style.display = "block"){
document.getElementById("localizacao").style.display = "none";
}

if(document.getElementById("outras").style.display = "block"){
document.getElementById("outras").style.display = "none";
}	

if(document.getElementById("downloads").style.display = "block"){
document.getElementById("downloads").style.display = "none";
}	

if(document.getElementById("obra").style.display = "block"){
document.getElementById("obra").style.display = "none";
}

document.getElementById("plantas").style.display = "block";
document.getElementById("foto").style.display = "none";
document.getElementById("foto_pequena").style.display = "block";
}



function Downloads() 
{
	
if(document.getElementById("empreendimento").style.display = "block"){
document.getElementById("empreendimento").style.display = "none";
}

if(document.getElementById("lazer").style.display = "block"){
document.getElementById("lazer").style.display = "none";
}

if(document.getElementById("localizacao").style.display = "block"){
document.getElementById("localizacao").style.display = "none";
}

if(document.getElementById("outras").style.display = "block"){
document.getElementById("outras").style.display = "none";
}	

if(document.getElementById("plantas").style.display = "block"){
document.getElementById("plantas").style.display = "none";
}	

if(document.getElementById("obra").style.display = "block"){
document.getElementById("obra").style.display = "none";
}

document.getElementById("Downloads").style.display = "block";
document.getElementById("foto").style.display = "none";
document.getElementById("foto_pequena").style.display = "block";
}

function Obra() 
{
	
if(document.getElementById("empreendimento").style.display = "block"){
document.getElementById("empreendimento").style.display = "none";
}

if(document.getElementById("lazer").style.display = "block"){
document.getElementById("lazer").style.display = "none";
}

if(document.getElementById("localizacao").style.display = "block"){
document.getElementById("localizacao").style.display = "none";
}

if(document.getElementById("outras").style.display = "block"){
document.getElementById("outras").style.display = "none";
}	

if(document.getElementById("plantas").style.display = "block"){
document.getElementById("plantas").style.display = "none";
}	

if(document.getElementById("Downloads").style.display = "block"){
document.getElementById("Downloads").style.display = "none";
}	

document.getElementById("Obra").style.display = "block";
document.getElementById("foto").style.display = "none";
document.getElementById("foto_pequena").style.display = "block";
}

function Outras() 
{
	
if(document.getElementById("empreendimento").style.display = "block"){
document.getElementById("empreendimento").style.display = "none";
}

if(document.getElementById("lazer").style.display = "block"){
document.getElementById("lazer").style.display = "none";
}

if(document.getElementById("localizacao").style.display = "block"){
document.getElementById("localizacao").style.display = "none";
}

if(document.getElementById("plantas").style.display = "block"){
document.getElementById("plantas").style.display = "none";
}

if(document.getElementById("downloads").style.display = "block"){
document.getElementById("downloads").style.display = "none";
}	

if(document.getElementById("obra").style.display = "block"){
document.getElementById("obra").style.display = "none";
}
	
document.getElementById("outras").style.display = "block";
document.getElementById("foto").style.display = "none";
document.getElementById("foto_pequena").style.display = "block";
}



function Foto_normal() 
{
	
if(document.getElementById("empreendimento").style.display = "block"){
document.getElementById("empreendimento").style.display = "none";
}

if(document.getElementById("lazer").style.display = "block"){
document.getElementById("lazer").style.display = "none";
}

if(document.getElementById("localizacao").style.display = "block"){
document.getElementById("localizacao").style.display = "none";
}

if(document.getElementById("plantas").style.display = "block"){
document.getElementById("plantas").style.display = "none";
}	

if(document.getElementById("outras").style.display = "block"){
document.getElementById("outras").style.display = "none";
}

if(document.getElementById("downloads").style.display = "block"){
document.getElementById("downloads").style.display = "none";
}	

if(document.getElementById("obra").style.display = "block"){
document.getElementById("obra").style.display = "none";
}
	
document.getElementById("foto").style.display = "block";
document.getElementById("foto_pequena").style.display = "none";
}



function Loja() 
{
document.getElementById("loja").style.display = "block";
}

function Fecha_Loja() 
{
document.getElementById("loja").style.display = "none";
}

function Pisos() 
{
document.getElementById("pisos").style.display = "block";
}

function Revestimento() 
{
document.getElementById("revestimento").style.display = "block";
}

function Rotaciona(){
	wBanner= Math.random() * 90;
	if((wBanner>1) && (wBanner<10)){
	document.write('<script type=\"text/javascript\">objectSwf(\'flash/alecrim.swf\',404,225);</script>');
	} else if((wBanner>11) && (wBanner<20)){
	document.write('<script type=\"text/javascript\">objectSwf(\'flash/quaresmeira.swf\',404,225);</script>');
	} else if((wBanner>21) && (wBanner<30)){
	document.write('<script type=\"text/javascript\">objectSwf(\'flash/manaca.swf\',404,225);</script>');	
	} else if((wBanner>31) && (wBanner<40)){
	document.write('<script type=\"text/javascript\">objectSwf(\'flash/castanheira.swf\',404,225);</script>');
	} else if((wBanner>41) && (wBanner<50)){
	document.write('<script type=\"text/javascript\">objectSwf(\'flash/taruma.swf\',404,225);</script>');
	} else if((wBanner>51) && (wBanner<60)){
	document.write('<script type=\"text/javascript\">objectSwf(\'flash/jundiai.swf\',404,225);</script>');
	} else if((wBanner>61) && (wBanner<70)){
	document.write('<script type=\"text/javascript\">objectSwf(\'flash/santo_antonio.swf\',404,225);</script>');
	} else if((wBanner>71) && (wBanner<80)){
	document.write('<script type=\"text/javascript\">objectSwf(\'flash/alto_lux.swf\',404,225);</script>');	
	} else if((wBanner>81) && (wBanner<90)){
	document.write('<script type=\"text/javascript\">objectSwf(\'flash/pitanga.swf\',404,225);</script>');	
	}
}

function Rotaciona2(){
	yBanner=Math.random() * 100;
	if((yBanner>0) && (yBanner<20))
	{
	document.write('<script type=\"text/javascript\">objectSwf(\'flash/mude.swf\',285,225);</script>');		
	}
	else if((yBanner>21) && (yBanner<60))
	{
	document.write('<script type=\"text/javascript\">objectSwf(\'flash/indica.swf\',285,225);</script>');
	
	//banners utilizando anteriormente
	//bairro_charmoso.swf , indica.swf, mude.swf
	//} else if((yBanner>76) && (yBanner<87)){
	//document.write('<table width="285" height="225" border="0" cellpadding="0" cellspacing="0" background="../imagens/fundo_noticiasp.jpg"><tr><td><br><br><center><IFRAME allowtransparency="yes" name="interno" src="ultimas_noticias_principal.php" width="240" height="180" frameborder="0" style="overflow-y: hidden;" scrolling="no"></IFRAME></center></td></tr></table>');		
	//} else if((yBanner>88) && (yBanner<100)){
	//document.write('<table width="285" height="225" border="0" cellpadding="0" cellspacing="0" background="../imagens/fundo_namidiap.jpg"><tr><td><br><br><center><IFRAME allowtransparency="yes" name="interno" src="ultimas_namidia_principal.php" width="240" height="180" frameborder="0" style="overflow-y: hidden;" scrolling="no"></IFRAME></center></td></tr></table>');
	}
	else if((yBanner>61) && (yBanner<100))
	{
	document.write('<script type=\"text/javascript\">objectSwf(\'flash/mude.swf\',285,225);</script>');
	}
	
}

function abreIndique(){
	window.open("indique.htm","INDICA","height=310,width=360,scrollbars=no,status=no");	
}

function abreIndique2(imovel){
	window.open("indique.php?edificio="+imovel+"","INDICA","height=310,width=350,scrollbars=no,status=no");	
}

function abreCorretor(){
	window.open("consultor.htm","CONSULTOR","height=250,width=360,scrollbars=no,status=no");	
}

function abreVisite(imovel){
	window.open("visite.php?edificio="+imovel+"","CONSULTOR","height=320,width=350,scrollbars=no,status=no");	
}

function abreInfo(imovel){
	window.open("maisinfo.php?edificio="+imovel+"","CONSULTOR","height=300,width=350,scrollbars=no,status=no");	
}

function abrePlanta(imovel,planta){
	window.open("planta.php?id="+imovel+"&planta="+planta+"","Planta","height=550,width=530,scrollbars=yes,status=no");	
}

function abreLazer(imovel,planta){
	window.open("lazer.php?id="+imovel+"&planta="+planta+"","Planta","height=570,width=500,scrollbars=no,status=no");	
}

function ValidaIndica() {


		if (document.formulario.nome.value==""){ 
		alert("Digite o seu Nome"); 
		document.formulario.nome.focus(); 
	return false;
	}
  
		if (document.formulario.email.value=="") { 
		alert("Digite o seu Email"); 
		document.formulario.email.focus(); 
		return false;
	}
	
		if (document.formulario.nome1.value==""){ 
		alert("Digite pelo menos o nome de um amigo(a)"); 
		document.formulario.nome1.focus(); 
	return false;
	}
  
		if (document.formulario.email1.value=="") { 
		alert("Digite pelo menos o e-mail de um amigo(a)"); 
		document.formulario.email1.focus(); 
		return false;
	}	
	
		parte1 = document.formulario.email1.value.indexOf("@");
		parte2 = document.formulario.email1.value.indexOf(".");
		parte3 = document.formulario.email1.value.length;
		if (!(parte1 >= 3 && parte2 >= 6 && parte3 >= 9)) {
			alert("O campo E-mail deve ser conter um endereco eletronico!");
			document.formulario.email1.select();
			return false;
		}

	return true;
}

function ValidaVisite() {


		if (document.formulario.nome.value==""){ 
		alert("Digite o seu Nome"); 
		document.formulario.nome.focus(); 
	return false;
	}
  
		if (document.formulario.email.value=="") { 
		alert("Digite o seu Email"); 
		document.formulario.email.focus(); 
		return false;
	}

		parte1 = document.formulario.email.value.indexOf("@");
		parte2 = document.formulario.email.value.indexOf(".");
		parte3 = document.formulario.email.value.length;
		if (!(parte1 >= 3 && parte2 >= 6 && parte3 >= 9)) {
			alert("O campo E-mail deve ser conter um endereco eletronico!");
			document.formulario.email.select();
			return false;
		}

  
		if (document.formulario.data.value=="") { 
		alert("Digite a data da visita"); 
		document.formulario.data.focus(); 
		return false;
	}
	
		if (document.formulario.horario.value=="") { 
		alert("Digite o horário da visita"); 
		document.formulario.horario.focus(); 
		return false;
	}		

	return true;
}

function ValidaInfo() {


		if (document.formulario.nome.value==""){ 
		alert("Digite o seu Nome"); 
		document.formulario.nome.focus(); 
	return false;
	}
  
		if (document.formulario.email.value=="") { 
		alert("Digite o seu Email"); 
		document.formulario.email.focus(); 
		return false;
	}

		parte1 = document.formulario.email.value.indexOf("@");
		parte2 = document.formulario.email.value.indexOf(".");
		parte3 = document.formulario.email.value.length;
		if (!(parte1 >= 3 && parte2 >= 6 && parte3 >= 9)) {
			alert("O campo E-mail deve ser conter um endereco eletronico!");
			document.formulario.email.select();
			return false;
		}

		if (document.formulario.telefone.value=="") { 
		alert("Digite o telefone"); 
		document.formulario.telefone.focus(); 
		return false;
	}


		if (document.formulario.comentario.value=="") { 
		alert("Digite sua mensagem"); 
		document.formulario.comentario.focus(); 
		return false;
	}
	

	return true;
}

function Favoritos(){
	window.open("favoritos.htm","Favoritos","height=570,width=360,scrollbars=auto,status=no");	
}

	function  shImList(o,s)
	{
		pos = getObjPos(o);
		elm = document.getElementById('imList');
		if(o){
			elm.style.left = pos.l + 10 + 'px';
			elm.style.top = pos.t + 12 + 'px';
		}
	
		elm.style.display = (s) ? 'block' : 'none';
	}

	function getObjPos(o)
	{
		var l = o.offsetLeft;
		var t = o.offsetTop;
		while (o.offsetParent) 
		{
			l += o.offsetParent.offsetLeft;
			t += o.offsetParent.offsetTop;
			o = o.offsetParent;
		}
		getObjPos.l = l;
		getObjPos.t = t;
		return getObjPos;
	}
	
function popcorretores(){
window.open("corretorespopup.php","barp","width=408,height=140");
}

function exibir_cidade(targ){
window.open(targ,"Atendimento");
}

function barropreto(){
window.open("barropreto.htm","barp","width=250,height=80");
}

function buritis(){
window.open("buritis.htm","bur","width=250,height=80");
}

function pampulha(){
window.open("pampulha.htm","pam","width=250,height=80");
}

function savassi(){
window.open("savassi.htm","Atensavdimento","width=250,height=80");
}

function catalogo(){
window.open("premios.html","catalogo","width=720,height=400,scrollbars=yes");
}