function desdehasta(min,max,s) {
	r1 = '';
	r2 = '';
	x = min.options[min.selectedIndex].value;
	y = max.options[max.selectedIndex].value;
	if (x != 0) r1 = '%20' + s + '>=' + x;
	if (y != 0) r2 = '%20' + s + '<=' + y;
	if ((r1!='') && (r2!=''))
		r = r1 + '%20AND' + r2
	else
		r = r1 + r2;
return r;
}
function desdehasta2(min,max,s) {
	r1 = '';
	r2 = '';
	x = min.value;
	y = max.value;
	if (x != 0) r1 = '%20' + s + '>=' + x;
	if (y != 0) r2 = '%20' + s + '<=' + y;
	if ((r1!='') && (r2!=''))
		r = r1 + '%20AND' + r2
	else
		r = r1 + r2;
return r;
}

// ########### LISTA DE LAS ZONAS ####################
function listaZonas(t,fr) {

var s = '';
var ss = '';
var ss_si = false;
var s_si = false;
with (fr) {
	for(j=0;j<t.length;j++)
		if (t.options[j].selected) {
			s_si = true;
			if (s.length > 0) s = s + "," + parseInt(t.options[j].value,10)
			else s = "zonas.idZona%20IN%20(" + parseInt(t.options[j].value,10);
		}
		else {
			ss_si = true;
			if (ss.length > 0) ss = ss + "," + parseInt(t.options[j].value,10)
			else ss = "zonas.idZona%20NOT%20IN%20(" + parseInt(t.options[j].value,10);
		}
	s = s + ")";
	ss = ss + ")";
}

if (ss_si)
	if (s.length > ss.length) s = ss;
return s;
}
// ########### STRING DEL LUGAR CIUDADES ####################
function stringLugarCiudades(fr,spro) {
var slugar="";
with (fr) {

//	if (todo.checked) slugar = spro + "%20AND%20(ciudades.idciudad=" + parseInt(ciudad.value,10) + ")"
//	if (zonas.options[0].selected) slugar = spro + "%20AND%20(ciudades.idciudad=" + parseInt(ciudad.value,10) + ")"
//	else slugar = spro + "%20AND%20(ciudades.idciudad=" + parseInt(ciudad.value,10) + ")%20AND%20(" + listaZonas(zonas,fr) + ")";

 slugar = spro + "%20AND%20(ciudades.idciudad=" + parseInt(ciudad.value,10) + ")"

} // del with

return slugar;
}

// ########### STRING DEL LUGAR ####################
function stringLugar(fr,t,sprovincia) {
var slugar="";
with (fr) {
	if (t == 1) { // s&oacute;lo ciudades
		slugar = sprovincia + "%20AND%20(ciudades.idciudad=" + ciudades.options[ciudades.options.selectedIndex].value + ")";
	}
} // del with

return slugar;
}


function alquiler2(p,x,y,d) {

	s = '';
	if (x != 0) {
		s1 = "(" + p + ">=" + x + ")";
		s = s1;
	}
	if (y != 0) {
		s2 = "(" + p + ">0)%20AND%20(" + p + "<=" + y + ")";
		if (s!='') s = s + '%20AND%20'+  s2
		else s = s2;
	}
//	if ((x==0) && (y==0) && (d!='-')) s = "(" + p + ">0)";
//	if ((x==0) && (y==0) && (d=='-')) s = "(1=1)";
//	if ((x==0) && (y==0) && (d=='-')) s = "(" + p + ">0%20or%20" + p + "=-1%20or%20" + p + "=-3)";
//	if ((x==0) && (y==0) && (d=='-')) s = "(" + p + ">0%20or%20" + p + "=-1)";

	if ((x==0) && (y==0) && (d=='-')) s = "(" + p + ">0%20or%20" + p + "=-1)";
	if ((x==1) && (y==0) && (d=='-')) s = "(" + p + ">0)";
	if ((x==1) && (y==1) && (d=='-')) s = "(" + p + "=-1)";

return s;
}

// ########### CONSULTA ####################
function consulta() {
var ok = 0;
var g = '';


if (parent.frames['fr2'].document.f1.departamento.value=='') {
	alert('Seleccione un lugar por favor. Gracias.');
	ok =1;
	}
else
if (parent.frames['fr2'].document.f1.inmueble.value=='') {
	alert('Seleccione un tipo de inmueble por favor. Gracias.');
	ok =1;
	}
else
if (parent.frames['fr2'].document.f1.transaccion.value=='') {
	alert('Seleccione un tipo de operación por favor. Gracias.');
	ok =1;
	}

if (ok==0) consulta3();
}

function consulta3() {
	var p = '';
	var swhere = new Array();
	var swhere2 = new Array();
	var w = '';
	var s = '';
	var z = '';
	var c = '';
	var id = '';
	var idinmo = '';
	var idgrupo = '';
	var slugar = '';
	var sprovincia = '';
	var szona = '';
	var sciudad = '';
	var from = '';
	var pmes = "";
	var p15 = "";
	var p15s = "";
	var psemana = "";

	var i = 0;
	var j = 0;

	with (top.frames['aldagaiak'].document.f1) {

// IDIOMA --------------------------------------------------------
	
	idioma = top.frames['aldagaiak'].document.f1.idi.value;

// INMOBILIARIA -------------------------------------------------------

	idinmo = top.frames['aldagaiak'].document.f1.inmo.value;

	idgrupo = top.frames['aldagaiak'].document.f1.id.value;
	if ((idgrupo!='000') && (idgrupo.substring(0,1)!='G') && (idgrupo.substring(0,1)!='T')) {
		swhere[i] = "%20inmobiliarias.idinmobiliaria='"+idinmo+"'";
		i++;
	}


// OFERTAS -------------------------------------------------------

	ofertitas = top.frames['aldagaiak'].document.f1.ofertas.value;
	if (ofertitas==1) {
		swhere[i] = "%20oferta='s'";
		i++;
	}


// INMUEBLE -------------------------------------------------------

		pbool = parent.frames['fr2'].document.f1.inmueble.options[parent.frames['fr2'].document.f1.inmueble.selectedIndex].value.substring(0,2)=='AP';
		cbool = parent.frames['fr2'].document.f1.inmueble.options[parent.frames['fr2'].document.f1.inmueble.selectedIndex].value.substring(0,2)=='CA';
		tbool = parent.frames['fr2'].document.f1.inmueble.options[parent.frames['fr2'].document.f1.inmueble.selectedIndex].value=='TE';
		lbool = parent.frames['fr2'].document.f1.inmueble.options[parent.frames['fr2'].document.f1.inmueble.selectedIndex].value=='LO';
		chbool = parent.frames['fr2'].document.f1.inmueble.options[parent.frames['fr2'].document.f1.inmueble.selectedIndex].value=='CH';
		obool = parent.frames['fr2'].document.f1.inmueble.options[parent.frames['fr2'].document.f1.inmueble.selectedIndex].value=='OF';
		cobool = parent.frames['fr2'].document.f1.inmueble.options[parent.frames['fr2'].document.f1.inmueble.selectedIndex].value=='CO';
		gbool = parent.frames['fr2'].document.f1.inmueble.options[parent.frames['fr2'].document.f1.inmueble.selectedIndex].value=='GA';
		esbool = parent.frames['fr2'].document.f1.inmueble.options[parent.frames['fr2'].document.f1.inmueble.selectedIndex].value=='ES';

		if (pbool) { // piso
			from = 'apartamentos';
			if (parrillero.checked) {
				swhere[i] = "%20(parrillero='s')%20";
				i++;
			}
			if (ascensor.checked) {
				swhere[i] = "%20ascensor='s'";
				i++;
			}
			if (ubicacion.options[ubicacion.selectedIndex].value != '-') {
				swhere[i] = "%20ubicacion='" + ubicacion.options[ubicacion.selectedIndex].value + "'";
				i++;
			}
			if (frente.checked) {
				swhere2[j] = "%20ubicacion='frente'";
				j++;
			}
			if (contrafrente.checked) {
				swhere2[j] = "%20ubicacion='contra%20frente'";
				j++;
			}
			if (interior.checked) {
				swhere2[j] = "%20ubicacion='interior'";
				j++;
			}
			if (lateral.checked) {
				swhere2[j] = "%20ubicacion='lateral'";
				j++;
			}
			if (penthouse.checked) {
				swhere2[j] = "%20ubicacion='penthouse'";
				j++;
			}
			if (j > 0) {
				w = '(' + swhere2[0];
				for (jj=1;jj<j;jj++) {
					w = w + '%20OR%20' + swhere2[jj];
				}
				w = w + ')';
				swhere[i] = "%20" + w;
				i++;
			}
			j = 0;
		}
		if (cbool) { // casas
			from = 'casas';
			if (fondo.checked) {
				swhere[i] = "%20fondo='s'";
				i++;
			}
			if (country.checked) {
				swhere[i] = "%20(barrio='s'%20or%20country='s')";
				i++;
			}
			if (parrillero.checked) {
				swhere[i] = "%20(parrillero='s'%20OR%20barbacoa='s')%20";
				i++;
			}
		}

		if (cbool || lbool) { // casas y local
			swhere[i]=desdehasta2(minm2cex,maxm2cex,'m2terreno');
			if (swhere[i]!='') i++;
		}
		if (tbool) { // terreno
			from = 'terrenos';
			if (vistaalmar.checked) {
				swhere[i] = "%20vistaalmar='s'%20";
				i++;
			}

			if (orientacion.selectedIndex != 0) {
				swhere[i] = "%20orientacion='" + orientacion.options[orientacion.selectedIndex].value + "'";
				i++;
			}
			swhere[i]=desdehasta2(minm2terrenoex,maxm2terrenoex,'m2');
			if (swhere[i]!='') i++;
			swhere[i]=desdehasta(minfrente,maxfrente,'mfrente');
			if (swhere[i]!='') i++;
			if (mar.options[mar.selectedIndex].value != -1) {
				swhere[i] = "%20mar<=" + mar.options[mar.selectedIndex].value + "%20AND%20mar<>-1";
				i++;
			}
		}
		if (chbool) { // chacra
			from = 'chacras';
			if (mar.options[mar.selectedIndex].value != -1) {
				swhere[i] = "%20mar<=" + mar.options[mar.selectedIndex].value + "%20AND%20mar<>-1";
				i++;
			}
			if (vivienda.checked) {
				swhere[i] = "%20vivienda='s'";
				i++;
			}
			if (vistaalmar.checked) {
				swhere[i] = "%20vistaalmar='s'%20";
				i++;
			}
			swhere[i] = "%20m2>99";
			i++;

			swhere[i]=desdehasta2(minm2chacraex,maxm2chacraex,'m2');
			if (swhere[i]!='') i++;
		}
		if ((pbool) || (cbool)) { //piso y casa

			if (mar.options[mar.selectedIndex].value != -1) {
				swhere[i] = "%20mar<=" + mar.options[mar.selectedIndex].value + "%20AND%20mar<>-1";
				i++;
			}
			if (estado.options[estado.selectedIndex].value != '-') {
				swhere[i] = "%20estadoconservacion='" + estado.options[estado.selectedIndex].value + "'";
				i++;
			}
			j = 0;
			if (ae.checked) {
				swhere2[j] = "%20estadoconservacion='a%20estrenar'";
				j++;
			}
			if (im.checked) {
				swhere2[j] = "%20estadoconservacion='impecable'";
				j++;
			}
			if (be.checked) {
				swhere2[j] = "%20estadoconservacion='buen%20estado'";
				j++;
			}
			if (rs.checked) {
				swhere2[j] = "%20estadoconservacion='reparaciones%20sencillas'";
				j++;
			}
			if (ar.checked) {
				swhere2[j] = "%20estadoconservacion='a%20reciclar'";
				j++;
			}
			if (ec.checked) {
				swhere2[j] = "%20estadoconservacion='en%20construccion'";
				j++;
			}
			if (j > 0) {
				w = '(' + swhere2[0];
				for (jj=1;jj<j;jj++) {
					w = w + '%20OR%20' + swhere2[jj];
				}
				w = w + ')';
				swhere[i] = "%20" + w;
				i++;
			}
			j = 0;
			if (vistaalmar.checked) {
				swhere[i] = "%20vistaalmar='s'%20";
				i++;
			}
			if (garaje.checked) {
				swhere[i] = "%20(garaje='s'%20OR%20cochera='s')%20";
				i++;
			}
			if (amueblado.checked) {
				swhere[i] = "%20amueblado='s'%20";
				i++;
			}
			if (calefaccion.checked) {
				swhere[i] = "%20calefaccion<>'n'";
				i++;
			}
			if (piscina.checked) {
				swhere[i] = "%20(piscina='s'%20or%20piscinacubierta='s')%20";
				i++;
			}
			if (dormservicio.checked) {
				swhere[i] = "%20dormservicio='s'";
				i++;
			}

			x = dormitorios.options[dormitorios.selectedIndex].value;

			if (x != '-') {
				if (x == 0)
					swhere[i] = '%20dormitorios=' + x
				else {
					y = x % 3;
					x = parseInt(x / 3,10);
					if (y == 0)
						swhere[i] = '%20dormitorios<=' + x;
					else if (y == 1)
								swhere[i] = '%20dormitorios>' + x
						  else swhere[i] = '%20dormitorios=' + parseInt(x +1,10);
				}
				i++;
			}
		}
		if ((cbool) || (pbool) || (lbool) || (obool)) { // chalet y local y apartamento y oficina
			x = banos.options[banos.selectedIndex].value;
			if (x != '-') {
				y = x % 3;
				x = parseInt(x / 3,10) + 1;
				if (y == 0)	swhere[i] = '%20ba%F1os%2Btoilettes>=' + x
				else if (y == 1) swhere[i] = '%20ba%F1os%2Btoilettes=' + x
					  else swhere[i] = '%20ba%F1os%2Btoilettes<=' + x;
				i++;
			}
			swhere[i]=desdehasta2(minm2ex,maxm2ex,'m2');
			if (swhere[i]!='') i++;
		}
		if (lbool) { // local
			from = 'locales';

			x = tipolocal.options[tipolocal.selectedIndex].value;
			if (x != '-') {
				swhere[i] = "%20tipolocal='" + x + "'"
				i++;
			}
			x = techol.options[techol.selectedIndex].value;
			if (x != '-') {
				swhere[i] = "%20techo='" + x + "'"
				i++;
			}
			if (oficinas.checked) {
				swhere[i] = "%20oficinas>0"
				i++;
			}
			if (plantas.checked) {
				swhere[i] = "%20plantas>1"
				i++;
			}
			x = entrada.options[entrada.selectedIndex].value;
			if (x != '-') {
				swhere[i] = "%20entrada='" + x + "'"
				i++;
			}
			x = altura.options[altura.selectedIndex].value;
			if (x != '-1') {
				if (x != 0)	swhere[i] = "%20altura>" + x
				else swhere[i] = "%20altura<=3";
				i++;
			}
		}
		if (obool) { // oficina
			from = 'oficinas';

			x = ubicacion.options[ubicacion.selectedIndex].value;
			if (x != '-') {
				swhere[i] = "%20ubicacion='" + x + "'";
				i++;
			}
			if (frente.checked) {
				swhere2[j] = "%20ubicacion='frente'";
				j++;
			}
			if (contrafrente.checked) {
				swhere2[j] = "%20ubicacion='contra%20frente'";
				j++;
			}
			if (interior.checked) {
				swhere2[j] = "%20ubicacion='interior'";
				j++;
			}
			if (lateral.checked) {
				swhere2[j] = "%20ubicacion='lateral'";
				j++;
			}
			if (penthouse.checked) {
				swhere2[j] = "%20ubicacion='penthouse'";
				j++;
			}
			if (j > 0) {
				w = '(' + swhere2[0];
				for (jj=1;jj<j;jj++) {
					w = w + '%20OR%20' + swhere2[jj];
				}
				w = w + ')';
				swhere[i] = "%20" + w;
				i++;
			}
			j = 0;

			if (garaje.checked) {
				swhere[i] = "%20garaje='s'";
				i++;
			}
			if (calefaccion.checked) {
				swhere[i] = "%20calefaccion<>'n'";
				i++;
			}
			if (ascensor.checked) {
				swhere[i] = "%20ascensor<>'n'";
				i++;
			}
			x = ambientes.options[ambientes.selectedIndex].value;
			if (x != '-') {
				y = x % 3;
				x = parseInt(x / 3,10) + 1;
				if (y == 0)
					swhere[i] = '%20ambientes>=' + x
				else if (y == 1)
							swhere[i] = '%20ambientes=' + x
					  else swhere[i] = '%20ambientes<=' + x;
				i++;
			}
		}

		if (cobool) { // comercios
			from = 'comercios';
		}
		if (gbool) { // garajes
			from = 'garajes';
		}
		if (esbool) { // especiales
			from = 'especiales';
		}


// TRANSACCION ----------------------------------------------------

		ventabool = parent.frames['fr2'].document.f1.transaccion.options[parent.frames['fr2'].document.f1.transaccion.selectedIndex].value=='V';
		alqbool = parent.frames['fr2'].document.f1.transaccion.options[parent.frames['fr2'].document.f1.transaccion.selectedIndex].value=='A';
		tembool = !(alqbool || ventabool);

		if (ventabool) {
			op = 'ventas';
			
			if ((idgrupo=='000') || (idgrupo.substring(0,1)=='G')) {
				swhere[i] = "%20ventas.vendido='n'";
				i++;
			}
			
			swhere[i] = "%20precioDolar>121";
			i++;

			swhere[i] = "%20" + op + ".vv='s'";
			i++;
			if (permuta.value==1) {
				swhere[i] = "%20permuta='s'";
				i++;
			}
			if (permuta.value==2) {
				swhere[i] = "%20permuta='n'";
				i++;
			}
			if (financia.value==1) {
				swhere[i] = "%20financia<>'n'";
				i++;
			}
			if (financia.value==2) {
				swhere[i] = "%20financia='n'";
				i++;
			}
			if (chbool) { // chacra
				swhere[i]=desdehasta2(preciominex,preciomaxex,'precioDolar*tipoprecio-(tipoprecio-1)*(m2/10000)*preciodolar');
			}
			else {
				swhere[i]=desdehasta2(preciominex,preciomaxex,'precioDolar');
			}
			if (swhere[i]!='') i++;
		}
		if (alqbool) {
			op = 'alquileres';

			if ((idgrupo=='000') || (idgrupo.substring(0,1)=='G')) {
				swhere[i] = "%20alquileres.alquilado='n'";
				i++;
			}

			swhere[i] = "%20" + op + ".va='s'";
			i++;

			if (traspaso.checked) {
				swhere[i] = "%20traspaso='s'";
				i++;
			}

			mierda = cambio.value.replace('.',',');
			mierda = parseFloat(mierda);

			if (moneda[0].checked) {
				xd = parseInt(minmensualidaddolarex.value,10);
				yd = parseInt(maxmensualidaddolarex.value,10);
				x = xd;
				y= yd;
				xp = parseInt(xd*mierda,10);
				yp = parseInt(yd*mierda,10);
			}
			else {
				xp = parseInt(minmensualidadpesoex.value,10);
				yp = parseInt(maxmensualidadpesoex.value,10);
				x = xp;
				y= yp;
				xd = Math.round(xp/mierda);
				yd = Math.round(yp/mierda);
			}
			if (x != 0) {
				swhere[i] = "%20((preciomensualidad>=" + xd + "%20AND%20unidad='d')%20OR%20(preciomensualidad>=" + xp + "%20AND%20unidad='p'))";
				i++;
			}
			if (y != 0) {
				swhere[i] = "%20((preciomensualidad<=" + yd + "%20AND%20unidad='d')%20OR%20(preciomensualidad<=" + yp + "%20AND%20unidad='p'))";
				i++;
			}
		}
		if (tembool) {
			op = 'temporada';

			swhere[i] = "%20" + op + ".vt='s'";
			i++;

			x = plazas.options[plazas.selectedIndex].value;
			if (x != '-') {
				y = x % 2;
				x = parseInt(x / 2,10) + 1;
				if (y == 0)	swhere[i] = '%20plazas=' + x
				else swhere[i] = '%20plazas>' + x;
				i++;
			}

			if (traspaso.checked) {
				swhere[i] = "%20traspaso='s'";
				i++;
			}

				x = parseInt(mintemporadaex.value,10);
				y = parseInt(maxtemporadaex.value,10);

				p = parent.frames['fr2'].document.f1.transaccion.options[parent.frames['fr2'].document.f1.transaccion.selectedIndex].value;
//				d = dias.options[dias.selectedIndex].value;
				d = "-";
				alq = '';

				if ((p!='ajul15') && (p!='ssanta')) {
					if ((p!='tempbaja') && (p!='tempbaja15')) {
						if (p.length>4) { // quincena
							alq = "(" + alquiler2(p,x,y,d) + '%20OR%20' + alquiler2(p+'s',x,y,d);
							p15="s";
							p15s="s";
						} else { // mes
							alq = "(" + alquiler2(p,x,y,d);
							pmes="s";
						}
					}
					else {
						if (p=='tempbaja') {
							alq = "(" + alquiler2(p,x,y,d);
							pmes="s";
						}
						else {
							alq = "(" + alquiler2(p,x,y,d);
							p15="s";
						}
					}
				}
				else {
					alq = "(" + alquiler2(p,x,y,d);
					if (p=='ajul15') {
						p15="s";
					} else {
						psemana="s";
					}
				}
				swhere[i] = alq  + ")";
				i++;
		}

// LUGAR ----------------------------------------------------------

	v = parent.frames['fr2'].document.f1.departamento.options[parent.frames['fr2'].document.f1.departamento.selectedIndex].value;
	limite = parent.frames['fr2'].document.f1.departamento.options[parent.frames['fr2'].document.f1.departamento.selectedIndex].value;
	if (limite!='0') {
		if (limite.length==3) { // es un departamento
			tipo = parseInt(parseInt(v,10) / 100,10);
			sprovincia = "(departamentos.IdDepartamento=" + parseInt(parseInt(v,10) % 100,10) + ")"
	
	//		if (!top.frames['aldagaiak_ciudades'].document.f1.ciudades.options[0].selected) {
	//			swhere[i] = stringLugar(top.frames['aldagaiak_ciudades'].document.f1,tipo,sprovincia);
	//		}
			swhere[i] = sprovincia;
			i++;
		}
		else {
			if (limite.length==7) { // es una ciudad
				tipo = v.substring(v.length-4,v.length-3);
				idciudad = parseInt(v.substring(v.length-3,v.length),10);
				iddepartamento = parseInt(v.substring(1,v.length-4),10);
				sprovincia = "(departamentos.IdDepartamento=" + iddepartamento + ")"
	
	
					swhere[i] = sprovincia + '%20AND%20(ciudades.idciudad=' + idciudad + ')';
					i++;
	
			}
			else { // es una zona
				if (limite.length==10) { // es una ciudad
					idzona = parseInt(v.substring(v.length-3,v.length),10);
					swhere[i] = '%20(zonas.idzona=' + idzona + ')';
					i++;
				}
				else {
					cantidadzonas = parseInt((v.length-7)/3,10);
					idzona = parseInt(v.substring(v.length-3,v.length),10);
					for (j=1;j<cantidadzonas;j++) {
						idzona = idzona + ',' + parseInt(v.substring(v.length-(3*(j+1))+3,v.length-(3*(j+1))),10);
					}
					swhere[i] = '%20(zonas.idzona in (' + idzona + '))';
					i++;
				}
			}
		}
	}

// FECHA -------------------------------------------------------

	if (idgrupo=='000') {
			ano = 2009;
			swhere[i] = "%20year("+from+".fua)>=" + ano;
//			swhere[i] = "%20year("+from+".fua)=" + ano + "%20and%20(month("+from+".fua)>=7%20and%20month("+from+".fua)<=12)";
			i++;
	}

// FOTOS -------------------------------------------------------

	fotitos = top.frames['aldagaiak'].document.f1.fotos.value;
	if (fotitos==1) {
		swhere[i] = "%20fotos>=1";
		i++;
	}
	if (fotitos==2) {
		swhere[i] = "%20fotos=0";
		i++;
	}

// nprop -------------------------

	nprop = parent.frames['fr2'].document.f1.nprop.value;

} // del with
	if (i > 0) {
		w = 'WHERE%20(' + swhere[0];
		for (j=1;j<i;j++) {
			w = w + '%20AND%20' + swhere[j];
		}
		w = w + ')';
	}


// grupos.

	if (idgrupo=='000') {
		w = w + "%20AND%20(G00='s')";
	}
	if (idgrupo.substring(0,1)=='G') {
		w = w + "%20AND%20(" + idgrupo + "='s')";
	}
	if (idgrupo.substring(0,1)=='T') {
		w = w + "%20AND%20(" + idgrupo + "='s')";
	}


	w = w + "%20AND%20((inmobiliarias.activada='s'))" + "&pmes="+pmes+"&p15="+p15+"&p15s="+p15s+"&psemana="+psemana+"&p="+p+"&idinmobiliaria="+idinmo+"&idgrupo="+idgrupo+'&nprop='+nprop;
	parent.frames['menu_emaitzak'].location.href = 'x_resumen.asp?idi='+idioma+'&op='+op+'&tabla='+from+'&where=' + w;
	parent.frames['emaitzak'].location.href = 'destacados_plus.asp?idi='+idioma+'&op='+op+'&tabla='+from+'&where=' + w;
}
