function envia()
{
	try
	{
		document.busca.poblacion.value = document.busca2.poblacion.value
	}
	catch(e)
	{
		document.busca.poblacion.value = 0
	}
	if(document.busca.precio.value  + "" == "") document.busca.precio.value = 9;
	//document.busca.action="http://10.20.30.20/English/ENGBuscador.asp"	
	document.busca.submit();
}

//////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////


function  carga_precios()
{
	var tipo
	try
	{
		tipo=document.busca.tipo_formulario.value;
	}
	catch(e)
	{
		tipo=0
	}
	if(tipo==1) cambiaPrecios()
	if(tipo==2) cambiaPreciosFinestrat()
}

//////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
function  cambiaPrecios()
{
	vtipo=document.busca.tipo_inmueble.value;
	voficina=0;
	//if (document.busca.ciudad[0].checked) voficina=6;
	//if (document.busca.ciudad[1].checked) voficina=7;

	var x=document.busca.precio.length;
	var i=0;
	for (i;i<x;i++) document.busca.precio.options[0]=null;
	
	for(i=0;i<document.busca.ciudad.length;i++)
        if(document.busca.ciudad[i].checked) zona=document.busca.ciudad[i].value;


	//VALENCIA
	if (zona==6) {
		if (vtipo==6)
		{
					document.busca.precio.options[0]= new Option("Hasta 150.000 Euros","35",true,true);
					document.busca.precio.options[1]= new Option("Desde 150.000 a 250.000 Euros","33",false,false);
					document.busca.precio.options[2]= new Option("Más de 250.000 Euros","34",false,false);
		}
			
		else if (vtipo==13)
		{
					document.busca.precio.options[0]= new Option("Hasta 100.000 Euros","31",true,true);
					document.busca.precio.options[1]= new Option("Desde 100.000 a 150.000 Euros","32",false,false);
					document.busca.precio.options[2]= new Option("Desde 150.000 a 250.000 Euros","33",false,false);					
					document.busca.precio.options[3]= new Option("Más de 250.000 Euros","34",false,false);	
		}
		else{
			cualquierPrecio()
		}
	
	}else if (zona==7){
		if (vtipo==6)
		{
			document.busca.precio.options[0]= new Option("Hasta 100.000 Euros","31",true,true);
			document.busca.precio.options[1]= new Option("Mas de 100.000 Euros","26",false,false);
		}
		else if (vtipo==13)
		{
			document.busca.precio.options[0]= new Option("Hasta 100.000 Euros","31",true,true);
			document.busca.precio.options[1]= new Option("Desde 100.000 a 150.000 Euros","32",false,false);
			document.busca.precio.options[2]= new Option("Desde 150.000 a 250.000 Euros","33",false,false);					
			document.busca.precio.options[3]= new Option("Más de 250.000 Euros","34",false,false);				
		}
		else 
		{
			cualquierPrecio()
		}
	}

	/*if (document.busca.precio.length==0)
	{
		document.busca.precio.options[0]= new Option("Any","9",true,true);
	}
	document.busca.precio.options[0].selected=true;*/
}
function cualquierPrecio()
{
	try
	{	
		document.busca.precio.options[0]= new Option("cualquiera","9",true,true);
	}
	catch(e)
	{}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
function  cambiaPreciosFinestrat()
{
	vtipo=document.busca.apartamentos.value;
	var x=document.busca.precio.length;
	var i=0;
	for (i;i<x;i++) document.busca.precio.options[0]=null;


	if (vtipo==12)
	{
		document.busca.precio.options[0]= new Option("Any","9",true,true);
		document.busca.precio.options[1]= new Option("Between 150.253 and 162.273 Euros","12",false,false);
		document.busca.precio.options[2]= new Option("Between 162.273 and 180.303 Euros","22",false,false);
		document.busca.precio.options[3]= new Option("Between 180.303 and 192.323 Euros","32",false,false);
		document.busca.precio.options[4]= new Option("Between 192.323 and 200.000 Euros","42",false,false);				
		document.busca.precio.options[5]= new Option("Between 200.000 and 210.354 Euros","52",false,false);
		document.busca.precio.options[6]= new Option("More than 210.354 Euros","62",false,false);				
	}
	
	//precios cualquiera
	if (document.busca.precio.length==0)
	{
		document.busca.precio.options[0]= new Option("Any","9",true,true);
	}
	document.busca.precio.options[0].selected=true;
	
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////