
function toggleDiv(div)
{var divy=$(div);if(divy)
{if(divy.style.display=="none")
{divy.style.display="block";}
else
{divy.style.display="none";}}}
function mudaLingua(lingua){location.href="/portal/changeLang.php?lang="+lingua+"&url="+escape(location.href);}
function showModal(url,title,dimensions)
{MOOdalBox.open(url,title,dimensions);}
function mostraClassificacao(classificacao){cga=document.getElementById("c_gostei_a");cgi=document.getElementById("c_gostei_i");cna=document.getElementById("c_ngostei_a");cni=document.getElementById("c_ngostei_i");if(classificacao==-1){cga.style.display="none";cgi.style.display="block";cna.style.display="none";cni.style.display="block";}else if(classificacao==0){cga.style.display="none";cgi.style.display="block";cna.style.display="block";cni.style.display="none";}else if(classificacao==1){cga.style.display="block";cgi.style.display="none";cna.style.display="none";cni.style.display="block";}else{cga.style.display="none";cgi.style.display="block";cna.style.display="none";cni.style.display="block";}}
function defineClassificacao(nokapa,classificacao,urlValida){var obj=new Object;obj.nokapa=nokapa;obj.classificacao=classificacao;var jSonRequest=new Json.Remote(urlValida,{headers:{'Content-type':'application/x-www-form-urlencoded; charset=utf-8'},onComplete:function(result)
{getRespClassif(classificacao,result);}}).send(obj);}
function getRespClassif(classificacao,result)
{if(result.ok)
{if(result.lg)
{}
mostraClassificacao(classificacao);}else{alert("Não foi possivel executar o seu pedido.");}}
function setPage(url){top.frames['esco'].location.href=url}
function setPage2(url){window.frames['TDD'].location.href=url}
function ml(lg){setPage('i2.php?op=4&lg='+lg)}
function seleccionaAuto(objOrigem,objAlterar,incremento){if(objAlterar!=""){objTemp=document.fp.elements[objAlterar];if(objTemp){if(objTemp.selectedIndex==0){objTemp.selectedIndex=objOrigem.selectedIndex+incremento;}}}}
function trataDivsImoveis(arrayImoveis,seleccionado,divDestino){strImoveis="";strFim="";trataDivsAvanc("");for(i=0;i<arrayImoveis.length;i++){if(seleccionado==arrayImoveis[i][1])
strFim+="<a href='javascript:void(trataDivsImoveis(arrayImoveis,"+arrayImoveis[i][1]+",document.getElementById(\"divImoveis\"),document.getElementById(\"divImoveisTop\")));' class=\"textoAmarelo\" onmouseout=\"window.status='';return true;\" onmouseover=\"window.status='Filtrar "+arrayImoveis[i][0]+"';return true;\"><b>"+arrayImoveis[i][0]+"</b></a><br>";else{strImoveis+="<tr height=23><td><a href='javascript:void(trataDivsImoveis(arrayImoveis,"+arrayImoveis[i][1]+",document.getElementById(\"divImoveis\"),document.getElementById(\"divImoveisTop\")));' class=\"textoAmarelo\" onmouseout=\"window.status='';return true;\" onmouseover=\"window.status='Filtrar "+arrayImoveis[i][0]+"';return true;\"><b>"+arrayImoveis[i][0]+"</b></a></td></tr>";}}
for(j=0;j<arrayImoveis.length;j++){obj=document.getElementById("tcx"+arrayImoveis[j][1]+"Div");if(obj)obj.style.display="none";}
if(j>1)divDestino.style.display="block";if(seleccionado>0){obj=document.getElementById("tcx"+seleccionado+"Div");obj.style.display="block";document.fp.itQS.value=seleccionado;}
divDestino.innerHTML="<table cellspacing=0 cellpadding=2>"+strImoveis+"</table>";redime();}
function setPointer(theRow,thePointerColor,theNormalBgColor)
{if(IE4){var theCells=null;if(thePointerColor==''||typeof(theRow.style)=='undefined')return false;if(typeof(document.getElementsByTagName)!='undefined'){theCells=theRow.getElementsByTagName('td');}else if(typeof(theRow.cells)!='undefined'){theCells=theRow.cells;}else{return false;}
var rowCellsCnt=theCells.length;var currentColor=null;var newColor=null;if(typeof(window.opera)=='undefined'&&typeof(theCells[0].getAttribute)!='undefined'&&typeof(theCells[0].getAttribute)!='undefined'){currentColor=theCells[0].getAttribute('bgcolor');newColor=(currentColor.toLowerCase()==thePointerColor.toLowerCase())?theNormalBgColor:thePointerColor;for(var c=0;c<rowCellsCnt;c++){theCells[c].setAttribute('bgcolor',newColor,0);}}else{currentColor=theCells[0].style.backgroundColor;newColor=(currentColor.toLowerCase()==thePointerColor.toLowerCase())?theNormalBgColor:thePointerColor;for(var c=0;c<rowCellsCnt;c++){theCells[c].style.backgroundColor=newColor;}}}
return true;}
function redime(){if(document.getElementById('dvdireita')&&document.getElementById('dvprincipal')){if(document.getElementById('dvprincipal').scrollHeight<document.getElementById('dvdireita').scrollHeight){document.getElementById('dvprincipal').style.height=document.getElementById('dvdireita').scrollHeight;}}}
function trataDivsAvanc(div){div=document.getElementById('tcx1DivAvanc');if(div)trataDivAvanc(div,'none');div=document.getElementById('tcx11DivAvanc');if(div)trataDivAvanc(div,'none');div=document.getElementById('tcx12DivAvanc')
if(div)trataDivAvanc(div,'none');div=document.getElementById('tcx7DivAvanc')
if(div)trataDivAvanc(div,'none');div=document.getElementById('tcx9DivAvanc');if(div)trataDivAvanc(div,'none');div=document.getElementById('tcx8DivAvanc');if(div)trataDivAvanc(div,'none');div=document.getElementById('tcx10DivAvanc');if(div)trataDivAvanc(div,'none');div=document.getElementById('tcx6DivAvanc');if(div)trataDivAvanc(div,'none');div=document.getElementById('tcx2DivAvanc');if(div)trataDivAvanc(div,'none');div=document.getElementById('tcx3DivAvanc');if(div)trataDivAvanc(div,'none');div=document.getElementById('tcx5DivAvanc');if(div)trataDivAvanc(div,'none');div=document.getElementById('tcx13DivAvanc');if(div)trataDivAvanc(div,'none');div=document.getElementById('tcx14DivAvanc');if(div)trataDivAvanc(div,'none');div=document.getElementById('tcx4DivAvanc');if(div)trataDivAvanc(div,'none');}
function trataDivAvanc(divCaract,accao){divFiltre=document.getElementById("divFiltreAqui");divDireita=document.getElementById('divEsquerda');if(accao==""){if(divCaract.style.display!='none')
divCaract.style.display='none';else{divCaract.style.display='block';divCaract.style.top=divFiltre.offsetTop+divFiltre.scrollHeight-divCaract.scrollHeight-175;divCaract.style.left=divDireita.offsetLeft-(180+divDireita.offsetLeft);}}else{divCaract.style.display=accao;divCaract.style.top=divFiltre.offsetTop+divFiltre.scrollHeight-divCaract.scrollHeight-175;divCaract.style.left=divDireita.offsetLeft-(180+divDireita.offsetLeft);}}
function redimFrameFavoritos(numFavoritos,frameFav){if(numFavoritos==1)
frameFav.style.height=100;else if(numFavoritos==2)
frameFav.style.height=162;else if(numFavoritos>=3)
frameFav.style.height=225;}
function mv_swapImgRestore(){var i,x,a=document.mv_sr;for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)x.src=x.oSrc;}
function mv_preloadImages(){var d=document;if(d.images){if(!d.mv_p)d.mv_p=new Array();var i,j=d.mv_p.length,a=mv_preloadImages.arguments;for(i=0;i<a.length;i++)
if(a[i].indexOf("#")!=0){d.mv_p[j]=new Image;d.mv_p[j++].src=a[i];}}}
function mv_findObj(n,d){var p,i,x;if(!d)
d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.getElementById)x=d.getElementById(n);for(i=0;!x&&i<d.forms.length;i++)
x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=mv_findObj(n,d.layers[i].document);return x;}
function mv_swapImage(){var i,j=0,x,a=mv_swapImage.arguments;document.mv_sr=new Array;for(i=0;i<(a.length-2);i+=3)
if((x=mv_findObj(a[i]))!=null){document.mv_sr[j++]=x;if(!x.oSrc)x.oSrc=x.src;x.src=a[i+2];}}
function mv_showHideLayers(){var i,p,v,obj,args=mv_showHideLayers.arguments;for(i=0;i<(args.length-2);i+=3){argumento=args[i];if((obj=mv_findObj(argumento))!=null){v=args[i+2];if(obj.style){obj=obj.style;v=(v=='show')?'visible':(v='hide')?'hidden':v;}
obj.visibility=v;}}}
function mv_displayStatusMsg(msgStr){window.status=msgStr;document.mv_returnValue=true;}
function mudaImagem(){args=mudaImagem.arguments;objImg=document.getElementById(args[2]);objImg.src=eval(args[1]+"_"+args[0]+".src");}
function trataCxValor(obj,ordemCValor,maisUm,ordemMaisUm){if(obj.options[obj.selectedIndex].value==ordemCValor){document.getElementById(ordemCValor+'_div').style.display='block';}else{document.getElementById(ordemCValor+'_div').style.display='none';}
if(maisUm){if((obj.options[obj.selectedIndex].text).indexOf('+1')!=-1)
document.getElementById(ordemMaisUm).checked=true;else document.getElementById(ordemMaisUm).checked=false;}}
function destacaOn(obj){obj.className='tableSelectON';}
function destacaOff(obj){obj.className='tableSelectOFF';}
