// JavaScript Document
<!--

function comprobar_fin_price(){
	//actualiza pricefin como minimo a priceinic, si estos cambian
	frm=document.forms['formbusquedas'];
	
	priceinic=Number(frm.ppriceinic.value);
	pricefin=Number(frm.ppricefin.value);
	
	if(priceinic!=0 && pricefin!=0){
		if(pricefin<priceinic)	frm.ppricefin.value=priceinic;
	}	
}

function mostrar_resultado_busqueda(donde_ir){
	frm=document.forms['formbusquedas'];
	
	if(!donde_ir){

		es_alquiler=frm.psection[1].checked;

		frm.action=(es_alquiler)?"pisos_alquiler_huelva.php":"pisos_segunda_mano_huelva.php";
	}
	else 
		frm.action=donde_ir;
	

	frm.submit();	
}

function fnWhenDone(elto,oXML) {		
	var elto_refresh = document.getElementById(elto);

	elto_refresh.innerHTML = oXML.responseText;
};

function refresh_areas_formu(id_refresh,lang,section,prm){
	if (document.getElementById(id_refresh)==null)
		return;
	
	var myConn = new XHConn();

	if (!myConn) alert("Navegador sin soporte AJAX. Por favor utilice un navegador más actual.");

	frm=document.forms['formbusquedas'];
	
	
	if (! section) section=(frm.psection[1].checked)? 'A':'V';//vemos cual está seleccionado	


	params='opc_section='+section+'&lang='+lang+prm;

	
	//function(sObj, sURL, sMethod, sVars, fnDone)
	myConn.connectobj(id_refresh,'modules/refresh_formu_inmuebles.php',"POST",params,fnWhenDone);	
}


function ShowRealstate(id){
	
	carga=escape(document.getElementById('page').value)+'?idr='+escape(id);
	
	carga+='&section='+escape(document.getElementById('section').value);
	carga+='&op='+escape(document.getElementById('op').value);
	carga+='&pcity='+escape(document.getElementById('pcity').value);
	carga+='&ptown='+escape(document.getElementById('ptown').value);
	carga+='&pzone='+escape(document.getElementById('pzone').value);
	carga+='&pnrooms='+escape(document.getElementById('pnrooms').value);
	carga+='&ppriceinic='+escape(document.getElementById('ppriceinic').value);
	carga+='&ppricefin='+escape(document.getElementById('ppricefin').value);

	window.location=carga;

}

function showPhotoWindow(i)
{
	k=0;

	while (true)
	{
		var obj='foto_' + String(k);
		obj_id = document.getElementById(obj);

		if (obj_id==null)
			break;

		if (k==i)
			obj_id.style.display = 'block';
		else
			obj_id.style.display = 'none';
		++k;
	}
}
-->