var uriImagenes = ""; var inmuebleSel; var tipoOperacionBusqueda = "V"; var iFrameMapaCargado = false; var iFrameMapaVideoCargado = false; var anteriorViviendaTipoID = null; var anteriorInfoInmueblePromoID = null; var CargarLista = false; var CargarListaPromociones = false; var globalOrden = 1; var timeOutID = null; var globalInmuebleID = null; var quitarDestacados = false; var contadorMarcadores = 0; var offsetListado = 0; var completados = 0; var lista = ""; var mostrarDatosPrimerInmueble = false; var mostrarDatosUltimoInmueble = false; var globalCambiarEnlacesNavegacion = false; var anteriorIDInmueble = null; var globalDeMiLista = false; var globalDesdeMapa = false; var globalDesdeDestacados = false; var globlaMostrarRectangulo = false; var idAnteriorGrid = null; var tiempoTimeOut = 30; var timeOutGuardarLista = null; var timeOutRecuperarLista = null; var timeOutEliminarLista = null; var timeOutAnyadirALista = null; var timeOutcargarDatosInmueble = null; var timeOutCargarInmuebles = null; var timeOutCargarInmueblesMapa = null; var timeOutIrAGrupoInmuebles = null; var timeOutIrAGrupoPromociones = null; var timeOutBuscarInmuebles = null; var timeOutEnviarCorreo = null; var timeOutIDRectangle = null; var scrollFotosv = new Object(); function limpiarTimeOuts(){ window.clearTimeout(timeOutGuardarLista); window.clearTimeout(timeOutRecuperarLista); window.clearTimeout(timeOutEliminarLista); window.clearTimeout(timeOutAnyadirALista); window.clearTimeout(timeOutcargarDatosInmueble); window.clearTimeout(timeOutCargarInmuebles); window.clearTimeout(timeOutIrAGrupoInmuebles); window.clearTimeout(timeOutIrAGrupoPromociones); window.clearTimeout(timeOutBuscarInmuebles); window.clearTimeout(timeOutEnviarCorreo); window.clearTimeout(timeOutCargarInmueblesMapa); timeOutGuardarLista = null; timeOutRecuperarLista = null; timeOutEliminarLista = null; timeOutAnyadirALista = null; timeOutcargarDatosInmueble = null; timeOutCargarInmuebles = null; timeOutIrAGrupoInmuebles = null; timeOutIrAGrupoPromociones = null; timeOutBuscarInmuebles = null; timeOutEnviarCorreo = null; timeOutCargarInmueblesMapa = null;}
function CargarGrid(){ CargarLista = true;}
var foto1_gran = new Image(); var foto2_gran = new Image(); var foto3_gran = new Image(); var foto4_gran = new Image(); var foto5_gran = new Image(); var foto6_gran = new Image(); var plano1 = new Image(); var plano2 = new Image(); var plano3 = new Image(); var foto_promo1_gran = new Image(); var foto_promo2_gran = new Image(); var foto_promo3_gran = new Image(); var foto_promo4_gran = new Image(); var foto_promo5_gran = new Image(); var foto_promo6_gran = new Image(); function showImage(queImg){ var foto_ini = null; if (queImg == 1) { foto_ini = foto_promo1_gran.src; ant = 0; if (foto_promo2_gran)
post = 2; else
post = 0;}
else
if (queImg == 2) { foto_ini = foto_promo2_gran.src; ant = 1; if (foto_promo3_gran)
post = 3; else
post = 0;}
else
if (queImg == 3) { foto_ini = foto_promo3_gran.src; ant = 2; if (foto_promo4_gran)
post = 4; else
post = 0;}
else
if (queImg == 4) { foto_ini = foto_promo4_gran.src; ant = 3; if (foto_promo5_gran)
post = 5; else
post = 0;}
else
if (queImg == 5) { foto_ini = foto_promo5_gran.src; ant = 4; if (foto_promo6_gran)
post = 6; else
post = 0;}
else
if (queImg == 6) { foto_ini = foto_promo6_gran.src; ant = 5; post = 0;}
texto = "<div class='box'  style='text-align:center;'>"; if (ant > 0)
texto += "<span class='ab' onclick=\"javascript:showImage('" + ant + "')\">" + _t_previous + "</span>"; else
texto += _t_previous; if (post > 0) { texto += " | <span class='ab' onclick=\"javascript:showImage('" + post + "')\">" + _t_next + "</span>";}
else
texto += " | " + _t_next; texto += "<br /><div id='container_foto_promo' style=\"background:url('/img/rel_interstitial_loading.gif') 50% 50% no-repeat;\"><img id='popup_promo' src='" + foto_ini + "' onload=\"document.getElementById('container_foto_promo').style.backgroundImage='none';\"></div></div>"; panelImagen.setHeader(_t_imagenes); panelImagen.setBody(texto); panelImagen.render(document.body); panelImagen.show();}
function guardarMiLista(id_lista){ mostrarPanelEspere(_t_saving_list); endTimeOut(timeOutGuardarLista); timeOutGuardarLista = beginTimeOut(tiempoTimeOut); request = '/inmuebles/' + atp_version + '/json/lista/json_guardar_lista.php?ID=' + id_lista + "&timeout=" + timeOutGuardarLista; aObj = new JSONscriptRequest(request); aObj.buildScriptTag(); aObj.addScriptTag();}
function showPlanoInmueble(quePlano){ var alto = 500; var ancho = 700; var plano_ini = new Image(); if (quePlano == 1) { plano_ini = plano1; ant = 0; if (plano2)
post = 2; else
post = 0;}
else
if (quePlano == 2) { plano_ini = plano2; ant = 1; if (plano3)
post = 3; else
post = 0;}
else
if (quePlano == 3) { plano_ini = plano3; ant = 2; post = 0;}
var maxHeight = plano1.height; if (plano2)
maxHeight = Math.max(plano1.height, plano2.height); if (plano3)
maxHeight = Math.max(maxHeight, plano3.height); if (maxHeight < alto)
alto = maxHeight + 50; var maxWidth = plano1.width; if (plano2)
maxWidth = Math.max(plano1.width, plano2.width); if (plano3)
maxWidth = Math.max(maxWidth, plano3.width); if (maxWidth < ancho)
ancho = maxWidth + 50; alto = 500; ancho = 700; var panelPlano = new YAHOO.widget.Panel("panel_plano", { width: +ancho + "px", height: +alto + "px", fixedcenter: true, constraintoviewport: true, underlay: "none", close: true, visible: false, draggable: true, modal: false
}); texto = "<div style='text-align:center; width:" + ancho + "; height:" + alto + "px;'>"; if (ant > 0)
texto += "<span class='ab' onclick=\"javascript:showPlanoInmueble('" + ant + "')\">" + _t_previous + "</span>"; else
texto += _t_previous; if (post > 0)
texto += " | <span class='ab' onclick=\"javascript:showPlanoInmueble('" + post + "')\">" + _t_next + "</span>"; else
texto += " | " + _t_next; ancho -= 30; alto -= 30; texto += "<div style='overflow:auto; width:" + ancho + "; height:" + alto + "px'><img id='popup_plano_inmueble' src='" + plano_ini.src + "'></div></div>"; panelPlano.setHeader(_t_plano); panelPlano.setBody(texto); panelPlano.render(document.body); panelPlano.show();}
function showImageInmueble(queImg){ var foto_ini = null; if (queImg == 1) { foto_ini = foto1_gran.src; ant = 0; if (foto2_gran)
post = 2; else
post = 0;}
else
if (queImg == 2) { foto_ini = foto2_gran.src; ant = 1; if (foto3_gran)
post = 3; else
post = 0;}
else
if (queImg == 3) { foto_ini = foto3_gran.src; ant = 2; if (foto4_gran)
post = 4; else
post = 0;}
else
if (queImg == 4) { foto_ini = foto4_gran.src; ant = 3; if (foto5_gran)
post = 5; else
post = 0;}
else
if (queImg == 5) { foto_ini = foto5_gran.src; ant = 4; if (foto6_gran)
post = 6; else
post = 0;}
else
if (queImg == 6) { foto_ini = foto6_gran.src; ant = 5; post = 0;}
texto = "<div class='caja'  style='text-align:center;'>"; if (ant > 0) { texto += "<span class='ab' onclick=\"javascript:showImageInmueble('" + ant + "')\">" + _t_previous + "</span>";}
else
texto += _t_previous; if (post > 0) { texto += " | <span class='ab' onclick=\"javascript:showImageInmueble('" + post + "')\">" + _t_next + "</span>";}
else
texto += " | " + _t_next; texto += "<br /><div id='container_foto_inmueble' style=\"background:url('/img/rel_interstitial_loading.gif') 50% 50% no-repeat;\"><img id='popup_imagenes_inmueble' src='" + foto_ini + "' onload=\"document.getElementById('container_foto_inmueble').style.backgroundImage='none';\"></div></div>"; panelImagen.setHeader(_t_imagenes); panelImagen.setBody(texto); panelImagen.render(document.body); panelImagen.show();}
function recuperarMiLista(){ lista = document.getElementById('codigo_lista').value; if (lista != '') { mostrarPanelEspere(_t_recup_list); endTimeOut(timeOutRecuperarLista); timeOutRecuperarLista = beginTimeOut(tiempoTimeOut); request = '/inmuebles/' + atp_version + '/json/lista/json_recuperar_lista.php?ln=' + _t_l + '&codigo=' + lista + "&timeout=" + timeOutRecuperarLista; aObj = new JSONscriptRequest(request); aObj.buildScriptTag(); aObj.addScriptTag();}
}
function proccesRequestGuardarMiLista(jData){ if (jData != null) { if (jData.timeout != timeOutGuardarLista)
return;}
else { endTimeOut(timeOutGuardarLista); return;}
endTimeOut(timeOutGuardarLista); if (jData != null) { if (jData.resultado[0].valor == 0) { panelEspere.hide(); panelImagen.setHeader(_t_saved_list); texto = _t_saved_list_d.replace("//clave//", jData.resultado[0].clave); panelImagen.setBody(texto); panelImagen.render(document.body); panelImagen.show(); div = document.getElementById('nombre_lista'); div.innerHTML = _t_list_key.replace("//clave//", jData.resultado[0].clave); div = document.getElementById('recuperar_lista'); div.innerHTML = _t_recuperar_lista + ": <input type='text' id='codigo_lista'  style='width:60px;'><input type='button' value='" + _t_aceptar + "' onclick='recuperarMiLista()'>";}
}
else
panelEspere.hide();}
function proccesRequestEliminarMiLista(jData){ if (jData != null) { if (jData.timeout != timeOutEliminarLista)
return;}
else { endTimeOut(timeOutEliminarLista); return;}
endTimeOut(timeOutEliminarLista); if (panelEspere)
panelEspere.hide(); if (jData != null) { if (jData.resultado[0].valor == 0) { var listado = document.getElementById('listado_mi_lista'); var div = document.getElementById('datos_inmueble_mi_lista_' + jData.resultado[0].ID); if (div) { listado.removeChild(div); cuantosEnMiLista--; cambiarLabelMiLista();}
}
}
}
function proccesRequestErrorRecuperarLista(jData){ if (jData != null) { if (jData.timeout != timeOutRecuperarLista)
return;}
else { endTimeOut(timeOutRecuperarLista); return;}
endTimeOut(timeOutRecuperarLista); if (panelEspere)
panelEspere.hide(); alert(_t_lista_no_existe);}
function proccesRequestRecuperarMiLista(jData){ if (jData != null) { if (jData.timeout != timeOutRecuperarLista)
return;}
else { endTimeOut(timeOutRecuperarLista); return;}
endTimeOut(timeOutRecuperarLista); if (jData != null) { var grid = document.getElementById('grid_mi_lista'); var listado = document.getElementById('listado_mi_lista'); if (listado) { while (listado.firstChild) { listado.removeChild(listado.firstChild);};}
cuantosEnMiLista = 0; for (i = 0; i < jData.datos.length; i++) { anyadirInmuebleALista(jData.datos[i]);}
var div = document.getElementById('nombre_lista'); div.innerHTML = _t_list_key.replace("//clave//", lista); ; _t_list_key
div = document.getElementById('recuperar_lista'); div.innerHTML = _t_recuperar_lista + ": <input type='text' id='codigo_lista'  style='width:60px;'><input type='button' value='" + _t_aceptar + "' onclick='recuperarMiLista()'>"; cambiarLabelMiLista();}
else
alert(_t_lista_no_existe); panelEspere.hide();}
function siguienteEnGrid(id){ var grid = document.getElementById('body_id'); var listado = document.getElementById('listado_inmuebles'); var x = listado.childNodes; var encontrado = false; var i = 0; var scroll = 0; while (!encontrado && i < x.length) { if (x[i].nodeName.toLowerCase() == 'div') { if (x[i].id == 'datos_inmueble_' + id) { encontrado = true; var el = null; if (x[i].nextSibling)
el = x[i].nextSibling; if (el && el.nodeName.toLowerCase() != 'div') { if (el.nextSibling)
el = el.nextSibling;}
}
}
i++;}
if (el) { if (el.id && el.nodeName.toLowerCase() == 'div') { var split_array = el.id.split("_"); panel.hide(); cargarDatosInmueble(split_array[2], true, false, false, false); scrollInmueble(split_array[2]);}
else { var nav = document.getElementById('nav_sup_next'); if (nav) { mostrarDatosPrimerInmueble = true; if (nav.click)
nav.click(); else
eval(nav.toString().slice(11, nav.toString().length));}
else
alert(_t_no_mas_i);}
}
else { var nav = document.getElementById('nav_sup_next'); if (nav) { mostrarDatosPrimerInmueble = true; if (nav.click)
nav.click(); else
eval(nav.toString().slice(11, nav.toString().length));}
else
alert(_t_no_mas_i);}
}
function scrollInmueble(id){ var grid = document.getElementById('body_id'); var listado = document.getElementById('listado_inmuebles'); var x = listado.childNodes; var encontrado = false; var i = 0; var scroll = document.getElementById('tabcontainer').scrollTop + 100; while (!encontrado && i < x.length) { if (x[i].nodeName.toLowerCase() == 'div') { if (x[i].id == 'datos_inmueble_' + id) { encontrado = true; var el = null; if (x[i].nextSibling)
el = x[i].nextSibling; if (el && el.nextSibling)
el = el.nextSibling;}
else
scroll += myDivHeight(x[i]) + 10;}
i++;}
try{ if (document.body && document.body.scrollTop)
document.body.scrollTop = scroll; if (document.documentElement && document.documentElement.scrollTop)
document.documentElement.scrollTop = scroll; if (window.pageYOffset)
window.pageYOffset = scroll;}
catch (e) {;}
}
function myDivHeight(el){ divHeight = 0; if (el) { if (el.offsetHeight) { divHeight = el.offsetHeight;}
else
if (el.style.pixelHeight) { divHeight = el.style.pixelHeight;}
}
return divHeight;}
function anteriorEnGrid(id){ var grid = document.getElementById('grid_inmuebles'); var listado = document.getElementById('listado_inmuebles'); var x = listado.childNodes; var encontrado = false; var i = 0; var scroll = 0; while (!encontrado && i < x.length) { if (x[i].nodeName.toLowerCase() == 'div') { if (x[i].id == 'datos_inmueble_' + id) { encontrado = true; var el = null; if (x[i].previousSibling)
el = x[i].previousSibling; if (el && el.nodeName.toLowerCase() != 'div') { if (el.previousSibling)
el = el.previousSibling;}
}
}
i++;}
if (el) { if (el.id && el.nodeName.toLowerCase() == 'div') { var split_array = el.id.split("_"); panel.hide(); cargarDatosInmueble(split_array[2], true, false, false, false); scrollInmueble(split_array[2]);}
else { var nav = document.getElementById('nav_sup_previous'); if (nav) { mostrarDatosUltimoInmueble = true; if (nav.click)
nav.click(); else
eval(nav.toString().slice(11, nav.toString().length));}
else
alert(_t_no_mas_i);}
}
else { var nav = document.getElementById('nav_sup_previous'); if (nav) { mostrarDatosUltimoInmueble = true; if (nav.click)
nav.click(); else
eval(nav.toString().slice(11, nav.toString().length));}
else
alert(_t_no_mas_i);}
}
function scrollInmuebleMiLista(id){ var grid = document.getElementById('grid_mi_lista'); var listado = document.getElementById('listado_mi_lista'); var x = listado.childNodes; var encontrado = false; var i = 0; var scroll = 0; while (!encontrado && i < x.length) { if (x[i].nodeName.toLowerCase() == 'div') { if (x[i].id == 'datos_inmueble_mi_lista_' + id) { encontrado = true; var el = null; if (x[i].nextSibling)
el = x[i].nextSibling; if (el && el.nextSibling)
el = el.nextSibling;}
else
scroll += myDivHeight(x[i]);}
i++;}
return scroll;}
function anteriorEnLista(id){ var grid = document.getElementById('grid_mi_lista'); var listado = document.getElementById('listado_mi_lista'); var x = listado.childNodes; var encontrado = false; var i = 0; var scroll = 0; while (!encontrado && i < x.length) { if (x[i].nodeName.toLowerCase() == 'div') { if (x[i].id == 'datos_inmueble_mi_lista_' + id) { encontrado = true; var el = null; if (x[i].previousSibling)
el = x[i].previousSibling; if (el && el.nodeName.toLowerCase() != 'div') { if (el.previousSibling)
el = el.previousSibling;}
}
}
i++;}
if (el) { if (el.id && el.nodeName.toLowerCase() == 'div') { var split_array = el.id.split("_"); panel.hide(); cargarDatosInmueble(split_array[4], true, true, false, false); grid.scrollTop = scrollInmuebleMiLista(split_array[4]);}
else { alert(_t_no_mas_l);}
}
else
alert(_t_no_mas_l);}
function siguienteEnLista(id){ var grid = document.getElementById('grid_mi_lista'); var listado = document.getElementById('listado_mi_lista'); var x = listado.childNodes; var encontrado = false; var i = 0; var scroll = 0; while (!encontrado && i < x.length) { if (x[i].nodeName.toLowerCase() == 'div') { if (x[i].id == 'datos_inmueble_mi_lista_' + id) { encontrado = true; var el = null; if (x[i].nextSibling)
el = x[i].nextSibling; if (el && el.nodeName.toLowerCase() != 'div') { if (el.nextSibling)
el = el.nextSibling;}
}
}
i++;}
if (el) { if (el.id && el.nodeName.toLowerCase() == 'div') { var split_array = el.id.split("_"); panel.hide(); cargarDatosInmueble(split_array[4], true, true, false, false); grid.scrollTop = scrollInmuebleMiLista(split_array[4]);}
else { alert(_t_no_mas_l);}
}
else
alert(_t_no_mas_l);}
function proccesRequestNoExisteInmueble(jData){ if (jData != null) { if (jData.timeout != timeOutcargarDatosInmueble)
return;}
else { endTimeOut(timeOutcargarDatosInmueble); return;}
endTimeOut(timeOutcargarDatosInmueble); if (panelEspere)
panelEspere.hide(); var listado = null; var div = null; if (globalDeMiLista == false) { listado = document.getElementById('listado_inmuebles'); div = document.getElementById('datos_inmueble_' + jData.id); if ((listado) && (div)) { listado.removeChild(div);}
}
else { quitarAMiLista(jData.id);}
alert(_t_i_eliminado);}
function cambiarTab(tabIndex){ var enlaces = document.getElementById('atp_mas_info_tabs'); var tabs = document.getElementById('atp_mas_info_container_tabs'); var x = tabs.childNodes; var as = enlaces.childNodes; for (var i = 0; i < x.length; i++) { x[i].style.display = "none";}
for (var i = 0; i < as.length; i++) { if (as[i].nodeName.toLowerCase() == 'span')
as[i].className = "no_select";}
x[tabIndex].style.display = "inline"; as[tabIndex * 2].className = "selected"; document.getElementById('scroll_datos').scrollTop = 0;}
function setMapaCargado(){ iFrameMapaCargado = true;}
function setVideoCargado(){ iFrameMapaVideoCargado = true;}
function cambiarTabMapa(tab, latitud, longitud){ if (iFrameMapaCargado == false) { var el = document.getElementById('caja_mapa'); var texto = "<iframe src='/iframe_mapa_tab.php?ln=" + _t_l + "&latitud=" + latitud + "&longitud=" + longitud + "' frameborder='0' scrolling='no' style='border:0; width:630px; height:300px; margin:0px; margin-bottom:10px; padding:0px;'></iframe>"; el.innerHTML = texto;}
cambiarTab(tab);}
function cambiarTabVideo(tab, id, idPromocion){ if (iFrameMapaVideoCargado == false) { var param; if (id)
param = "id="+id; else
param = "id_promocion="+idPromocion; var el = document.getElementById('caja_video'); var texto = "<iframe src='/" + atp_version + "/video.php?" + param + "' frameborder='0' scrolling='no' style='border:0; width:630px; height:350px; margin:0px; margin-bottom:10px; padding:0px; z-index:10001'></iframe>"; el.innerHTML = texto;}
cambiarTab(tab);}
function imprimirTextoEnviarCorreo(){ var texto = "<span style='margin-left:10px;'><span class='ab' style='text-decoration:none;' onclick='javascript:scrollCorreo();'>"; texto += "<img style='vertical-align:middle;'  src='/img/mail6.gif' style='border:0' alt='" + _t_inquiry_infor_alt + "'> " + _t_inquiry_infor + "</span></span>"; return texto;}
function imprimirTextoImprimir(id){ var texto = "<span style='margin-left:10px;'><a class='ab' style='text-decoration:none;' href='/inmuebles/imprimir.php?ln=" + _t_l + "&tipo_op=" + tipoOperacionBusqueda + "&id=" + id + "' target='_blank'>"; texto += "<img style='vertical-align:middle;'  src='/img/print.png' style='border:0' alt='" + _t_print_alt + "'> " + _t_print + "</a></span>"; return texto;}
function imprimirTextoAddLista(id){ var texto = "<span style='margin-left:10px;'><span class='ab' style='text-decoration:none;' onclick='javascript:anyadirAMiLista(" + id + ");'>"; texto += "<img style='vertical-align:middle;' src='/img/add_lista.png' style='border:0' alt='" + _t_add_list_alt + "'> " + _t_add_list + "</span></span>"; return texto;}
function imprimirTextoDatos(jData){ var localidad = jData.datos[0].COD_POSTAL + " - " + jData.datos[0].POBLACION + " (" + jData.datos[0].PROVINCIA + ")"; if (jData.datos[0].NUEVO == 'S')
nuevo = _t_new; else
nuevo = _t_second_hand; var texto = "<div class='atpTab' id='atp_mas_info_datos'  style='display:inline;'>"; texto += "<table width='98%' cellpadding='0' cellspacing='0'><tr><td>"; if (((globalTipoPagina == "INDEX") || (globalTipoPagina == "COMPARTIDOS")) && (esATP)){ texto += "<div class='caja' id='popup_inmobiliaria2'>"; texto += "<table border=0 width=100%><tr>"; texto += "<td width='66%' valign='top'><span class='alt1'>"; var localidad_usuario = jData.datos[0].COD_POSTAL_USUARIO + " - " + jData.datos[0].LOC_USUARIO + " (" + jData.datos[0].PROV_USUARIO + ")"; if (jData.datos[0].TIPO_USUARIO == 'P')
texto += "Preguntar por: " + jData.datos[0].NOMBRE_USUARIO + "<br />"; else { texto += jData.datos[0].DENOMINACION + "<br />"; texto += jData.datos[0].DIR_USUARIO + " " + localidad_usuario + "<br />";}
texto += _t_mail + ": " + jData.datos[0].CORREO + "<br />"; texto += _t_phone + ": " + jData.datos[0].TELEFONO + "</span>"; texto += "</td>"; texto += "<td>"; if (jData.datos[0].LOGO != "")
texto += "<img border ='0' style='width:150px' src='/inmobiliarias/images/" + jData.datos[0].LOGO + "'>"; texto += "</td></tr></table>"; texto += "</div><!-- popup_inmobiliaria2 -->";}
var tipo_operacion = _t_for_sale; if (tipoOperacionBusqueda == "A")
tipo_operacion = _t_for_rent; else
if (tipoOperacionBusqueda == "AC")
tipo_operacion = _t_for_rent_to_buy; var aAlt = new ATP_alternateClass("row", 2); texto += "<div class='caja_datos' id='atp_mas_info_desc'>"; texto += "<table width='100%' style='border:0px; border-collapse:collapse;'>"; texto += "<tr>"; texto += "<td colspan='2'><span class='alt2'>" + nuevo + " | " + tipo_operacion + "</span></td>"; texto += "</tr>"; texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_p_address + ":</td>"; texto += "<td>" + jData.datos[0].DIRECCION + " " + localidad + "</td>"; texto += "</tr>"; texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_type + ":</td>"; texto += "<td>" + jData.datos[0].TIPO_PROPIEDAD + "</td>"; texto += "</tr>"; if (jData.datos[0].HABITACIONES > 0) { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_rooms + ":</td>"; texto += "<td>" + jData.datos[0].HABITACIONES + "</td>"; texto += "</tr>";}
if (jData.datos[0].BANYOS > 0) { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_banys + ":</td>"; texto += "<td>" + jData.datos[0].BANYOS + "</td>"; texto += "</tr>";}
if (jData.datos[0].ASEOS > 0) { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_aseos + ":</td>"; texto += "<td>" + jData.datos[0].ASEOS + "</td>"; texto += "</tr>";}
if (jData.datos[0].METROS > 0) { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_metros + ":</td>"; texto += "<td>" + jData.datos[0].METROS + "</td>"; texto += "</tr>";}
if (jData.datos[0].METROS_CONSTRUIDOS > 0) { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_metros_cons + ":</td>"; texto += "<td>" + jData.datos[0].METROS_CONSTRUIDOS + "</td>"; texto += "</tr>";}
if (jData.datos[0].GARAJE > 0) { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_parkings + ":</td>"; texto += "<td>" + jData.datos[0].GARAJE + "</td>"; texto += "</tr>";}
if (jData.datos[0].TERRAZA > 0) { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_terraza + ":</td>"; texto += "<td>" + jData.datos[0].TERRAZA + "</td>"; texto += "</tr>";}
if (jData.datos[0].PISCINA == "S") { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_s_pool + ":</td>"; texto += "<td>" + _t_yes + "</td>"; texto += "</tr>";}
if (jData.datos[0].ASCENSOR == "S") { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_ascensor + ":</td>"; texto += "<td>" + _t_yes + "</td>"; texto += "</tr>";}
if (jData.datos[0].REFERENCIA != "") { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_ref + ":</td>"; texto += "<td>" + jData.datos[0].REFERENCIA + "</td>"; texto += "</tr>";}
if (jData.datos[0].DESCRIPCION != "") { texto += "<tr class='" + aAlt.alternate() + "'>"; var cs = 2; if (_t_l == "en") { cs = 1; texto += "<td><input type='button' onclick=\"javascript:translate('d', " + jData.datos[0].ID + ")\" value='Translate'></td>";}
texto += "<td colspan='" + cs + "'><span id='d_" + jData.datos[0].ID + "'>" + jData.datos[0].DESCRIPCION + "</span>"; texto += "</tr>";}
texto += "</table>"; texto += textoOtrosPrecios(tipoOperacionBusqueda, jData.datos[0]); texto += "</div><!-- otrosdatos -->"; texto += "</td></tr></table>"; texto += "</div>"; return texto;}
function proccesRequestTranslate(jData){ if (jData != null) { if (jData.timeout != timeOutcargarDatosInmueble)
return;}
else { endTimeOut(timeOutcargarDatosInmueble); return;}
endTimeOut(timeOutcargarDatosInmueble); if (jData != null) { panelEspere.hide(); if (jData.what == "d") { var spanId = "d_" + jData.id; var el = document.getElementById(spanId); if (el)
el.innerHTML = jData.m;}
else { var spanId = "dp_" + jData.id; var el = document.getElementById(spanId); if (el)
el.innerHTML = jData.dp; spanId = "fp_" + jData.id; el = document.getElementById(spanId); if (el)
el.innerHTML = jData.fp; spanId = "fpp_" + jData.id; el = document.getElementById(spanId); if (el)
el.innerHTML = jData.fpp;}
}
}
function translate(what, id){ mostrarPanelEspere('Translating'); endTimeOut(timeOutcargarDatosInmueble); timeOutcargarDatosInmueble = beginTimeOut(tiempoTimeOut); request = '/traductor/translate.php?what=' + what + '&timeout=' + timeOutcargarDatosInmueble + "&id=" + id; aObj = new JSONscriptRequest(request); aObj.buildScriptTag(); aObj.addScriptTag();}
function imprimirTextoVideo(jData){ var texto = ""; if (((jData.datos[0].ID_PROMOCION == "") && (jData.datos[0].VIDEO)) || ((jData.datos[0].ID_PROMOCION != "") && (jData.datos[0].VIDEO_PROMO)))
{ texto = "<div class='atpTab' id='atp_mas_info_video'  style='display:none;>"; texto += "<table width='98%'  cellpadding='0' cellspacing='0'><tr><td>"; texto += "<div class='caja_datos' id='caja_video'>"; texto += "</div>"; texto += "</td></tr></table>"; texto += "</div>";}
return texto;}
function imprimirTextoMapa(){ texto = "<div class='atpTab' id='atp_mas_info_mapa'  style='display:none;'>"; texto += "<table width='98%'  cellpadding='0' cellspacing='0'><tr><td>"; texto += "<div class='caja_datos' id='caja_mapa'>"; texto += "</div>"; texto += "</td></tr></table>"; texto += "</div>"; return texto;}
function imprimirTextoAnunciante(jData){ var localidad_usuario = jData.datos[0].COD_POSTAL_USUARIO + " - " + jData.datos[0].LOC_USUARIO + " (" + jData.datos[0].PROV_USUARIO + ")"; var texto = ""; var ops = ""; if (((globalTipoPagina == "INDEX") || (globalTipoPagina == "COMPARTIDOS")) && (esATP)){ texto = "<div class='atpTab' id='atp_mas_info_contacto'  style='display:none;'>"; texto += "<table width='98%'  cellpadding='0' cellspacing='0'><tr><td>"; if (jData.datos[0].LOGO != '') { texto += "<div class='caja_datos' id='popup_logo'>"; if (jData.datos[0].DIRECTORIO != '') { if (_t_l != "es")
ops = "?ln=" + _t_l; texto += "<a target='_blank' href='/" + jData.datos[0].DIRECTORIO + "/" + ops + "'><span id='container_logo_empresa' style=\"background:url('/img/rel_interstitial_loading.gif') 50% 50% no-repeat;\"><img border ='0' src='/inmobiliarias/images/" + jData.datos[0].LOGO + "' alt='logo empresa' onload=\"document.getElementById('container_logo_empresa').style.backgroundImage='none';\"></span></a><br />"; texto += "<a target='_blank' href='/" + jData.datos[0].DIRECTORIO + "/" + ops + "'>" + _t_vea_todos + "</a>";}
else { texto += "<span id='container_logo_empresa' style=\"background:url('/img/rel_interstitial_loading.gif') 50% 50% no-repeat;\"><img border ='0' src='/inmobiliarias/images/" + jData.datos[0].LOGO + "' alt='logo empresa' onload=\"document.getElementById('container_logo_empresa').style.backgroundImage='none';\"></span>";}
texto += "</div>";}
texto += "<div class='caja' id='popup_inmobiliaria'><span class='alt1'>"; if (jData.datos[0].TIPO_USUARIO == 'P')
texto += "Preguntar por: " + jData.datos[0].NOMBRE_USUARIO + "<br />"; else { texto += jData.datos[0].DENOMINACION + "<br />"; texto += jData.datos[0].DIR_USUARIO + " " + localidad_usuario + "<br />";}
texto += _t_mail + ": " + jData.datos[0].CORREO + "<br />"; texto += _t_phone + ": " + jData.datos[0].TELEFONO + "</span>"; texto += "</div><!-- popup_inmobiliaria -->"; texto += "</td></tr></table>"; texto += "</div>";}
return texto;}
function imprimirTextoCorreo(jData){ var texto = ""; if (globalTipoPagina != "MISINMUEBLES") { texto = "<table width='98%'  cellpadding='0' cellspacing='0'><tr><td>"; texto += "<div class='caja' id='caja_correo'><div class='caption'>" + _t_m_c + "</div>"; texto += ATPMailWindow(jData.datos[0].ID, jData.datos[0].REFERENCIA, true); texto += "</div>"; texto += "</td></tr></table>";}
return texto;}
function imprimirTextoNavegacion(jData, vieneDeHistory){ textoNav = ""; if ((globalCambiarEnlacesNavegacion) && (vieneDeHistory == false)) { if (globalDesdeDestacados == false) { if (globalDeMiLista == false) { textoNav += "<a href='javascript:anteriorEnGrid(" + jData.datos[0].ID + ");'>" + _t_previous + "</a>"; textoNav += " | <a href='javascript:siguienteEnGrid(" + jData.datos[0].ID + ");'>" + _t_next + "</a>";}
else { textoNav += " <a href='javascript:anteriorEnLista(" + jData.datos[0].ID + ");'>" + _t_previous_l + "</a>"; textoNav += " | <a href='javascript:siguienteEnLista(" + jData.datos[0].ID + ");'>" + _t_next_l + "</a>";}
}
anteriorIDInmueble = jData.datos[0].ID;}
else { if ((globalDesdeDestacados == false) && (vieneDeHistory = false)) { if (globalDeMiLista == false) { textoNav += "<a href='javascript:anteriorEnGrid(" + anteriorIDInmueble + ");'>" + _t_previous + "</a>"; textoNav += " | <a href='javascript:siguienteEnGrid(" + anteriorIDInmueble + ");'>" + _t_next + "</a>";}
else { textoNav += " <a href='javascript:anteriorEnLista(" + anteriorIDInmueble + ");'>" + _t_previous_l + "</a>"; textoNav += " | <a href='javascript:siguienteEnLista(" + anteriorIDInmueble + ");'>" + _t_next_l + "</a>";}
}
}
return textoNav;}
function proccesRequestDatos(jData){ var vieneDeHistory = false; if (timeOutcargarDatosInmueble == null)
vieneDeHistory = true; if (jData != null) { if ((jData.timeout != timeOutcargarDatosInmueble) && (timeOutcargarDatosInmueble != null))
return;}
else { endTimeOut(timeOutcargarDatosInmueble); return;}
endTimeOut(timeOutcargarDatosInmueble); timeOutcargarDatosInmueble = null; if (panelEspere)
panelEspere.hide(); var localidad; var texto = ""; var nuevo; if (jData != null) { var div; if (globalInmuebleID!=null ) { if (inmuebleSel) { inmuebleSel.style.background = ''; inmuebleSel.style.paddingTop = "";}
}
if (globalDeMiLista == false)
div = document.getElementById('datos_inmueble_' + jData.datos[0].ID); else
div = document.getElementById('datos_inmueble_mi_lista_' + jData.datos[0].ID); if (div) { div.style.background = 'url(/img/selected.gif) no-repeat'; div.style.paddingTop = "25px"; inmuebleSel = div;}else
inmuebleSel = null; if (jData.datos[0].ID_PROMOCION != '') { proccesRequestDatosPromocion(jData, vieneDeHistory); return;}
globalInmuebleID = jData.datos[0].ID; foto0 = ""; if (jData.datos[0].imagen_0) { foto0 = jData.datos[0].imagen_0;}
foto1 = ""; if (jData.datos[0].imagen_1) { foto1 = jData.datos[0].imagen_1;}
foto2 = ""; if (jData.datos[0].imagen_2) { foto2 = jData.datos[0].imagen_2;}
foto3 = ""; if (jData.datos[0].imagen_3) { foto3 = jData.datos[0].imagen_3;}
foto4 = ""; if (jData.datos[0].imagen_4) { foto4 = jData.datos[0].imagen_4;}
foto5 = ""; if (jData.datos[0].imagen_5) { foto5 = jData.datos[0].imagen_5;}
foto_promo1 = ""; if (jData.datos[0].imagen_promo0) { foto_promo1 = jData.datos[0].imagen_promo0;}
foto_promo2 = ""; if (jData.datos[0].imagen_promo1) { foto_promo2 = jData.datos[0].imagen_promo1;}
foto_promo3 = ""; if (jData.datos[0].imagen_promo2) { foto_promo3 = jData.datos[0].imagen_promo2;}
foto_promo4 = ""; if (jData.datos[0].imagen_promo3) { foto_promo4 = jData.datos[0].imagen_promo3;}
foto_promo5 = ""; if (jData.datos[0].imagen_promo4) { foto_promo5 = jData.datos[0].imagen_promo4;}
foto_promo6 = ""; if (jData.datos[0].imagen_promo5) { foto_promo6 = jData.datos[0].imagen_promo5;}
}
foto_promo1_gran = null; foto_promo2_gran = null; foto_promo3_gran = null; foto_promo4_gran = null; foto_promo5_gran = null; foto_promo6_gran = null; foto1_gran = null; foto2_gran = null; foto3_gran = null; foto4_gran = null; foto5_gran = null; foto6_gran = null; plano1 = null; plano2 = null; plano3 = null; texto = ""; texto += "<div style='text-align:left;' id='atp_mas_info' class='atp_mas_info'>"
texto += "<div class='caja_datos' id='enlaces_datos' style='margin-bottom:0px;margin-top:0px;'>"; texto += "<table border='0' width='100%' cellpadding=0 cellspacing=0>"; texto += "<tr><td>"; if (tipoOperacionBusqueda == "V")
var quePrecio = jData.datos[0].PRECIO; else
if (tipoOperacionBusqueda == "A")
var quePrecio = jData.datos[0].PRECIO_ALQUILER; else
var quePrecio = jData.datos[0].PRECIO_ALQUILER_COMPRA; if (quePrecio > 0) { var precio_final = formatPrecio(quePrecio); var precio_pts = Math.round(parseInt(quePrecio) * 166.386, 0).toString(); var precio_t = formatPrecio(precio_pts) + " pts"; texto += "<span class='precio' title='" + precio_t + "'>" + _t_price + ": " + precio_final + " &euro;</span>\n";}
else
texto += "<span class='precio' style='cursor:auto;'>" + _t_price_consult + "</span> "; texto += "</td><td align='right'>"; if (globalTipoPagina != "MISINMUEBLES") { texto += imprimirTextoEnviarCorreo();}
texto += imprimirTextoImprimir(jData.datos[0].ID); if (globalDesdeMapa == false) { if ((globalTipoPagina != "MISINMUEBLES") && (globalDeMiLista == false || globalDesdeDestacados == true)) { texto += imprimirTextoAddLista(jData.datos[0].ID);}
}
else { if (globalTipoPagina != "MISINMUEBLES") { texto += imprimirTextoAddLista(jData.datos[0].ID);}
}
texto += "</td></tr></table>"; texto += "</div>"; texto += "<div id='atp_mas_info_tabs' class='caja' style='margin-bottom:0px;'>"; var contTabs = 0; texto += "<span  class='selected' onclick=\"javascript:cambiarTab(" + contTabs + ");\">" + _t_car + "</span>"; contTabs++; if ((jData.datos[0].ID_PROMOCION != '') && (foto_promo1 != '')) { texto += " | <span class='no_select' onclick=\"javascript:cambiarTab(" + contTabs + ");\">" + _t_photos_p + "</span>"; contTabs++;}
if (jData.datos[0].VIDEO ) { texto += " | <span class='no_select' onclick=\"javascript:cambiarTabVideo(" + contTabs + "," + jData.datos[0].ID + ",null);\">" + "Video" + "</span>"; contTabs++;}
if (foto0 != '') { texto += " | <span class='no_select' onclick=\"javascript:cambiarTab(" + contTabs + ");\">" + _t_photos + "</span>"; contTabs++;}
texto += " | <span class='no_select' onclick=\"javascript:cambiarTabMapa(" + contTabs + ", " + jData.datos[0].LATITUD + ", " + jData.datos[0].LONGITUD + ");\">" + _t_map_sit + "</span>"; contTabs++; if (((globalTipoPagina == "INDEX") || (globalTipoPagina == "COMPARTIDOS")) && (esATP)){ texto += " | <span class='no_select' onclick=\"javascript:cambiarTab(" + contTabs + ");\">" + _t_advert + "</span>";}
texto += "</div>"; texto += "<div id='scroll_datos' style='height:400px; overflow:auto;' class='atp_mas_info'>"
texto += "<div id='atp_mas_info_container_tabs'>"; texto += imprimirTextoDatos(jData); texto += imprimirTextoVideo(jData); var uri = uriImagenes; if (jData.datos[0].URL_ATP != ""){ uri = jData.datos[0].URL_ATP;}
if (foto0 != '') { texto += "<div class='atpTab' id='atp_mas_info_fotos'  style='display:none;'>"; texto += "<table width='98%'  cellpadding='0' cellspacing='0'><tr><td>"; texto += "<div class='caja_datos' id='imagenes'>"; if (foto0 != '') { foto1_gran = new Image(); foto1_gran.src = uri + '/inmuebles/images/300_' + foto0; texto += "<div class='fotos' onclick=\"javascript:showImageInmueble('1')\"><img src='" + uri + "/inmuebles/images/100_" + foto0 + "'></div>";}
if (foto1 != '') { foto2_gran = new Image(); foto2_gran.src = uri + '/inmuebles/images/300_' + foto1; texto += "<div class='fotos' onclick=\"javascript:showImageInmueble('2')\"><img src='" + uri + "/inmuebles/images/100_" + foto1 + "'></div>";}
if (foto2 != '') { foto3_gran = new Image(); foto3_gran.src = uri + '/inmuebles/images/300_' + foto2; texto += "<div class='fotos' onclick=\"javascript:showImageInmueble('3')\"><img src='" + uri + "/inmuebles/images/100_" + foto2 + "'></div>";}
if (foto3 != '') { foto4_gran = new Image(); foto4_gran.src = uri + '/inmuebles/images/300_' + foto3; texto += "<div class='fotos' onclick=\"javascript:showImageInmueble('4')\"><img src='" + uri + "/inmuebles/images/100_" + foto3 + "'></div>";}
if (foto4 != '') { foto5_gran = new Image(); foto5_gran.src = uri + '/inmuebles/images/300_' + foto4; texto += "<div class='fotos' onclick=\"javascript:showImageInmueble('5')\"><img src='" + uri + "/inmuebles/images/100_" + foto4 + "'></div>";}
if (foto5 != '') { foto6_gran = new Image(); foto6_gran.src = uri + '/inmuebles/images/300_' + foto5; texto += "<div class='clearone'></div>"; texto += "<div class='fotos' onclick=\"javascript:showImageInmueble('6')\"><img src='" + uri + "/inmuebles/images/100_" + foto5 + "'></div>";}
texto += "<div class='clearone'></div>"; texto += "<span class='ab' onclick=\"javascript:showImageInmueble('1')\">" + _t_ampliar + "</span>"; texto += "</div><!-- imagenes -->"; texto += "</td></tr></table>"; texto += "</div>";}
texto += imprimirTextoMapa(); texto += imprimirTextoAnunciante(jData); texto += "</div>"; texto += imprimirTextoCorreo(jData); texto += "</div>"; texto += "</div>"; panelEspere.hide(); panel.setHeader("<span style='float:left';>" + _t_desc + "</span><span style='float:right; margin-right:30px;'>" + imprimirTextoNavegacion(jData, vieneDeHistory) + "</span><span class='clearone'></span>"); panel.setBody(texto); panel.render(document.body); logoMask(); var divMapa = document.getElementById('caja_mapa'); iFrameMapaCargado = false; iFrameMapaVideoCargado = false; panel.show(); globalDeMiLista = false; globalDesdeMapa = false; globalDesdeDestacados = false;}
function irAViviendaTipo(id){ var request; if (id == -1)
return; var div_id = 'atp_vt_id_' + id; var div_vt = document.getElementById(div_id); if (!div_vt) { mostrarPanelEspere(_t_cargando_datos); endTimeOut(timeOutcargarDatosInmueble); timeOutcargarDatosInmueble = beginTimeOut(tiempoTimeOut); request = '/inmuebles/' + atp_version + '/json/json_info_vivienda_tipo.php?ln=' + _t_l + '&ID=' + id + "&timeout=" + timeOutcargarDatosInmueble; aObj = new JSONscriptRequest(request); aObj.buildScriptTag(); aObj.addScriptTag();}
}
function proccesRequestDatosViviendaTipo(jData){ if (timeOutcargarDatosInmueble == null)
vieneDeHistory = true; if (jData != null) { if ((jData.timeout != timeOutcargarDatosInmueble) && (timeOutcargarDatosInmueble != null))
return;}
else { endTimeOut(timeOutcargarDatosInmueble); return;}
endTimeOut(timeOutcargarDatosInmueble); timeOutcargarDatosInmueble = null; if (panelEspere)
panelEspere.hide(); ponerDatosViviendaTipo(jData.datos[0]);}
function ponerDatosViviendaTipo(jData, uriATP){ var div; var queFoto; div = document.getElementById('atp_info_vivienda_tipo'); div.innerHTML = ""; var texto = "<div id='atp_vt_id_" + jData.ID + "'>"; texto += "<table width='98%'><tr><td>"; var aAlt = new ATP_alternateClass("row", 2); texto += "<table width='100%' style='border:0px; border-collapse:collapse;'>"; var tOp; if (tipoOperacionBusqueda == "V") { var quePrecio = jData.PRECIO; tOp = _t_for_sale;}
else
if (tipoOperacionBusqueda == "A") { var quePrecio = jData.PRECIO_ALQUILER; tOp = _t_for_rent;}
else { var quePrecio = jData.PRECIO_ALQUILER_COMPRA; tOp = _t_for_rent_to_buy;}
texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td width='20%'>" + _t_price + ":</td>"; if (quePrecio > 0) { var precio_final = formatPrecio(quePrecio); var precio_pts = Math.round(parseInt(quePrecio) * 166.386, 0).toString(); var precio_t = formatPrecio(precio_pts) + " pts"; texto += "<td><span class='precio' title='" + precio_t + "'>" + precio_final + " &euro;</span> <span class='alt1'>" + tOp + "<span></td>";}
else
texto += "<td><span class='precio' style='cursor:auto;'>" + _t_price_consult + "</span> <span class='alt1'>" + tOp + "<span></td>"; texto += "</tr>"; texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_type + ":</td>"; texto += "<td>" + jData.TIPO_PROPIEDAD + "</td>"; texto += "</tr>"; texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_viv_tipo + ":</td>"; texto += "<td>" + jData.VIVIENDA_TIPO + "</td>"; texto += "</tr>"; if (jData.HABITACIONES > 0) { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_rooms + ":</td>"; texto += "<td>" + jData.HABITACIONES + "</td>"; texto += "</tr>";}
if (jData.BANYOS > 0) { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_banys + ":</td>"; texto += "<td>" + jData.BANYOS + "</td>"; texto += "</tr>";}
if (jData.ASEOS > 0) { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_aseos + ":</td>"; texto += "<td>" + jData.ASEOS + "</td>"; texto += "</tr>";}
if (jData.METROS > 0) { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_metros_util + ":</td>"; texto += "<td>" + jData.METROS + "</td>"; texto += "</tr>";}
if (jData.METROS_CONSTRUIDOS > 0) { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_metros_cons + ":</td>"; texto += "<td>" + jData.METROS_CONSTRUIDOS + "</td>"; texto += "</tr>";}
if (jData.GARAJE > 0) { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_parkings + ":</td>"; texto += "<td>" + jData.GARAJE + "</td>"; texto += "</tr>";}
if (jData.TERRAZA > 0) { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_terraza + ":</td>"; texto += "<td>" + jData.TERRAZA + "</td>"; texto += "</tr>";}
if (jData.PISCINA == "S") { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_s_pool + ":</td>"; texto += "<td>" + _t_yes + "</td>";}
if (jData.ASCENSOR == "S") { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_ascensor + ":</td>"; texto += "<td>" + _t_yes + "</td>"; texto += "</tr>";}
if (jData.REFERENCIA != "") { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_ref + ":</td>"; texto += "<td>" + jData.REFERENCIA + "</td>"; texto += "</tr>";}
if (jData.DESCRIPCION != "") { texto += "<tr class='" + aAlt.alternate() + "'>"; var cs = 2; if (_t_l == "en") { cs = 1; texto += "<td><input type='button' onclick=\"javascript:translate('d', " + jData.ID + ")\" value='Translate'></td>";}
texto += "<td colspan='" + cs + "'><span id='d_" + jData.ID + "'>" + jData.DESCRIPCION + "</span>"; texto += "</tr>";}
texto += "</table>"; texto += textoOtrosPrecios(tipoOperacionBusqueda, jData); foto1_gran = foto2_gran = foto3_gran = foto4_gran = foto5_gran = foto6_gran = null; texto += "<div class='atpTab' id='atp_mas_info_fotos'>"; var uri = uriImagenes; if (uriATP)
uri = uriATP; else { if (jData.URL_ATP != "") { uri = jData.URL_ATP;}
}
if (jData.IMAGENES.length > 0) { texto += "<div class='caja'>"; for (var j = 0; j < jData.IMAGENES.length; j++) { if (j == 0) { foto1_gran = new Image(); foto1_gran.src = uri + '/inmuebles/images/300_' + jData.IMAGENES[j];}
else
if (j == 1) { foto2_gran = new Image(); foto2_gran.src = uri + '/inmuebles/images/300_' + jData.IMAGENES[j];}
else
if (j == 2) { foto3_gran = new Image(); foto3_gran.src = uri + '/inmuebles/images/300_' + jData.IMAGENES[j];}
else
if (j == 3) { foto4_gran = new Image(); foto4_gran.src = uri + '/inmuebles/images/300_' + jData.IMAGENES[j];}
else
if (j == 4) { foto5_gran = new Image(); foto5_gran.src = uri + '/inmuebles/images/300_' + jData.IMAGENES[j]; texto += "<div class='clearone'></div>"
}
else
if (j == 5) { foto6_gran = new Image(); foto6_gran.src = uri + '/inmuebles/images/300_' + jData.IMAGENES[j];}
queFoto = j + 1; texto += "<span class='fotos' onclick=\"javascript:showImageInmueble('" + queFoto + "')\"><img src='" + uriImagenes + "/inmuebles/images/100_" + jData.IMAGENES[j] + "'></span>";}
texto += "<div class='clearone'></div>"
texto += "<a href =\"javascript:showImageInmueble('1')\">" + _t_ampliar + "</a>"; texto += "</div>";}
if (jData.PLANO != '') { plano1 = new Image(); plano1.src = uri + '/inmuebles/images/800_' + jData.PLANO; texto += "<div class='caja'>"; texto += "<span class='ab' onclick=\"javascript:showPlanoInmueble(1)\">" + _t_ver_planos + "</span></div>";}
else
plano1 = null; if (jData.PLANO2 != '') { plano2 = new Image(); plano2.src = uri + '/inmuebles/images/800_' + jData.PLANO2;}
else
plano2 = null; if (jData.PLANO3 != '') { plano3 = new Image(); plano3.src = uri + '/inmuebles/images/800_' + jData.PLANO3;}
else
plano3 = null; if (jData.HAY_VIDEO == 'S') { texto += "<div class='video' style='padding-left:5px;'onclick=\"javascript:mostrarPanelVideo(" + jData.ID +",null);\"><span>Video</span></div>";}
texto += "</div>"; texto += "</td></tr></table>"; texto += "</div>"; div.innerHTML += texto;}
function verViviendaTipo(tab, id, queIndex){ cambiarTab(tab); irAViviendaTipo(id); document.getElementById('vivienda_tipo').options[queIndex].selected = true;}
function imprimirTextoDatosPromo(jData, viviendaEmpiezaEn){ var localidad = jData.datos[0].COD_POSTAL + " - " + jData.datos[0].POBLACION + " (" + jData.datos[0].PROVINCIA + ")"; var localidad_usuario = jData.datos[0].COD_POSTAL_USUARIO + " - " + jData.datos[0].LOC_USUARIO + " (" + jData.datos[0].PROV_USUARIO + ")"; var showTranslate = false; texto = "<div class='atpTab' id='atp_mas_info_datos'  style='display:inline;'>"; texto += "<table width='98%'><tr><td>"; if (((globalTipoPagina == "INDEX") || (globalTipoPagina == "COMPARTIDOS")) && (esATP)){ texto += "<div class='caja' id='popup_inmobiliaria2'>"; texto += "<table border=0 width=100%><tr>"; texto += "<td width='66%' valign='top'><span class='alt1'>"; var localidad_usuario = jData.datos[0].COD_POSTAL_USUARIO + " - " + jData.datos[0].LOC_USUARIO + " (" + jData.datos[0].PROV_USUARIO + ")"; if (jData.datos[0].TIPO_USUARIO == 'P')
texto += "Preguntar por: " + jData.datos[0].NOMBRE_USUARIO + "<br />"; else { texto += jData.datos[0].DENOMINACION + "<br />"; texto += jData.datos[0].DIR_USUARIO + " " + localidad_usuario + "<br />";}
texto += _t_phone + ": " + jData.datos[0].TELEFONO + "</span>"; texto += "</td>"; texto += "<td>"; if (jData.datos[0].LOGO != "")
texto += "<img border ='0' style='height:80px;' src='/inmobiliarias/images/" + jData.datos[0].LOGO + "'>"; texto += "</td></tr></table>"; texto += "</div><!-- popup_inmobiliaria2 -->";}
texto += "<div class='caja_datos' id='atp_mas_info_popup_promocion'>"; var aAlt = new ATP_alternateClass("row", 2); texto += "<table width='100%' style='border:0px; border-collapse:collapse;'>"; texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_name_promo + ":</td>"; texto += "<td>" + jData.datos[0].NOMBRE + "</td>"; texto += "</tr>"; texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_dir_promo + ":</td>"; texto += "<td>" + jData.datos[0].DIRECCION + " " + localidad + "</td>"; texto += "</tr>"; if (jData.datos[0].DESC_PROMO != '') { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_desc + ":</td>"; texto += "<td id='dp_" + jData.datos[0].ID + "'>" + jData.datos[0].DESC_PROMO + "</td>"; texto += "</tr>"; showTranslate = true;}
if (jData.datos[0].FECHAS_PROMO != '') { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_fechas_promo + ":</td>"; texto += "<td id='fp_" + jData.datos[0].ID + "'>" + jData.datos[0].FECHAS_PROMO + "</td>"; texto += "</tr>"; showTranslate = true;}
if (jData.datos[0].FORMA_PAGO_PROMO != '') { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td>" + _t_pago_promo + ":</td>"; texto += "<td  id='fpp_" + jData.datos[0].ID + "'>" + jData.datos[0].FORMA_PAGO_PROMO + "</td>"; texto += "</tr>"; showTranslate = true;}
if (jData.datos[0].MEMORIA != '') { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td colspan='2'><a href='" + uriImagenes + "/inmuebles/calidades/" + jData.datos[0].MEMORIA + "' target='_blank'>" + _t_mem_promo + "</a></td>"; texto += "</tr>";}
if (jData.datos[0].URL_PROMO_CLIENTE != '') { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td colspan='2'><a href='/redirect.php?cod_user=" + jData.datos[0].COD_USUARIO + "&from=info&id=" + jData.datos[0].ID + "&url=" + jData.datos[0].URL_PROMO_CLIENTE + "' target='_blank'>" + _t_link_promo + jData.datos[0].DENOMINACION + "</a></td>"; texto += "</tr>";}
if ((showTranslate) && (_t_l == "en")) { texto += "<tr class='" + aAlt.alternate() + "'>"; texto += "<td colspan='2'><input type='button' onclick=\"javascript:translate('p'," + jData.datos[0].ID + ")\" value='Translate'></td>"; texto += "</tr>";}
texto += "</table>"; texto += "</div><!-- atp_mas_info_popup_promocion -->"; texto += "</td></tr></table>"; texto += "</div>"; return texto;}
function imprimirTablaViviendas(jData, campoPrecio){ texto = ""; texto = "<div id='atp_viv_tipo'>"; texto += "<table class='tabla_mas_info' style='width:95%'>"; texto += "<caption>" + _t_viv_tipos + "</caption>"; texto += "<tr>"; texto += "<th scope='col'>" + _t_price + "</th>"; texto += "<th scope='col'>" + _t_type_short + "</th>"; texto += "<th scope='col'>" + _t_metros_util + "</th>"; texto += "<th scope='col'>" + _t_metros_cons_short + "</th>"; texto += "<th scope='col'>" + _t_rooms_short + "</th>"; texto += "<th scope='col'>" + _t_banys + "</th>"; texto += "<th scope='col'>" + _t_aseos + "</th>"; texto += "<th scope='col'>" + _t_garaje_short + "</th>"; texto += "<th scope='col'></th>"; texto += "</tr>"; textoInfo = ""; var tabVivienda = 0; var indice = 0; var ev; var val; for (var i = 0; i < jData.datos[0].INMUEBLES.length; i++) { texto += "<tr>"; ev = "jData.datos[0].INMUEBLES[i]." + campoPrecio; val = eval(ev); precio_final = formatPrecio(val); precio_pts = Math.round(parseInt(val) * 166.386, 0).toString(); precio_t = formatPrecio(precio_pts) + " pts"; texto += "<td><span class='precio' title='" + precio_t + "'>" + precio_final + " &euro;</span></td>"; texto += "<td>" + jData.datos[0].INMUEBLES[i].TIPO_PROPIEDAD + "</td>"; texto += "<td>" + jData.datos[0].INMUEBLES[i].METROS + "</td>"; texto += "<td>" + jData.datos[0].INMUEBLES[i].METROS_CONSTRUIDOS + "</td>"; texto += "<td>" + jData.datos[0].INMUEBLES[i].HABITACIONES + "</td>"; texto += "<td>" + jData.datos[0].INMUEBLES[i].BANYOS + "</td>"; texto += "<td>" + jData.datos[0].INMUEBLES[i].ASEOS + "</td>"; texto += "<td>" + jData.datos[0].INMUEBLES[i].GARAJE + "</td>"; indice = i + 1; texto += "<td><a href=\"javascript:verViviendaTipo(" + viviendaEmpiezaEn + ", " + jData.datos[0].INMUEBLES[i].ID + ", " + indice + ");\">" + _t_more_info + "</a></td>"; texto += "</tr>";}
texto += "</table>"; texto += "</div><!-- atp_viv_tipo -->"; return texto;}
function proccesRequestDatosPromocion(jData, vieneDeHistory){ var div = document.getElementById('datos_inmueble'); var texto = ""; anteriorViviendaTipoID = null; globalInmuebleID = jData.datos[0].ID; foto_promo1 = ""; if (jData.datos[0].imagen_promo0) { foto_promo1 = jData.datos[0].imagen_promo0;}
foto_promo2 = ""; if (jData.datos[0].imagen_promo1) { foto_promo2 = jData.datos[0].imagen_promo1;}
foto_promo3 = ""; if (jData.datos[0].imagen_promo2) { foto_promo3 = jData.datos[0].imagen_promo2;}
foto_promo4 = ""; if (jData.datos[0].imagen_promo3) { foto_promo4 = jData.datos[0].imagen_promo3;}
foto_promo5 = ""; if (jData.datos[0].imagen_promo4) { foto_promo5 = jData.datos[0].imagen_promo4;}
foto_promo6 = ""; if (jData.datos[0].imagen_promo5) { foto_promo6 = jData.datos[0].imagen_promo5;}
foto_promo1_gran = null; foto_promo2_gran = null; foto_promo3_gran = null; foto_promo4_gran = null; foto_promo5_gran = null; foto_promo6_gran = null; plano1 = null; plano2 = null; plano3 = null; texto = ""; texto += "<div style='text-align:left;' id='atp_mas_info' class='atp_mas_info'>"
texto += "<div class='caja_datos' id='enlaces_datos' style='margin-bottom:0px;margin-top:0px;'>"; texto += "<table border='0' width='100%' cellpadding=0 cellspacing=0>"; texto += "<tr><td>"; var precio_final = null; var precio_pts = null; var precio_t = null; if (tipoOperacionBusqueda == "V")
var quePrecio = "PRECIO"; else
if (tipoOperacionBusqueda == "A")
var quePrecio = "PRECIO_ALQUILER"; else
var quePrecio = "PRECIO_ALQUILER_COMPRA"; if (jData.datos[0].PRECIO_MIN > 0) { precio_final = formatPrecio(jData.datos[0].PRECIO_MIN); precio_pts = Math.round(parseInt(jData.datos[0].PRECIO_MIN) * 166.386, 0).toString(); precio_t = formatPrecio(precio_pts) + " pts"; texto += "<span class='precio' title='" + precio_t + "'>" + _t_desde + " " + precio_final + " &euro;</span>\n";}
if ((jData.datos[0].PRECIO_MAX > 0) && (jData.datos[0].PRECIO_MAX != jData.datos[0].PRECIO_MIN)) { precio_final = formatPrecio(jData.datos[0].PRECIO_MAX); precio_pts = Math.round(parseInt(jData.datos[0].PRECIO_MAX) * 166.386, 0).toString(); precio_t = formatPrecio(precio_pts) + " pts"; texto += "<span class='precio' title='" + precio_t + "'> " + _t_hasta + " " + precio_final + " &euro;</span>\n";}
if ((jData.datos[0].PRECIO_MIN == 0) && (jData.datos[0].PRECIO_MAX == 0)) { texto += "<span class='precio'>" + _t_price_consult + "</span>\n";}
texto += "</td><td align='right'>"; if (globalTipoPagina != "MISINMUEBLES") { texto += imprimirTextoEnviarCorreo();}
texto += imprimirTextoImprimir(jData.datos[0].ID); if (globalDesdeMapa == false) { if ((globalTipoPagina != "MISINMUEBLES") && (globalDeMiLista == false || globalDesdeDestacados == true)) { texto += imprimirTextoAddLista(jData.datos[0].ID);}
}
else { if (globalTipoPagina != "MISINMUEBLES") { texto += imprimirTextoAddLista(jData.datos[0].ID);}
}
texto += "</td></tr></table>"; texto += "</div>"; texto += "<div id='atp_mas_info_tabs' class='caja'>"; var contTabs = 0; texto += "<span class='selected' onclick=\"javascript:cambiarTab(" + contTabs + ");\">" + _t_car + "</span>"; contTabs++; if ((jData.datos[0].ID_PROMOCION != '') && (foto_promo1 != '')) { texto += " | <span class='no_select' onclick=\"javascript:cambiarTab(" + contTabs + ");\">" + _t_photos_p + "</span>"; contTabs++;}
if (jData.datos[0].VIDEO_PROMO) { texto += " | <span class='no_select' onclick=\"javascript:cambiarTabVideo(" + contTabs + ",null," + jData.datos[0].ID_PROMOCION + ");\">" + "Video" + "</span>"; contTabs++;}
texto += " | <span class='no_select'  onclick=\"javascript:cambiarTab(" + contTabs + ");\">" + _t_viv_tipo + "</span>"; viviendaEmpiezaEn = contTabs; contTabs++; texto += " | <span class='no_select' onclick=\"javascript:cambiarTabMapa(" + contTabs + ", " + jData.datos[0].LATITUD + ", " + jData.datos[0].LONGITUD + ");\">" + _t_map_sit + "</span>"; contTabs++; if (((globalTipoPagina == "INDEX") || (globalTipoPagina == "COMPARTIDOS")) && (esATP)){ texto += " | <span class='no_select' onclick=\"javascript:cambiarTab(" + contTabs + ");\">" + _t_advert + "</span>"; contTabs++;}
texto += "</div>"; texto += "<div id='scroll_datos' style='height:400px; overflow:auto;' class='atp_mas_info'>"
texto += textoOfertaEspecial(jData.datos[0], 10); texto += "<div id='atp_mas_info_container_tabs'>"; texto += imprimirTextoDatosPromo(jData, viviendaEmpiezaEn); var uri = uriImagenes; if (jData.datos[0].URL_ATP != ""){ uri = jData.datos[0].URL_ATP;}
if ((jData.datos[0].ID_PROMOCION != '') && (foto_promo1 != '')) { texto += "<div class='atpTab' id='atp_mas_info_fotos_promo'  style='display:none;'>"; texto += "<table width='98%'><tr><td>"; texto += "<div class='caja_datos' id='imagenes_promo'>"; if (foto_promo1 != '') { foto_promo1_gran = new Image(); foto_promo1_gran.src = uriImagenes + '/inmuebles/images/300_' + foto_promo1; texto += "<div class='fotos' onclick=\"javascript:showImage('1')\"><img src='" + uri + "/inmuebles/images/100_" + foto_promo1 + "'></div>";}
if (foto_promo2 != '') { foto_promo2_gran = new Image(); foto_promo2_gran.src = uriImagenes + '/inmuebles/images/300_' + foto_promo2; texto += "<div class='fotos' onclick=\"javascript:showImage('2')\"><img src='" + uri + "/inmuebles/images/100_" + foto_promo2 + "'></div>";}
if (foto_promo3 != '') { foto_promo3_gran = new Image(); foto_promo3_gran.src = uriImagenes + '/inmuebles/images/300_' + foto_promo3; texto += "<div class='fotos' onclick=\"javascript:showImage('3')\"><img src='" + uri + "/inmuebles/images/100_" + foto_promo3 + "'></div>";}
if (foto_promo4 != '') { foto_promo4_gran = new Image(); foto_promo4_gran.src = uriImagenes + '/inmuebles/images/300_' + foto_promo4; texto += "<div class='fotos' onclick=\"javascript:showImage('4')\"><img src='" + uri + "/inmuebles/images/100_" + foto_promo4 + "'></div>";}
if (foto_promo5 != '') { foto_promo5_gran = new Image(); foto_promo5_gran.src = uriImagenes + '/inmuebles/images/300_' + foto_promo5; texto += "<div class='fotos' onclick=\"javascript:showImage('5')\"><img src='" + uri + "/inmuebles/images/100_" + foto_promo5 + "'></div>"; texto += "<div class='clearone'></div>";}
if (foto_promo6 != '') { foto_promo6_gran = new Image(); foto_promo6_gran.src = uriImagenes + '/inmuebles/images/300_' + foto_promo6; texto += "<div class='fotos' onclick=\"javascript:showImage('6')\"><img src='" + uri + "/inmuebles/images/100_" + foto_promo6 + "'></div>";}
texto += "<div class='clearone'></div>"; texto += "<span class='ab' onclick =\"javascript:showImage('1')\">" + _t_ampliar + "</span>"; texto += "</div><!-- imagenes_promo -->"; texto += "</td></tr></table>"; texto += "</div>";}
texto += imprimirTextoVideo(jData); var aAlt = new ATP_alternateClass("alt", 2); var inputSelect = ""; texto += "<div class='atpTab' id='atp_mas_info_viviendas_tipo_id_' style='display:none;'>"; texto += "<table  width='98%'><tr><td>"; inputSelect = "<div class='caja'><span class='alt1'>" + _t_elija_v_t + "&nbsp;&nbsp;</span><SELECT id='vivienda_tipo'>"; inputSelect += "<option value='-1' SELECTED>" + _t_elija_v_t + "</option>"; var sel; var ev; for (var i = 0; i < jData.datos[0].INMUEBLES.length; i++) { sel = ""; if ((globalDesdeMapa == false) && (jData.datos[0].INMUEBLES[i].ACTUAL == 'S'))
sel = "SELECTED"; ev = "jData.datos[0].INMUEBLES[i]." + quePrecio; if (eval(ev) > 0)
inputSelect += "<option value='" + jData.datos[0].INMUEBLES[i].ID + "' " + sel + ">" + jData.datos[0].INMUEBLES[i].TIPO_PROPIEDAD + " - " + formatPrecio(eval(ev)) + " &euro;</option>"; else
inputSelect += "<option value='" + jData.datos[0].INMUEBLES[i].ID + "' " + sel + ">" + jData.datos[0].INMUEBLES[i].TIPO_PROPIEDAD + " - " + _t_price_consult + "</option>";}
inputSelect += "</SELECT>"; inputSelect += "<input class='btn' type='button' value='" + _t_mostrar_viv + "' onclick=\"javascript:irAViviendaTipo(document.getElementById('vivienda_tipo').value);\">"; inputSelect += "</div>"; texto += inputSelect; texto += "<div class='caja_datos' id='atp_info_vivienda_tipo'>"; texto += "</div>"; texto += "</td></tr></table>"; texto += "</div>"; texto += imprimirTextoMapa(jData); texto += imprimirTextoAnunciante(jData); texto += "</div>"; texto += imprimirTablaViviendas(jData, quePrecio); texto += imprimirTextoCorreo(jData); texto += "</div>"; texto += "</div>"; panelEspere.hide(); panel.setHeader("<span style='float:left';>" + _t_desc + "</span><span style='float:right; margin-right:30px;'>" + imprimirTextoNavegacion(jData, vieneDeHistory) + "</span><span class='clearone'></span>"); panel.setBody(texto); panel.render(document.body); logoMask(); var divMapa = document.getElementById('caja_mapa'); iFrameMapaCargado = false; iFrameMapaVideoCargado = false; panel.show(); if (globalDesdeMapa == false) { for (i = 0; i < jData.datos[0].INMUEBLES.length; i++) { if (jData.datos[0].INMUEBLES[i].ACTUAL == 'S') { cambiarTab(viviendaEmpiezaEn); ponerDatosViviendaTipo(jData.datos[0].INMUEBLES[i], uri); break;}
}
}
globalDeMiLista = false; globalDesdeMapa = false; globalDesdeDestacados = false;}
function proccesRequestYaEstaEnMiLista(jData){ if (jData != null) { if (jData.timeout != timeOutAnyadirALista)
return;}
else { endTimeOut(timeOutAnyadirALista); return;}
endTimeOut(timeOutAnyadirALista); if (panelEspere)
panelEspere.hide(); alert(_t_inmueble_ya_en_l);}
function proccesRequestDatosMiLista(jData){ if (jData != null) { if (jData.timeout != timeOutAnyadirALista)
return;}
else { endTimeOut(timeOutAnyadirALista); return;}
endTimeOut(timeOutAnyadirALista); if (panelEspere)
panelEspere.hide(); if (jData != null) { anyadirInmuebleALista(jData.datos[0]); cambiarLabelMiLista();}
}
function anyadirInmuebleALista(jData){ cuantosEnMiLista++; listado = document.getElementById('listado_mi_lista'); AnyadirInmuebleListado(jData, listado);}
function cambiarLabelMiLista(){ var e = document.getElementById('atp_mi_lista'); if (e.textContent)
e.textContent = _t_mi_lista + " (" + cuantosEnMiLista.toString() + ")"; else
e.innerText = _t_mi_lista + " (" + cuantosEnMiLista.toString() + ")";}
function quitarAMiLista(id){ endTimeOut(timeOutEliminarLista); timeOutEliminarLista = beginTimeOut(tiempoTimeOut); mostrarPanelEspere(_t_removing_list); request = '/inmuebles/' + atp_version + '/json/lista/json_eliminar_lista.php?ID=' + id + "&timeout=" + timeOutEliminarLista; aObj = new JSONscriptRequest(request); aObj.buildScriptTag(); aObj.addScriptTag();}
function anyadirAMiLista(id){ if (cuantosEnMiLista >= maximosEnMiLista) { alert(_t_max_list + " (" + maximosEnMiLista + ")");}
else { if (!document.getElementById('datos_inmueble_mi_lista_' + id)) { endTimeOut(timeOutAnyadirALista); timeOutAnyadirALista = beginTimeOut(tiempoTimeOut); mostrarPanelEspere(_t_add_list_m); var idImg = "fv_" + id; var img = document.getElementById(idImg); var imagen = ""; if (img) { var partes = img.src.split("/"); if (partes[partes.length - 1] != "sin_imagen4.png") { partes = partes[partes.length - 1].split("_"); imagen = partes[partes.length - 1];}
else
imagen = "";}
request = '/inmuebles/' + atp_version + '/json/lista/json_add_lista.php?ln=' + _t_l + '&ID=' + id + "&timeout=" + timeOutAnyadirALista + "&imagen=" + imagen; request += '&tipo_op=' + tipoOperacionBusqueda; aObj = new JSONscriptRequest(request); aObj.buildScriptTag(); aObj.addScriptTag();}
else { alert(_t_inmueble_ya_en_l);}
}
}
function cargarDatosInmueble(id, cambiarEnlacesNavegacion, deMiLista, desdeMapa, desdeDestacados){ var div; globalCambiarEnlacesNavegacion = cambiarEnlacesNavegacion; globalDeMiLista = deMiLista; globalDesdeMapa = desdeMapa; globalDesdeDestacados = desdeDestacados; mostrarPanelEspere(_t_cargando_datos); endTimeOut(timeOutcargarDatosInmueble); timeOutcargarDatosInmueble = beginTimeOut(tiempoTimeOut); request = '/inmuebles/' + atp_version + '/json/json_info_inmueble_history.php?ln=' + _t_l + '&ID=' + id + "&timeout=" + timeOutcargarDatosInmueble; request += "&tipooperacionbusqueda=" + tipoOperacionBusqueda; var div; if (globalTipoPagina == "COMPARTIDOS") { request += "&id_usuario_compartido=" + document.getElementById('id_usuario_compartido').value; request += "&compartidos=S";}
if (globalDesdeMapa == false)
request += "&desdemapa=N"; else
request += "&desdemapa=S"; aObj = new JSONscriptRequestHistory(request); aObj.buildScriptTag();}
function AnyadirInmuebleListado(datosInmueble, listado){ var contImg = 0; if (datosInmueble.ID_PROMOCION != "") { AnyadirInmueblePromocionListado(datosInmueble, listado); return;}
var desdeLista = "false"; if (listado.id == "listado_mi_lista")
desdeLista = "true"; var div_general = document.createElement('div'); var aAlt = new ATP_alternateClass("alt", 2); var clase = ""; if (datosInmueble.DESTACADO == 'S')
clase = "vivienda_grid_destacada"; else
clase = "vivienda_grid"; var image_hook = "fv_"; if (listado.id == "listado_mi_lista") { div_general.id = 'datos_inmueble_mi_lista_' + datosInmueble.ID; image_hook = "fvl_";}
else
div_general.id = 'datos_inmueble_' + datosInmueble.ID; div_general.className = clase; var div; var texto = ""; var texto_alt = ""; var img; texto += "<table border=0>"; texto += "<tr>"; texto += "<td valign='top' align='center' style='width:100px'>"; texto_alt += ""; texto_alt += " " + datosInmueble.TIPO_PROPIEDAD; texto_alt += " " + datosInmueble.POBLACION + " " + datosInmueble.PROVINCIA; var uri = uriImagenes; if (datosInmueble.URL_ATP != ""){ uri = datosInmueble.URL_ATP;}
if (eval('datosInmueble.imagen_0')) { texto += "<div class='ab' style='width:105px; height:110px' onmouseover='javascript:mouseOverFotos(\"" + image_hook + datosInmueble.ID + "\",\"" + datosInmueble.URL_ATP + "\");' onclick=\"javascript:cargarDatosInmueble(" + datosInmueble.ID + ", true, " + desdeLista + ", false, false);\"><img class='fotos' id='" + image_hook + datosInmueble.ID + "' src='" + uri + "/inmuebles/images/100_" + eval('datosInmueble.imagen_0') + "' alt='" + texto_alt + "'></div>";}
else
texto += "<div class='ab' onclick=\"javascript:cargarDatosInmueble(" + datosInmueble.ID + ", true, " + desdeLista + ", false, false);\"><img class='fotos_tabla' id='fv_" + datosInmueble.ID + "' src='/img/sin_imagen4.png' alt='Imagen no disponible'></div>"; if (datosInmueble.HAY_VIDEO == 'S'){ texto += "<div class='video' onclick=\"javascript:mostrarPanelVideo(" + datosInmueble.ID +",null);\"><span>Video</span></div>";}
texto += "</td><td valign='top' style='width:570px'>"; aAlt.alternate(); texto += textoPoblacion(datosInmueble, aAlt); alt = "normal"; texto += "<br /><ul style='margin-top:0; margin-bottom:0'>"; var nuevo = _t_new; if (datosInmueble.NUEVO == 'N')
nuevo = _t_second_hand; var tipo_operacion = _t_for_sale; if (tipoOperacionBusqueda == "A")
tipo_operacion = _t_for_rent; else
if (tipoOperacionBusqueda == "AC")
tipo_operacion = _t_for_rent_to_buy; var valor = datosInmueble.TIPO_PROPIEDAD + " - " + nuevo + " - " + tipo_operacion; texto += "<li><span class='normal'>" + valor + "</span></li>"; valor = ""; if (datosInmueble.HABITACIONES > 0) { valor = datosInmueble.HABITACIONES + " " + _t_rooms;}
if (datosInmueble.METROS > 0) { if (datosInmueble.HABITACIONES > 0)
valor += " " + _t_y + " " + datosInmueble.METROS + " " + _t_metros; else
valor += datosInmueble.METROS + " " + _t_metros;}
if (valor != "")
texto += "<li><span class='normal'>" + valor + "</span></li>\n"; valor = ""; if (tipoOperacionBusqueda == "V")
var quePrecio = datosInmueble.PRECIO; else
if (tipoOperacionBusqueda == "A")
var quePrecio = datosInmueble.PRECIO_ALQUILER; else
var quePrecio = datosInmueble.PRECIO_ALQUILER_COMPRA; if ((tipoOperacionBusqueda == "V") && (datosInmueble.METROS > 0) && (quePrecio > 0)) { valor = getPrecio(Math.round(parseInt(quePrecio / datosInmueble.METROS), 0)); texto += "<li><span class='normal'>" + _t_precio_m2 + ": </span><span class='precio' title='" + valor.precio_t + "'> " + valor.precio_final + " &euro;</span></li>\n";}
texto += "</ul>"; texto += textoOtrosPrecios(tipoOperacionBusqueda, datosInmueble); texto += textoDescripcion(datosInmueble); texto += textoFecha(datosInmueble); texto += "</td>"; texto += textoAnunciante(datosInmueble, aAlt); texto += "</tr>"; texto += "<tr><td colspan='3'>"; texto += "<span style='margin:0px;padding:3px; float:left;'>"; texto += textoSituar(datosInmueble, quePrecio, listado); if (quePrecio > 0) { var precio_final = formatPrecio(quePrecio); var precio_pts = Math.round(parseInt(quePrecio) * 166.386, 0).toString(); var precio_t = formatPrecio(precio_pts) + " pts"; texto += "<span class='precio' title='" + precio_t + "'> " + precio_final + " &euro;</span>";}
else
texto += "<span class='precio' style='cursor:auto;'> " + _t_price_consult + "</span>"; texto += textoHipoteca(datosInmueble); texto += "</span>"; texto += textoOpciones(datosInmueble, listado); texto += "</td></tr>"; texto += "</table>"; div_general.innerHTML = texto; listado.appendChild(div_general); aAlt = null;}
function textoSituar(datosInmueble, quePrecio, listado){ var texto = ""; var image = ""; var className = ""; if (listado.id == "listado_mi_lista")
image = "/img/icons/mm_20_orange.png"; else
image = getIconInmueble(quePrecio, true); if (ATPConfig.tipoPagina == 2)
className = "icono_mostrado"; else
className = "icono_oculto"; texto = "<a href='javascript: atp_setCurrentYPos(200); frame_mapa.situar(" + datosInmueble.LATITUD + "," + datosInmueble.LONGITUD + ")'><span><img style='width: 12px; height: 20px; vertical-align:middle;' class='" + className + "' src='" + image + "' alt='" + _t_situar_mapa + "' title='" + _t_situar_mapa + "'></span></a> "; return texto;}
function textoFecha(datosInmueble){ var texto = ""; if (globalTipoPagina == "MISINMUEBLES"){ texto += "<div><span class='fec_alta' style='font-size:.8em; color:red;'>Dado de alta hace " + datosInmueble.FECHA_ALTA + " días. \n"; if (datosInmueble.FECHA_MOD != "")
texto += "Modificado hace " + datosInmueble.FECHA_MOD + " días"; texto += "</span></div>\n";}
return texto;}
function comprobarDesc(desc){ if ((desc.length > 0) && (desc.replace(/[^a-z]/g, "").length) > (desc.replace(/[^A-Z]/g, "").length)) { return true;}else
return false;}
function textoOfertaEspecial(datosInmueble, margin){ var m = margin || 0; var texto = ""; if (comprobarDesc(datosInmueble.OFERTA)) { texto = "<div class='caja' style='font-size:.8em;margin-top:3px;margin-right:" + m + "px;margin-left:" + m + "px;text-align:justify;'><span style='color:red; font-weight:bold;'>" + _t_oferta + ": </span> " + datosInmueble.OFERTA + "</div>";}
return texto;}
function textoDescripcion(datosInmueble){ var texto = ""; if (comprobarDesc(datosInmueble.DESCRIPCION)) { texto = "<div class='caja' style='font-size:.8em;margin-top:3px;margin-right:0;margin-left:0;text-align:justify;'>" + datosInmueble.DESCRIPCION + "</div>";}
return texto;}
function textoHipoteca(datosInmueble){ var texto = ""; var title = ""; if ((esATP) && (tipoOperacionBusqueda == "V")){ if ((datosInmueble.HIPOTECA != "")){ title = _h_entrada + " 20% - " + _h_plazo + " 30 " + _h_anyos + " - Euríbor: " + atp_Euribor; texto = "<span class='precio' style='padding-left:5px; font-size:.8em; line-height:1.1em'><a title='" + title + "' href='/hipotecas/simulador_hipotecas.php?compute=s&amp;sale_price= " + datosInmueble.PRECIO + "' target='_blank'>" + _h_texto + ": "; texto += datosInmueble.HIPOTECA + " &euro;</a>"; texto += "</span>\n";}
}
return texto;}
function textoAnunciante(datosInmueble, aAlt){ var texto = ""; texto += "<td width='150px'>"; texto += "&nbsp;"; texto += "</td>"; return texto;}
function textoPoblacion(datosInmueble, aAlt){ var texto = ""; texto += "<span class='caja_pob'><span class='" + aAlt.alternate() + "'> " + datosInmueble.POBLACION + " - " + datosInmueble.COD_POSTAL; texto += " (" + datosInmueble.PROVINCIA + ")</span></span>\n"; return texto;}
function textoOpciones(datosInmueble, listado){ var texto = ""; texto += "<span class='caja' style='margin:0px;padding:3px; background-color:transparent; float:right;'>"; var desdeLista = "false"; if (listado.id == "listado_mi_lista")
desdeLista = "true"; if (globalTipoPagina == "MISINMUEBLES") { if (datosInmueble.PRIVADO == 'S') { texto += "<br/ ><span class='alt2' style='color:red'>Mostrar sólo en página de portada</span><br />\n";}
}
if (globalTipoPagina != "MISINMUEBLES") { texto += "<span style='margin-left:10px;'><a style='text-decoration:none;' href='javascript:showMailWindow(" + datosInmueble.ID + ");'>"; texto += "<img style='vertical-align:middle;border:0'  src='/img/mail6.gif' alt='" + _t_inquiry_infor_alt + "'> " + _t_inquiry_infor + "</a></span>";}
texto += "<span style='margin-left:10px;'><a style='text-decoration:none;' href='javascript:cargarDatosInmueble(" + datosInmueble.ID + ", true, " + desdeLista + ", false, false);'>"; texto += "<img style='vertical-align:middle;border:0' src='/img/mas_info.png' alt='" + _t_more_info_alt + "'> " + _t_more_info + "</a></span>"; texto += "<span style='margin-left:10px;'><a target = '_blank' style='text-decoration:none;' href='/inmuebles/imprimir.php?ln=" + _t_l + "&id=" + datosInmueble.ID + "&tipo_op=" + tipoOperacionBusqueda + "&i=s' rel='external'>"; texto += "<img style='vertical-align:middle;border:0'  src='/img/print.png'  alt='" + _t_print_alt + "'> " + _t_print + "</a></span>"; if (globalTipoPagina != "MISINMUEBLES") { if (listado.id == "listado_mi_lista") { texto += "<span style='margin-left:10px;'><a style='text-decoration:none;' href='javascript:quitarAMiLista(" + datosInmueble.ID + ");'>"; texto += "<img style='vertical-align:middle;border:0' src='/img/del_lista.png'  alt='" + _t_remove_list_alt + "'> " + _t_remove_list + "</a></span>";}
else { texto += "<span style='margin-left:10px;'><a style='text-decoration:none;' href='javascript:anyadirAMiLista(" + datosInmueble.ID + ");'>"; texto += "<img style='vertical-align:middle;border:0' src='/img/add_lista.png' alt='" + _t_add_list_alt + "'> " + _t_add_list + "</a></span>";}
}else{ if (listado.id == 'listado_promociones') { texto += "<span style='margin-left:10px;'><a style='text-decoration:none;'  href='/inmuebles/" + atp_version + "/gestion/modificar_promocion.php?id=" + datosInmueble.ID + "&amp;id_usuario=" + document.getElementById('id_usuario').value + "'>";}
else { if (datosInmueble.ID_PROMOCION != '')
texto += "<span style='margin-left:10px;'><a style='text-decoration:none;'  href='/inmuebles/" + atp_version + "/gestion/modificar_promocion.php?id=" + datosInmueble.ID_PROMOCION + "&amp;id_usuario=" + document.getElementById('id_usuario').value + "'>"; else
texto += "<span style='margin-left:10px;'><a style='text-decoration:none;'  href='/inmuebles/" + atp_version + "/gestion/modificar.php?id=" + datosInmueble.ID + "&amp;id_usuario=" + document.getElementById('id_usuario').value + "'>";}
texto += "<img style='vertical-align:middle;border:0' src='/img/mod.gif' alt='Modificar'>Modificar</a></span>"; if (listado.id == 'listado_promociones')
texto += "<span style='margin-left:10px;'><a style='text-decoration:none;'  href=\"javascript:eliminarPromocion(" + datosInmueble.ID + "," + document.getElementById('id_usuario').value + ")\">"; else
texto += "<span style='margin-left:10px;'><a style='text-decoration:none;'  href=\"javascript:eliminarInmueble(" + datosInmueble.ID + "," + document.getElementById('id_usuario').value + ")\">"; texto += "<img style='vertical-align:middle;border:0' src='/img/delete.gif' alt='Eliminar'>Eliminar</a></span>";}
texto += "</span>\n"; return texto;}
function showPlanosRejilla(vPlano, vPlano2, vPlano3){ if ((vPlano != '') && (plano1)) { if (plano1.src != uriImagenes + '/inmuebles/images/800_' + vPlano) { plano1 = new Image(); plano1.src = uriImagenes + '/inmuebles/images/800_' + vPlano;}
}
else
plano1 = null; if ((vPlano2 != '') && (plano2)){ if (plano2.src != uriImagenes + '/inmuebles/images/800_' + vPlano2) { plano2 = new Image(); plano2.src = uriImagenes + '/inmuebles/images/800_' + vPlano2;}
}
else
plano2 = null; if ((vPlano3 != '') && (plano3)){ if (plano3.src != uriImagenes + '/inmuebles/images/800_' + vPlano3) { plano3 = new Image(); plano3.src = uriImagenes + '/inmuebles/images/800_' + vPlano3;}
}
else
plano3 = null; showPlanoInmueble(1);}
function textoOtrosPrecios(tipoOperacionBusqueda, datosInmueble){ var otrosPrecios = false; var texto = ""; if ((tipoOperacionBusqueda == "V") && ((datosInmueble.ES_ALQUILER == "S") || (datosInmueble.ES_ALQUILER_COMPRA == "S"))){ otrosPrecios = true;}
if ((tipoOperacionBusqueda == "A") && ((datosInmueble.ES_VENTA == "S") || (datosInmueble.ES_ALQUILER_COMPRA == "S"))){ otrosPrecios = true;}
if ((tipoOperacionBusqueda == "AC") && ((datosInmueble.ES_ALQUILER == "S") || (datosInmueble.ES_VENTA == "S"))){ otrosPrecios = true;}
if (otrosPrecios) { texto += "<br /><span class='alt2'>" + _t_otros_precios + "</span>"
texto += "<ul class='otros_precios' style='margin-top:0; margin-bottom:0;'>"; var p; if ((datosInmueble.ES_VENTA == "S") && (tipoOperacionBusqueda != "V")) { if (datosInmueble.PRECIO>0) { p = getPrecio(datosInmueble.PRECIO); texto += "<li><span class='normal'>" + _t_for_sale + ": </span><span class='precio' title='" + p.precio_t + "'> " + p.precio_final + " &euro;</span></li>";}else
texto += "<li><span class='normal'>" + _t_for_sale + ": </span><span class='precio' style='cursor:auto;'> " + _t_price_consult + "</span></li>";}
if ((datosInmueble.ES_ALQUILER == "S") && (tipoOperacionBusqueda != "A")) { if (datosInmueble.PRECIO_ALQUILER>0) { p = getPrecio(datosInmueble.PRECIO_ALQUILER); texto += "<li><span class='normal'>" + _t_for_rent + ": </span><span class='precio' title='" + p.precio_t + "'> " + p.precio_final + " &euro;</span></li>";}else
texto += "<li><span class='normal'>" + _t_for_rent + ": </span><span class='precio' style='cursor:auto;'> " + _t_price_consult + "</span></li>";}
if ((datosInmueble.ES_ALQUILER_COMPRA == "S") && (tipoOperacionBusqueda != "AC")) { if (datosInmueble.PRECIO_ALQUILER_COMPRA > 0) { p = getPrecio(datosInmueble.PRECIO_ALQUILER_COMPRA); texto += "<li><span class='normal'>" + _t_for_rent_to_buy + ": </span><span class='precio' title='" + p.precio_t + "'> " + p.precio_final + " &euro;</span></li>";}else
texto += "<li><span class='normal'>" + _t_for_rent_to_buy + ": </span><span class='precio' style='cursor:auto;'> " + _t_price_consult + "</span></li>";}
texto += "</ul>";}
return texto;}
function AnyadirInmueblePromocionListado(datosInmueble, listado){ var contImg = 0; var div_general = document.createElement('div'); var aAlt = new ATP_alternateClass("alt", 2); var desdeLista = "false"; if (listado.id == "listado_mi_lista")
desdeLista = "true"; var image_hook = "fv_"; if (listado.id == "listado_mi_lista") { div_general.id = 'datos_inmueble_mi_lista_' + datosInmueble.ID; image_hook = "fvl_";}
else
div_general.id = 'datos_inmueble_' + datosInmueble.ID; var clase = ""; if (datosInmueble.DESTACADO == 'S')
clase = "vivienda_grid_destacada"; else
clase = "vivienda_grid"; div_general.className = clase; var texto = ""; var texto_alt = _t_obra_nueva_short + " "; var div; var img; texto += "<table border=0>"; texto += "<tr>"; texto += "<td valign='top' align='center' style='width:100px'>"; texto_alt += " " + datosInmueble.TIPO_PROPIEDAD; texto_alt += " " + datosInmueble.POBLACION + " " + datosInmueble.PROVINCIA; var uri = uriImagenes; if (datosInmueble.URL_ATP != ""){ uri = datosInmueble.URL_ATP;}
if (eval('datosInmueble.imagen_0')) { texto += "<div class='ab' style='width:105px; height:110px' onmouseover='javascript:mouseOverFotos(\"" + image_hook + datosInmueble.ID + "\",\"" + datosInmueble.URL_ATP + "\");' onclick=\"javascript:cargarDatosInmueble(" + datosInmueble.ID + ", true, " + desdeLista + ", false, false);\"><img class='fotos' id='" + image_hook + datosInmueble.ID + "' src='" + uri + "/inmuebles/images/100_" + eval('datosInmueble.imagen_0') + "' alt='" + texto_alt + "'></div>";}
else
texto += "<div class='ab' onclick=\"javascript:cargarDatosInmueble(" + datosInmueble.ID + ", true, " + desdeLista + ", false, false);\"><img class='fotos_tabla' id='fv_" + datosInmueble.ID + "' src='/img/sin_imagen4.png' alt='Imagen no disponible'></div>"; if (datosInmueble.HAY_PLANO){ texto += "<div class='plano' onclick=\"javascript:showPlanosRejilla('" + datosInmueble.PLANO +"','" + datosInmueble.PLANO2 + "','" + datosInmueble.PLANO3 + "');\"><span>" + _t_plano + "</span></div>";}
if (datosInmueble.HAY_VIDEO == 'S') { texto += "<div class='video' onclick=\"javascript:mostrarPanelVideo(" + datosInmueble.ID + ",null);\"><span>Video</span></div>";}
else
if (datosInmueble.HAY_VIDEO_PROMO == 'S') { texto += "<div class='video' onclick=\"javascript:mostrarPanelVideo(null," + datosInmueble.ID_PROMOCION + ");\"><span>Video</span></div>";}
texto += "</td><td valign='top' style='width:570px'>"; clase = aAlt.alternate(); texto += textoPoblacion(datosInmueble, aAlt); clase = aAlt.alternate(); clase = aAlt.alternate(); texto += "<br /><span class='" + clase + "'>" + _t_obra_nueva + ": " + datosInmueble.NOMBRE + "</span>"; alt = "normal"; texto += "<br /><ul style='margin-top:0; margin-bottom:0'>"; var nuevo = _t_new; if (datosInmueble.NUEVO == 'N')
nuevo = _t_second_hand; var tipo_operacion = _t_for_sale; if (tipoOperacionBusqueda == "A")
tipo_operacion = _t_for_rent; else
if (tipoOperacionBusqueda == "AC")
tipo_operacion = _t_for_rent_to_buy; var valor = datosInmueble.TIPO_PROPIEDAD + " - " + nuevo + " - " + tipo_operacion; texto += "<li><span class='normal'>" + valor + "</span></li>"; valor = ""; if (datosInmueble.HABITACIONES > 0) { valor = datosInmueble.HABITACIONES + " " + _t_rooms;}
if (datosInmueble.METROS > 0) { if (datosInmueble.HABITACIONES > 0)
valor += " " + _t_y + " " + datosInmueble.METROS + " " + _t_metros; else
valor += datosInmueble.METROS + " " + _t_metros;}
if (valor != "")
texto += "<li><span class='normal'>" + valor + "</span></li>\n"; if (tipoOperacionBusqueda == "V")
var quePrecio = datosInmueble.PRECIO; else if (tipoOperacionBusqueda == "A")
var quePrecio = datosInmueble.PRECIO_ALQUILER; else
var quePrecio = datosInmueble.PRECIO_ALQUILER_COMPRA; if ((tipoOperacionBusqueda == "V") && (datosInmueble.METROS > 0 ) && (quePrecio > 0)) { valor = getPrecio(Math.round(parseInt(quePrecio / datosInmueble.METROS), 0)); texto += "<li><span class='normal'>" + _t_precio_m2 + ": </span><span class='precio' title='" + valor.precio_t + "'> " + valor.precio_final + " &euro;</span></li>\n";}
texto += "</ul>"; texto += textoOfertaEspecial(datosInmueble); texto += textoOtrosPrecios(tipoOperacionBusqueda, datosInmueble); var temp = ""; var ponerOtros = false; temp = "<br /><span class='alt2'>" + _t_other_pro + "</span>"
temp += "<ul style='margin-top:0; margin-bottom:0;'>"; if (datosInmueble.PROPIEDAD_PROMO.length > 0) { temp += "<li><span class='normal'>"; for (var i = 0; i < datosInmueble.PROPIEDAD_PROMO.length; i++) { temp += datosInmueble.PROPIEDAD_PROMO[i] + " | ";}
temp = temp.substring(0, temp.length - 2); temp += "</span></li>"; ponerOtros = true;}
if ((datosInmueble.METROS_MIN > 0) || (datosInmueble.METROS_MAX > 0)) { temp += "<li>"; if (datosInmueble.METROS_MIN > 0) { temp += "<span class='normal'>" + _t_desde + " " + datosInmueble.METROS_MIN + "</span>\n";}
if ((datosInmueble.METROS_MAX > 0) && (datosInmueble.METROS_MAX != datosInmueble.METROS_MIN)) { temp += "<span class='normal'>" + _t_hasta + " " + datosInmueble.METROS_MAX + " " + _t_metros_2 + "</span>\n";}
else
temp += "<span class='normal'>" + _t_metros_2 + "</span>\n"; temp += "</li>"; ponerOtros = true;}
if ((datosInmueble.HABITACIONES > 0) || (datosInmueble.HABITACIONES_MAX > 0)) { temp += "<li>"; if (datosInmueble.HABITACIONES_MIN > 0) { temp += "<span class='normal'>" + _t_desde + " " + datosInmueble.HABITACIONES_MIN + "</span>\n";}
if ((datosInmueble.HABITACIONES_MAX > 0) && (datosInmueble.HABITACIONES_MAX != datosInmueble.HABITACIONES_MIN)) { temp += "<span class='normal'>" + _t_hasta + " " + datosInmueble.HABITACIONES_MAX + " " + _t_rooms + "</span>\n";}
else
temp += "<span class='normal'>" + _t_rooms + "</span>\n"; temp += "</li>"; ponerOtros = true;}
if ((datosInmueble.PRECIO_MIN > 0) || (datosInmueble.PRECIO_MAX > 0)) { temp += "<li>"; if (datosInmueble.PRECIO_MIN > 0) { var precio_final = formatPrecio(datosInmueble.PRECIO_MIN); var precio_pts = Math.round(parseInt(datosInmueble.PRECIO_MIN) * 166.386, 0).toString(); var precio_t = formatPrecio(precio_pts) + " pts"; temp += "<span class='normal' style='cursor:help' title='" + precio_t + "'>" + _t_desde + " " + precio_final + " &euro;</span>\n";}
if ((datosInmueble.PRECIO_MAX > 0) && (datosInmueble.PRECIO_MAX != datosInmueble.PRECIO_MIN)) { var precio_final = formatPrecio(datosInmueble.PRECIO_MAX); var precio_pts = Math.round(parseInt(datosInmueble.PRECIO_MAX) * 166.386, 0).toString(); var precio_t = formatPrecio(precio_pts) + " pts"; temp += "<span class='normal' style='cursor:help' title='" + precio_t + "'> " + _t_hasta + " " + precio_final + " &euro;</span>\n";}
temp += "</li>"; ponerOtros = true;}
temp += "</ul>"; if (ponerOtros)
texto += temp; texto += textoDescripcion(datosInmueble); texto += textoFecha(datosInmueble); texto += "</td>"; texto += textoAnunciante(datosInmueble, aAlt); texto += "</tr>"; texto += "<tr><td colspan='3'>"; texto += "<span style='margin:0px;padding:3px; float:left;'>"; texto += textoSituar(datosInmueble, quePrecio, listado); if (quePrecio > 0) { var precio_final = formatPrecio(quePrecio); var precio_pts = Math.round(parseInt(quePrecio) * 166.386, 0).toString(); var precio_t = formatPrecio(precio_pts) + " pts"; texto += "<span class='precio' title='" + precio_t + "'> " + precio_final + " &euro;</span>";}
else
texto += "<span class='precio' style='cursor:auto;'> " + _t_price_consult + "</span>"; texto += textoHipoteca(datosInmueble); texto += "</span>"; texto += textoOpciones(datosInmueble, listado); texto += "</td></tr>"; texto += "</table>"; div_general.innerHTML = texto; listado.appendChild(div_general); aAlt = null;}
function ponerNavegacion(jData, superior){ var div; var queNav = ""; var anterior = ""; var posterior = ""; var texto = ""; var numPaginas = Math.ceil(jData.numrows / parseInt(document.getElementById('maxResults').value)); var maxResults = parseInt(document.getElementById('maxResults').value); var primero = (parseInt(jData.offset) - 1) * maxResults; var numRows = parseInt(jData.numrows); var offset = parseInt(jData.offset); var ultimo = primero + maxResults; var que = jData.que; var ordenado; if (globalTipoPagina == "MISINMUEBLES"){ _t_asc = "Fecha Asc"; _t_asc_more = "Fecha ascendente"; _t_order_desc = "Fecha Desc"; _t_desc_more = "Fecha descendente";}
if (superior)
div = document.getElementById('nav_sup'); else
div = document.getElementById('nav_inf'); if (eval(jData.funcion))
queNav = jData.funcion; else
queNav = "irAGrupoInmuebles"; if (jData.orden == '')
ordenado = 2; else
ordenado = jData.orden; globalOrden = ordenado; if (ultimo > numRows)
ultimo = numRows; primero++; if (numRows == 0) { texto = "<span class='alt2'>" + _t_no_results + "</span>";}
else
if (numRows > maxResults) { if (!(offset == 1)) { des = offset - 1; if (superior)
anterior = "<a id='nav_sup_previous' href=\"javascript:" + queNav + "('" + que + "'," + numRows + "," + des + "," + ordenado + ");\"><img style='vertical-align:middle;' src='/img/navigate_left_trans.png' alt='" + _t_previous_page + "'></a>\n"; else
anterior = "<a id='nav_inf_previous' href=\"javascript:" + queNav + "('" + que + "'," + numRows + "," + des + "," + ordenado + ");\"><img style='vertical-align:middle;'src='/img/navigate_left_trans.png' alt='" + _t_previous_page + "'></a>\n";}
else
anterior = "<img style='vertical-align:middle;' src='/img/nav_end_trans.png' alt='Se ha llegado al principio'>"; if (!(offset * maxResults >= numRows)) { des = offset + 1; if (superior)
posterior = " <a id='nav_sup_next' href=\"javascript:" + queNav + "('" + que + "'," + numRows + "," + des + "," + ordenado + ");\"><img style='vertical-align:middle;' src='/img/navigate_right_trans.png' alt='" + _t_next_page + "'></a>\n"; else
posterior = " <a id='nav_inf_next' href=\"javascript:" + queNav + "('" + que + "'," + numRows + "," + des + "," + ordenado + ");\"><img style='vertical-align:middle;' src='/img/navigate_right_trans.png' alt='" + _t_next_page + "'></a>\n";}
else
posterior = " <img style='vertical-align:middle;' src='/img/nav_end_trans.png' alt='" + _t_s_fin + "'>"; if (_t_l == "en")
texto = "<span class='alt2'>" + anterior + " Showing from " + primero + " up to " + ultimo + " of " + numRows + posterior + "</span>"; else
if (_t_l == "ca")
texto = "<span class='alt2'>" + anterior + " Mostrat del " + primero + " al " + ultimo + " de " + numRows + posterior + "</span>"; else
if (_t_l == "val")
texto = "<span class='alt2'>" + anterior + " Mostrat del " + primero + " al " + ultimo + " de " + numRows + posterior + "</span>"; else
texto = "<span class='alt2'>" + anterior + " Mostrado del " + primero + " al " + ultimo + " de " + numRows + posterior + "</span>"; if (superior) { if (numPaginas > 1) { texto += " <span class='alt2'>" + _t_page + " </span>"; if (superior)
id_select = "iraPagina_sup"; else
id_select = "iraPagina_inf"; var sel = ""; texto += "<select style='font-size:10px;' name='" + id_select + "' id='" + id_select + "'>"; for (var i = 1; i <= numPaginas; i++) { sel = ""; if (i == offset)
sel = "SELECTED"; texto += "<option value='" + i + "'" + sel + ">" + i + "</option>";}
texto += "</select>"; texto += "<input type='button' style='height:20px;' class='btn'  value='" + _t_go + "' onclick=\"javascript:" + queNav + "('" + que + "'," + numRows + "," + "document.getElementById('" + id_select + "').value," + ordenado + ");\">";}
texto += "<span class='alt2' style='margin-left:40px;'>" + _t_order + ": </span>"; if (ordenado == 2)
texto += "<span class='alt1'>" + _t_asc + " <img alt='" + _t_asc_more + "' style='border:0; vertical-align:middle;' src='/img/asc2.png'></span>"; else
texto += "<a style='text-decoration:none' href=\"javascript:irAGrupoInmuebles('" + que + "',"+numRows+",1,2);\">" + _t_asc + " <img alt='" + _t_asc_more + "' style='border:0; vertical-align:middle;' src='/img/asc2.png'></a>"; texto += " | "; if (ordenado == 3)
texto += "<span class='alt1'>" + _t_order_desc + " <img alt='" + _t_desc_more + "' style='border:0; vertical-align:middle;' src='/img/desc2.png'></span>"; else
texto += "<a style='text-decoration:none' href=\"javascript:irAGrupoInmuebles('" + que + "'," +numRows + ",1,3);\">" + _t_order_desc + " <img alt='" + _t_desc_more + "' style='border:0; vertical-align:middle;' src='/img/desc2.png'></a>";}
}
else { if (_t_l == "en")
texto = "<span class='alt2'>" + anterior + " Showing from " + primero + " to " + ultimo + " of " + numRows + posterior + "</span>"; else
if (_t_l == "ca")
texto = "<span class='alt2'>" + anterior + " Mostrat del " + primero + " al " + ultimo + " de " + numRows + posterior + "</span>"; else
if (_t_l == "val")
texto = "<span class='alt2'>" + anterior + " Mostrat del " + primero + " al " + ultimo + " de " + numRows + posterior + "</span>"; else
texto = "<span class='alt2'>" + anterior + " Mostrado del " + primero + " al " + ultimo + " de " + numRows + posterior + "</span>";}
div.innerHTML = texto; if (ATPConfig.tipoPagina == 2)
atp_setCurrentYPos(650); else
atp_setCurrentYPos(200);}
function proccesRequestNavegacion(jData){ if (CargarLista == false)
return; ponerNavegacion(jData, true); ponerNavegacion(jData, false);}
function proccesRequestListadoInmuebles(jData){ if (panelFotosPeq)
panelFotosPeq.hide(); if (CargarLista == false)
return; var idPrimer = null; var primer = true; latitudPrimerInmueble = null; longitudPrimerInmueble = null; if (timeOutIrAGrupoInmuebles) { if (jData != null) { if (jData.timeout != timeOutIrAGrupoInmuebles)
return;}
else { endTimeOut(timeOutIrAGrupoInmuebles); timeOutIrAGrupoInmuebles = null; return;}
endTimeOut(timeOutIrAGrupoInmuebles); timeOutIrAGrupoInmuebles = null;}
if (timeOutBuscarInmuebles) { if (jData != null) { if (jData.timeout != timeOutBuscarInmuebles)
return;}
else { endTimeOut(timeOutBuscarInmuebles); timeOutBuscarInmuebles = null; return;}
endTimeOut(timeOutBuscarInmuebles); timeOutBuscarInmuebles = null;}
var grid = document.getElementById('grid_inmuebles'); var listado = document.getElementById('listado_inmuebles'); if (listado) { grid.removeChild(listado);}
scrollFotosv = new Object(); var listado = document.createElement('div'); listado.id = 'listado_inmuebles'; grid.appendChild(listado); for (i = 0; i < jData.datos.length; i++) { if (primer) { idPrimer = jData.datos[i].ID; latitudPrimerInmueble = jData.datos[i].LATITUD; longitudPrimerInmueble = jData.datos[i].LONGITUD;}
AnyadirFotosScroll(jData.datos[i]); AnyadirInmuebleListado(jData.datos[i], listado); primer = false;}
completados++; if (completados >= MAX_COMPLETADOS) { completados = 0; panelEspere.hide();}
if (mostrarDatosPrimerInmueble == true) { var primer = listado.childNodes[0]; if (primer) { var split_array = primer.id.split("_"); panel.hide(); cargarDatosInmueble(split_array[2], true, false, false, false);}
}
if (mostrarDatosUltimoInmueble == true) { var grid = document.getElementById('grid_inmuebles'); var nodelist = listado.childNodes; var ultimo = listado.childNodes[nodelist.length - 1]; if (ultimo) { var split_array = ultimo.id.split("_"); panel.hide(); cargarDatosInmueble(split_array[2], true, false, false, false); grid.scrollTop = scrollInmueble(split_array[2]);}
}
mostrarDatosPrimerInmueble = false; mostrarDatosUltimoInmueble = false; if (ATPConfig.tipoPagina == 2) { if ((jData.hayLocalidad == 1) && (latitudPrimerInmueble != null))
frame_mapa.situar(latitudPrimerInmueble, longitudPrimerInmueble); else { }
latitudPrimerInmueble = null; longitudPrimerInmueble = null;}
mapaBeginTimeOutScrollFotos();}
var scrollFotoIndex = 0; function AnyadirFotosScrollFromPHP(){ var grid = document.getElementById('grid_inmuebles'); var listado = document.getElementById('listado_inmuebles'); var x = listado.childNodes; var i = 0; var ids = ""; for (i = 0; i < x.length; i++) { if (x[i].nodeName.toLowerCase() == 'div') { ids += x[i].id.split("_")[2] + "_";}
}
if (ids.length > 0) { request = '/inmuebles/' + atp_version + '/json/json_get_images.php?ids=' + ids + "&timeout=" + 20102; aObj = new JSONscriptRequest(request); aObj.buildScriptTag(); aObj.addScriptTag();}
if (globalTipoPagina == "MISINMUEBLES") { grid = document.getElementById('grid_promociones'); listado = document.getElementById('listado_promociones'); x = listado.childNodes; ids = ""; for (i = 0; i < x.length; i++) { if (x[i].nodeName.toLowerCase() == 'div') { ids += x[i].id.split("_")[2] + "_";}
}
if (ids.length > 0) { request = '/inmuebles/' + atp_version + '/json/json_get_images_promociones.php?ids=' + ids + "&timeout=" + 20102; aObj = new JSONscriptRequest(request); aObj.buildScriptTag(); aObj.addScriptTag();}
}
}
function proccesRequestLoadImages(jData){ if (jData != null) { for (i = 0; i < jData.datos.length; i++) { AnyadirFotosScroll(jData.datos[i]);}
}
mapaBeginTimeOutScrollFotos();}
function AnyadirFotosScroll(jData){ var hayFotos = true; var i = 0; var queFoto = ""; var fotosIn = new Array(); var uri = uriImagenes; if (jData.URL_ATP != ""){ uri = jData.URL_ATP;}
while (hayFotos) { queFoto = "jData.imagen_" + i; if (eval(queFoto)) { fotosIn[fotosIn.length] = uri + "/inmuebles/images/100_" + eval(queFoto); var img = new Image(); img.src = uri + "/inmuebles/images/100_" + eval(queFoto); i++;}
else
hayFotos = false;}
if (i > 0)
scrollFotosv[jData.ID] = fotosIn;}
function scrollFotos(){ var div = null; for (var fotos in scrollFotosv) { div = document.getElementById('fv_' + fotos); if (div)
div.src = scrollFotosv[fotos][Mod(scrollFotoIndex, scrollFotosv[fotos].length)];}
scrollFotoIndex++; mapaBeginTimeOutScrollFotos();}
var timeOutScrollFotos = null; function mapaBeginTimeOutScrollFotos(){ clearTimeOutScrollFotos(); timeOutScrollFotos = window.setTimeout("checkTimeOutScrollFotos()", 3 * 1000);}
function clearTimeOutScrollFotos(){ window.clearTimeout(timeOutScrollFotos); timeOutScrollFotos = null;}
function checkTimeOutScrollFotos(){ clearTimeOutScrollFotos(); scrollFotos();}
function mouseOverFotos(anchorElement, URL_ATP){ var uri = uriImagenes; try { var id = anchorElement.split("_")[1]; var texto = "<div onclick=\"javascript:cargarDatosInmueble(" + id + ", true, false, false, false);\" onmouseout='javascript:panelFotosPeq.hide();'"; texto += " style:'background:url(/img/indicator.gif) no-repeat;';>"; var img; var w = 0; var fotoActual = document.getElementById(anchorElement); texto += "<img class='fotos' src='" + fotoActual.src + "'>"; w += 112; if (scrollFotosv[id]) { for (var i = 0; i < scrollFotosv[id].length; i++) { if (fotoActual.src.indexOf(scrollFotosv[id][i]) == -1) { texto += "<img style=\"background:url('/img/indicator.gif') 50% 50% no-repeat;\" class='fotos' src='" + scrollFotosv[id][i] + "'>"; w += 112;}
}
}
texto += "</div>"; panelFotosPeq.cfg.queueProperty('context', ['' + anchorElement + '', 'tl', 'tl']); panelFotosPeq.cfg.queueProperty('width', w); panelFotosPeq.setBody(texto); panelFotosPeq.render(document.body); panelFotosPeq.show();}
catch (e) { ;}
}
function irAGrupoInmuebles(parametros, numRows, offset, orden){ var grid = document.getElementById('grid_inmuebles'); var listado = document.getElementById('listado_inmuebles'); completados = MAX_COMPLETADOS - 1; mostrarPanelEspere(_t_info, _t_buscando); endTimeOut(timeOutIrAGrupoInmuebles); timeOutIrAGrupoInmuebles = beginTimeOut(tiempoTimeOut); if (globalTipoPagina == "MISINMUEBLES") { request = '/inmuebles/' + atp_version + '/json/json_listado_history.php?ln=' + _t_l + '&orden=' + orden + parametros + "&NumRows=" + numRows + "&offset=" + offset + "&timeout=" + timeOutIrAGrupoInmuebles; request += '&privado=S'; request += '&misinmuebles=S';}
else { request = '/inmuebles/' + atp_version + '/json/json_listado_history.php?ln=' + _t_l + '&orden=' + orden + parametros + "&NumRows=" + numRows + "&offset=" + offset + "&timeout=" + timeOutIrAGrupoInmuebles;}
var div; if (globalTipoPagina != "INDEX") { div = document.getElementById('id_usuario'); if (div)
request += "&id_usuario=" + document.getElementById('id_usuario').value;}
if (globalTipoPagina == "INDEX")
request += '&de_inicio=S'; if (globalTipoPagina == "COMPARTIDOS") { request += "&id_usuario_compartido=" + document.getElementById('id_usuario_compartido').value; request += "&compartidos=S";}
aObj = new JSONscriptRequestHistory(request); aObj.buildScriptTag();}
function selViviendas(el, tipo, check){ if (el.checked) { var Dom = YAHOO.util.Dom; var div = Dom.get("form_busqueda"); var className = "tipo_prop_" + tipo; var els = Dom.getElementsByClassName(className, "", div); var tp = ""; if (els) { for (var i = 0; i < els.length; i++) { els[i].checked = check;}
}
}
}
function buscarInmuebles(interactivo){ var parametros_particulares = ""; var grid = document.getElementById('grid_inmuebles'); var listado = document.getElementById('listado_inmuebles'); panel.hide(); completados = 0; mostrarPanelEspere(_t_info, _t_buscando); ATPConfig.parametros = ""; ATPConfig.parametros_particulares = ""; var precio_min = ATPescape(document.getElementById('precio_min').value); if (precio_min != '')
ATPConfig.parametros += "&precio_min=" + precio_min; var precio_max = ATPescape(document.getElementById('precio_max').value); if (precio_max != '')
ATPConfig.parametros += "&precio_max=" + precio_max; var metros_min = ATPescape(document.getElementById('metros_min').value); if (metros_min != '')
ATPConfig.parametros += "&metros_min=" + metros_min; var metros_max = ATPescape(document.getElementById('metros_max').value); if (metros_max != '')
ATPConfig.parametros += "&metros_max=" + metros_max; var hab_min = ATPescape(document.getElementById('hab_min').value); if (hab_min != '')
ATPConfig.parametros += "&hab_min=" + hab_min; var hab_max = ATPescape(document.getElementById('hab_max').value); if (hab_max != '')
ATPConfig.parametros += "&hab_max=" + hab_max; if (document.getElementById('nuevo').checked)
ATPConfig.parametros += "&nuevo=s"; if (document.getElementById('segunda').checked)
ATPConfig.parametros += "&segunda=s"; if (document.getElementById('obra_nueva').checked)
ATPConfig.parametros += "&obra_nueva=s"; else
ATPConfig.parametros += "&obra_nueva=n"; var o = document.form_busqueda.tipo_op; for (var i = 0; i < o.length; i++){ if (o[i].checked) { ATPConfig.parametros += "&tipo_op=" + o[i].value; tipoOperacionBusqueda = (o[i].value).toUpperCase();}
}
var Dom = YAHOO.util.Dom; var div = Dom.get("form_busqueda"); var els = Dom.getElementsByClassName("tipo_prop", "", div); var tp = ""; if (els){ for (var i = 0; i < els.length; i++) { if (els[i].checked)
tp += "_" + els[i].value;}
}
ATPConfig.parametros += "&tipo_propiedad=" + tp; var r = document.getElementById('referencia'); if (r)
ATPConfig.parametros += "&referencia=" + ATPescape(r.value); var codpostal = document.getElementById('codpostal').value; if (codpostal.length >= 2) { ATPConfig.parametros_particulares += "&codpostal=" + ATPescape(codpostal);}
else { var provincias = document.getElementById('provincia'); ATPConfig.parametros_particulares += "&provincia=" + provincias.value; ATPConfig.parametros_particulares += "&localidad=" + ATPescape(document.getElementById('localidad').value);}
endTimeOut(timeOutBuscarInmuebles); timeOutBuscarInmuebles = beginTimeOut(tiempoTimeOut); globalOrden = 2; request = '/inmuebles/' + atp_version + '/json/json_listado_history.php?ln=' + _t_l + '&orden=' + globalOrden + ATPConfig.parametros + ATPConfig.parametros_particulares + "&timeout=" + timeOutBuscarInmuebles; var div; if (globalTipoPagina != "INDEX") { div = document.getElementById('id_usuario'); if (div) { request += "&id_usuario=" + div.value; if (globalTipoPagina != "MISINMUEBLES")
request += "&privado=S";}
}
if (globalTipoPagina == "MISINMUEBLES") { request += "&nocargarlista=s"; request += "&misinmuebles=S"; ATPConfig.parametros += "&misinmuebles=S";}
if (globalTipoPagina == "INDEX")
request += "&de_inicio=S"; div = document.getElementById('id_usuario_compartido'); if (div) { request += "&compartidos=S"; request += "&id_usuario_compartido=" + div.value;}
aObj = new JSONscriptRequestHistory(request); aObj.buildScriptTag(); if (ATPConfig.tipoPagina == 2) { if (ATPConfig.parametros != '') { frame_mapa.atpCargarInmuebles(); frame_mapa.atpCuantosInmuebles();}
}
}
function cargarRejillaDesdeMapa(){ panel.hide(); completados = 0; mostrarPanelEspere(_t_info, _t_buscando); var latnorte = frame_mapa.atpGetLatnorte(); var longnorte = frame_mapa.atpGetLongnorte(); var latsur = frame_mapa.atpGetLatsur(); var longsur = frame_mapa.atpGetLongsur(); var parametros = ATPConfig.parametros + '&latnorte=' + latnorte + '&longnorte=' + longnorte + '&latsur=' + latsur + '&longsur=' + longsur; timeOutBuscarInmuebles = endTimeOut(timeOutBuscarInmuebles); timeOutBuscarInmuebles = beginTimeOut(tiempoTimeOut); globalOrden = 2; request = '/inmuebles/' + atp_version + '/json/json_listado_mapa_history.php?ln=' + _t_l + '&orden=' + globalOrden + parametros + "&timeout=" + timeOutBuscarInmuebles; var div; if (globalTipoPagina != "INDEX") { div = document.getElementById('id_usuario'); if (div)
request += "&id_usuario=" + document.getElementById('id_usuario').value;}
if (globalTipoPagina == "MISINMUEBLES")
request += "&nocargarlista=s"; if (globalTipoPagina == "INDEX")
request += "&de_inicio=S"; if (globalTipoPagina == "COMPARTIDOS") { request += "&id_usuario_compartido=" + document.getElementById('id_usuario_compartido').value; ; request += "&compartidos=S";}
aObj = new JSONscriptRequestHistory(request); aObj.buildScriptTag();}
function logoMask(){ var pos = 0; try { if (document.body && document.body.scrollTop)
pos = document.body.scrollTop; if (document.documentElement && document.documentElement.scrollTop)
pos = document.documentElement.scrollTop; if (window.pageYOffset)
pos = window.pageYOffset;}
catch (e) { ;}
var div = document.getElementById('datos_inmuebleID_mask'); div.style.backgroundPosition = "0px " + pos + "px";}

