function janelaSecundaria()
{ 
   window.open("http://www.ancora.adm.br/mapa.htm","janela1","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=612,height=443") 
}

function valida(Ref, nTotFotos, nDesc)
{
javascript:window.open("imagem.asp?ref="+Ref+"&TotFotos="+nTotFotos+"&desc="+nDesc,"fotos","left=0, top=60,width=649, height=450") ;
} 

function divOn(div){
	document.getElementById(div).style.border = "1px solid #000000";
	document.getElementById(div).style.background = "#CCCCCC";
	document.getElementById(div).style.textDecoration = "underline";
	document.getElementById(div).style.color = "#000000";
	document.getElementById(div).style.cursor = "pointer";
}

function divOut(div){
	document.getElementById(div).style.border = "1px solid #000000";
	document.getElementById(div).style.background = "#EEEEEE";
	document.getElementById(div).style.textDecoration = "none";
	document.getElementById(div).style.color = "#000000";
}

function enter(evt)
{
    var key_code = evt.keyCode  ? evt.keyCode  :
                       evt.charCode ? evt.charCode :
                       evt.which    ? evt.which    : void 0;


    if (key_code == 13)
    {
        busca();
    }
}

function busca(){
	ref = document.getElementById('txtRef').value;	
	location.href="busca.asp?ref="+ref;	
}

function abreIndique(){
	$("#divIndique").slideDown("fast");	
	document.getElementById("txtNomeDest").focus();
}

function fechaIndique(){
	$("#divIndique").slideUp("fast");
}

function enviarParaAmigo(){
	
	nomeAmigo = document.getElementById('txtNomeDest');
	emailAmigo = document.getElementById('txtEmailDest');
	nome = document.getElementById('txtMeuNome');
	email = document.getElementById('txtMeuEmail');
	url = document.getElementById('hidUrl').value;
	
	$.post("../asp/enviar_indique.asp", {nomeAmigo:nomeAmigo.value,emailAmigo:emailAmigo.value,nome:nome.value,email:email.value,url:url}, function(data){
		alert("Indicação enviada com sucesso!");
		fechaIndique();
	});	
}

function buscaTiposImoveis(segmento){
	
	$("#quadro").html("<br /><br /><br /><img src='../pictures/loading.gif' /><br /><span style='font-family:arial; font-size:12px'>Carregando</span>");
	$.get("../montaTipoImoveis.asp", {segmento:segmento}, function(data){
		$("#quadro").html(data);
	});	

}

function buscaValores(segmento,tipoImovel,dorm){

	$("#quadro").html("<br /><br /><br /><img src='../pictures/loading.gif' /><br /><span style='font-family:arial; font-size:12px'>Carregando</span>");
	$.get("../montaValores.asp", {segmento:segmento,tipoImovel:tipoImovel,dorm:dorm}, function(data){
		$("#quadro").html(data);
	});	

}

function buscaDormitorios(segmento,tipoImovel){
	
	$("#quadro").html("<br /><br /><br /><img src='../pictures/loading.gif' /><br /><span style='font-family:arial; font-size:12px'>Carregando</span>");
	if(tipoImovel!=4 && tipoImovel!=5 && tipoImovel!=8 && tipoImovel!=9 && tipoImovel!=10 && tipoImovel!=11){
		$.get("../montaDormitorios.asp", {segmento:segmento,tipoImovel:tipoImovel}, function(data){
			$("#quadro").html(data);
		});	
	}
	else{
		buscaValores(segmento,tipoImovel,0);
	}

}


function montaListaImoveis(segmento,tipoImovel,dorm,opt){

	$("#quadro").html("<br /><br /><br /><img src='../pictures/loading.gif' /><br /><span style='font-family:arial; font-size:12px'>Carregando</span>");
	$.get("../montaListaImoveis.asp", {segmento:segmento,tipoImovel:tipoImovel,dorm:dorm,opt:opt}, function(data){
		$("#quadro").html(data);
	});	

}



<!--
function FP_preloadImgs() {//v1.0
 var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
 for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }
}

function FP_swapImg() {//v1.0
 var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;
 n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;
 elm.$src=elm.src; elm.src=args[n+1]; } }
}

function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}
// -->