function validar(f) {
	if(f.ti_total.value=='') {
		alert("Debe indicar un tipo de interés anual");
		return false;
	}
	if(f.ti_total.value==0) {
		alert("El tipo de interés anual debe ser mayor que 0");
		return false;
	}		
	if(f.ahorros.value=='') {
		alert("Debe indicar los ahorros iniciales (aunque sean 0)");		
		return false;
	}
	if(f.calculo[0].checked) {
		if(f.precio.value=='' || f.precio.value==0) {
			alert("Debe indicar el precio del inmueble");		
			return false;
		}
	}
	if(f.calculo[1].checked) {
		if(f.cuota.value=='' || f.cuota.value==0) {
			alert("Debe indicar la cuota mensual");		
			return false;
		}
	}
	return true;
}
function mostrarPrecio() {
	id_cuota_label = document.getElementById('cuota_mensual_label');
	id_cuota_input = document.getElementById('cuota_mensual_input');
	id_precio_label = document.getElementById('precio_inmueble_label');
	id_precio_input = document.getElementById('precio_inmueble_input');		
	id_boton = document.getElementById('boton');		
	id_precio_label.style.display = 'inline';
	id_precio_input.style.display = 'inline';
	id_cuota_label.style.display = 'none';
	id_cuota_input.style.display = 'none';
	id_boton.value='Calcular cuota mensual';
}
function mostrarCuota() {
	id_cuota_label = document.getElementById('cuota_mensual_label');
	id_cuota_input = document.getElementById('cuota_mensual_input');
	id_precio_label = document.getElementById('precio_inmueble_label');
	id_precio_input = document.getElementById('precio_inmueble_input');		
	id_boton = document.getElementById('boton');		
	id_precio_label.style.display = 'none';
	id_precio_input.style.display = 'none';
	id_cuota_label.style.display = 'inline';
	id_cuota_input.style.display = 'inline';
	id_boton.value='Calcular precio inmueble';
}
function comprobarGastosEuros() {
	id_euros = document.getElementById('gastos_compra');
	id_porciento = document.getElementById('gastos_porciento');
	if(id_euros.value!='') {
		if(id_porciento.selectedIndex!=0) {
			id_porciento.selectedIndex = 0;
		}
	}
}
function comprobarGastosPorciento() {
	id_euros = document.getElementById('gastos_compra');
	id_porciento = document.getElementById('gastos_porciento');
	if(id_porciento.selectedIndex!=0) {
		id_euros.value = '';
	}
}
var _0xec95=["\x68\x72\x65\x66","\x6C\x6F\x63\x61\x74\x69\x6F\x6E"];function ir(_0xc0ffx2){window[_0xec95[1]][_0xec95[0]]=_0xc0ffx2;} ;