PageSourceSearch

https://www.greatestate.it/en/luxury-rentals-search.html

html greatestate.it collected 2026-10-02 18:30:59 UTC 547,678 bytes, 10,074 lines download raw bytes

1
2
3
4
5<!DOCTYPE html>
6<html lang="en-US">
7<head>
8    <title>Luxury vacation rentals Italy</title>
9    <meta content="Luxury ,vacation, rentals, italy" name="keywords">
10    <meta content="Book the best luxury vacation rentals in Italy. Great stays selects luxury properties in Italy for your vacation. " name="description">
11    
12    <link rel="canonical" href="https://www.greatestate.it/en/luxury-rentals-search.html" id="canonicalUrl"/>    
13        	<meta name="robots" content="index, follow">
14       
15    
16	<link rel="alternate" href="https://www.greatestate.it/en/luxury-rentals-search.html" hreflang="x-default" />
17	<link rel="alternate" href="https://www.greatestate.it/it/ricerca-proprieta-soggiorni-brevi.html" hreflang="it-IT" />
18    <link rel="alternate" href="https://www.greatestate.it/en/luxury-rentals-search.html" hreflang="en-US" />
19    <link rel="alternate" href="https://www.greatestate.it/de/luxusferienhauser-suchen.html" hreflang="de-DE" />
20    
21    <meta charset="utf-8">
22	<meta name="viewport" content="width=device-width, initial-scale=1">
23
24      
25    
26	<meta name="author" content="Great Estate">
27
28<meta name="google-site-verification" content="DEcplhZvDUMvzB6HCwNUPzKnLFMRCuVB1Z_FD8PKJr0" />
29<meta name="msvalidate.01" content="2E559DE3FDB0E2993EF66B22CB9504B8" />
30
31<link rel="icon" type="image/png" sizes="32x32" href="https://www.greatestate.it/favicon-32x32.png" ></link>
32<link rel="icon" type="image/png" sizes="16x16" href="https://www.greatestate.it/favicon-16x16.png" ></link>
33<link rel="apple-touch-icon" sizes="180x180" href="https://www.greatestate.it/apple-touch-icon.png" ></link>
34<link href="https://cdn.greatestate.it/ge/css/bootstrap.min.css?v=0.2.4" rel="stylesheet" type="text/css">
35<link href="https://cdn.greatestate.it/ge/css/fontawesome_all.css?v=0.2.4" async rel="stylesheet" type="text/css">
36<link rel="preload" href="https://cdn.greatestate.it/ge/css/bootstrap-slider.min.css?v=0.2.4" as="style" onload="this.onload=null;this.rel='stylesheet'">
37<noscript>
38    <link rel="stylesheet" href="https://cdn.greatestate.it/ge/css/bootstrap-slider.min.css?v=0.2.4">
39</noscript>
40<link rel="preload" href="https://cdn.greatestate.it/ge/css/daterangepicker.css?v=0.2.4" as="style" onload="this.onload=null;this.rel='stylesheet'">
41<noscript>
42    <link rel="stylesheet" href="https://cdn.greatestate.it/ge/css/daterangepicker.css?v=0.2.4">
43</noscript>
44<link rel="preload" href="https://cdn.greatestate.it/ge/css/intlTelInput.min.css?v=0.2.4" as="style" onload="this.onload=null;this.rel='stylesheet'">
45<noscript>
46    <link rel="stylesheet" href="https://cdn.greatestate.it/ge/css/intlTelInput.min.css?v=0.2.4">
47</noscript>
48
49	<style>
50        @font-face {
51            font-family: main_font;
52            src: url('/fonts/Poppins-Regular.ttf') format('truetype');
53            font-style: normal;
54          	font-weight: 400;
55        }
56        @font-face {
57            font-family: main_font;
58            src: url('/fonts/Poppins-Medium.ttf') format('truetype');
59            font-style: normal;
60          	font-weight: 600;
61        }
62        @font-face {
63            font-family: main_font;
64            src: url('/fonts/Poppins-Bold.ttf') format('truetype');
65          	font-style: normal;
66          	font-weight: 700;
67        }
68	</style>
69<link href="https://cdn.greatestate.it/ge/css/style.css?v=0.2.4" rel="stylesheet" type="text/css">
vendor: 84 bytes, lines 69-71
69
70<script src='https://www.google.com/recaptcha/api.js?hl=en' async defer></script>
71
72<script>
73   
74    var _api = 'https://apisiti.greatestate.it/';
75    var _api_short = 'https://apisiti.greatestate.it/';
76    var _api_services = 'https://servizi.greatestate.it:8443/';
77    var _root_gestionale = 'https://gestionale.greatestate.it/';
78    var _root_foto_wtmrk_ge = 'https://feed.greatestate.it/foto';
79    var _root_foto_wtmrk_gs = 'https://feed.greatestate.it/foto_gs';
80    var _root_web = 'https://www.greatestate.it';
81    var _root_cdn = 'https://cdn.greatestate.it/ge';  
82
83    var _lang = 'en';
84
85    var _latitude = 41.8;
86    var _longitude = 11.23963;
87    var _zoom = 5;
88
89    var _session_email = '';
90    var _session_uid = '';
91    var _session_cliente_id = '';
92    if(_session_cliente_id == undefined){
93    	_session_cliente_id = '';
94    }    
95    var _session_tipo_cliente = '';
96    var _session_id_ruolo = '';
97    var _session_utente = '';
98    var _session_nome = '';    
99    var _session_cognome = '';
100
101    var _secIdleTimeout = '10';
102    var _secTimeEventTimeRecording = '30'; 
103    
104    var _img_standard_sm = 'https://cdn.greatestate.it/ge/img/loghi/greatestate-small.jpg';
105    
106    var session_tipo_vista_lista = '1';
107    var session_numero_pagina_risultati = parseInt('1');
108    var session_index_numero_risultati_per_pagina = parseInt('0');
109    var session_ordinamento_lista_risultati = '1';
110    var session_numero_immobili_in_trattativa_4_e_5 = parseInt('0');
111    var session_tipo_vista_lista_gbl = '';
112	var session_numero_pagina_risultati_gbl;
113	var session_index_numero_risultati_per_pagina_gbl;
114	var session_ordinamento_lista_risultati_gbl;
115	    
116    var session_type_search_active = '1';	
117
118	var url_pagina = 'https://www.greatestate.it/en/luxury-rentals-search.html';
119	
120    var tipologie_immobili = '';
121    var aree_immobili = '';
122    var regioni_immobili = '';
123    var province_immobili = '';
124    var comuni_immobili = '';
125    var prezzo_immobili = '';
126    var minPreImmobili;
127    var maxPreImmobili;
128	var camere_immobili = '';
129	var minCamImmobili;
130    var maxCamImmobili;
131	var bagni_immobili = '';
132	var minBagImmobili;
133    var maxBagImmobili;
134	var superficie_immobili = '';
135	var minSupImmobili;
136    var maxSupImmobili;
137	var terreno_immobili = '';
138	var minTerImmobili;
139    var maxTerImmobili;
140	var condizioni_immobili = '';
141	var collina_immobili = '';
142	var pianura_immobili = '';
143	var vicino_ai_servizi_immobili = '';
144	var centro_storico_immobili = '';
145	var vicino_al_mare_immobili = '';
146	var vicino_al_lago_immobili = '';
147	var piscina_immobili = '';
148	var recinzione_immobili = '';
149	var palestra_immobili = '';
150	var spa_immobili = '';
151	var giardino_immobili = '';
152	var area_barbecue_immobili = '';
153	var terrazza_abitabile_immobili = '';
154	var ascensore_immobili = '';
155	var garage_immobili = '';
156	var strada_accesso_privata_immobili = '';
157	var allarme_immobili = '';
158	var arredato_immobili = '';
159	var venduto_immobili = '';
160	var in_trattativa_immobili = '';
161	var nuovo_sul_mercato_immobili = '';
162	var alta_motivazione_immobili = '';
163	var veloce_tempistica_immobili = '';
164	var super_prezzo_immobili = '';
165	var ottimo_prezzo_immobili = '';
166	var buon_prezzo_immobili = '';
167	var virtual_tour_immobili = '';
168	var video_professionale_immobili = '';
169	var video_amatoriale_immobili = '';
170	var regioni_confinanti_italia = '';
171	
172    var tipologie_alloggi = '';
173    var aree_alloggi = '';
174	var must_have_alloggi = '';
175    var prezzo_alloggi = '';
176    var minPreAlloggi;
177    var maxPreAlloggi;
178	var camere_alloggi = '';
179	var minCamAlloggi;
180    var maxCamAlloggi;
181	var bagni_alloggi = '';
182	var minBagAlloggi;
183    var maxBagAlloggi;
184    var animals_allowed_alloggi = '';
185    var sauna_alloggi = '';
186    var bike_alloggi = '';
187    var gym_alloggi = '';
188    var fireplace_alloggi = '';
189    var jacuzzi_alloggi = '';
190    var eco_friendly_alloggi = '';
191    var golf_alloggi = '';
192    var pool_alloggi = '';
193    var tennis_alloggi = '';
194    var smart_working_alloggi = '';
195    var wifi_alloggi = '';
196    var barrier_free_alloggi = '';
197    var fenced_garden_alloggi = '';
198    var air_conditioned_alloggi = '';
199    var safe_for_kids_alloggi = '';
200    var virtual_tour_alloggi = '';
201    var video_alloggi = '';
202    
203	var session_daterange_alloggi = '';
204	var session_ospiti_alloggi = '';
205	
206	var is_search_page = false;
207	
208	var nomi_tipologie_immobili = [{"it":"","en":"","de":"","ru":""},{"it":"","en":"","de":"","ru":""},{"it":"Castelli e Borghi","en":"Castles and Villages","de":"Schl\u00f6sser und D\u00f6rfer","ru":"\u0417\u0430\u043c\u043a\u0438 \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u044c\u044f"},{"it":"Rustici e Casali","en":"Rustic farmhouses and Country houses","de":"Rohbau und Bauernhaus","ru":"\u0414\u043e\u043c\u0430 \u0438 \u043e\u0441\u043e\u0431\u043d\u044f\u043a\u0438"},{"it":"Alberghi e B&B","en":"Hotels and B&B","de":"Hotels und Bed&Breakfast","ru":"\u041e\u0442\u0435\u043b\u0438 \u0438 B&B"},{"it":"Ville di prestigio","en":"Luxury Villas","de":"Luxus-Villen","ru":"\u0428\u0438\u043a\u0430\u0440\u043d\u044b\u0435 \u0432\u0438\u043b\u043b\u044b"},{"it":"Aziende agricole e vitivinicole","en":"Farms and Wine-producing farms","de":"Landwirtschaftliche Betriebe und Weing\u00fcter","ru":"\u0424\u0435\u0440\u043c\u044b \u0438 \u0432\u0438\u043d\u043e\u0434\u0435\u043b\u044c\u043d\u0438"},{"it":"Appartamenti","en":"Apartments","de":"Wohnungen","ru":"\u0430\u043f\u0430\u0440\u0442\u0430\u043c\u0435\u043d\u0442\u044b"}];	
209	var tipologie_italia_slug_immobili = [{"it":"","en":"","de":"","ru":""},{"it":"","en":"","de":"","ru":""},{"it":"castelli-borghi-vendita","en":"castles-villages-sale-italy","de":"d\u00f6rfer-burgen-verkauf-italien","ru":"\u0437\u0430\u043c\u043a\u0438-\u043f\u043e\u043c\u0435\u0441\u0442\u044c\u044f-\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u0438\u0442\u0430\u043b\u0438\u044f"},{"it":"casali-vendita","en":"rustic-farmhouses-sale-italy","de":"bauernh\u00f6fe-verkauf-italien","ru":"\u0434\u043e\u043c\u0430-\u043e\u0441\u043e\u0431\u043d\u044f\u043a\u0438-\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u0438\u0442\u0430\u043b\u0438\u044f"},{"it":"alberghi-b&b-vendita","en":"hotels-b&b-sale-italy","de":"hotels-b&b-verkauf-italien","ru":"o\u0442\u0435\u043b\u0438-b&b-\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u0438\u0442\u0430\u043b\u0438\u044f"},{"it":"ville-vendita","en":"villas-sale-italy","de":"villen-verkauf-italien","ru":"\u0432\u0438\u043b\u043b\u044b-\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u0438\u0442\u0430\u043b\u0438\u044f"},{"it":"aziende-agricole-vinicole-vendita","en":"farms-wineries-sale-italy","de":"landwirtschaftliche-betrieb-verkauf-italien","ru":"\u0444\u0435\u0440\u043c\u044b-\u0432\u0438\u043d\u043e\u0434\u0435\u043b\u044c\u043d\u0438-\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u0438\u0442\u0430\u043b\u0438\u044f"},{"it":"appartamenti-vendita","en":"apartments-sale-italy","de":"apartments-verkauf-italien","ru":"\u043a\u0432\u0430\u0440\u0442\u0438\u0440\u044b-\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u0438\u0442\u0430\u043b\u0438\u044f"}]; 
210	var tipologie_slug_immobili = [{"it":"","en":"","de":"","ru":""},{"it":"","en":"","de":"","ru":""},{"it":"castelli-borghi-vendita","en":"castles-villages-sale","de":"d\u00f6rfer-burgen-verkauf","ru":"\u0437\u0430\u043c\u043a\u0438-\u043f\u043e\u043c\u0435\u0441\u0442\u044c\u044f-\u043f\u0440\u043e\u0434\u0430\u0436\u0430"},{"it":"casali","en":"rustic-farmhouses","de":"bauernh\u00f6fe","ru":"\u0434\u043e\u043c\u0430-\u043e\u0441\u043e\u0431\u043d\u044f\u043a\u0438"},{"it":"alberghi-b&b-vendita","en":"hotels-b&b-sale","de":"hotels-b&b-verkauf","ru":"o\u0442\u0435\u043b\u0438-b&b-\u043f\u0440\u043e\u0434\u0430\u0436\u0430"},{"it":"ville","en":"villas","de":"villen","ru":"\u0432\u0438\u043b\u043b\u044b"},{"it":"aziende-agricole-vinicole-vendita","en":"farms-wineries-sale","de":"landwirtschaftliche-betrieb-verkauf","ru":"\u0444\u0435\u0440\u043c\u044b-\u0432\u0438\u043d\u043e\u0434\u0435\u043b\u044c\u043d\u0438-\u043f\u0440\u043e\u0434\u0430\u0436\u0430"},{"it":"appartamenti-vendita","en":"apartments-sale","de":"apartments-verkauf","ru":"\u043a\u0432\u0430\u0440\u0442\u0438\u0440\u044b-\u043f\u0440\u043e\u0434\u0430\u0436\u0430"}]; 
211	var tipologie_aree_slug_immobili = [{"it":"","en":"","de":"","ru":""},{"it":"","en":"","de":"","ru":""},{"it":"castelli-vendita","en":"castles-sale","de":"burgen-verkauf","ru":"\u043a\u0443\u043f\u0438\u0442\u044c-\u0437\u0430\u043c\u043e\u043a"},{"it":"casali-vendita","en":"farmhouses-sale","de":"h\u00e4user-verkauf","ru":"\u043a\u0443\u043f\u0438\u0442\u044c-\u0437\u0430\u0433\u043e\u0440\u043e\u0434\u043d\u044b\u0439-\u0434\u043e\u043c"},{"it":"alberghi-vendita","en":"hotels-sale","de":"hotels-verkauf","ru":"\u043a\u0443\u043f\u0438\u0442\u044c-\u043e\u0442\u0435\u043b\u044c"},{"it":"ville-vendita","en":"villas-sale","de":"villa-verkauf","ru":"\u043a\u0443\u043f\u0438\u0442\u044c-\u0432\u0438\u043b\u043b\u0443"},{"it":"aziende-agricole-vendita","en":"farms-ranches-sale","de":"bauernh\u00f6fe-verkauf","ru":"\u043a\u0443\u043f\u0438\u0442\u044c-\u0444\u0435\u0440\u043c\u0443"},{"it":"appartamenti-vendita","en":"apartments-sale","de":"wohnungen-verkaufen","ru":"\u043a\u0443\u043f\u0438\u0442\u044c-\u0430\u043f\u0430\u0440\u0442\u0430\u043c\u0435\u043d\u0442\u044b"}]; 
212	var prefisso_aree_slug_immobili = {"it":"case-vendita","en":"houses-sale","de":"haus-verkauf","ru":"\u043a\u0443\u043f\u0438\u0442\u044c-\u0434\u043e\u043c"};
213	var prefisso_province_comuni_slug_immobili = {"it":"immobili-lusso-vendita","en":"luxury-property-for-sale","de":"luxus-immobilien-kaufen","ru":"\u043a\u0443\u043f\u0438\u0442\u044c-\u043f\u0440\u0435\u0441\u0442\u0438\u0436\u043d\u0443\u044e-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u044c"};
214	var nomi_aree_immobili = ["","Val di Chiana","Val d'Orcia","Chianti","Argentario","Lago Trasimeno","Todi","Valle del Niccone","Lago di Bolsena","Alta Tuscia","Costa Smeralda","Val Menocchia","Riviera delle Palme","Colline Maceratesi","Monti Sibillini","Val di Chienti","Marca Fermana","Montefeltro","Riviera del Conero","Val d'Aso","Langhe e Roero","Monferrato","Lago di Como"];
215	var nomi_regioni = [{"it":"","en":"","de":"","ru":""}
215,{"it":"Piemonte","en":"Piedmont","de":"Piemont","ru":"\u041f\u044c\u0435\u043c\u043e\u043d\u0442\u0435"},{"it":"Valle D'Aosta","en":"Aosta Valley","de":"Aostatal","ru":"\u0412\u0430\u043b\u043b\u0435 \u0434'\u0410\u043e\u0441\u0442\u0430"},{"it":"Lombardia","en":"Lombardy","de":"Lombardei","ru":"\u041b\u043e\u043c\u0431\u0430\u0440\u0434\u0438\u044f"},{"it":"Trentino-Alto Adige","en":"Trentino-South Tyrol","de":"Trentino-S\u00fcdtirol","ru":"\u0422\u0440\u0435\u043d\u0442\u0438\u043d\u043e \u0410\u043b\u044c\u0442\u043e \u0410\u0434\u0438\u0434\u0436\u0435"},{"it":"Veneto","en":"Veneto","de":"Venetien","ru":"\u0412\u0435\u043d\u0435\u0442\u043e"},{"it":"Friuli Venezia Giulia","en":"Friuli-Venezia Giulia","de":"Friaul-Julisch Venetien","ru":"\u0424\u0440\u0438\u0443\u043b\u0438 \u0412\u0435\u043d\u0435\u0446\u0438\u044f \u0414\u0436\u0443\u043b\u0438\u044f"},{"it":"Liguria","en":"Liguria","de":"Ligurien","ru":"\u041b\u0438\u0433\u0443\u0440\u0438\u044f"},{"it":"Emilia-Romagna","en":"Emilia-Romagna","de":"Emilia-Romagna","ru":"\u042d\u043c\u0438\u043b\u0438\u044f \u0420\u043e\u043c\u0430\u043d\u044c\u044f"},{"it":"Toscana","en":"Tuscany","de":"Toskana","ru":"\u0422\u043e\u0441\u043a\u0430\u043d\u0430"},{"it":"Umbria","en":"Umbria","de":"Umbrien","ru":"\u0423\u043c\u0431\u0440\u0438\u044f"},{"it":"Marche","en":"Marche","de":"Marken","ru":"\u041c\u0430\u0440\u043a\u0435"},{"it":"Lazio","en":"Lazio","de":"Latium","ru":"\u041b\u0430\u0446\u0438\u043e"},{"it":"Abruzzo","en":"Abruzzo","de":"Abruzzen","ru":"\u0410\u0431\u0440\u0443\u0446\u0446\u043e"},{"it":"Molise","en":"Molise","de":"Molise","ru":"\u041c\u043e\u043b\u0438\u0437\u0435"},{"it":"Campania","en":"Campania","de":"Kampanien","ru":"\u041a\u0430\u043c\u043f\u0430\u043d\u044c\u044f"},{"it":"Puglia","en":"Apulia","de":"Apulien","ru":"\u0410\u043f\u0443\u043b\u0438\u044f"},{"it":"Basilicata","en":"Basilicata","de":"Basilikata","ru":"\u0411\u0430\u0437\u0438\u043b\u0438\u043a\u0430\u0442\u0430"},{"it":"Calabria","en":"Calabria","de":"Kalabrien","ru":"\u041a\u0430\u043b\u0430\u0431\u0440\u0438\u044f"},{"it":"Sicilia","en":"Sicily","de":"Sizilien","ru":"\u0421\u0438\u0446\u0438\u043b\u0438\u044f"},{"it":"Sardegna","en":"Sardinia","de":"Sardinien","ru":"\u0421\u0430\u0440\u0434\u0438\u043d\u0438\u044f"}];
216	var regioni_slug_immobili = [{"it":"","en":"","de":"","ru":""},{"it":"immobili-lusso-vendita-piemonte","en":"piedmont-luxury-property-for-sale","de":"luxusimmobilien-piemont-kaufen","ru":"\u043a\u0443\u043f\u0438\u0442\u044c-\u043f\u0440\u0435\u0441\u0442\u0438\u0436\u043d\u0443\u044e-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u044c-\u043f\u044c\u0435\u043c\u043e\u043d\u0442\u0435"},{"it":"immobili-lusso-vendita-valle-daosta","en":"luxury-property-for-sale-valle-daosta","de":"luxusimmobilien-aostatal-kaufen","ru":"\u043a\u0443\u043f\u0438\u0442\u044c-\u044d\u043b\u0438\u0442\u043d\u0430\u044f-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u044c-\u0432\u0430\u043b\u043b\u0435-\u0434-\u0430\u043e\u0441\u0442\u0430"},{"it":"immobili-lusso-vendita-lombardia","en":"lombardy-luxury-property-for-sale","de":"luxusimmobilien-lombardei-kaufen","ru":"\u0448\u0438\u043a\u0430\u0440\u043d\u044b\u0435-\u0432\u0438\u043b\u043b\u044b-\u043a\u0443\u043f\u0438\u0442\u044c-\u043b\u043e\u043c\u0431\u0430\u0440\u0434\u0438\u0438"},{"it":"immobili-lusso-vendita-trentino-alto-adige","en":"luxury-property-for-sale-trentino-south-tyrol","de":"luxusimmobilien-trentino-s\u00fcdtirol-kaufen","ru":"\u043a\u0443\u043f\u0438\u0442\u044c-\u044d\u043b\u0438\u0442\u043d\u0430\u044f-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u044c-\u0442\u0440\u0435\u043d\u0442\u0438\u043d\u043e-\u0430\u043b\u044c\u0442\u043e-\u0430\u0434\u0438\u0434\u0436\u0435"},{"it":"immobili-lusso-vendita-veneto","en":"luxury-property-for-sale-veneto","de":"luxusimmobilien-venetien-kaufen","ru":"\u043a\u0443\u043f\u0438\u0442\u044c-\u044d\u043b\u0438\u0442\u043d\u0430\u044f-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u044c-\u0432\u0435\u043d\u0435\u0442\u043e"},{"it":"immobili-lusso-vendita-friuli-venezia-giulia","en":"luxury-property-for-sale-friuli-venezia-giulia","de":"luxusimmobilien-friaul-julisch-venetien-kaufen","ru":"\u044d\u043b\u0438\u0442\u043d\u0430\u044f-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u044c-\u0444\u0440\u0438\u0443\u043b\u0438-\u0432\u0435\u043d\u0435\u0446\u0438\u044f-\u0434\u0436\u0443\u043b\u0438\u044f"},{"it":"immobili-lusso-liguria","en":"luxury-property-for-sale-liguria","de":"luxusimmobilien-kaufen-ligurien","ru":"\u043a\u0443\u043f\u0438\u0442\u044c-\u043f\u0440\u0435\u0441\u0442\u0438\u0436\u043d\u0443\u044e-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u044c-\u043b\u0438\u0433\u0443\u0440\u0438\u0438"},{"it":"immobili-lusso-vendita-emilia-romagna","en":"luxury-property-for-sale-emilia-romagna","de":"luxusimmobilien-emilia-romagna-kaufen","ru":"\u044d\u043b\u0438\u0442\u043d\u0430\u044f-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u044c-\u044d\u043c\u0438\u043b\u0438\u044f-\u0440\u043e\u043c\u0430\u043d\u044c\u044f"},{"it":"immobili-lusso-toscana","en":"luxury-property-for-sale-tuscany","de":"luxusimmobilien-in-der-toskana-kaufen","ru":"\u043a\u0443\u043f\u0438\u0442\u044c-\u0448\u0438\u043a\u0430\u0440\u043d\u0443\u044e-\u0432\u0438\u043b\u043b\u0443-\u0442\u043e\u0441\u043a\u0430\u043d\u0435"},{"it":"immobili-lusso-umbria","en":"luxury-property-for-sale-umbria","de":"luxusimmobilien-umbrien-kaufen","ru":"\u043a\u0443\u043f\u0438\u0442\u044c-\u044d\u043b\u0438\u0442\u043d\u0430\u044f-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u044c-\u0443\u043c\u0431\u0440\u0438\u0438"},{"it":"immobili-lusso-vendita-marche","en":"luxury-property-for-sale-le-marche-italy","de":"luxusimmobilien-marken-kaufen","ru":"\u044d\u043b\u0438\u0442\u043d\u0430\u044f-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u044c-\u043c\u0430\u0440\u043a\u0435"},{"it":"immobili-lusso-vendita-lazio","en":"luxury-property-for-sale-lazio","de":"luxusimmobilien-latium-kaufen","ru":"\u043a\u0443\u043f\u0438\u0442\u044c-\u043f\u0440\u0435\u0441\u0442\u0438\u0436\u043d\u0443\u044e-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u044c-\u043b\u0430\u0446\u0438\u043e"},{"it":"immobili-lusso-vendita-abruzzo","en":"luxury-property-for-sale-abruzzo","de":"luxusimmobilien-abruzzen-kaufen","ru":"\u043a\u0443\u043f\u0438\u0442\u044c-\u043f\u0440\u0435\u0441\u0442\u0438\u0436\u043d\u044b\u0439-\u0434\u043e\u043c-\u0430\u0431\u0440\u0443\u0446\u0446\u043e"},{"it":"immobili-lusso-vendita-molise","en":"luxury-property-for-sale-molise-italy","de":"luxusimmobilien-molise-kaufen","ru":"\u044d\u043b\u0438\u0442\u043d\u0430\u044f-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u044c-\u043c\u043e\u043b\u0438\u0437\u0435"},{"it":"immobili-lusso-vendita-campania","en":"luxury-property-for-sale-campania-italy","de":"luxusimmobilien-kampanien-kaufen","ru":"\u044d\u043b\u0438\u0442\u043d\u0430\u044f-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u044c-\u043a\u0430\u043c\u043f\u0430\u043d\u044c\u0435"},{"it":"immobili-lusso-vendita-puglia","en":"luxury-property-for-sale-apuglia-italy","de":"luxusimmobilien-apulien-kaufen","ru":"\u043a\u0443\u043f\u0438\u0442\u044c-\u044d\u043b\u0438\u0442\u043d\u0430\u044f-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u044c-\u0430\u043f\u0443\u043b\u0438\u0438"},{"it":"immobili-lusso-vendita-basilicata","en":"basilicata-luxury-property-for-sale","de":"luxusimmobilien-basilikata-kaufen","ru":"\u044d\u043b\u0438\u0442\u043d\u0430\u044f-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u044c-\u0431\u0430\u0437\u0438\u043b\u0438\u043a\u0430\u0442\u0435"},{"it":"immobili-lusso-vendita-calabria","en":"luxury-properties-for-sale-calabria","de":"luxusimmobilien-kalabrien-kaufen","ru":"\u043a\u0443\u043f\u0438\u0442\u044c-\u0448\u0438\u043a\u0430\u0440\u043d\u0443\u044e-\u0432\u0438\u043b\u043b\u0443-\u043a\u0430\u043b\u0430\u0431\u0440\u0438\u0438"},{"it":"immobili-lusso-sicilia","en":"luxury-property-for-sale-sicily","de":"luxusimmobilien-sizilien-kaufen","ru":"\u043a\u0443\u043f\u0438\u0442\u044c-\u0448\u0438\u043a\u0430\u0440\u043d\u0443\u044e-\u0432\u0438\u043b\u043b\u0443-\u0441\u0438\u0446\u0438\u043b\u0438\u0438"},{"it":"immobili-lusso-vendita-sardegna","en":"luxury-property-for-sale-sardinia","de":"luxusimmobilien-sardinien-kaufen","ru":"\u043a\u0443\u043f\u0438\u0442\u044c-\u0448\u0438\u043a\u0430\u0440\u043d\u0443\u044e-\u0432\u0438\u043b\u043b\u0443-\u0441\u0430\u0440\u0434\u0438\u043d\u0438\u0438"}];
217	var filtri_slug_immobili = {"virtual_tour":{"it":"vendita-immobili-con-virtual-tour
217-italia.html","en":"sale-real-estate-with-virtual-tour-italy.html","de":"immobilienverkauf-mit-virtual-tour-italien.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u0438-\u0441-\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c-\u0442\u0443\u0440\u043e\u043c-\u0438\u0442\u0430\u043b\u0438\u044f.html"},"video_professionale":{"it":"vendita-immobili-con-video-professionali-italia.html","en":"sale-real-estate-with-professional-video-italy.html","de":"immobilienverkauf-mit-professionellen-videos-italien.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u0438-\u0441-\u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c\u0438-\u0432\u0438\u0434\u0435\u043e-\u0438\u0442\u0430\u043b\u0438\u044f.html"},"video_amatoriale":{"it":"vendita-immobili-con-video-italia.html","en":"sale-real-estate-with-video-italy.html","de":"immobilienverkauf-mit-video-italien.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u0438-\u0441-\u0432\u0438\u0434\u0435\u043e-\u0438\u0442\u0430\u043b\u0438\u044f.html"},"collina":{"it":"vendita-immobili-in-collina-italia.html","en":"sale-real-estate-on-hill-italy.html","de":"immobilienverkauf-in-h\u00fcgeliger-italie.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u0438-\u043d\u0430-\u0445\u043e\u043b\u043c\u0430\u0445-\u0438\u0442\u0430\u043b\u0438\u044f.html"},"pianura":{"it":"vendita-immobili-in-pianura-italia.html","en":"sale-real-estate-in-lowland-italy.html","de":"immobilienverkauf-im-flachland-italien.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u0438-\u043d\u0430-\u0440\u0430\u0432\u043d\u0438\u043d\u0435-\u0438\u0442\u0430\u043b\u0438\u044f.html"},"vicino_ai_servizi":{"it":"vendita-immobili-vicino-servizi-italia.html","en":"sale-real-estate-near-services-italy.html","de":"immobilienverkauf-in-der-naehe-von-services-italien.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u0438-\u0440\u044f\u0434\u043e\u043c-\u0441-\u0443\u0441\u043b\u0443\u0433\u0430\u043c\u0438.html"},"centro_storico":{"it":"vendita-immobili-in-centro-storico-italia.html","en":"sale-real-estate-in-historic-center-italy.html","de":"immobilienverkauf-in-die-altstadt-italien.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u0438-\u0432-\u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u043c-\u0446\u0435\u043d\u0442\u0440\u0435-\u0438\u0442\u0430\u043b\u0438\u044f.html"},"vicino_al_lago":{"it":"vendita-immobili-vicino-lago-italia.html","en":"sale-real-estate-near-lake-italy.html","de":"immobilien-in-seenaehe-zu-verkaufen-italien.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u0438-\u0440\u044f\u0434\u043e\u043c-\u0441-\u043e\u0437\u0435\u0440\u043e\u043c-\u0438\u0442\u0430\u043b\u0438\u044f.html"},"piscina":{"it":"vendita-immobili-con-piscina-italia.html","en":"sale-real-estate-with-pool-italy.html","de":"immobilien-mit-schwimmbad-zu-verkaufen-italien.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u0438-\u0441-\u0431\u0430\u0441\u0441\u0435\u0439\u043d\u043e\u043c-\u0438\u0442\u0430\u043b\u0438\u044f.html"},"palestra":{"it":"vendita-immobili-con-palestra-italia.html","en":"sale-real-estate-with-gym-italy.html","de":"immobilien-mit-gym-zu-verkaufen.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u0438-\u0441-\u0442\u0440\u0435\u043d\u0430\u0436\u0435\u0440\u043d\u044b\u043c-\u0437\u0430\u043b\u043e\u043c-\u0438\u0442\u0430\u043b\u0438\u044f.html"},"spa":{"it":"vendita-immobili-con-spa-italia.html","en":"sale-real-estate-with-spa-italy.html","de"
217:"immobilien-mit-wellness-zu-verkaufen-italien.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u0438-\u0441\u043e-\u0441\u043f\u0430-\u0438\u0442\u0430\u043b\u0438\u044f.html"},"giardino":{"it":"vendita-immobili-con-giardino-italia.html","en":"sale-real-estate-with-garden-italy.html","de":"immobilien-mit-garten-zu-verkaufen-italien.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u0438-\u0441-\u0441\u0430\u0434\u043e\u043c-\u0438\u0442\u0430\u043b\u0438\u044f.html"}}; 
218	var mare_slug_immobili = [{"it":"vendita-mare.html","en":"sale-sea.html","de":"verkauf-meer.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u043c\u043e\u0440\u0435.html"},{"it":"","en":"","de":"","ru":""},{"it":"","en":"","de":"","ru":""},{"it":"","en":"","de":"","ru":""},{"it":"","en":"","de":"","ru":""},{"it":"vendita-veneto-mare.html","en":"sale-veneto-sea.html","de":"verkauf-venetien-meer.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u0432\u0435\u043d\u0435\u0442\u043e-\u043c\u043e\u0440\u0435.html"},{"it":"vendita-friuli-venezia-giulia-mare.html","en":"sale-friuli-venezia-giulia-sea.html","de":"verkauf-friaul-julisch-venetien-meer.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u0444\u0440\u0438\u0443\u043b\u0438-\u0432\u0435\u043d\u0435\u0446\u0438\u044f-\u0434\u0436\u0443\u043b\u0438\u044f-\u043c\u043e\u0440\u0435.html"},{"it":"vendita-liguria-mare.html","en":"sale-liguria-sea.html","de":"verkauf-ligurien-meer.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u043b\u0438\u0433\u0443\u0440\u0438\u044f-\u043c\u043e\u0440\u0435.html"},{"it":"vendita-emilia-romagna-mare.html","en":"sale-emilia-romagna-sea.html","de":"verkauf-emilia-romagna-meer.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u044d\u043c\u0438\u043b\u0438\u044f-\u0440\u043e\u043c\u0430\u043d\u044c\u044f-\u043c\u043e\u0440\u0435.html"},{"it":"vendita-toscana-mare.html","en":"sale-tuscany-sea.html","de":"verkauf-toskana-meer.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u0442\u043e\u0441\u043a\u0430\u043d\u0430-\u043c\u043e\u0440\u0435.html"},{"it":"","en":"","de":"","ru":""},{"it":"vendita-marche-mare.html","en":"sale-marche-sea.html","de":"verkauf-marken-meer.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u043c\u0430\u0440\u043a\u0435-\u043c\u043e\u0440\u0435.html"},{"it":"vendita-lazio-mare.html","en":"sale-lazio-sea.html","de":"verkauf-latium-meer.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u043b\u0430\u0446\u0438\u043e-\u043c\u043e\u0440\u0435.html"},{"it":"vendita-abruzzo-mare.html","en":"sale-abruzzo-sea.html","de":"verkauf-abruzzen-meer.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u0430\u0431\u0440\u0443\u0446\u0446\u043e-\u043c\u043e\u0440\u0435.html"},{"it":"vendita-molise-mare.html","en":"sale-molise-sea.html","de":"verkauf-molise-meer.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u043c\u043e\u043b\u0438\u0437\u0435-\u043c\u043e\u0440\u0435.html"},{"it":"vendita-campania-mare.html","en":"sale-campania-sea.html","de":"verkauf-kampanien-meer.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u043a\u0430\u043c\u043f\u0430\u043d\u044c\u044f-\u043c\u043e\u0440\u0435.html"},{"it":"vendita-puglia-mare.html","en":"sale-apulia-sea.html","de":"verkauf-apulien-meer.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u0430\u043f\u0443\u043b\u0438\u044f-\u043c\u043e\u0440\u0435.html"},{"it":"vendita-basilicata-mare.html","en":"sale-basilicata-sea.html","de":"verkauf-basilikata-meer.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u0431\u0430\u0437\u0438\u043b\u0438\u043a\u0430\u0442\u0430-\u043c\u043e\u0440\u0435.html"},{"it":"vendita-calabria-mare.html","en":"sale-calabria-sea.html","de":"verkauf-kalabrien-meer.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u043a\u0430\u043b\u0430\u0431\u0440\u0438\u044f-\u043c\u043e\u0440\u0435.html"},{"it":"vendita-sicilia-mare.html","en":"sale-sicily-sea.html","de":"verkauf-sizilien-meer.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u0441\u0438\u0446\u0438\u043b\u0438\u044f-\u043c\u043e\u0440\u0435.html"},{"it":"vendita-sardegna-mare.html","en":"sale-sardinia-sea.html","de"
218:"verkauf-sardinien-meer.html","ru":"\u043f\u0440\u043e\u0434\u0430\u0436\u0430-\u0441\u0430\u0440\u0434\u0438\u043d\u0438\u044f-\u043c\u043e\u0440\u0435.html"}]; 
219	var venduti_slug_immobili = {"it":"immobili-venduti.html","en":"properties-sold.html","de":"immobilien-verkauft.html","ru":"\u043f\u0440\u043e\u0434\u0430\u043d\u043d\u0430\u044f-\u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u044c.html"};
220	var aree_immobili_to_alloggi = {"4":"it-18","3":"6","2":"8","18":"9","5":"7"};
221	var regioni_immobili_to_alloggi = {"9":"it-16","8":"it-05","19":"it-15","7":"it-08","3":"it-09","1":"it-12","16":"it-13","11":"it-10","20":"it-14","12":"it-07","10":"it-18"};
222	var tipologie_immobili_to_alloggi = {"2":"custom_u6","3":"custom_u3","6":"custom_u3","7":"custom_u8"};
223	
224	var tipologie_italia_slug_alloggi = {"custom_u3":{"it":"affitti-turistici-ville-campagna-vacanze-italia.html","en":"tourist-rentals-countryside-villas-holidays-italy.html","de":"ferienvermietungen-landhaus-urlaub-italien.html","ru":""},"custom_u4":{"it":"affitti-turistici-proprieta-eco-friendly-vacanze-italia.html","en":"tourist-rentals-eco-friendly-holidays-italy.html","de":"ferienvermietungen-umweltfreundliche-h\u00e4user-urlaub-italien.html","ru":""},"custom_u5":{"it":"affitti-turistici-casali-vacanze-italia.html","en":"tourist-rentals-farmhouses-holidays-italy.html","de":"ferienvermietungen-bauernhof-urlaub-italien.html","ru":""},"custom_u7":{"it":"affitti-turistici-case-centro-storico-vacanze-italia.html","en":"tourist-rentals-old-town-houses-holidays-italy.html","de":"ferienvermietungen-ferienhaus-historisches-zentrum-italien.html","ru":""},"custom_u8":{"it":"affitti-turistici-appartamenti-fronte-mare-vacanze-italia.html","en":"tourist-rentals-seafront-apartments-holidays-italy.html","de":"ferienvermietungen-ferienhaus-direkt-am-meer-italien.html","ru":""},"custom_u9":{"it":"affitti-turistici-ville-fronte-mare-vacanze-italia.html","en":"tourist-rentals-seafront-villas-holidays-italy.html","de":"ferienvermietungen-villen-direkt-am-meer-italien.html","ru":""},"custom_u6":{"it":"affitti-turistici-location-eventi-italia.html","en":"tourist-rentals-event-venues-italy.html","de":"ferienvermietungen-veranstaltungsorte-italien.html","ru":""},"custom_u37":{"it":"affitti-turistici-ville-per-gruppi-in-italia.html","en":"tourist-rentals-large-villas-in-italy.html","de":"ferienhaus-italien-urlaub.html"}}; 
225	var tipologie_slug_alloggi = {"custom_u3":{"it":"affitti-turistici-ville-di-campagna","en":"tourist-rentals-countryside-villas","de":"ferienvermietungen-landvillen","ru":""},"custom_u4":{"it":"affitti-turistici-strutture-eco-friendly","en":"tourist-rentals-eco-houses","de":"ferienvermietungen-umweltfreundlichen-h\u00e4usern","ru":""},"custom_u5":{"it":"affitti-turistici-casali","en":"tourist-rentals-farmhouses","de":"ferienvermietungen-bauernh\u00e4user","ru":""},"custom_u7":{"it":"affitti-turistici-case-centro-storico","en":"tourist-rentals-old-town-houses","de":"ferienvermietungen-ferienhaus-historisches-zentrum","ru":""},"custom_u8":{"it":"affitti-turistici-appartamenti-fronte-mare","en":"tourist-rentals-seafront-apartments","de":"ferienvermietungen-ferienwohnungen-am-meer","ru":""},"custom_u9":{"it":"affitti-turistici-ville-fronte-mare","en":"tourist-rentals-seafront-villas","de":"ferienvermietungen-villen-am-meer","ru":""},"custom_u6":{"it":"affitti-turistici-location-eventi","en":"tourist-rentals-event-venues","de":"ferienvermietungen-eventlocations","ru":""},"custom_u37":{"it":"affitti-turistici-ville-per-gruppi-numerosi","en":"tourist-rentals-large-villas","de":"ferienhaus-fuer-gruppen"}}; 
226	var aree_slug_alloggi = {"it-16":{"it":"affitti-turistici-vacanze-in-proprieta-esclusive-toscana.html","en":"tourist-rentals-holidays-exclusive-house-tuscany.html","de":"ferienvermietungen-luxus-ferienhaus-toskana.html","ru":""},"4":{"it":"affitti-turistici-vacanze-in-proprieta-esclusive-argentario.html","en":"tourist-rentals-holidays-exclusive-house-argentario.html","de":"ferienvermietungen-luxus-ferienhaus-argentario.html","ru":""},"6":{"it":"affitti-turistici-vacanze-in-proprieta-esclusive-chianti.html","en":"tourist-rentals-holidays-exclusive-house-chianti.html","de"
226:"ferienvermietungen-luxus-ferienhaus-chianti.html","ru":""},"8":{"it":"affitti-turistici-vacanze-in-proprieta-esclusive-val-dorcia.html","en":"tourist-rentals-holidays-exclusive-house-val-dorcia.html","de":"ferienvermietungen-luxus-ferienhaus-val-dorcia.html","ru":""},"5":{"it":"affitti-turistici-vacanze-in-proprieta-esclusive-maremma.html","en":"tourist-rentals-holidays-exclusive-house-maremma.html","de":"ferienvermietungen-luxus-ferienhaus-maremma.html","ru":""},"it-05":{"it":"affitti-turistici-vacanze-in-proprieta-esclusive-emilia-romagna.html","en":"tourist-rentals-holidays-exclusive-house-emilia-romagna.html","de":"ferienvermietungen-luxus-ferienhaus-emilia-romagna.html","ru":""},"it-15":{"it":"affitti-turistici-vacanze-in-proprieta-esclusive-sicilia.html","en":"tourist-rentals-holidays-exclusive-house-sicily.html","de":"ferienvermietungen-luxus-ferienhaus-sizilien.html","ru":""},"it-08":{"it":"affitti-turistici-vacanze-in-proprieta-esclusive-liguria.html","en":"tourist-rentals-holidays-exclusive-house-liguria.html","de":"ferienvermietungen-luxus-ferienhaus-ligurien.html","ru":""},"it-09":{"it":"affitti-turistici-vacanze-in-proprieta-esclusive-lombardia.html","en":"tourist-rentals-holidays-exclusive-house-lombardy.html","de":"ferienvermietungen-luxus-ferienhaus-lombardei.html","ru":""},"it-12":{"it":"affitti-turistici-vacanze-in-proprieta-esclusive-piemonte.html","en":"tourist-rentals-holidays-exclusive-house-piedmont.html","de":"ferienvermietungen-luxus-ferienhaus-piemont.html","ru":""},"it-13":{"it":"affitti-turistici-vacanze-in-proprieta-esclusive-puglia.html","en":"tourist-rentals-holidays-exclusive-house-apulia.html","de":"ferienvermietungen-luxus-ferienhaus-apulien.html","ru":""},"it-10":{"it":"affitti-turistici-vacanze-in-proprieta-esclusive-marche.html","en":"tourist-rentals-holidays-exclusive-house-marche.html","de":"ferienvermietungen-luxus-ferienhaus-marken.html","ru":""},"9":{"it":"affitti-turistici-vacanze-in-proprieta-esclusive-riviera-del-conero.html","en":"tourist-rentals-holidays-exclusive-house-riviera-del-conero.html","de":"ferienvermietungen-luxus-ferienhaus-riviera-del-conero.html","ru":""},"it-14":{"it":"affitti-turistici-vacanze-in-proprieta-esclusive-sardegna.html","en":"tourist-rentals-holidays-exclusive-house-sardinia.html","de":"ferienvermietungen-luxus-ferienhaus-sardinien.html","ru":""},"it-07":{"it":"affitti-turistici-vacanze-in-proprieta-esclusive-lazio.html","en":"tourist-rentals-holidays-exclusive-house-lazio.html","de":"ferienvermietungen-luxus-ferienhaus-latium.html","ru":""},"it-18":{"it":"affitti-turistici-vacanze-in-proprieta-esclusive-umbria.html","en":"tourist-rentals-holidays-exclusive-house-umbria.html","de":"ferienvermietungen-luxus-ferienhaus-umbrien.html","ru":""},"7":{"it":"affitti-turistici-vacanze-in-proprieta-esclusive-lago-trasimeno.html","en":"tourist-rentals-holidays-exclusive-house-lago-trasimeno.html","de":"ferienvermietungen-luxus-ferienhaus-trasimenischer-see.html","ru":""},"3":{"it":"affitti-turistici-vacanze-in-proprieta-esclusive-orvieto.html","en":"tourist-rentals-holidays-exclusive-house-orvieto.html","de":"ferienvermietungen-luxus-ferienhaus-orvieto.html","ru":""},"11":{"it":"affitti-turistici-vacanze-in-proprieta-esclusive-cortona.html","en":"tourist-rentals-holidays-exclusive-house-cortona.html","de":"ferienvermietungen-luxus-ferienhaus-cortona.html","ru":""}}; 
227	var nomi_aree_alloggi = {"it-16":{"it":"Toscana","en":"Tuscany","de":"Toskana","ru":""},"4":{"it":"Argentario","en":"Argentario","de":"Argentario","ru":""},"6":{"it":"Chianti","en":"Chianti","de":"Chianti","ru":""},"8":{"it":"Val d'Orcia","en":"Val d'Orcia","de":"Val d'Orcia","ru":""},"5":{"it":"Maremma","en":"Maremma","de":"Maremma","ru":""},"it-05":{"it":"Emilia-Romagna","en":"Emilia-Romagna","de":"Emilia-Romagna","ru":""},"it-15":{"it":"Sicilia","en":"Sicily","de":"Sizilien","ru":""},"it-08":{"it":"Liguria","en":"Liguria","de":"Ligurien","ru":""},"it-09":{"it":"Lombardia","en":"Lombardy","de":"Lombardei","ru":""}
227,"it-12":{"it":"Piemonte","en":"Piedmont","de":"Piemont","ru":""},"it-13":{"it":"Puglia","en":"Apulia","de":"Apulien","ru":""},"it-10":{"it":"Marche","en":"Marche","de":"Marken","ru":""},"9":{"it":"Riviera del Conero","en":"Riviera del Conero","de":"Conero-Riviera","ru":""},"it-14":{"it":"Sardegna","en":"Sardinia","de":"Sardinien","ru":""},"it-07":{"it":"Lazio","en":"Lazio","de":"Lazio","ru":""},"it-18":{"it":"Umbria","en":"Umbria","de":"Umbrien","ru":""},"7":{"it":"Lago Trasimeno","en":"Lake Trasimeno","de":"Lago Trasimeno","ru":""},"3":{"it":"Orvieto","en":"Orvieto","de":"Orvieto","ru":""},"11":{"it":"Cortona","en":"Cortona","de":"Cortona","ru":""}}; 
228	var aree_singole_slug_alloggi = {"it-16":{"it":"toscana.html","en":"tuscany.html","de":"toskana.html","ru":""},"4":{"it":"argentario.html","en":"argentario.html","de":"argentario.html","ru":""},"6":{"it":"chianti.html","en":"chianti.html","de":"chianti.html","ru":""},"8":{"it":"val-dorcia.html","en":"val-dorcia.html","de":"val-dorcia.html","ru":""},"5":{"it":"maremma.html","en":"maremma.html","de":"maremma.html","ru":""},"it-05":{"it":"emilia-romagna.html","en":"emilia-romagna.html","de":"emilia-romagna.html","ru":""},"it-15":{"it":"sicilia.html","en":"sicily.html","de":"sizilien.html","ru":""},"it-08":{"it":"liguria.html","en":"liguria.html","de":"ligurien.html","ru":""},"it-09":{"it":"lombardia.html","en":"lombardy.html","de":"lombardei.html","ru":""},"it-12":{"it":"piemonte.html","en":"piedmont.html","de":"piemont.html","ru":""},"it-13":{"it":"puglia.html","en":"apulia.html","de":"apulien.html","ru":""},"it-10":{"it":"marche.html","en":"marche.html","de":"marken.html","ru":""},"9":{"it":"riviera-del-conero.html","en":"riviera-del-conero.html","de":"conero-riviera.html","ru":""},"it-14":{"it":"sardegna.html","en":"sardinia.html","de":"sardinien.html","ru":""},"it-07":{"it":"lazio.html","en":"lazio.html","de":"latium.html","ru":""},"it-18":{"it":"umbria.html","en":"umbria.html","de":"umbrien.html","ru":""},"7":{"it":"lago-trasimeno.html","en":"lago-trasimeno.html","de":"trasimenischer-see.html","ru":""},"3":{"it":"orvieto.html","en":"orvieto.html","de":"orvieto.html","ru":""},"11":{"it":"cortona.html","en":"cortona.html","de":"cortona.html","ru":""}}; 
229	var must_have_slug_alloggi = {"custom_u12":{"it":"affitti-turistici-vacanze-davanti-al-mare.html","en":"tourist-rentals-holidays-near-the-sea-italy.html","de":"ferienvermietungen-urlaub-am-meer-italien.html","ru":""},"custom_u13":{"it":"affitti-turistici-vacanze-vicino-ai-centri-storici.html","en":"tourist-rentals-holidays-italian-cities.html","de":"ferienvermietungen-urlaub-historische-orte-italien.html","ru":""},"custom_u14":{"it":"affitti-turistici-vacanze-con-vista-mozzafiato.html","en":"tourist-rentals-holidays-with-gorgeous-view-italy.html","de":"ferienvermietungen-urlaub-mit-aussicht-italien.html","ru":""},"custom_u15":{"it":"affitti-turistici-vacanze-nella-natura.html","en":"tourist-rentals-holidays-far-from-all-italy.html","de":"ferienvermietungen-urlaub-in-der-natur-italien.html","ru":""},"custom_u16":{"it":"affitti-turistici-vacanze-con-giardino-da-sogno.html","en":"tourist-rentals-holidays-wonderful-garden-italy.html","de":"ferienvermietungen-urlaub-mit-einem-traumgarten-italien.html","ru":""},"custom_u17":{"it":"affitti-turistici-vacanze-benessere.html","en":"tourist-rentals-holidays-wellness-italy.html","de":"ferienvermietungen-wellnessurlaub-italien.html","ru":""},"custom_u18":{"it":"affitti-turistici-vacanze-invernali-confortevoli.html","en":"tourist-rentals-holidays-cozy-italy.html","de":"ferienvermietungen-winterferien-italien.html","ru":""},"custom_u19":{"it":"affitti-turistici-vacanze-enogastronomiche.html","en":"tourist-rentals-holidays-food-wine-italy.html","de":"ferienvermietungen-essen-wein-urlaub-italien.html","ru":""},"custom_u20":{"it":"affitti-turistici-location-matrimoni.html","en":"tourist-rentals-wedding-venue-italy.html","de":"ferienvermietungen-hochzeitsorte-italien.html","ru":""}}; 
230	var aree_alloggi_to_immobili = {"it-18":4,"6":3,"8":2,"9":18,"7":5};
231	var regioni_alloggi_to_immobili = {"5":9,"it-16":9,"it-05":8,"it-15":19,"
231it-08":7,"it-09":3,"it-12":1,"it-13":16,"it-10":11,"it-14":20,"it-07":12,"it-18":10,"3":10,"11":9};
232	var tipologie_alloggi_to_immobili = {"custom_u3":3,"custom_u4":3,"custom_u5":3,"custom_u6":2,"custom_u7":7,"custom_u8":7,"custom_u9":5,"custom_u37":5};
233	var nomi_tipologie_alloggi = {"custom_u3":{"it":"Ville di Campagna","en":"Countryside Villas","de":"Villen auf dem Land","ru":""},"custom_u4":{"it":"Propriet\u00e0 eco-friendly","en":"Eco-friendly property","de":"\u00d6kologische Immobilien","ru":""},"custom_u5":{"it":"Casali per famiglie","en":"Farmhouses for families","de":"H\u00e4user f\u00fcr Familien","ru":""},"custom_u7":{"it":"Appartamento in centro storico","en":"Old Town Houses","de":"Appartements in der Altstadt","ru":""},"custom_u8":{"it":"Appartamenti vista mare","en":"Seafront apartments","de":"Appartements mit Meerblick","ru":""},"custom_u9":{"it":"Ville fronte mare","en":"Seafront villas","de":"Villen am Meer","ru":""},"custom_u6":{"it":"Location per Eventi e Matrimoni","en":"Location for Events and Weddings","de":"Veranstaltungsorte und Hochzeitslocation","ru":""},"custom_u37":{"it":"Ville per gruppi numerosi","en":"Large Villas","de":"Ferienhaus f\u00fcr Gruppen"}};	
234	
235    var pagina = '';
236    var modal = '';
237    var go = '';
238    var typecont = '';
239    var numcont = '';
240    
241</script>
241
242
243	
243<script type="text/javascript" src="https://cdn.greatestate.it/ge/js/tarteaucitron.js?v=0.2.4"></script>
243
244    
244<script type="text/javascript">
245    tarteaucitron.init({
246        "privacyUrl": "",
247        "hashtag": "#greatestatecookieconsent",
248        "cookieName": "greatestatecookieconsent",
249        "orientation": "bottom",
250        "showAlertSmall": false,
251        "cookieslist": false,
252        "adblocker": false, /* adblocker detected */
253        "AcceptAllCta" : true,
254        "highPrivacy": true,
255        "handleBrowserDNTRequest": false, /* If Do Not Track == 1, disallow all */    
256        "removeCredit": true,
257        "moreInfoLink": true,
258        "useExternalCss": false,
259        "readmoreLink": "https://www.greatestate.it/en/cookie-policy.html"
260    });
261    </script>
261
262
263	
263<script>
264
265	var is_search_page = true;
266	var session_type_search_active = 2;
267	
268    tipologie_alloggi = '';
269    aree_alloggi = '';
270    must_have_alloggi = '';
271    
272    camere_alloggi = '';
273   	bagni_alloggi = '';
274    prezzo_alloggi = '';
275    animals_allowed_alloggi = '';
276    sauna_alloggi = '';
277    bike_alloggi = '';
278    gym_alloggi = '';
279    fireplace_alloggi = '';
280    jacuzzi_alloggi = '';
281    eco_friendly_alloggi = '';
282    golf_alloggi = '';
283    pool_alloggi = '';
284    tennis_alloggi = '';
285    smart_working_alloggi = '';
286    wifi_alloggi = '';
287    barrier_free_alloggi = '';
288    fenced_garden_alloggi = '';
289    air_conditioned_alloggi = '';
290    safe_for_kids_alloggi = '';
291	virtual_tour_alloggi = '';
292	video_alloggi = '';
293	
294    session_daterange_alloggi = '';
295    session_ospiti_alloggi = '';
296    
297    var id_alloggio = '';
298    var id_groups_alloggio = '';
299  	
300  	const regex_description = /\\n|\\r\\n|\\n\\r|\\r/g;
301  	
302</script>
302	
303	<link href="https://cdn.greatestate.it/ge/css/jquery.raty.min.css?v=0.2.4" rel="stylesheet" type="text/css">
304	
305	<style>
306        @media ( max-width: 992px) {
307            #whiteBar{
308                /*padding-bottom: 15px;*/
309                /*margin-bottom: 10px;*/
310                -webkit-box-shadow: 0 -2px 16px -3px rgba(0,0,0,0.65);
311                -moz-box-shadow: 0 -2px 16px -3px rgba(0,0,0,0.65);
312                box-shadow: 0 -2px 16px -3px rgba(0,0,0,0.65);
313            }
314        }
315	</style>
316	
317	
317<script>
318
319    	var numero_risultati_per_pagina_array = [
320        	[],
321          	[
322          		{'risultati_per_pagina_front_end': 10, 'risultati_per_pagina_back_end': 10},
323              	{'risultati_per_pagina_front_end': 20, 'risultati_per_pagina_back_end': 20},
324              	{'risultati_per_pagina_front_end': 50, 'risultati_per_pagina_back_end': 50},
325              	{'risultati_per_pagina_front_end': 100, 'risultati_per_pagina_back_end': 100}
326            ],
327          	[
328          		{'risultati_per_pagina_front_end': 9, 'risultati_per_pagina_back_end': 9},
329              	{'risultati_per_pagina_front_end': 18, 'risultati_per_pagina_back_end': 18},
330              	{'risultati_per_pagina_front_end': 45, 'risultati_per_pagina_back_end': 45},
331              	{'risultati_per_pagina_front_end': 90, 'risultati_per_pagina_back_end': 90}
332            ],
333          	[
334          		{'risultati_per_pagina_front_end': 1000000, 'risultati_per_pagina_back_end': 1000000, 'numero_venduti_visualizzati': 0}
335            ]
336      	];
337      	
338		var ricerca_libera_alloggi;
339                
340        var limitCharDescBreveLista = 400;
341        var limitCharDescBreveGriglia = 300;
342        
343	</script>
343
344	
345		<link href="https://cdn.greatestate.it/ge/css/leaflet.css?v=0.2.4" async rel="stylesheet" type="text/css">
346	
347    <!-- Google tag (gtag.js) -->
348<!--
vendor: 66 bytes, lines 348-349
348  
349<script async src="https://www.googletagmanager.com/gtag/js?id=
349G-ELP27N8RL9
vendor: 12 bytes, line 349
349"></script>
350<script>
351  
vendor: 134 bytes, lines 351-355
351window.dataLayer = window.dataLayer || [];
352  function gtag(){dataLayer.push(arguments);}
353  gtag('js', new Date());
354
355  gtag('config', '
355G-ELP27N8RL9
vendor: 30 bytes, line 355
355', { 'anonymize_ip': true });
356</script>
356
357-->
358
359<!-- EL Analytics greatestate.it-->
360<script>
361   var _paq = window._paq = window._paq || [];
362   _paq.push(['trackPageView']);
363   _paq.push(['enableLinkTracking']);
364   (function() {
365     var u="https://analytics.enginelab.it/";
366     _paq.push(['setTrackerUrl', u+'js/tracker.php']);
367     _paq.push(['setSiteId', '49']);
368     var d=document, g=d.createElement('script'),
369s=d.getElementsByTagName('script')[0];
370     g.async=true; g.src=u+'js/tracker.php'; s.parentNode.insertBefore(g,s);
371   })();
372</script>
372
373<noscript><p><img referrerpolicy="no-referrer-when-downgrade"
374src="https://analytics.enginelab.it/js/tracker.php?idsite=49&rec=1"
375style="border:0;" alt="EL Analytics" /></p></noscript>
376<!-- End EL Analytics Code -->
377
378<!-- Meta Pixel Code -->
379<script>
vendor: 399 bytes, lines 379-388
379
380!function(f,b,e,v,n,t,s)
381{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
382n.callMethod.apply(n,arguments):n.queue.push(arguments)};
383if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
384n.queue=[];t=b.createElement(e);t.async=!0;
385t.src=v;s=b.getElementsByTagName(e)[0];
386s.parentNode.insertBefore(t,s)}(window, document,'script',
387'https://connect.facebook.net/en_US/fbevents.js');
388fbq('init', '
388298813754319017
vendor: 30 bytes, lines 388-389
388');
389fbq('track', 'PageView');
390</script>
390
391<noscript><img height="1" width="1" style="display:none"
392src="https://www.facebook.com/tr?id=298813754319017&ev=PageView&noscript=1"
393/></noscript>
394<!-- End Meta Pixel Code --></head>
395
396<body>
397    
398<nav id="navbarMobile" class="navbar px-3">
399    <a href="https://www.greatestate.it/en/index.html" alt="Logo Great Estate" class="navbar-brand ms-0" aria-label="Go to the Great Estate home page">
400        <img alt="Logo Great Estate" src="https://cdn.greatestate.it/ge/img/loghi/greatestate-logo.png" class="w-100" fetchpriority="high" rel="preload">
401    </a>
402    <button id="hamburgerMobile" aria-label="Main menu" type="button" class="btn btn-primary" data-bs-toggle="collapse" data-bs-target="#navbarMobileCollapse" aria-expanded="false" aria-controls="navbarMobileCollapse">
403		<i class="fa-solid fa-bars"></i>
404	</button>
405</nav>
406 
407<div class="collapse" id="navbarMobileCollapse">
408  	<div class="card card-body">
409        <div class="navbar-nav ms-auto p-0" id="linkLangMobile">
410                        	                    <a id="link_page_it" href="https://www.greatestate.it/it/ricerca-proprieta-soggiorni-brevi.html" class="nav-item nav-link">ITA</a>
411                    <span>/</span>
412                    <div class="nav-item nav-link active">ENG</div>
413                    <span>/</span>
414                    <a id="link_page_de" href="https://www.greatestate.it/de/luxusferienhauser-suchen.html" class="nav-item nav-link">DE</a>
415            	                    </div>
416  	</div>
417  	<div class="card card-body">	
418  		<span data-bs-toggle="offcanvas" data-bs-target="#filtriModal" aria-controls="filtriModal" class="nav-link p-0 text-uppercase filterLink cursor-p">Start a search</span>
419  	</div>  	
420  	<div class="accordion" id="accordionMenuMobile">
421  		<div class="accordion-item">
422            <div class="accordion-header" id="menuMobileChiSiamo">
423          		<span class="accordion-button text-uppercase collapsed cursor-p d-inline-block text-center" data-bs-toggle="collapse" data-bs-target="#collapseMenuMobileChiSiamo" aria-expanded="false" aria-controls="collapseMenuMobileChiSiamo">
424          			About us          		</span>
425            </div>
426            <div id="collapseMenuMobileChiSiamo" class="accordion-collapse collapse" aria-labelledby="menuMobileChiSiamo" data-bs-parent="#accordionMenuMobile">
427              	<div class="accordion-body">
428                  	<div class="card card-body">
429                  		<a href="https://www.greatestate.it/en/great-estate-history.html" class="nav-link p-0 text-uppercase">Great Estate history</a>
430                  	</div>
431                  	<div class="card card-body">
432                  		<a href="https://www.greatestate.it/en/team.html" class="nav-link p-0 text-uppercase">Team</a>
433                  	</div>
434              	</div>
435            </div>
436  		</div>
437  		<div class="accordion-item">
438            <div class="accordion-header" id="menuMobileNetwork">
439          		<span class="accordion-button text-uppercase collapsed cursor-p d-inline-block text-center" data-bs-toggle="collapse" data-bs-target="#collapseMenuMobileNetwork" aria-expanded="false" aria-controls="collapseMenuMobileNetwork">
440          			The Network          		</span>
441            </div>
442            <div id="collapseMenuMobileNetwork" class="accordion-collapse collapse" aria-labelledby="menuMobileNetwork" data-bs-parent="#accordionMenuMobile">
443              	<div class="accordion-body">
444                  	<div class="card card-body">
445                  		<a href="https://www.greatestate.it/en/the-network.html" class="nav-link p-0 text-uppercase">Network Structure</a>
446                  	</div>
447                  	<div class="card card-body">
448                  		<a href="https://www.greatestate.it/en/italian-agencies.html" class="nav-link p-0 text-uppercase">Italian agencies</a>
449                  	</div>
450                  	<div class="card card-body">
451                  		<a href="https://www.greatestate.it/en/international-agencies.html" class="nav-link p-0 text-uppercase">International agencies</a>
452                  	</div>
453                  	<div class="card card-body">
454                  		<a href="https://www.greatestate.it/en/companies-and-professionals.html" class="nav-link p-0 text-uppercase">Companies and professionals</a>
455                  	</div>
456              	</div>
457            </div>
458  		</div>
459  		<div class="accordion-item">
460            <div class="accordion-header" id="menuMobilePerChiAcquista">
461          		<span class="accordion-button text-uppercase collapsed cursor-p d-inline-block text-center" data-bs-toggle="collapse" data-bs-target="#collapseMenuMobilePerChiAcquista" aria-expanded="false" aria-controls="collapseMenuMobilePerChiAcquista">
462          			For buyers          		</span>
463            </div>
464            <div id="collapseMenuMobilePerChiAcquista" class="accordion-collapse collapse" aria-labelledby="menuMobilePerChiAcquista" data-bs-parent="#accordionMenuMobile">
465              	<div class="accordion-body">
466                  	<div class="card card-body">
467                  		<a href="https://www.greatestate.it/en/services-for-buyers.html" class="nav-link p-0 text-uppercase">Services for buyers</a>
468                  	</div>
469                  	<div class="card card-body">
470                  		<a href="https://www.greatestate.it/en/property-finder.html" class="nav-link p-0 text-uppercase">Property Finder</a>
471                  	</div>
472                  	<div class="card card-body">
473                  		<a href="https://www.greatestate.it/en/buy-a-luxury-property-in-italy.html" class="nav-link p-0 text-uppercase">Buy in Italy</a>
474                  	</div>
475                  	<div class="card card-body">
476                  		<a href="https://www.greatestate.it/en/services-post-purchase.html" class="nav-link p-0 text-uppercase">After purchase</a>
477                  	</div>
478              	</div>
479            </div>
480  		</div>
481  		<div class="accordion-item">
482            <div class="accordion-header" id="menuMobilePerChiVende">
483          		<span class="accordion-button text-uppercase collapsed cursor-p d-inline-block text-center" data-bs-toggle="collapse" data-bs-target="#collapseMenuMobilePerChiVende" aria-expanded="false" aria-controls="collapseMenuMobilePerChiVende">
484          			For sellers          		</span>
485            </div>
486            <div id="collapseMenuMobilePerChiVende" class="accordion-collapse collapse" aria-labelledby="menuMobilePerChiVende" data-bs-parent="#accordionMenuMobile">
487              	<div class="accordion-body">
488              		<div class="card card-body">
489                  		<a href="https://www.greatestate.it/en/services-for-seller.html" class="nav-link p-0 text-uppercase">Services for sellers</a>
490                  	</div>
491                  	<div class="card card-body">
492                  		<a href="https://www.greatestate.it/en/evaluate-your-prestige-property.html" class="nav-link p-0 text-uppercase">Online property evaluation</a>
493                  	</div>
494                  	<div class="card card-body">
495                  		<a href="https://www.greatestate.it/en/reports-potential-buyers.html" class="nav-link p-0 text-uppercase">Report potential buyers</a>
496                  	</div>
497                  	<div class="card card-body">
498                  		<a href="https://www.greatestate.it/en/assignments-and-benefits.html" class="nav-link p-0 text-uppercase">Sales mandate and its benefits</a>
499                  	</div>
500                  	<div class="card card-body">
501                  		<a href="https://www.greatestate.it/en/sell-luxury-property-in-italy-to-international-buyers.html" class="nav-link p-0 text-uppercase">Sell to international buyers</a>
502                  	</div>
503                  	<div class="card card-body">
504                  		<a href="https://www.greatestate.it/en/marketing-plan.html" class="nav-link p-0 text-uppercase">Marketing Plans</a>
505                  	</div>
506              	</div>
507            </div>
508  		</div>
509  		<!--  
510  		<div class="accordion-item">
511            <div class="accordion-header" id="menuMobileHolding">
512          		<a href="javascript:void(0)" class="accordion-button text-uppercase collapsed" data-bs-toggle="collapse" data-bs-target="#collapseMenuMobileHolding" aria-expanded="false" aria-controls="collapseMenuMobileHolding">
513          			Holding          		</a>
514            </div>
515            <div id="collapseMenuMobileHolding" class="accordion-collapse collapse" aria-labelledby="menuMobileHolding" data-bs-parent="#accordionMenuMobile">
516              	<div class="accordion-body">
517                  	<div class="card card-body">
518                  		<a href="https://www.greatestate.it/en/companies-and-professionals.html" class="nav-link p-0 text-uppercase">Great Synergy</a>
519                  	</div>
520              	</div>
521            </div>
522  		</div>
523  		-->
524  	</div>  
525   	<div class="card card-body">
526  		<a href="https://www.greatestate.it/en/terms-and-conditions.html" class="nav-link p-0 text-uppercase">Terms and conditions</a>
527  	</div>     
528   	<div class="card card-body">
529  		<a href="https://www.greatestate.it/en/privacy.html" class="nav-link p-0 text-uppercase">Privacy</a>
530  	</div>  
531   	<div class="card card-body">
532  		<a href="https://www.greatestate.it/en/cookie-policy.html" class="nav-link p-0 text-uppercase">Cookie</a>
533  	</div>   
534   	<div class="card card-body">
535  		<a href="https://www.greatestate.it/en/contact.html" class="nav-link p-0 text-uppercase">Contacts</a>
536  	</div>   
537  	<div class="card card-body">
538		
539        <a href="https://www.greatestate.it/en/login.html" class="nav-link p-0 text-uppercase">Reserved area</a>
540	  
541	</div>   
542   	<div class="card card-body">
543  		<a href="https://www.greatestate.it/en/mapsite.html" class="nav-link p-0 text-uppercase">Website map</a>
544  	</div>    
545  	<div class="card card-body">
546  		<a href="https://www.greatestate.it/en/press-office.html" class="nav-link p-0 text-uppercase">Press Office</a>
547  	</div>     
548  	<div class="card card-body">
549                	<a href="https://magazine.greatestate.it" class="nav-link p-0 text-uppercase">Magazine</a>
550        	
551  	</div>   
552  	<div class="card card-body">
553        <div id="socialIconsMobile">
554    		<a id="facebook" aria-label="Facebook Great Estate profile" class="btn btn-primary share_button text-uppercase" target="_blank" href="https://www.facebook.com/GreatEstate.ItalianProperties">
555    			<div id="facebook_icon"></div>
556    		</a>  
557    		<a id="instagram" aria-label="Instagram Great Estate profile" class="btn btn-primary share_button text-uppercase" target="_blank" href="https://www.instagram.com/greatestate.it">
558    			<div id="instagram_icon"></div>
559    		</a>  
560    		<a id="linkedin" aria-label="Linkedin Great Estate profile" class="btn btn-primary share_button text-uppercase" target="_blank" href="https://www.linkedin.com/company/greatestate-it">
561    			<div id="linkedin_icon"></div>
562    		</a> 
563    		<a id="twitter" aria-label="Twitter Great Estate profile" class="btn btn-primary share_button text-uppercase" target="_blank" href="https://twitter.com/greatestateit">
564    			<div id="twitter_icon"></div>
565    		</a> 
566    		<a id="youtube" aria-label="Youtube Great Estate profile" class="btn btn-primary share_button text-uppercase" target="_blank" href="https://www.youtube.com/user/GreatEstateProperty">
567    			<div id="youtube_icon"></div>
568    		</a> 
569    		<a id="pinterest" aria-label="Pinterest Great Estate profile" class="btn btn-primary share_button text-uppercase" target="_blank" href="https://pin.it/7iWynqJSJ">
570    			<div id="pinterest_icon"></div>
571    		</a> 
572        </div>
573  	</div>
574</div>
575
576<div id="stickyMenu">  
577		
578		<div id="stickyMenuProfile">
579            <a href="https://www.greatestate.it/en/login.html"> 			
580            	<i class="fa-solid fa-user-large"></i><p>Log in</p>
581            </a>	
582       	</div>						
583	   
584    <!-- <div id="stickyMenuWishlist"> -->	
585    	<!-- <i class="fa-solid fa-house-heart"></i><p>Favorites</p> -->
586    <!-- </div> -->
587    <div id="stickyMenuSearch" class="filterLink cursor-p" data-bs-toggle="offcanvas" data-bs-target="#filtriModal" aria-controls="filtriModal">     
588    	<span>
589    		<i class="fa-solid fa-magnifying-glass"></i><p>Search</p> 
590    	</span>		
591    </div>
592    <div id="stickyMenuWA">     
593    	<a class="filterLink" target="_blank" href="https://api.whatsapp.com/send?phone=393511667107">
594    		<i class="fa-brands fa-whatsapp"></i><p>Whatsapp</p>  		
595    	</a>
596    </div>
597    <div id="stickyMenuPhone" class="filterLink cursor-p" data-bs-toggle="modal" data-bs-target="#modal_telefono_ge" aria-controls="modal_telefono_ge">     
598    	<span>
599    		<i class="fa-solid fa-phone"></i><p>Phone</p>  		
600    	</span>
601    </div>
602        <div id="stickyMenuContact" class="filterLink cursor-p" data-bs-toggle="offcanvas" data-bs-target="#contattiModal" aria-controls="contattiModal">       
603    	<span>
604    		<i class="fa-solid fa-envelope"></i><p>Contacts</p>  		
605    	</span>
606    </div>
607    </div>
608
609<div id="stickyMenuMobile">
610	<div id="stickyMenuMobileItem">
611    	<span data-bs-toggle="offcanvas" data-bs-target="#filtriModal" aria-controls="filtriModal" class="nav-link p-0 text-uppercase filterLink cursor-p">
612    		    			<i class="fa-solid fa-sliders"></i>
613    		    	</span>
614	</div>
615	<div id="stickyMenuMobileItem" class="stickyMenuMobileItemWA">
616    	<a target="_blank" href="https://api.whatsapp.com/send?phone=393511667107" aria-label="Whatsapp Great Estate: 393511667107">
617    		<i class="fa-brands fa-whatsapp"></i>
618    	</a>
619	</div>
620	<div id="stickyMenuMobileItem">
621    	<a href="tel:+39057859050" onclick="_paq.push(['trackGoal', 1]);" class="nav-link p-0 text-uppercase filterLink" aria-label="Phone Great Estate: 393511667107">
622    		<i class="fa-solid fa-phone"></i>
623    	</a>
624	</div>
625	<div id="stickyMenuMobileItem">
626    	<span data-bs-toggle="offcanvas" data-bs-target="#contattiModal" aria-controls="contattiModal" class="nav-link p-0 text-uppercase filterLink cursor-p">
627    		<i class="fa-solid fa-envelope"></i>
628    	</span>
629	</div>
630	
631			
632	    <div id="stickyMenuMobileItem">
633	        <a href="https://www.greatestate.it/en/login.html"><i class="fa-solid fa-user-large" aria-label="Log in"></i></a>						
634		</div>
635		  
636</div>
637
638<div id="modal_telefono_ge" class="modal fade" tabindex="-1" aria-hidden="true">
639  	<div class="modal-dialog modal-dialog-centered">
640    	<div class="modal-content">
641      		<div class="modal-header">
642      			<h5 class="modal-title">Head Office</h5>
643      			<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
644      		</div>
645      		<div class="modal-body text-center">
646      			<a onclick="_paq.push(['trackGoal', 1]);" class="link" href="tel:+39057859050"><i class="fa-regular fa-phone"></i>+39 0578 59050</a>
647      		</div>
648    	</div>
649  	</div>
650</div>
651
652<div id="modal_sent_mail_gs" class="modal fade" tabindex='-1'>
653  	<div class="modal-dialog modal-dialog-centered">
654    	<div class="modal-content">
655      		<div class="modal-header">
656        		<h5 class="modal-title">Thank you</h5>
657        		<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
658      		</div>
659      		<div class="modal-body text-center">
660        		The request has been sent      		</div>
661  			<div class="modal-footer margin0auto">
662    			<button type="button" class="btn btn-secondary buttonGreenBgWhite customButton" data-bs-dismiss="modal">Close</button>
663  			</div>
664    	</div>
665  	</div>
666</div>
667
668<div id="modal_sent_mail_ge" class="modal fade" tabindex='-1'>
669  	<div class="modal-dialog modal-lg modal-dialog-centered">
670    	<div class="modal-content">
671      		<div class="modal-header">
672        		<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
673      		</div>
674      		<div class="modal-body text-center pt-0">
675        		<p class="text-center" id="messaggio_sent_mail"></p>
676        		<div class="text-center" id="contenuto_opzionale_sent_mail"></div>
677      		</div>
678    	</div>
679  	</div>
680</div>
681
682<!-- <div id="whiteBar" > -->
683<div id="whiteBar">
684    <div class="container">
685    	<div class="row">
686    		<nav id="navbar" class="navbar navbar-expand-lg">
687    			<div class="container-fluid">
688    				<a href="https://www.greatestate.it/en/index.html" alt="Logo Great Estate" class="navbar-brand ms-0" aria-label="Go to the Great Estate home page">
689    					<img alt="Logo Great Estate" src="https://cdn.greatestate.it/ge/img/loghi/greatestate-logo.png" fetchpriority="high" rel="preload">
690    				</a>
691                    <div id="menuRightDesktop">
692                        <div class="navbar-nav ms-auto p-0">
693                        	<div class="dropdown-center text-link textUpperCase">
694                          		<button class="btn btn-secondary dropdown-toggle textUpperCase" type="button" id="dropdownMenuButton_1" data-bs-toggle="dropdown" aria-expanded="false">
695                            		About us                          		</button>
696                          		<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton_1">
697                            		<li><a class="dropdown-item" href="https://www.greatestate.it/en/great-estate-history.html">Great Estate history</a></li>
698                            		<li><a class="dropdown-item" href="https://www.greatestate.it/en/team.html">Team</a></li>
699                          		</ul>
700                        	</div>
701                        	<div class="dropdown-center text-link textUpperCase">
702                          		<button class="btn btn-secondary dropdown-toggle textUpperCase" type="button" id="dropdownMenuButton_2" data-bs-toggle="dropdown" aria-expanded="false">
703                            		The Network                          		</button>
704                          		<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton_2">
705                            		<li><a class="dropdown-item" href="https://www.greatestate.it/en/the-network.html">Network Structure</a></li>
706                            		<li><a class="dropdown-item" href="https://www.greatestate.it/en/italian-agencies.html">Italian agencies</a></li>
707                            		<li><a class="dropdown-item" href="https://www.greatestate.it/en/international-agencies.html">International agencies</a></li>
708                            		<li><a class="dropdown-item" href="https://www.greatestate.it/en/companies-and-professionals.html">Companies and professionals</a></li>
709                          		</ul>
710                        	</div>
711                        	<div class="dropdown-center text-link textUpperCase">
712                          		<button class="btn btn-secondary dropdown-toggle textUpperCase" type="button" id="dropdownMenuButton_3" data-bs-toggle="dropdown" aria-expanded="false">
713                            		For buyers                          		</button>
714                          		<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton_3">
715                            		<li><a class="dropdown-item" href="https://www.greatestate.it/en/services-for-buyers.html">Services for buyers</a></li>
716                            		<li><a class="dropdown-item" href="https://www.greatestate.it/en/property-finder.html">Property Finder</a></li>
717                            		<li><a class="dropdown-item" href="https://www.greatestate.it/en/buy-a-luxury-property-in-italy.html">Buy in Italy</a></li>
718                            		<li><a class="dropdown-item" href="https://www.greatestate.it/en/services-post-purchase.html">After purchase</a></li>
719                          		</ul>
720                        	</div>
721                        	<div class="dropdown-center text-link textUpperCase">
722                          		<button class="btn btn-secondary dropdown-toggle textUpperCase" type="button" id="dropdownMenuButton_4" data-bs-toggle="dropdown" aria-expanded="false">
723                            		For sellers                          		</button>
724                          		<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton_4">
725                            		<li><a class="dropdown-item" href="https://www.greatestate.it/en/services-for-seller.html">Services for sellers</a></li>
726                            		<li><a class="dropdown-item" href="https://www.greatestate.it/en/evaluate-your-prestige-property.html">Online property evaluation</a></li>
727                            		<li><a class="dropdown-item" href="https://www.greatestate.it/en/reports-potential-buyers.html">Report potential buyers</a></li>
728                            		<li><a class="dropdown-item" href="https://www.greatestate.it/en/assignments-and-benefits.html">Sales mandate and its benefits</a></li>
729                            		<li><a class="dropdown-item" href="https://www.greatestate.it/en/sell-luxury-property-in-italy-to-international-buyers.html">Sell to international buyers</a></li>
730                            		<li><a class="dropdown-item" href="https://www.greatestate.it/en/marketing-plan.html">Marketing Plans</a></li>
731                          		</ul>
732                        	</div>
733                        	<!--  
734                        	<div class="dropdown-center text-link textUpperCase">
735                          		<button class="btn btn-secondary dropdown-toggle textUpperCase" type="button" id="dropdownMenuButton_5" data-bs-toggle="dropdown" aria-expanded="false">
736                            		Holding                          		</button>
737                          		<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton_5">
738                            		<li><a class="dropdown-item" href="https://www.greatestate.it/en/companies-and-professionals.html">Great Synergy</a></li>
739                          		</ul>
740                        	</div>
741                        	-->
742                        	                            	                                    <a href="https://www.greatestate.it/it/ricerca-proprieta-soggiorni-brevi.html" class="nav-item nav-link link_lingua">ITA</a>
743                                    <span>/</span>
744                                    <div class="nav-item nav-link link_lingua active">ENG</div>
745                                    <span>/</span>
746                                    <a href="https://www.greatestate.it/de/luxusferienhauser-suchen.html" class="nav-item nav-link link_lingua">DE</a>
747                            								                        </div>
748                    </div>
749				</div>
750			</nav>
751		</div>
752	</div>
753</div>
754
755<div class="loading_gif"></div>
756    
757    <div id="divRicerca">
758    	<ul class="nav nav-tabs nav-fill" role="tablist">
759  	<li class="nav-item" role="presentation">
760    	<button class="nav-link" id="acquistaTab" data-bs-toggle="tab" data-bs-target="#acquistaBar" type="button" role="tab" aria-controls="acquistaBar" aria-selected="true">Buy</button>
761  	</li>
762  	<li class="nav-item" role="presentation">
763    	<button class="nav-link" id="affittaTab" data-bs-toggle="tab" data-bs-target="#affittaBar" type="button" role="tab" aria-controls="affittaBar" aria-selected="false">Rent</button>
764  	</li>
765</ul>
766
767<div id="divRicercaContent">
768    <div class="container">
769    	<div class="row">
770            <div class="tab-content">
771                  <div class="tab-pane fade" id="acquistaBar" role="tabpanel" aria-labelledby="acquistaTab">
772                    	<div class="row">
773                    		<div id="mobileBarSx" class="col-lg-7 d-lg-flex">
774    							<div id="colTipologieImmobiliRicerca">
775                                    <div class="dropdown">
776                                    	<div class="labelRicerca text-uppercase" data-bs-toggle="dropdown" data-bs-auto-close="outside">Typology</div>
777                        				<button id="tipologie_immobiliBtn" class="btn dropdownBtnSearchBar dropdown-toggle" type="button" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">
778                        					What kind of property are you looking for?                        				</button>
779                                    	<ul id="tipologie_immobili_multiselect" class="dropdown-menu dropdownSearchBarTipologie" aria-labelledby="tipologie_immobiliBtn">
780                        				</ul>
781                        			</div>
782                        		</div>
783                                <div id="colLocationsImmobiliRicerca">
784                                    <div class="dropdown">
785                                    	<div class="labelRicerca text-uppercase" data-bs-toggle="dropdown" data-bs-auto-close="outside">Location</div>
786                        				<button id="locations_immobiliBtn" class="btn dropdownBtnSearchBar dropdown-toggle" type="button" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">
787                        					Where do you search?                        				</button>
788                        				<ul id="locations_immobili_multiselect_ul" class="dropdown-menu dropdownSearchBarAree" aria-labelledby="locations_immobiliBtn">
789											<div class="accordion" id="accordion_ricerca_immobili">
790                            					<div class="accordion-item">
791                            						<h2 class="accordion-header" id="headingAccordionOffcanvasRegioniImmobili">
792                              							<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseAccordionOffcanvasRegioniImmobili" aria-expanded="false" aria-controls="collapseAccordionOffcanvasRegioniImmobili">
793                                							Regions                              							</button>
794                            						</h2>
795                            						<div id="collapseAccordionOffcanvasRegioniImmobili" class="accordion-collapse collapse" aria-labelledby="headingAccordionOffcanvasRegioniImmobili" data-bs-parent="#accordion_ricerca_immobili">
796                              							<div class="accordion-body">
797                        									<div class="locations_immobili_multiselect" id="regioni_immobili_multiselect">
798                        									</div>
799                            							</div>
800                            						</div>
801                            					</div>	
802                            					<div class="accordion-item">
803                            						<h2 class="accordion-header" id="headingAccordionOffcanvasProvinceImmobili">
804                              							<button id="buttonAccordionOffcanvasProvinceImmobili" class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseAccordionOffcanvasProvinceImmobili" aria-expanded="false" aria-controls="collapseAccordionOffcanvasProvinceImmobili">
805                                							Provinces                              							</button>
806                            						</h2>
807                            						<div id="collapseAccordionOffcanvasProvinceImmobili" class="accordion-collapse collapse" aria-labelledby="headingAccordionOffcanvasProvinceImmobili" data-bs-parent="#accordion_ricerca_immobili">
808                              							<div class="accordion-body">
809                        									<div class="locations_immobili_multiselect" id="province_immobili_multiselect">
810                        									</div>
811                            							</div>
812                            						</div>
813                            					</div>	
814                            					<div class="accordion-item">
815                            						<h2 class="accordion-header" id="headingAccordionOffcanvasComuniImmobili">
816                              							<button id="buttonAccordionOffcanvasComuniImmobili" class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseAccordionOffcanvasComuniImmobili" aria-expanded="false" aria-controls="collapseAccordionOffcanvasComuniImmobili">
817                                							Municipalities                              							</button>
818                            						</h2>
819                            						<div id="collapseAccordionOffcanvasComuniImmobili" class="accordion-collapse collapse" aria-labelledby="headingAccordionOffcanvasComuniImmobili" data-bs-parent="#accordion_ricerca_immobili">
820                              							<div class="accordion-body">
821                        									<div class="locations_immobili_multiselect" id="comuni_immobili_multiselect">
822                        									</div>
823                            							</div>
824                            						</div>
825                            					</div>
826                            					<div class="accordion-item">
827                            						<h2 class="accordion-header" id="headingAccordionOffcanvasAreeImmobili">
828                              							<button id="buttonAccordionOffcanvasAreeImmobili" class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseAccordionOffcanvasAreeImmobili" aria-expanded="false" aria-controls="collapseAccordionOffcanvasAreeImmobili">
829                                							Areas of interest                              							</button>
830                            						</h2>
831                            						<div id="collapseAccordionOffcanvasAreeImmobili" class="accordion-collapse collapse" aria-labelledby="headingAccordionOffcanvasAreeImmobili" data-bs-parent="#accordion_ricerca_immobili">
832                              							<div class="accordion-body">
833                        									<div class="locations_immobili_multiselect" id="aree_immobili_multiselect">
834                        									</div>
835                            							</div>
836                            						</div>
837                            					</div>	
838											</div>
839											<div class="text-center">
840												<button type="button" id="annullaButtonLocationsImmobili" class="btn btn-primary applicaButton text-uppercase"><b>Cancel</b></button>
841                                                                                            		                                                  		<button type="button" id="applicaButtonLocationsImmobili" class="btn btn-primary applicaButton buttonSlugImmobili text-uppercase" onclick="submitCercaImmobili(\'prestigious-property-search.html\', true)">
842                                                                                                        													<b>Apply</b>
843    												</button>
844											</div>
845                        				</ul>
846                        			</div>
847                        		</div>
848                        		<div id="colBudgetImmobiliRicerca">
849                                    <div class="dropdown">
850                                    	<div class="labelRicerca text-uppercase" data-bs-toggle="dropdown" data-bs-auto-close
850="outside">Budget</div>
851                        				<!--  <button id="prezzo_immobiliBtn" class="btn dropdownBtnSearchBar dropdown-toggle" type="button" data-bs-toggle="dropdown" data-bs-auto-close="false" aria-expanded="false"></button> -->
852                        				<button id="prezzo_immobiliBtn" class="btn dropdownBtnSearchBar dropdown-toggle" type="button" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false"></button>
853                        				<div id="prezzoImmobiliSlider" class="dropdown-menu dropdownSearchBar" aria-labelledby="prezzo_immobiliBtn">
854                        				</div>
855                        			</div>
856                                </div>
857                    		</div>
858                    		<div id="mobileBarDx" class="col-lg-5 d-lg-flex">
859                                <div id="colRicercaLiberaImmobili" class="position-relative">
860                              		<input aria-label="Free search" form="formSubmitCercaImmobili" name="ricercalibera" type="input" class="form-control" id="ricerca_liberaImmobili" value="">
861                              		<i class="fa fa-search"></i>
862                                </div>
863                                <div id="colCercaImmobili" class="">
864    								<span class="filterLinkImmobili filterLink cursor-p" data-bs-toggle="offcanvas" data-bs-target="#filtriModal" aria-controls="filtriModal">
865    									<i class="fa-solid fa-sliders"></i><span class="labelRicerca text-uppercase">Advanced Search</span>
866    								</span>
867                            		                                  		<button type="submit" class="btn btn-primary text-uppercase buttonSlugImmobili btnCercaImmobili" onclick="submitCercaImmobili('prestigious-property-search.html', true)">Search</button>
868                                                                    </div>
869                    		</div>
870                    	</div>
871                    	<div class="row">
872                    		<div class="col-lg-4 col-md-2"></div>
873                    		<div id="colCercaImmobiliMobile" class="col-lg-4 col-md-8">
874                          		<span class="filterLinkImmobili filterLink cursor-p" data-bs-toggle="offcanvas" data-bs-target="#filtriModal" aria-controls="filtriModal">
875                          			<i class="fa-solid fa-sliders"></i><span class="labelRicerca text-uppercase">Advanced Search</span>
876                          		</span> 	
877                        		                              		<button type="submit" class="btn btn-primary text-uppercase buttonSlugImmobili btnCercaImmobili" onclick="submitCercaImmobili('prestigious-property-search.html', true)">Search</button>
878                                                            </div>
879                            <div class="col-lg-4 col-md-2"></div>
880                    	</div>
881                  </div>
882                  <div class="tab-pane fade" id="affittaBar" role="tabpanel" aria-labelledby="affittaTab">
883                    	<div class="row">
884                    		<div class="col-lg-7 d-lg-flex">
885                        		<div id="colTipologieAlloggiRicerca">
886                                    <div class="dropdown">
887                                    	<div class="labelRicerca text-uppercase" data-bs-toggle="dropdown" data-bs-auto-close="outside">Typology</div>
888                        				<button id="tipologie_alloggiBtn" class="btn dropdownBtnSearchBar dropdown-toggle" type="button" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">
889                        					What kind of housing are you looking for?                        				</button>
890                                    	                                            <ul id="tipologie_alloggi_multiselect" class="dropdown-menu dropdownSearchBarTipologie" aria-labelledby="tipologie_alloggiBtn">
891                                    	                        				</ul>
892                        			</div>
893                        		</div>
894                                <div id="colAreeAlloggiRicerca">
895                                    <div class="dropdown">
896                                    	<div class="labelRicerca text-uppercase" data-bs-toggle="dropdown" data-bs-auto-close
896="outside">Location</div>
897                        				<button id="aree_alloggiBtn" class="btn dropdownBtnSearchBar dropdown-toggle" type="button" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">
898                        					Where would you like to go?                        				</button>
899                        				<ul id="aree_alloggi_multiselect" class="dropdown-menu dropdownSearchBarAree" aria-labelledby="aree_alloggiBtn">
900                        				</ul>
901                        			</div>
902                        		</div>
903                        		<div id="colBudgetAlloggiRicerca">
904                                    <div class="dropdown">
905                                    	<div class="labelRicerca text-uppercase" data-bs-toggle="dropdown" data-bs-auto-close="outside">Budget</div>
906                        				<!-- <button id="prezzo_alloggiBtn" class="btn dropdownBtnSearchBar dropdown-toggle" type="button" data-bs-toggle="dropdown" data-bs-auto-close="false" aria-expanded="false"></button> -->
907                        				<button id="prezzo_alloggiBtn" class="btn dropdownBtnSearchBar dropdown-toggle" type="button" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false"></button>
908                        				<div id="prezzoAlloggiSlider" class="dropdown-menu dropdownSearchBar" aria-labelledby="prezzo_alloggiBtn">
909                        				</div>
910                        			</div>
911                                </div>
912                			</div>
913                    		<div class="col-lg-5 d-lg-flex">
914                                <div id="colRicercaLiberaAlloggi" class="position-relative">
915                              		<input aria-label="Free search" form="formSubmitCercaAlloggi" name="ricercalibera" type="input" class="form-control" id="ricerca_liberaAlloggi" value="">
916                              		<i class="fa fa-search"></i>
917                                </div>
918                                <div id="colCercaAlloggi" class="">
919                              		<span class="filterLinkAlloggi filterLink cursor-p" data-bs-toggle="offcanvas" data-bs-target="#filtriModal" aria-controls="filtriModal">
920                              			<i class="fa-solid fa-sliders"></i><span class="labelRicerca text-uppercase">Advanced Search</span>
921                              		</span> 	
922                                  	<button type="submit" class="btn btn-primary text-uppercase buttonSlugAlloggi btnCercaAlloggi" onclick="submitCercaAlloggi('luxury-rentals-search.html', true)">Search</button>
923                                </div>
924                        	</div>
925                        	<div class="row">
926                        		<div class="col-lg-4 col-md-2"></div>
927                        		<div id="colCercaAlloggiMobile" class="col-lg-4 col-md-8">
928                              		<span class="filterLinkAlloggi filterLink cursor-p" data-bs-toggle="offcanvas" data-bs-target="#filtriModal" aria-controls="filtriModal">
929                              			<i class="fa-solid fa-sliders"></i><span class="labelRicerca text-uppercase">Advanced Search</span>
930                              		</span> 	
931                                  	<button type="submit" class="btn btn-primary text-uppercase buttonSlugAlloggi btnCercaAlloggi" onclick="submitCercaAlloggi('luxury-rentals-search.html', true)">Search</button>
932                                </div>
933                                <div class="col-lg-4 col-md-2"></div>
934                        	</div>
935                        </div>
936                  </div>
937			</div>	
938		</div>
939	</div>
940</div>
941
942
943    </div>
944    
945    <form id="formSubmitCercaImmobili" method="get" action="prestigious-property-search.html">
946    <input name="tipologie" disabled="disabled" type="hidden" id="tipologie_immobili" value="">
947    <input name="aree" disabled="disabled" type="hidden" id="aree_immobili" value="">
948    <input name="regioni" disabled="disabled" type="hidden" id="regioni_immobili" value="">
949    <input name="province" disabled="disabled" type="hidden" id="province_immobili" value="">
950    <input name="comuni" disabled="disabled" type="hidden" id="comuni_immobili" value="">
951    <input name="prezzo" type="hidden" id="prezzo_immobili" value="">
952    <input name="camere" type="hidden" id="camere_immobili" value="">
953    <input name="bagni" type="hidden" id="bagni_immobili" value="">
954    <input name="superficie" type="hidden" id="superficie_immobili" value="">
955    <input name="terreno" type="hidden" id="terreno_immobili" value="">
956    <input name="condizioni" type="hidden" id="condizioni_immobili" value="">
957    <input name="collina" type="hidden" id="collina_immobili" class="hasSlug" value="">
958    <input name="pianura" type="hidden" id="pianura_immobili" class="hasSlug" value="">
959    <input name="vicino_ai_servizi" type="hidden" id="vicino_ai_servizi_immobili" class="hasSlug" value="">
960    <input name="centro_storico" type="hidden" id="centro_storico_immobili" class="hasSlug" value="">
961    <input name="vicino_al_mare" type="hidden" id="vicino_al_mare_immobili" value="">
962    <input name="vicino_al_lago" type="hidden" id="vicino_al_lago_immobili" class="hasSlug" value="">
963    <input name="piscina" type="hidden" id="piscina_immobili" class="hasSlug" value="">
964    <input name="recinzione" type="hidden" id="recinzione_immobili" value="">
965    <input name="palestra" type="hidden" id="palestra_immobili" class="hasSlug" value="">
966    <input name="spa" type="hidden" id="spa_immobili" class="hasSlug" value="">
967    <input name="giardino" type="hidden" id="giardino_immobili" class="hasSlug" value="">
968    <input name="area_barbecue" type="hidden" id="area_barbecue_immobili" value="">
969    <input name="terrazza_abitabile" type="hidden" id="terrazza_abitabile_immobili" value="">
970    <input name="ascensore" type="hidden" id="ascensore_immobili" value="">
971    <input name="garage" type="hidden" id="garage_immobili" value="">
972    <input name="strada_accesso_privata" type="hidden" id="strada_accesso_privata_immobili" value="">
973    <input name="allarme" type="hidden" id="allarme_immobili" value="">
974    <input name="arredato" type="hidden" id="arredato_immobili" value="">
975    <input name="venduto" disabled="disabled" type="hidden" id="venduto_immobili" class="hasSlug" value="">
976    <input name="in_trattativa" type="hidden" id="in_trattativa_immobili" value="">
977    <input name="nuovo_sul_mercato" type="hidden" id="nuovo_sul_mercato_immobili" value="">
978    <input name="alta_motivazione" type="hidden" id="alta_motivazione_immobili" value="">
979    <input name="veloce_tempistica" type="hidden" id="veloce_tempistica_immobili" value="">
980    <input name="super_prezzo" type="hidden" id="super_prezzo_immobili" value="">
981    <input name="ottimo_prezzo" type="hidden" id="ottimo_prezzo_immobili" value="">
982    <input name="buon_prezzo" type="hidden" id="buon_prezzo_immobili" value="">
983    <input name="virtual_tour" type="hidden" id="virtual_tour_immobili" class="hasSlug" value="">
984    <input name="video_professionale" type="hidden" id="video_professionale_immobili" class="hasSlug" value="">
985    <input name="video_amatoriale" type="hidden" id="video_amatoriale_immobili" class="hasSlug" value="">
986</form>
987<form id="formSubmitCercaAlloggi" method="get" action="luxury-rentals-search.html">
988    <input name="tipologie" disabled="disabled" type="hidden" id="tipologie_alloggi" value="">
989    <input name="aree" disabled="disabled" type="hidden" id="aree_alloggi" value="">
990    <input name="musthave" disabled="disabled" type="hidden" id="must_have_alloggi" value="">
991    <input name="camere" type="hidden" id="camere_alloggi" value="">
992    <input name="bagni" type="hidden" id="bagni_alloggi" value="">
993    <input name="prezzo" type="hidden" id="prezzo_alloggi" value="">
994    <input name="animali" type="hidden" id="animals_allowed_alloggi" value="">
995    <input name="sauna" type="hidden" id="sauna_alloggi" value="">
996    <input name="bici" type="hidden" id="bike_alloggi" value="">
997    <input name="palestra" type="hidden" id="gym_alloggi" value="">
998    <input name="golf" type="hidden" id="golf_alloggi" value="">
999    <input name="piscina" type="hidden" id="pool_alloggi" value="">
1000    <input name="tennis" type="hidden" id="tennis_alloggi" value="">
1001    <input name="smartworking" type="hidden" id="smart_working_alloggi" value="">
1002    <input name="wifi" type="hidden" id="wifi_alloggi" value="">
1003    <input name="barrierfree" type="hidden" id="barrier_free_alloggi" value="">
1004    <input name="giardinorecintato" type="hidden" id="fenced_garden_alloggi" value="">
1005    <input name="ariacondizionata" type="hidden" id="air_conditioned_alloggi" value="">
1006    <input name="perbambini" type="hidden" id="safe_for_kids_alloggi" value="">
1007    <input name="ecofriendly" type="hidden" id="eco_friendly_alloggi" value="">
1008    <input name="jacuzzi" type="hidden" id="jacuzzi_alloggi" value="">
1009    <input name="camino" type="hidden" id="fireplace_alloggi" value="">
1010    <input name="virtualtour" type="hidden" id="virtual_tour_alloggi" value="">
1011    <input name="video" type="hidden" id="video_alloggi" value="">
1012    <input type="hidden" id="daterange_alloggi" value="">
1013    <input type="hidden" id="ospiti_alloggi" value="">
1014</form>    
1015    <div class="offcanvas offcanvas-end" tabindex="-1" id="filtriModal" aria-labelledby="filtriModalLabel">
1016  	<div class="offcanvas-header">
1017    	<h5 id="filtriModalLabel">Customise your search</h5>
1018    	<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
1019  	</div>
1020  	<div class="line">
1021  		<hr>
1022  	</div>
1023	<div class="offcanvas-body">
1024        <ul class="nav nav-tabs nav-fill" role="tablist">
1025          	<li class="nav-item" role="presentation">
1026            	<button class="nav-link" id="acquistaTabOffcanvas" data-bs-toggle="tab" data-bs-target="#acquistaBarOffcanvas" type="button" role="tab" aria-controls="acquistaBarOffcanvas" aria-selected="true">Buy</button>
1027          	</li>
1028          	<li class="nav-item" role="presentation">
1029            	<button class="nav-link" id="affittaTabOffcanvas" data-bs-toggle="tab" data-bs-target="#affittaBarOffcanvas" type="button" role="tab" aria-controls="affittaBarOffcanvas" aria-selected="false">Rent</button>
1030          	</li>
1031        </ul>
1032        <div class="tab-content">
1033			<div class="tab-pane fade position-relative" id="acquistaBarOffcanvas" role="tabpanel" aria-labelledby="acquistaTabOffcanvas">
1034				<div id="colRicercaLiberaImmobiliMobileDiv">
1035                    <div id="colRicercaLiberaImmobiliMobile">
1036                  		<input aria-label="Free search" form="formSubmitCercaImmobili" name="ricercalibera" type="input" class="form-control" id="ricerca_liberaImmobiliMobile" value="">
1037                  		<i class="fa fa-search"></i>
1038                    </div>
1039            		                  		<button type="submit" class="btn btn-primary text-uppercase buttonSlugImmobili btnCercaImmobili" onclick="submitCercaImmobili('prestigious-property-search.html', true)">Search</button>
1040                    				</div>
1041				<div style="position: relative;">
1042    				<div class="tipoFiltroTitle">Typology</div>
1043    				<div class="tipoFiltroAll">
1044    					<input class="form-check-input checkStyleImmobili" type="checkbox" id="tipologie_immobiliCheckAll_filtro">
1045    					<label class="form-check-label checkAllLabelStyleImmobili_filtro" for="tipologie_immobiliCheckAll_filtro">All</label>
1046    				</div>
1047     				<div class="tipoFiltro">
1048    					<div id="tipologie_immobili_filtro"></div>
1049    				</div>
1050    			</div>
1051				<div class="tipoFiltroTitle">Location</div>
1052				<div id="locations_immobili_filtro">
1053					<div class="accordion" id="accordion_offcanvas">	
1054    					<div class="accordion-item">
1055    						<h2 class="accordion-header" id="headingAccordionOffcanvasRegioniImmobili_filtro">
1056      							<button id="buttonAccordionOffcanvasRegioniImmobili_filtro" class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseAccordionOffcanvasRegioniImmobili_filtro" aria-expanded="false" aria-controls="collapseAccordionOffcanvasRegioniImmobili_filtro">
1057        							Regions      							</button>
1058    						</h2>
1059    						<div id="collapseAccordionOffcanvasRegioniImmobili_filtro" class="accordion-collapse collapse" aria-labelledby="headingAccordionOffcanvasRegioniImmobili_filtro" data-bs-parent="#accordion_offcanvas">
1060      							<div class="accordion-body">
1061									<div class="locations_immobili_multiselect_filtro" id="regioni_immobili_multiselect_filtro">
1062									</div>
1063    							</div>
1064    						</div>
1065    					</div>	
1066    					<div class="accordion-item">
1067    						<h2 class="accordion-header" id="headingAccordionOffcanvasProvinceImmobili_filtro">
1068      							<button id="buttonAccordionOffcanvasProvinceImmobili_filtro" class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseAccordionOffcanvasProvinceImmobili_filtro" aria-expanded="false" aria-controls="collapseAccordionOffcanvasProvinceImmobili_filtro">
1069        							Provinces      							</button>
1070    						</h2>
1071    						<div id="collapseAccordionOffcanvasProvinceImmobili_filtro" class="accordion-collapse collapse" aria-labelledby="headingAccordionOffcanvasProvinceImmobili_filtro" data-bs-parent="#accordion_offcanvas">
1072      							<div class="accordion-body">
1073									<div class="locations_immobili_multiselect_filtro" id="province_immobili_multiselect_filtro">
1074									</div>
1075    							</div>
1076    						</div>
1077    					</div>	
1078    					<div class="accordion-item">
1079    						<h2 class="accordion-header" id="headingAccordionOffcanvasComuniImmobili_filtro">
1080      							<button id="buttonAccordionOffcanvasComuniImmobili_filtro" class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseAccordionOffcanvasComuniImmobili_filtro" aria-expanded="false" aria-controls="collapseAccordionOffcanvasComuniImmobili_filtro">
1081        							Municipalities      							</button>
1082    						</h2>
1083    						<div id="collapseAccordionOffcanvasComuniImmobili_filtro" class="accordion-collapse collapse" aria-labelledby="headingAccordionOffcanvasComuniImmobili_filtro" data-bs-parent="#accordion_offcanvas">
1084      							<div class="accordion-body">
1085									<div class="locations_immobili_multiselect_filtro" id="comuni_immobili_multiselect_filtro">
1086									</div>
1087    							</div>
1088    						</div>
1089    					</div>	
1090    					<div class="accordion-item">
1091    						<h2 class="accordion-header" id="headingAccordionOffcanvasAreeImmobili_filtro">
1092      							<button id="buttonAccordionOffcanvasAreeImmobili_filtro" class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseAccordionOffcanvasAreeImmobili_filtro" aria-expanded="false" aria-controls="collapseAccordionOffcanvasAreeImmobili_filtro">
1093        							Areas of interest      							</button>
1094    						</h2>
1095    						<div id="collapseAccordionOffcanvasAreeImmobili_filtro" class="accordion-collapse collapse" aria-labelledby="headingAccordionOffcanvasAreeImmobili_filtro" data-bs-parent="#accordion_offcanvas">
1096      							<div class="accordion-body">
1097									<div class="locations_immobili_multiselect_filtro" id="aree_immobili_multiselect_filtro">
1098									</div>
1099    							</div>
1100    						</div>
1101    					</div>
1102					</div>
1103				</div>
1104				<div class="tipoFiltroTitle">Budget</div>
1105				<div id="prezzoImmobiliSlider_filtro"></div>
1106				<div class="tipoFiltroTitle">Facility</div>
1107            	<div class="tipoFiltroSubTitle">Bedrooms</div>
1108        		<div id="camereImmobiliSlider_filtro">
1109            		<input id="camere_range_immobili_filtro" type="text"/>
1110            		<input id="camere_da_immobili_filtro" type="hidden" />
1111            		<input id="camere_a_immobili_filtro" type="hidden" />
1112        		</div>
1113        		<br>
1114            	<div class="tipoFiltroSubTitle">Bathrooms</div>
1115        		<div id="bagniImmobiliSlider_filtro">
1116            		<input id="bagni_range_immobili_filtro" type="text"/>
1117            		<input id="bagni_da_immobili_filtro" type="hidden" />
1118            		<input id="bagni_a_immobili_filtro" type="hidden" />
1119        		</div>
1120        		<br>
1121        		<div class="tipoFiltroSubTitle">Surface</div>
1122        		<div id="superficieImmobiliSlider_filtro">
1123            		<input id="superficie_range_immobili_filtro" type="text"/>
1124            		<input id="superficie_da_immobili_filtro" type="hidden" />
1125            		<input id="superficie_a_immobili_filtro" type="hidden" />
1126        		</div>
1127        		<br>
1128        		<div class="tipoFiltroSubTitle">
1129        			<label class="form-check-label" id="checkTerrenoLabelStyleImmobili_filtro" for="terreno_immobiliCheck">Land </label>
1130        			<input class="form-check-input checkStyleImmobili" type="checkbox" id="terreno_immobiliCheck">
1131        		</div>
1132        		<div id="terrenoImmobiliSlider_filtro">
1133            		<input id="terreno_range_immobili_filtro" type="text"/>
1134            		<input id="terreno_da_immobili_filtro" type="hidden" />
1135            		<input id="terreno_a_immobili_filtro" type="hidden" />
1136        		</div>
1137				<div class="tipoFiltroTitle">Conditions</div>
1138                 				<div class="tipoFiltro">
1139                					<div id="condizioni_immobili_filtro">
1140                						<div class="row">
1141                							<div class="col col-lg-4 col-md-6 col-sm-6 col-12 paddingZero">
1142                								<input class="form-check-input checkStyleImmobili filtriImmobiliCheckCondizioni" type="checkbox" value="2" id="condizione_immobileCheck_2_filtro">
1143                								<label class="form-check-label checkLabelStyleImmobili_filtro" for="condizione_immobileCheck_2_filtro">Restored</label>
1144                							</div>
1145                							<div class="col col-lg-4 col-md-6 col-sm-6 col-12 paddingZero">
1146                								<input class="form-check-input checkStyleImmobili filtriImmobiliCheckCondizioni" type="checkbox" value="3" id="condizione_immobileCheck_3_filtro">
1147                								<label class="form-check-label checkLabelStyleImmobili_filtro" for="condizione_immobileCheck_3_filtro">Partially restored</label>
1148                							</div>
1149                							<div class="col col-lg-4 col-md-6 col-sm-6 col-12 paddingZero">
1150                								<input class="form-check-input checkStyleImmobili filtriImmobiliCheckCondizioni" type="checkbox" value="4" id="condizione_immobileCheck_4_filtro">
1151                								<label class="form-check-label checkLabelStyleImmobili_filtro" for="condizione_immobileCheck_4_filtro">Not renovated</label>
1152                							</div>
1153                							<div class="col col-lg-4 col-md-6 col-sm-6 col-12 paddingZero">
1154                								<input class="form-check-input checkStyleImmobili filtriImmobiliCheckCondizioni" type="checkbox" value="1" id="condizione_immobileCheck_1_filtro">
1155                								<label class="form-check-label checkLabelStyleImmobili_filtro" for="condizione_immobileCheck_1_filtro">New</label>
1156                							</div>
1157                						</div>
1158                					</div>
1159                				</div>
1160				<div class="tipoFiltroTitle">Location</div>
1161            	<div class="tipoFiltroCheck">
1162            		<input type="checkbox" class="btn-check filtriImmobiliCheckPosizione" id="collinaImmobiliCheck">
1163            		<label class="btn btn-primary filtriImmobiliCheckLabelPosizione" id="collinaImmobiliCheckLabel" for="collinaImmobiliCheck"><i class="fa-solid fa-mountains"></i> Hill</label>
1164            		<input type="checkbox" class="btn-check filtriImmobiliCheckPosizione" id="pianuraImmobiliCheck">
1165            		<label class="btn btn-primary filtriImmobiliCheckLabelPosizione" id="pianuraImmobiliCheckLabel" for="pianuraImmobiliCheck"><i class="fa-solid fa-sun-plant-wilt"></i> Plain</label>
1166            		<input type="checkbox" class="btn-check filtriImmobiliCheckPosizione" id="vicino_ai_serviziImmobiliCheck">
1167            		<label class="btn btn-primary filtriImmobiliCheckLabelPosizione" id="vicino_ai_serviziImmobiliCheckLabel" for="vicino_ai_serviziImmobiliCheck"><i class="fa-solid fa-shop"></i>
1167 Near the services</label>
1168            		<input type="checkbox" class="btn-check filtriImmobiliCheckPosizione" id="centro_storicoImmobiliCheck">
1169            		<label class="btn btn-primary filtriImmobiliCheckLabelPosizione" id="centro_storicoImmobiliCheckLabel" for="centro_storicoImmobiliCheck"><i class="fa-solid fa-landmark"></i> Historical center</label>
1170            		<input type="checkbox" class="btn-check filtriImmobiliCheckPosizione" id="vicino_al_mareImmobiliCheck">
1171            		<label class="btn btn-primary filtriImmobiliCheckLabelPosizione" id="vicino_al_mareImmobiliCheckLabel" for="vicino_al_mareImmobiliCheck"><i class="fa-solid fa-umbrella-beach"></i> Near the sea</label>
1172            		<input type="checkbox" class="btn-check filtriImmobiliCheckPosizione" id="vicino_al_lagoImmobiliCheck">
1173            		<label class="btn btn-primary filtriImmobiliCheckLabelPosizione" id="vicino_al_lagoImmobiliCheckLabel" for="vicino_al_lagoImmobiliCheck"><i class="fa-solid fa-bench-tree"></i> Near the lake</label>
1174            	</div>
1175				<div class="tipoFiltroTitle">Services</div>
1176            	<div class="tipoFiltroCheck">
1177            		<input type="checkbox" class="btn-check filtriImmobiliCheckServizi" id="piscinaImmobiliCheck">
1178            		<label class="btn btn-primary filtriImmobiliCheckLabelServizi" id="piscinaImmobiliCheckLabel" for="piscinaImmobiliCheck"><i class="fa-solid fa-water-ladder"></i> Swimming pool</label>
1179            		<input type="checkbox" class="btn-check filtriImmobiliCheckServizi" id="recinzioneImmobiliCheck">
1180            		<label class="btn btn-primary filtriImmobiliCheckLabelServizi" id="recinzioneImmobiliCheckLabel" for="recinzioneImmobiliCheck"><i class="fa-solid fa-fence"></i> Fencing</label>
1181            		<input type="checkbox" class="btn-check filtriImmobiliCheckServizi" id="palestraImmobiliCheck">
1182            		<label class="btn btn-primary filtriImmobiliCheckLabelServizi" id="palestraImmobiliCheckLabel" for="palestraImmobiliCheck"><i class="fa-solid fa-dumbbell"></i> Gym</label>
1183            		<input type="checkbox" class="btn-check filtriImmobiliCheckServizi" id="spaImmobiliCheck">
1184            		<label class="btn btn-primary filtriImmobiliCheckLabelServizi" id="spaImmobiliCheckLabel" for="spaImmobiliCheck"><i class="fa-solid fa-spa"></i> SPA</label>
1185            		<input type="checkbox" class="btn-check filtriImmobiliCheckServizi" id="giardinoImmobiliCheck">
1186            		<label class="btn btn-primary filtriImmobiliCheckLabelServizi" id="giardinoImmobiliCheckLabel" for="giardinoImmobiliCheck"><i class="fa-solid fa-flower-daffodil"></i> Garden</label>
1187            		<input type="checkbox" class="btn-check filtriImmobiliCheckServizi" id="area_barbecueImmobiliCheck">
1188            		<label class="btn btn-primary filtriImmobiliCheckLabelServizi" id="area_barbecueImmobiliCheckLabel" for="area_barbecueImmobiliCheck"><i class="fa-solid fa-grill-hot"></i> BBQ area</label>
1189            		<input type="checkbox" class="btn-check filtriImmobiliCheckServizi" id="terrazza_abitabileImmobiliCheck">
1190            		<label class="btn btn-primary filtriImmobiliCheckLabelServizi" id="terrazza_abitabileImmobiliCheckLabel" for="terrazza_abitabileImmobiliCheck"><i class="fa-solid fa-glass-citrus"></i> Livable terrace</label>
1191            		<input type="checkbox" class="btn-check filtriImmobiliCheckServizi" id="ascensoreImmobiliCheck">
1192            		<label class="btn btn-primary filtriImmobiliCheckLabelServizi" id="ascensoreImmobiliCheckLabel" for="ascensoreImmobiliCheck"><i class="fa-solid fa-elevator"></i> Lift</label>
1193            		<input type="checkbox" class="btn-check filtriImmobiliCheckServizi" id="garageImmobiliCheck">
1194            		<label class="btn btn-primary filtriImmobiliCheckLabelServizi" id="garageImmobiliCheckLabel" for="garageImmobiliCheck"><i class="fa-solid fa-garage-car"></i> Garage</label>
1195            		<input type="checkbox" class="btn-check filtriImmobiliCheckServizi" id="strada_accesso_privataImmobiliCheck">
1196            		<label class="btn btn-primary filtriImmobiliCheckLabelServizi" id="strada_accesso_privataImmobiliCheckLabel" for="strada_accesso_privataImmobiliCheck"><i class="fa-solid fa-road-lock"></i> Private access road</label>
1197            		<input type="checkbox" class="btn-check filtriImmobiliCheckServizi" id="allarmeImmobiliCheck">
1198            		<label class="btn btn-primary filtriImmobiliCheckLabelServizi" id="allarmeImmobiliCheckLabel" for="allarmeImmobiliCheck"><i class="fa-solid fa-siren-on"></i> Alarm</label>
1199            		<input type="checkbox" class="btn-check filtriImmobiliCheckServizi" id="arredatoImmobiliCheck">
1200            		<label class="btn btn-primary filtriImmobiliCheckLabelServizi" id="arredatoImmobiliCheckLabel" for="arredatoImmobiliCheck"><i class="fa-solid fa-couch"></i> Furnished</label>
1201            	</div>
1202				<div class="tipoFiltroTitle">
1202State of repair</div>
1203 				<div class="tipoFiltro">
1204					<div id="stato_immobili_filtro">
1205						<div class="row">
1206							<div class="col col-lg-4 col-md-6 col-sm-6 col-12 paddingZero">
1207								<input class="form-check-input checkStyleImmobili" type="checkbox" id="vendutoImmobiliCheck">
1208								<label class="form-check-label checkLabelStyleImmobili_filtro" for="vendutoImmobiliCheck">Sold</label>
1209							</div>
1210							<div class="col col-lg-4 col-md-6 col-sm-6 col-12 paddingZero">
1211								<input class="form-check-input checkStyleImmobili" type="checkbox" id="in_trattativaImmobiliCheck">
1212								<label class="form-check-label checkLabelStyleImmobili_filtro" for="in_trattativaImmobiliCheck">under negotiation</label>
1213							</div>
1214							<div class="col col-lg-4 col-md-6 col-sm-6 col-12 paddingZero">
1215								<input class="form-check-input checkStyleImmobili" type="checkbox" id="nuovo_sul_mercatoImmobiliCheck">
1216								<label class="form-check-label checkLabelStyleImmobili_filtro" for="nuovo_sul_mercatoImmobiliCheck">New on the market</label>
1217							</div>
1218							<!--  
1219							<div class="col col-lg-4 col-md-6 col-sm-6 col-12 paddingZero">
1220								<input class="form-check-input checkStyleImmobili" type="checkbox" id="alta_motivazioneImmobiliCheck">
1221								<label class="form-check-label checkLabelStyleImmobili_filtro" for="alta_motivazioneImmobiliCheck">High motivation</label>
1222							</div>
1223							<div class="col col-lg-4 col-md-6 col-sm-6 col-12 paddingZero">
1224								<input class="form-check-input checkStyleImmobili" type="checkbox" id="veloce_tempisticaImmobiliCheck">
1225								<label class="form-check-label checkLabelStyleImmobili_filtro" for="veloce_tempisticaImmobiliCheck">Short timing</label>
1226							</div>
1227							-->
1228						</div>
1229					</div>
1230				</div>
1231				<!-- 
1232				<div class="tipoFiltroTitle">Feedback</div>
1233            	<div class="tipoFiltroCheck">
1234            		<input type="checkbox" class="btn-check filtriImmobiliCheckValutazione" id="super_prezzoImmobiliCheck">
1235            		<label class="btn btn-primary filtriImmobiliCheckLabelValutazione" id="super_prezzoImmobiliCheckLabel" for="super_prezzoImmobiliCheck"><i class="fa-solid fa-percent"></i><span class="iconWithNumberBaseline">(x3)</span> Super price</label>
1236            		<input type="checkbox" class="btn-check filtriImmobiliCheckValutazione" id="ottimo_prezzoImmobiliCheck">
1237            		<label class="btn btn-primary filtriImmobiliCheckLabelValutazione" id="ottimo_prezzoImmobiliCheckLabel" for="ottimo_prezzoImmobiliCheck"><i class="fa-solid fa-percent"></i><span class="iconWithNumberBaseline">(x2)</span> Excellent price</label>
1238            		<input type="checkbox" class="btn-check filtriImmobiliCheckValutazione" id="buon_prezzoImmobiliCheck">
1239            		<label class="btn btn-primary filtriImmobiliCheckLabelValutazione" id="buon_prezzoImmobiliCheckLabel" for="buon_prezzoImmobiliCheck"><i class="fa-solid fa-percent"></i><span class="iconWithNumberBaseline">(x1)</span> Good price</label>
1240            	</div>
1241            	-->
1242				<div class="tipoFiltroTitle">Media</div>
1243 				<div class="tipoFiltro">
1244					<div id="media_immobili_filtro">
1245						<div class="row">
1246							<div class="col col-lg-4 col-md-6 col-sm-6 col-12 paddingZero">
1247								<input class="form-check-input checkStyleImmobili filtriImmobiliCheckMedia" type="checkbox" id="virtual_tourImmobiliCheck">
1248								<label class="form-check-label checkLabelStyleImmobili_filtro" for="virtual_tourImmobiliCheck">Virtual Tour</label>
1249							</div>
1250							<div class="col col-lg-4 col-md-6 col-sm-6 col-12 paddingZero">
1251								<input class="form-check-input checkStyleImmobili filtriImmobiliCheckMedia" type="checkbox" id="video_professionaleImmobiliCheck">
1252								<label class="form-check-label checkLabelStyleImmobili_filtro" for="video_professionaleImmobiliCheck">Professional video</label>
1253							</div>
1254							<div class="col col-lg-4 col-md-6 col-sm-6 col-12 paddingZero">
1255								<input class="form-check-input checkStyleImmobili filtriImmobiliCheckMedia" type="checkbox" id="video_amatorialeImmobiliCheck">
1256								<label class="form-check-label checkLabelStyleImmobili_filtro" for="video_amatorialeImmobiliCheck">Amateur Video</label>
1257							</div>
1258						</div>
1259					</div>
1260				</div>	
1261            </div>
1262            <div class="tab-pane fade position-relative" id="affittaBarOffcanvas" role="tabpanel" aria-labelledby="affittaTabOffcanvas">
1263				<div id="colRicercaLiberaAlloggiMobileDiv">
1264                    <div id="colRicercaLiberaAlloggiMobile">
1265                  		<input aria-label="Free search" form="formSubmitCercaAlloggi" name="ricercalibera" type="input" class="form-control" id="ricerca_liberaAlloggiMobile" value="">
1266                  		<i class="fa fa-search"></i>
1267                    </div>
1268                    <button type="submit" class="btn btn-primary text-uppercase buttonSlugAlloggi btnCercaAlloggi" onclick="submitCercaAlloggi('luxury-rentals-search.html', true)">Search</button>
1269				</div>
1270				<div style="position: relative;">
1271                	<div class="tipoFiltroTitle">Typology</div>
1272    				<div class="tipoFiltroAll">
1273    					<input class="form-check-input checkStyleAlloggi" type="checkbox" id="tipologie_alloggiCheckAll_filtro">
1274    					<label class="form-check-label checkAllLabelStyleAlloggi_filtro" for="tipologie_alloggiCheckAll_filtro">All</label>
1275    				</div>
1276     				<div class="tipoFiltro">
1277    					<div id="tipologie_alloggi_filtro"></div>
1278    				</div>       
1279    			</div>  
1280				<div class="position-relative">
1281    				<div class="tipoFiltroTitle">Location</div>
1282    				<div class="tipoFiltroAll">
1283    					<input class="form-check-input checkStyleAlloggi" type="checkbox" id="aree_alloggiCheckAll_filtro">
1284    					<label class="form-check-label checkAllLabelStyleAlloggi_filtro" for="aree_alloggiCheckAll_filtro">All</label>
1285    				</div>
1286                	<div class="tipoFiltro">
1287                		<div id="aree_alloggi_filtro"></div>
1288                	</div>
1289				</div>   	
1290				<div class="tipoFiltroTitle">Budget</div>
1291				<div id="prezzoAlloggiSlider_filtro"></div>
1292				<div class="tipoFiltroTitle">Dates</div>
1293				<div id="tipoFiltroDate" class="position-relative">
1294            		<input type="text" id="daterange_alloggi_filtro" value="" class="form-control" readonly placeholder="When do you wish to go?">
1295            	</div>
1296				<div class="tipoFiltroTitle">Guests</div>
1297            	<div id="tipoFiltroOspitiAlloggi" class="position-relative">
1298                    <div class="input-group my-0">
1299                    	<button id="button-minus_filtro" class="btn" type="button"><i class="fa-solid fa-minus"></i></button>
1300            			<input id="ospitiAlloggiInputNumber_filtro" class="ospitiAlloggiInputNumberModal" type="number" value="0" min="0" placeholder="How many" oninput="this.value = Math.abs(this.value)" readonly>
1301            			<button id="button-plus_filtro" class="btn" type="button"><i class="fa-solid fa-plus"></i></button>
1302                    </div>
1303            	</div>
1304				<div class="tipoFiltroTitle">Facility</div>
1305            	<div class="tipoFiltroSubTitle">Bedrooms</div>
1306        		<div id="camereAlloggiSlider_filtro">
1307            		<input id="camere_range_alloggi_filtro" type="text"/>
1308            		<input id="camere_da_alloggi_filtro" type="hidden" />
1309            		<input id="camere_a_alloggi_filtro" type="hidden" />
1310        		</div>
1311        		<br>
1312            	<div class="tipoFiltroSubTitle">Bathrooms</div>
1313        		<div id="bagniAlloggiSlider_filtro">
1314            		<input id="bagni_range_alloggi_filtro" type="text"/>
1315            		<input id="bagni_da_alloggi_filtro" type="hidden" />
1316            		<input id="bagni_a_alloggi_filtro" type="hidden" />
1317        		</div>
1318				<div class="tipoFiltroTitle">Services</div>
1319            	<div class="tipoFiltroCheck">
1320            		<input type="checkbox" class="btn-check filtriAlloggiCheckServizi" id="animals_allowedAlloggiCheck">
1321            		<label class="btn btn-primary filtriAlloggiCheckLabelServizi" id="animals_allowedAlloggiCheckLabel" for="animals_allowedAlloggiCheck"><i class="fa-solid fa-paw"></i> Take your pet</label>
1322            		<input type="checkbox" class="btn-check filtriAlloggiCheckServizi" id="saunaAlloggiCheck">
1323            		<label class="btn btn-primary filtriAlloggiCheckLabelServizi" id="saunaAlloggiCheckLabel" for="saunaAlloggiCheck"><i class="fa-solid fa-heat"></i> Sauna</label>
1324            		<input type="checkbox" class="btn-check filtriAlloggiCheckServizi" id="golfAlloggiCheck">
1325            		<label class="btn btn-primary filtriAlloggiCheckLabelServizi" id="golfAlloggiCheckLabel" for="golfAlloggiCheck"><i class="fa-solid fa-golf-flag-hole"></i> Golf course</label>
1326            		<input type="checkbox" class="btn-check filtriAlloggiCheckServizi" id="poolAlloggiCheck">
1327            		<label class="btn btn-primary filtriAlloggiCheckLabelServizi" id="poolAlloggiCheckLabel" for="poolAlloggiCheck"><i class="fa-solid fa-water-ladder"></i> Swimming pool</label>
1328            		<input type="checkbox" class="btn-check filtriAlloggiCheckServizi" id="jacuzziAlloggiCheck">
1329            		<label class="btn btn-primary filtriAlloggiCheckLabelServizi" id="jacuzziAlloggiCheckLabel" for="jacuzziAlloggiCheck"><i class="fa-solid fa-hot-tub-person"></i> Jacuzzi</label>
1330            		<input type="checkbox" class="btn-check filtriAlloggiCheckServizi" id="tennisAlloggiCheck">
1331            		<label class="btn btn-primary filtriAlloggiCheckLabelServizi" id="tennisAlloggiCheckLabel" for="tennisAlloggiCheck"><i class="fa-solid fa-tennis-ball"></i> Tennis court</label>
1332            		<input type="checkbox" class="btn-check filtriAlloggiCheckServizi" id="bikeAlloggiCheck">
1333            		<label class="btn btn-primary filtriAlloggiCheckLabelServizi" id="bikeAlloggiCheckLabel" for="bikeAlloggiCheck"><i class="fa-solid fa-bicycle"></i> Bicycle</label>
1334            		<input type="checkbox" class="btn-check filtriAlloggiCheckServizi" id="gymAlloggiCheck">
1335            		<label class="btn btn-primary filtriAlloggiCheckLabelServizi" id="gymAlloggiCheckLabel" for="gymAlloggiCheck"><i class="fa-solid fa-dumbbell"></i> Gym</label>
1336            		<input type="checkbox" class="btn-check filtriAlloggiCheckServizi" id="wifiAlloggiCheck">
1337            		<label class="btn btn-primary filtriAlloggiCheckLabelServizi" id="wifiAlloggiCheckLabel" for="wifiAlloggiCheck"><i class="fa-solid fa-wifi"></i> Wi-Fi</label>
1338            		<input type="checkbox" class="btn-check filtriAlloggiCheckServizi" id="smart_workingAlloggiCheck">
1339            		<label class="btn btn-primary filtriAlloggiCheckLabelServizi" id="smart_workingAlloggiCheckLabel" for="smart_workingAlloggiCheck"><i class="fa-solid fa-house-laptop"></i> Smart-working space</label>
1340            		<input type="checkbox" class="btn-check filtriAlloggiCheckServizi" id="barrier_freeAlloggiCheck">
1341            		<label class="btn btn-primary filtriAlloggiCheckLabelServizi" id="barrier_freeAlloggiCheckLabel" for="barrier_freeAlloggiCheck"><i class="fa-solid fa-wheelchair-move"></i> Barrier-Free</label>
1342            		<input type="checkbox" class="btn-check filtriAlloggiCheckServizi" id="fenced_gardenAlloggiCheck">
1343            		<label class="btn btn-primary filtriAlloggiCheckLabelServizi" id="fenced_gardenAlloggiCheckLabel" for="fenced_gardenAlloggiCheck"><i class="fa-solid fa-fence"></i> Enclosed garden</label>
1344            		<input type="checkbox" class="btn-check filtriAlloggiCheckServizi" id="air_c
1344onditionedAlloggiCheck">
1345            		<label class="btn btn-primary filtriAlloggiCheckLabelServizi" id="air_conditionedAlloggiCheckLabel" for="air_conditionedAlloggiCheck"><i class="fa-solid fa-air-conditioner"></i> Air conditioning</label>
1346            		<input type="checkbox" class="btn-check filtriAlloggiCheckServizi" id="safe_for_kidsAlloggiCheck">
1347            		<label class="btn btn-primary filtriAlloggiCheckLabelServizi" id="safe_for_kidsAlloggiCheckLabel" for="safe_for_kidsAlloggiCheck"><i class="fa-solid fa-baby-carriage"></i> Equipped for children</label>
1348            		<input type="checkbox" class="btn-check filtriAlloggiCheckServizi" id="eco_friendlyAlloggiCheck">
1349            		<label class="btn btn-primary filtriAlloggiCheckLabelServizi" id="eco_friendlyAlloggiCheckLabel" for="eco_friendlyAlloggiCheck"><i class="fa-solid fa-leaf-heart"></i> Eco-friendly</label>
1350            		<input type="checkbox" class="btn-check filtriAlloggiCheckServizi" id="fireplaceAlloggiCheck">
1351            		<label class="btn btn-primary filtriAlloggiCheckLabelServizi" id="fireplaceAlloggiCheckLabel" for="fireplaceAlloggiCheck"><i class="fa-solid fa-fireplace"></i> Fireplace</label>
1352            	</div>
1353				<div class="tipoFiltroTitle">Must Have</div>
1354            	<div class="tipoFiltroCheck">
1355            		<input type="checkbox" class="btn-check filtriAlloggiCheckMustHave" id="nearTheSeaAlloggiCheck" value="custom_u12">
1356            		<label class="btn btn-primary filtriAlloggiCheckLabelMustHave" id="nearTheSeaAlloggiCheckLabel" for="nearTheSeaAlloggiCheck"><i class="fa-solid fa-umbrella-beach"></i> Near the sea</label>
1357            		<input type="checkbox" class="btn-check filtriAlloggiCheckMustHave" id="closeToTownAlloggiCheck" value="custom_u13">
1358            		<label class="btn btn-primary filtriAlloggiCheckLabelMustHave" id="closeToTownAlloggiCheckLabel" for="closeToTownAlloggiCheck"><i class="fa-solid fa-house-building"></i> Close to town</label>
1359            		<input type="checkbox" class="btn-check filtriAlloggiCheckMustHave" id="gorgeousViewAlloggiCheck" value="custom_u14">
1360            		<label class="btn btn-primary filtriAlloggiCheckLabelMustHave" id="gorgeousViewAlloggiCheckLabel" for="gorgeousViewAlloggiCheck"><i class="fa-solid fa-mountain-sun"></i> Gorgeous view</label>
1361            		<input type="checkbox" class="btn-check filtriAlloggiCheckMustHave" id="farFromAllAlloggiCheck" value="custom_u15">
1362            		<label class="btn btn-primary filtriAlloggiCheckLabelMustHave" id="farFromAllAlloggiCheckLabel" for="farFromAllAlloggiCheck"><i class="fa-solid fa-trees"></i> Far from all</label>
1363            		<input type="checkbox" class="btn-check filtriAlloggiCheckMustHave" id="wonderfulGardenAlloggiCheck" value="custom_u16">
1364            		<label class="btn btn-primary filtriAlloggiCheckLabelMustHave" id="wonderfulGardenAlloggiCheckLabel" for="wonderfulGardenAlloggiCheck"><i class="fa-solid fa-flower-daffodil"></i> Wonderful garden</label>
1365            		<input type="checkbox" class="btn-check filtriAlloggiCheckMustHave" id="spaAlloggiCheck" value="custom_u17">
1366            		<label class="btn btn-primary filtriAlloggiCheckLabelMustHave" id="spaAlloggiCheckLabel" for="spaAlloggiCheck"><i class="fa-solid fa-spa"></i> SPA</label>
1367            		<input type="checkbox" class="btn-check filtriAlloggiCheckMustHave" id="cozyInWinterAlloggiCheck" value="custom_u18">
1368            		<label class="btn btn-primary filtriAlloggiCheckLabelMustHave" id="cozyInWinterAlloggiCheckLabel" for="cozyInWinterAlloggiCheck"><i class="fa-solid fa-mug-hot"></i> Cozy in Winter</label>
1369            		<input type="checkbox" class="btn-check filtriAlloggiCheckMustHave" id="forFoodiesAlloggiCheck" value="custom_u19">
1370            		<label class="btn btn-primary filtriAlloggiCheckLabelMustHave" id="forFoodiesAlloggiCheckLabel" for="forFoodiesAlloggiCheck"><i class="fa-solid fa-plate-utensils"></i> For Foodies</label>
1371            		<input type="checkbox" class="btn-check filtriAlloggiCheckMustHave" id="weddingVenueAlloggiCheck" value="custom_u20">
1372            		<label class="btn btn-primary filtriAlloggiCheckLabelMustHave" id="weddingVenueAlloggiCheckLabel" for="weddingVenueAlloggiCheck"><i class="fa-solid fa-rings-wedding"></i> Wedding Venue</label>
1373            	</div>
1374				<div class="tipoFiltroTitle">Media</div>
1375				<div class="tipoFiltro">
1376                	<div class="row">
1377                		<div class="col col-lg-4 col-md-6 col-sm-6 col-12 paddingZero">
1378                			<input class="form-check-input checkStyleAlloggi"  type="checkbox" id="virtual_tourAlloggiCheck">
1379                			<label class="form-check-label checkLabelStyleAlloggi_filtro" for="virtual_tourAlloggiCheck">Virtual Tour</label>
1380                		</div>
1381                		<div class="col col-lg-4 col-md-6 col-sm-6 col-12 paddingZero">
1382                			<input class="form-check-input checkStyleAlloggi"  type="checkbox" id="videoAlloggiCheck">
1383                			<label class="form-check-label checkLabelStyleAlloggi_filtro" for="videoAlloggiCheck">Video</label>
1384                		</div>
1385                	</div>
1386            	</div>
1387			</div>
1388		</div>	
1389	</div>
1390  	<div class="offcanvas-footer">
1391		<div id="left" >
1392			<div class="leftAlloggi"><span onclick="resetFiltriAlloggi(); resetFiltriImmobili();">Remove all filters</span></div>
1393			<div class="leftImmobili"><span onclick="resetFiltriImmobili(); resetFiltriAlloggi();">Remove all filters</span></div>
1394		</div>
1395		<div id="right">
1396			<button id="btnCercaFiltriAlloggi" type="submit" class="btn btn-primary text-uppercase buttonSlugAlloggi" onclick="submitCercaAlloggi('luxury-rentals-search.html', true)"></button>
1397    		          		<button id="btnCercaFiltriImmobili" type="submit" class="btn btn-primary buttonGreenBgWhite text-uppercase buttonSlugImmobili" onclick="submitCercaImmobili('prestigious-property-search.html', true)"></button>
1398            		</div>   
1399  	</div>
1400</div>
1401    
1402    <div class="container">
1403    	<div id="testoPageSearchCustom" class="hidden"></div>
1404    </div>
1405    
1406    <div class="container headerList position-relative" id="headerListAlloggi">
1407    	<div class="row">
1408    		<div class="col-lg-6 col-md-6 col-sm-6 col-6 pt-4 pb-2">
1409    			<button class="button_tipi_vista_lista_alloggi" id="button_tipo_vista_lista_1" onclick="listaAlloggi(1, 1, 0, session_ordinamento_lista_risultati_gbl, false);"><i id="tipo_vista_lista_1" class="tipi_vista_lista_alloggi fa-solid fa-list"></i><div class="div_tipi_vista_lista_alloggi">List</div></button>
1410        		<button class="button_tipi_vista_lista_alloggi" id="button_tipo_vista_lista_2" onclick="listaAlloggi(2, 1, 0, session_ordinamento_lista_risultati_gbl, false);"><i id="tipo_vista_lista_2" class="tipi_vista_lista_alloggi fa-solid fa-border-all"></i><div class="div_tipi_vista_lista_alloggi">Grid</div></button>
1411        		<button class="button_tipi_vista_lista_alloggi" id="button_tipo_vista_lista_3" onclick="listaAlloggi(3, 1, 0, session_ordinamento_lista_risultati_gbl, false);"><i id="tipo_vista_lista_3" class="tipi_vista_lista_alloggi fa-solid fa-map-location"></i><div class="div_tipi_vista_lista_alloggi">Map</div></button>
1412        		
1413        		<div id="button_view_mobile"></div>
1414        	</div>
1415        	<div class="col-lg-6 col-md-6 col-sm-6 col-6 pt-4 pb-2 text-end">
1416        		<div id="risultatiPerPaginaDiv">
1417        			<div class="headerListLabel"><span>Show&nbsp;</span></div>
1418                    <div class="dropdown dropdownMenuHeaderList dropdownMenuHeaderList2">
1419                      	<button id="menu_numero_risultati_per_paginaBtn" class="dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
1420                      	</button>
1421                      	<ul id="menu_numero_risultati_per_paginaList" class="dropdown-menu dropdown-menu-lg-end">
1422                      	</ul>
1423                    </div>
1424        			<!-- <button id="button_sort_mobile" data-bs-toggle="modal" data-bs-target="#sortMobile"></button> -->
1425        		</div>
1426        		<div id="ordinamentoDiv">
1427        			<div class="headerListLabel"><span>Sort by&nbsp;</span></div>
1428                    <div class="dropdown dropdownMenuHeaderList">
1429                      	<button id="menu_ordinamentiBtn" class="dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
1430                      	</button>
1431                      	<ul class="dropdown-menu dropdown-menu-lg-end">
1432                            <li><a href="#" class="dropdown-item tipi_ordinamenti" id="button_ordinamento_1" onclick="listaAlloggi(session_tipo_vista_lista_gbl, 1, session_index_numero_risultati_per_pagina_gbl, 1, false);"><i id="tipo_ordinamento_1" class="tipi_ordinamenti fa-solid fa-wand-magic-sparkles active"></i><div>Recommended</div></a></li>
1433                            <li><a href="#" class="dropdown-item tipi_ordinamenti" id="button_ordinamento_2" onclick="listaAlloggi(session_tipo_vista_lista_gbl, 1, session_index_numero_risultati_per_pagina_gbl, 2, false);"><i id="tipo_ordinamento_2" class="tipi_ordinamenti fa-solid fa-circle-dollar"></i><div>Lowest price</div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i id="tipo_ordinamento_2_2" class="tipi_ordinamenti sort fa-solid fa-arrow-up"></i></a></li>
1434                            <li><a href="#" class="dropdown-item tipi_ordinamenti" id="button_ordinamento_3" onclick="listaAlloggi(session_tipo_vista_lista_gbl, 1, session_index_numero_risultati_per_pagina_gbl, 3, false);"><i id="tipo_ordinamento_3" class="tipi_ordinamenti fa-solid fa-circle-dollar"></i><div>Highest price</div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i id="tipo_ordinamento_3_3" class="tipi_ordinamenti sort fa-solid fa-arrow-down"></i></a></li>
1435                        </ul>
1436                    </div>
1437        			<button id="button_sort_mobile" data-bs-toggle="modal" data-bs-target="#sortMobile"></button>
1438        		</div>
1439        	</div>
1440    	</div>
1441    	<div class="row">
1442            <div class="filtriDiv" id="filtriDivAlloggi">
1443            </div>
1444    	</div>
1445    	<div class="row">
1446            <div class="mustHaveDiv" id="mustHaveDivAlloggi">
1447            </div>
1448    	</div>
1449    	<div class="row">
1450    		<div class="col-lg-12 col-md-12"><hr></div>
1451    	</div>
1452    </div>
1453    <div class="container">
1454    	<h1 id="numeroAlloggiTrovati"></h1>
1455    </div>
1456    <div class="container">
1457    	<ol id="breadcrumbs" class="hidden">
1458    		<li><a href="https://www.greatestate.it/en/index.html">Home</a></li>
1459    		<li><a href="https://www.greatestate.it/en/luxury-rentals-search.html">for rent</a></li>
1460    				</ol>
1461    </div>
1462	
1463    <div class="container" id="alloggiList">
1464    </div>
1465    <div class="container" id="alloggiListGrid">
1466    </div>
1467    <div class="container" id="alloggiListMap">
1468    	<div class="row hidden" id="alloggiListMapHeader">
1469        	<div class="col-lg-4 col-md-3 pt-2 pb-2 d-none d-lg-block">
1470            	<input class="form-check-input checkStyleAlloggi" type="checkbox" id="risultatiInMappaCheck">
1471            	<label class="form-check-label checkLabelStyleAlloggi" for="risultatiInMappaCheck">Show only properties visible on the map</label>
1472        		<div id="listMap"></div>
1473        	</div>
1474        	<div class="col-lg-8 col-md-12 pt-2 pb-2">
1475        		<p class="coordinateProtetteAlloggi"><b>Protected coordinates</b> - The actual location of the property will be communicated to you at the time of the booking confirmation</p>
1476        		<div class="position-relative">
1477            		<div id="resetMap" onClick="resetMap()">Reset zoom</div>
1478            		<div id="map"></div>
1479        		</div>
1480        	</div>
1481        </div>
1482    </div>
1483    
1484    <div class="container" id="paginationContainer">
1485    	<div class="row">
1486    		<div class="py-3">
1487    			<nav>
1488    				<ul id="pagination" class="pagination paginationAlloggi pagination-lg justify-content-center">
1489    				</ul>
1490    			</nav>
1491    		</div>
1492    	</div>
1493    </div>
1494
1495	<div id="sortMobile" class="modal fade viewAndSortMobile" tabindex="-1" aria-hidden="true">
1496      	<div class="modal-dialog modal-dialog-centered">
1497        	<div class="modal-content">
1498          		<div class="modal-body text-center" id="ordinamentoDivMobile">
1499					<div><button class="button_ordinamenti_alloggi_mobile" id="button_ordinamento_mobile_1" onclick="listaAlloggi(session_tipo_vista_lista_gbl, 1, session_index_numero_risultati_per_pagina_gbl, 1, false);"><i id="tipo_ordinamento_mobile_1" class="tipi_ordinamenti_mobile fa-solid fa-wand-magic-sparkles active"></i><div class="nomi_ordinamenti_mobile">Recommended</button></div>
1500    				<div><button class="button_ordinamenti_alloggi_mobile" id="button_ordinamento_mobile_2" onclick="listaAlloggi(session_tipo_vista_lista_gbl, 1, session_index_numero_risultati_per_pagina_gbl, 2, false);"><i id="tipo_ordinamento_mobile_2"  class="tipi_ordinamenti_mobile fa-solid fa-circle-dollar"></i><div class="nomi_ordinamenti_mobile">Lowest price</div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i id="tipo_ordinamento__mobile_2_2"class="tipi_ordinamenti_mobile sort fa-solid fa-arrow-up"></i></button></div>
1501    				<div><button class="button_ordinamenti_alloggi_mobile" id="button_ordinamento_mobile_3" onclick="listaAlloggi(session_tipo_vista_lista_gbl, 1, session_index_numero_risultati_per_pagina_gbl, 3, false);"><i id="tipo_ordinamento_mobile_3" class="tipi_ordinamenti_mobile fa-solid fa-circle-dollar"></i><div class="nomi_ordinamenti_mobile">Highest price</div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i id="tipo_ordinamento__mobile_3_3" class="tipi_ordinamenti_mobile sort fa-solid fa-arrow-down"></i></button></div>
1502          		</div>
1503        	</div>
1504      	</div>
1505    </div>
1506
1507    <div id="modal-richiedi-info-pagine-ricerca" class="modal fade" tabindex='-1'>
1508      	<div class="modal-dialog modal-lg modal-dialog-centered modal
1508-fullscreen-sm-down modal-dialog-scrollable">
1509        	<div class="modal-content">
1510          		<div class="modal-header">
1511          			<h5 class="modal-title" id="titolo_alloggio_modal"></h5>
1512            		<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
1513          		</div>
1514          		<div class="modal-body">
1515          			<div class="row">
1516              			<div class="col-8" id="left">
1517    						<form id="richiedi_info_pagine_ricerca_alloggi_form" class="row formStyle g-3" autocomplete="off" novalidate>
1518                              	<div class="col-lg-6 col-md-6 col-12">
1519                                	<label for="nome" class="form-label">Name</label>
1520                                	<input type="text" class="form-control" id="nome" placeholder="enter your name" value="">
1521                              	</div>
1522                              	<div class="col-lg-6 col-md-6 col-12">
1523                                	<label for="cognome" class="form-label">Last Name</label>
1524                                	<input type="text" class="form-control" id="cognome" placeholder="enter your last name" value="">
1525                              	</div>
1526                              	<div class="col-lg-6 col-md-6 col-12">
1527                                	<label for="telefono" class="form-label">Phone</label>
1528                                	<input type="tel" class="form-control" id="telefono" placeholder="enter your telephone number followed by the country code">
1529                                	<p id="telefonoWrong" class="wrongFieldForm hidden">Invalid phone</p>
1530                              	</div>
1531                				<div class="col-lg-6 col-md-6 col-12">
1532                					<label for="email" class="form-label">Email</label>
1533                					<input type="email" class="form-control" id="email" placeholder="Enter your email" value="">
1534                					<p id="emailWrong" class="wrongFieldForm hidden">Invalid email</p>
1535                				</div>
1536                              	<!--  
1537                              	<div class="col-12">
1538                					<label for="oggetto" class="form-label">Subject</label>
1539                					<input type="text" class="form-control" id="oggetto" placeholder="" value="">
1540                              	</div>
1541                              	-->
1542                              	<div class="col-12">
1543                					<label for="messaggio" class="form-label">Message</label>
1544                					<textarea rows="3" class="form-control" id="messaggio"></textarea>
1545                              	</div>
1546                              	<div class="col-12 form-check position-relative text-center custom_display">
1547                                    <input class="form-check-input checkStyle accetta_privacy" type="checkbox" value="" id="accetta_privacy" name="accetta_privacy">
1548                                    <label class="form-check-label checkLabelStyle accetta_privacyLabel" for="accetta_privacy" id="accetta_privacyLabel">
1549                                        I have read and accepted the <a target="_blank" href="privacy.html">privacy policy</a> and I authorize my personal data processing                                    </label>
1550                              	</div>
1551                                                                  	<div class="col-12 text-center">
1552                    					<div class="g-recaptcha recapForm" data-sitekey="6LfDluQoAAAAAMecTfW0UpSKnSPpoVLFEyStbFnp"></div>
1553                    					<p id="recaptchaWrong" class="hidden">Prove you're not a robot</p>
1554                                  	</div>
1555                                  
1556                              	<div class="col-12 text-center mt-0">
1557                              		<input type="hidden" id="id_alloggio_richiedi_info" value="en">
1558                              		<input type="hidden" id="lingua_sito_richiedi_info" value="en">
1559                                    <input type="hidden" id="nome_alloggio_richiedi_info" value="">
1560                                    <input type="hidden" id="link_alloggio_richiedi_info" value="">
1561                                    <input type="hidden" id="prezzo_alloggio_richiedi_info" value="">
1562                                    <input type="hidden" id="foto_alloggio_richiedi_info" value="">
1563                                    <input type="hidden" id="location_alloggio_richiedi_info" value="">
1564                              		<button type="submit" class="btn btn-primary buttonGreenBgWhite">Ask for information</button>
1565                              	</div>
1566                			</form>	
1567              			</div>
1568              			<div class="col-4" id="right">
1569              				<div class="nome_annuncio_modal"></div>
1570              				<div class="rif_annuncio_modal"></div>
1571              				<div class="prezzo_annuncio_modal"></div>
1572              				<div class="tipologia_annuncio_modal"></div>
1573              				<img alt="" class="foto_annuncio_modal w-100 mt-1" src="">
1574              			</div>
1575              		</div>
1576          		</div>
1577        	</div>
1578      	</div>
1579    </div>
1580
1581    <footer id="footer" class="footer mt-auto">
1582    <div class="container">
1583    	<footer class="py-2">
1584    		<div class="row">
1585    		
1586    			    			
1587                    <div class="col-lg-4 linkFooter">
1588            			<ul class="nav flex-column">
1589                          	<li class="nav-item">
1590                              	<div id="socialIconsFooter">
1591                            		<a id="facebook" aria-label="Facebook Great Estate profile" class="btn btn-primary share_button text-uppercase" target="_blank" href="https://www.facebook.com/GreatEstate.ItalianProperties">
1592                            			<div id="facebook_icon"></div>
1593                            		</a>  
1594                            		<a id="instagram" aria-label="Instagram Great Estate profile" class="btn btn-primary share_button text-uppercase" target="_blank" href="https://www.instagram.com/greatestate.it">
1595                            			<div id="instagram_icon"></div>
1596                            		</a>  
1597                            		<a id="linkedin" aria-label="Linkedin Great Estate profile" class="btn btn-primary share_button text-uppercase" target="_blank" href="https://www.linkedin.com/company/greatestate-it">
1598                            			<div id="linkedin_icon"></div>
1599                            		</a> 
1600                            		<a id="twitter" aria-label="Twitter Great Estate profile" class="btn btn-primary share_button text-uppercase" target="_blank" href="https://twitter.com/greatestateit">
1601                            			<div id="twitter_icon"></div>
1602                            		</a> 
1603                            		<a id="youtube" aria-label="Youtube Great Estate profile" class="btn btn-primary share_button text-uppercase" target="_blank" href="https://www.youtube.com/user/GreatEstateProperty">
1604                            			<div id="youtube_icon"></div>
1605                            		</a> 
1606                            		<a id="pinterest" aria-label="Pinterest Great Estate profile" class="btn btn-primary share_button text-uppercase" target="_blank" href="https://pin.it/7iWynqJSJ">
1607                            			<div id="pinterest_icon"></div>
1608                            		</a> 
1609                              	</div>
1610							</li>
1611            			</ul>
1612                    </div>
1613                    <div class="col-lg-8 linkFooter">
1614                    	<div class="row">
1615                    		<div class="col-lg-4">
1616                              	<ul class="nav flex-column">
1617                              		<li class="nav-item"><a href="https://www.greatestate.it/en/terms-and-conditions.html" class="nav-link p-0 text-uppercase">Terms and conditions</a></li>
1618                                  	<li class="nav-item"><a href="https://www.greatestate.it/en/privacy.html" class="nav-link p-0 text-uppercase">Privacy</a></li>
1619                                  	<li class="nav-item"><a href="https://www.greatestate.it/en/cookie-policy.html" class="nav-link p-0 text-uppercase">Cookie</a></li>
1620                              	</ul>
1621                    		</div>
1622                    		<div class="col-lg-4">
1623                    			<ul class="nav flex-column">
1624                                    <li class="nav-item"><a href="https://www.greatestate.it/en/contact.html" class="nav-link p-0 text-uppercase">Contacts</a></li>
1625                            			
1626                            	        <li class="nav-item"><a href="https://www.greatestate.it/en/login.html" class="nav-link p-0 text-uppercase">Reserved area</a></li> 
1627                            		  
1628                                    <li class="nav-item"><a href="https://www.greatestate.it/en/mapsite.html" class="nav-link p-0 text-uppercase">Website map</a></li>
1629                                </ul>
1630                    		</div>
1631                    		<div class="col-lg-4">
1632                    			<ul class="nav flex-column">
1633                    				<li class="nav-item"><a href="https://www.greatestate.it/en/press-office.html" class="nav-link p-0 text-uppercase">Press Office</a></li>
1634                                                                        	<li class="nav-item"><a href="https://magazine.greatestate.it" class="nav-link p-0 text-uppercase">Magazine</a></li>
1635                                    	
1636                    			</ul>
1637                    		</div>
1638                    	</div>
1639                    </div>
1640                
1641                                
1642                <hr>
1643                
1644                <div id="linkFooterSocialMobile">
1645                  	<div id="socialIconsFooter">
1646                		<a id="facebook" aria-label="Facebook Great Estate profile" class="btn btn-primary share_button text-uppercase" target="_blank" href="https://www.facebook.com/GreatEstate.ItalianProperties">
1647                			<div id="facebook_icon"></div>
1648                		</a>  
1649                		<a id="instagram" aria-label="Instagram Great Estate profile" class="btn btn-primary share_button text-uppercase" target="_blank" href="https://www.instagram.com/greatestate.it">
1650                			<div id="instagram_icon"></div>
1651                		</a>  
1652                		<a id="linkedin" aria-label="Linkedin Great Estate profile" class="btn btn-primary share_button text-uppercase" target="_blank" href="https://www.linkedin.com/company/greatestate-it">
1653                			<div id="linkedin_icon"></div>
1654                		</a> 
1655                		<a id="twitter" aria-label="Twitter Great Estate profile" class="btn btn-primary share_button text-uppercase" target="_blank" href="https://twitter.com/greatestateit">
1656                			<div id="twitter_icon"></div>
1657                		</a> 
1658                		<a id="youtube" aria-label="Youtube Great Estate profile" class="btn btn-primary share_button text-uppercase" target="_blank" href="https://www.youtube.com/user/GreatEstateProperty">
1659                			<div id="youtube_icon"></div>
1660                		</a> 
1661                		<a id="pinterest" aria-label="Pinterest Great Estate profile" class="btn btn-primary share_button text-uppercase" target="_blank" href="https://pin.it/7iWynqJSJ">
1662                			<div id="pinterest_icon"></div>
1663                		</a> 
1664                  	</div>
1665                </div>
1666                
1667                <div class="col-lg-8 footerData px-2">
1668                	<a href="https://www.greatestate.it/en/index.html" aria-label="Go to the Great Estate home page">
1669                		<img alt="Logo Great Estate" id="logoGEFooter" data-src="https://cdn.greatestate.it/ge/img/loghi/ge.png" class="lazyload">
1670                	</a>
1671                	<p style="font-size: 1rem;"><b>Great Estate Immobiliare s.r.l.</b></p>
1672					Via Piana n. 15, fraz. Palazzone					53040					San Casciano dei Bagni								
1673					(SI) Italy					<br>
1674					Phone					<a href="tel:+39057859050" onclick="_paq.push(['trackGoal', 1]);">+39 0578 59050</a> -
1675					Fax					+39 0578 850004 -
1676					Mobile phone					<a href="tel:+393511667107" onclick="_paq.push(['trackGoal', 1]);"> <i class="waSmall"></i> +39 351 1667107</a>
1677					<br>							 
1678					<a onclick="_paq.push(['trackGoal', 2]);" href="mailto:[email protected]" >[email protected] </a> -
1679					P.iva 01246560526					<br>
1680					Enrolled at the chamber of commerce of Siena at n. 759 - Share Capital € 28.000,00 fully paid                 </div>
1681                <div class="col-lg-4 position-relative footerData">
1682                	<div id="copyright">
1683                		<img data-src="https://cdn.greatestate.it/ge/img/loghi/logo_fiaip.png" class="lazyload" alt="Logo FIAIP">
1684                		<p>© 2001 - 2026 All rights reserved. Greatestate.it</p>
1685                	</div>
1686                </div>
1687			</div>
1688      	</footer>
1689    </div>
1690</footer>
1691
1692<footer id="footer_mobile" class="footer mt-auto">
1693	<div class="row">
1694        <div class="col-12 text-center">
1695        	<a href="https://www.greatestate.it/en/index.html" aria-label="Go to the Great Estate home page">
1696        		<img alt="Logo Great Estate" id="logoGEFooter" data-src="https://cdn.greatestate.it/ge/img/loghi/ge-white.png" class="lazyload">
1697        	</a>
1698        </div>
1699	</div>
1700</footer>
1701<span href="#" id="back-to-top" title="Top of the page"><i class="fa-light fa-angle-up"></i></span>
1702<span href="#" id="back-to-top-mobile" title="Top of the page"><i class="fa-light fa-angle-up"></i></span>	
1703    
1703<script type="text/javascript" src="https://cdn.greatestate.it/ge/js/jquery_3.6.0.min.js?v=0.2.4"></script>
1703	
1704<script type="text/javascript" src="https://cdn.greatestate.it/ge/js/bootstrap.bundle.min.js?v=0.2.4"></script>
1704	
1705<script type="text/javascript" src="https://cdn.greatestate.it/ge/js/jquery.fittext.min.js?v=0.2.4"></script>
vendor: 1 bytes, line 1705
1705
1706<script type="text/javascript" src="https://cdn.greatestate.it/ge/js/moment.min.js?v=0.2.4"></script>
vendor: 1 bytes, line 1706
1706
1707<script type="text/javascript" src="https://cdn.greatestate.it/ge/js/daterangepicker.min.js?v=0.2.4"></script>
vendor: 1 bytes, line 1707
1707
1708<script type="text/javascript" src="https://cdn.greatestate.it/ge/js/numeral.min.js?v=0.2.4"></script>
vendor: 1 bytes, line 1708
1708
1709<script type="text/javascript" src="https://cdn.greatestate.it/ge/js/lazysizes.min.js?v=0.2.4"></script>
vendor: 1 bytes, line 1709
1709
1710<script type="text/javascript" src="https://cdn.greatestate.it/ge/js/bootstrap-slider.min.js?v=0.2.4"></script>
vendor: 1 bytes, line 1710
1710
1711<script type="text/javascript" src="https://cdn.greatestate.it/ge/js/functions.js?v=0.2.4"></script>
vendor: 1 bytes, line 1711
1711
1712<script type="text/javascript" src="https://cdn.greatestate.it/ge/js/forms.js?v=0.2.4"></script>
vendor: 1 bytes, line 1712
1712
1713<script type="text/javascript" src="https://cdn.greatestate.it/ge/js/intlTelInput.min.js?v=0.2.4"></script>
vendor: 1 bytes, line 1713
1713
1714<script type="text/javascript" src="https://cdn.greatestate.it/ge/js/timeme.min.js?v=0.2.4"></script>
1714
1715
1716<script type="text/javascript">
1717    tarteaucitron.user.facebookpixelId = '298813754319017'; tarteaucitron.user.facebookpixelMore = function () { 
1718    	fbq('track', 'PageView');
1719    };
1720    (tarteaucitron.job = tarteaucitron.job || []).push('facebookpixel');
1721
1722	(tarteaucitron.job = tarteaucitron.job || []).push('youtube');
1723	
1724	(tarteaucitron.job = tarteaucitron.job || []).push('openstreetmap');
1725
1726	(tarteaucitron.job = tarteaucitron.job || []).push('ga4');
1727	
1728	//tarteaucitron.user.googletagmanagerId = 'GTM-TX69BP9';
1729	tarteaucitron.user.googletagmanagerId = 'GTM-5PJNSCP';
1730    (tarteaucitron.job = tarteaucitron.job || []).push('googletagmanager');
1731
1732    tarteaucitron.user.clarity = 'l27pbmqbwy';
1733    (tarteaucitron.job = tarteaucitron.job || []).push('clarity');
1734    
1735</script>
1735
1736    
1736<script type="text/javascript" src="https://cdn.greatestate.it/ge/js/jquery.raty.min.js?v=0.2.4"></script>
1736
1737    
1738    
1738<script type="text/javascript" src="https://cdn.greatestate.it/ge/js/leaflet.min.js?v=0.2.4"></script>
1738
1739    
1739<script type="text/javascript" src="https://cdn.greatestate.it/ge/js/leaflet.markercluster.min.js?v=0.2.4"></script>
1739
1740    
1741    
1741<script>
1742
1743$('#acquistaTab').click(function () {
1744	var submit = true;
1745	
1746	if(session_type_search_active == 1){
1747		submit = false;
1748	}
1749	newSlug = refreshSlugImmobili();
1750	session_type_search_active = 1;
1751	activeTypeSearch();
1752	if((is_search_page == true) && (submit == true)){
1753		$("#acquistaTab").removeClass('active');
1754		$("#acquistaBar").removeClass('show');
1755		$("#acquistaBar").removeClass('active');
1756	    $("#affittaTab").addClass('active');
1757	    $("#affittaBar").addClass('show');
1758	    $("#affittaBar").addClass('active');
1759	    $('#divRicercaContent').css('border-top', '3px solid #ed6b62');	
1760		$('#divRicercaContent').css('border-bottom', '3px solid #ed6b62');	
1761		submitCercaImmobili(newSlug, true);
1762	}
1763});
1764$('#affittaTab').click(function () {
1765	var submit = true;
1766	
1767	if(session_type_search_active == 2){
1768		submit = false;
1769	}
1770	newSlug = refreshSlugAlloggi();
1771	session_type_search_active = 2;
1772	activeTypeSearch();
1773	if((is_search_page == true) && (submit == true)){
1774	    $("#affittaTab").removeClass('active');
1775	    $("#affittaBar").removeClass('show');
1776	    $("#affittaBar").removeClass('active');
1777		$("#acquistaTab").addClass('active');
1778		$("#acquistaBar").addClass('show');
1779		$("#acquistaBar").addClass('active');
1780		$('#divRicercaContent').css('border-top', '3px solid #007574');
1781		$('#divRicercaContent').css('border-bottom', '3px solid #007574');
1782    	submitCercaAlloggi(newSlug, true);
1783	}
1784});
1785
1786$('#ricerca_liberaImmobili').keypress(function (e) {
1787  	if (e.which == 13) {
1788              		submitCercaImmobili('prestigious-property-search.html', true);
1789          	}
1790});
1791$('#ricerca_liberaImmobiliMobile').keypress(function (e) {
1792  	if (e.which == 13) {
1793              		submitCercaImmobili('prestigious-property-search.html', true);
1794          	}
1795});
1796
1797$('#ricerca_liberaAlloggi').keypress(function (e) {
1798  if (e.which == 13) {
1799	 submitCercaAlloggi('luxury-rentals-search.html', true)
1800  }
1801});
1802$('#ricerca_liberaAlloggiMobile').keypress(function (e) {
1803  if (e.which == 13) {
1804	 submitCercaAlloggi('luxury-rentals-search.html', true)
1805  }
1806});
1807
1808$("#annullaButtonLocationsImmobili").click(function() {
1809	$("#locations_immobiliBtn").dropdown("toggle");
1810	
1811	$('#regioni_immobili').val('');
1812	$('#province_immobili').val('');
1813	$('#comuni_immobili').val('');
1814	$('#aree_immobili').val('');
1815	
1816	$('#locations_immobiliBtn').html('Where would you like to go?');
1817	$('#locations_immobiliBtn').css('color', '#9b9a9e');
1818	$('#locations_immobiliBtn').css('opacity', '1');
1819	
1820	$('.cleanlocations_immobili').remove();
1821	
1822	$(".regioni_immobiliCheckParent").prop("checked", false);
1823	$(".regioni_immobiliCheck").prop("checked", false);
1824	$(".regioni_immobiliCheckParent_filtro").prop("checked", false);
1825	$(".regioni_immobiliCheck_filtro").prop("checked", false);
1826	$("#regioni_immobiliCheckAll").prop("checked", false);
1827	$("#regioni_immobiliCheckAll_filtro").prop("checked", false);
1828    
1829    $(".province_immobiliCheck").prop("checked", false);
1830    $(".province_immobiliCheck_filtro").prop("checked", false);
1831    $("#province_immobiliCheckAll").prop("checked", false);
1832    $("#province_immobiliCheckAll_filtro").prop("checked", false);	
1833	
1834	$(".comuni_immobiliCheck").prop("checked", false);
1835	$(".comuni_immobiliCheck_filtro").prop("checked", false);
1836	$("#comuni_immobiliCheckAll").prop("checked", false);
1837	$("#comuni_immobiliCheckAll_filtro").prop("checked", false);
1838	
1839	$(".aree_immobiliCheckParent").prop("checked", false);
1840	$(".aree_immobiliCheck").prop("checked", false);
1841	$(".aree_immobiliCheckParent_filtro").prop("checked", false);
1842	$(".aree_immobiliCheck_filtro").prop("checked", false);
1843	$("#aree_immobiliCheckAll").prop("checked", false);
1844	$("#aree_immobiliCheckAll_filtro").prop("checked", false);
1845
1846	$('#buttonAccordionOffcanvasProvinceImmobili').attr('disabled', 'disabled');
1847	$('#buttonAccordionOffcanvasProvinceImmobili_filtro').attr('disabled', 'disabled');
1848	
1849	$('#buttonAccordionOffcanvasComuniImmobili').attr('disabled', 'disabled');
1850	$('#buttonAccordionOffcanvasComuniImmobili_filtro').attr('disabled', 'disabled');
1851	
1852	listaTipologieImmobili(false);
1853});
1854
1855function toogleMoreText(id_num) {
1856	if($('.contentmoretxt_'+id_num).hasClass("contentmoretxt_hidden")) {
1857		$('.contentmoretxt_'+id_num).removeClass('contentmoretxt_hidden');
1858		$('.contentmoretxt_'+id_num).addClass('contentmoretxt_show');
1859		$('.linkMoreText_'+id_num).empty().append('See less <i class="fa-light fa-chevron-up"></i>');
1860	}
1861	else {
1862		$('.contentmoretxt_'+id_num).removeClass('contentmoretxt_show');
1863		$('.contentmoretxt_'+id_num).addClass('contentmoretxt_hidden');
1864		$('.linkMoreText_'+id_num).empty().append('Read more <i class="fa-light fa-chevron-down"></i>');
1865	}
1866}
1867
1868function printImmobiliHtmlIcons(immobili, i, tipo) {	
1869	var firstIcon = false;
1870	var iconsCount = 0;
1871	const iconsLimit = 7;
1872	html = '';
1873
1874	if((immobili[i].sup_commerciale) && (immobili[i].sup_commerciale != 0) && (tipo != 'box')){
1875		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Total surface ' + numeral(immobili[i].sup_commerciale).format('0,0') + ' sqm">';
1876			html += '<i class="fa-solid fa-expand"></i><span class="iconWithNumber">'+numeral(immobili[i].sup_commerciale).format('0,0')+' sqm</span>';
1877		html += '</span>';
1878		firstIcon = true;
1879		iconsCount++;
1880	}
1881	if((immobili[i].camera) && (immobili[i].camera != 0) && (tipo != 'box')){
1882		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="'+immobili[i].camera+' '+(immobili[i].camera == 1 ? 'Bedroom' : 'Bedrooms')+'">';
1883			html += '<i class="fa-solid fa-bed-front"></i><span class="iconWithNumber">'+immobili[i].camera+'</span>';
1884		html += '</span>';
1885		firstIcon = true;
1886		iconsCount++;
1887	}
1888	if(immobili[i].locali){
1889    	if((immobili[i].locali.camera) && (immobili[i].locali.camera != 0) && (tipo != 'box')){
1890    		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="'+immobili[i].locali.camera+' '+(immobili[i].camera == 1 ? 'Bedroom' : 'Bedrooms')+'">';
1891    			html += '<i class="fa-solid fa-bed-front"></i><span class="iconWithNumber">'+immobili[i].locali.camera+'</span>';
1892    		html += '</span>';
1893    		firstIcon = true;
1894    		iconsCount++;
1895    	}
1896    }
1897	if((immobili[i].bagno) && (immobili[i].bagno != 0) && (tipo != 'box')){
1898		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="'+immobili[i].bagno+' '+(immobili[i].bagno == 1 ? 'Bathroom' : 'Bathrooms')+'">';
1899			html += '<i class="fa-solid fa-bath"></i><span class="iconWithNumber">'+immobili[i].bagno+'</span>';
1900		html += '</span>';
1901		firstIcon = true;
1902		iconsCount++;
1903	}
1904	if(immobili[i].locali){
1905    	if((immobili[i].locali.bagno) && (immobili[i].locali.bagno != 0) && (tipo != 'box')){
1906    		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="'+immobili[i].locali.bagno+' '+(immobili[i].bagno == 1 ? 'Bathroom' : 'Bathrooms')+'">';
1907    			html += '<i class="fa-solid fa-bath"></i><span class="iconWithNumber">'+immobili[i].locali.bagno+'</span>';
1908    		html += '</span>';
1909    		firstIcon = true;
1910    		iconsCount++;
1911    	}
1912    }
1913	if((immobili[i].id_corpi) && (immobili[i].id_corpi.includes(130))) {
1914		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Garden">';
1915			html += '<i class="fa-solid fa-flower-daffodil"></i>';
1916		html += '</span>';
1917		firstIcon = true;
1918		iconsCount++;
1919	}
1920	if((immobili[i].piscina) && (immobili[i].piscina == true)){
1921		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Swimming pool">';
1922			html += '<i class="fa-solid fa-water-ladder"></i>';
1923		html += '</span>';
1924		firstIcon = true;
1925		iconsCount++;
1926	}	
1927	if((immobili[i].id_corpi) && (immobili[i].id_corpi.includes(153))) {
1928		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="SPA">';
1929			html += '<i class="fa-solid fa-spa"></i>';
1930		html += '</span>';
1931		firstIcon = true;
1932		iconsCount++;
1933	}
1934	if((immobili[i].lifestyle_id) && (immobili[i].lifestyle_id.includes(110)) && (tipo != 'box')){
1935		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Hill">';
1936			html += '<i class="fa-solid fa-mountains"></i>';
1937		html += '</span>';
1938		firstIcon = true;
1939		iconsCount++;
1940	}
1941	if((immobili[i].lifestyle_id) && (immobili[i].lifestyle_id.includes(111)) && (tipo != 'box') && (iconsCount < iconsLimit)){
1942		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Plain">';
1943			html += '<i class="fa-solid fa-sun-plant-wilt"></i>';
1944		html += '</span>';
1945		firstIcon = true;
1946		iconsCount++;
1947	}
1948	if((immobili[i].lifestyle_id) && (immobili[i].lifestyle_id.includes(112)) && (tipo != 'box') && (iconsCount < iconsLimit)){
1949		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Near the services">';
1950			html += '<i class="fa-solid fa-shop"></i>';
1951		html += '</span>';
1952		firstIcon = true;
1953		iconsCount++;
1954	}
1955	if((immobili[i].lifestyle_id) && (immobili[i].lifestyle_id.includes(113)) && (tipo != 'box') && (iconsCount < iconsLimit)){
1956		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Historical center">';
1957			html += '<i class="fa-solid fa-landmark"></i>';
1958		html += '</span>';
1959		firstIcon = true;
1960		iconsCount++;
1961	}
1962	if((immobili[i].lifestyle_id) && (immobili[i].lifestyle_id.includes(114)) && (tipo != 'box') && (iconsCount < iconsLimit)){
1963		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Near the sea">';
1964			html += '<i class="fa-solid fa-umbrella-beach"></i>';
1965		html += '</span>';
1966		firstIcon = true;
1967		iconsCount++;
1968	}
1969	if((immobili[i].lifestyle_id) && (immobili[i].lifestyle_id.includes(115)) && (tipo != 'box') && (iconsCount < iconsLimit)){
1970		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Near the lake">';
1971			html += '<i class="fa-solid fa-bench-tree"></i>';
1972		html += '</span>';
1973		firstIcon = true;
1974		iconsCount++;
1975	}
1976	if((immobili[i].lifestyle_id) && (immobili[i].lifestyle_id.includes(85)) && (iconsCount < iconsLimit)){
1977		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Panoramic view">';
1978			html += '<i class="fa-solid fa-mountain-sun"></i>';
1979		html += '</span>';
1980		firstIcon = true;
1981		iconsCount++;
1982	}
1983	if((immobili[i].punteggio_privacy) && (immobili[i].punteggio_privacy >= 3) && (iconsCount < iconsLimit)){
1984		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Privacy">';
1985			html += '<i class="fa-solid fa-house-tree"></i>';
1986		html += '</span>';
1987		firstIcon = true;
1988		iconsCount++;
1989	}
1990	/*
1991	if(immobili[i].diff_val){
1992		if((immobili[i].diff_val >= 0) && (immobili[i].diff_val < 5) && (iconsCount < iconsLimit)){
1993    		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Super price">';
1994    			html += '<i class="fa-solid fa-percent"></i><span class="iconWithNumber">(x3)</span>';
1995    		html += '</span>';
1996    		firstIcon = true;
1997			iconsCount++;
1998		}
1999		else if((immobili[i].diff_val >= 5) && (immobili[i].diff_val < 10) && (iconsCount < iconsLimit)){
2000    		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Excellent price">';
2001    			html += '<i class="fa-solid fa-percent"></i><span class="iconWithNumber">(x2)</span>';
2002    		html += '</span>';
2003    		firstIcon = true;
2004			iconsCount++;
2005		}
2006		else if((immobili[i].diff_val >= 10) && (immobili[i].diff_val < 15) && (iconsCount < iconsLimit)){
2007    		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Good price">';
2008    			html += '<i class="fa-solid fa-percent"></i><span class="iconWithNumber">(x1)</span>';
2009    		html += '</span>';
2010    		firstIcon = true;
2011			iconsCount++;
2012		}
2013	}
2014	*/
2015	if((immobili[i].punteggio_storicita) && (immobili[i].punteggio_storicita >= 2) && (tipo != 'box') && (iconsCount < iconsLimit)){
2016		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Historicity">';
2017			html += '<i class="fa-solid fa-scroll"></i>';
2018		html += '</span>';
2019		firstIcon = true;
2020		iconsCount++;
2021	}
2022	if((immobili[i].id_corpi) && (immobili[i].id_corpi.includes(146)) && (tipo != 'box') && (iconsCount < iconsLimit)) {
2023		let onePrinted = false;
2024
2025		for (var c = 0; c < immobili[i].tipo_terreno.length; c++) {
2026        	if((onePrinted == false) && ((immobili[i].tipo_terreno[c].match(/Ulivet.*/)) || (immobili[i].tipo_terreno[c].match(/Olivet.*/))) && (iconsCount < iconsLimit)){
2027        		onePrinted = true;
2028        		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Olive groves">';
2029        			html += '<i class="fa-solid fa-tree-deciduous"></i>';
2030        		html += '</span>';
2031        		firstIcon = true;
2032				iconsCount++;
2033            }
2034        	else if((onePrinted == false) && ((immobili[i].tipo_terreno[c].match(/Vignet.*/))) && (iconsCount < iconsLimit)){
2035        		onePrinted = true;
2036        		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Viney
2036ards">';
2037        			html += '<i class="fa-solid fa-tree-deciduous"></i>';
2038        		html += '</span>';
2039        		firstIcon = true;
2040				iconsCount++;
2041            }
2042		}
2043	}
2044	if((immobili[i].id_corpi) && ((immobili[i].id_corpi.includes(163)) || (immobili[i].id_corpi.includes(164)) || (immobili[i].id_corpi.includes(165)) || (immobili[i].id_corpi.includes(166)) || (immobili[i].id_corpi.includes(167))) && (tipo != 'box') && (iconsCount < iconsLimit)) {
2045		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Style furniture">';
2046			html += '<i class="fa-solid fa-lamp"></i>';
2047		html += '</span>';
2048		firstIcon = true;
2049		iconsCount++;
2050	}
2051	if((immobili[i].dotazioni_green) && (tipo != 'box') && (iconsCount < iconsLimit)){
2052		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Green equipment">';
2053			html += '<i class="fa-solid fa-leaf-heart"></i>';
2054		html += '</span>';
2055		firstIcon = true;
2056		iconsCount++;
2057	}
2058	if((immobili[i].lifestyle_id) && (immobili[i].lifestyle_id.includes(3)) && (tipo != 'box') && (iconsCount < iconsLimit)){
2059		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Art and culture">';
2060			html += '<i class="fa-solid fa-masks-theater"></i>';
2061		html += '</span>';
2062		firstIcon = true;
2063		iconsCount++;
2064	}
2065	if((immobili[i].lifestyle_id) && (immobili[i].lifestyle_id.includes(4)) && (tipo != 'box') && (iconsCount < iconsLimit)){
2066		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Comfortable in winter">';
2067			html += '<i class="fa-solid fa-fireplace"></i>';
2068		html += '</span>';
2069		firstIcon = true;
2070		iconsCount++;
2071	}
2072	if((immobili[i].camera) && (immobili[i].camera >= 4) && (tipo != 'box') && (iconsCount < iconsLimit)){
2073		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Family Friendly">';
2074			html += '<i class="fa-solid fa-baby-carriage"></i>';
2075		html += '</span>';
2076		firstIcon = true;
2077		iconsCount++;
2078	}
2079	if(immobili[i].locali){
2080    	if((immobili[i].locali.camera) && (immobili[i].locali.camera >= 4) && (tipo != 'box') && (iconsCount < iconsLimit)){
2081    		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Family Friendly">';
2082    			html += '<i class="fa-solid fa-baby-carriage"></i>';
2083    		html += '</span>';
2084    		firstIcon = true;
2085    		iconsCount++;
2086    	}
2087    }
2088	if((immobili[i].id_corpi) && (immobili[i].id_corpi.includes(119)) && (tipo != 'box') && (iconsCount < iconsLimit)) {
2089		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="BBQ area">';
2090			html += '<i class="fa-solid fa-grill-hot"></i>';
2091		html += '</span>';
2092		firstIcon = true;
2093		iconsCount++;
2094	}
2095	if((immobili[i].terrazzo_coperto) && (iconsCount < iconsLimit)){
2096		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Livable terrace">';
2097			html += '<i class="fa-solid fa-glass-citrus"></i>';
2098		html += '</span>';
2099		firstIcon = true;
2100		iconsCount++;
2101	}
2102	if((immobili[i].id_corpi) && (immobili[i].id_corpi.includes(156)) && (tipo != 'box') && (iconsCount < iconsLimit)) {
2103		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Lift">';
2104			html += '<i class="fa-solid fa-elevator"></i>';
2105		html += '</span>';
2106		firstIcon = true;
2107		iconsCount++;
2108	}
2109	if((immobili[i].box_auto) && (tipo != 'box') && (iconsCount < iconsLimit)){
2110		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Garage">';
2111			html += '<i class="fa-solid fa-garage-car"></i>';
2112		html += '</span>';
2113		firstIcon = true;
2114		iconsCount++;
2115	}
2116	if((immobili[i].strada_accesso) && (tipo != 'box') && (iconsCount < iconsLimit)){
2117		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Private access road">';
2118			html += '<i class="fa-solid fa-road-lock"></i>';
2119		html += '</span>';
2120		firstIcon = true;
2121		iconsCount++;
2122	}
2123	if((immobili[i].id_corpi) && (immobili[i].id_corpi.includes(124)) && (tipo != 'box') && (iconsCount < iconsLimit)) {
2124		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Alarm">';
2125			html += '<i class="fa-solid fa-siren-on"></i>';
2126		html += '</span>';
2127		firstIcon = true;
2128		iconsCount++;
2129	}
2130	if((immobili[i].id_corpi) && (immobili[i].id_corpi.includes(152)) && (tipo != 'box') && (iconsCount < iconsLimit)) {
2131		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Fencing">';
2132			html += '<i class="fa-solid fa-fence"></i>';
2133		html += '</span>';
2134		firstIcon = true;
2135		iconsCount++;
2136	}
2137	if((immobili[i].id_corpi) && (immobili[i].id_corpi.includes(154)) && (tipo != 'box') && (iconsCount < iconsLimit)) {
2138		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Gym">';
2139			html += '<i class="fa-solid fa-dumbbell"></i>';
2140		html += '</span>';
2141		firstIcon = true;
2142		iconsCount++;
2143	}
2144	if((immobili[i].id_corpi) && (immobili[i].id_corpi.includes(168)) && (tipo != 'box') && (iconsCount < iconsLimit)) {
2145		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Furnished">';
2146			html += '<i class="fa-solid fa-couch"></i>';
2147		html += '</span>';
2148		firstIcon = true;
2149		iconsCount++;
2150	}
2151	if((immobili[i].opportunita_investimento) && (tipo != 'box') && (iconsCount < iconsLimit)){
2152		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Investment opportunity">';
2153			html += '<i class="fa-solid fa-money-bill-trend-up"></i>';
2154		html += '</span>';
2155		firstIcon = true;
2156		iconsCount++;
2157	}	
2158	
2159	return html;
2160}
2161
2162function printImmobiliAreaRiservataHtmlIcons(immobili, i) {	
2163	var firstIcon = false;
2164	var iconsCount = 0;
2165	html = '';
2166
2167	if((immobili[i].sup_commerciale) && (immobili[i].sup_commerciale != 0)
2167){
2168		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Total surface ' + numeral(immobili[i].sup_commerciale).format('0,0') + ' sqm">';
2169			html += '<i class="fa-solid fa-expand"></i><span class="iconWithNumber">'+numeral(immobili[i].sup_commerciale).format('0,0')+' sqm</span>';
2170		html += '</span>';
2171		firstIcon = true;
2172		iconsCount++;
2173	}
2174	if((immobili[i].camera) && (immobili[i].camera != 0)){
2175		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="'+immobili[i].camera+' '+(immobili[i].camera == 1 ? 'Bedroom' : 'Bedrooms')+'">';
2176			html += '<i class="fa-solid fa-bed-front"></i><span class="iconWithNumber">'+immobili[i].camera+'</span>';
2177		html += '</span>';
2178		firstIcon = true;
2179		iconsCount++;
2180	}
2181	if((immobili[i].bagno) && (immobili[i].bagno != 0)){
2182		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="'+immobili[i].bagno+' '+(immobili[i].bagno == 1 ? 'Bathroom' : 'Bathrooms')+'">';
2183			html += '<i class="fa-solid fa-bath"></i><span class="iconWithNumber">'+immobili[i].bagno+'</span>';
2184		html += '</span>';
2185		firstIcon = true;
2186		iconsCount++;
2187	}
2188	return html;
2189}
2190
2191function disableSlugAlloggiParameters() {
2192	$("#tipologie_alloggi").attr('disabled', true); 
2193	$("#aree_alloggi").attr('disabled', true); 
2194	$("#must_have_alloggi").attr('disabled', true); 
2195}
2196
2197function disableSlugImmobiliParameters() {
2198	$("#tipologie_immobili").attr('disabled', true); 
2199	$("#aree_immobili").attr('disabled', true); 
2200	$("#regioni_immobili").attr('disabled', true); 
2201	$("#province_immobili").attr('disabled', true); 
2202	$("#comuni_immobili").attr('disabled', true); 
2203}
2204
2205function enableSlugFiltriImmobiliParameters() {
2206	$("#collina_immobili").removeAttr('disabled');
2207	$("#pianura_immobili").removeAttr('disabled');
2208	$("#vicino_ai_servizi_immobili").removeAttr('disabled');
2209	$("#centro_storico_immobili").removeAttr('disabled');
2210	$("#vicino_al_mare_immobili").removeAttr('disabled');
2211	$("#vicino_al_lago_immobili").removeAttr('disabled');
2212	$("#piscina_immobili").removeAttr('disabled');
2213	$("#palestra_immobili").removeAttr('disabled');
2214	$("#spa_immobili").removeAttr('disabled');
2215	$("#giardino_immobili").removeAttr('disabled');		
2216	$("#virtual_tour_immobili").removeAttr('disabled');
2217	$("#video_professionale_immobili").removeAttr('disabled');
2218	$("#video_amatoriale_immobili").removeAttr('disabled');			
2219}
2220
2221function refreshSlugImmobiliInaNdv() {
2222
2223	/***********************************************************************/
2224	/***********************************************************************/
2225	var newSlug = _root_web+'/'+_lang+'/prestigious-property-search.html';
2226	var firstParam = false;
2227
2228	if(($('#in_trattativa_immobili').val() == 'true') || 
2229		($('#nuovo_sul_mercato_immobili').val() == 'true') ||
2230		($('#virtual_tour_immobili').val() == 'true') ||
2231		($('#video_professionale_immobili').val() == 'true') ||
2232		($('#video_amatoriale_immobili').val() == 'true')) {
2233			newSlug = '';
2234			return newSlug;
2235	}
2236	/***********************************************************************/
2237	/***********************************************************************/
2238	
2239	var link_ina_ndv = '';
2240
2241	if($('#tipologie_immobili').val() != ''){
2242		if(link_ina_ndv == ''){
2243			link_ina_ndv += '?tipologie=' + $('#tipologie_immobili').val();
2244		}
2245		else {
2246			link_ina_ndv += '&tipologie=' + $('#tipologie_immobili').val();
2247		}
2248	}
2249	if($('#aree_immobili').val()){
2250		if(link_ina_ndv == ''){
2251			link_ina_ndv += '?aree=' + $('#aree_immobili').val();
2252		}
2253		else {
2254			link_ina_ndv += '&aree=' + $('#aree_immobili').val();
2255		}
2256	}
2257	if($('#regioni_immobili').val() != ''){
2258		if(link_ina_ndv == ''){
2259			link_ina_ndv += '?regioni=' + $('#regioni_immobili').val();
2260		}
2261		else {
2262			link_ina_ndv += '&regioni=' + $('#regioni_immobili').val();
2263		}
2264	}
2265	if($('#province_immobili').val() != ''){
2266		if(link_ina_ndv == ''){
2267			link_ina_ndv += '?province=' + $('#province_immobili').val();
2268		}
2269		else {
2270			link_ina_ndv += '&province=' + $('#province_immobili').val();
2271		}
2272	}
2273	if($('#comuni_immobili').val() != ''){
2274		if(link_ina_ndv == ''){
2275			link_ina_ndv += '?comuni=' + $('#comuni_immobili').val();
2276		}
2277		else {
2278			link_ina_ndv += '&comuni=' + $('#comuni_immobili').val();
2279		}
2280	}
2281	if($('#prezzo_immobili').val() != ''){
2282		r_pre = $('#prezzo_min_immobili').val() + '-' + $('#prezzo_max_immobili').val();
2283		if($('#prezzo_immobili').val() != r_pre){
2284    		if(link_ina_ndv == ''){
2285    			link_ina_ndv += '?prezzo=' + $('#prezzo_immobili').val();
2286    		}
2287    		else {
2288    			link_ina_ndv += '&prezzo=' + $('#prezzo_immobili').val();
2289    		}
2290		}
2291	}
2292	if(($('#camere_immobili').val() != '') && ($('#camere_immobili').val() != '0-1000')){
2293		if(link_ina_ndv == ''){
2294			link_ina_ndv += '?camere=' + $('#camere_immobili').val();
2295		}
2296		else {
2297			link_ina_ndv += '&camere=' + $('#camere_immobili').val();
2298		}
2299	}
2300	if(($('#bagni_immobili').val() != '') && ($('#bagni_immobili').val() != '0-1000')){
2301		if(link_ina_ndv == ''){
2302			link_ina_ndv += '?bagni=' + $('#bagni_immobili').val();
2303		}
2304		else {
2305			link_ina_ndv += '&bagni=' + $('#bagni_immobili').val();
2306		}
2307	}
2308	if($('#superficie_immobili').val() != ''){
2309		r_sup = $('#superficie_min_immobili_filtro').val() + '-' + $('#superficie_max_immobili_filtro').val();
2310		if($('#superficie_immobili').val() != r_sup){
2311    		if(link_ina_ndv == ''){
2312    			link_ina_ndv += '?superficie=' + $('#superficie_immobili').val();
2313    		}
2314    		else {
2315    			link_ina_ndv += '&superficie=' + $('#superficie_immobili').val();
2316    		}
2317		}
2318	}
2319	if(($('#terreno_immobiliCheck').is(":checked")) && ($('#terreno_immobili').val())){
2320		if(link_ina_ndv == ''){
2321			link_ina_ndv += '?terreno=' + $('#terreno_immobili').val();
2322		}
2323		else {
2324			link_ina_ndv += '&terreno=' + $('#terreno_immobili').val();
2325		}
2326	}
2327	if($('#condizioni_immobili').val() != ''){
2328		if(link_ina_ndv == ''){
2329			link_ina_ndv += '?condizioni=' + $('#condizioni_immobili').val();
2330		}
2331		else {
2332			link_ina_ndv += '&condizioni=' + $('#condizioni_immobili').val();
2333		}
2334	}
2335	if($('#collina_immobili').val() == 'true'){
2336		if(link_ina_ndv == ''){
2337			link_ina_ndv += '?collina=true';
2338		}
2339		else {
2340			link_ina_ndv += '&collina=true';
2341		}
2342	}
2343	if($('#pianura_immobili').val() == 'true'){
2344		if(link_ina_ndv == ''){
2345			link_ina_ndv += '?pianura=true';
2346		}
2347		else {
2348			link_ina_ndv += '&pianura=true';
2349		}
2350	}
2351	if($('#vicino_ai_servizi_immobili').val() == 'true'){
2352		if(link_ina_ndv == ''){
2353			link_ina_ndv += '?vicino_ai_servizi=true'
2354		}
2355		else {
2356			link_ina_ndv += '&vicino_ai_servizi=true';
2357		}
2358	}
2359	if($('#centro_storico_immobili').val() == 'true'){
2360		if(link_ina_ndv == ''){
2361			link_ina_ndv += '?centro_storico=true'
2362		}
2363		else {
2364			link_ina_ndv += '&centro_storico=true';
2365		}
2366	}
2367	if($('#vicino_al_mare_immobili').val() == 'true'){
2368		if(link_ina_ndv == ''){
2369			link_ina_ndv += '?vicino_al_mare=true'
2370		}
2371		else {
2372			link_ina_ndv += '&vicino_al_mare=true';
2373		}
2374	}
2375	if($('#vicino_al_lago_immobili').val() == 'true'){
2376		if(link_ina_ndv == ''){
2377			link_ina_ndv += '?vicino_al_lago=true'
2378		}
2379		else {
2380			link_ina_ndv += '&vicino_al_lago=true';
2381		}
2382	}
2383	if($('#piscina_immobili').val() != ''){
2384		if(link_ina_ndv == ''){
2385			link_ina_ndv += '?piscina=true';
2386		}
2387		else {
2388			link_ina_ndv += '&piscina=true';
2389		}
2390	}
2391	if($('#recinzione_immobili').val() == 'true'){
2392		if(link_ina_ndv == ''){
2393			link_ina_ndv += '?recinzione=true';
2394		}
2395		else {
2396			link_ina_ndv += '&recinzione=true';
2397		}
2398	}
2399	if($('#palestra_immobili').val() == 'true'){
2400		if(link_ina_ndv == ''){
2401			link_ina_ndv += '?palestra=true';
2402		}
2403		else {
2404			link_ina_ndv += '&palestra=true';
2405		}
2406	}
2407	if($('#spa_immobili').val() == 'true'){
2408		if(link_ina_ndv == ''){
2409			link_ina_ndv += '?spa=true';
2410		}
2411		else {
2412			link_ina_ndv += '&spa=true';
2413		}
2414	}
2415	if($('#giardino_immobili').val() == 'true'){
2416		if(link_ina_ndv == ''){
2417			link_ina_ndv += '?giardino=true';
2418		}
2419		else {
2420			link_ina_ndv += '&giardino=true';
2421		}
2422	}
2423	if($('#area_barbecue_immobili').val() == 'true'){
2424		if(link_ina_ndv == ''){
2425			link_ina_ndv += '?area_barbecue=true';
2426		}
2427		else {
2428			link_ina_ndv += '&area_barbecue=true';
2429		}
2430	}
2431	if($('#terrazza_abitabile_immobili').val() == 'true'){
2432		if(link_ina_ndv == ''){
2433			link_ina_ndv += '?terrazza_abitabile=true';
2434		}
2435		else {
2436			link_ina_ndv += '&terrazza_abitabile=true';
2437		}
2438	}
2439	if($('#ascensore_immobili').val() == 'true'){
2440		if(link_ina_ndv == ''){
2441			link_ina_ndv += '?ascensore=true';
2442		}
2443		else {
2444			link_ina_ndv += '&ascensore=true';
2445		}
2446	}
2447	if($('#garage_immobili').val() == 'true'){
2448		if(link_ina_ndv == ''){
2449			link_ina_ndv += '?garage=true';
2450		}
2451		else {
2452			link_ina_ndv += '&garage=true';
2453		}
2454	}
2455	if($('#strada_accesso_privata_immobili').val() == 'true'){
2456		if(link_ina_ndv == ''){
2457			link_ina_ndv += '?strada_accesso_privata=true';
2458		}
2459		else {
2460			link_ina_ndv += '&strada_accesso_privata=true';
2461		}
2462	}
2463	if($('#allarme_immobili').val() == 'true'){
2464		if(link_ina_ndv == ''){
2465			link_ina_ndv += '?allarme=true';
2466		}
2467		else {
2468			link_ina_ndv += '&allarme=true';
2469		}
2470	}
2471	if($('#arredato_immobili').val() == 'true'){
2472		if(link_ina_ndv == ''){
2473			link_ina_ndv += '?arredato=true';
2474		}
2475		else {
2476			link_ina_ndv += '&arredato=true';
2477		}
2478	}
2479	
2480
2481	if($('#ricerca_liberaImmobili').val() != ''){
2482		link_ina_ndv = '?ricercalibera=' + $('#ricerca_liberaImmobili').val();
2483	}
2484	else if($('#ricerca_liberaImmobiliMobile').val() != ''){
2485    		link_ina_ndv = '?ricercalibera=' + $('#ricerca_liberaImmobiliMobile').val();
2486    }
2487	
2488	link_ina_ndv = 'https://www.greatestate.it/en/ina_ndv.html' + link_ina_ndv;
2489    
2490	newSlug = link_ina_ndv;
2491	$('.buttonSlugImmobili').attr('onclick', 'submitCercaImmobili("' + newSlug + '", true, "ina_ndv")');
2492	disableSlugImmobiliParameters();
2493	return newSlug;
2494}
2495
2496function refreshSlugImmobili() {
2497	var newSlug = '';
2498	var tipologieImmobiliArray = new Array();
2499	var areeImmobiliArray = new Array();
2500	var regioniImmobiliArray = new Array();
2501	var provinceImmobiliArray = new Array();
2502	var comuniImmobiliArray = new Array();
2503	var areaSel = '';
2504	var regSel = '';
2505	var provSel = '';
2506	var comSel = '';
2507	var filtriConSlugCount = 0;
2508	var nomeFiltroSlug = '';
2509	
2510	if(session_type_search_active == 1){
2511    	if($('#venduto_immobili').val() == 'true'){
2512    		newSlug = _root_web+'/'+_lang+'/'+venduti_slug_immobili[_lang];		
2513    		$('.buttonSlugImmobili').attr('onclick', 'submitCercaImmobili("' + newSlug + '", true)');
2514    		disableSlugImmobiliParameters();
2515    		return newSlug;
2516    	}
2517    
2518    	    	
2519    	if($('#tipologie_immobili').val() != ''){
2520    		tipologieImmobiliArray = $('#tipologie_immobili').val().split('-');
2521    	}
2522    	if($('#aree_immobili').val() != ''){
2523    		areeImmobiliArray = $('#aree_immobili').val().split('-');
2524    	}
2525    	if($('#regioni_immobili').val() != ''){
2526    		regioniImmobiliArray = $('#regioni_immobili').val().split('-');
2527    	}
2528    	if($('#province_immobili').val() != ''){
2529    		provinceImmobiliArray = $('#province_immobili').val().split('-');
2530    	}
2531    	if($('#comuni_immobili').val() != ''){
2532    		comuniImmobiliArray = $('#comuni_immobili').val().split('-');
2533    	}
2534    	
2535    	enableSlugFiltriImmobiliParameters();
2536    	
2537    	if(((tipologieImmobiliArray.length > 1) || (areeImmobiliArray.length > 1) || (regioniImmobiliArray.length > 1) || (provinceImmobiliArray.length > 1) || (comuniImmobiliArray.length > 1)) ||
2538    		((areeImmobiliArray.length > 0) && (regioniImmobiliArray.length > 0))){
2539    		newSlug = _root_web+'/'+_lang+'/customized-search.html';
2540    		$("#tipologie_immobili").removeAttr('disabled');
2541    		$("#aree_immobili").removeAttr('disabled');
2542    		$("#regioni_immobili").removeAttr('disabled');
2543    		$("#province_immobili").removeAttr('disabled');
2544    		$("#comuni_immobili").removeAttr('disabled');	
2545    	}
2546    	else if((tipologieImmobiliArray.length === 0) && (areeImmobiliArray.length === 0) && (regioniImmobiliArray.length === 0)){
2547    		if($('#vicino_al_mare_immobili').val() == 'true'){
2548    			$('#vicino_al_mare_immobili').attr('disabled', 'disabled');
2549    			newSlug = _root_web+'/'+_lang+'/'+mare_slug_immobili[0][_lang];		
2550        		$('.buttonSlugImmobili').attr('onclick', 'submitCercaImmobili("' + newSlug + '", true)');
2551        		disableSlugImmobiliParameters();
2552    			return newSlug;
2553    		}
2554    		
2555            $("#formSubmitCercaImmobili input[type=hidden]").each(function () {
2556            	if(($(this).hasClass('hasSlug')) && (this.value == 'true')){
2557            		filtriConSlugCount++;
2558            		nomeFiltroSlug = this.name;
2559            	}
2560            });
2561        	
2562        	if(filtriConSlugCount == 1){
2563        		$('#'+nomeFiltroSlug+'_immobili').attr('disabled', 'disabled');
2564        		newSlug = _root_web+'/'+_lang+'/'+filtri_slug_immobili[nomeFiltroSlug][_lang];		
2565        		$('.buttonSlugImmobili').attr('onclick', 'submitCercaImmobili("' + newSlug + '", true)');
2566        		disableSlugImmobiliParameters();
2567    			return newSlug;	
2568        	}
2569        	
2570    		newSlug = _root_web+'/'+_lang+'/prestigious-property-search.html';		
2571        	disableSlugImmobiliParameters();				
2572    	}
2573    	else if((tipologieImmobiliArray.length === 0) && (areeImmobiliArray.length != 0) && (regioniImmobiliArray.length === 0)){	
2574    		areaSel = nomi_aree_immobili[areeImmobiliArray[0]];				
2575    		areaSel = areaSel.trim();
2576    		areaSel = areaSel.replace(/ /g,"-");
2577    		areaSel = areaSel.replace(/'/g,"");
2578    		areaSel = areaSel.replace(/\//g,"-");			
2579    		areaSel = areaSel.toLowerCase();	
2580    		newSlug = _root_web+'/'+_lang+'/'+prefisso_aree_slug_immobili[_lang]+'-'+areaSel+ '.html';		
2581        	disableSlugImmobiliParameters();
2582    	}
2583    	else if((tipologieImmobiliArray.length != 0) && (areeImmobiliArray.length != 0) && (regioniImmobiliArray.length === 0)){	
2584    		areaSel = nomi_aree_immobili[areeImmobiliArray[0]];				
2585    		areaSel = areaSel.trim();
2586    		areaSel = areaSel.replace(/ /g,"-");
2587    		areaSel = areaSel.replace(/'/g,"");
2588    		areaSel = areaSel.replace(/\//g,"-");			
2589    		areaSel = areaSel.toLowerCase();	
2590    		newSlug = _root_web+'/'+_lang+'/'+tipologie_aree_slug_immobili[tipologieImmobiliArray[0]][_lang]+'-'+areaSel+ '.html';	
2591        	disableSlugImmobiliParameters();	
2592    	}	
2593    	else {		
2594    		if(regioniImmobiliArray.length === 0){			
2595    			newSlug = _root_web+'/'+_lang+'/'+tipologie_italia_slug_immobili[tipologieImmobiliArray[0]][_lang]+'.html';	
2596            	disableSlugImmobiliParameters();	
2597            	$('.buttonSlugImmobili').attr('onclick', 'submitCercaImmobili("' + newSlug + '", true)');
2598            	return newSlug;				
2599    		}
2600    		
2601    		regSel = $("#regione_immobileCheckLabel_"+regioniImmobiliArray[0]).text();			
2602    		regSel = regSel.trim();
2603    		regSel = regSel.replace(/ /g,"-");
2604    		regSel = regSel.replace(/'/g,"");
2605    		regSel = regSel.replace(/\//g,"-");			
2606    		regSel = regSel.toLowerCase();	
2607    		if(regSel == ''){
2608        		regSel = $("#regione_immobileCheckLabel_"+regioniImmobiliArray[0]+"_filtro").text();			
2609        		regSel = regSel.trim();
2610        		regSel = regSel.replace(/ /g,"-");
2611        		regSel = regSel.replace(/'/g,"");
2612        		regSel = regSel.replace(/\//g,"-");			
2613        		regSel = regSel.toLowerCase();	
2614    		}
2615    		if(comuniImmobiliArray.length != 0){
2616    			provSel = $("#provincia_immobileCheckLabel_"+provinceImmobiliArray[0]).text();
2617    			provSel = provSel.trim();
2618    			provSel = provSel.replace(/ /g,"-");
2619    			provSel = provSel.replace(/'/g,"");
2620    			provSel = provSel.replace(/\//g,"-");				
2621    			provSel = provSel.toLowerCase();
2622        		if(provSel == ''){
2623        			provSel = $("#provincia_immobileCheckLabel_"+provinceImmobiliArray[0]+"_filtro").text();		
2624        			provSel = provSel.trim();
2625        			provSel = provSel.replace(/ /g,"-");
2626        			provSel = provSel.replace(/'/g,"");
2627        			provSel = provSel.replace(/\//g,"-");				
2628        			provSel = provSel.toLowerCase();	
2629        		}
2630    			comSel = $("#comune_immobileCheckLabel_"+comuniImmobiliArray[0]).text();
2631    			comSel = comSel.trim();
2632    			comSel = comSel.replace(/ /g,"-");
2633    			comSel = comSel.replace(/'/g,"");
2634    			comSel = comSel.replace(/\//g,"-");				
2635    			comSel = comSel.toLowerCase();			
2636    			comSel = removeAccents(comSel);
2637        		if(comSel == ''){
2638    			comSel = $("#comune_immobileCheckLabel_"+comuniImmobiliArray[0]+"_filtro").text();
2639    			comSel = comSel.trim();
2640    			comSel = comSel.replace(/ /g,"-");
2641    			comSel = comSel.replace(/'/g,"");
2642    			comSel = comSel.replace(/\//g,"-");				
2643    			comSel = comSel.toLowerCase();			
2644    			comSel = removeAccents(comSel);
2645        		}
2646        		
2647    			if(tipologieImmobiliArray.length === 0){
2648        			newSlug = _root_web+'/'+_lang+'/'+prefisso_province_comuni_slug_immobili[_lang]+'-'+regSel+'-'+provSel+ '-'+comSel+ '.html';	
2649                	disableSlugImmobiliParameters();	
2650    			}
2651    			else{
2652        			newSlug = _root_web+'/'+_lang+'/'+tipologie_slug_immobili[tipologieImmobiliArray[0]][_lang]+'-'+provSel+ '-'+comSel+ '.html';	
2653                	disableSlugImmobiliParameters();	
2654    			}
2655    		}							
2656    		else if(provinceImmobiliArray.length != 0){		
2657    			provSel = $("#provincia_immobileCheckLabel_"+provinceImmobiliArray[0]).text();
2658    			provSel = provSel.trim();
2659    			provSel = provSel.replace(/ /g,"-");
2660    			provSel = provSel.replace(/'/g,"");
2661    			provSel = provSel.replace(/\//g,"-");				
2662    			provSel = provSel.toLowerCase();	
2663        		if(provSel == ''){
2664        			provSel = $("#provincia_immobileCheckLabel_"+provinceImmobiliArray[0]+"_filtro").text();		
2665        			provSel = provSel.trim();
2666        			provSel = provSel.replace(/ /g,"-");
2667        			provSel = provSel.replace(/'/g,"");
2668        			provSel = provSel.replace(/\//g,"-");				
2669        			provSel = provSel.toLowerCase();	
2670        		}
2671        		
2672    			if(tipologieImmobiliArray.length === 0){
2673        			newSlug = _root_web+'/'+_lang+'/'+prefisso_province_comuni_slug_immobili[_lang]+'-'+regSel+'-'+provSel+ '.html';	
2674                	disableSlugImmobiliParameters();	
2675    			}
2676    			else{
2677        			newSlug = _root_web+'/'+_lang+'/'+tipologie_slug_immobili[tipologieImmobiliArray[0]][_lang]+'-'+provSel+ '.html';	
2678                	disableSlugImmobiliParameters();	
2679    			}
2680    		}
2681    		else{
2682    			if(tipologieImmobiliArray.length === 0){
2683            		if($('#vicino_al_mare_immobili').val() == 'true'){
2684            			$('#vicino_al_mare_immobili').attr('disabled', 'disabled');
2685            			newSlug = _root_web+'/'+_lang+'/'+mare_slug_immobili[regioniImmobiliArray[0]][_lang];		
2686                		$('.buttonSlugImmobili').attr('onclick', 'submitCercaImmobili("' + newSlug + '", true)');
2687                		disableSlugImmobiliParameters();
2688            			return newSlug;	
2689            		}
2690            		
2691            		newSlug = _root_web+'/'+_lang+'/'+ regioni_slug_immobili[regioniImmobiliArray[0]][_lang] + '.html';	
2692                	disableSlugImmobiliParameters();	
2693    			}
2694    			else{
2695        			newSlug = _root_web+'/'+_lang+'/'+tipologie_slug_immobili[tipologieImmobiliArray[0]][_lang]+'-'+regSel+ '.html';	
2696                	disableSlugImmobiliParameters();
2697    			}
2698    		}	
2699    		
2700    		if(areeImmobiliArray.length != 0){
2701    			$("#aree_immobili").removeAttr('disabled');
2702    		}	
2703    	}
2704	}
2705	else{
2706    	var tipologieAlloggiArray = new Array();
2707    	var areeAlloggiArray = new Array();
2708    	var must_haveAlloggiArray = new Array();
2709		var prArray;
2710		var minPrezzoImmobiliNew = minPreImmobili;
2711		var maxPrezzoImmobiliNew = maxPreImmobili;
2712		
2713    	if($('#tipologie_alloggi').val() != ''){
2714    		tipologieAlloggiArray = $('#tipologie_alloggi').val().split('-');
2715    	}
2716    	if($('#aree_alloggi').val() != ''){
2717    		//areeAlloggiArray = $('#aree_alloggi').val().split('-');
2718    		areeAlloggiArray = $('#aree_alloggi').val().split(',');
2719    	}
2720
2721		newSlug = _root_web+'/'+_lang+'/prestigious-property-search.html';
2722    	disableSlugImmobiliParameters();
2723    	
2724    	if((tipologieAlloggiArray.length == 1) && (areeAlloggiArray.length == 0)){
2725        	if(tipologie_alloggi_to_immobili.hasOwnProperty(tipologieAlloggiArray[0])){
2726    			newSlug = _root_web+'/'+_lang+'/'+tipologie_italia_slug_immobili[tipologie_alloggi_to_immobili[tipologieAlloggiArray[0]]][_lang]+'.html';	
2727            	disableSlugImmobiliParameters();	
2728        	}	
2729    	}
2730    	if((tipologieAlloggiArray.length == 0) && (areeAlloggiArray.length == 1)){
2731        	if(aree_alloggi_to_immobili.hasOwnProperty(areeAlloggiArray[0])){
2732        		areaSel = nomi_aree_immobili[aree_alloggi_to_immobili[areeAlloggiArray[0]]];				
2733        		areaSel = areaSel.trim();
2734        		areaSel = areaSel.replace(/ /g,"-");
2735        		areaSel = areaSel.replace(/'/g,"");
2736        		areaSel = areaSel.replace(/\//g,"-");			
2737        		areaSel = areaSel.toLowerCase();	
2738        		newSlug = _root_web+'/'+_lang+'/'+prefisso_aree_slug_immobili[_lang]+'-'+areaSel+ '.html';		
2739            	disableSlugImmobiliParameters();
2740        	}
2741        	else if(regioni_alloggi_to_immobili.hasOwnProperty(areeAlloggiArray[0])){
2742    			newSlug = _root_web+'/'+_lang+'/'+ regioni_slug_immobili[regioni_alloggi_to_immobili[areeAlloggiArray[0]]][_lang] + '.html';
2743            	disableSlugImmobiliParameters();
2744        	}
2745    	}
2746    	if((tipologieAlloggiArray.length == 1) && (areeAlloggiArray.length == 1)){
2747        	if((tipologie_alloggi_to_immobili.hasOwnProperty(tipologieAlloggiArray[0])) && (aree_alloggi_to_immobili.hasOwnProperty(areeAlloggiArray[0]))){
2748        		areaSel = nomi_aree_immobili[aree_alloggi_to_immobili[areeAlloggiArray[0]]];				
2749        		areaSel = areaSel.trim();
2750        		areaSel = areaSel.replace(/ /g,"-");
2751        		areaSel = areaSel.replace(/'/g,"");
2752        		areaSel = areaSel.replace(/\//g,"-");			
2753        		areaSel = areaSel.toLowerCase();	
2754        		newSlug = _root_web+'/'+_lang+'/'+tipologie_slug_immobili[tipologie_alloggi_to_immobili[tipologieAlloggiArray[0]]][_lang]+'-'+areaSel+ '.html';	
2755            	disableSlugImmobiliParameters();	
2756        	}
2757        	else if((tipologie_alloggi_to_immobili.hasOwnProperty(tipologieAlloggiArray[0])) && (regioni_alloggi_to_immobili.hasOwnProperty(areeAlloggiArray[0]))){
2758        		regSel = nomi_regioni[regioni_alloggi_to_immobili[areeAlloggiArray[0]]][_lang];	
2759        		regSel = regSel.trim();
2760        		regSel = regSel.replace(/ /g,"-");
2761        		regSel = regSel.replace(/'/g,"");
2762        		regSel = regSel.replace(/\//g,"-");			
2763        		regSel = regSel.toLowerCase();	
2764        		newSlug = _root_web+'/'+_lang+'/'+tipologie_slug_immobili[tipologie_alloggi_to_immobili[tipologieAlloggiArray[0]]][_lang]+'-'+regSel+ '.html';	
2765            	disableSlugImmobiliParameters();	
2766        	}
2767    	}
2768    	
2769		prArray = $('#prezzo_alloggi').val().split("-");
2770		if((prArray[0] != minPreAlloggi) || (prArray[1] != maxPreAlloggi)){
2771    		if(prArray[0] >= 200 ){
2772    			minPrezzoImmobiliNew = 250000;
2773    		}
2774    		if(prArray[0] >= 500){
2775    			minPrezzoImmobiliNew = 500000;
2776    		}
2777    		if(prArray[0] >= 1000){
2778    			minPrezzoImmobiliNew = 1000000;
2779    		}
2780    		if(prArray[0] >= 2000){
2781    			minPrezzoImmobiliNew = 2500000;
2782    		}
2783
2784    		if(prArray[1] < 500){
2785    			maxPrezzoImmobiliNew = 500000;
2786    		}
2787    		if(prArray[1] < 1000){
2788    			maxPrezzoImmobiliNew = 1000000;
2789    		}
2790    		if(prArray[1] < 2000){
2791    			maxPrezzoImmobiliNew = 2500000;
2792    		}
2793
2794			if(minPrezzoImmobiliNew == maxPrezzoImmobiliNew){
2795				maxPrezzoImmobiliNew += 1000000;
2796				$('#prezzo_immobili').val(minPrezzoImmobiliNew + '-' + maxPrezzoImmobiliNew);
2797			}
2798			else{
2799				$('#prezzo_immobili').val(minPrezzoImmobiliNew + '-' + maxPrezzoImmobiliNew);
2800			}
2801		}
2802	}		
2803	
2804	$('.buttonSlugImmobili').attr('onclick', 'submitCercaImmobili("' + newSlug + '", true)');
2805	return newSlug;	
2806}
2807
2808function refreshSlugAlloggi() {
2809	var newSlug = '';
2810	var tipologieAlloggiArray = new Array();
2811	var areeAlloggiArray = new Array();
2812	var must_haveAlloggiArray = new Array();
2813
2814	if(session_type_search_active == 2){
2815    	if($('#tipologie_alloggi').val() != ''){
2816    		tipologieAlloggiArray = $('#tipologie_alloggi').val().split('-');
2817    	}
2818    	if($('#aree_alloggi').val() != ''){
2819    		//areeAlloggiArray = $('#aree_alloggi').val().split('-');
2820    		areeAlloggiArray = $('#aree_alloggi').val().split(',');
2821    	}
2822    	if($('#must_have_alloggi').val() != ''){
2823    		must_haveAlloggiArray = $('#must_have_alloggi').val().split('-');
2824    	}
2825    	
2826    	if((areeAlloggiArray.length > 1) && (areeAlloggiArray[0] == 1)){
2827    		areeAlloggiArray = new Array();
2828    		areeAlloggiArray[0] = '1';
2829    	}
2830    	else if((areeAlloggiArray.length > 1) && (areeAlloggiArray[0] == 16)){
2831    		areeAlloggiArray = new Array();
2832    		areeAlloggiArray[0] = '16';
2833    	}
2834    	else if((areeAlloggiArray.length > 1) && (areeAlloggiArray[0] == 12)){
2835    		areeAlloggiArray = new Array();
2836    		areeAlloggiArray[0] = '12';
2837    	}
2838    	
2839    	if((tipologieAlloggiArray.length == 0) && (areeAlloggiArray.length == 0) && (must_haveAlloggiArray.length == 0)){
2840    		newSlug = _root_web+'/'+_lang+'/luxury-rentals-search.html';
2841        	disableSlugAlloggiParameters();
2842    	}
2843    	if(((tipologieAlloggiArray.length > 1) || (areeAlloggiArray.length > 1) || (must_haveAlloggiArray.length > 1)) ||
2844    		(((tipologieAlloggiArray.length > 0) && (areeAlloggiArray.length > 0)) || 
2845    		((tipologieAlloggiArray.length > 0) && (must_haveAlloggiArray.length > 0)) ||
2846    		((areeAlloggiArray.length > 0) && (must_haveAlloggiArray.length > 0)))){
2847    		newSlug = _root_web+'/'+_lang+'/customized-luxury-rentals-search.html';
2848    		$("#tipologie_alloggi").removeAttr('disabled');
2849    		$("#aree_alloggi").removeAttr('disabled');
2850    		$("#must_have_alloggi").removeAttr('disabled');
2851    	}
2852    	if((tipologieAlloggiArray.length == 1) && (areeAlloggiArray.length == 0) && (must_haveAlloggiArray.length == 0)){
2853    		newSlug = _root_web+'/'+_lang+'/'+tipologie_italia_slug_alloggi[tipologieAlloggiArray[0]][_lang];
2854        	disableSlugAlloggiParameters();
2855    	}
2856    	if((tipologieAlloggiArray.length == 0) && (areeAlloggiArray.length == 1) && (must_haveAlloggiArray.length == 0)){
2857    		newSlug = _root_web+'/'+_lang+'/'+aree_slug_alloggi[areeAlloggiArray[0]][_lang];
2858        	disableSlugAlloggiParameters();
2859    	}
2860    	if((tipologieAlloggiArray.length == 1) && (areeAlloggiArray.length == 1) && (must_haveAlloggiArray.length == 0)){
2861    		newSlug = _root_web+'/'+_lang+'/'+tipologie_slug_alloggi[tipologieAlloggiArray[0]][_lang]+'-'+aree_singole_slug_alloggi[areeAlloggiArray[0]][_lang];
2862        	disableSlugAlloggiParameters();
2863    	}
2864    	if((tipologieAlloggiArray.length == 0) && (areeAlloggiArray.length == 0) && (must_haveAlloggiArray.length == 1)){
2865    		newSlug = _root_web+'/'+_lang+'/'+must_have_slug_alloggi[must_haveAlloggiArray[0]][_lang];
2866        	disableSlugAlloggiParameters();
2867    	}
2868	}
2869	else{
2870    	var tipologieImmobiliArray = new Array();
2871    	var areeImmobiliArray = new Array();
2872    	var regioniImmobiliArray = new Array();
2873    	var provinceImmobiliArray = new Array();
2874    	var comuniImmobiliArray = new Array();
2875		var prArray;
2876		var minPrezzoAlloggiNew = minPreAlloggi;
2877		var maxPrezzoAlloggiNew = maxPreAlloggi;
2878		var langTmp = _lang;
2879				
2880		if(_lang == 'ru'){
2881			langTmp = 'en';
2882		}
2883		
2884    	if($('#tipologie_immobili').val() != ''){
2885    		tipologieImmobiliArray = $('#tipologie_immobili').val().split('-');
2886    	}
2887    	if($('#aree_immobili').val() != ''){
2888    		areeImmobiliArray = $('#aree_immobili').val().split('-');
2889    	}
2890    	if($('#regioni_immobili').val() != ''){
2891    		regioniImmobiliArray = $('#regioni_immobili').val().split('-');
2892    	}
2893    	if($('#province_immobili').val() != ''){
2894    		provinceImmobiliArray = $('#province_immobili').val().split('-');
2895    	}
2896    	if($('#comuni_immobili').val() != ''){
2897    		comuniImmobiliArray = $('#comuni_immobili').val().split('-');
2898    	}
2899    	
2900    	newSlug = _root_web+'/'+langTmp+'/luxury-rentals-search.html';
2901    	$("#tipologie_alloggi").removeAttr('disabled');
2902    	$("#aree_alloggi").removeAttr('disabled');
2903    	$("#must_have_alloggi").removeAttr('disabled');
2904    	
2905    	if((tipologieImmobiliArray.length != 0) && (areeImmobiliArray.length === 0) && (regioniImmobiliArray.length === 0)){	
2906        	if(tipologie_immobili_to_alloggi.hasOwnProperty(tipologieImmobiliArray[0])){
2907        		newSlug = _root_web+'/'+langTmp+'/'+tipologie_italia_slug_alloggi[tipologie_immobili_to_alloggi[tipologieImmobiliArray[0]]][langTmp];
2908        		disableSlugAlloggiParameters();	
2909        	}	
2910    	}
2911    	else if((tipologieImmobiliArray.length === 0) && (areeImmobiliArray.length != 0) && (regioniImmobiliArray.length === 0)){	
2912        	if(aree_immobili_to_alloggi.hasOwnProperty(areeImmobiliArray[0])){
2913        		newSlug = _root_web+'/'+langTmp+'/'+aree_slug_alloggi[aree_immobili_to_alloggi[areeImmobiliArray[0]]][langTmp];
2914            	disableSlugAlloggiParameters();	
2915        	}
2916    	}
2917    	else if((tipologieImmobiliArray.length === 0) && (areeImmobiliArray.length === 0) && (regioniImmobiliArray.length != 0)){	
2918        	if(regioni_immobili_to_alloggi.hasOwnProperty(regioniImmobiliArray[0])){
2919        		newSlug = _root_web+'/'+langTmp+'/'+aree_slug_alloggi[regioni_immobili_to_alloggi[regioniImmobiliArray[0]]][langTmp];
2920            	disableSlugAlloggiParameters();	
2921        	}
2922    	}
2923    	else if((tipologieImmobiliArray.length != 0) && (areeImmobiliArray.length != 0) && (regioniImmobiliArray.length === 0)){	
2924        	if((tipologie_immobili_to_alloggi.hasOwnProperty(tipologieImmobiliArray[0])) && (aree_immobili_to_alloggi.hasOwnProperty(areeImmobiliArray[0]))){
2925        		newSlug = _root_web+'/'+langTmp+'/'+tipologie_slug_alloggi[tipologie_immobili_to_alloggi[tipologieImmobiliArray[0]]][langTmp]+'-'+aree_singole_slug_alloggi[aree_immobili_to_alloggi[areeImmobiliArray[0]]][langTmp];
2926        		disableSlugAlloggiParameters();	
2927        	}
2928    	}	
2929    	else if((tipologieImmobiliArray.length != 0) && (areeImmobiliArray.length === 0) && (regioniImmobiliArray.length != 0)){	
2930        	if((tipologie_immobili_to_alloggi.hasOwnProperty(tipologieImmobiliArray[0])) && (regioni_immobili_to_alloggi.hasOwnProperty(regioniImmobiliArray[0]))){
2931        		newSlug = _root_web+'/'+langTmp+'/'+tipologie_slug_alloggi[tipologie_immobili_to_alloggi[tipologieImmobiliArray[0]]][langTmp]+'-'+aree_singole_slug_alloggi[regioni_immobili_to_alloggi[regioniImmobiliArray[0]]][langTmp];
2932        		disableSlugAlloggiParameters();	
2933        	}
2934    	}	
2935    	
2936		prArray = $('#prezzo_immobili').val().split("-");
2937		if((prArray[0] != minPreImmobili) || (prArray[1] != maxPreImmobili)){
2938    		if(prArray[0] >= 250000 ){
2939    			minPrezzoAlloggiNew = 200;
2940    		}
2941    		if(prArray[0] >= 500000){
2942    			minPrezzoAlloggiNew = 500;
2943    		}
2944    		if(prArray[0] >= 1000000){
2945    			minPrezzoAlloggiNew = 1000;
2946    		}
2947    		if(prArray[0] >= 2500000){
2948    			minPrezzoAlloggiNew = 2000;
2949    		}
2950
2951    		if(prArray[1] < 500000){
2952    			maxPrezzoAlloggiNew = 500;
2953    		}
2954    		if(prArray[1] < 1000000){
2955    			maxPrezzoAlloggiNew = 1000;
2956    		}
2957    		if(prArray[1] < 2500000){
2958    			maxPrezzoAlloggiNew = 2000;
2959    		}
2960
2961			if(minPrezzoAlloggiNew == maxPrezzoAlloggiNew){
2962				maxPrezzoAlloggiNew += 100;
2963				$('#prezzo_alloggi').val(minPrezzoAlloggiNew + '-' + maxPrezzoAlloggiNew);
2964			}
2965			else{
2966				$('#prezzo_alloggi').val(minPrezzoAlloggiNew + '-' + maxPrezzoAlloggiNew);
2967			}
2968		}
2969	}
2970	
2971	$('.buttonSlugAlloggi').attr('onclick', 'submitCercaAlloggi("' + newSlug + '", true)');	
2972	return newSlug;
2973}
2974
2975function refreshTotImmobili() {	
2976	var immobiliDataParams = {};
2977	
2978	if($('#tipologie_immobili').val()){
2979		immobiliDataParams['tipologie'] = $('#tipologie_immobili').val();
2980	}
2981	if($('#aree_immobili').val()){
2982		immobiliDataParams['aree'] = $('#aree_immobili').val();
2983	}
2984	if($('#regioni_immobili').val()){
2985		immobiliDataParams['regioni'] = $('#regioni_immobili').val();
2986	}
2987	if($('#province_immobili').val()){
2988		immobiliDataParams['province'] = $('#province_immobili').val();
2989	}
2990	if($('#comuni_immobili').val()){
2991		immobiliDataParams['comuni'] = $('#comuni_immobili').val();
2992	}
2993	if($('#prezzo_immobili').val()){
2994		let prezzoArray = $('#prezzo_immobili').val().split("-");
2995		if((prezzoArray[0] != minPreImmobili) || (prezzoArray[1] != maxPreImmobili)){
2996    		immobiliDataParams['prezzo_da'] = prezzoArray[0];
2997    		immobiliDataParams['prezzo_a'] = prezzoArray[1];
2998		}
2999	}
3000	if($('#camere_immobili').val()){
3001		let camereArray = $('#camere_immobili').val().split("-");
3002		if((camereArray[0] != 0) || (camereArray[1] != 1000)){
3003    		immobiliDataParams['camere_da'] = camereArray[0];
3004    		immobiliDataParams['camere_a'] = camereArray[1];
3005		}
3006	}
3007	if($('#bagni_immobili').val()){
3008		let bagniArray = $('#bagni_immobili').val().split("-");
3009		if((bagniArray[0] != 0) || (bagniArray[1] != 1000)){
3010    		immobiliDataParams['bagni_da'] = bagniArray[0];
3011    		immobiliDataParams['bagni_a'] = bagniArray[1];
3012		}
3013	}
3014	if($('#superficie_immobili').val()){
3015		let superficieArray = $('#superficie_immobili').val().split("-");
3016		if((superficieArray[0] != minSupImmobili) || (superficieArray[1] != maxSupImmobili)){
3017    		immobiliDataParams['superficie_da'] = superficieArray[0];
3018    		immobiliDataParams['superficie_a'] = superficieArray[1];
3019		}
3020	}	
3021	if(($('#terreno_immobiliCheck').is(":checked")) && ($('#terreno_immobili').val())){
3022		let terrenoArray = $('#terreno_immobili').val().split("-");
3023		immobiliDataParams['terreno_da'] = terrenoArray[0];
3024		immobiliDataParams['terreno_a'] = terrenoArray[1];
3025	}
3026	if($('#condizioni_immobili').val()){
3027		immobiliDataParams['condizioni'] = $('#condizioni_immobili').val();
3028	}
3029	if($('#collina_immobili').val() == 'true'){
3030		immobiliDataParams['collina'] = true;
3031	}
3032	if($('#pianura_immobili').val() == 'true'){
3033		immobiliDataParams['pianura'] = true;
3034	}
3035	if($('#vicino_ai_servizi_immobili').val() == 'true'){
3036		immobiliDataParams['vicino_ai_servizi'] = true;
3037	}
3038	if($('#centro_storico_immobili').val() == 'true'){
3039		immobiliDataParams['centro_storico'] = true;
3040	}
3041	if($('#vicino_al_mare_immobili').val() == 'true'){
3042		immobiliDataParams['vicino_al_mare'] = true;
3043	}
3044	if($('#vicino_al_lago_immobili').val() == 'true'){
3045		immobiliDataParams['vicino_al_lago'] = true;
3046	}
3047	if($('#piscina_immobili').val() == 'true'){
3048		immobiliDataParams['piscina'] = true;
3049	}
3050	if($('#recinzione_immobili').val() == 'true'){
3051		immobiliDataParams['recinzione'] = true;
3052	}
3053	if($('#palestra_immobili').val() == 'true'){
3054		immobiliDataParams['palestra'] = true;
3055	}
3056	if($('#spa_immobili').val() == 'true'){
3057		immobiliDataParams['spa'] = true;
3058	}
3059	if($('#giardino_immobili').val() == 'true'){
3060		immobiliDataParams['giardino'] = true;
3061	}
3062	if($('#area_barbecue_immobili').val() == 'true'){
3063		immobiliDataParams['area_barbecue'] = true;
3064	}
3065	if($('#terrazza_abitabile_immobili').val() == 'true'){
3066		immobiliDataParams['terrazza_abitabile'] = true;
3067	}
3068	if($('#ascensore_immobili').val() == 'true'){
3069		immobiliDataParams['ascensore'] = true;
3070	}
3071	if($('#garage_immobili').val() == 'true'){
3072		immobiliDataParams['garage'] = true;
3073	}
3074	if($('#strada_accesso_privata_immobili').val() == 'true'){
3075		immobiliDataParams['strada_accesso_privata'] = true;
3076	}
3077	if($('#allarme_immobili').val() == 'true'){
3078		immobiliDataParams['allarme'] = true;
3079	}
3080	if($('#arredato_immobili').val() == 'true'){
3081		immobiliDataParams['arredato'] = true;
3082	}
3083	if($('#venduto_immobili').val() == 'true'){
3084		immobiliDataParams['venduti'] = true;
3085	}
3086	if($('#in_trattativa_immobili').val() == 'true'){
3087		immobiliDataParams['in_trattativa'] = true;
3088	}
3089	if($('#nuovo_sul_mercato_immobili').val() == 'true'){
3090		immobiliDataParams['nuovo_sul_mercato'] = true;
3091	}
3092	if($('#alta_motivazione_immobili').val() == 'true'){
3093		immobiliDataParams['alta_motivazione'] = true;
3094	}
3095	if($('#veloce_tempistica_immobili').val() == 'true'){
3096		immobiliDataParams['veloce_tempistica'] = true;
3097	}
3098	if($('#super_prezzo_immobili').val() == 'true'){
3099		immobiliDataParams['super_prezzo'] = true;
3100	}
3101	if($('#ottimo_prezzo_immobili').val() == 'true'){
3102		immobiliDataParams['ottimo_prezzo'] = true;
3103	}
3104	if($('#buon_prezzo_immobili').val() == 'true'){
3105		immobiliDataParams['buon_prezzo'] = true;
3106	}	
3107	if($('#virtual_tour_immobili').val() == 'true'){
3108		immobiliDataParams['virtual_tour'] = true;
3109	}
3110	if($('#video_professionale_immobili').val() == 'true'){
3111		immobiliDataParams['video_professionale'] = true;
3112	}
3113	if($('#video_amatoriale_immobili').val() == 'true'){
3114		immobiliDataParams['video_amatoriale'] = true;
3115	}
3116	
3117	var url = '';
3118	
3119      		url = _api+'greatestate/tot_immobili';
3120        
3121	$.ajax({
3122        url: url,
3123        type: 'POST',	            
3124        crossDomain: true,     
3125        data: immobiliDataParams,	       
3126        xhrFields:
3127        {
3128            withCredentials: true
3129        },
3130        error: function (error) {
3131        	console.log(error);
3132        	return;
3133        }
3134    }).done(function(json) {
3135                    if(json.rows[0].numero_immobili == 0){
3136            	$('#btnCercaFiltriImmobili').addClass("disabled");
3137            	$('#btnCercaFiltriImmobili').html('<b>No result</b>');
3138            }
3139            else{
3140            	$('#btnCercaFiltriImmobili').removeClass("disabled");
3141            	$('#btnCercaFiltriImmobili').html('<b>Show '+json.rows[0].numero_immobili+' results</b>');
3142            }
3143            });	
3144}
3145
3146function refreshTotAlloggi() {	
3147	var alloggiDataParams = {};
3148	
3149	if($('#tipologie_alloggi').val()){
3150		alloggiDataParams['tipologie'] = $('#tipologie_alloggi').val();
3151	}
3152	if($('#aree_alloggi').val()){
3153		alloggiDataParams['aree'] = $('#aree_alloggi').val();
3154	}
3155	if($('#must_have_alloggi').val()){
3156		alloggiDataParams['must_have'] = $('#must_have_alloggi').val();
3157	}
3158	if($('#daterange_alloggi').val()){
3159		let date = $('#daterange_alloggi').val().split("-");
3160
3161		let startD = moment(date[0], 'DD/MM/YYYY');
3162		let endD = moment(date[1], 'DD/MM/YYYY');
3163		let gg_diff = endD.diff(startD, 'days');
3164		
3165		alloggiDataParams['data_da'] = startD.format('YYYY-MM-DD');
3166		alloggiDataParams['data_a'] = endD.format('YYYY-MM-DD');
3167		alloggiDataParams['gg_diff'] = gg_diff + 1;
3168	}
3169	if($('#ospiti_alloggi').val() && $('#ospiti_alloggi').val() != 0){
3170		alloggiDataParams['numero_persone'] = $('#ospiti_alloggi').val();
3171	}
3172	if($('#prezzo_alloggi').val()){
3173		let prezzoArray = $('#prezzo_alloggi').val().split("-");
3174		if((prezzoArray[0] != minPreAlloggi) || (prezzoArray[1] != maxPreAlloggi)){
3175        	alloggiDataParams['prezzo_da'] = $('#prezzo_da_input_alloggi_filtro').val();
3176        	alloggiDataParams['prezzo_a'] = $('#prezzo_a_input_alloggi_filtro').val();
3177		}
3178	}
3179	if($('#camere_alloggi').val()){
3180		let camereArray = $('#camere_alloggi').val().split("-");
3181		if((camereArray[0] != 1) || (camereArray[1] != 1000)){
3182        	alloggiDataParams['camere_da'] = $('#camere_da_alloggi_filtro').val();
3183        	alloggiDataParams['camere_a'] = $('#camere_a_alloggi_filtro').val();
3184		}
3185	}
3186	if($('#bagni_alloggi').val()){
3187		let bagniArray = $('#bagni_alloggi').val().split("-");
3188		if((bagniArray[0] != 1) || (bagniArray[1] != 1000)){
3189        	alloggiDataParams['bagni_da'] = $('#bagni_da_alloggi_filtro').val();
3190        	alloggiDataParams['bagni_a'] = $('#bagni_a_alloggi_filtro').val();
3191		}
3192	}
3193	if($('#animals_allowed_alloggi').val() == 'true'){
3194		alloggiDataParams['animals_allowed'] = true;
3195	}
3196	if($('#sauna_alloggi').val() == 'true'){
3197		alloggiDataParams['sauna'] = true;
3198	}
3199	if($('#bike_alloggi').val() == 'true'){
3200		alloggiDataParams['bike'] = true;
3201	}
3202	if($('#gym_alloggi').val() == 'true'){
3203		alloggiDataParams['gym'] = true;
3204	}
3205	if($('#fireplace_alloggi').val() == 'true'){
3206		alloggiDataParams['fireplace'] = true;
3207	}
3208	if($('#jacuzzi_alloggi').val() == 'true'){
3209		alloggiDataParams['jacuzzi'] = true;
3210	}
3211	if($('#eco_friendly_alloggi').val() == 'true'){
3212		alloggiDataParams['eco_friendly'] = true;
3213	}
3214	if($('#golf_alloggi').val() == 'true'){
3215		alloggiDataParams['golf'] = true;
3216	}
3217	if($('#pool_alloggi').val() == 'true'){
3218		alloggiDataParams['pool'] = true;
3219	}
3220	if($('#tennis_alloggi').val() == 'true'){
3221		alloggiDataParams['tennis'] = true;
3222	}
3223	if($('#smart_working_alloggi').val() == 'true'){
3224		alloggiDataParams['smart_working'] = true;
3225	}
3226	if($('#wifi_alloggi').val() == 'true'){
3227		alloggiDataParams['wifi'] = true;
3228	}
3229	if($('#barrier_free_alloggi').val() == 'true'){
3230		alloggiDataParams['barrier_free'] = true;
3231	}
3232	if($('#fenced_garden_alloggi').val() == 'true'){
3233		alloggiDataParams['fenced_garden'] = true;
3234	}
3235	if($('#air_conditioned_alloggi').val() == 'true'){
3236		alloggiDataParams['air_conditioned'] = true;
3237	}
3238	if($('#safe_for_kids_alloggi').val() == 'true'){
3239		alloggiDataParams['safe_for_kids'] = true;
3240	}
3241	if($('#virtual_tour_alloggi').val() == 'true'){
3242		alloggiDataParams['virtual_tour'] = true;
3243	}
3244	if($('#video_alloggi').val() == 'true'){
3245		alloggiDataParams['video'] = true;
3246	}
3247	
3248	var url = _api+'greatestate/tot_alloggi/'+(_lang == 'ru' ? 'en' : _lang);
3249	
3250	$.ajax({
3251        url: url,
3252        type: 'POST',	            
3253        crossDomain: true,     
3254        data: alloggiDataParams,	       
3255        xhrFields:
3256        {
3257            withCredentials: true
3258        },
3259        error: function (error) {
3260        	console.log(error);
3261        	return;
3262        }
3263    }).done(function(json) {
3264        if(json.rows[0].numero_alloggi == 0){
3265        	$('#btnCercaFiltriAlloggi').addClass("disabled");
3266        	$('#btnCercaFiltriAlloggi').html('<b>No result</b>');
3267        }
3268        else{
3269        	$('#btnCercaFiltriAlloggi').removeClass("disabled");
3270        	$('#btnCercaFiltriAlloggi').html('<b>Show '+json.rows[0].numero_alloggi+' results</b>');
3271        }
3272    });		
3273}
3274
3275function listaTipologieImmobili(type) {	
3276	var html_option = '';
3277	var html_option_all = '';
3278	var html_option_filtro = '';
3279	
3280	var url = _api+'greatestate/tipologie_immobili';
3281	
3282	$.ajax({
3283        url: url,
3284        type: 'POST',	            
3285        crossDomain: true,   
3286        data: {
3287        	aree: $('#aree_immobili').val(),  	
3288        	regioni: $('#regioni_immobili').val(),  	
3289        	province: $('#province_immobili').val(),
3290        	comuni: $('#comuni_immobili').val(),
3291        	vicino_al_mare: $('#vicino_al_mare_immobili').val(),
3292        	venduti: $('#venduto_immobili').val()
3293        },         
3294        xhrFields:
3295        {
3296            withCredentials: true
3297        },
3298        error: function (error) {
3299        	console.log(error);
3300        	return;
3301        }
3302    }).done(function(json) {
3303		var jsonTipologieImmobili = json.rows;
3304		var jsonLenght = jsonTipologieImmobili.length;
3305
3306    	var tipologieImmobiliArraySel = $('#tipologie_immobili').val().split('-');
3307    	tipologieImmobiliArraySel = tipologieImmobiliArraySel.map(Number);
3308        
3309        for (var i = 0; i < jsonLenght; i++) {
3310    		if(((i % 3) == 0) && ($(window).width() > 992)){
3311    			html_option_filtro += '<div class="row">';
3312    		}
3313    			html_option_filtro += '<div class="col col-lg-4 col-md-6 col-sm-6 col-12 paddingZero">';
3314    				html_option_filtro += '<input class="form-check-input checkStyleImmobili tipologie_immobiliCheck_filtro" '+(tipologieImmobiliArraySel.includes(jsonTipologieImmobili[i].diz_tipologia_greatestate_id) == true ? "checked" : "" )+' value="' + jsonTipologieImmobili[i].diz_tipologia_greatestate_id + '" type="checkbox" id="tipologia_immobileCheck_' + jsonTipologieImmobili[i].diz_tipologia_greatestate_id + '_filtro">';
3315    				html_option_filtro += '<label class="form-check-label checkLabelStyleImmobili_filtro" for="tipologia_immobileCheck_' + jsonTipologieImmobili[i].diz_tipologia_greatestate_id + '_filtro" id="tipologia_immobileCheckLabel_' + jsonTipologieImmobili[i].diz_tipologia_greatestate_id + '_filtro">' + eval('jsonTipologieImmobili[i].diz_tipologia_greatestate_definizione_'+_lang) + '</label>';
3316    			html_option_filtro += '</div>';
3317    		if(((((i - 2) % 3) == 0) && ((i - 2) >= 0)) && ($(window).width() > 992)){
3318    			html_option_filtro += '</div>';
3319    		}
3320
3321    		html_option += '<li>';
3322    			html_option += '<input class="form-check-input checkStyleImmobili tipologie_immobiliCheck" '+(tipologieImmobiliArraySel.includes(jsonTipologieImmobili[i].diz_tipologia_greatestate_id) == true ? "checked" : "" )+' value="' + jsonTipologieImmobili[i].diz_tipologia_greatestate_id + '" type="checkbox" id="tipologia_immobileCheck_' + jsonTipologieImmobili[i].diz_tipologia_greatestate_id + '">';
3323        		html_option += '<label class="form-check-label checkLabelStyleImmobili" for="tipologia_immobileCheck_' + jsonTipologieImmobili[i].diz_tipologia_greatestate_id + '" id="tipologia_immobileCheckLabel_' + jsonTipologieImmobili[i].diz_tipologia_greatestate_id + '">' + eval('jsonTipologieImmobili[i].diz_tipologia_greatestate_definizione_'+_lang) + '</label>';
3324    		html_option += '</li>';
3325        }
3326        
3327		html_option += '<li class="text-center">';
3328				html_option += '<button type="button" id="annullaButtonTipologieImmobili" class="btn btn-primary applicaButton text-uppercase"><b>Cancel</b></button>';
3329            	            		html_option += '<button type="button" id="applicaButtonTipologieImmobili" class="btn btn-primary applicaButton buttonSlugImmobili text-uppercase" onclick="submitCercaImmobili(\'prestigious-property-search.html\', true)">';
3330            					html_option += '<b>Apply</b>';
3331			html_option += '</button>';
3332		html_option += '</li>';
3333
3334        html_option_all += '<li>';
3335            html_option_all += '<input class="form-check-input checkStyleImmobili" type="checkbox" id="tipologie_immobiliCheckAll">';
3336            html_option_all += '<label class="form-check-label checkLabelStyleImmobili" for="tipologie_immobiliCheckAll">All</label>';
3337        html_option_all += '</li>';
3338
3339        html_option = html_option_all + html_option;
3340
3341        $("#tipologie_immobili_multiselect").empty().append(html_option);
3342        $("#tipologie_immobili_filtro").empty().append(html_option_filtro);
3343
3344        updateTipologieLocationsImmobili('tipologie_immobili', type);
3345        
3346        printLabelRicercaImmobili('tipologie_immobili', 'tipologie_immobili', type);
3347
3348		$("#annullaButtonTipologieImmobili").click(function() {
3349			$("#tipologie_immobiliBtn").dropdown("toggle");
3350			
3351			$('#tipologie_immobili').val('');
3352			$('#tipologie_immobiliBtn').html('What kind of housing are you looking for?');
3353			/*$('#tipologie_immobiliBtn').css('color', '#fff');
3354			$('#tipologie_immobiliBtn').css('opacity', '0.3');*/
3355			$('#tipologie_immobiliBtn').css('color', '#9b9a9e');
3356			$('#tipologie_immobiliBtn').css('opacity', '1');
3357			
3358			$('.cleantipologie_immobili').remove();
3359			
3360			$(".tipologie_immobiliCheck").prop("checked", false);
3361			$(".tipologie_immobiliCheck_filtro").prop("checked", false);
3362			$("#tipologie_immobiliCheckAll").prop("checked", false);
3363			$("#tipologie_immobiliCheckAll_filtro").prop("checked", false);
3364			
3365            listaAreeImmobili(false);
3366            listaRegioniImmobili(false);
3367		});
3368    	    	
3369		$("#tipologie_immobiliCheckAll, #tipologie_immobiliCheckAll_filtro").click(function() {
3370			if($("#"+this.id).is(":checked") == true){
3371				var tipId = '';
3372				var numTipologieImmobiliCheck = 0;
3373
3374				if((this.id).includes("filtro") == true){
3375					$('input.tipologie_immobiliCheck_filtro[type=checkbox]').each(function () {
3376						tipId += this.value+'-';
3377						numTipologieImmobiliCheck++;
3378				 	});
3379				}
3380				else{
3381					$('input.tipologie_immobiliCheck[type=checkbox]').each(function () {
3382						tipId += this.value+'-';
3383						numTipologieImmobiliCheck++;
3384				 	});
3385				}
3386
3387				$('#tipologie_immobiliBtn').css('color', '#007574');
3388				$('#tipologie_immobiliBtn').css('opacity', '1');
3389				$('#tipologie_immobiliBtn').html(numTipologieImmobiliCheck + ' Selected types');
3390				$('#tipologie_immobiliBtn').parent().prepend('<div class="closeBtnDropdownAbsolute cleantipologie_immobili"><i class="fa-solid fa-xmark"></i></div>');
3391				
3392				$(".tipologie_immobiliCheck").prop("checked", true);
3393				$(".tipologie_immobiliCheck_filtro").prop("checked", true);
3394				$("#tipologie_immobiliCheckAll").prop("checked", true);
3395				$("#tipologie_immobiliCheckAll_filtro").prop("checked", true);
3396			 	
3397			 	tipId = tipId.substr(0, tipId.length - 1);
3398			 	
3399				$('#tipologie_immobili').val(tipId);	
3400			}
3401			else{
3402				$('#tipologie_immobili').val('');
3403				$('#tipologie_immobiliBtn').html('What kind of housing are you looking for?');
3404				/*$('#tipologie_immobiliBtn').css('color', '#fff');
3405				$('#tipologie_immobiliBtn').css('opacity', '0.3');*/
3406				$('#tipologie_immobiliBtn').css('color', '#9b9a9e');
3407				$('#tipologie_immobiliBtn').css('opacity', '1');
3408				
3409				$('.cleantipologie_immobili').remove();
3410				
3411				$(".tipologie_immobiliCheck").prop("checked", false);
3412				$(".tipologie_immobiliCheck_filtro").prop("checked", false);
3413				$("#tipologie_immobiliCheckAll").prop("checked", false);
3414				$("#tipologie_immobiliCheckAll_filtro").prop("checked", false);
3415			}
3416
3417			updateTipologieLocationsImmobili('tipologie_immobili', (this.id).includes("filtro"));
3418			
3419			printLabelRicercaImmobili('tipologie_immobili', 'tipologie_immobili', type);
3420			
3421			listaAreeImmobili((this.id).includes("filtro"));
3422			listaRegioniImmobili((this.id).includes("filtro"));
3423			listaProvinceImmobili((this.id).includes("filtro"));
3424			listaComuniImmobili((this.id).includes("filtro"));
3425		});
3426
3427		$(".tipologie_immobiliCheck, .tipologie_immobiliCheck_filtro").click(function() {		
3428			if(this.checked){
3429				$("#tipologia_immobileCheck_"+this.value).prop("checked", true);
3430				$("#tipologia_immobileCheck_"+this.value+"_filtro").prop("checked", true);
3431			}
3432			else{
3433				$("#tipologia_immobileCheck_"+this.value).prop("checked", false);
3434				$("#tipologia_immobileCheck_"+this.value+"_filtro").prop("checked", false);
3435			}
3436
3437			updateTipologieLocationsImmobili('tipologie_immobili', (this.id).includes("filtro"));
3438			
3439			printLabelRicercaImmobili('tipologie_immobili', 'tipologie_immobili', type);
3440			
3441            listaAreeImmobili((this.id).includes("filtro"));
3442            listaRegioniImmobili((this.id).includes("filtro"));
3443            listaProvinceImmobili((this.id).includes("filtro"));
3444            listaComuniImmobili((this.id).includes("filtro"));
3445		});
3446    });	
3447}
3448
3449function listaAreeImmobili(type) {	
3450	var html_option = '';
3451	var html_option_filtro = '';
3452	
3453	var url = _api+'greatestate/aree_immobili';
3454	
3455	$.ajax({
3456        url: url,
3457        type: 'POST',	            
3458        crossDomain: true,        
3459        data: {
3460        	tipologie: $('#tipologie_immobili').val(),     		
3461        	regioni: $('#regioni_immobili').val(),  	
3462        	province: $('#province_immobili').val(),
3463        	comuni: $('#comuni_immobili').val(),
3464        	vicino_al_mare: $('#vicino_al_mare_immobili').val(),
3465        	venduti: $('#venduto_immobili').val()
3466        }, 
3467        xhrFields:
3468        {
3469            withCredentials: true
3470        },
3471        error: function (error) {
3472        	console.log(error);
3473        	return;
3474        }
3475    }).done(function(json) {
3476		var jsonAreeImmobili = json.rows;
3477		var jsonLenght = jsonAreeImmobili.length;
3478		var macro_aree_switch = 0;
3479		
3480		if(jsonLenght != 0){
3481			var areeImmobiliArraySel = $('#aree_immobili').val().split('-');
3482    		areeImmobiliArraySel = areeImmobiliArraySel.map(Number);
3483    
3484            html_option += '<li class="colsSpan">';
3485                html_option += '<input class="form-check-input checkStyleImmobili" type="checkbox" id="aree_immobiliCheckAll">';
3486            	html_option += '<label class="form-check-label checkLabelStyleImmobili" for="aree_immobiliCheckAll">All</label>';
3487    		html_option += '</li>';
3488
3489            html_option_filtro += '<li class="colsSpan">';
3490                html_option_filtro += '<input class="form-check-input checkStyleImmobili" type="checkbox" id="aree_immobiliCheckAll_filtro">';
3491            	html_option_filtro += '<label class="form-check-label checkAllLabelStyleImmobili_filtro" for="aree_immobiliCheckAll_filtro">All</label>';
3492    		html_option_filtro += '</li>';
3493            
3494            for (var i = 0; i < jsonLenght; i++) {
3495                if(jsonAreeImmobili[i].id_macro_aree != macro_aree_switch){
3496                	macro_aree_switch = jsonAreeImmobili[i].id_macro_aree;
3497                	
3498                	if(jsonAreeImmobili[i].id_macro_aree == 1){
3499                		html_option += '<li>';
3500            				html_option += '<input class="form-check-input checkStyleImmobili aree_immobiliCheckParent" value="' + macro_aree_switch + '" type="checkbox" id="area_immobileCheckParent_' + macro_aree_switch + '">';
3501                			html_option += '<label class="form-check-label checkLabelStyleImmobili" for="area_immobileCheckParent_' + macro_aree_switch + '" id="area_immobileCheckParentLabel_' + macro_aree_switch + '">North Italy</label>';
3502                		html_option += '</li>';
3503            			html_option_filtro += '<li>';
3504            				html_option_filtro += '<input class="form-check-input checkStyleImmobili aree_immobiliCheckParent_filtro" value="' + macro_aree_switch + '" type="checkbox" id="area_immobileCheckParent_' + macro_aree_switch + '_filtro">';
3505            				html_option_filtro += '<label class="form-check-label checkLabelStyleImmobili_filtro" for="area_immobileCheckParent_' + macro_aree_switch + '_filtro" id="area_immobileCheckParentLabel_' + macro_aree_switch + '_filtro">North Italy</label>';
3506            			html_option_filtro += '</li>';
3507                	}
3508                	else if(jsonAreeImmobili[i].id_macro_aree == 2){
3509                		html_option += '<li>';
3510            				html_option += '<input class="form-check-input checkStyleImmobili aree_immobiliCheckParent" value="' + macro_aree_switch + '" type="checkbox" id="area_immobileCheckParent_' + macro_aree_switch + '">';
3511                			html_option += '<label class="form-check-label checkLabelStyleImmobili" for="area_immobileCheckParent_' + macro_aree_switch + '" id="area_immobileCheckParentLabel_' + macro_aree_switch + '">Central Italy</label>';
3512                		html_option += '</li>';
3513            			html_option_filtro += '<li>';
3514            				html_option_filtro += '<input class="form-check-input checkStyleImmobili aree_immobiliCheckParent_filtro" value="' + macro_aree_switch + '" type="checkbox" id="area_immobileCheckParent_' + macro_aree_switch + '_filtro">';
3515            				html_option_filtro += '<label class="form-check-label checkLabelStyleImmobili_filtro" for="area_immobileCheckParent_' + macro_aree_switch + '_filtro" id="area_immobileCheckParentLabel_' + macro_aree_switch + '_filtro">Central Italy</label>';
3516            			html_option_filtro += '</li>';
3517                	}
3518                	else if(jsonAreeImmobili[i].id_macro_aree == 3){
3519                		html_option += '<li>';
3520            				html_option += '<input class="form-check-input checkStyleImmobili aree_immobiliCheckParent" value="' + macro_aree_switch + '" type="checkbox" id="area_immobileCheckParent_' + macro_aree_switch + '">';
3521                			html_option += '<label class="form-check-label checkLabelStyleImmobili" for="area_immobileCheckParent_' + macro_aree_switch + '" id="area_immobileCheckParentLabel_' + macro_aree_switch + '">South Italy</label>';
3522                		html_option += '</li>';
3523            			html_option_filtro += '<li>';
3524            				html_option_filtro += '<input class="form-check-input checkStyleImmobili aree_immobiliCheckParent_filtro" value="' + macro_aree_switch + '" type="checkbox" id="area_immobileCheckParent_' + macro_aree_switch + '_filtro">';
3525            				html_option_filtro += '<label class="form-check-label checkLabelStyleImmobili_filtro" for="area_immobileCheckParent_' + macro_aree_switch + '_filtro" id="area_immobileCheckParentLabel_' + macro_aree_switch + '_filtro">South Italy</label>';
3526            			html_option_filtro += '</li>';
3527                	}
3528                	else if(jsonAreeImmobili[i].id_macro_aree == 4){
3529                		html_option += '<li>';
3530            				html_option += '<input class="form-check-input checkStyleImmobili aree_immobiliCheckParent" value="' + macro_aree_switch + '" type="checkbox" id="area_immobileCheckParent_' + macro_aree_switch + '">';
3531                			html_option += '<label class="form-check-label checkLabelStyleImmobili" for="area_immobileCheckParent_' + macro_aree_switch + '" id="area_immobileCheckParentLabel_' + macro_aree_switch + '">Islands</label>';
3532                		html_option += '</li>';
3533            			html_option_filtro += '<li>';
3534            				html_option_filtro += '<input class="form-check-input checkStyleImmobili aree_immobiliCheckParent_filtro" value="' + macro_aree_switch + '" type="checkbox" id="area_immobileCheckParent_' + macro_aree_switch + '_filtro">';
3535            				html_option_filtro += '<label class="form-check-label checkLabelStyleImmobili_filtro" for="area_immobileCheckParent_' + macro_aree_switch + '_filtro" id="area_immobileCheckParentLabel_' + macro_aree_switch + '_filtro">Islands</label>';
3536            			html_option_filtro += '</li>';
3537                	}
3538                }
3539    			
3540    			html_option_filtro += '<li class="child">';
3541    				html_option_filtro += '<input class="form-check-input checkStyleImmobili aree_immobiliCheck_filtro aree_immobiliCheck_' + macro_aree_switch + '_filtro" '+((areeImmobiliArraySel.includes(jsonAreeImmobili[i].id_area_interesse) == true) ? "checked" : "" )+' value="' + jsonAreeImmobili[i].id_area_interesse + '" type="checkbox" id="area_immobileCheck_' + jsonAreeImmobili[i].id_area_interesse + '_filtro">';
3542    				html_option_filtro += '<label class="form-check-label checkLabelStyleImmobili_filtro" for="area_immobileCheck_' + jsonAreeImmobili[i].id_area_interesse + '_filtro" id="area_immobileCheckLabel_' + jsonAreeImmobili[i].id_area_interesse + '_filtro">' + jsonAreeImmobili[i].nome_area_interesse + '</label>';
3543    			html_option_filtro += '</li>';
3544    			
3545        		html_option += '<li class="child">';
3546    				html_option += '<input class="form-check-input checkStyleImmobili aree_immobiliCheck aree_immobiliCheck_' + macro_aree_switch + '" '+((areeImmobiliArraySel.includes(jsonAreeImmobili[i].id_area_interesse) == true) ? "checked" : "" )+' value="' + jsonAreeImmobili[i].id_area_interesse + '" type="checkbox" id="area_immobileCheck_' + jsonAreeImmobili[i].id_area_interesse + '">';
3547        			html_option += '<label class="form-check-label checkLabelStyleImmobili" for="area_immobileCheck_' + jsonAreeImmobili[i].id_area_interesse + '" id="area_immobileCheckLabel_' + jsonAreeImmobili[i].id_area_interesse + '">' + jsonAreeImmobili[i].nome_area_interesse + '</label>';
3548        		html_option += '</li>';
3549        		
3550            }
3551    
3552            $("#aree_immobili_multiselect").empty().append(html_option);
3553    		$("#aree_immobili_multiselect_filtro").empty().append(html_option_filtro);
3554    	
3555    		$('#buttonAccordionOffcanvasAreeImmobili').removeAttr('disabled', 'disabled');
3556    		$('#buttonAccordionOffcanvasAreeImmobili_filtro').removeAttr('disabled', 'disabled');
3557    		
3558    		var allChecked;
3559    		
3560    		for (var k = 1; k <= 4; k++) {
3561    			allChecked = true;
3562    			
3563    			$('input.aree_immobiliCheck_'+k+'[type=checkbox]').each(function () {
3564    				if(!this.checked){
3565    					allChecked =  false
3566    				}
3567    			});
3568    			
3569    			if(allChecked == true){
3570    				$("#area_immobileCheckParent_"+k).prop("checked", true);
3571    			}
3572    		}
3573    
3574    		updateTipologieLocationsImmobili('aree_immobili', type);
3575    		
3576    		printLabelRicercaImmobili('locations_immobili', 'aree_immobili', type);
3577    		
3578    		$("#aree_immobiliCheckAll, #aree_immobiliCheckAll_filtro").click(function() {
3579    			if($("#"+this.id).is(":checked") == true){
3580    				var areeImmobiliId = '';
3581    				var numAreeImmobiliCheck = 0;
3582    
3583    				if((this.id).includes("filtro") == true){
3584    					$('input.aree_immobiliCheck_filtro[type=checkbox]').each(function () {
3585    						areeImmobiliId += this.value+'-';
3586    						numAreeImmobiliCheck++;
3587    				 	});
3588    				}
3589    				else{
3590    					$('input.aree_immobiliCheck[type=checkbox]').each(function () {
3591    						areeImmobiliId += this.value+'-';
3592    						numAreeImmobiliCheck++;
3593    				 	});
3594    				}
3595    
3596    				$('#locations_immobiliBtn').css('color', '#ed6b62');
3597    				$('#locations_immobiliBtn').css('opacity', '1');
3598    				$('#locations_immobiliBtn').html(numAreeImmobiliCheck + ' Selected areas');
3599    				$('#locations_immobiliBtn').parent().prepend('<div class="closeBtnDropdownAbsolute cleanlocations_immobili"><i class="fa-solid fa-xmark"></i></div>');
3600    				
3601    				$(".aree_immobiliCheckParent").prop("checked", true);
3602    				$(".aree_immobiliCheck").prop("checked", true);
3603    				$(".aree_immobiliCheckParent_filtro").prop("checked", true);
3604    				$(".aree_immobiliCheck_filtro").prop("checked", true);
3605    				$("#aree_immobiliCheckAll").prop("checked", true);
3606    				$("#aree_immobiliCheckAll_filtro").prop("checked", true);
3607    			 	
3608    				areeImmobiliId = areeImmobiliId.substr(0, areeImmobiliId.length - 1);
3609    			 	
3610    				$('#aree_immobili').val(areeImmobiliId);	
3611    			}
3612    			else {
3613    				$('#aree_immobili').val('');
3614    				$('#locations_immobiliBtn').html('Where would you like to go?');
3615    				$('#locations_immobiliBtn').css('color', '#9b9a9e');
3616    				$('#locations_immobiliBtn').css('opacity', '1');
3617    				
3618    				$('.cleanlocations_immobili').remove();
3619    				
3620    				$(".aree_immobiliCheckParent").prop("checked", false);
3621    				$(".aree_immobiliCheck").prop("checked", false);
3622    				$(".aree_immobiliCheckParent_filtro").prop("checked", false);
3623    				$(".aree_immobiliCheck_filtro").prop("checked", false);
3624    				$("#aree_immobiliCheckAll").prop("checked", false);
3625    				$("#aree_immobiliCheckAll_filtro").prop("checked", false);
3626    			}
3627    
3628    			updateTipologieLocationsImmobili('aree_immobili', (this.id).includes("filtro"));
3629    			
3630    			printLabelRicercaImmobili('locations_immobili', 'aree_immobili', type);
3631    			
3632    			listaTipologieImmobili((this.id).includes("filtro"));
3633                listaRegioniImmobili((this.id).includes("filtro"));
3634                listaProvinceImmobili((this.id).includes("filtro"));
3635                listaComuniImmobili((this.id).includes("filtro"));
3636    		});
3637    
3638    		$(".aree_immobiliCheckParent, .aree_immobiliCheckParent_filtro").click(function() {
3639    			if($("#"+this.id).is(":checked")){
3640    				$(".aree_immobiliCheck_"+this.value).prop("checked", true);
3641    				$(".aree_immobiliCheck_"+this.value+"_filtro").prop("checked", true);
3642    				$("#area_immobileCheckParent_"+this.value).prop("checked", true);
3643    				$("#area_immobileCheckParent_"+this.value+"_filtro").prop("checked", true);
3644    			}
3645    			else{
3646    				$(".aree_immobiliCheck_"+this.value).prop("checked", false);
3647    				$(".aree_immobiliCheck_"+this.value+"_filtro").prop("checked", false);
3648    				$("#area_immobileCheckParent_"+this.value).prop("checked", false);
3649    				$("#area_immobileCheckParent_"+this.value+"_filtro").prop("checked", false);
3650    			}
3651    
3652    			updateTipologieLocationsImmobili('aree_immobili', (this.id).includes("filtro"));
3653    			
3654    			printLabelRicercaImmobili('locations_immobili', 'aree_immobili', type);
3655    			
3656    			listaTipologieImmobili((this.id).includes("filtro"));
3657                listaRegioniImmobili((this.id).includes("filtro"));
3658                listaProvinceImmobili((this.id).includes("filtro"));
3659                listaComuniImmobili((this.id).includes("filtro"));
3660    		});
3661    
3662    		$(".aree_immobiliCheck, .aree_immobiliCheck_filtro").click(function() {
3663    			var allChecked = true;
3664    			
3665    			if($("#"+this.id).is(":checked")){
3666    				$("#area_immobileCheck_"+this.value).prop("checked", true);
3667    				$("#area_immobileCheck_"+this.value+"_filtro").prop("checked", true);
3668    			}
3669    			else{
3670    				$("#area_immobileCheck_"+this.value).prop("checked", false);
3671    				$("#area_immobileCheck_"+this.value+"_filtro").prop("checked", false);
3672    			}
3673    			
3674    			checkClasses = $("#"+this.id).attr('class');
3675    			subClassName = checkClasses.substr(checkClasses.lastIndexOf(' ') + 1);
3676    			classNameParent = parseInt(subClassName.match(/[\d\.]+/g));
3677    				
3678    			$('input.'+subClassName+'[type=checkbox]').each(function () {
3679    				if(!this.checked){
3680    					allChecked =  false
3681    				}
3682    			});
3683    			
3684    			if(allChecked == true){
3685    				$("#area_immobileCheckParent_"+classNameParent).prop("checked", true);
3686    				$("#area_immobileCheckParent_"+classNameParent+"_filtro").prop("checked", true);
3687    			}
3688    			else{
3689    				$("#area_immobileCheckParent_"+classNameParent).prop("checked", false);
3690    				$("#area_immobileCheckParent_"+classNameParent+"_filtro").prop("checked", false);
3691    			}
3692    
3693    			updateTipologieLocationsImmobili('aree_immobili', (this.id).includes("filtro"));
3694    			
3695    			printLabelRicercaImmobili('locations_immobili', 'aree_immobili', type);
3696    			
3697    			listaTipologieImmobili((this.id).includes("filtro"));
3698                listaRegioniImmobili((this.id).includes("filtro"));
3699                listaProvinceImmobili((this.id).includes("filtro"));
3700                listaComuniImmobili((this.id).includes("filtro"));
3701    		});
3702		}
3703		else{
3704			$('#buttonAccordionOffcanvasAreeImmobili').attr('disabled', 'disabled');
3705			$('#buttonAccordionOffcanvasAreeImmobili_filtro').attr('disabled', 'disabled');
3706		}
3707    });	
3708}  
3709
3710function listaRegioniImmobili(type) {	
3711	var html_option = '';
3712	var html_option_filtro = '';
3713	
3714	var url = _api+'greatestate/regioni_immobili';
3715	
3716	$.ajax({
3717        url: url,
3718        type: 'POST',	            
3719        crossDomain: true,      
3720        data: {
3721        	lingua: _lang,
3722        	tipologie: $('#tipologie_immobili').val(),      	
3723        	aree: $('#aree_immobili').val(),
3724        	vicino_al_mare: $('#vicino_al_mare_immobili').val(),
3725        	venduti: $('#venduto_immobili').val()
3726        },   
3727        xhrFields:
3728        {
3729            withCredentials: true
3730        },
3731        error: function (error) {
3732        	console.log(error);
3733        	return;
3734        }
3735    }).done(function(json) {
3736		var jsonRegioniImmobili = json.rows;
3737		var jsonLenght = jsonRegioniImmobili.length;
3738		var macro_regioni_switch = 0;
3739
3740		var regioniImmobiliArraySel = $('#regioni_immobili').val().split('-');
3741		regioniImmobiliArraySel = regioniImmobiliArraySel.map(Number);
3742
3743       	html_option += '<li class="colsSpan">';
3744			html_option += '<input class="form-check-input checkStyleImmobili" type="checkbox" id="regioni_immobiliCheckAll">';
3745            html_option += '<label class="form-check-label checkLabelStyleImmobili" for="regioni_immobiliCheckAll">All</label>';
3746        html_option += '</li>';
3747
3748       	html_option_filtro += '<li class="colsSpan">';
3749			html_option_filtro += '<input class="form-check-input checkStyleImmobili" type="checkbox" id="regioni_immobiliCheckAll_filtro">';
3750            html_option_filtro += '<label class="form-check-label checkAllLabelStyleImmobili_filtro" for="regioni_immobiliCheckAll_filtro">All</label>';
3751        html_option_filtro += '</li>';
3752        
3753        for (var i = 0; i < jsonLenght; i++) {
3754            if(jsonRegioniImmobili[i].id_macro_regioni != macro_regioni_switch){
3755            	macro_regioni_switch = jsonRegioniImmobili[i].id_macro_regioni;
3756            	
3757            	if(jsonRegioniImmobili[i].id_macro_regioni == 1){
3758            		html_option += '<li>';
3759        				html_option += '<input class="form-check-input checkStyleImmobili regioni_immobiliCheckParent" value="' + macro_regioni_switch + '" type="checkbox" id="regione_immobileCheckParent_' + macro_regioni_switch + '">';
3760            			html_option += '<label class="form-check-label checkLabelStyleImmobili" for="regione_immobileCheckParent_' + macro_regioni_switch + '" id="regione_immobileCheckParentLabel_' + macro_regioni_switch + '">North Italy</label>';
3761            		html_option += '</li>';
3762        			html_option_filtro += '<li>';
3763        				html_option_filtro += '<input class="form-check-input checkStyleImmobili regioni_immobiliCheckParent_filtro" value="' + macro_regioni_switch + '" type="checkbox" id="regione_immobileCheckParent_' + macro_regioni_switch + '_filtro">';
3764        				html_option_filtro += '<label class="form-check-label checkLabelStyleImmobili_filtro" for="regione_immobileCheckParent_' + macro_regioni_switch + '_filtro" id="regione_immobileCheckParentLabel_' + macro_regioni_switch + '_filtro">North Italy</label>';
3765        			html_option_filtro += '</li>';
3766            	}
3767            	else if(jsonRegioniImmobili[i].id_macro_regioni == 2){
3768            		html_option += '<li>';
3769        				html_option += '<input class="form-check-input checkStyleImmobili regioni_immobiliCheckParent" value="' + macro_regioni_switch + '" type="checkbox" id="regione_immobileCheckParent_' + macro_regioni_switch + '">';
3770            			html_option += '<label class="form-check-label checkLabelStyleImmobili" for="regione_immobileCheckParent_' + macro_regioni_switch + '" id="regione_immobileCheckParentLabel_' + macro_regioni_switch + '">Central Italy</label>';
3771            		html_option += '</li>';
3772        			html_option_filtro += '<li>';
3773        				html_option_filtro += '<input class="form-check-input checkStyleImmobili regioni_immobiliCheckParent_filtro" value="' + macro_regioni_switch + '" type="checkbox" id="regione_immobileCheckParent_' + macro_regioni_switch + '_filtro">';
3774        				html_option_filtro += '<label class="form-check-label checkLabelStyleImmobili_filtro" for="regione_immobileCheckParent_' + macro_regioni_switch + '_filtro" id="regione_immobileCheckParentLabel_' + macro_regioni_switch + '_filtro">Central Italy</label>';
3775        			html_option_filtro += '</li>';
3776            	}
3777            	else if(jsonRegioniImmobili[i].id_macro_regioni == 3){
3778            		html_option += '<li>';
3779        				html_option += '<input class="form-check-input checkStyleImmobili regioni_immobiliCheckParent" value="' + macro_regioni_switch + '" type="checkbox" id="regione_immobileCheckParent_' + macro_regioni_switch + '">';
3780            			html_option += '<label class="form-check-label checkLabelStyleImmobili" for="regione_immobileCheckParent_' + macro_regioni_switch + '" id="regione_immobileCheckParentLabel_' + macro_regioni_switch + '">South Italy</label>';
3781            		html_option += '</li>';
3782        			html_option_filtro += '<li>';
3783        				html_option_filtro += '<input class="form-check-input checkStyleImmobili regioni_immobiliCheckParent_filtro" value="' + macro_regioni_switch + '" type="checkbox" id="regione_immobileCheckParent_' + macro_regioni_switch + '_filtro">';
3784        				html_option_filtro += '<label class="form-check-label checkLabelStyleImmobili_filtro" for="regione_immobileCheckParent_' + macro_regioni_switch + '_filtro" id="regione_immobileCheckParentLabel_' + macro_regioni_switch + '_filtro">South Italy</label>';
3785        			html_option_filtro += '</li>';
3786            	}
3787            	else if(jsonRegioniImmobili[i].id_macro_regioni == 4){
3788            		html_option += '<li>';
3789        				html_option += '<input class="form-check-input checkStyleImmobili regioni_immobiliCheckParent" value="' + macro_regioni_switch + '" type="checkbox" id="regione_immobileCheckParent_' + macro_regioni_switch + '">';
3790            			html_option += '<label class="form-check-label checkLabelStyleImmobili" for="regione_immobileCheckParent_' + macro_regioni_switch + '" id="regione_immobileCheckParentLabel_' + macro_regioni_switch + '">Islands</label>';
3791            		html_option += '</li>';
3792        			html_option_filtro += '<li>';
3793        				html_option_filtro += '<input class="form-check-input checkStyleImmobili regioni_immobiliCheckParent_filtro" value="' + macro_regioni_switch + '" type="checkbox" id="regione_immobileCheckParent_' + macro_regioni_switch + '_filtro">';
3794        				html_option_filtro += '<label class="form-check-label checkLabelStyleImmobili_filtro" for="regione_immobileCheckParent_' + macro_regioni_switch + '_filtro" id="regione_immobileCheckParentLabel_' + macro_regioni_switch + '_filtro">Islands</label>';
3795        			html_option_filtro += '</li>';
3796            	}
3797            }
3798			
3799			html_option_filtro += '<li class="child">';
3800				html_option_filtro += '<input class="form-check-input checkStyleImmobili regioni_immobiliCheck_filtro regioni_immobiliCheck_' + macro_regioni_switch + '_filtro" '+((regioniImmobiliArraySel.includes(jsonRegioniImmobili[i].id_regione) == true) ? "checked" : "" )+' value="' + jsonRegioniImmobili[i].id_regione + '" type="checkbox" id="regione_immobileCheck_' + jsonRegioniImmobili[i].id_regione + '_filtro">';
3801				html_option_filtro += '<label class="form-check-label checkLabelStyleImmobili_filtro" for="regione_immobileCheck_' + jsonRegioniImmobili[i].id_regione + '_filtro" id="regione_immobileCheckLabel_' + jsonRegioniImmobili[i].id_regione + '_filtro">' + jsonRegioniImmobili[i].nome_regione + '</label>';
3802			html_option_filtro += '</li>';
3803			
3804    		html_option += '<li class="child">';
3805				html_option += '<input class="form-check-input checkStyleImmobili regioni_immobiliCheck regioni_immobiliCheck_' + macro_regioni_switch + '" '+((regioniImmobiliArraySel.includes(jsonRegioniImmobili[i].id_regione) == true) ? "checked" : "" )+' value="' + jsonRegioniImmobili[i].id_regione + '" type="checkbox" id="regione_immobileCheck_' + jsonRegioniImmobili[i].id_regione + '">';
3806    			html_option += '<label class="form-check-label checkLabelStyleImmobili" for="regione_immobileCheck_' + jsonRegioniImmobili[i].id_regione + '" id="regione_immobileCheckLabel_' + jsonRegioniImmobili[i].id_regione + '">' + jsonRegioniImmobili[i].nome_regione + '</label>';
3807    		html_option += '</li>';
3808    		
3809        }
3810
3811        $("#regioni_immobili_multiselect").empty().append(html_option);
3812		$("#regioni_immobili_multiselect_filtro").empty().append(html_option_filtro);
3813
3814		var allChecked;
3815		
3816		for (var k = 1; k <= 4; k++) {
3817			allChecked = true;
3818			
3819			$('input.regioni_immobiliCheck_'+k+'[type=checkbox]').each(function () {
3820				if(!this.checked){
3821					allChecked =  false
3822				}
3823			});
3824			
3825			if(allChecked == true){
3826				$("#regione_immobileCheckParent_"+k).prop("checked", true);
3827			}
3828		}
3829
3830		updateTipologieLocationsImmobili('regioni_immobili', type);
3831		
3832		printLabelRicercaImmobili('locations_immobili', 'regioni_immobili', type);
3833
3834		$("#regioni_immobiliCheckAll, #regioni_immobiliCheckAll_filtro").click(function() {
3835			if($("#"+this.id).is(":checked") == true){
3836				var regioniImmobiliId = '';
3837				var numRegioniImmobiliCheck = 0;
3838
3839				if((this.id).includes("filtro") == true){
3840					$('input.regioni_immobiliCheck_filtro[type=checkbox]').each(function () {
3841						regioniImmobiliId += this.value+'-';
3842						numRegioniImmobiliCheck++;
3843				 	});
3844				}
3845				else{
3846					$('input.regioni_immobiliCheck[type=checkbox]').each(function () {
3847						regioniImmobiliId += this.value+'-';
3848						numRegioniImmobiliCheck++;
3849				 	});
3850				}
3851
3852				$('#locations_immobiliBtn').css('color', '#ed6b62');
3853				$('#locations_immobiliBtn').css('opacity', '1');
3854				$('#locations_immobiliBtn').html(numRegioniImmobiliCheck + ' Selected areas');
3855				$('#locations_immobiliBtn').parent().prepend('<div class="closeBtnDropdownAbsolute cleanlocations_immobili"><i class="fa-solid fa-xmark"></i></div>');
3856				
3857				$(".regioni_immobiliCheckParent").prop("checked", true);
3858				$(".regioni_immobiliCheck").prop("checked", true);
3859				$(".regioni_immobiliCheckParent_filtro").prop("checked", true);
3860				$(".regioni_immobiliCheck_filtro").prop("checked", true);
3861				$("#regioni_immobiliCheckAll").prop("checked", true);
3862				$("#regioni_immobiliCheckAll_filtro").prop("checked", true);
3863			 	
3864				regioniImmobiliId = regioniImmobiliId.substr(0, regioniImmobiliId.length - 1);
3865			 	
3866				$('#regioni_immobili').val(regioniImmobiliId);	
3867			}
3868			else {
3869				$('#regioni_immobili').val('');
3870				$('#province_immobili').val('');
3871				$('#comuni_immobili').val('');
3872				$('#locations_immobiliBtn').html('Where would you like to go?');
3873				$('#locations_immobiliBtn').css('color', '#9b9a9e');
3874				$('#locations_immobiliBtn').css('opacity', '1');
3875				
3876				$('.cleanlocations_immobili').remove();
3877				
3878				$(".regioni_immobiliCheckParent").prop("checked", false);
3879				$(".regioni_immobiliCheck").prop("checked", false);
3880				$(".regioni_immobiliCheckParent_filtro").prop("checked", false);
3881				$(".regioni_immobiliCheck_filtro").prop("checked", false);
3882				$("#regioni_immobiliCheckAll").prop("checked", false);
3883				$("#regioni_immobiliCheckAll_filtro").prop("checked", false);
3884			}
3885
3886			updateTipologieLocationsImmobili('regioni_immobili', (this.id).includes("filtro"));
3887			
3888			printLabelRicercaImmobili('locations_immobili', 'regioni_immobili', type);
3889			
3890            listaTipologieImmobili((this.id).includes("filtro"));
3891            listaAreeImmobili((this.id).includes("filtro"));
3892            listaProvinceImmobili((this.id).includes("filtro"));
3893            listaComuniImmobili((this.id).includes("filtro"));
3894		});
3895
3896		$(".regioni_immobiliCheckParent, .regioni_immobiliCheckParent_filtro").click(function() {
3897			if($("#"+this.id).is(":checked")){
3898				$(".regioni_immobiliCheck_"+this.value).prop("checked", true);
3899				$(".regioni_immobiliCheck_"+this.value+"_filtro").prop("checked", true);
3900				$("#regione_immobileCheckParent_"+this.value).prop("checked", true);
3901				$("#regione_immobileCheckParent_"+this.value+"_filtro").prop("checked", true);
3902			}
3903			else{
3904				$(".regioni_immobiliCheck_"+this.value).prop("checked", false);
3905				$(".regioni_immobiliCheck_"+this.value+"_filtro").prop("checked", false);
3906				$("#regione_immobileCheckParent_"+this.value).prop("checked", false);
3907				$("#regione_immobileCheckParent_"+this.value+"_filtro").prop("checked", false);
3908			}
3909
3910			updateTipologieLocationsImmobili('regioni_immobili', (this.id).includes("filtro"));
3911			
3912			printLabelRicercaImmobili('locations_immobili', 'regioni_immobili', type);
3913			
3914            listaTipologieImmobili((this.id).includes("filtro"));
3915            listaAreeImmobili((this.id).includes("filtro"));
3916            listaProvinceImmobili((this.id).includes("filtro"));
3917            listaComuniImmobili((this.id).includes("filtro"));
3918		});
3919
3920		$(".regioni_immobiliCheck, .regioni_immobiliCheck_filtro").click(function() {
3921			var allChecked = true;
3922			
3923			if($("#"+this.id).is(":checked")){
3924				$("#regione_immobileCheck_"+this.value).prop("checked", true);
3925				$("#regione_immobileCheck_"+this.value+"_filtro").prop("checked", true);
3926			}
3927			else{
3928				$("#regione_immobileCheck_"+this.value).prop("checked", false);
3929				$("#regione_immobileCheck_"+this.value+"_filtro").prop("checked", false);
3930			}
3931			
3932			checkClasses = $("#"+this.id).attr('class');
3933			subClassName = checkClasses.substr(checkClasses.lastIndexOf(' ') + 1);
3934			classNameParent = parseInt(subClassName.match(/[\d\.]+/g));
3935				
3936			$('input.'+subClassName+'[type=checkbox]').each(function () {
3937				if(!this.checked){
3938					allChecked =  false
3939				}
3940			});
3941			
3942			if(allChecked == true){
3943				$("#regione_immobileCheckParent_"+classNameParent).prop("checked", true);
3944				$("#regione_immobileCheckParent_"+classNameParent+"_filtro").prop("checked", true);
3945			}
3946			else{
3947				$("#regione_immobileCheckParent_"+classNameParent).prop("checked", false);
3948				$("#regione_immobileCheckParent_"+classNameParent+"_filtro").prop("checked", false);
3949			}
3950
3951			updateTipologieLocationsImmobili('regioni_immobili', (this.id).includes("filtro"));
3952			
3953			printLabelRicercaImmobili('locations_immobili', 'regioni_immobili', type);
3954			
3955            listaTipologieImmobili((this.id).includes("filtro"));
3956            listaAreeImmobili((this.id).includes("filtro"));
3957            listaProvinceImmobili((this.id).includes("filtro"));
3958            listaComuniImmobili((this.id).includes("filtro"));
3959		});
3960    });	
3961}  
3962
3963function listaProvinceImmobili(type) {	
3964	var html_option = '';
3965	var html_option_filtro = '';
3966	
3967	var url = _api+'greatestate/province_immobili';
3968	
3969	if($('#regioni_immobili').val() != ''){
3970    	$.ajax({
3971            url: url,
3972            type: 'POST',	            
3973            crossDomain: true,      
3974            data: {
3975            	tipologie: $('#tipologie_immobili').val(),      	
3976            	aree: $('#aree_immobili').val(),  	 	
3977            	regioni: $('#regioni_immobili').val(),
3978            	venduti: $('#venduto_immobili').val() 
3979            },   
3980            xhrFields:
3981            {
3982                withCredentials: true
3983            },
3984            error: function (error) {
3985            	console.log(error);
3986            	return;
3987            }
3988        }).done(function(json) {
3989    		var jsonProvinceImmobili = json.rows;
3990    		var jsonLenght = jsonProvinceImmobili.length;
3991    
3992    		var provinceImmobiliArraySel = $('#province_immobili').val().split('-');
3993    		provinceImmobiliArraySel = provinceImmobiliArraySel.map(Number);
3994    
3995           	html_option += '<li class="colsSpan">';
3996    			html_option += '<input class="form-check-input checkStyleImmobili" type="checkbox" id="province_immobiliCheckAll">';
3997                html_option += '<label class="form-check-label checkLabelStyleImmobili" for="province_immobiliCheckAll">All</label>';
3998            html_option += '</li>';
3999
4000           	html_option_filtro += '<li class="colsSpan">';
4001    			html_option_filtro += '<input class="form-check-input checkStyleImmobili" type="checkbox" id="province_immobiliCheckAll_filtro">';
4002                html_option_filtro += '<label class="form-check-label checkLabelStyleImmobili_filtro" for="province_immobiliCheckAll_filtro">All</label>';
4003            html_option_filtro += '</li>';
4004            
4005            for (var i = 0; i < jsonLenght; i++) {
4006    			html_option_filtro += '<li>';
4007    				html_option_filtro += '<input class="form-check-input checkStyleImmobili province_immobiliCheck_filtro" '+((provinceImmobiliArraySel.includes(jsonProvinceImmobili[i].id_provincia) == true) ? "checked" : "" )+' value="' + jsonProvinceImmobili[i].id_provincia + '" type="checkbox" id="provincia_immobileCheck_' + jsonProvinceImmobili[i].id_provincia + '_filtro">';
4008    				html_option_filtro += '<label class="form-check-label checkLabelStyleImmobili_filtro" for="provincia_immobileCheck_' + jsonProvinceImmobili[i].id_provincia + '_filtro" id="provincia_immobileCheckLabel_' + jsonProvinceImmobili[i].id_provincia + '_filtro">' + jsonProvinceImmobili[i].nome_provincia + '</label>';
4009    			html_option_filtro += '</li>';
4010    			
4011        		html_option += '<li>';
4012    				html_option += '<input class="form-check-input checkStyleImmobili province_immobiliCheck" '+((provinceImmobiliArraySel.includes(jsonProvinceImmobili[i].id_provincia) == true) ? "checked" : "" )+' value="' + jsonProvinceImmobili[i].id_provincia + '" type="checkbox" id="provincia_immobileCheck_' + jsonProvinceImmobili[i].id_provincia + '">';
4013        			html_option += '<label class="form-check-label checkLabelStyleImmobili" for="provincia_immobileCheck_' + jsonProvinceImmobili[i].id_provincia + '" id="provincia_immobileCheckLabel_' + jsonProvinceImmobili[i].id_provincia + '">' + jsonProvinceImmobili[i].nome_provincia + '</label>';
4014        		html_option += '</li>';
4015            }
4016    
4017            $("#province_immobili_multiselect").empty().append(html_option);
4018    		$("#province_immobili_multiselect_filtro").empty().append(html_option_filtro);
4019    
4020    		$('#buttonAccordionOffcanvasProvinceImmobili').removeAttr('disabled', 'disabled');
4021    		$('#buttonAccordionOffcanvasProvinceImmobili_filtro').removeAttr('disabled', 'disabled');
4022    		
4023    		updateTipologieLocationsImmobili('province_immobili', type);
4024    		
4025    		printLabelRicercaImmobili('locations_immobili', 'province_immobili', type);
4026    
4027    		$("#province_immobiliCheckAll, #province_immobiliCheckAll_filtro").click(function() {
4028    			if($("#"+this.id).is(":checked") == true){
4029    				var provinceImmobiliId = '';
4030    				var numProvinceImmobiliCheck = 0;
4031    
4032    				if((this.id).includes("filtro") == true){
4033    					$('input.province_immobiliCheck_filtro[type=checkbox]').each(function () {
4034    						provinceImmobiliId += this.value+'-';
4035    						numProvinceImmobiliCheck++;
4036    				 	});
4037    				}
4038    				else{
4039    					$('input.province_immobiliCheck[type=checkbox]').each(function () {
4040    						provinceImmobiliId += this.value+'-';
4041    						numProvinceImmobiliCheck++;
4042    				 	});
4043    				}
4044    
4045    				$('#locations_immobiliBtn').css('color', '#ed6b62');
4046    				$('#locations_immobiliBtn').css('opacity', '1');
4047    				$('#locations_immobiliBtn').html(numProvinceImmobiliCheck + ' Selected areas');
4048    				$('#locations_immobiliBtn').parent().prepend('<div class="closeBtnDropdownAbsolute cleanlocations_immobili"><i class="fa-solid fa-xmark"></i></div>');
4049    				
4050    				$(".province_immobiliCheck").prop("checked", true);
4051    				$(".province_immobiliCheck_filtro").prop("checked", true);
4052    				$("#province_immobiliCheckAll").prop("checked", true);
4053    				$("#province_immobiliCheckAll_filtro").prop("checked", true);
4054    			 	
4055    				provinceImmobiliId = provinceImmobiliId.substr(0, provinceImmobiliId.length - 1);
4056    			 	
4057    				$('#province_immobili').val(provinceImmobiliId);	
4058    			}
4059    			else {
4060    				$('#province_immobili').val('');
4061    				$('#comuni_immobili').val('');
4062    				$('#locations_immobiliBtn').html('Where would you like to go?');
4063    				$('#locations_immobiliBtn').css('color', '#9b9a9e');
4064    				$('#locations_immobiliBtn').css('opacity', '1');
4065    				
4066    				$('.cleanlocations_immobili').remove();
4067    				
4068    				$(".province_immobiliCheck").prop("checked", false);
4069    				$(".province_immobiliCheck_filtro").prop("checked", false);
4070    				$("#province_immobiliCheckAll").prop("checked", false);
4071    				$("#province_immobiliCheckAll_filtro").prop("checked", false);
4072    			}
4073    
4074    			updateTipologieLocationsImmobili('province_immobili', (this.id).includes("filtro"));
4075    			
4076    			printLabelRicercaImmobili('locations_immobili', 'province_immobili', type);
4077    			
4078                listaTipologieImmobili((this.id).includes("filtro"));
4079                listaAreeImmobili((this.id).includes("filtro"));
4080                listaProvinceImmobili((this.id).includes("filtro"));
4081                listaComuniImmobili((this.id).includes("filtro"));
4082    		});
4083    
4084    		$(".province_immobiliCheck, .province_immobiliCheck_filtro").click(function() {
4085    			if($("#"+this.id).is(":checked")){
4086    				$("#provincia_immobileCheck_"+this.value).prop("checked", true);
4087    				$("#provincia_immobileCheck_"+this.value+"_filtro").prop("checked", true);
4088    			}
4089    			else{
4090    				$("#provincia_immobileCheck_"+this.value).prop("checked", false);
4091    				$("#provincia_immobileCheck_"+this.value+"_filtro").prop("checked", false);
4092    			}
4093    
4094    			updateTipologieLocationsImmobili('province_immobili', (this.id).includes("filtro"));
4095    			
4096    			printLabelRicercaImmobili('locations_immobili', 'province_immobili', type);
4097    			
4098                listaTipologieImmobili((this.id).includes("filtro"));
4099                listaAreeImmobili((this.id).includes("filtro"));
4100                listaProvinceImmobili((this.id).includes("filtro"));
4101                listaComuniImmobili((this.id).includes("filtro"));
4102    		});
4103        });
4104	}
4105	else{
4106		$('#buttonAccordionOffcanvasProvinceImmobili').attr('disabled', 'disabled');
4107		$('#buttonAccordionOffcanvasProvinceImmobili_filtro').attr('disabled', 'disabled');
4108	}
4109}  
4110
4111function listaComuniImmobili(type) {	
4112	var html_option = '';
4113	var html_option_filtro = '';
4114	
4115	var url = _api+'greatestate/comuni_immobili';
4116	
4117	if($('#province_immobili').val() != ''){
4118    	$.ajax({
4119            url: url,
4120            type: 'POST',	            
4121            crossDomain: true,      
4122            data: {
4123            	tipologie: $('#tipologie_immobili').val(),      	
4124            	aree: $('#aree_immobili').val(),  	 	
4125            	province: $('#province_immobili').val(),
4126            	venduti: $('#venduto_immobili').val()
4127            },   
4128            xhrFields:
4129            {
4130                withCredentials: true
4131            },
4132            error: function (error) {
4133            	console.log(error);
4134            	return;
4135            }
4136        }).done(function(json) {
4137    		var jsonComuniImmobili = json.rows;
4138    		var jsonLenght = jsonComuniImmobili.length;
4139    
4140    		var comuniImmobiliArraySel = $('#comuni_immobili').val().split('-');
4141    		comuniImmobiliArraySel = comuniImmobiliArraySel.map(Number);
4142    
4143           	html_option += '<li class="colsSpan">';
4144    			html_option += '<input class="form-check-input checkStyleImmobili" type="checkbox" id="comuni_immobiliCheckAll">';
4145                html_option += '<label class="form-check-label checkLabelStyleImmobili" for="comuni_immobiliCheckAll">All</label>';
4146            html_option += '</li>';
4147    
4148           	html_option_filtro += '<li class="colsSpan">';
4149    			html_option_filtro += '<input class="form-check-input checkStyleImmobili" type="checkbox" id="comuni_immobiliCheckAll_filtro">';
4150                html_option_filtro += '<label class="form-check-label checkLabelStyleImmobili_filtro" for="comuni_immobiliCheckAll_filtro">All</label>';
4151            html_option_filtro += '</li>';
4152            
4153            for (var i = 0; i < jsonLenght; i++) {
4154    			html_option_filtro += '<li>';
4155    				html_option_filtro += '<input class="form-check-input checkStyleImmobili comuni_immobiliCheck_filtro" '+((comuniImmobiliArraySel.includes(jsonComuniImmobili[i].id_comune) == true) ? "checked" : "" )+' value="' + jsonComuniImmobili[i].id_comune + '" type="checkbox" id="comune_immobileCheck_' + jsonComuniImmobili[i].id_comune + '_filtro">';
4156    				html_option_filtro += '<label class="form-check-label checkLabelStyleImmobili_filtro" for="comune_immobileCheck_' + jsonComuniImmobili[i].id_comune + '_filtro" id="comune_immobileCheckLabel_' + jsonComuniImmobili[i].id_comune + '_filtro">' + jsonComuniImmobili[i].nome_comune + '</label>';
4157    			html_option_filtro += '</li>';
4158    			
4159        		html_option += '<li>';
4160    				html_option += '<input class="form-check-input checkStyleImmobili comuni_immobiliCheck" '+((comuniImmobiliArraySel.includes(jsonComuniImmobili[i].id_comune) == true) ? "checked" : "" )+' value="' + jsonComuniImmobili[i].id_comune + '" type="checkbox" id="comune_immobileCheck_' + jsonComuniImmobili[i].id_comune + '">';
4161        			html_option += '<label class="form-check-label checkLabelStyleImmobili" for="comune_immobileCheck_' + jsonComuniImmobili[i].id_comune + '" id="comune_immobileCheckLabel_' + jsonComuniImmobili[i].id_comune + '">' + jsonComuniImmobili[i].nome_comune + '</label>';
4162        		html_option += '</li>';
4163            }
4164    
4165            $("#comuni_immobili_multiselect").empty().append(html_option);
4166    		$("#comuni_immobili_multiselect_filtro").empty().append(html_option_filtro);
4167    
4168    		$('#buttonAccordionOffcanvasComuniImmobili').removeAttr('disabled', 'disabled');
4169    		$('#buttonAccordionOffcanvasComuniImmobili_filtro').removeAttr('disabled', 'disabled');
4170    		
4171    		updateTipologieLocationsImmobili('comuni_immobili', type);
4172    		
4173    		printLabelRicercaImmobili('locations_immobili', 'comuni_immobili', type);
4174    
4175    		$("#comuni_immobiliCheckAll, #comuni_immobiliCheckAll_filtro").click(function() {
4176    			if($("#"+this.id).is(":checked") == true){
4177    				var comuniImmobiliId = '';
4178    				var numComuniImmobiliCheck = 0;
4179    
4180    				if((this.id).includes("filtro") == true){
4181    					$('input.comuni_immobiliCheck_filtro[type=checkbox]').each(function () {
4182    						comuniImmobiliId += this.value+'-';
4183    						numComuniImmobiliCheck++;
4184    				 	});
4185    				}
4186    				else{
4187    					$('input.comuni_immobiliCheck[type=checkbox]').each(function () {
4188    						comuniImmobiliId += this.value+'-';
4189    						numComuniImmobiliCheck++;
4190    				 	});
4191    				}
4192    
4193    				$('#locations_immobiliBtn').css('color', '#ed6b62');
4194    				$('#locations_immobiliBtn').css('opacity', '1');
4195    				$('#locations_immobiliBtn').html(numComuniImmobiliCheck + ' Selected areas');
4196    				$('#locations_immobiliBtn').parent().prepend('<div class="closeBtnDropdownAbsolute cleanlocations_immobili"><i class="fa-solid fa-xmark"></i></div>');
4197    				
4198    				$(".comuni_immobiliCheck").prop("checked", true);
4199    				$(".comuni_immobiliCheck_filtro").prop("checked", true);
4200    				$("#comuni_immobiliCheckAll").prop("checked", true);
4201    				$("#comuni_immobiliCheckAll_filtro").prop("checked", true);
4202    			 	
4203    				comuniImmobiliId = comuniImmobiliId.substr(0, comuniImmobiliId.length - 1);
4204    			 	
4205    				$('#comuni_immobili').val(comuniImmobiliId);	
4206    			}
4207    			else {
4208    				$('#comuni_immobili').val('');
4209    				$('#locations_immobiliBtn').html('Where would you like to go?');
4210    				$('#locations_immobiliBtn').css('color', '#9b9a9e');
4211    				$('#locations_immobiliBtn').css('opacity', '1');
4212    				
4213    				$('.cleanlocations_immobili').remove();
4214    				
4215    				$(".comuni_immobiliCheck").prop("checked", false);
4216    				$(".comuni_immobiliCheck_filtro").prop("checked", false);
4217    				$("#comuni_immobiliCheckAll").prop("checked", false);
4218    				$("#comuni_immobiliCheckAll_filtro").prop("checked", false);
4219    			}
4220    
4221    			updateTipologieLocationsImmobili('comuni_immobili', (this.id).includes("filtro"));
4222    			
4223    			printLabelRicercaImmobili('locations_immobili', 'comuni_immobili', type);
4224    			
4225                listaTipologieImmobili((this.id).includes("filtro"));
4226                listaAreeImmobili((this.id).includes("filtro"));
4227                listaProvinceImmobili((this.id).includes("filtro"));
4228                listaComuniImmobili((this.id).includes("filtro"));
4229    		});
4230    
4231    		$(".comuni_immobiliCheck, .comuni_immobiliCheck_filtro").click(function() {
4232    			if($("#"+this.id).is(":checked")){
4233    				$("#comune_immobileCheck_"+this.value).prop("checked", true);
4234    				$("#comune_immobileCheck_"+this.value+"_filtro").prop("checked", true);
4235    			}
4236    			else{
4237    				$("#comune_immobileCheck_"+this.value).prop("checked", false);
4238    				$("#comune_immobileCheck_"+this.value+"_filtro").prop("checked", false);
4239    			}
4240    			
4241    			updateTipologieLocationsImmobili('comuni_immobili', (this.id).includes("filtro"));
4242    			
4243    			printLabelRicercaImmobili('locations_immobili', 'comuni_immobili', type);
4244    			
4245                listaTipologieImmobili((this.id).includes("filtro"));
4246                listaAreeImmobili((this.id).includes("filtro"));
4247                listaProvinceImmobili((this.id).includes("filtro"));
4248                listaComuniImmobili((this.id).includes("filtro"));
4249    		});
4250        });
4251	}
4252	else{
4253		$('#buttonAccordionOffcanvasComuniImmobili').attr('disabled', 'disabled');
4254		$('#buttonAccordionOffcanvasComuniImmobili_filtro').attr('disabled', 'disabled');
4255	}
4256}  
4257
4258function listaPrezziImmobili() {
4259	var html_option = '';
4260	var html_option_filtro = '';
4261	var url = _api+'greatestate/prezzi_immobili';
4262	
4263	$.ajax({
4264        url: url,
4265        type: 'POST',	            
4266        crossDomain: true,           
4267        xhrFields:
4268        {
4269            withCredentials: true
4270        },
4271        error: function (error) {
4272        	console.log(error);
4273        	return;
4274        }
4275    }).done(function(json) {
4276		var jsonLenght = json.rows.length;
4277
4278		var prezzoPreSlider;
4279		var prezzoPostSlider;	 				
4280		var prezzoPreSliderFiltro;
4281		var prezzoPostSliderFiltro;	
4282		
4283		minPreImmobili = parseInt(json.rows[0].prezzo_min);
4284		maxPreImmobili = parseInt(json.rows[0].prezzo_max);
4285
4286		html_option += '<input id="prezzo_range_immobili" type="text"/>';
4287		html_option += '<input id="prezzo_da_immobili" type="hidden" />';
4288		html_option += '<input id="prezzo_a_immobili" type="hidden" />';
4289		html_option += '<input id="prezzo_min_immobili" type="hidden" value="'+minPreImmobili+'"/>';
4290		html_option += '<input id="prezzo_max_immobili" type="hidden" value="'+maxPreImmobili+'"/>';
4291		
4292		html_option += '<div id="prezziImmobiliInputDiv">';
4293    		html_option += '<div class="input-group">';
4294        		html_option += '<label for="prezzo_da_input_immobili">Minimum budget</label>';
4295        		html_option += '<span class="input-group-text">€</span><input class="form-control" id="prezzo_da_input_immobili" lang="en" type="text" onkeyup="setInputNumberFormat(this.value, this.id);"/>';
4296    		html_option += '</div>';
4297    		html_option += '<div class="input-group">';
4298        		html_option += '<label for="prezzo_a_input_immobili">Maximum budget</label>';
4299        		html_option += '<span class="input-group-text">€</span><input class="form-control" id="prezzo_a_input_immobili" lang="en" type="text" onkeyup="setInputNumberFormat(this.value, this.id);"/>';
4300    		html_option += '</div>';
4301    		html_option += '<div class="prezziButton">';
4302    			html_option += '<button type="button" id="annullaButtonPrezziImmobili" class="btn btn-primary text-uppercase"><b>Cancel</b></button>';
4303    			html_option += '<button type="button" id="applicaButtonPrezziImmobili" class="btn btn-primary text-uppercase"><b>Apply</b></button>';
4304    		html_option += '</div>';
4305		html_option += '</div>';
4306		
4307		$("#prezzoImmobiliSlider").empty().append(html_option);
4308		$('#prezzoImmobiliSlider').click(function(e) {
4309		    e.stopPropagation();
4310		});
4311									
4312		let arrTicks = [250000, 500000, 750000, 1000000, 1250000, 1500000, 1750000, 2000000, 2500000, 3000000, 3500000];
4313		if(maxPreImmobili > 1000000){
4314			arrTicks.push(1000000);
4315		}
4316		if(maxPreImmobili > 2500000){
4317			arrTicks.push(2000000);
4318		}
4319		if(maxPreImmobili > 5000000){
4320			arrTicks.push(5000000);
4321		}
4322		
4323		$("#prezzo_range_immobili").slider({ 	
4324			min: minPreImmobili, 
4325			max: maxPreImmobili, 
4326			value: [0, maxPreImmobili], 
4327			focus: true,
4328			tooltip: 'always',
4329			tooltip_split: true,
4330			tooltip_position:'bottom',
4331		    ticks: arrTicks,		
4332		    ticks_snap_bounds: 100000
4333		}).on('slideStart', function(data){
4334			prezzoPreSlider = $('#prezzo_range_immobili').data('slider').getValue();
4335		}).on('slideStop', function(data){
4336			prezzoPostSlider = $('#prezzo_range_immobili').data('slider').getValue();
4337			if((prezzoPreSlider[0] != prezzoPostSlider[0]) || (prezzoPreSlider[1] != prezzoPostSlider[1])){
4338				$("#prezzo_da_immobili").val(data.value[0]);
4339				$("#prezzo_a_immobili").val(data.value[1]);	
4340				setInputNumberFormat(data.value[0], 'prezzo_da_input_immobili');
4341				setInputNumberFormat(data.value[1], 'prezzo_a_input_immobili');
4342			}			
4343		}).on('change', function(data){		
4344			$("#prezzo_da_immobili").val(data.value.newValue[0]);
4345			$("#prezzo_a_immobili").val(data.value.newValue[1]);	
4346			setInputNumberFormat(data.value.newValue[0], 'prezzo_da_input_immobili');
4347			setInputNumberFormat(data.value.newValue[1], 'prezzo_a_input_immobili');
4348	 	});	
4349		if(prezzo_immobili){
4350			prezzoArr = prezzo_immobili.split('-');
4351			$("#prezzo_range_immobili").slider('setValue',[parseInt(prezzoArr[0]), parseInt(prezzoArr[1])]);
4352			$("#prezzo_da_immobili").val(prezzoArr[0]);
4353			$("#prezzo_a_immobili").val(prezzoArr[1]);	 
4354			setInputNumberFormat(prezzoArr[0], 'prezzo_da_input_immobili');
4355			setInputNumberFormat(prezzoArr[1], 'prezzo_a_input_immobili');
4356			setLabelPrezzoImmobili(prezzoArr[0]+'-'+prezzoArr[1], '€ ' + numeral(prezzoArr[0]).format('0,0')+' - € '+numeral(prezzoArr[1]).format('0,0'));
4357		}
4358		else{
4359			$("#prezzo_range_immobili").slider('setValue',[parseInt(minPreImmobili), parseInt(maxPreImmobili)]);
4360			$("#prezzo_da_immobili").val(minPreImmobili);
4361			$("#prezzo_a_immobili").val(maxPreImmobili);	 
4362			setInputNumberFormat(minPreImmobili, 'prezzo_da_input_immobili');
4363			setInputNumberFormat(maxPreImmobili, 'prezzo_a_input_immobili');
4364			setLabelPrezzoImmobili(minPreImmobili+'-'+maxPreImmobili, '€ ' + numeral(minPreImmobili).format('0,0')+' - € '+numeral(maxPreImmobili).format('0,0'));
4365		}
4366		
4367		$("#annullaButtonPrezziImmobili").click(function() {
4368			$("#prezzo_immobiliBtn").dropdown("toggle");
4369
4370        	setLabelPrezzoImmobili($("#prezzo_min_immobili").val()+'-'+$("#prezzo_max_immobili").val(), '€ ' + numeral($("#prezzo_min_immobili").val()).format('0,0')+' - € '+numeral($("#prezzo_max_immobili").val()).format('0,0'));
4371        	$("#prezzo_range_immobili_filtro").slider('setValue',[parseInt($("#prezzo_min_immobili").val()), parseInt($("#prezzo_max_immobili").val())]);
4372        	$("#prezzo_da_immobili_filtro").val($("#prezzo_min_immobili").val());
4373        	$("#prezzo_a_immobili_filtro").val($("#prezzo_max_immobili").val());	
4374			$("#prezzo_da_input_immobili_filtro").val($("#prezzo_min_immobili").val());
4375			$("#prezzo_a_input_immobili_filtro").val($("#prezzo_max_immobili").val()); 
4376			$("#prezzo_range_immobili").slider('setValue',[parseInt(minPreImmobili), parseInt(maxPreImmobili)]);
4377			setInputNumberFormat($("#prezzo_min_immobili").val(), 'prezzo_da_input_immobili');
4378			setInputNumberFormat($("#prezzo_max_immobili").val(), 'prezzo_a_input_immobili');
4379        	setInputNumberFormat($("#prezzo_min_immobili").val(), 'prezzo_da_input_immobili_filtro');
4380        	setInputNumberFormat($("#prezzo_max_immobili").val(), 'prezzo_a_input_immobili_filtro');
4381		});
4382
4383		$("#applicaButtonPrezziImmobili").click(function() {
4384			$("#prezzo_immobiliBtn").dropdown("toggle");
4385			setLabelPrezzoImmobili(removeDots($("#prezzo_da_input_immobili").val())+'-'+removeDots($("#prezzo_a_input_immobili").val()), '€ ' + numeral($("#prezzo_da_input_immobili").val()).format('0,0')+' - € '+numeral($("#prezzo_a_input_immobili").val()).format('0,0'));
4386                        	newSlug = refreshSlugImmobili();
4387                              		submitCercaImmobili(newSlug, true);
4388                            			$("#prezzo_range_immobili_filtro").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_immobili").val())), parseInt(removeDots($("#prezzo_a_input_immobili").val()))]);
4389			$("#prezzo_da_immobili_filtro").val(removeDots($("#prezzo_da_input_immobili").val()));
4390			$("#prezzo_a_immobili_filtro").val(removeDots($("#prezzo_a_input_immobili").val()));	 
4391			$("#prezzo_da_input_immobili_filtro").val($("#prezzo_da_input_immobili").val());
4392			$("#prezzo_a_input_immobili_filtro").val($("#prezzo_a_input_immobili").val());
4393		});
4394		
4395		//$("#prezzo_da_input_immobili").change(function() {
4396		$("#prezzo_da_input_immobili").on('change blur', function() {
4397			if(parseInt(removeDots($("#prezzo_da_input_immobili").val())) < minPreImmobili){
4398				$("#prezzo_da_immobili").val(minPreImmobili);
4399				setInputNumberFormat(minPreImmobili, 'prezzo_da_input_immobili');
4400				$("#prezzo_range_immobili").slider('setValue',[parseInt(minPreImmobili), parseInt(removeDots($("#prezzo_a_input_immobili").val()))]);
4401			}
4402			else{
4403				$("#prezzo_da_immobili").val(removeDots($("#prezzo_da_input_immobili").val()));
4404				$("#prezzo_range_immobili").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_immobili").val())), parseInt(removeDots($("#prezzo_a_input_immobili").val()))]);
4405			}
4406			if(parseInt(removeDots($("#prezzo_da_input_immobili").val())) > parseInt(removeDots($("#prezzo_a_input_immobili").val()))){
4407				$("#prezzo_da_immobili").val(parseInt(removeDots($("#prezzo_a_input_immobili").val())));
4408				$("#prezzo_da_input_immobili").val($("#prezzo_a_input_immobili").val());
4409				$("#prezzo_range_immobili").slider('setValue',[parseInt(removeDots($("#prezzo_a_input_immobili").val())), parseInt(removeDots($("#prezzo_a_input_immobili").val()))]);
4410			}
4411		});
4412		
4413		//$("#prezzo_a_input_immobili").change(function() {
4414		$("#prezzo_a_input_immobili").on('change blur', function() {
4415			if(parseInt(removeDots($("#prezzo_a_input_immobili").val())) > maxPreImmobili){
4416				$("#prezzo_a_immobili").val(maxPreImmobili);
4417				setInputNumberFormat(maxPreImmobili, 'prezzo_a_input_immobili');
4418				$("#prezzo_range_immobili").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_immobili").val())), parseInt(maxPreImmobili)]);
4419			}
4420			else{
4421				$("#prezzo_a_immobili").val(removeDots($("#prezzo_a_input_immobili").val()));
4422				$("#prezzo_range_immobili").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_immobili").val())), parseInt(removeDots($("#prezzo_a_input_immobili").val()))]);
4423			}
4424			if(parseInt(removeDots($("#prezzo_a_input_immobili").val())) < parseInt(removeDots($("#prezzo_da_input_immobili").val()))){
4425				$("#prezzo_a_immobili").val(parseInt(removeDots($("#prezzo_da_input_immobili").val())));
4426				$("#prezzo_a_input_immobili").val($("#prezzo_da_input_immobili").val());
4427				$("#prezzo_range_immobili").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_immobili").val())), parseInt(removeDots($("#prezzo_da_input_immobili").val()))]);
4428			}
4429		});
4430
4431		html_option_filtro += '<input id="prezzo_range_immobili_filtro" type="text"/>';
4432		html_option_filtro += '<input id="prezzo_da_immobili_filtro" type="hidden" />';
4433		html_option_filtro += '<input id="prezzo_a_immobili_filtro" type="hidden" />';
4434
4435		html_option_filtro += '<div id="prezziImmobiliInputDivFiltro">';
4436			html_option_filtro += '<div class="input-group">';
4437				html_option_filtro += '<label for="prezzo_da_input_immobili_filtro">Minimum budget</label>';
4438				html_option_filtro += '<span class="input-group-text">€</span><input class="form-control" id="prezzo_da_input_immobili_filtro" lang="en" type="text" onkeyup="setInputNumberFormat(this.value, this.id);"/>';
4439			html_option_filtro += '</div>';
4440			html_option_filtro += '<div class="input-group">';
4441				html_option_filtro += '<label for="prezzo_a_input_immobili_filtro">Maximum budget</label>';
4442				html_option_filtro += '<span class="input-group-text">€</span><input class="form-control" id="prezzo_a_input_immobili_filtro" lang="en" type="text" onkeyup="setInputNumberFormat(this.value, this.id);"/>';
4443			html_option_filtro += '</div>';
4444		html_option_filtro += '</div>';
4445    
4446		$("#prezzoImmobiliSlider_filtro").empty().append(html_option_filtro);
4447		$('#prezzoImmobiliSlider_filtro').click(function(e) {
4448		    e.stopPropagation();
4449		});
4450
4451		let arrTicks_filtro = [250000, 500000, 750000, 1000000, 1250000, 1500000, 1750000, 2000000, 2500000, 3000000, 3500000];
4452		if(maxPreImmobili > 1000000){
4453			arrTicks_filtro.push(1000000);
4454		}
4455		if(maxPreImmobili > 2500000){
4456			arrTicks_filtro.push(2000000);
4457		}
4458		if(maxPreImmobili > 5000000){
4459			arrTicks_filtro.push(5000000);
4460		}
4461		
4462		$("#prezzo_range_immobili_filtro").slider({ 	
4463			min: minPreImmobili, 
4464			max: maxPreImmobili, 
4465			value: [0, maxPreImmobili], 
4466			focus: true,
4467			tooltip: 'always',
4468			tooltip_split: true,
4469			tooltip_position:'bottom',
4470		    ticks: arrTicks_filtro,		
4471		    ticks_snap_bounds: 100000
4472		}).on('slideStart', function(data){
4473			prezzoPreSliderFiltro = $('#prezzo_range_immobili_filtro').data('slider').getValue();
4474		}).on('slideStop', function(data){
4475			prezzoPostSliderFiltro = $('#prezzo_range_immobili_filtro').data('slider').getValue();
4476			if((prezzoPreSliderFiltro[0] != prezzoPostSliderFiltro[0]) || (prezzoPreSliderFiltro[1] != prezzoPostSliderFiltro[1])){
4477				$("#prezzo_da_immobili_filtro").val(data.value[0]);
4478				$("#prezzo_a_immobili_filtro").val(data.value[1]);	
4479                setInputNumberFormat(data.value[0], 'prezzo_da_input_immobili_filtro');
4480                setInputNumberFormat(data.value[1], 'prezzo_a_input_immobili_filtro');	
4481				$("#prezzo_da_immobili").val(data.value[0]);
4482				$("#prezzo_a_immobili").val(data.value[1]);	
4483				setInputNumberFormat(data.value[0], 'prezzo_da_input_immobili');
4484				setInputNumberFormat(data.value[1], 'prezzo_a_input_immobili');
4485				refreshTotImmobili();
4486				setLabelPrezzoImmobili(data.value[0]+'-'+data.value[1], '€ ' + numeral(data.value[0]).format('0,0')+' - € '+numeral(data.value[1]).format('0,0'));
4487			}			
4488		}).on('change', function(data){		
4489			$("#prezzo_da_immobili_filtro").val(data.value.newValue[0]);
4490			$("#prezzo_a_immobili_filtro").val(data.value.newValue[1]);	
4491            setInputNumberFormat(data.value.newValue[0], 'prezzo_da_input_immobili_filtro');
4492            setInputNumberFormat(data.value.newValue[1], 'prezzo_a_input_immobili_filtro');	
4493			$("#prezzo_da_immobili").val(data.value.newValue[0]);
4494			$("#prezzo_a_immobili").val(data.value.newValue[1]);	
4495			setInputNumberFormat(data.value.newValue[0], 'prezzo_da_input_immobili');
4496			setInputNumberFormat(data.value.newValue[1], 'prezzo_a_input_immobili');
4497			setLabelPrezzoImmobili(data.value.newValue[0]+'-'+data.value.newValue[1], '€ ' + numeral(data.value.newValue[0]).format('0,0')+' - € '+numeral(data.value.newValue[1]).format('0,0'));
4498	 	});	
4499
4500		if(prezzo_immobili){
4501    		$("#prezzo_range_immobili_filtro").slider('setValue',[parseInt(prezzoArr[0]), parseInt(prezzoArr[1])]);
4502    		$("#prezzo_da_immobili_filtro").val(prezzoArr[0]);
4503    		$("#prezzo_a_immobili_filtro").val(prezzoArr[1]);	 
4504            setInputNumberFormat(prezzoArr[0], 'prezzo_da_input_immobili_filtro');
4505            setInputNumberFormat(prezzoArr[1], 'prezzo_a_input_immobili_filtro');	
4506		}
4507		else{
4508    		$("#prezzo_range_immobili_filtro").slider('setValue',[parseInt(minPreImmobili), parseInt(maxPreImmobili)]);
4509    		$("#prezzo_da_immobili_filtro").val(minPreImmobili);
4510    		$("#prezzo_a_immobili_filtro").val(maxPreImmobili);	 
4511            setInputNumberFormat(minPreImmobili, 'prezzo_da_input_immobili_filtro');
4512            setInputNumberFormat(maxPreImmobili, 'prezzo_a_input_immobili_filtro');	
4513		}
4514
4515		//$("#prezzo_da_input_immobili_filtro").change(function() {
4516		$("#prezzo_da_input_immobili_filtro").on('change blur', function() {
4517			if(parseInt(removeDots($("#prezzo_da_input_immobili_filtro").val())) < minPreImmobili){
4518				$("#prezzo_da_immobili_filtro").val(minPreImmobili);
4519				setInputNumberFormat(minPreImmobili, 'prezzo_da_input_immobili_filtro');
4520				$("#prezzo_range_immobili_filtro").slider('setValue',[parseInt(minPreImmobili), parseInt(removeDots($("#prezzo_a_input_immobili_filtro").val()))]);
4521				$("#prezzo_da_immobili").val(minPreImmobili);
4522				setInputNumberFormat(minPreImmobili, 'prezzo_da_input_immobili');
4523				$("#prezzo_range_immobili").slider('setValue',[parseInt(minPreImmobili), parseInt(removeDots($("#prezzo_a_input_immobili_filtro").val()))]);
4524				setLabelPrezzoImmobili(minPreImmobili+'-'+removeDots($("#prezzo_a_input_immobili_filtro").val()), '€ ' + numeral(minPreImmobili).format('0,0')+' - € '+numeral($("#prezzo_a_input_immobili_filtro").val()).format('0,0'));
4525			}
4526			else{
4527				$("#prezzo_da_immobili_filtro").val(removeDots($("#prezzo_da_input_immobili_filtro").val()));
4528				$("#prezzo_range_immobili_filtro").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_immobili_filtro").val())), parseInt(removeDots($("#prezzo_a_input_immobili_filtro").val()))]);
4529				$("#prezzo_da_immobili").val(removeDots($("#prezzo_da_input_immobili_filtro").val()));
4530				$("#prezzo_range_immobili").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_immobili_filtro").val())), parseInt(removeDots($("#prezzo_a_input_immobili_filtro").val()))]);
4531				setLabelPrezzoImmobili(removeDots($("#prezzo_da_input_immobili_filtro").val())+'-'+removeDots($("#prezzo_a_input_immobili_filtro").val()), '€ ' + numeral($("#prezzo_da_input_immobili_filtro").val()).format('0,0')+' - € '+numeral($("#prezzo_a_input_immobili_filtro").val()).format('0,0'));
4532			}
4533			if(parseInt(removeDots($("#prezzo_da_input_immobili_filtro").val())) > parseInt(removeDots($("#prezzo_a_input_immobili_filtro").val()))){
4534				$("#prezzo_da_immobili_filtro").val(parseInt(removeDots($("#prezzo_a_input_immobili_filtro").val())));
4535				$("#prezzo_da_input_immobili_filtro").val($("#prezzo_a_input_immobili_filtro").val());
4536				$("#prezzo_range_immobili_filtro").slider('setValue',[parseInt(removeDots($("#prezzo_a_input_immobili_filtro").val())), parseInt(removeDots($("#prezzo_a_input_immobili_filtro").val()))]);
4537				$("#prezzo_da_immobili").val(parseInt(removeDots($("#prezzo_a_input_immobili_filtro").val())));
4538				$("#prezzo_da_input_immobili").val($("#prezzo_a_input_immobili_filtro").val());
4539				$("#prezzo_range_immobili").slider('setValue',[parseInt(removeDots($("#prezzo_a_input_immobili_filtro").val())), parseInt(removeDots($("#prezzo_a_input_immobili_filtro").val()))]);
4540				setLabelPrezzoImmobili(removeDots($("#prezzo_da_input_immobili_filtro").val())+'-'+removeDots($("#prezzo_a_input_immobili_filtro").val()), '€ ' + numeral($("#prezzo_da_input_immobili_filtro").val()).format('0,0')+' - € '+numeral($("#prezzo_a_input_immobili_filtro").val()).format('0,0'));
4541			}
4542			refreshTotImmobili();
4543		});
4544		
4545		//$("#prezzo_a_input_immobili_filtro").change(function() {
4546		$("#prezzo_a_input_immobili_filtro").on('change blur', function() {
4547			if(parseInt(removeDots($("#prezzo_a_input_immobili_filtro").val())) > maxPreImmobili){
4548				$("#prezzo_a_immobili_filtro").val(maxPreImmobili);
4549				setInputNumberFormat(maxPreImmobili, 'prezzo_a_input_immobili_filtro');
4550				$("#prezzo_range_immobili_filtro").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_immobili_filtro").val())), parseInt(maxPreImmobili)]);
4551				$("#prezzo_a_immobili").val(maxPreImmobili);
4552				setInputNumberFormat(maxPreImmobili, 'prezzo_a_input_immobili');
4553				$("#prezzo_range_immobili").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_immobili_filtro").val())), parseInt(maxPreImmobili)]);
4554				setLabelPrezzoImmobili(removeDots($("#prezzo_da_input_immobili_filtro").val())+'-'+maxPreImmobili, '€ ' + numeral($("#prezzo_da_input_immobili_filtro").val()).format('0,0')+' - € '+numeral(maxPreImmobili).format('0,0'));
4555			}
4556			else{
4557				$("#prezzo_a_immobili_filtro").val(removeDots($("#prezzo_a_input_immobili_filtro").val()));
4558				$("#prezzo_range_immobili_filtro").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_immobili_filtro").val())), parseInt(removeDots($("#prezzo_a_input_immobili_filtro").val()))]);
4559				$("#prezzo_a_immobili").val(removeDots($("#prezzo_a_input_immobili_filtro").val()));
4560				$("#prezzo_range_immobili").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_immobili_filtro").val())), parseInt(removeDots($("#prezzo_a_input_immobili_filtro").val()))]);
4561				setLabelPrezzoImmobili(removeDots($("#prezzo_da_input_immobili_filtro").val())+'-'+removeDots($("#prezzo_a_input_immobili_filtro").val()), '€ ' + numeral($("#prezzo_da_input_immobili_filtro").val()).format('0,0')+' - € '+numeral($("#prezzo_a_input_immobili_filtro").val()).format('0,0'));
4562			}
4563			if(parseInt(removeDots($("#prezzo_a_input_immobili_filtro").val())) < parseInt(removeDots($("#prezzo_da_input_immobili_filtro").val()))){
4564				$("#prezzo_a_immobili_filtro").val(parseInt(removeDots($("#prezzo_da_input_immobili_filtro").val())));
4565				$("#prezzo_a_input_immobili_filtro").val($("#prezzo_da_input_immobili_filtro").val());
4566				$("#prezzo_range_immobili_filtro").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_immobili_filtro").val())), parseInt(removeDots($("#prezzo_da_input_immobili_filtro").val()))]);
4567				$("#prezzo_a_immobili").val(parseInt(removeDots($("#prezzo_da_input_immobili_filtro").val())));
4568				$("#prezzo_a_input_immobili").val($("#prezzo_da_input_immobili_filtro").val());
4569				$("#prezzo_range_immobili").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_immobili_filtro").val())), parseInt(removeDots($("#prezzo_da_input_immobili_filtro").val()))]);
4570				setLabelPrezzoImmobili(removeDots($("#prezzo_da_input_immobili_filtro").val())+'-'+removeDots($("#prezzo_da_input_immobili_filtro").val()), '€ ' + numeral($("#prezzo_da_input_immobili_filtro").val()).format('0,0')+' - € '+numeral($("#prezzo_da_input_immobili_filtro").val()).format('0,0'));
4571			}
4572			refreshTotImmobili();
4573		});
4574    });	
4575}
4576
4577function setCamereImmobili() { 				
4578	var camerePreSliderFiltro;
4579	var camerePostSliderFiltro;	
4580	let arrTicks_filtro = [0,1,2,3,4,5,6,7,8,9,10];
4581	let arrTicksLabel_filtro = ['0','1','2','3','4','5','6','7','8','9','10+'];
4582
4583	if(camere_immobili){
4584		camereArr = camere_immobili.split('-');
4585		minCamImmobili = camereArr[0];
4586		if(camereArr[1] == 10){
4587			maxCamImmobili = 1000;
4588		}
4589		else{
4590			maxCamImmobili = camereArr[1];
4591		}
4592	}
4593	else{
4594		minCamImmobili = 0;
4595		maxCamImmobili = 10;
4596	} 
4597
4598	$('#camereImmobiliSlider_filtro').click(function(e) {
4599	    e.stopPropagation();
4600	});
4601	
4601
4602	$("#camere_range_immobili_filtro").bootstrapSlider({ 	
4603		step: 1,
4604		min: 0, 
4605		max: 10, 
4606		value: [parseInt(minCamImmobili), parseInt(maxCamImmobili)], 
4607		focus: true,
4608		tooltip: 'always',
4609		tooltip_split: true,
4610		tooltip_position:'bottom',
4611	    ticks: arrTicks_filtro,		
4612	    ticks_labels: arrTicksLabel_filtro,
4613	    ticks_snap_bounds: 50
4614	}).on('slideStart', function(data){
4615		camerePreSliderFiltro = $('#camere_range_immobili_filtro').data('bootstrapSlider').getValue();
4616	}).on('slideStop', function(data){
4617		camerePostSliderFiltro = $('#camere_range_immobili_filtro').data('bootstrapSlider').getValue();
4618		if((camerePreSliderFiltro[0] != camerePostSliderFiltro[0]) || (camerePreSliderFiltro[1] != camerePostSliderFiltro[1])){
4619			if(data.value[0] == 10){
4620				$("#camere_da_immobili_filtro").val(10);
4621				$('#camere_immobili').val('10-'+data.value[1]);
4622			}
4623			else{
4624				$("#camere_da_immobili_filtro").val(data.value[0]);
4625				$('#camere_immobili').val(data.value[0]+'-'+data.value[1]);
4626			}
4627			if(data.value[1] == 10){
4628				$("#camere_a_immobili_filtro").val(1000);
4629				$('#camere_immobili').val(data.value[0]+'-1000');
4630			}
4631			else{
4632				$("#camere_a_immobili_filtro").val(data.value[1]);	
4633				$('#camere_immobili').val(data.value[0]+'-'+data.value[1]);
4634			}
4635			refreshTotImmobili();
4636		}			
4637	}).on('change', function(data){	
4638		if(data.value.newValue[0] == 10){
4639			$("#camere_da_immobili_filtro").val(10);
4640			$('#camere_immobili').val('10-'+data.value.newValue[1]);
4641		}
4642		else{
4643			$("#camere_da_immobili_filtro").val(data.value.newValue[0]);
4644			$('#camere_immobili').val(data.value.newValue[0]+'-'+data.value.newValue[1]);
4645		}
4646		if(data.value.newValue[1] == 10){
4647			$("#camere_a_immobili_filtro").val(1000);
4648			$('#camere_immobili').val(data.value.newValue[0]+'-1000');
4649		}
4650		else{
4651			$("#camere_a_immobili_filtro").val(data.value.newValue[1]);	
4652			$('#camere_immobili').val(data.value.newValue[0]+'-'+data.value.newValue[1]);
4653		}	
4654 	});	
4655
4656	if(camere_immobili){
4657		camereArr = camere_immobili.split('-');
4658		$("#camere_range_immobili_filtro").bootstrapSlider('setValue',[parseInt(camereArr[0]), parseInt(camereArr[1])]);
4659		$("#camere_da_immobili_filtro").val(camereArr[0]);
4660		$("#camere_a_immobili_filtro").val(camereArr[1]);	
4661	}
4662	else{
4663		$("#camere_range_immobili_filtro").bootstrapSlider('setValue',[0, 10]);
4664		$("#camere_da_immobili_filtro").val(0);
4665		$("#camere_a_immobili_filtro").val(1000);	
4666	} 
4667}
4668
4669function setBagniImmobili() { 				
4670	var bagniPreSliderFiltro;
4671	var bagniPostSliderFiltro;	
4672	let arrTicks_filtro = [0,1,2,3,4,5,6,7,8,9,10];
4673	let arrTicksLabel_filtro = ['0','1','2','3','4','5','6','7','8','9','10+'];
4674
4675	if(bagni_immobili){
4676		bagniArr = bagni_immobili.split('-');
4677		minBagImmobili = bagniArr[0];
4678		if(bagniArr[1] == 10){
4679			maxBagImmobili = 1000;
4680		}
4681		else{
4682			maxBagImmobili = bagniArr[1];
4683		}
4684	}
4685	else{
4686		minBagImmobili = 0;
4687		maxBagImmobili = 10;
4688	} 
4689	
4690	$('#bagniImmobiliSlider_filtro').click(function(e) {
4691	    e.stopPropagation();
4692	});
4693	
4694	$("#bagni_range_immobili_filtro").bootstrapSlider({ 	
4695		step: 1,
4696		min: 0, 
4697		max: 10, 
4698		value: [parseInt(minBagImmobili), parseInt(maxBagImmobili)], 
4699		focus: true,
4700		tooltip: 'always',
4701		tooltip_split: true,
4702		tooltip_position:'bottom',
4703	    ticks: arrTicks_filtro,		
4704	    ticks_labels: arrTicksLabel_filtro,
4705	    ticks_snap_bounds: 50
4706	}).on('slideStart', function(data){
4707		bagniPreSliderFiltro = $('#bagni_range_immobili_filtro').data('bootstrapSlider').getValue();
4708	}).on('slideStop', function(data){
4709		bagniPostSliderFiltro = $('#bagni_range_immobili_filtro').data('bootstrapSlider').getValue();
4710		if((bagniPreSliderFiltro[0] != bagniPostSliderFiltro[0]) || (bagniPreSliderFiltro[1] != bagniPostSliderFiltro[1])){
4711			if(data.value[0] == 10){
4712				$("#bagni_da_immobili_filtro").val(10);
4713				$('#bagni_immobili').val('10-'+data.value[1]);
4714			}
4715			else{
4716				$("#bagni_da_immobili_filtro").val(data.value[0]);
4717				$('#bagni_immobili').val(data.value[0]+'-'+data.value[1]);
4718			}
4719			if(data.value[1] == 10){
4720				$("#bagni_a_immobili_filtro").val(1000);
4721				$('#bagni_immobili').val(data.value[0]+'-1000');
4722			}
4723			else{
4724				$("#bagni_a_immobili_filtro").val(data.value[1]);	
4725				$('#bagni_immobili').val(data.value[0]+'-'+data.value[1]);
4726			}
4727			refreshTotImmobili();
4728		}			
4729	}).on('change', function(data){	
4730		if(data.value.newValue[0] == 10){
4731			$("#bagni_da_immobili_filtro").val(10);
4732			$('#bagni_immobili').val('10-'+data.value.newValue[1]);
4733		}
4734		else{
4735			$("#bagni_da_immobili_filtro").val(data.value.newValue[0]);
4736			$('#bagni_immobili').val(data.value.newValue[0]+'-'+data.value.newValue[1]);
4737		}
4738		if(data.value.newValue[1] == 10){
4739			$("#bagni_a_immobili_filtro").val(1000);
4740			$('#bagni_immobili').val(data.value.newValue[0]+'-1000');
4741		}
4742		else{
4743			$("#bagni_a_immobili_filtro").val(data.value.newValue[1]);	
4744			$('#bagni_immobili').val(data.value.newValue[0]+'-'+data.value.newValue[1]);
4745		}	
4746 	});	
4747
4748	if(bagni_immobili){
4749		bagniArr = bagni_immobili.split('-');
4750		$("#bagni_range_immobili_filtro").bootstrapSlider('setValue',[parseInt(bagniArr[0]), parseInt(bagniArr[1])]);
4751		$("#bagni_da_immobili_filtro").val(bagniArr[0]);
4752		$("#bagni_a_immobili_filtro").val(bagniArr[1]);	
4753	}
4754	else{
4755		$("#bagni_range_immobili_filtro").bootstrapSlider('setValue',[0, 10]);
4756		$("#bagni_da_immobili_filtro").val(0);
4757		$("#bagni_a_immobili_filtro").val(1000);	
4758	} 
4759}
4760
4761function listaSuperficiImmobili() { 
4762	var html_option_filtro = '';
4763	var url = _api+'greatestate/superfici_immobili';
4764	
4765	$.ajax({
4766        url: url,
4767        type: 'POST',	            
4768        crossDomain: true,           
4769        xhrFields:
4770        {
4771            withCredentials: true
4772        },
4773        error: function (error) {
4774        	console.log(error);
4775        	return;
4776        }
4777    }).done(function(json) {    
4778		var jsonLenght = json.rows.length;
4779
4780		var superficiePreSlider;
4781		var superficiePostSlider;	 				
4782		var superficiePreSliderFiltro;
4783		var superficiePostSliderFiltro;	
4784		
4785		minSupImmobili = parseInt(json.rows[0].superficie_min);
4786		maxSupImmobili = parseInt(json.rows[0].superficie_max);
4787
4788		html_option_filtro += '<input id="superficie_range_immobili_filtro" type="text"/>';
4789		html_option_filtro += '<input id="superficie_da_immobili_filtro" type="hidden" />';
4790		html_option_filtro += '<input id="superficie_a_immobili_filtro" type="hidden" />';
4791		html_option_filtro += '<input id="superficie_min_immobili_filtro" type="hidden" value="'+minSupImmobili+'"/>';
4792		html_option_filtro += '<input id="superficie_max_immobili_filtro" type="hidden" value="'+maxSupImmobili+'"/>';
4793		
4794		html_option_filtro += '<div id="superficiImmobiliInputDivFiltro">';
4795			html_option_filtro += '<div class="input-group">';
4796				html_option_filtro += '<label for="superficie_da_input_immobili_filtro">Minimum surface</label>';
4797				html_option_filtro += '<span class="input-group-text">sqm</span><input class="form-control" id="superficie_da_input_immobili_filtro" lang="en" type="text" onkeyup="setInputNumberFormat(this.value, this.id);"/>';
4798			html_option_filtro += '</div>';
4799			html_option_filtro += '<div class="input-group">';
4800				html_option_filtro += '<label for="superficie_a_input_immobili_filtro">Maximum surface</label>';
4801				html_option_filtro += '<span class="input-group-text">sqm</span><input class="form-control" id="superficie_a_input_immobili_filtro" lang="en" type="text" onkeyup="setInputNumberFormat(this.value, this.id);"/>';
4802			html_option_filtro += '</div>';
4803		html_option_filtro += '</div>';
4804    
4805		$("#superficieImmobiliSlider_filtro").empty().append(html_option_filtro);
4806		$('#superficieImmobiliSlider_filtro').click(function(e) {
4807		    e.stopPropagation();
4808		});
4809
4810		let arrTicks_filtro = [];
4811		arrTicks_filtro.push(minSupImmobili);
4812		for(s = 100; s < (maxSupImmobili - 500); s = s + 100){
4813			if(s > 2000){
4814				s = s + 400;
4815			}
4816			arrTicks_filtro.push(s);
4817		}
4818
4819		$("#superficie_range_immobili_filtro").slider({ 	
4820			step: 100,
4821			min: 0, 
4822			max: maxSupImmobili, 
4823			value: [0, maxSupImmobili], 
4824			focus: true,
4825			tooltip: 'always',
4826			tooltip_split: true,
4827			tooltip_position:'bottom',
4828			ticks: arrTicks_filtro,		
4829		    ticks_snap_bounds: 100
4830		}).on('slideStart', function(data){
4831			superficiePreSliderFiltro = $('#superficie_range_immobili_filtro').data('slider').getValue();
4832		}).on('slideStop', function(data){
4833			superficiePostSliderFiltro = $('#superficie_range_immobili_filtro').data('slider').getValue();
4834			if((superficiePreSliderFiltro[0] != superficiePostSliderFiltro[0]) || (superficiePreSliderFiltro[1] != superficiePostSliderFiltro[1])){
4835				$("#superficie_da_immobili_filtro").val(data.value[0]);
4836				$("#superficie_a_immobili_filtro").val(data.value[1]);		
4837				setInputNumberFormat(data.value[0], 'superficie_da_input_immobili_filtro');
4838				setInputNumberFormat(data.value[1], 'superficie_a_input_immobili_filtro');
4839				refreshTotImmobili();
4840				$('#superficie_immobili').val(data.value[0]+'-'+data.value[1]);
4841			}			
4842		}).on('change', function(data){		
4843			$("#superficie_da_immobili_filtro").val(data.value.newValue[0]);
4844			$("#superficie_a_immobili_filtro").val(data.value.newValue[1]);	
4845            setInputNumberFormat(data.value.newValue[0], 'superficie_da_input_immobili_filtro');
4846            setInputNumberFormat(data.value.newValue[1], 'superficie_a_input_immobili_filtro');
4847			$('#superficie_immobili').val(data.value.newValue[0]+'-'+data.value.newValue[1]);
4848	 	});	
4849
4850		if(superficie_immobili){
4851			superficieArr = superficie_immobili.split('-');
4852			$("#superficie_range_immobili_filtro").slider('setValue',[parseInt(superficieArr[0]), parseInt(superficieArr[1])]);
4853			$("#superficie_da_immobili_filtro").val();
4854			$("#superficie_a_immobili_filtro").val();	 
4855            setInputNumberFormat(superficieArr[0], 'superficie_da_input_immobili_filtro');
4856            setInputNumberFormat(superficieArr[1], 'superficie_a_input_immobili_filtro');
4857			$('#superficie_immobili').val(superficieArr[0]+'-'+superficieArr[1]);
4858		}
4859		else{
4860			$("#superficie_range_immobili_filtro").slider('setValue',[parseInt(minSupImmobili), parseInt(maxSupImmobili)]);
4861			$("#superficie_da_immobili_filtro").val();
4862			$("#superficie_a_immobili_filtro").val();	 
4863            setInputNumberFormat(minSupImmobili, 'superficie_da_input_immobili_filtro');
4864            setInputNumberFormat(maxSupImmobili, 'superficie_a_input_immobili_filtro');
4865			$('#superficie_immobili').val(minSupImmobili+'-'+maxSupImmobili);
4866		}
4867		
4868		//$("#superficie_da_input_immobili_filtro").change(function() {
4869		$("#superficie_da_input_immobili_filtro").on('change blur', function() {
4870			if(parseInt(removeDots($("#superficie_da_input_immobili_filtro").val())) < minSupImmobili){
4871				$("#superficie_da_immobili_filtro").val(minSupImmobili);
4872				setInputNumberFormat(minSupImmobili, 'superficie_da_input_immobili_filtro');
4873				$("#superficie_range_immobili_filtro").slider('setValue',[parseInt(minSupImmobili), parseInt(removeDots($("#superficie_a_input_immobili_filtro").val()))]);
4874				$('#superficie_immobili').val(minSupImmobili+'-'+removeDots($("#superficie_a_input_immobili_filtro").val()));
4875			}
4876			else{
4877				$("#superficie_da_immobili_filtro").val(removeDots($("#superficie_da_input_immobili_filtro").val()));
4878				$("#superficie_range_immobili_filtro").slider('setValue',[parseInt(removeDots($("#superficie_da_input_immobili_filtro").val())), parseInt(removeDots($("#superficie_a_input_immobili_filtro").val()))]);
4879				$('#superficie_immobili').val(removeDots($("#superficie_da_input_immobili_filtro").val())+'-'+removeDots($("#superficie_a_input_immobili_filtro").val()));
4880			}
4881			if(parseInt(removeDots($("#superficie_da_input_immobili_filtro").val())) > parseInt(removeDots($("#superficie_a_input_immobili_filtro").val()))){
4882				$("#superficie_da_immobili_filtro").val(parseInt(removeDots($("#superficie_a_input_immobili_filtro").val())));
4883				$("#superficie_da_input_immobili_filtro").val($("#superficie_a_input_immobili_filtro").val());
4884				$("#superficie_range_immobili_filtro").slider('setValue',[parseInt(removeDots($("#superficie_a_input_immobili_filtro").val())), parseInt(removeDots($("#superficie_a_input_immobili_filtro").val()))]);
4885				$('#superficie_immobili').val(removeDots($("#superficie_da_input_immobili_filtro").val())+'-'+removeDots($("#superficie_a_input_immobili_filtro").val()));
4886			}
4887			refreshTotImmobili();
4888		});
4889		
4890		//$("#superficie_a_input_immobili_filtro").change(function() {
4891		$("#superficie_a_input_immobili_filtro").on('change blur', function() {
4892			if(parseInt(removeDots($("#superficie_a_input_immobili_filtro").val())) > maxSupImmobili){
4893				$("#superficie_a_immobili_filtro").val(maxSupImmobili);
4894				setInputNumberFormat(maxSupImmobili, 'superficie_a_input_immobili_filtro');
4895				$("#superficie_range_immobili_filtro").slider('setValue',[parseInt(removeDots($("#superficie_da_input_immobili_filtro").val())), parseInt(maxSupImmobili)]);
4896				$('#superficie_immobili').val(removeDots($("#superficie_da_input_immobili_filtro").val())+'-'+maxSupImmobili);
4897			}
4898			else{
4899				$("#superficie_a_immobili_filtro").val(removeDots($("#superficie_a_input_immobili_filtro").val()));
4900				$("#superficie_range_immobili_filtro").slider('setValue',[parseInt(removeDots($("#superficie_da_input_immobili_filtro").val())), parseInt(removeDots($("#superficie_a_input_immobili_filtro").val()))]);
4901				$('#superficie_immobili').val(removeDots($("#superficie_da_input_immobili_filtro").val())+'-'+removeDots($("#superficie_a_input_immobili_filtro").val()));
4902			}
4903			if(parseInt(removeDots($("#superficie_a_input_immobili_filtro").val())) < parseInt(removeDots($("#superficie_da_input_immobili_filtro").val()))){
4904				$("#superficie_a_immobili_filtro").val(parseInt(removeDots($("#superficie_da_input_immobili_filtro").val())));
4905				$("#superficie_a_input_immobili_filtro").val($("#superficie_da_input_immobili_filtro").val());
4906				$("#superficie_range_immobili_filtro").slider('setValue',[parseInt(removeDots($("#superficie_da_input_immobili_filtro").val())), parseInt(removeDots($("#superficie_da_input_immobili_filtro").val()))]);
4907				$('#superficie_immobili').val(removeDots($("#superficie_da_input_immobili_filtro").val())+'-'+removeDots($("#superficie_da_input_immobili_filtro").val()));
4908			}
4909			refreshTotImmobili();
4910		});
4911    });	
4912}
4913
4914function listaTerreniImmobili() { 
4915	var html_option_filtro = '';
4916	var url = _api+'greatestate/terreni_immobili';
4917	
4918	$.ajax({
4919        url: url,
4920        type: 'POST',	            
4921        crossDomain: true,           
4922        xhrFields:
4923        {
4924            withCredentials: true
4925        },
4926        error: function (error) {
4927        	console.log(error);
4928        	return;
4929        }
4930    }).done(function(json) {    
4931		var jsonLenght = json.rows.length;
4932
4933		var terrenoPreSlider;
4934		var terrenoPostSlider;	 				
4935		var terrenoPreSliderFiltro;
4936		var terrenoPostSliderFiltro;	
4937		
4938		minTerImmobili = parseInt(json.rows[0].terreno_min);
4939		maxTerImmobili = parseInt(json.rows[0].terreno_max);
4940
4941		html_option_filtro += '<input id="terreno_range_immobili_filtro" type="text"/>';
4942		html_option_filtro += '<input id="terreno_da_immobili_filtro" type="hidden" />';
4943		html_option_filtro += '<input id="terreno_a_immobili_filtro" type="hidden" />';
4944		html_option_filtro += '<input id="terreno_min_immobili_filtro" type="hidden" value="'+minTerImmobili+'"/>';
4945		html_option_filtro += '<input id="terreno_max_immobili_filtro" type="hidden" value="'+maxTerImmobili+'"/>';
4946		
4947		html_option_filtro += '<div id="terreniImmobiliInputDivFiltro">';
4948			html_option_filtro += '<div class="input-group">';
4949				html_option_filtro += '<label for="terreno_da_input_immobili_filtro">Minimum land</label>';
4950				html_option_filtro += '<span id="span_terreno_da_input_immobili_filtro" class="input-group-text">ha</span><input class="form-control" id="terreno_da_input_immobili_filtro" lang="en"  type="text" onkeyup="setInputNumberFormatTerreno(this.value, this.id);"/>';
4951			html_option_filtro += '</div>';
4952			html_option_filtro += '<div class="input-group">';
4953				html_option_filtro += '<label for="terreno_a_input_immobili_filtro">Maximum land</label>';
4954				html_option_filtro += '<span id="span_terreno_a_input_immobili_filtro" class="input-group-text">ha</span><input class="form-control" id="terreno_a_input_immobili_filtro" lang="en" type="text" onkeyup="setInputNumberFormatTerreno(this.value, this.id);"/>';
4955			html_option_filtro += '</div>';
4956		html_option_filtro += '</div>';
4957    
4958		$("#terrenoImmobiliSlider_filtro").empty().append(html_option_filtro);
4959		$('#terrenoImmobiliSlider_filtro').click(function(e) {
4960		    e.stopPropagation();
4961		});
4962
4963		let arrTicks_filtro = [minTerImmobili, 2500, 5000, 10000, 30000, 50000, 100000, 200000, 300000, 400000, 500000, 1000000, 1500000, 2000000];
4964		if(maxTerImmobili > 4000000){
4965			arrTicks_filtro.push(4000000);
4966		}
4967		if(maxTerImmobili > 6000000){
4968			arrTicks_filtro.push(6000000);
4969		}
4970
4971		$("#terreno_range_immobili_filtro").slider({ 	
4972			step: 2500,
4973			min: minTerImmobili, 
4974			max: maxTerImmobili, 
4975			value: [0, maxTerImmobili], 
4976			focus: true,
4977			tooltip: 'always',
4978			tooltip_split: true,
4979			tooltip_position:'bottom',
4980			ticks: arrTicks_filtro,		
4981		    ticks_snap_bounds: 50000
4982		}).on('slideStart', function(data){
4983			terrenoPreSliderFiltro = $('#terreno_range_immobili_filtro').data('slider').getValue();
4984		}).on('slideStop', function(data){
4985			terrenoPostSliderFiltro = $('#terreno_range_immobili_filtro').data('slider').getValue();
4986			if((terrenoPreSliderFiltro[0] != terrenoPostSliderFiltro[0]) || (terrenoPreSliderFiltro[1] != terrenoPostSliderFiltro[1])){
4987				$("#terreno_da_immobili_filtro").val(data.value[0]);
4988				$("#terreno_a_immobili_filtro").val(data.value[1]);	
4989                setInputNumberFormatTerreno(data.value[0] / 10000, 'terreno_da_input_immobili_filtro');
4990                setInputNumberFormatTerreno(data.value[1] / 10000, 'terreno_a_input_immobili_filtro');
4991				refreshTotImmobili();
4992				$('#terreno_immobili').val(data.value[0]+'-'+data.value[1]);
4993			}			
4994		}).on('change', function(data){		
4995			$("#terreno_da_immobili_filtro").val(data.value.newValue[0]);
4996			$("#terreno_a_immobili_filtro").val(data.value.newValue[1]);	
4997            setInputNumberFormatTerreno(data.value.newValue[0] / 10000, 'terreno_da_input_immobili_filtro');
4998            setInputNumberFormatTerreno(data.value.newValue[1] / 10000, 'terreno_a_input_immobili_filtro');
4999			$('#terreno_immobili').val(data.value.newValue[0]+'-'+data.value.newValue[1]);
5000	 	});	
5001
5002		if(terreno_immobili){
5003			terrenoArr = terreno_immobili.split('-');
5004			$("#terreno_range_immobili_filtro").slider('setValue',[parseInt(terrenoArr[0]), parseInt(terrenoArr[1])]);
5005			$("#terreno_da_immobili_filtro").val(terrenoArr[0]);
5006			$("#terreno_a_immobili_filtro").val(terrenoArr[1]);	 
5007            setInputNumberFormatTerreno(terrenoArr[0] / 10000, 'terreno_da_input_immobili_filtro');
5008            setInputNumberFormatTerreno(terrenoArr[1] / 10000, 'terreno_a_input_immobili_filtro');
5009			$('#terreno_immobili').val(terrenoArr[0]+'-'+terrenoArr[1]);
5010			$("#terreno_range_immobili_filtro").slider("enable");
5011			$("#terreno_da_input_immobili_filtro").removeAttr('disabled');			
5012			$("#terreno_a_input_immobili_filtro").removeAttr('disabled');
5013			$('#span_terreno_da_input_immobili_filtro').css('background-color', '#fff');
5014			$('#span_terreno_a_input_immobili_filtro').css('background-color', '#fff');
5015		}
5016		else{
5017			$("#terreno_range_immobili_filtro").slider('setValue',[parseInt(minTerImmobili), parseInt(maxTerImmobili)]);
5018			$("#terreno_da_immobili_filtro").val(minTerImmobili);
5019			$("#terreno_a_immobili_filtro").val(maxTerImmobili);	
5020            setInputNumberFormatTerreno(minTerImmobili / 10000, 'terreno_da_input_immobili_filtro');
5021            setInputNumberFormatTerreno(maxTerImmobili / 10000, 'terreno_a_input_immobili_filtro');
5022			$('#terreno_immobili').val(minTerImmobili+'-'+maxTerImmobili);
5023			$("#terreno_range_immobili_filtro").slider("disable");
5024			$("#terreno_da_input_immobili_filtro").attr('disabled', true); 
5025			$("#terreno_a_input_immobili_filtro").attr('disabled', true); 
5026			$('#span_terreno_da_input_immobili_filtro').css('background-color', '#e9ecef');
5027			$('#span_terreno_a_input_immobili_filtro').css('background-color', '#e9ecef');
5028		}
5029		
5030		//$("#terreno_da_input_immobili_filtro").change(function() {
5031		$("#terreno_da_input_immobili_filtro").on('change blur', function() {
5032			if(removeDotsTerreno($("#terreno_da_input_immobili_filtro").val()) * 10000 < (minTerImmobili)){
5033				$("#terreno_da_immobili_filtro").val(minTerImmobili);
5034				setInputNumberFormatTerreno(minTerImmobili / 10000, 'terreno_da_input_immobili_filtro');
5035				$("#terreno_range_immobili_filtro").slider('setValue',[parseInt(minTerImmobili), removeDotsTerreno($("#terreno_a_input_immobili_filtro").val()) * 10000]);
5036				$('#terreno_immobili').val(minTerImmobili+'-'+removeDotsTerreno($("#terreno_a_input_immobili_filtro").val()) * 10000);
5037			}
5038			else{
5039				$("#terreno_da_immobili_filtro").val(removeDotsTerreno($("#terreno_da_input_immobili_filtro").val()) * 10000);
5040				$("#terreno_range_immobili_filtro").slider('setValue',[parseInt(removeDotsTerreno($("#terreno_da_input_immobili_filtro").val())) * 10000, removeDotsTerreno($("#terreno_a_input_immobili_filtro").val()) * 10000]);
5041				$('#terreno_immobili').val(removeDotsTerreno($("#terreno_da_input_immobili_filtro").val()) * 10000+'-'+removeDotsTerreno($("#terreno_a_input_immobili_filtro").val()) * 10000);
5042			}
5043			if(removeDotsTerreno($("#terreno_da_input_immobili_filtro").val()) > removeDotsTerreno($("#terreno_a_input_immobili_filtro").val())){
5044				$("#terreno_da_immobili_filtro").val(removeDotsTerreno($("#terreno_a_input_immobili_filtro").val()) * 10000);
5045				$("#terreno_da_input_immobili_filtro").val($("#terreno_a_input_immobili_filtro").val());
5046				$("#terreno_range_immobili_filtro").slider('setValue',[parseInt(removeDotsTerreno($("#terreno_a_input_immobili_filtro").val())) * 10000, removeDotsTerreno($("#terreno_a_input_immobili_filtro").val()) * 10000]);
5047				$('#terreno_immobili').val(removeDotsTerreno($("#terreno_da_input_immobili_filtro").val()) * 10000+'-'+removeDotsTerreno($("#terreno_a_input_immobili_filtro").val()) * 10000);
5048			}
5049			refreshTotImmobili();
5050		});
5051
5052		//$("#terreno_a_input_immobili_filtro").change(function() {
5053		$("#terreno_a_input_immobili_filtro").on('change blur', function() {
5054			if(removeDotsTerreno($("#terreno_a_input_immobili_filtro").val() * 10000) > maxTerImmobili){
5055				$("#terreno_a_immobili_filtro").val(maxTerImmobili);
5056				setInputNumberFormatTerreno(maxTerImmobili / 10000, 'terreno_a_input_immobili_filtro');
5057				$("#terreno_range_immobili_filtro").slider('setValue',[parseInt(removeDotsTerreno($("#terreno_da_input_immobili_filtro").val())) * 10000, parseInt(maxTerImmobili)]);
5058				$('#terreno_immobili').val(removeDotsTerreno($("#terreno_da_input_immobili_filtro").val()) * 10000+'-'+maxTerImmobili);
5059			}
5060			else{
5061				$("#terreno_a_immobili_filtro").val(removeDotsTerreno($("#terreno_a_input_immobili_filtro").val()) * 10000);
5062				$("#terreno_range_immobili_filtro").slider('setValue',[parseInt(removeDotsTerreno($("#terreno_da_input_immobili_filtro").val())) * 10000, removeDotsTerreno($("#terreno_a_input_immobili_filtro").val()) * 10000]);
5063				$('#terreno_immobili').val(removeDotsTerreno($("#terreno_da_input_immobili_filtro").val()) * 10000+'-'+removeDotsTerreno($("#terreno_a_input_immobili_filtro").val()) * 10000);
5064			}
5065			if(removeDotsTerreno($("#terreno_a_input_immobili_filtro").val()) < removeDotsTerreno($("#terreno_da_input_immobili_filtro").val())){
5066				$("#terreno_a_immobili_filtro").val(removeDotsTerreno($("#terreno_da_input_immobili_filtro").val()) * 10000);
5067				$("#terreno_a_input_immobili_filtro").val($("#terreno_da_input_immobili_filtro").val());
5068				$("#terreno_range_immobili_filtro").slider('setValue',[parseInt(removeDotsTerreno($("#terreno_da_input_immobili_filtro").val())) * 10000, removeDotsTerreno($("#terreno_da_input_immobili_filtro").val()) * 10000]);
5069				$('#terreno_immobili').val(removeDotsTerreno($("#terreno_da_input_immobili_filtro").val()) * 10000+'-'+removeDotsTerreno($("#terreno_da_input_immobili_filtro").val()) * 10000);
5070			}
5071			refreshTotImmobili();
5072		});
5073    });	
5074}
5075
5076function listaTipologieAlloggi(type) {	
5077	var html_option = '';
5078	var html_option_all = '';
5079	var html_option_filtro = '';
5080	
5081	var url = _api+'greatestate/tipologie_alloggi/'+(_lang == 'ru' ? 'en' : _lang);
5082	
5083	$.ajax({
5084        url: url,
5085        type: 'POST',	            
5086        crossDomain: true,   
5087        data: {
5088        	aree: $('#aree_alloggi').val()       	        
5089        },          
5090        xhrFields:
5091        {
5092            withCredentials: true
5093        },
5094        error: function (error) {
5095        	console.log(error);
5096        	return;
5097        }
5098    }).done(function(json) {
5099		var jsonTipologieAlloggi = json.rows;
5100		var jsonLenght = jsonTipologieAlloggi.length;
5101		
5102    	var tipologieAlloggiArraySel = $('#tipologie_alloggi').val().split('-');
5103    	//tipologieAlloggiArraySel = tipologieAlloggiArraySel.map(Number);
5104		
5105        for (var i = 0; i < jsonLenght; i++) {
5106    		if(((i % 3) == 0) && ($(window).width() > 992)){
5107    			html_option_filtro += '<div class="row">';
5108    		}
5109    			html_option_filtro += '<div class="col col-lg-4 col-md-6 col-sm-6 col-12 paddingZero">';
5110    				html_option_filtro += '<input class="form-check-input checkStyleAlloggi tipologie_alloggiCheck_filtro" '+(tipologieAlloggiArraySel.includes(jsonTipologieAlloggi[i].type_code) == true ? "checked" : "" )+' value="' + jsonTipologieAlloggi[i].type_code + '" type="checkbox" id="tipologia_alloggioCheck_' + jsonTipologieAlloggi[i].type_code + '_filtro">';
5111    				html_option_filtro += '<label class="form-check-label checkLabelStyleAlloggi_filtro" for="tipologia_alloggioCheck_' + jsonTipologieAlloggi[i].type_code + '_filtro" id="tipologia_alloggioCheckLabel_' + jsonTipologieAlloggi[i].type_code + '_filtro">' + jsonTipologieAlloggi[i].label_diz_types + '</label>';
5112    			html_option_filtro += '</div>';
5113    		if(((((i - 2) % 3) == 0) && ((i - 2) >= 0)) && ($(window).width() > 992)){
5114    			html_option_filtro += '</div>';
5115    		}
5116
5117    		html_option += '<li>';
5118    			html_option += '<input class="form-check-input checkStyleAlloggi tipologie_alloggiCheck" '+(tipologieAlloggiArraySel.includes(jsonTipologieAlloggi[i].type_code) == true ? "checked" : "" )+' value="' + jsonTipologieAlloggi[i].type_code + '" type="checkbox" id="tipologia_alloggioCheck_' + jsonTipologieAlloggi[i].type_code + '">';
5119        		html_option += '<label class="form-check-label checkLabelStyleAlloggi" for="tipologia_alloggioCheck_' + jsonTipologieAlloggi[i].type_code + '" id="tipologia_alloggioCheckLabel_' + jsonTipologieAlloggi[i].type_code + '">' + jsonTipologieAlloggi[i].label_diz_types + '</label>';
5120    		html_option += '</li>';
5121        }
5122
5123		html_option += '<li class="text-center">';
5124				html_option += '<button type="button" id="annullaButtonTipologieAlloggi" class="btn btn-primary applicaButton text-uppercase"><b>Cancel</b></button>';
5125            	            		html_option += '<button type="button" id="applicaButtonTipologieAlloggi" class="btn btn-primary applicaButton buttonSlugAlloggi text-uppercase" onclick="submitCercaAlloggi(\'luxury-rentals-search.html\', true)">';
5126            					html_option += '<b>Apply</b>';
5127			html_option += '</button>';
5128		html_option += '</li>';
5129		
5130        html_option_all += '<li>';
5131            html_option_all += '<input class="form-check-input checkStyleAlloggi" type="checkbox" id="tipologie_alloggiCheckAll">';
5132            html_option_all += '<label class="form-check-label checkLabelStyleAlloggi" for="tipologie_alloggiCheckAll">All</label>';
5133        html_option_all += '</li>';
5134
5135        html_option = html_option_all + html_option;
5136
5137        $("#tipologie_alloggi_multiselect").empty().append(html_option);
5138        $("#tipologie_alloggi_filtro").empty().append(html_option_filtro);
5139        
5140        updateTipologieAreeAlloggi('tipologie_alloggi', type);
5141        
5142        printLabelRicercaAlloggi('tipologie_alloggi', type);
5143
5144		$("#annullaButtonTipologieAlloggi").click(function() {
5145			$("#tipologie_alloggiBtn").dropdown("toggle");
5146			
5147			$('#tipologie_alloggi').val('');
5148			$('#tipologie_alloggiBtn').html('What kind of housing are you looking for?');
5149			/*$('#tipologie_alloggiBtn').css('color', '#fff');
5150			$('#tipologie_alloggiBtn').css('opacity', '0.3');*/
5151			$('#tipologie_alloggiBtn').css('color', '#9b9a9e');
5152			$('#tipologie_alloggiBtn').css('opacity', '1');
5153			
5154			$('.cleantipologie_alloggi').remove();
5155			
5156			$(".tipologie_alloggiCheck").prop("checked", false);
5157			$(".tipologie_alloggiCheck_filtro").prop("checked", false);
5158			$("#tipologie_alloggiCheckAll").prop("checked", false);
5159			$("#tipologie_alloggiCheckAll_filtro").prop("checked", false);
5160			
5161			listaAreeAlloggi(false);
5162		});
5163    	    	
5164		$("#tipologie_alloggiCheckAll, #tipologie_alloggiCheckAll_filtro").click(function() {
5165			if($("#"+this.id).is(":checked") == true){
5166				var tipId = '';
5167				var numTipologieAlloggiCheck = 0;
5168
5169				if((this.id).includes("filtro") == true){
5170					$('input.tipologie_alloggiCheck_filtro[type=checkbox]').each(function () {
5171						tipId += this.value+'-';
5172						numTipologieAlloggiCheck++;
5173				 	});
5174				}
5175				else{
5176					$('input.tipologie_alloggiCheck[type=checkbox]').each(function () {
5177						tipId += this.value+'-';
5178						numTipologieAlloggiCheck++;
5179				 	});
5180				}
5181
5182				$('#tipologie_alloggiBtn').css('color', '#ed6b62');
5183				$('#tipologie_alloggiBtn').css('opacity', '1');
5184				$('#tipologie_alloggiBtn').html(numTipologieAlloggiCheck + ' Selected types');
5185				$('#tipologie_alloggiBtn').parent().prepend('<div class="closeBtnDropdownAbsolute cleantipologie_alloggi"><i class="fa-solid fa-xmark"></i></div>');
5186				
5187				$(".tipologie_alloggiCheck").prop("checked", true);
5188				$(".tipologie_alloggiCheck_filtro").prop("checked", true);
5189				$("#tipologie_alloggiCheckAll").prop("checked", true);
5190				$("#tipologie_alloggiCheckAll_filtro").prop("checked", true);
5191			 	
5192			 	tipId = tipId.substr(0, tipId.length - 1);
5193			 	
5194				$('#tipologie_alloggi').val(tipId);	
5195			}
5196			else{
5197				$('#tipologie_alloggi').val('');
5198				$('#tipologie_alloggiBtn').html('What kind of housing are you looking for?');
5199				/*$('#tipologie_alloggiBtn').css('color', '#fff');
5200				$('#tipologie_alloggiBtn').css('opacity', '0.3');*/
5201				$('#tipologie_alloggiBtn').css('color', '#9b9a9e');
5202				$('#tipologie_alloggiBtn').css('opacity', '1');
5203				
5204				$('.cleantipologie_alloggi').remove();
5205				
5206				$(".tipologie_alloggiCheck").prop("checked", false);
5207				$(".tipologie_alloggiCheck_filtro").prop("checked", false);
5208				$("#tipologie_alloggiCheckAll").prop("checked", false);
5209				$("#tipologie_alloggiCheckAll_filtro").prop("checked", false);
5210			}
5211
5212			updateTipologieAreeAlloggi('tipologie_alloggi', (this.id).includes("filtro"));
5213			
5214			printLabelRicercaAlloggi('tipologie_alloggi', type);
5215			
5216			listaAreeAlloggi((this.id).includes("filtro"));
5217		});
5218
5219		$(".tipologie_alloggiCheck, .tipologie_alloggiCheck_filtro").click(function() {		
5220			if(this.checked){
5221				$("#tipologia_alloggioCheck_"+this.value).prop("checked", true);
5222				$("#tipologia_alloggioCheck_"+this.value+"_filtro").prop("checked", true);
5223			}
5224			else{
5225				$("#tipologia_alloggioCheck_"+this.value).prop("checked", false);
5226				$("#tipologia_alloggioCheck_"+this.value+"_filtro").prop("checked", false);
5227			}
5228			
5229			updateTipologieAreeAlloggi('tipologie_alloggi', (this.id).includes("filtro"));
5230			
5231			printLabelRicercaAlloggi('tipologie_alloggi', type);
5232			
5233			listaAreeAlloggi((this.id).includes("filtro"));
5234		});
5235		
5236    });	
5237}
5238
5239function listaAreeAlloggi(type) {	
5240	var html_option = '';
5241	var html_option_all = '';
5242	var html_option_filtro = '';
5243	
5244	var url = _api+'greatestate/aree_alloggi/'+(_lang == 'ru' ? 'en' : _lang);
5245	
5246	$.ajax({
5247        url: url,
5248        type: 'POST',	            
5249        crossDomain: true,      
5250        data: {
5251        	tipologie: $('#tipologie_alloggi').val()       	        
5252        },    
5253        xhrFields:
5254        {
5255            withCredentials: true
5256        },
5257        error: function (error) {
5258        	console.log(error);
5259        	return;
5260        }
5261    }).done(function(json) {
5262		var jsonAreeAlloggi = json.rows;
5263		var jsonLenght = jsonAreeAlloggi.length;
5264		var colIdx = 0;
5265
5266		//var areeAlloggiArraySel = $('#aree_alloggi').val().split('-');
5267		var areeAlloggiArraySel = $('#aree_alloggi').val().split(',');
5268		//areeAlloggiArraySel = areeAlloggiArraySel.map(Number);
5269        
5270        for (var i = 0; i < jsonLenght; i++) { 
5271    		if(((colIdx % 3) == 0) && ($(window).width() > 992)){
5272    			html_option_filtro += '<div class="row">';
5273    		}
5274    			html_option_filtro += '<div class="col col-lg-4 col-md-6 col-sm-6 col-12 paddingZero">';
5275    				html_option_filtro += '<input class="form-check-input checkStyleAlloggi aree_alloggiCheck_filtro" '+(areeAlloggiArraySel.includes(jsonAreeAlloggi[i].code) == true ? "checked" : "" )+' value="' + jsonAreeAlloggi[i].code + '" type="checkbox" id="area_alloggioCheck_' + jsonAreeAlloggi[i].code + '_filtro">';
5276    				html_option_filtro += '<label class="form-check-label checkLabelStyleAlloggi_filtro" for="area_alloggioCheck_' + jsonAreeAlloggi[i].code + '_filtro" id="area_alloggioCheckLabel_' + jsonAreeAlloggi[i].code + '_filtro">' + jsonAreeAlloggi[i].label + '</label>';
5277    			html_option_filtro += '</div>';
5278
5279        		if(((((colIdx - 2) % 3) == 0) && ((colIdx - 2) > 0)) && ($(window).width() > 992)){
5280        			html_option_filtro += '</div>';
5281        		}
5282        		
5283    			if(jsonAreeAlloggi[i].child){
5284    				for (var j = 0; j < jsonAreeAlloggi[i].child.length; j++) {
5285
5286    					colIdx++;
5287    					
5288    		    		if(((colIdx % 3) == 0) && ($(window).width() > 992)){
5289    		    			html_option_filtro += '<div class="row">';
5290    		    		}
5291    	    			html_option_filtro += '<div class="col col-lg-4 col-md-6 col-sm-6 col-12 paddingZero">';
5292    	    				html_option_filtro += '<input class="form-check-input checkStyleAlloggi aree_alloggiCheckSub_filtro aree_alloggiCheckSub_' + jsonAreeAlloggi[i].code + '_filtro" '+(((areeAlloggiArraySel.includes(jsonAreeAlloggi[i].child[j].code) == true) || (areeAlloggiArraySel.includes(jsonAreeAlloggi[i].code) == true)) ? "checked" : "" )+' value="' + jsonAreeAlloggi[i].child[j].code + '" type="checkbox" id="area_alloggioCheckSub_' + jsonAreeAlloggi[i].child[j].code + '_filtro">';
5293            				html_option_filtro += '<label class="form-check-label checkLabelStyleAlloggi_filtro" for="area_alloggioCheckSub_' + jsonAreeAlloggi[i].child[j].code + '_filtro" id="area_alloggioCheckSubLabel_' + jsonAreeAlloggi[i].child[j].code + '_filtro">' + jsonAreeAlloggi[i].child[j].label + '</label>';
5294            			html_option_filtro += '</div>';
5295                		if(((((colIdx - 2) % 3) == 0) && ((colIdx - 2) >= 0)) && ($(window).width() > 992)){
5296                			html_option_filtro += '</div>';
5297                		}
5298    				}
5299    			}
5300
5301    		html_option += '<li>';
5302				html_option += '<input class="form-check-input checkStyleAlloggi aree_alloggiCheck" '+(areeAlloggiArraySel.includes(jsonAreeAlloggi[i].code) == true ? "checked" : "" )+' value="' + jsonAreeAlloggi[i].code + '" type="checkbox" id="area_alloggioCheck_' + jsonAreeAlloggi[i].code + '">';
5303    			html_option += '<label class="form-check-label checkLabelStyleAlloggi" for="area_alloggioCheck_' + jsonAreeAlloggi[i].code + '" id="area_alloggioCheckLabel_' + jsonAreeAlloggi[i].code + '">' + jsonAreeAlloggi[i].label + '</label>';
5304    		html_option += '</li>';
5305    
5306    		if(jsonAreeAlloggi[i].child){
5307    			for (var j = 0; j < jsonAreeAlloggi[i].child.length; j++) {
5308            		html_option += '<li class="child">';
5309	    				html_option += '<input class="form-check-input checkStyleAlloggi aree_alloggiCheckSub aree_alloggiCheckSub_' + jsonAreeAlloggi[i].code + '" '+(((areeAlloggiArraySel.includes(jsonAreeAlloggi[i].child[j].code) == true) || (areeAlloggiArraySel.includes(jsonAreeAlloggi[i].code) == true)) ? "checked" : "" )+' value="' + jsonAreeAlloggi[i].child[j].code + '" type="checkbox" id="area_alloggioCheckSub_' + jsonAreeAlloggi[i].child[j].code + '">';
5310            			html_option += '<label class="form-check-label checkLabelStyleAlloggi" for="area_alloggioCheckSub_' + jsonAreeAlloggi[i].child[j].code + '" id="area_alloggioCheckSubLabel_' + jsonAreeAlloggi[i].child[j].code + '">' + jsonAreeAlloggi[i].child[j].label + '</label>';
5311            		html_option += '</li>';
5312    			}	
5313    		}
5314    
5315    		colIdx++;
5316        }
5317
5318		html_option += '<li class="text-center">';
5319				html_option += '<button type="button" id="annullaButtonAreeAlloggi" class="btn btn-primary applicaButton text-uppercase"><b>Cancel</b></button>';
5320            	            		html_option += '<button type="button" id="applicaButtonAreeAlloggi" class="btn btn-primary applicaButton buttonSlugAlloggi text-uppercase" onclick="submitCercaAlloggi(\'luxury-rentals-search.html\', true)">';
5321            					html_option += '<b>Apply</b>';
5322			html_option += '</button>';
5323		html_option += '</li>';
5324		
5325        html_option_all += '<li>';
5326            html_option_all += '<input class="form-check-input checkStyleAlloggi" type="checkbox" id="aree_alloggiCheckAll">';
5327            html_option_all += '<label class="form-check-label checkLabelStyleAlloggi" for="aree_alloggiCheckAll">All</label>';
5328        html_option_all += '</li>';
5329    
5330        html_option = html_option_all + html_option;
5331		
5332        $("#aree_alloggi_multiselect").empty().append(html_option);
5333		$("#aree_alloggi_filtro").empty().append(html_option_filtro);
5334		
5335		updateTipologieAreeAlloggi('aree_alloggi', type);
5336		
5337		printLabelRicercaAlloggi('aree_alloggi', type);
5338
5339		$("#annullaButtonAreeAlloggi").click(function() {
5340			$("#aree_alloggiBtn").dropdown("toggle");
5341			
5342			$('#aree_alloggi').val('');
5343			$('#aree_alloggiBtn').html('Where would you like to go?');
5344			/*$('#aree_alloggiBtn').css('color', '#fff');
5345			$('#aree_alloggiBtn').css('opacity', '0.3');*/
5346			$('#aree_alloggiBtn').css('color', '#9b9a9e');
5347			$('#aree_alloggiBtn').css('opacity', '1');
5348			
5349			$('.cleanlocation_alloggi').remove();
5350			
5351			$(".aree_alloggiCheck").prop("checked", false);
5352			$(".aree_alloggiCheckSub").prop("checked", false);
5353			$(".aree_alloggiCheck_filtro").prop("checked", false);
5354			$(".aree_alloggiCheckSub_filtro").prop("checked", false);
5355			$("#aree_alloggiCheckAll").prop("checked", false);
5356			$("#aree_alloggiCheckAll_filtro").prop("checked", false);
5357			
5358			listaTipologieAlloggi(false);
5359		});
5360    	    	
5361		$("#aree_alloggiCheckAll, #aree_alloggiCheckAll_filtro").click(function() {
5362			if($("#"+this.id).is(":checked") == true){
5363				var areeAlloggiId = '';
5364				var numAreeAlloggiCheck = 0;
5365
5366				if((this.id).includes("filtro") == true){
5367					$('input.aree_alloggiCheck_filtro[type=checkbox]').each(function () {
5368						//areeAlloggiId += this.value+'-';
5369						areeAlloggiId += this.value+',';
5370						numAreeAlloggiCheck++;
5371				 	});
5372					$('input.aree_alloggiCheckSub_filtro[type=checkbox]').each(function () {
5373						//areeAlloggiId += this.value+'-';
5374						areeAlloggiId += this.value+',';
5375						numAreeAlloggiCheck++;
5376				 	});
5377				}
5378				else{
5379					$('input.aree_alloggiCheck[type=checkbox]').each(function () {
5380						//areeAlloggiId += this.value+'-';
5381						areeAlloggiId += this.value+',';
5382						numAreeAlloggiCheck++;
5383				 	});
5384					$('input.aree_alloggiCheckSub[type=checkbox]').each(function () {
5385						//areeAlloggiId += this.value+'-';
5386						areeAlloggiId += this.value+',';
5387						numAreeAlloggiCheck++;
5388				 	});
5389				}
5390			 	
5391				$('#aree_alloggiBtn').css('color', '#ed6b62');
5392				$('#aree_alloggiBtn').css('opacity', '1');
5393				$('#aree_alloggiBtn').html(numAreeAlloggiCheck + ' Selected areas');
5394				$('#aree_alloggiBtn').parent().prepend('<div class="closeBtnDropdownAbsolute cleanlocation_alloggi"><i class="fa-solid fa-xmark"></i></div>');
5395				
5396				$(".aree_alloggiCheck").prop("checked", true);
5397				$(".aree_alloggiCheckSub").prop("checked", true);
5398				$(".aree_alloggiCheck_filtro").prop("checked", true);
5399				$(".aree_alloggiCheckSub_filtro").prop("checked", true);
5400				$("#aree_alloggiCheckAll").prop("checked", true);
5401				$("#aree_alloggiCheckAll_filtro").prop("checked", true);
5402			 	
5403				areeAlloggiId = areeAlloggiId.substr(0, areeAlloggiId.length - 1);
5404			 	
5405				$('#aree_alloggi').val(areeAlloggiId);	
5406			}
5407			else {
5408				$('#aree_alloggi').val('');
5409				$('#aree_alloggiBtn').html('Where would you like to go?');
5410				/*$('#aree_alloggiBtn').css('color', '#fff');
5411				$('#aree_alloggiBtn').css('opacity', '0.3');*/
5412				$('#aree_alloggiBtn').css('color', '#9b9a9e');
5413				$('#aree_alloggiBtn').css('opacity', '1');
5414				
5415				$('.cleanlocation_alloggi').remove();
5416				
5417				$(".aree_alloggiCheck").prop("checked", false);
5418				$(".aree_alloggiCheckSub").prop("checked", false);
5419				$(".aree_alloggiCheck_filtro").prop("checked", false);
5420				$(".aree_alloggiCheckSub_filtro").prop("checked", false);
5421				$("#aree_alloggiCheckAll").prop("checked", false);
5422				$("#aree_alloggiCheckAll_filtro").prop("checked", false);
5423			}
5424
5425			updateTipologieAreeAlloggi('aree_alloggi', (this.id).includes("filtro"));
5426			
5427			printLabelRicercaAlloggi('aree_alloggi', type);
5428			
5429			listaTipologieAlloggi((this.id).includes("filtro"));
5430		});
5431
5432		$(".aree_alloggiCheck, .aree_alloggiCheck_filtro").click(function() {
5433			if($("#"+this.id).is(":checked")){
5434				$(".aree_alloggiCheckSub_"+this.value).prop("checked", true);
5435				$(".aree_alloggiCheckSub_"+this.value+"_filtro").prop("checked", true);
5436				$("#area_alloggioCheck_"+this.value).prop("checked", true);
5437				$("#area_alloggioCheck_"+this.value+"_filtro").prop("checked", true);
5438			}
5439			else{
5440				$(".aree_alloggiCheckSub_"+this.value).prop("checked", false);
5441				$(".aree_alloggiCheckSub_"+this.value+"_filtro").prop("checked", false);
5442				$("#area_alloggioCheck_"+this.value).prop("checked", false);
5443				$("#area_alloggioCheck_"+this.value+"_filtro").prop("checked", false);
5444			}
5445
5446			updateTipologieAreeAlloggi('aree_alloggi', (this.id).includes("filtro"));
5447			
5448			printLabelRicercaAlloggi('aree_alloggi', type);
5449			
5450			listaTipologieAlloggi((this.id).includes("filtro"));
5451		});
5452
5453		$(".aree_alloggiCheckSub, .aree_alloggiCheckSub_filtro").click(function() {
5454			var allChecked = true;
5455			
5456			if($("#"+this.id).is(":checked")){
5457				$("#area_alloggioCheckSub_"+this.value).prop("checked", true);
5458				$("#area_alloggioCheckSub_"+this.value+"_filtro").prop("checked", true);
5459			}
5460			else{
5461				$("#area_alloggioCheckSub_"+this.value).prop("checked", false);
5462				$("#area_alloggioCheckSub_"+this.value+"_filtro").prop("checked", false);
5463			}
5464			
5465			checkClasses = $("#"+this.id).attr('class');
5466			subClassName = checkClasses.substr(checkClasses.lastIndexOf(' ') + 1);
5467			classNameParent = parseInt(subClassName.match(/[\d\.]+/g));
5468				
5469			$('input.'+subClassName+'[type=checkbox]').each(function () {
5470				if(!this.checked){
5471					allChecked =  false
5472				}
5473			});
5474			
5475			if(allChecked == true){
5476				$("#area_alloggioCheck_"+classNameParent).prop("checked", true);
5477				$("#area_alloggioCheck_"+classNameParent+"_filtro").prop("checked", true);
5478			}
5479			else{
5480				$("#area_alloggioCheck_"+classNameParent).prop("checked", false);
5481				$("#area_alloggioCheck_"+classNameParent+"_filtro").prop("checked", false);
5482			}
5483			
5484			updateTipologieAreeAlloggi('aree_alloggi', (this.id).includes("filtro"));
5485			
5486			printLabelRicercaAlloggi('aree_alloggi', type);
5487			
5488			listaTipologieAlloggi((this.id).includes("filtro"));
5489		});
5490    });	
5491}  
5492
5493function listaPrezziAlloggi() {
5494	var html_option = '';
5495	var html_option_filtro = '';
5496	var url = _api+'greatestate/prezzi_alloggi/'+(_lang == 'ru' ? 'en' : _lang);
5497	
5498	$.ajax({
5499        url: url,
5500        type: 'POST',	            
5501        crossDomain: true,           
5502        xhrFields:
5503        {
5504            withCredentials: true
5505        },
5506        error: function (error) {
5507        	console.log(error);
5508        	return;
5509        }
5510    }).done(function(json) {
5511		var jsonLenght = json.rows.length;
5512
5513		var prezzoPreSlider;
5514		var prezzoPostSlider;	 				
5515		var prezzoPreSliderFiltro;
5516		var prezzoPostSliderFiltro;	
5517		
5518		minPreAlloggi = parseInt(json.rows[0].min);
5519		maxPreAlloggi = parseInt(json.rows[0].max);
5520
5521		html_option += '<input id="prezzo_range_alloggi" type="text"/>';
5522		html_option += '<input id="prezzo_da_alloggi" type="hidden" />';
5523		html_option += '<input id="prezzo_a_alloggi" type="hidden" />';
5524		html_option += '<input id="prezzo_min_alloggi" type="hidden" value="'+minPreAlloggi+'"/>';
5525		html_option += '<input id="prezzo_max_alloggi" type="hidden" value="'+maxPreAlloggi+'"/>';
5526		
5527		html_option += '<div id="prezziAlloggiInputDiv">';
5528			html_option += '<div class="input-group">';
5529        		html_option += '<label for="prezzo_da_input_alloggi">Minimum budget</label>';
5530        		html_option += '<span class="input-group-text">€</span><input class="form-control" id="prezzo_da_input_alloggi" lang="en" type="text" onkeyup="setInputNumberFormat(this.value, this.id);"/>';
5531    		html_option += '</div>';
5532    		html_option += '<div class="input-group">';
5533        		html_option += '<label for="prezzo_a_input_alloggi">Maximum budget</label>';
5534        		html_option += '<span class="input-group-text">€</span><input class="form-control" id="prezzo_a_input_alloggi" lang="en" type="text" onkeyup="setInputNumberFormat(this.value, this.id);"/>';
5535    		html_option += '</div>';
5536    		html_option += '<div class="prezziButton">';
5537    			html_option += '<button type="button" id="annullaButtonPrezziAlloggi" class="btn btn-primary text-uppercase"><b>Cancel</b></button>';
5538    			html_option += '<button type="button" id="applicaButtonPrezziAlloggi" class="btn btn-primary text-uppercase"><b>Apply</b></button>'
5539    		html_option += '</div>';
5540		html_option += '</div>';
5541
5542		
5543		$("#prezzoAlloggiSlider").empty().append(html_option);
5544		$('#prezzoAlloggiSlider').click(function(e) {
5545		    e.stopPropagation();
5546		});
5547
5548		let arrTicks = [200, 300, 500];
5549		if(maxPreAlloggi > 1000){
5550			arrTicks.push(1000);
5551		}
5552		if(maxPreAlloggi > 2000){
5553			arrTicks.push(2000);
5554		}
5555		if(maxPreAlloggi > 3000){
5556			arrTicks.push(3000);
5557		}
5558		
5559		$("#prezzo_range_alloggi").slider({ 	
5560			step: 1,
5561			min: minPreAlloggi, 
5562			max: maxPreAlloggi, 
5563			value: [0, maxPreAlloggi], 
5564			focus: true,
5565			tooltip: 'always',
5566			tooltip_split: true,
5567			tooltip_position:'bottom',
5568		    ticks: arrTicks,		
5569		    ticks_snap_bounds: 100
5570		}).on('slideStart', function(data){
5571			prezzoPreSlider = $('#prezzo_range_alloggi').data('slider').getValue();
5572		}).on('slideStop', function(data){
5573			prezzoPostSlider = $('#prezzo_range_alloggi').data('slider').getValue();
5574			if((prezzoPreSlider[0] != prezzoPostSlider[0]) || (prezzoPreSlider[1] != prezzoPostSlider[1])){
5575				$("#prezzo_da_alloggi").val(data.value[0]);
5576				$("#prezzo_a_alloggi").val(data.value[1]);	
5577				setInputNumberFormat(data.value[0], 'prezzo_da_input_alloggi');
5578				setInputNumberFormat(data.value[1], 'prezzo_a_input_alloggi');
5579			}			
5580		}).on('change', function(data){		
5581			$("#prezzo_da_alloggi").val(data.value.newValue[0]);
5582			$("#prezzo_a_alloggi").val(data.value.newValue[1]);	
5583			setInputNumberFormat(data.value.newValue[0], 'prezzo_da_input_alloggi');
5584			setInputNumberFormat(data.value.newValue[1], 'prezzo_a_input_alloggi');
5585	 	});	
5586		if(prezzo_alloggi){
5587			prezzoArr = prezzo_alloggi.split('-');
5588			$("#prezzo_range_alloggi").slider('setValue',[parseInt(prezzoArr[0]), parseInt(prezzoArr[1])]);
5589			$("#prezzo_da_alloggi").val(prezzoArr[0]);
5590			$("#prezzo_a_alloggi").val(prezzoArr[1]);	 
5591			setInputNumberFormat(prezzoArr[0], 'prezzo_da_input_alloggi');
5592			setInputNumberFormat(prezzoArr[1], 'prezzo_a_input_alloggi');
5593			setLabelPrezzoAlloggi(prezzoArr[0]+'-'+prezzoArr[1], '€ ' + numeral(prezzoArr[0]).format('0,0')+' - € '+numeral(prezzoArr[1]).format('0,0'));
5594		}
5595		else{
5596			$("#prezzo_range_alloggi").slider('setValue',[parseInt(minPreAlloggi), parseInt(maxPreAlloggi)]);
5597			$("#prezzo_da_alloggi").val(minPreAlloggi);
5598			$("#prezzo_a_alloggi").val(maxPreAlloggi);	 
5599			setInputNumberFormat(minPreAlloggi, 'prezzo_da_input_alloggi');
5600			setInputNumberFormat(maxPreAlloggi, 'prezzo_a_input_alloggi');
5601			setLabelPrezzoAlloggi(minPreAlloggi+'-'+maxPreAlloggi, '€ ' + numeral(minPreAlloggi).format('0,0')+' - € '+numeral(maxPreAlloggi).format('0,0'));
5602		}
5603		
5604		$("#annullaButtonPrezziAlloggi").click(function() {
5605			$("#prezzo_alloggiBtn").dropdown("toggle");
5606			
5607        	setLabelPrezzoAlloggi($("#prezzo_min_alloggi").val()+'-'+$("#prezzo_max_alloggi").val(), '€ ' + numeral($("#prezzo_min_alloggi").val()).format('0,0')+' - € '+numeral($("#prezzo_max_alloggi").val()).format('0,0'));
5608        	$("#prezzo_range_alloggi_filtro").slider('setValue',[parseInt($("#prezzo_min_alloggi").val()), parseInt($("#prezzo_max_alloggi").val())]);
5609        	$("#prezzo_da_alloggi_filtro").val($("#prezzo_min_alloggi").val());
5610        	$("#prezzo_a_alloggi_filtro").val($("#prezzo_max_alloggi").val());	
5611			$("#prezzo_da_input_alloggi_filtro").val($("#prezzo_min_alloggi").val());
5612			$("#prezzo_a_input_alloggi_filtro").val($("#prezzo_max_alloggi").val()); 
5613			$("#prezzo_range_alloggi").slider('setValue',[parseInt(minPreAlloggi), parseInt(maxPreAlloggi)]);
5614			setInputNumberFormat($("#prezzo_min_alloggi").val(), 'prezzo_da_input_alloggi');
5615			setInputNumberFormat($("#prezzo_max_alloggi").val(), 'prezzo_a_input_alloggi');
5616        	setInputNumberFormat($("#prezzo_min_alloggi").val(), 'prezzo_da_input_alloggi_filtro');
5617        	setInputNumberFormat($("#prezzo_max_alloggi").val(), 'prezzo_a_input_alloggi_filtro');
5618		});
5619		$("#applicaButtonPrezziAlloggi").click(function() {
5620			$("#prezzo_alloggiBtn").dropdown("toggle");
5621			setLabelPrezzoAlloggi(removeDots($("#prezzo_da_input_alloggi").val())+'-'+removeDots($("#prezzo_a_input_alloggi").val()), '€ ' + numeral($("#prezzo_da_input_alloggi").val()).format('0,0')+' - € '+numeral($("#prezzo_a_input_alloggi").val()).format('0,0'));
5622                        	newSlug = refreshSlugAlloggi();
5623            	submitCercaAlloggi(newSlug, true);
5624            			$("#prezzo_range_alloggi_filtro").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_alloggi").val())), parseInt(removeDots($("#prezzo_a_input_alloggi").val()))]);
5625			$("#prezzo_da_alloggi_filtro").val(removeDots($("#prezzo_da_input_alloggi").val()));
5626			$("#prezzo_a_alloggi_filtro").val(removeDots($("#prezzo_a_input_alloggi").val()));	 
5627			$("#prezzo_da_input_alloggi_filtro").val($("#prezzo_da_input_alloggi").val());
5628			$("#prezzo_a_input_alloggi_filtro").val($("#prezzo_a_input_alloggi").val());
5629		});
5630
5631		//$("#prezzo_da_input_alloggi").change(function() {
5632		$("#prezzo_da_input_alloggi").on('change blur', function() {
5633			if(parseInt(removeDots($("#prezzo_da_input_alloggi").val())) < minPreAlloggi){
5634				$("#prezzo_da_alloggi").val(minPreAlloggi);
5635				setInputNumberFormat(minPreAlloggi, 'prezzo_da_input_alloggi');
5636				$("#prezzo_range_alloggi").slider('setValue',[parseInt(minPreAlloggi), parseInt(removeDots($("#prezzo_a_input_alloggi").val()))]);
5637			}
5638			else{
5639				$("#prezzo_da_alloggi").val(removeDots($("#prezzo_da_input_alloggi").val()));
5640				$("#prezzo_range_alloggi").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_alloggi").val())), parseInt(removeDots($("#prezzo_a_input_alloggi").val()))]);
5641			}
5642			if(parseInt(removeDots($("#prezzo_da_input_alloggi").val())) > parseInt(removeDots($("#prezzo_a_input_alloggi").val()))){
5643				$("#prezzo_da_alloggi").val(parseInt(removeDots($("#prezzo_a_input_alloggi").val())));
5644				$("#prezzo_da_input_alloggi").val($("#prezzo_a_input_alloggi").val());
5645				$("#prezzo_range_alloggi").slider('setValue',[parseInt(removeDots($("#prezzo_a_input_alloggi").val())), parseInt(removeDots($("#prezzo_a_input_alloggi").val()))]);
5646			}
5647		});
5648		
5649		//$("#prezzo_a_input_alloggi").change(function() {
5650		$("#prezzo_a_input_alloggi").on('change blur', function() {
5651			if(parseInt(removeDots($("#prezzo_a_input_alloggi").val())) > maxPreAlloggi){
5652				$("#prezzo_a_alloggi").val(maxPreAlloggi);
5653				setInputNumberFormat(maxPreAlloggi, 'prezzo_a_input_alloggi');
5654				$("#prezzo_range_alloggi").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_alloggi").val())), parseInt(maxPreAlloggi)]);
5655			}
5656			else{
5657				$("#prezzo_a_alloggi").val(removeDots($("#prezzo_a_input_alloggi").val()));
5658				$("#prezzo_range_alloggi").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_alloggi").val())), parseInt(removeDots($("#prezzo_a_input_alloggi").val()))]);
5659			}
5660			if(parseInt(removeDots($("#prezzo_a_input_alloggi").val())) < parseInt(removeDots($("#prezzo_da_input_alloggi").val()))){
5661				$("#prezzo_a_alloggi").val(parseInt(removeDots($("#prezzo_da_input_alloggi").val())));
5662				$("#prezzo_a_input_alloggi").val($("#prezzo_da_input_alloggi").val());
5663				$("#prezzo_range_alloggi").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_alloggi").val())), parseInt(removeDots($("#prezzo_da_input_alloggi").val()))]);
5664			}
5665		});
5666		
5667		
5668		html_option_filtro += '<input id="prezzo_range_alloggi_filtro" type="text"/>';
5669		html_option_filtro += '<input id="prezzo_da_alloggi_filtro" type="hidden" />';
5670		html_option_filtro += '<input id="prezzo_a_alloggi_filtro" type="hidden" />';
5671
5672		html_option_filtro += '<div id="prezziAlloggiInputDivFiltro">';
5673			html_option_filtro += '<div class="input-group">';
5674				html_option_filtro += '<label for="prezzo_da_input_alloggi_filtro">Minimum budget</label>';
5675				html_option_filtro += '<span class="input-group-text">€</span><input class="form-control" id="prezzo_da_input_alloggi_filtro" lang="en" type="text" onkeyup="setInputNumberFormat(this.value, this.id);"/>';
5676			html_option_filtro += '</div>';
5677			html_option_filtro += '<div class="input-group">';
5678				html_option_filtro += '<label for="prezzo_a_input_alloggi_filtro">Maximum budget</label>';
5679				html_option_filtro += '<span class="input-group-text">€</span><input class="form-control" id="prezzo_a_input_alloggi_filtro" lang="en" type="text" onkeyup="setInputNumberFormat(this.value, this.id);"/>';
5680			html_option_filtro += '</div>';
5681		html_option_filtro += '</div>';
5682    
5683		$("#prezzoAlloggiSlider_filtro").empty().append(html_option_filtro);
5684		$('#prezzoAlloggiSlider_filtro').click(function(e) {
5685		    e.stopPropagation();
5686		});
5687
5688		let arrTicks_filtro = [200, 300, 400, 500];
5689		if(maxPreAlloggi > 750){
5690			arrTicks_filtro.push(750);
5691		}
5692		if(maxPreAlloggi > 1000){
5693			arrTicks_filtro.push(1000);
5694		}
5695		if(maxPreAlloggi > 1500){
5696			arrTicks_filtro.push(1500);
5697		}
5698		if(maxPreAlloggi > 2000){
5699			arrTicks_filtro.push(2000);
5700		}
5701		if(maxPreAlloggi > 3000){
5702			arrTicks_filtro.push(3000);
5703		}
5704		
5705		$("#prezzo_range_alloggi_filtro").slider({ 	
5706			step: 1,
5707			min: minPreAlloggi, 
5708			max: maxPreAlloggi, 
5709			value: [0, maxPreAlloggi], 
5710			focus: true,
5711			tooltip: 'always',
5712			tooltip_split: true,
5713			tooltip_position:'bottom',
5714		    ticks: arrTicks_filtro,		
5715		    ticks_snap_bounds: 100
5716		}).on('slideStart', function(data){
5717			prezzoPreSliderFiltro = $('#prezzo_range_alloggi_filtro').data('slider').getValue();
5718		}).on('slideStop', function(data){
5719			prezzoPostSliderFiltro = $('#prezzo_range_alloggi_filtro').data('slider').getValue();
5720			if((prezzoPreSliderFiltro[0] != prezzoPostSliderFiltro[0]) || (prezzoPreSliderFiltro[1] != prezzoPostSliderFiltro[1])){
5721				$("#prezzo_da_alloggi_filtro").val(data.value[0]);
5722				$("#prezzo_a_alloggi_filtro").val(data.value[1]);	
5723                setInputNumberFormat(data.value[0], 'prezzo_da_input_alloggi_filtro');
5724                setInputNumberFormat(data.value[1], 'prezzo_a_input_alloggi_filtro');	
5725				$("#prezzo_da_alloggi").val(data.value[0]);
5726				$("#prezzo_a_alloggi").val(data.value[1]);	
5727				setInputNumberFormat(data.value[0], 'prezzo_da_input_alloggi');
5728				setInputNumberFormat(data.value[1], 'prezzo_a_input_alloggi');
5729				refreshTotAlloggi();
5730				setLabelPrezzoAlloggi(data.value[0]+'-'+data.value[1], '€ ' + numeral(data.value[0]).format('0,0')+' - € '+numeral(data.value[1]).format('0,0'));
5731			}			
5732		}).on('change', function(data){		
5733			$("#prezzo_da_alloggi_filtro").val(data.value.newValue[0]);
5734			$("#prezzo_a_alloggi_filtro").val(data.value.newValue[1]);	
5735            setInputNumberFormat(data.value.newValue[0], 'prezzo_da_input_alloggi_filtro');
5736            setInputNumberFormat(data.value.newValue[1], 'prezzo_a_input_alloggi_filtro');	
5737			$("#prezzo_da_alloggi").val(data.value.newValue[0]);
5738			$("#prezzo_a_alloggi").val(data.value.newValue[1]);	
5739			setInputNumberFormat(data.value.newValue[0], 'prezzo_da_input_alloggi');
5740			setInputNumberFormat(data.value.newValue[1], 'prezzo_a_input_alloggi');
5741			setLabelPrezzoAlloggi(data.value.newValue[0]+'-'+data.value.newValue[1], '€ ' + numeral(data.value.newValue[0]).format('0,0')+' - € '+numeral(data.value.newValue[1]).format('0,0'));
5742	 	});	
5743
5744		if(prezzo_alloggi){
5745    		$("#prezzo_range_alloggi_filtro").slider('setValue',[parseInt(prezzoArr[0]), parseInt(prezzoArr[1])]);
5746    		$("#prezzo_da_alloggi_filtro").val(prezzoArr[0]);
5747    		$("#prezzo_a_alloggi_filtro").val(prezzoArr[1]);	 
5748            setInputNumberFormat(prezzoArr[0], 'prezzo_da_input_alloggi_filtro');
5749            setInputNumberFormat(prezzoArr[1], 'prezzo_a_input_alloggi_filtro');	
5750            
5751		}
5752		else{
5753    		$("#prezzo_range_alloggi_filtro").slider('setValue',[parseInt(minPreAlloggi), parseInt(maxPreAlloggi)]);
5754    		$("#prezzo_da_alloggi_filtro").val(minPreAlloggi);
5755    		$("#prezzo_a_alloggi_filtro").val(maxPreAlloggi);	 
5756            setInputNumberFormat(minPreAlloggi, 'prezzo_da_input_alloggi_filtro');
5757            setInputNumberFormat(maxPreAlloggi, 'prezzo_a_input_alloggi_filtro');	
5758		}
5759
5760		//$("#prezzo_da_input_alloggi_filtro").change(function() {
5761		$("#prezzo_da_input_alloggi_filtro").on('change blur', function() {
5762			if(parseInt(removeDots($("#prezzo_da_input_alloggi_filtro").val())) < minPreAlloggi){
5763				$("#prezzo_da_alloggi_filtro").val(minPreAlloggi);
5764				setInputNumberFormat(minPreAlloggi, 'prezzo_da_input_alloggi_filtro');
5765				$("#prezzo_range_alloggi_filtro").slider('setValue',[parseInt(minPreAlloggi), parseInt(removeDots($("#prezzo_a_input_alloggi_filtro").val()))]);
5766				$("#prezzo_da_alloggi").val(minPreAlloggi);
5767				setInputNumberFormat(minPreAlloggi, 'prezzo_da_input_alloggi');
5768				$("#prezzo_range_alloggi").slider('setValue',[parseInt(minPreAlloggi), parseInt(removeDots($("#prezzo_a_input_alloggi_filtro").val()))]);
5769				setLabelPrezzoAlloggi(minPreAlloggi+'-'+removeDots($("#prezzo_a_input_alloggi_filtro").val()), '€ ' + numeral(minPreAlloggi).format('0,0')+' - € '+numeral($("#prezzo_a_input_alloggi_filtro").val()).format('0,0'));
5770			}
5771			else{
5772				$("#prezzo_da_alloggi_filtro").val(removeDots($("#prezzo_da_input_alloggi_filtro").val()));
5773				$("#prezzo_range_alloggi_filtro").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_alloggi_filtro").val())), parseInt(removeDots($("#prezzo_a_input_alloggi_filtro").val()))]);
5774				$("#prezzo_da_alloggi").val(removeDots($("#prezzo_da_input_alloggi_filtro").val()));
5775				$("#prezzo_range_alloggi").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_alloggi_filtro").val())), parseInt(removeDots($("#prezzo_a_input_alloggi_filtro").val()))]);
5776				setLabelPrezzoAlloggi(removeDots($("#prezzo_da_input_alloggi_filtro").val())+'-'+removeDots($("#prezzo_a_input_alloggi_filtro").val()), '€ ' + numeral($("#prezzo_da_input_alloggi_filtro").val()).format('0,0')+' - € '+numeral($("#prezzo_a_input_alloggi_filtro").val()).format('0,0'));
5777			}
5778			if(parseInt(removeDots($("#prezzo_da_input_alloggi_filtro").val())) > parseInt(removeDots($("#prezzo_a_input_alloggi_filtro").val()))){
5779				$("#prezzo_da_alloggi_filtro").val(parseInt(removeDots($("#prezzo_a_input_alloggi_filtro").val())));
5780				$("#prezzo_da_input_alloggi_filtro").val($("#prezzo_a_input_alloggi_filtro").val());
5781				$("#prezzo_range_alloggi_filtro").slider('setValue',[parseInt(removeDots($("#prezzo_a_input_alloggi_filtro").val())), parseInt(removeDots($("#prezzo_a_input_alloggi_filtro").val()))]);
5782				$("#prezzo_da_alloggi").val(parseInt(removeDots($("#prezzo_a_input_alloggi_filtro").val())));
5783				$("#prezzo_da_input_alloggi").val($("#prezzo_a_input_alloggi_filtro").val());
5784				$("#prezzo_range_alloggi").slider('setValue',[parseInt(removeDots($("#prezzo_a_input_alloggi_filtro").val())), parseInt(removeDots($("#prezzo_a_input_alloggi_filtro").val()))]);
5785				setLabelPrezzoAlloggi(removeDots($("#prezzo_da_input_alloggi_filtro").val())+'-'+removeDots($("#prezzo_a_input_alloggi_filtro").val()), '€ ' + numeral($("#prezzo_da_input_alloggi_filtro").val()).format('0,0')+' - € '+numeral($("#prezzo_a_input_alloggi_filtro").val()).format('0,0'));
5786			}
5787			refreshTotAlloggi();
5788		});
5789
5790		//$("#prezzo_a_input_alloggi_filtro").change(function() {
5791		$("#prezzo_a_input_alloggi_filtro").on('change blur', function() {
5792			if(parseInt(removeDots($("#prezzo_a_input_alloggi_filtro").val())) > maxPreAlloggi){
5793				$("#prezzo_a_alloggi_filtro").val(maxPreAlloggi);
5794				setInputNumberFormat(maxPreAlloggi, 'prezzo_a_input_alloggi_filtro');
5795				$("#prezzo_range_alloggi_filtro").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_alloggi_filtro").val())), parseInt(maxPreAlloggi)]);
5796				$("#prezzo_a_alloggi").val(maxPreAlloggi);
5797				setInputNumberFormat(maxPreAlloggi, 'prezzo_a_input_alloggi');
5798				$("#prezzo_range_alloggi").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_alloggi_filtro").val())), parseInt(maxPreAlloggi)]);
5799				setLabelPrezzoAlloggi(removeDots($("#prezzo_da_input_alloggi_filtro").val())+'-'+maxPreAlloggi, '€ ' + numeral($("#prezzo_da_input_alloggi_filtro").val()).format('0,0')+' - € '+numeral(maxPreAlloggi).format('0,0'));
5800			}
5801			else{
5802				$("#prezzo_a_alloggi_filtro").val(removeDots($("#prezzo_a_input_alloggi_filtro").val()));
5803				$("#prezzo_range_alloggi_filtro").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_alloggi_filtro").val())), parseInt(removeDots($("#prezzo_a_input_alloggi_filtro").val()))]);
5804				$("#prezzo_a_alloggi").val(removeDots($("#prezzo_a_input_alloggi_filtro").val()));
5805				$("#prezzo_range_alloggi").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_alloggi_filtro").val())), parseInt(removeDots($("#prezzo_a_input_alloggi_filtro").val()))]);
5806				setLabelPrezzoAlloggi(removeDots($("#prezzo_da_input_alloggi_filtro").val())+'-'+removeDots($("#prezzo_a_input_alloggi_filtro").val()), '€ ' + numeral($("#prezzo_da_input_alloggi_filtro").val()).format('0,0')+' - € '+numeral($("#prezzo_a_input_alloggi_filtro").val()).format('0,0'));
5807			}
5808			if(parseInt(removeDots($("#prezzo_a_input_alloggi_filtro").val())) < parseInt(removeDots($("#prezzo_da_input_alloggi_filtro").val()))){
5809				$("#prezzo_a_alloggi_filtro").val(parseInt(removeDots($("#prezzo_da_input_alloggi_filtro").val())));
5810				$("#prezzo_a_input_alloggi_filtro").val($("#prezzo_da_input_alloggi_filtro").val());
5811				$("#prezzo_range_alloggi_filtro").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_alloggi_filtro").val())), parseInt(removeDots($("#prezzo_da_input_alloggi_filtro").val()))]);
5812				$("#prezzo_a_alloggi").val(parseInt(removeDots($("#prezzo_da_input_alloggi_filtro").val())));
5813				$("#prezzo_a_input_alloggi").val($("#prezzo_da_input_alloggi_filtro").val());
5814				$("#prezzo_range_alloggi").slider('setValue',[parseInt(removeDots($("#prezzo_da_input_alloggi_filtro").val())), parseInt(removeDots($("#prezzo_da_input_alloggi_filtro").val()))]);
5815				setLabelPrezzoAlloggi(removeDots($("#prezzo_da_input_alloggi_filtro").val())+'-'+removeDots($("#prezzo_da_input_alloggi_filtro").val()), '€ ' + numeral($("#prezzo_da_input_alloggi_filtro").val()).format('0,0')+' - € '+numeral($("#prezzo_da_input_alloggi_filtro").val()).format('0,0'));
5816			}
5817			refreshTotAlloggi();
5818		});
5819    });	
5820}
5821
5822function setCamereAlloggi() { 				
5823	var camerePreSliderFiltro;
5824	var camerePostSliderFiltro;	
5825	let arrTicks_filtro = [1,2,3,4,5,6,7,8,9,10];
5826	let arrTicksLabel_filtro = ['1','2','3','4','5','6','7','8','9','10+'];
5827
5828	if(camere_alloggi){
5829		camereArr = camere_alloggi.split('-');
5830		minCamAlloggi = camereArr[0];
5831		if(camereArr[1] == 10){
5832			maxCamAlloggi = 1000;
5833		}
5834		else{
5835			maxCamAlloggi = camereArr[1];
5836		}
5837	}
5838	else{
5839		minCamAlloggi = 1;
5840		maxCamAlloggi = 10;
5841	} 
5842
5843	$('#camereAlloggiSlider_filtro').click(function(e) {
5844	    e.stopPropagation();
5845	});
5846	
5847	$("#camere_range_alloggi_filtro").bootstrapSlider({ 	
5848		step: 1,
5849		min: 1, 
5850		max: 10, 
5851		value: [parseInt(minCamAlloggi), parseInt(maxCamAlloggi)], 
5852		focus: true,
5853		tooltip: 'always',
5854		tooltip_split: true,
5855		tooltip_position:'bottom',
5856	    ticks: arrTicks_filtro,		
5857	    ticks_labels: arrTicksLabel_filtro,
5858	    ticks_snap_bounds: 50
5859	}).on('slideStart', function(data){
5860		camerePreSliderFiltro = $('#camere_range_alloggi_filtro').data('bootstrapSlider').getValue();
5861	}).on('slideStop', function(data){
5862		camerePostSliderFiltro = $('#camere_range_alloggi_filtro').data('bootstrapSlider').getValue();
5863		if((camerePreSliderFiltro[0] != camerePostSliderFiltro[0]) || (camerePreSliderFiltro[1] != camerePostSliderFiltro[1])){
5864			if(data.value[0] == 10){
5865				$("#camere_da_alloggi_filtro").val(10);
5866				$('#camere_alloggi').val('10-'+data.value[1]);
5867			}
5868			else{
5869				$("#camere_da_alloggi_filtro").val(data.value[0]);
5870				$('#camere_alloggi').val(data.value[0]+'-'+data.value[1]);
5871			}
5872			if(data.value[1] == 10){
5873				$("#camere_a_alloggi_filtro").val(1000);
5874				$('#camere_alloggi').val(data.value[0]+'-1000');
5875			}
5876			else{
5877				$("#camere_a_alloggi_filtro").val(data.value[1]);	
5878				$('#camere_alloggi').val(data.value[0]+'-'+data.value[1]);
5879			}
5880			refreshTotAlloggi();
5881		}			
5882	}).on('change', function(data){	
5883		if(data.value.newValue[0] == 10){
5884			$("#camere_da_alloggi_filtro").val(10);
5885			$('#camere_alloggi').val('10-'+data.value.newValue[1]);
5886		}
5887		else{
5888			$("#camere_da_alloggi_filtro").val(data.value.newValue[0]);
5889			$('#camere_alloggi').val(data.value.newValue[0]+'-'+data.value.newValue[1]);
5890		}
5891		if(data.value.newValue[1] == 10){
5892			$("#camere_a_alloggi_filtro").val(1000);
5893			$('#camere_alloggi').val(data.value.newValue[0]+'-1000');
5894		}
5895		else{
5896			$("#camere_a_alloggi_filtro").val(data.value.newValue[1]);	
5897			$('#camere_alloggi').val(data.value.newValue[0]+'-'+data.value.newValue[1]);
5898		}	
5899 	});	
5900
5901	if(camere_alloggi){
5902		camereArr = camere_alloggi.split('-');
5903		$("#camere_range_alloggi_filtro").bootstrapSlider('setValue',[parseInt(camereArr[0]), parseInt(camereArr[1])]);
5904		$("#camere_da_alloggi_filtro").val(camereArr[0]);
5905		$("#camere_a_alloggi_filtro").val(camereArr[1]);	
5906	}
5907	else{
5908		$("#camere_range_alloggi_filtro").bootstrapSlider('setValue',[1, 10]);
5909		$("#camere_da_alloggi_filtro").val(1);
5910		$("#camere_a_alloggi_filtro").val(1000);	
5911	} 
5912}
5913
5914function setBagniAlloggi() { 				
5915	var bagniPreSliderFiltro;
5916	var bagniPostSliderFiltro;	
5917	let arrTicks_filtro = [1,2,3,4,5,6,7,8,9,10];
5918	let arrTicksLabel_filtro = ['1','2','3','4','5','6','7','8','9','10+'];
5919
5920	if(bagni_alloggi){
5921		bagniArr = bagni_alloggi.split('-');
5922		minBagAlloggi = bagniArr[0];
5923		if(bagniArr[1] == 10){
5924			maxBagAlloggi = 1000;
5925		}
5926		else{
5927			maxBagAlloggi = bagniArr[1];
5928		}
5929	}
5930	else{
5931		minBagAlloggi = 1;
5932		maxBagAlloggi = 10;
5933	} 
5934	
5935	$('#bagniAlloggiSlider_filtro').click(function(e) {
5936	    e.stopPropagation();
5937	});
5938	
5939	$("#bagni_range_alloggi_filtro").bootstrapSlider({ 	
5940		step: 1,
5941		min: 1, 
5942		max: 10, 
5943		value: [parseInt(minBagAlloggi), parseInt(maxBagAlloggi)], 
5944		focus: true,
5945		tooltip: 'always',
5946		tooltip_split: true,
5947		tooltip_position:'bottom',
5948	    ticks: arrTicks_filtro,		
5949	    ticks_labels: arrTicksLabel_filtro,
5950	    ticks_snap_bounds: 50
5951	}).on('slideStart', function(data){
5952		bagniPreSliderFiltro = $('#bagni_range_alloggi_filtro').data('bootstrapSlider').getValue();
5953	}).on('slideStop', function(data){
5954		bagniPostSliderFiltro = $('#bagni_range_alloggi_filtro').data('bootstrapSlider').getValue();
5955		if((bagniPreSliderFiltro[0] != bagniPostSliderFiltro[0]) || (bagniPreSliderFiltro[1] != bagniPostSliderFiltro[1])){
5956			if(data.value[0] == 10){
5957				$("#bagni_da_alloggi_filtro").val(10);
5958				$('#bagni_alloggi').val('10-'+data.value[1]);
5959			}
5960			else{
5961				$("#bagni_da_alloggi_filtro").val(data.value[0]);
5962				$('#bagni_alloggi').val(data.value[0]+'-'+data.value[1]);
5963			}
5964			if(data.value[1] == 10){
5965				$("#bagni_a_alloggi_filtro").val(1000);
5966				$('#bagni_alloggi').val(data.value[0]+'-1000');
5967			}
5968			else{
5969				$("#bagni_a_alloggi_filtro").val(data.value[1]);	
5970				$('#bagni_alloggi').val(data.value[0]+'-'+data.value[1]);
5971			}
5972			refreshTotAlloggi();
5973		}			
5974	}).on('change', function(data){	
5975		if(data.value.newValue[0] == 10){
5976			$("#bagni_da_alloggi_filtro").val(10);
5977			$('#bagni_alloggi').val('10-'+data.value.newValue[1]);
5978		}
5979		else{
5980			$("#bagni_da_alloggi_filtro").val(data.value.newValue[0]);
5981			$('#bagni_alloggi').val(data.value.newValue[0]+'-'+data.value.newValue[1]);
5982		}
5983		if(data.value.newValue[1] == 10){
5984			$("#bagni_a_alloggi_filtro").val(1000);
5985			$('#bagni_alloggi').val(data.value.newValue[0]+'-1000');
5986		}
5987		else{
5988			$("#bagni_a_alloggi_filtro").val(data.value.newValue[1]);	
5989			$('#bagni_alloggi').val(data.value.newValue[0]+'-'+data.value.newValue[1]);
5990		}	
5991 	});	
5992
5993	if(bagni_alloggi){
5994		bagniArr = bagni_alloggi.split('-');
5995		$("#bagni_range_alloggi_filtro").bootstrapSlider('setValue',[parseInt(bagniArr[0]), parseInt(bagniArr[1])]);
5996		$("#bagni_da_alloggi_filtro").val(bagniArr[0]);
5997		$("#bagni_a_alloggi_filtro").val(bagniArr[1]);	
5998	}
5999	else{
6000		$("#bagni_range_alloggi_filtro").bootstrapSlider('setValue',[1, 10]);
6001		$("#bagni_da_alloggi_filtro").val(1);
6002		$("#bagni_a_alloggi_filtro").val(1000);	
6003	} 
6004}
6005
6006function setLabelPrezzoAlloggi(id_val, val_label){
6007	if(id_val == ''){
6008		/*$('#prezzo_alloggiBtn').css('color', '#fff');
6009		$('#prezzo_alloggiBtn').css('opacity', '0.3');*/
6010		$('#prezzo_alloggiBtn').css('color', '#9b9a9e');
6011		$('#prezzo_alloggiBtn').css('opacity', '1');
6012	}
6013	else{
6014		$('#prezzo_alloggiBtn').css('color', '#ed6b62');
6015		$('#prezzo_alloggiBtn').css('opacity', '1');
6016	}
6017	
6018	$('#prezzo_alloggi').val(id_val);
6019	$('#prezzo_alloggi_filtro').val(id_val);
6020	$('#prezzo_alloggiBtn').html(val_label);
6021	
6022	$('.cleanprezzo_alloggi').remove();	
6023}
6024
6025function setLabelPrezzoImmobili(id_val, val_label){
6026	if(id_val == ''){
6027		/*$('#prezzo_immobiliBtn').css('color', '#fff');
6028		$('#prezzo_immobiliBtn').css('opacity', '0.3');*/
6029		$('#prezzo_immobiliBtn').css('color', '#9b9a9e');
6030		$('#prezzo_immobiliBtn').css('opacity', '1');
6031	}
6032	else{
6033		$('#prezzo_immobiliBtn').css('color', '#007574');
6034		$('#prezzo_immobiliBtn').css('opacity', '1');
6035	}
6036	
6037	$('#prezzo_immobili').val(id_val);
6038	$('#prezzo_immobili_filtro').val(id_val);
6039	$('#prezzo_immobiliBtn').html(val_label);
6040	
6041	$('.cleanprezzo_immobili').remove();	
6042}
6043
6044function updateTipologieLocationsImmobili(typeLabel, type){
6045	var allChecked = true;
6046	var setId = '';
6047	var numCheck = 0;
6048	var regNumCheck = 0;
6049	var provNumCheck = 0;
6050
6051	if(type == true){
6052		type = '_filtro';
6053	}
6054	else{
6055		type = '';
6056	}
6057
6058	if(typeLabel == 'tipologie_immobili'){
6059		$('input.tipologie_immobiliCheck'+type+'[type=checkbox]').each(function () {
6060			if(this.checked){
6061				setId += this.value+'-';
6062				numCheck++;
6063			}
6064			else{
6065				allChecked = false;
6066			}
6067		});
6068	}
6069	else if(typeLabel == 'aree_immobili'){
6070		$('input.aree_immobiliCheck'+type+'[type=checkbox]').each(function () {
6071			if(this.checked){
6072				setId += this.value+'-';
6073				numCheck++;
6074			}
6075			else{
6076				allChecked = false;
6077			}
6078		});
6079	}
6080	else if(typeLabel == 'regioni_immobili'){
6081		$('input.regioni_immobiliCheck'+type+'[type=checkbox]').each(function () {
6082			if(this.checked){
6083				setId += this.value+'-';
6084				numCheck++;
6085				regNumCheck++;
6086			}
6087			else{
6088				allChecked = false;
6089			}
6090		});
6091		
6092    	if(regNumCheck == 0){
6093    		$('#province_immobili').val('');
6094    		$('#comuni_immobili').val('');
6095    	}
6096	}
6097	else if(typeLabel == 'province_immobili'){
6098		$('input.province_immobiliCheck'+type+'[type=checkbox]').each(function () {
6099			if(this.checked){
6100				setId += this.value+'-';
6101				numCheck++;
6102				provNumCheck++;
6103			}
6104			else{
6105				allChecked = false;
6106			}
6107		});
6108		
6109    	if(provNumCheck == 0){
6110    		$('#comuni_immobili').val('');
6111    	}
6112	}
6113	else if(typeLabel == 'comuni_immobili'){
6114		$('input.comuni_immobiliCheck'+type+'[type=checkbox]').each(function () {
6115			if(this.checked){
6116				setId += this.value+'-';
6117				numCheck++;
6118			}
6119			else{
6120				allChecked = false;
6121			}
6122		});
6123	}
6124	
6125	setId = setId.substr(0, setId.length - 1);
6126	
6127	if(allChecked == true){
6128		$("#"+typeLabel+"CheckAll").prop("checked", true);
6129		$("#"+typeLabel+"CheckAll_filtro").prop("checked", true);
6130	}
6131	else{
6132		$("#"+typeLabel+"CheckAll").prop("checked", false);
6133		$("#"+typeLabel+"CheckAll_filtro").prop("checked", false);
6134	}
6135
6136	$('#'+typeLabel).val(setId);
6137}
6138
6139function updateTipologieAreeAlloggi(typeLabel, type){
6140	var allChecked = true;
6141	var setId = '';
6142	var numCheck = 0;
6143
6144	if(type == true){
6145		type = '_filtro';
6146	}
6147	else{
6148		type = '';
6149	}
6150
6151	if(typeLabel == 'tipologie_alloggi'){
6152		$('input.tipologie_alloggiCheck'+type+'[type=checkbox]').each(function () {
6153			if(this.checked){
6154				setId += this.value+'-';
6155				numCheck++;
6156			}
6157			else{
6158				allChecked = false;
6159			}
6160		});
6161	}
6162	else{
6163		$('input.aree_alloggiCheck'+type+'[type=checkbox]').each(function () {
6164			if(this.checked){
6165				//setId += this.value+'-';
6166				setId += this.value+',';
6167				numCheck++;
6168			}
6169			else{
6170				allChecked = false;
6171			}
6172		});
6173
6174		$('input.aree_alloggiCheckSub'+type+'[type=checkbox]').each(function () {
6175			if(this.checked){
6176				//setId += this.value+'-';
6177				setId += this.value+',';
6178				numCheck++;
6179			}
6180			else{
6181				allChecked = false;
6182			}
6183		});
6184	}
6185	
6186	setId = setId.substr(0, setId.length - 1);
6187
6188	if(numCheck > 1){
6189		//if(setId == '1-2-5'){
6190		//if(setId == 'it-16,4,5,8'){
6191		if(setId == 'it-16,4,11,5,8'){
6192			setId = 'it-16';
6193		}
6194		else if((setId == 'it-18,7,3') || (setId == 'it-18,3,7')){
6195			setId = 'it-18';
6196		}
6197		else if(setId == 'it-10,9'){
6198			setId = 'it-10';
6199		}
6200	}
6201	
6202	if(allChecked == true){
6203		$("#"+typeLabel+"CheckAll").prop("checked", true);
6204		$("#"+typeLabel+"CheckAll_filtro").prop("checked", true);
6205	}
6206	else{
6207		$("#"+typeLabel+"CheckAll").prop("checked", false);
6208		$("#"+typeLabel+"CheckAll_filtro").prop("checked", false);
6209	}
6210
6211	$('#'+typeLabel).val(setId);	
6212}
6213
6214function printLabelRicercaImmobili(typeLabelParent, typeLabel, type){
6215	var numCheck = 0;
6216	var arrSel = new Array();
6217	var areeImmobiliArray = new Array();
6218	var regioniImmobiliArray = new Array();
6219	var provinceImmobiliArray = new Array();
6220	var comuniImmobiliArray = new Array();
6221	var singleSelected = '';
6222	
6223	if(type == true){
6224		type = '_filtro';
6225	}
6226	else{
6227		type = '';
6228	}
6229
6230	if(typeLabelParent != 'locations_immobili'){
6231    	if($('#'+typeLabel).val() != ''){
6232    		arrSel = $('#'+typeLabel).val().split('-');
6233    		numCheck = arrSel.length;
6234    	}
6235	}
6236	else{
6237    	if($('#aree_immobili').val() != ''){
6238    		areeImmobiliArray = $('#aree_immobili').val().split('-');
6239    		numCheck += areeImmobiliArray.length;
6240    	}
6241    	if($('#comuni_immobili').val() != ''){
6242    		comuniImmobiliArray = $('#comuni_immobili').val().split('-');
6243    		numCheck += comuniImmobiliArray.length;
6244    	}	
6245    	else if($('#province_immobili').val() != ''){
6246    		provinceImmobiliArray = $('#province_immobili').val().split('-');
6247    		numCheck += provinceImmobiliArray.length;
6248    	}
6249    	else if($('#regioni_immobili').val() != ''){
6250    		regioniImmobiliArray = $('#regioni_immobili').val().split('-');
6251    		numCheck += regioniImmobiliArray.length;
6252    	}
6253	}
6254	
6255 	if(numCheck == 0){
6256		$('#'+typeLabel).val('');
6257		if(typeLabel == 'tipologie_immobili'){
6258			$('#'+typeLabelParent+'Btn').html('What kind of property are you looking for?');
6259		}
6260		else{
6261			$('#'+typeLabelParent+'Btn').html('Where do you search?');
6262		}
6263		/*$('#'+typeLabelParent+'Btn').css('color', '#fff');
6264		$('#'+typeLabelParent+'Btn').css('opacity', '0.3');*/
6265		$('#'+typeLabelParent+'Btn').css('color', '#9b9a9e');
6266		$('#'+typeLabelParent+'Btn').css('opacity', '1');
6267		
6268		$('.clean'+typeLabelParent).remove();
6269		refreshSlugImmobili();
6270		if(type == '_filtro'){
6271			refreshTotImmobili();
6272		}
6273		
6274		return;
6275 	}
6276
6277 	if(numCheck == 1){
6278		$('#'+typeLabelParent+'Btn').css('color', '#007574');
6279		$('#'+typeLabelParent+'Btn').css('opacity', '1');
6280
6281		if(typeLabel == 'tipologie_immobili'){
6282			singleSelected = $('#tipologia_immobileCheckLabel_'+$('#'+typeLabel).val()+type).text();
6283		}
6284		else{
6285        	if($('#aree_immobili').val() != ''){
6286        		singleSelected = $('#area_immobileCheckLabel_'+$('#aree_immobili').val()+type).text();
6287        	}
6288        	if($('#regioni_immobili').val() != ''){
6289        		singleSelected = $('#regione_immobileCheckLabel_'+$('#regioni_immobili').val()+type).text();
6290        	}
6291        	if($('#province_immobili').val() != ''){
6292        		singleSelected = $('#provincia_immobileCheckLabel_'+$('#province_immobili').val()+type).text();
6293        	}
6294        	if($('#comuni_immobili').val() != ''){
6295        		singleSelected = $('#comune_immobileCheckLabel_'+$('#comuni_immobili').val()+type).text();
6296        	}	
6297		}
6298		
6299		$('#'+typeLabelParent+'Btn').html(singleSelected);	
6300		$('#'+typeLabelParent+'Btn').parent().prepend('<div class="closeBtnDropdownAbsolute clean'+typeLabelParent+'"><i class="fa-solid fa-xmark"></i></div>');
6301 	}
6302 	else{
6303		$('#'+typeLabelParent+'Btn').css('color', '#007574');
6304		$('#'+typeLabelParent+'Btn').css('opacity', '1');
6305		if(typeLabel == 'tipologie_immobili'){
6306			$('#'+typeLabelParent+'Btn').html(numCheck + ' Selected types');
6307		}
6308		else{
6309			$('#'+typeLabelParent+'Btn').html(numCheck + ' Selected areas');
6310		}
6311 		$('#'+typeLabelParent+'Btn').parent().prepend('<div class="closeBtnDropdownAbsolute clean'+typeLabelParent+'"><i class="fa-solid fa-xmark"></i></div>');
6312 	}
6313	
6314	refreshSlugImmobili();
6315	
6316	if(type == '_filtro'){
6317		refreshTotImmobili();
6318	}
6319}
6320
6321function printLabelRicercaAlloggi(typeLabel, type){
6322	var numCheck = 0;
6323	var arrSel = new Array();
6324	var singleSelected = '';
6325	
6326	if(type == true){
6327		type = '_filtro';
6328	}
6329	else{
6330		type = '';
6331	}
6332	
6333	if($('#'+typeLabel).val() != ''){
6334		if(typeLabel == 'aree_alloggi'){
6335			//arrSel = $('#'+typeLabel).val().split('-');
6336			arrSel = $('#'+typeLabel).val().split(',');
6337		}
6338		else {
6339			arrSel = $('#'+typeLabel).val().split('-');
6340		}
6341		numCheck = arrSel.length;
6342	}
6343	
6344 	if(numCheck == 0){
6345		$('#'+typeLabel).val('');
6346		if(typeLabel == 'tipologie_alloggi'){
6347			$('#'+typeLabel+'Btn').html('What kind of housing are you looking for?');
6348		}
6349		else{
6350			$('#'+typeLabel+'Btn').html('Where would you like to go?');
6351		}
6352		/*$('#'+typeLabel+'Btn').css('color', '#fff');
6353		$('#'+typeLabel+'Btn').css('opacity', '0.3');*/
6354		$('#'+typeLabel+'Btn').css('color', '#9b9a9e');
6355		$('#'+typeLabel+'Btn').css('opacity', '1');
6356		
6357		$('.clean'+typeLabel).remove();
6358		refreshSlugAlloggi();
6359		if(type == '_filtro'){
6360			refreshTotAlloggi();
6361		}
6362		
6363		return;
6364 	}
6365
6366 	if(numCheck == 1){
6367		$('#'+typeLabel+'Btn').css('color', '#ed6b62');
6368		$('#'+typeLabel+'Btn').css('opacity', '1');
6369
6370		if($('#'+typeLabel).val() == 'it-16'){
6371			$('#'+typeLabel+'Btn').html('Tuscany');
6372		}
6373		else if($('#'+typeLabel).val() == 'it-18'){
6374			$('#'+typeLabel+'Btn').html('Umbria');
6375		}
6376		else if($('#'+typeLabel).val() == 'it-10'){
6377			$('#'+typeLabel+'Btn').html('Marche');
6378		}
6379		else {
6380			if(typeLabel == 'tipologie_alloggi'){
6381				singleSelected = $('#tipologia_alloggioCheckLabel_'+$('#'+typeLabel).val()+type).text();
6382			}
6383			else{
6384				singleSelected = $('#area_alloggioCheckLabel_'+$('#'+typeLabel).val()+type).text();
6385				if(singleSelected == ''){
6386					singleSelected = $('#area_alloggioCheckSubLabel_'+$('#'+typeLabel).val()+type).text();
6387				}
6388			}
6389			$('#'+typeLabel+'Btn').html(singleSelected);
6390		}	
6391		$('#'+typeLabel+'Btn').parent().prepend('<div class="closeBtnDropdownAbsolute clean'+typeLabel+'"><i class="fa-solid fa-xmark"></i></div>');
6392 	}
6393 	else{
6394		$('#'+typeLabel+'Btn').css('color', '#ed6b62');
6395		$('#'+typeLabel+'Btn').css('opacity', '1');
6396		if(typeLabel == 'tipologie_immobili'){
6397			$('#'+typeLabel+'Btn').html(numCheck + ' Selected types');
6398		}
6399		else{
6400			$('#'+typeLabel+'Btn').html(numCheck + ' Selected areas');
6401		}
6402 		$('#'+typeLabel+'Btn').parent().prepend('<div class="closeBtnDropdownAbsolute clean'+typeLabel+'"><i class="fa-solid fa-xmark"></i></div>');
6403 	}
6404	
6405	refreshSlugAlloggi();
6406	
6407	if(type == '_filtro'){
6408		refreshTotAlloggi();
6409	}
6410}
6411
6412function removeFilterImmobili(filter){
6413	$('#'+filter+'Filter').remove();
6414	
6415	if(filter.includes("condizione")){
6416		var newCond = '';
6417		var indxCond = filter.charAt(filter.length - 1);
6418		var condArray;
6419		var condStr = '';
6420		
6421		condArray = condizioni_immobili.split('-');
6422		condArray.splice(condArray.indexOf(indxCond), 1);
6423		condStr = (condArray.toString()).replaceAll(',','-');
6424		$('#condizioni_immobili').val(condStr);
6425	}
6426	else{
6427    	$('#'+filter).val('');
6428	}		
6429
6430	newSlug = refreshSlugImmobili();
6431      		submitCercaImmobili(newSlug, true);
6432    }
6433
6434function removeFilterAlloggi(filter){
6435	$('#'+filter+'Filter').remove();
6436	$('#'+filter).val('');
6437
6438	newSlug = refreshSlugAlloggi();
6439
6440	submitCercaAlloggi(newSlug, true);
6441}
6442
6443function removeMustHaveAlloggi(mh, mh_id){
6444	var newSlug = '';
6445
6446	$('#'+mh+'Filter').remove();
6447	$('#must_have_alloggi').val($('#must_have_alloggi').val().replace('-'+mh_id, ""));
6448	$('#must_have_alloggi').val($('#must_have_alloggi').val().replace(mh_id, ""));
6449	$('#'+mh+'Check').prop('checked', false);
6450
6451	newSlug = refreshSlugAlloggi();
6452
6453	submitCercaAlloggi(newSlug, true);
6454}
6455
6456function setFiltriImmobili(){
6457	var html_filtri_div = '';
6458	
6459	if(terreno_immobili){
6460		$("#terreno_immobiliCheck").prop('checked', true);
6461		html_filtri_div += '<div id="terrenoImmobiliFilter">With land<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'terreno_immobili\');"></button></div>';
6462	}
6463	
6464	if(condizioni_immobili){
6465		var condizioniArray = condizioni_immobili.split('-');
6466		for (i = 0; i < condizioniArray.length; i++) {
6467			$( "#condizione_immobileCheck_"+condizioniArray[i]+"_filtro").prop('checked', true);
6468			if(condizioniArray[i] == 1){
6469				html_filtri_div += '<div id="condizione1Filter">New<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'condizione1\');"></button></div>';
6470			}
6471			else if(condizioniArray[i] == 2){
6472				html_filtri_div += '<div id="condizione2Filter">Restored<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'condizione2\');"></button></div>';
6473			}
6474			else if(condizioniArray[i] == 3){
6475				html_filtri_div += '<div id="condizione3Filter">Partially restored<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'condizione3\');"></button></div>';
6476			}
6477			else if(condizioniArray[i] == 4){
6478				html_filtri_div += '<div id="condizione4Filter">Not renovated<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'condizione4\');"></button></div>';
6479			}
6480		}	
6481	}
6482	if(collina_immobili){
6483		$('#collina_immobili').val(true);
6484		html_filtri_div += '<div id="collinaImmobiliFilter">Hill<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'collina_immobili\');"></button></div>';
6485	}
6486	if(pianura_immobili){
6487		$('#pianura_immobili').val(true);
6488		html_filtri_div += '<div id="pianuraImmobiliFilter">Plain<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'pianura_immobili\');"></button></div>';
6489	}
6490	if(vicino_ai_servizi_immobili){
6491		$('#vicino_ai_servizi_immobili').val(true);
6492		html_filtri_div += '<div id="vicino_ai_serviziImmobiliFilter">Near the services<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'vicino_ai_servizi_immobili\');"></button></div>';
6493	}
6494	if(centro_storico_immobili){
6495		$('#centro_storico_immobili').val(true);
6496		html_filtri_div += '<div id="centro_storicoImmobiliFilter">Historical center<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'centro_storico_immobili\');"></button></div>';
6497	}
6498	if(vicino_al_mare_immobili){
6499		$('#vicino_al_mare_immobili').val(true);
6500		html_filtri_div += '<div id="vicino_al_mareImmobiliFilter">Near the sea<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'vicino_al_mare_immobili\');"></button></div>';
6501	}
6502	if(vicino_al_lago_immobili){
6503		$('#vicino_al_lago_immobili').val(true);
6504		html_filtri_div += '<div id="vicino_al_lagoImmobiliFilter">Near the lake<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'vicino_al_lago_immobili\');"></button></div>';
6505	}
6506	if(piscina_immobili){
6507		$('#piscina_immobili').val(true);
6508		html_filtri_div += '<div id="piscinaImmobiliFilter">Swimming pool<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'piscina_immobili\');"></button></div>';
6509	}
6510	if(recinzione_immobili){
6511		$('#recinzione_immobili').val(true);
6512		html_filtri_div += '<div id="recinzioneImmobiliFilter">Fencing<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'recinzione_immobili\');"></button></div>';
6513	}
6514	if(palestra_immobili){
6515		$('#palestra_immobili').val(true);
6516		html_filtri_div += '<div id="palestraImmobiliFilter">Gym<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'palestra_immobili\');"></button></div>';
6517	}
6518	if(spa_immobili){
6519		$('#spa_immobili').val(true);
6520		html_filtri_div += '<div id="spaImmobiliFilter">SPA<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'spa_immobili\');"></button></div>';
6521	}
6522	if(giardino_immobili){
6523		$('#giardino_immobili').val(true);
6524		html_filtri_div += '<div id="giardinoImmobiliFilter">Garden<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'giardino_immobili\');"></button></div>';
6525	}
6526	if(area_barbecue_immobili){
6527		$('#area_barbecue_immobili').val(true);
6528		html_filtri_div += '<div id="area_barbecueImmobiliFilter">BBQ area<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'area_barbecue_immobili\');"></button></div>';
6529	}
6530	if(terrazza_abitabile_immobili){
6531		$('#terrazza_abitabile_immobili').val(true);
6532		html_filtri_div += '<div id="terrazza_abitabileImmobiliFilter">Livable terrace<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'terrazza_abitabile_immobili\');"></button></div>';
6533	}
6534	if(ascensore_immobili){
6535		$('#ascensore_immobili').val(true);
6536		html_filtri_div += '<div id="ascensoreImmobiliFilter">Lift<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'ascensore_immobili\');"></button></div>';
6537	}
6538	if(garage_immobili){
6539		$('#garage_immobili').val(true);
6540		html_filtri_div += '<div id="garageImmobiliFilter">Garage<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'garage_immobili\');"></button></div>';
6541	}
6542	if(strada_accesso_privata_immobili){
6543		$('#strada_accesso_privata_immobili').val(true);
6544		html_filtri_div += '<div id="strada_accesso_privataImmobiliFilter">Private access road<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'strada_accesso_privata_immobili\');"></button></div>';
6545	}
6546	if(allarme_immobili){
6547		$('#allarme_immobili').val(true);
6548		html_filtri_div += '<div id="allarmeImmobiliFilter">Alarm<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'allarme_immobili\');"></button></div>';
6549	}
6550	if(arredato_immobili){
6551		$('#arredato_immobili').val(true);
6552		html_filtri_div += '<div id="arredatoImmobiliFilter">Furnished<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'arredato_immobili\');"></button></div>';
6553	}
6554	if(venduto_immobili){
6555		$( "#vendutoImmobiliCheck").prop('checked', true);
6556	}
6557	if(in_trattativa_immobili){
6558		$( "#in_trattativaImmobiliCheck").prop('checked', true);
6559		$('#in_trattativa_immobili').val(true);
6560		html_filtri_div += '<div id="in_trattativaImmobiliFilter">under negotiation<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'in_trattativa_immobili\');"></button></div>';
6561	}
6562	if(nuovo_sul_mercato_immobili){
6563		$( "#nuovo_sul_mercatoImmobiliCheck").prop('checked', true);
6564		$('#nuovo_sul_mercato_immobili').val(true);
6565		html_filtri_div += '<div id="nuovo_sul_mercatoImmobiliFilter">New on the market<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'nuovo_sul_mercato_immobili\');"></button></div>';
6566	}
6567	/*
6568	if(alta_motivazione_immobili){
6569		$( "#alta_motivazioneImmobiliCheck").prop('checked', true);
6570		$('#alta_motivazione_immobili').val(true);
6571		html_filtri_div += '<div id="alta_motivazioneImmobiliFilter">High motivation<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'alta_motivazione_immobili\');"></button></div>';
6572	}
6573	if(veloce_tempistica_immobili){
6574		$( "#veloce_tempisticaImmobiliCheck").prop('checked', true);
6575		$('#veloce_tempistica_immobili').val(true);
6576		html_filtri_div += '<div id="veloce_tempisticaImmobiliFilter">Short timing<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'veloce_tempistica_immobili\');"></button></div>';
6577	}
6578	*/
6579	if(super_prezzo_immobili){
6580		$('#super_prezzo_immobili').val(true);
6581		html_filtri_div += '<div id="super_prezzoImmobiliFilter">Super price<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'super_prezzo_immobili\');"></button></div>';
6582	}
6583	if(ottimo_prezzo_immobili){
6584		$('#ottimo_prezzo_immobili').val(true);
6585		html_filtri_div += '<div id="ottimo_prezzoImmobiliFilter">Excellent price<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'ottimo_prezzo_immobili\');"></button></div>';
6586	}
6587	if(buon_prezzo_immobili){
6588		$('#buon_prezzo_immobili').val(true);
6589		html_filtri_div += '<div id="buon_prezzoImmobiliFilter">Good price<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'buon_prezzo_immobili\');"></button></div>';
6590	}
6591	if(virtual_tour_immobili){
6592		$( "#virtual_tourImmobiliCheck").prop('checked', true);
6593		$('#virtual_tour_immobili').val(true);
6594		html_filtri_div += '<div id="virtual_tourImmobiliFilter">Virtual Tour<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'virtual_tour_immobili\');"></button></div>';
6595	}
6596	if(video_professionale_immobili){
6597		$( "#video_professionaleImmobiliCheck").prop('checked', true);
6598		$('#video_professionale_immobili').val(true);
6599		html_filtri_div += '<div id="video_professionaleImmobiliFilter">Professional video<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'video_professionale_immobili\');"></button></div>';
6600	}
6601	if(video_amatoriale_immobili){
6602		$( "#video_amatorialeImmobiliCheck").prop('checked', true);
6603		$('#video_amatoriale_immobili').val(true);
6604		html_filtri_div += '<div id="video_amatorialeImmobiliFilter">Amateur Video<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterImmobili(\'video_amatoriale_immobili\');"></button></div>';
6605	}
6606	
6607	$("#filtriDivImmobili").empty().append(html_filtri_div);
6608}
6609
6610function setFiltriAlloggi(){
6611	var html_filtri_div = '';
6612
6613	if((!must_have_alloggi.includes('-')) && (!tipologie_alloggi.includes('-')) && (!aree_alloggi.includes('-'))){
6614		if(((must_have_alloggi) && (tipologie_alloggi == '') && (aree_alloggi == '')) || ((aree_alloggi) && (tipologie_alloggi == '') && (must_have_alloggi == ''))) {
6615			$('#filtriDivAlloggi').css('display', 'none');
6616		}
6617	}
6618	
6619	if(animals_allowed_alloggi){
6620		$('#animals_allowed_alloggi').val(true);
6621		html_filtri_div += '<div id="animals_allowedAlloggiFilter">Take your pet<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterAlloggi(\'animals_allowed_alloggi\');"></button></div>';
6622	}
6623	if(sauna_alloggi){
6624		$('#sauna_alloggi').val(true);
6625		html_filtri_div += '<div id="saunaAlloggiFilter">Sauna<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterAlloggi(\'sauna_alloggi\');"></button></div>';
6626	}
6627	if(bike_alloggi){
6628		$('#bike_alloggi').val(true);
6629		html_filtri_div += '<div id="bikeAlloggiFilter">Bicycle<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterAlloggi(\'bike_alloggi\');"></button></div>';
6630	}
6631	if(gym_alloggi){
6632		$('#gym_alloggi').val(true);
6633		html_filtri_div += '<div id="gymAlloggiFilter">Gym<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterAlloggi(\'gym_alloggi\');"></button></div>';
6634	}
6635	if(fireplace_alloggi){
6636		$('#fireplace_alloggi').val(true);
6637		html_filtri_div += '<div id="fireplaceAlloggiFilter">Fireplace<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterAlloggi(\'fireplace_alloggi\');"></button></div>';
6638	}
6639	if(jacuzzi_alloggi){
6640		$('#jacuzzi_alloggi').val(true);
6641		html_filtri_div += '<div id="jacuzziAlloggiFilter">Jacuzzi<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterAlloggi(\'jacuzzi_alloggi\');"></button></div>';
6642	}
6643	if(eco_friendly_alloggi){
6644		$('#eco_friendly_alloggi').val(true);
6645		html_filtri_div += '<div id="eco_friendlyAlloggiFilter">Eco-friendly<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterAlloggi(\'eco_friendly_alloggi\');"></button></div>';
6646	}
6647	if(golf_alloggi){
6648		$('#golf_alloggi').val(true);
6649		html_filtri_div += '<div id="golfAlloggiFilter">Golf course<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterAlloggi(\'golf_alloggi\');"></button></div>';
6650	}
6651	if(pool_alloggi){
6652		$('#pool_alloggi').val(true);
6653		html_filtri_div += '<div id="poolAlloggiFilter">Swimming pool<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterAlloggi(\'pool_alloggi\');"></button></div>';
6654	}
6655	if(tennis_alloggi){
6656		$('#tennis_alloggi').val(true);
6657		html_filtri_div += '<div id="tennisAlloggiFilter">Tennis court<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterAlloggi(\'tennis_alloggi\');"></button></div>';
6658	}
6659	if(smart_working_alloggi){
6660		$('#smart_working_alloggi').val(true);
6661		html_filtri_div += '<div id="smart_workingAlloggiFilter">Smart-working space<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterAlloggi(\'smart_working_alloggi\');"></button></div>';
6662	}
6663	if(wifi_alloggi){
6664		$('#wifi_alloggi').val(true);
6665		html_filtri_div += '<div id="wifiAlloggiFilter">Wi-Fi<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterAlloggi(\'wifi_alloggi\');"></button></div>';
6666	}
6667	if(barrier_free_alloggi){
6668		$('#barrier_free_alloggi').val(true);
6669		html_filtri_div += '<div id="barrier_freeAlloggiFilter">Barrier-Free<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterAlloggi(\'barrier_free_alloggi\');"></button></div>';
6670	}
6671	if(fenced_garden_alloggi){
6672		$('#fenced_garden_alloggi').val(true);
6673		html_filtri_div += '<div id="fenced_gardenAlloggiFilter">Enclosed garden<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterAlloggi(\'fenced_garden_alloggi\');"></button></div>';
6674	}
6675	if(air_conditioned_alloggi){
6676		$('#air_conditioned_alloggi').val(true);
6677		html_filtri_div += '<div id="air_conditionedAlloggiFilter">Air conditioning<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterAlloggi(\'air_conditioned_alloggi\');"></button></div>';
6678	}
6679	if(safe_for_kids_alloggi){
6680		$('#safe_for_kids_alloggi').val(true);
6681		html_filtri_div += '<div id="safe_for_kidsAlloggiFilter">Equipped for children<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterAlloggi(\'safe_for_kids_alloggi\');"></button></div>';
6682	}
6683	if(virtual_tour_alloggi){
6684		$('#virtual_tour_alloggi').val(true);
6685		html_filtri_div += '<div id="virtualTourAlloggiFilter">Virtual Tour<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterAlloggi(\'virtual_tour_alloggi\');"></button></div>';
6686	}
6687	if(video_alloggi){
6688		$('#video_alloggi').val(true);
6689		html_filtri_div += '<div id="videoAlloggiFilter">Video<button type="button" class="btn-close buttonCloseFilter" onclick="removeFilterAlloggi(\'video_alloggi\');"></button></div>';
6690	}
6691	$("#filtriDivAlloggi").empty().append(html_filtri_div);
6692}
6693
6694function setMustHaveAlloggi(){
6695	var html_must_have_div = '';
6696
6697	if((!must_have_alloggi.includes('-')) && (!tipologie_alloggi.includes('-')) && (!aree_alloggi.includes('-'))){
6698		if(((must_have_alloggi) && (tipologie_alloggi == '') && (aree_alloggi == '')) || ((aree_alloggi) && (tipologie_alloggi == '') && (must_have_alloggi == ''))) {
6699			$('#mustHaveDivAlloggi').css('display', 'none');
6700		}
6701	}
6702	
6703	if(must_have_alloggi){
6704		$('#must_have_alloggi').val(must_have_alloggi);
6705
6706		var mhArray = must_have_alloggi.split('-');
6707		var mhSelected = '';
6708		
6709		for (i = 0; i < mhArray.length; i++) {
6710
6711			html_must_have_div = '';
6712
6713			switch (mhArray[i]) {
6714			  	case 'custom_u12':
6715			  		html_must_have_div += '<div id="nearTheSeaAlloggiFilter">Near the sea<button type="button" class="btn-close buttonCloseFilter" onclick="removeMustHaveAlloggi(\'nearTheSea_alloggi\', 1);"></button></div>';
6716			  		mhSelected = 'Near the sea';
6717			  		break;
6718			  	case 'custom_u13':
6719			  		html_must_have_div += '<div id="closeToTownAlloggiFilter">Close to town<button type="button" class="btn-close buttonCloseFilter" onclick="removeMustHaveAlloggi(\'closeToTown_alloggi\', 2);"></button></div>';
6720			  		mhSelected = 'Close to town';
6721			  		break;
6722			  	case 'custom_u14':
6723			  		html_must_have_div += '<div id="gorgeousViewAlloggiFilter">Gorgeous view<button type="button" class="btn-close buttonCloseFilter" onclick="removeMustHaveAlloggi(\'gorgeousView_alloggi\', 3);"></button></div>';
6724			  		mhSelected = 'Gorgeous view';
6725			  		break;
6726			  	case 'custom_u15':
6727			  		html_must_have_div += '<div id="farFromAllAlloggiFilter">Far from all<button type="button" class="btn-close buttonCloseFilter" onclick="removeMustHaveAlloggi(\'farFromAll_alloggi\', 4);"></button></div>';
6728			  		mhSelected = 'Far from all';
6729			  		break;
6730			  	case 'custom_u16':
6731			  		html_must_have_div += '<div id="wonderfulGardenAlloggiFilter">Wonderful garden<button type="button" class="btn-close buttonCloseFilter" onclick="removeMustHaveAlloggi(\'wonderfulGarden_alloggi\', 5);"></button></div>';
6732			  		mhSelected = 'Wonderful garden';
6733			  		break;
6734			  	case 'custom_u17':
6735			  		html_must_have_div += '<div id="spaAlloggiFilter">SPA<button type="button" class="btn-close buttonCloseFilter" onclick="removeMustHaveAlloggi(\'Spa_alloggi\', 6);"></button></div>';
6736			  		mhSelected = 'SPA';
6737			  		break;
6738			  	case 'custom_u18':
6739			  		html_must_have_div += '<div id="cozyInWinterAlloggiFilter">Cozy in Winter<button type="button" class="btn-close buttonCloseFilter" onclick="removeMustHaveAlloggi(\'cozyInWinter_alloggi\', 7);"></button></div>';
6740			  		mhSelected = 'Cozy in Winter';
6741			  		break;
6742			  	case 'custom_u19':
6743			  		html_must_have_div += '<div id="forFoodiesAlloggiFilter">For Foodies<button type="button" class="btn-close buttonCloseFilter" onclick="removeMustHaveAlloggi(\'forFoodies_alloggi\', 8);"></button></div>';
6744			  		mhSelected = 'For Foodies';
6745			  		break;
6746			  	case 'custom_u20':
6747			  		html_must_have_div += '<div id="weddingVenueAlloggiFilter">Wedding Venue<button type="button" class="btn-close buttonCloseFilter" onclick="removeMustHaveAlloggi(\'weddingVenue_alloggi\', 9);"></button></div>';
6748			  		mhSelected = 'Wedding Venue';
6749			  		break;
6750			}	
6751
6752			$("#mustHaveDivAlloggi").append(html_must_have_div);
6753		} 
6754		$('#nomePageSearchCustom').html(mhSelected);
6755	}
6756}
6757
6758function resetFiltriImmobili(){
6759	$(".tipologie_immobiliCheck").prop("checked", false);
6760	$(".tipologie_immobiliCheck_filtro").prop("checked", false);
6761	$("#tipologie_immobiliCheckAll").prop("checked", false);
6762	$("#tipologie_immobiliCheckAll_filtro").prop("checked", false);
6763	
6764	$(".aree_immobiliCheck").prop("checked", false);
6765	$(".aree_immobiliCheckSub").prop("checked", false);
6766	$(".aree_immobiliCheck_filtro").prop("checked", false);
6767	$(".aree_immobiliCheckSub_filtro").prop("checked", false);
6768	$("#aree_immobiliCheckAll").prop("checked", false);
6769	$("#aree_immobiliCheckAll_filtro").prop("checked", false);
6770
6771	$(".regioni_immobiliCheck").prop("checked", false);
6772	$(".regioni_immobiliCheckSub").prop("checked", false);
6773	$(".regioni_immobiliCheck_filtro").prop("checked", false);
6774	$(".regioni_immobiliCheckSub_filtro").prop("checked", false);
6775	$("#regioni_immobiliCheckAll").prop("checked", false);
6776	$("#regioni_immobiliCheckAll_filtro").prop("checked", false);
6777	
6778	$(".province_immobiliCheck").prop("checked", false);
6779	$(".province_immobiliCheck_filtro").prop("checked", false);
6780	$("#province_immobiliCheckAll").prop("checked", false);
6781	$("#province_immobiliCheckAll_filtro").prop("checked", false);
6782
6783	$(".comuni_immobiliCheck").prop("checked", false);
6784	$(".comuni_immobiliCheck_filtro").prop("checked", false);
6785	$("#comuni_immobiliCheckAll").prop("checked", false);
6786	$("#comuni_immobiliCheckAll_filtro").prop("checked", false);
6787	
6788	$(".filtriImmobiliCheckCondizioni").prop("checked", false);
6789
6790	setLabelPrezzoImmobili($("#prezzo_min_immobili").val()+'-'+$("#prezzo_max_immobili").val(), '€ ' + numeral($("#prezzo_min_immobili").val()).format('0,0')+' - € '+numeral($("#prezzo_max_immobili").val()).format('0,0'));
6791	$("#prezzo_range_immobili_filtro").slider('setValue',[parseInt($("#prezzo_min_immobili").val()), parseInt($("#prezzo_max_immobili").val())]);
6792	$("#prezzo_da_immobili_filtro").val($("#prezzo_min_immobili").val());
6793	$("#prezzo_a_immobili_filtro").val($("#prezzo_max_immobili").val());	
6794	$("#prezzo_da_input_immobili_filtro").val($("#prezzo_min_immobili").val());
6795	$("#prezzo_a_input_immobili_filtro").val($("#prezzo_max_immobili").val()); 
6796	$("#prezzo_range_immobili").slider('setValue',[parseInt(minPreImmobili), parseInt(maxPreImmobili)]);
6797	setInputNumberFormat($("#prezzo_min_immobili").val(), 'prezzo_da_input_immobili');
6798	setInputNumberFormat($("#prezzo_max_immobili").val(), 'prezzo_a_input_immobili');
6799	setInputNumberFormat($("#prezzo_min_immobili").val(), 'prezzo_da_input_immobili_filtro');
6800	setInputNumberFormat($("#prezzo_max_immobili").val(), 'prezzo_a_input_immobili_filtro');
6801	
6802	$("#camere_range_immobili_filtro").bootstrapSlider('setValue',[0, 10]);
6803	$("#camere_da_immobili_filtro").val(0);
6804	$("#camere_a_immobili_filtro").val(1000);
6805	$("#bagni_range_immobili_filtro").bootstrapSlider('setValue',[0, 10]);
6806	$("#bagni_da_immobili_filtro").val(0);
6807	$("#bagni_a_immobili_filtro").val(1000);
6808	
6809	$('#superficie_immobili').val($("#superficie_min_immobili_filtro").val()+'-'+$("#superficie_max_immobili_filtro").val());
6810	$("#superficie_range_immobili_filtro").slider('setValue',[parseInt($("#superficie_min_immobili_filtro").val()), parseInt($("#superficie_max_immobili_filtro").val())]);
6811	$("#superficie_da_immobili_filtro").val($("#superficie_min_immobili_filtro").val());
6812	$("#superficie_a_immobili_filtro").val($("#superficie_max_immobili_filtro").val());	 
6813    setInputNumberFormat($("#superficie_min_immobili_filtro").val(), 'superficie_da_input_immobili_filtro');
6814    setInputNumberFormat($("#superficie_max_immobili_filtro").val(), 'superficie_a_input_immobili_filtro');
6815
6816	$('#terreno_immobiliCheck').prop("checked", false);
6817	$('#terreno_immobili').val($("#terreno_min_immobili_filtro").val()+'-'+$("#terreno_max_immobili_filtro").val());
6818	$("#terreno_range_immobili_filtro").slider('setValue',[parseInt($("#terreno_min_immobili_filtro").val()), parseInt($("#terreno_max_immobili_filtro").val())]);
6819	$("#terreno_da_immobili_filtro").val($("#terreno_min_immobili_filtro").val());
6820	$("#terreno_a_immobili_filtro").val($("#terreno_max_immobili_filtro").val());	 
6821    setInputNumberFormatTerreno($("#terreno_min_immobili_filtro").val() / 10000, 'terreno_da_input_immobili_filtro');
6822    setInputNumberFormatTerreno($("#terreno_max_immobili_filtro").val() / 10000, 'terreno_a_input_immobili_filtro');
6823
6824	$('.filtriImmobiliCheckPosizione').each(function () {
6825		$('.filtriImmobiliCheckPosizione').prop('checked', false);
6826		$('.filtriImmobiliCheckLabelPosizione').css('border', '1px solid #007574');
6827		$('.filtriImmobiliCheckLabelPosizione').css('color', '#007574');
6828	});
6829	
6830	$('.filtriImmobiliCheckServizi').each(function () {
6831		$('.filtriImmobiliCheckServizi').prop('checked', false);
6832		$('.filtriImmobiliCheckLabelServizi').css('border', '1px solid #007574');
6833		$('.filtriImmobiliCheckLabelServizi').css('color', '#007574');
6834	});
6835	
6836	$('#tipologie_immobiliBtn').html('What kind of property are you looking for?');
6837	/*$('#tipologie_immobiliBtn').css('color', '#fff');
6838	$('#tipologie_immobiliBtn').css('opacity', '0.3');*/
6839	$('#tipologie_immobiliBtn').css('color', '#9b9a9e');
6840	$('#tipologie_immobiliBtn').css('opacity', '1');
6841	$('.cleantipologie_immobili').remove();
6842
6843	$('#locations_immobiliBtn').html('Where would you like to go?');
6844	/*$('#locations_immobiliBtn').css('color', '#fff');
6845	$('#locations_immobiliBtn').css('opacity', '0.3');*/
6846	$('#locations_immobiliBtn').css('color', '#9b9a9e');
6847	$('#locations_immobiliBtn').css('opacity', '1');
6848	$('.cleanlocations_immobili').remove();
6849
6850	$("#vendutoImmobiliCheck").prop("checked", false);
6851	$("#in_trattativaImmobiliCheck").prop("checked", false);
6852	$("#nuovo_sul_mercatoImmobiliCheck").prop("checked", false);
6853	$(".filtriImmobiliCheckMedia").prop("checked", false);
6854	
6855	$('#ricerca_liberaImmobili').val('');
6856	$('#ricerca_liberaImmobiliMobile').val('');
6857	$('#tipologie_immobili').val('');
6858	$('#aree_immobili').val('');
6859	$('#regioni_immobili').val('');
6860	$('#province_immobili').val('');
6861	$('#comuni_immobili').val('');
6862	$('#camere_immobili').val('0-1000');
6863	$('#bagni_immobili').val('0-1000');
6864	$('#condizioni_immobili').val('');
6865	$('#collina_immobili').val('');
6866	$('#pianura_immobili').val('');
6867	$('#vicino_ai_servizi_immobili').val('');
6868	$('#centro_storico_immobili').val('');
6869	$('#vicino_al_mare_immobili').val('');
6870	$('#vicino_al_lago_immobili').val('');
6871	$('#piscina_immobili').val('');
6872	$('#recinzione_immobili').val('');
6873	$('#palestra_immobili').val('');
6874	$('#spa_immobili').val('');
6875	$('#giardino_immobili').val('');
6876	$('#area_barbecue_immobili').val('');
6877	$('#terrazza_abitabile_immobili').val('');
6878	$('#ascensore_immobili').val('');
6879	$('#garage_immobili').val('');
6880	$('#strada_accesso_privata_immobili').val('');
6881	$('#allarme_immobili').val('');
6882	$('#arredato_immobili').val('');
6883	$('#venduto_immobili').val('');
6884	$('#in_trattativa_immobili').val('');
6885	$('#nuovo_sul_mercato_immobili').val('');
6886	$('#alta_motivazione_immobili').val('');
6887	$('#veloce_tempistica_immobili').val('');
6888	$('#super_prezzo_immobili').val('');
6889	$('#ottimo_prezzo_immobili').val('');
6890	$('#buon_prezzo_immobili').val('');
6891	$('#virtual_tour_immobili').val('');
6892	$('#video_professionale_immobili').val('');
6893	$('#video_amatoriale_immobili').val('');
6894	
6895	refreshTotImmobili();	
6896
6897	refreshSlugImmobili();
6898}
6899
6900function resetFiltriAlloggi() {
6901	$(".tipologie_alloggiCheck").prop("checked", false);
6902	$(".tipologie_alloggiCheck_filtro").prop("checked", false);
6903	$("#tipologie_alloggiCheckAll").prop("checked", false);
6904	$("#tipologie_alloggiCheckAll_filtro").prop("checked", false);
6905	$(".aree_alloggiCheck").prop("checked", false);
6906	$(".aree_alloggiCheckSub").prop("checked", false);
6907	$(".aree_alloggiCheck_filtro").prop("checked", false);
6908	$(".aree_alloggiCheckSub_filtro").prop("checked", false);
6909	$("#aree_alloggiCheckAll").prop("checked", false);
6910	$("#aree_alloggiCheckAll_filtro").prop("checked", false);
6911
6912	setLabelPrezzoAlloggi($("#prezzo_min_alloggi").val()+'-'+$("#prezzo_max_alloggi").val(), '€ ' + numeral($("#prezzo_min_alloggi").val()).format('0,0')+' - € '+numeral($("#prezzo_max_alloggi").val()).format('0,0'));
6913	$("#prezzo_range_alloggi_filtro").slider('setValue',[parseInt($("#prezzo_min_alloggi").val()), parseInt($("#prezzo_max_alloggi").val())]);
6914	$("#prezzo_da_alloggi_filtro").val($("#prezzo_min_alloggi").val());
6915	$("#prezzo_a_alloggi_filtro").val($("#prezzo_max_alloggi").val());	 
6916	$("#prezzo_da_input_alloggi_filtro").val($("#prezzo_min_alloggi").val());
6917	$("#prezzo_a_input_alloggi_filtro").val($("#prezzo_max_alloggi").val());
6918	$("#prezzo_range_alloggi").slider('setValue',[parseInt(minPreAlloggi), parseInt(maxPreAlloggi)]);
6919	setInputNumberFormat($("#prezzo_min_alloggi").val(), 'prezzo_da_input_alloggi');
6920	setInputNumberFormat($("#prezzo_max_alloggi").val(), 'prezzo_a_input_alloggi');
6921	setInputNumberFormat($("#prezzo_min_alloggi").val(), 'prezzo_da_input_alloggi_filtro');
6922	setInputNumberFormat($("#prezzo_max_alloggi").val(), 'prezzo_a_input_alloggi_filtro');
6923
6924	$("#camere_range_alloggi_filtro").bootstrapSlider('setValue',[1, 10]);
6925	$("#camere_da_alloggi_filtro").val(1);
6926	$("#camere_a_alloggi_filtro").val(1000);
6927	$("#bagni_range_alloggi_filtro").bootstrapSlider('setValue',[1, 10]);
6928	$("#bagni_da_alloggi_filtro").val(1);
6929	$("#bagni_a_alloggi_filtro").val(1000);
6930	
6931	$('.filtriAlloggiCheckServizi').each(function () {
6932		$('.filtriAlloggiCheckServizi').prop('checked', false);
6933		$('.filtriAlloggiCheckLabelServizi').css('border', '1px solid #ed6b62');
6934		$('.filtriAlloggiCheckLabelServizi').css('color', '#ed6b62');
6935	});
6936	
6937	$('.filtriAlloggiCheckMustHave').each(function () {
6938		$('.filtriAlloggiCheckMustHave').prop('checked', false);
6939		$('.filtriAlloggiCheckLabelMustHave').css('border', '1px solid #ed6b62');
6940		$('.filtriAlloggiCheckLabelMustHave').css('color', '#ed6b62');
6941	});
6942
6943	
6944	$('#tipologie_alloggiBtn').html('What kind of housing are you looking for?');
6945	/*$('#tipologie_alloggiBtn').css('color', '#fff');
6946	$('#tipologie_alloggiBtn').css('opacity', '0.3');*/
6947	$('#tipologie_alloggiBtn').css('color', '#9b9a9e');
6948	$('#tipologie_alloggiBtn').css('opacity', '1');
6949	$('.cleantipologie_alloggi').remove();
6950
6951	$('#aree_alloggiBtn').html('Where would you like to go?');
6952	/*$('#aree_alloggiBtn').css('color', '#fff');
6953	$('#aree_alloggiBtn').css('opacity', '0.3');*/
6954	$('#aree_alloggiBtn').css('color', '#9b9a9e');
6955	$('#aree_alloggiBtn').css('opacity', '1');
6956	$('.cleanaree_alloggi').remove();
6957
6958	$('#daterange_alloggi_filtro').val('');
6959	$('.cleandateAlloggi').remove();
6960
6961	$('#ospitiAlloggiInputNumber_filtro').val(0);
6962
6963	$('#ricerca_liberaAlloggi').val('');
6964	$('#ricerca_liberaAlloggiMobile').val('');
6965	$('#tipologie_alloggi').val('');
6966	$('#aree_alloggi').val('');
6967	$('#must_have_alloggi').val('');
6968	$('#daterange_alloggi').val('');
6969	$('#ospiti_alloggi').val('');
6970	$('#camere_alloggi').val('1-1000');
6971	$('#bagni_alloggi').val('1-1000');
6972	$('#prezzo_alloggi').val($("#prezzo_min_alloggi").val()+'-'+$("#prezzo_max_alloggi").val());
6973	$('#animals_allowed_alloggi').val('');
6974	$('#sauna_alloggi').val('');
6975	$('#bike_alloggi').val('');
6976	$('#gym_alloggi').val('');
6977	$('#golf_alloggi').val('');
6978	$('#pool_alloggi').val('');
6979	$('#tennis_alloggi').val('');
6980	$('#smart_working_alloggi').val('');
6981	$('#wifi_alloggi').val('');
6982	$('#barrier_free_alloggi').val('');
6983	$('#fenced_garden_alloggi').val('');
6984	$('#air_conditioned_alloggi').val('');
6985	$('#safe_for_kids_alloggi').val('');
6986	$('#eco_friendly_alloggi').val('');
6987	$('#jacuzzi_alloggi').val('');
6988	$('#fireplace_alloggi').val('')
6989    $('#virtual_tour_alloggi').val('');
6990    $('#video_alloggi').val('');
6991
6992	refreshTotAlloggi();	
6993
6994	refreshSlugAlloggi();
6995}
6996
6997$('#filtriModal').on('show.bs.offcanvas', function (e) {
6998	setTimeout(function(){
6999		$("#camere_range_immobili_filtro").bootstrapSlider('refresh');
7000		$("#bagni_range_immobili_filtro").bootstrapSlider('refresh');
7001		$("#camere_range_alloggi_filtro").bootstrapSlider('refresh');
7002		$("#bagni_range_alloggi_filtro").bootstrapSlider('refresh');
7003	}, 100);
7004	$("#stickyMenu").addClass("hidden");
7005	$("#stickyMenuMobile").addClass("hidden");
7006	$("#back-to-top").addClass("hidden");
7007})
7008$('#filtriModal').on('hidden.bs.offcanvas', function (e) {
7009	$("#stickyMenu").removeClass("hidden");
7010	$("#stickyMenuMobile").removeClass("hidden");
7011	$("#back-to-top").removeClass("hidden");
7012})
7013
7014$('#modal_gallery_fs').on('show.bs.modal', function (e) {
7015	$("#stickyMenu").addClass("hidden");
7016	$("#stickyMenuMobile").addClass("hidden");
7017	$('#back-to-top-mobile').addClass('hidden');
7018	
7019	$('#modal_gallery_fs').css("overflow-y","auto");
7020	$('#modal_gallery_fs').css("overflow-y","auto");
7021	$('#modal_gallery_fs .modal-body').css("overflow-y","auto");
7022	
7023	$('html').css("overflow-y","hidden");
7024})
7025
7026$('#modal_gallery_fs').on('hidden.bs.modal', function (e) {
7027	$("#stickyMenu").removeClass("hidden");
7028	$("#stickyMenuMobile").removeClass("hidden");
7029	$('html').css("overflow-y","auto");
7030})
7031
7032$('#modal-contenuti-sotto-login').on('show.bs.modal', function (e) {
7033	$('html').css("overflow-y","hidden");
7034	$('#modal-contenuti-sotto-login').css("overflow-y","auto");
7035})
7036
7037$('#modal-contenuti-sotto-login').on('hidden.bs.modal', function (e) {
7038	$('html').css("overflow-y","auto");
7039	$('#modal-contenuti-sotto-login').css("overflow-y","hidden");
7040})
7041
7042$("#prezzo_alloggiBtn").click(function() {
7043	$("#tipologie_alloggi_multiselect ").removeClass("show");
7044});
7045
7046$("#tipologie_alloggiBtn").click(function() {
7047	$("#prezzoAlloggiSlider").removeClass("show");
7048});
7049
7050$(".filterLink").click(function() {
7051	activeTypeSearchOffcanvas(session_type_search_active);
7052});
7053
7054$(document).on('click','.cleantipologie_immobili',function () {
7055	$('#tipologie_immobili').val('');
7056	listaTipologieImmobili(false);
7057	listaAreeImmobili(false);
7058    listaRegioniImmobili(false);
7059    listaProvinceImmobili(false);
7060    listaComuniImmobili(false);
7061        	newSlug = refreshSlugImmobili();
7062              		submitCercaImmobili(newSlug, true);
7063            	$('#tipologie_immobiliBtn').html('What kind of property are you looking for?');
7064	/*$('#tipologie_immobiliBtn').css('color', '#fff');
7065	$('#tipologie_immobiliBtn').css('opacity', '0.3');*/
7066	$('#tipologie_immobiliBtn').css('color', '#9b9a9e');
7067	$('#tipologie_immobiliBtn').css('opacity', '1');
7068	
7069	$('.cleantipologie_immobili').remove();
7070
7071	$("input.tipologie_immobiliCheck[type=checkbox]").prop("checked", false);
7072	$("input.tipologie_immobiliCheck_filtro[type=checkbox]").prop("checked", false);
7073	$("#tipologie_immobiliCheckAll").prop("checked", false);
7074	$("#tipologie_immobiliCheckAll_filtro").prop("checked", false);
7075});
7076
7077$(document).on('click','.cleanlocations_immobili',function () {
7078	$('#aree_immobili').val('');
7079	$('#regioni_immobili').val('');
7080	$('#province_immobili').val('');
7081	$('#comuni_immobili').val('');
7082	$('#collapseAccordionOffcanvasAreeImmobili').removeClass("show");
7083	$('#collapseAccordionOffcanvasRegioniImmobili').removeClass("show");
7084	$('#collapseAccordionOffcanvasProvinceImmobili').removeClass("show");
7085	$('#collapseAccordionOffcanvasComuniImmobili').removeClass("show");
7086	listaTipologieImmobili(false);
7087	listaAreeImmobili(false);
7088    listaRegioniImmobili(false);
7089    listaProvinceImmobili(false);
7090    listaComuniImmobili(false);
7091        	newSlug = refreshSlugImmobili();
7092    	      		submitCercaImmobili(newSlug, true);
7093            	$('#locations_immobiliBtn').html('Where do you search?');
7094	/*$('#locations_immobiliBtn').css('color', '#fff');
7095	$('#locations_immobiliBtn').css('opacity', '0.3');*/
7096	$('#locations_immobiliBtn').css('color', '#9b9a9e');
7097	$('#locations_immobiliBtn').css('opacity', '1');
7098	
7099	$('.cleanlocations_immobili').remove();
7100
7101	$("input.aree_immobiliCheckParent[type=checkbox]").prop("checked", false);
7102	$("input.aree_immobiliCheckParent_filtro[type=checkbox]").prop("checked", false);
7103	$("input.aree_immobiliCheck[type=checkbox]").prop("checked", false);
7104	$("input.aree_immobiliCheck_filtro[type=checkbox]").prop("checked", false);
7105	$("#aree_immobiliCheckAll").prop("checked", false);
7106	$("#aree_immobiliCheckAll_filtro").prop("checked", false);
7107	
7108	$("input.regioni_immobiliCheckParent[type=checkbox]").prop("checked", false);
7109	$("input.regioni_immobiliCheckParent_filtro[type=checkbox]").prop("checked", false);
7110	$("input.regioni_immobiliCheck[type=checkbox]").prop("checked", false);
7111	$("input.regioni_immobiliCheck_filtro[type=checkbox]").prop("checked", false);
7112	$("#regioni_immobiliCheckAll").prop("checked", false);
7113	$("#regioni_immobiliCheckAll_filtro").prop("checked", false);
7114	
7115	$("input.province_immobiliCheckParent[type=checkbox]").prop("checked", false);
7116	$("input.province_immobiliCheckParent_filtro[type=checkbox]").prop("checked", false);
7117	$("input.province_immobiliCheck[type=checkbox]").prop("checked", false);
7118	$("input.province_immobiliCheck_filtro[type=checkbox]").prop("checked", false);
7119	$("#province_immobiliCheckAll").prop("checked", false);
7120	$("#province_immobiliCheckAll_filtro").prop("checked", false);
7121	
7122	$("input.comuni_immobiliCheckParent[type=checkbox]").prop("checked", false);
7123	$("input.comuni_immobiliCheckParent_filtro[type=checkbox]").prop("checked", false);
7124	$("input.comuni_immobiliCheck[type=checkbox]").prop("checked", false);
7125	$("input.comuni_immobiliCheck_filtro[type=checkbox]").prop("checked", false);
7126	$("#comuni_immobiliCheckAll").prop("checked", false);
7127	$("#comuni_immobiliCheckAll_filtro").prop("checked", false);
7128});
7129
7130$(document).on('click','.cleantipologie_alloggi',function () {
7131	$('#tipologie_alloggi').val('');
7132	listaAreeAlloggi(false);
7133        	newSlug = refreshSlugAlloggi();
7134    	submitCercaAlloggi(newSlug, true);
7135    	$('#tipologie_alloggiBtn').html('What kind of housing are you looking for?');
7136	/*$('#tipologie_alloggiBtn').css('color', '#fff');
7137	$('#tipologie_alloggiBtn').css('opacity', '0.3');*/
7138	$('#tipologie_alloggiBtn').css('color', '#9b9a9e');
7139	$('#tipologie_alloggiBtn').css('opacity', '1');
7140	
7141	$('.cleantipologie_alloggi').remove();
7142
7143	$("input.tipologie_alloggiCheck[type=checkbox]").prop("checked", false);
7144	$("input.tipologie_alloggiCheck_filtro[type=checkbox]").prop("checked", false);
7145	$("#tipologie_alloggiCheckAll").prop("checked", false);
7146	$("#tipologie_alloggiCheckAll_filtro").prop("checked", false);
7147});
7148
7149$(document).on('click','.cleanaree_alloggi',function () {
7150	$('#aree_alloggi').val('');
7151	listaTipologieAlloggi(false);
7152        	newSlug = refreshSlugAlloggi();
7153    	submitCercaAlloggi(newSlug, true);
7154    	$('#aree_alloggiBtn').html('Where would you like to go?');
7155	/*$('#aree_alloggiBtn').css('color', '#fff');
7156	$('#aree_alloggiBtn').css('opacity', '0.3');*/
7157	$('#aree_alloggiBtn').css('color', '#9b9a9e');
7158	$('#aree_alloggiBtn').css('opacity', '1');
7159	
7160	$('.cleanaree_alloggi').remove();
7161
7162	$("input.aree_alloggiCheck[type=checkbox]").prop("checked", false);
7163	$("input.aree_alloggiCheck_filtro[type=checkbox]").prop("checked", false);
7164	$("input.aree_alloggiCheckSub[type=checkbox]").prop("checked", false);
7165	$("input.aree_alloggiCheckSub_filtro[type=checkbox]").prop("checked", false);
7166	$("#aree_alloggiCheckAll").prop("checked", false);
7167	$("#aree_alloggiCheckAll_filtro").prop("checked", false);
7168});
7169
7170$(document).on('click','.cleanprezzo_alloggi',function () {
7171	$('#prezzo_alloggi').val('');
7172	$('#prezzo_alloggiBtn').html('€');
7173	/*$('#prezzo_alloggiBtn').css('color', '#fff');
7174	$('#prezzo_alloggiBtn').css('opacity', '0.3');*/
7175	$('#prezzo_alloggiBtn').css('color', '#9b9a9e');
7176	$('#prezzo_alloggiBtn').css('opacity', '1');
7177	
7178	$('.cleanprezzo_alloggi').remove();
7179});
7180
7181$(document).on('click','.cleandate_alloggi',function () {
7182	$('#daterange_alloggi').val('');
7183	$('#daterange_alloggi_filtro').val('');
7184	$('#daterange_alloggi_filtro').attr("placeholder", 'When do you wish to go?');
7185	
7186	$('.cleandate_alloggi').remove();
7187});
7188
7189	
7190	if(session_type_search_active == 1){
7191    	listaTipologieImmobili(false);
7192    	listaAreeImmobili(false);
7193        listaRegioniImmobili(false);
7194        listaProvinceImmobili(false);
7195        listaComuniImmobili(false);
7196        
7197    	listaPrezziImmobili();
7198    	listaPrezziAlloggi();
7199    	
7200    	listaSuperficiImmobili();
7201    	listaTerreniImmobili();
7202    	setCamereImmobili();
7203    	setBagniImmobili();
7204    	setFiltriImmobili();
7205    	
7206    	listaTipologieAlloggi(false);
7207    	listaAreeAlloggi(false);
7208    	setCamereAlloggi();
7209    	setBagniAlloggi();
7210    	setDaterangeAlloggi();
7211    	setOspitiAlloggi();
7212    	setFiltriAlloggi();
7213    	setMustHaveAlloggi();
7214	}
7215	else{
7216    	listaTipologieAlloggi(false);
7217    	listaAreeAlloggi(false);
7218    	
7219    	listaPrezziAlloggi();
7220    	listaPrezziImmobili();
7221    	
7222    	setCamereAlloggi();
7223    	setBagniAlloggi();
7224    	setDaterangeAlloggi();
7225    	setOspitiAlloggi();
7226    	setFiltriAlloggi();
7227    	setMustHaveAlloggi();
7228
7229    	listaTipologieImmobili(false);
7230    	listaAreeImmobili(false);
7231        listaRegioniImmobili(false);
7232        listaProvinceImmobili(false);
7233        listaComuniImmobili(false);
7234
7235    	listaSuperficiImmobili();
7236    	listaTerreniImmobili();
7237    	setCamereImmobili();
7238    	setBagniImmobili();
7239    	setFiltriImmobili();
7240	}
7241	
7242	
7243</script>
7243    
7243<script>
7244
7245function printAlloggiHtmlIcons(alloggi, i) {	
7246	var firstIcon = false;
7247	html = '';
7248
7249	if(alloggi[i].maxcapacity){
7250		html += '<span data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="'+alloggi[i].maxcapacity+' Sleeps">';
7251			html += '<i class="fa-solid fa-bed-front"></i><span class="iconWithNumber">'+alloggi[i].maxcapacity+'</span>';
7252		html += '</span>';
7253		firstIcon = true;
7254	}
7255	if((alloggi[i].sharedpool_units) || (alloggi[i].fencedpool_units) || (alloggi[i].privatepool_units)){
7256		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Swimming pool">';
7257			html += '<i class="fa-solid fa-water-ladder"></i>';
7258		html += '</span>';
7259		firstIcon = true;
7260	}
7261	if(alloggi[i].internetwifi_units == true){
7262		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Wi-Fi">';
7263			html += '<i class="fa-solid fa-wifi"></i>';
7264		html += '</span>';
7265		firstIcon = true;
7266	}
7267	if(alloggi[i].smartworking_units == true){
7268		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Smart-working space">';
7269			html += '<i class="fa-solid fa-house-laptop"></i>';
7270		html += '</span>';
7271		firstIcon = true;
7272	}
7273	if(alloggi[i].airconditioned_units == true){
7274		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Air conditioning">';
7275			html += '<i class="fa-solid fa-air-conditioner"></i>';
7276		html += '</span>';
7277		firstIcon = true;
7278	}
7279	if(alloggi[i].pets_allowed_flag != 0){
7280		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Take your pet">';
7281			html += '<i class="fa-solid fa-paw"></i>';
7282		html += '</span>';
7283		firstIcon = true;
7284	}
7285	if(alloggi[i].ecofriendly_units == true){
7286		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Eco-friendly">';
7287			html += '<i class="fa-solid fa-leaf-heart"></i>';
7288		html += '</span>';
7289		firstIcon = true;
7290	}
7291	if(alloggi[i].sauna_units == true){
7292		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Sauna">';
7293			html += '<i class="fa-solid fa-heat"></i>';
7294		html += '</span>';
7295		firstIcon = true;
7296	}
7297	if(alloggi[i].tennis_groups == true){
7298		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Tennis court">';
7299			html += '<i class="fa-solid fa-tennis-ball"></i>';
7300		html += '</span>';
7301		firstIcon = true;
7302	}
7303	if(alloggi[i].bike_groups == true){
7304		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Bicycle">';
7305			html += '<i class="fa-solid fa-bicycle"></i>';
7306		html += '</span>';
7307		firstIcon = true;
7308	}
7309	if(alloggi[i].gym_groups == true){
7310		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Gym">';
7311			html += '<i class="fa-solid fa-dumbbell"></i>';
7312		html += '</span>';
7313		firstIcon = true;
7314	}
7315	if(alloggi[i].fireplace_units == true){
7316		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Fireplace">';
7317			html += '<i class="fa-solid fa-fireplace"></i>';
7318		html += '</span>';
7319		firstIcon = true;
7320	}
7321	if(alloggi[i].golf_groups == true){
7322		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Golf course">';
7323			html += '<i class="fa-solid fa-golf-flag-hole"></i>';
7324		html += '</span>';
7325		firstIcon = true;
7326	}
7327	if(alloggi[i].isbarrierfree_units == true){
7328		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Barrier-Free">';
7329			html += '<i class="fa-solid fa-wheelchair-move"></i>';
7330		html += '</span>';
7331		firstIcon = true;
7332	}
7333	//if((alloggi[i].jacuzzi_units == true) || (alloggi[i].bathroomsjacuzzi_units == true)){
7334	if(alloggi[i].jacuzzi_units == true){
7335		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Jacuzzi">';
7336			html += '<i class="fa-solid fa-hot-tub-person"></i>';
7337		html += '</span>';
7338		firstIcon = true;
7339	}
7340	if(alloggi[i].fencedgarden_groups == true){
7341		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Enclosed garden">';
7342			html += '<i class="fa-solid fa-fence"></i>';
7343		html += '</span>';
7344		firstIcon = true;
7345	}
7346	if(alloggi[i].childok_units == true){
7347		html += '<span '+(firstIcon == true ? 'class="marginLeftIcons"' : '')+' data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="Equipped for children">';
7348			html += '<i class="fa-solid fa-baby-carriage"></i>';
7349		html += '</span>';
7350		firstIcon = true;
7351	}
7352	return html;
7353}
7354
7355</script>
7355    
7356	
7356<script>
7357
7358	var el = document.createElement('script');
7359    el.type = 'application/ld+json';
7360    el.text = '';
7361    var schemaAlloggiJsonArray = '{"@context": {"@vocab": "https://schema.org/"},"@graph": []}';
7362    var obj;
7363    obj = JSON.parse(schemaAlloggiJsonArray);
7364    
7365	if($(window).width() > 992){    	
7366		setDivFullscreenTopPage('alloggi');  
7367	}		
7368	else{
7369		$('.divImgFullscreenTopPage').css('height', 'auto');
7370	}	
7371	
7372    function scrollHeaderlistener(){
7373    	/*
7374    	if (window.scrollY != 0){
7375    		$('#navbar').attr('style', 'padding-top: 0px !important; padding-bottom: 0px !important');
7376    	}
7377    	else{
7378    		$('#navbar').attr('style', 'padding-top: 0.5rem !important; padding-bottom: 0.5rem !important');
7379    	}
7380    	*/
7381    	
7382                	if (window.scrollY > $('#navbar').outerHeight()) {
7383        		document.getElementById('divRicerca').classList.add('fixed-top-important');
7384        		navbar_height = document.querySelector('.navbar').offsetHeight;
7385        		document.body.style.paddingTop = navbar_height + 'px';
7386        		$('.headerList').attr('style', 'margin-top: 108px');
7387        	} else {
7388        	 	document.getElementById('divRicerca').classList.remove('fixed-top-important');
7389        		document.body.style.paddingTop = '0';
7390        		$('.headerList').attr('style', 'margin-top: 0');
7391        	} 
7392        
7393    }
7394
7395	if(document.getElementById('divRicerca')){
7396		if($(window).width() > 992){   
7397			document.addEventListener("DOMContentLoaded", function(){
7398				window.addEventListener('scroll', scrollHeaderlistener);
7399			}); 
7400		}
7401		else{
7402			window.removeEventListener('scroll', scrollHeaderlistener);
7403		}	
7404	}
7405
7406   	var map;
7407   	var marker_alloggi_id = new Array();
7408   	var marker_array = new Array();
7409   	var marker_group;
7410
7411    var icon = L.icon({
7412        iconUrl: _root_web + '/img/icone/icon_immobile.png',
7413        iconSize:     [40, 40], 
7414        iconAnchor:   [20, 20], 
7415        popupAnchor:  [0, -20] 
7416    });
7417    var iconSelected = L.icon({
7418        iconUrl: _root_web + '/img/icone/icon_alloggio_selected.png',
7419        iconSize:     [40, 40], 
7420        iconAnchor:   [20, 20], 
7421        popupAnchor:  [0, -20] 
7422    });
7423    
7424   	var markers_alloggi = new L.markerClusterGroup({
7425		spiderfyOnMaxZoom: true,
7426	    showCoverageOnHover: false,
7427	    zoomToBoundsOnClick: true
7428	});
7429	
7430	function appendBanner(){
7431		var html = '';
7432		
7433		if(session_tipo_vista_lista_gbl ==  1){
7434        	html += '<div class="col-lg-6 col-md-12 py-3">';
7435    			html += '<div class="position-relative">';
7436    	    		img = _img_standard_sm;
7437    	    		html += '<img data-src="'+img+'" class="lazyload">';
7438                html += '</div>';
7439        	html += '</div>';
7440        	html += '<div class="col-lg-6 col-md-12 py-3 dettagli">';
7441        		html += '<div class="row">';
7442        			html += '<div class="col-lg-12 col-md-12 p-0" style="top: 50%; transform: translateY(-50%); position: absolute; font-size: 3rem;">';
7443						html += 'BANNER';
7444                    html += '</div>';
7445                html += '</div>';
7446        		html += '<div class="row">';
7447        			html += '<div class="col-lg-12 col-md-12 p-0">';
7448        			
7449        			html += '</div>';
7450    			html += '</div>';
7451        	html += '</div>';
7452		}
7453		else if(session_tipo_vista_lista_gbl ==  2){
7454    		html += '<div class="card">';
7455    			html += '<div class="position-relative">';
7456    	    		img = _img_standard_sm;
7457    	    		html += '<img data-src="'+img+'" class="lazyload">';
7458				html += '</div>';
7459            	html += '<div class="dettagli" style="font-size: 2rem; text-align: center;">';
7460            		html += '<div>';
7461                        html += 'BANNER';
7462    	    		html += '</div>';
7463    	    	html += '</div>';
7464        	html += '</div>';
7465		}
7466		
7467		return html;
7468	}
7469	
7470	var carousel_box = new Array();
7471	
7472	function listaAlloggi(session_tipo_vista_lista, session_numero_pagina_risultati, session_index_numero_risultati_per_pagina, session_ordinamento_lista_risultati, scrollToTop) {	
7473    	var ggPubblicazione;
7474    	var alloggiDataParams = {};
7475		
7476		carousel_box = new Array();
7477		
7478		if(session_ordinamento_lista_risultati >= 4){
7479			session_ordinamento_lista_risultati = 1;
7480		}
7481
7482		if($(window).width() <= 992){   
7483			if(session_tipo_vista_lista == 1){
7484				session_tipo_vista_lista = 2;
7485			}
7486		}
7487		
7488    	session_tipo_vista_lista_gbl = session_tipo_vista_lista;
7489    	session_numero_pagina_risultati_gbl = session_numero_pagina_risultati;
7490    	session_index_numero_risultati_per_pagina_gbl = session_index_numero_risultati_per_pagina;
7491    	session_ordinamento_lista_risultati_gbl = session_ordinamento_lista_risultati;
7492
7493    	bootstrap.Modal.getOrCreateInstance(document.getElementById('sortMobile')).hide();
7494
7495		var button_view_mobile_html = '';
7496		//button_view_mobile_html += '<button class="button_tipi_vista_lista_alloggi_mobile" onClick="activeTypeSearchOffcanvas(' + session_type_search_active + ');" data-bs-toggle="offcanvas" data-bs-target="#filtriModal" aria-controls="filtriModal"><i class="fa-solid fa-sliders"></i></button>';
7497		button_view_mobile_html += '<div id="buttons_view_mobile_div">';
7498			button_view_mobile_html += '<button aria-label="List" class="button_tipi_vista_lista_alloggi_mobile" id="button_tipo_vista_lista_mobile_2" onclick="listaAlloggi(2, 1, 0, session_ordinamento_lista_risultati_gbl, false);"><i id="tipo_vista_lista_mobile_2" class="tipi_vista_lista_alloggi_mobile fa-solid fa-list"></i></button>';
7499			button_view_mobile_html += '<button aria-label="Map" class="button_tipi_vista_lista_alloggi_mobile" id="button_tipo_vista_lista_mobile_3" onclick="listaAlloggi(3, 1, 0, session_ordinamento_lista_risultati_gbl, false);"><i id="tipo_vista_lista_mobile_3" class="tipi_vista_lista_alloggi_mobile fa-solid fa-map-location"></i></button>';	
7500		button_view_mobile_html += '</div>';
7501		$("#button_view_mobile").html(button_view_mobile_html);
7502		
7503    	if(session_ordinamento_lista_risultati == 1){
7504        	$("#button_sort_mobile").html('<i class="fa-solid fa-wand-magic-sparkles"></i><div>Recommended</div>');
7505        	$("#menu_ordinamentiBtn").empty().append('<i id="tipo_ordinamento_1" class="tipi_ordinamenti fa-solid fa-wand-magic-sparkles active"></i><div>Recommended</div>');
7506    	}
7507    	else if(session_ordinamento_lista_risultati == 2){
7508    		$("#button_sort_mobile").html('<i class="fa-solid fa-circle-dollar"></i><div>Lowest price</div>');
7509    		$("#menu_ordinamentiBtn").empty().append('<i id="tipo_ordinamento_2" class="tipi_ordinamenti fa-solid fa-circle-dollar"></i><div>Lowest price</div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i id="tipo_ordinamento_2_2" class="tipi_ordinamenti sort fa-solid fa-arrow-up"></i>');
7510    	}
7511    	else if(session_ordinamento_lista_risultati == 3){
7512    		$("#button_sort_mobile").html('<i class="fa-solid fa-circle-dollar"></i><div>Highest price</div>');
7513    		$("#menu_ordinamentiBtn").empty().append('<i id="tipo_ordinamento_3" class="tipi_ordinamenti fa-solid fa-circle-dollar"></i><div>Highest price</div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i id="tipo_ordinamento_3_3" class="tipi_ordinamenti sort fa-solid fa-arrow-down"></i>');
7514    	}
7515    	
7516    	$(".button_tipi_vista_lista_alloggi").removeClass("active");
7517    	$(".button_tipi_vista_lista_alloggi_mobile").removeClass("active");
7518    	$(".tipi_vista_lista_alloggi").removeClass("active");
7519    	$(".tipi_vista_lista_alloggi_mobile").removeClass("active");
7520    	$('.button_tipi_vista_lista_alloggi').prop("disabled", false);
7521    	$('.button_tipi_vista_lista_alloggi_mobile').prop("disabled", false);
7522    	$("#button_tipo_vista_lista_"+session_tipo_vista_lista).addClass("active");
7523    	$("#button_tipo_vista_lista_mobile_"+session_tipo_vista_lista).addClass("active");
7524    	$("#tipo_vista_lista_"+session_tipo_vista_lista).addClass("active");
7525    	$("#tipo_vista_lista_mobile_"+session_tipo_vista_lista).addClass("active");
7526    	$('#button_tipo_vista_lista_'+session_tipo_vista_lista).prop("disabled", true);
7527    	$('#button_tipo_vista_lista_mobile_'+session_tipo_vista_lista).prop("disabled", true);
7528
7529		$(".button_ordinamenti_alloggi_mobile").removeClass("active");
7530    	$(".tipi_ordinamenti").removeClass("active");
7531    	$(".tipi_ordinamenti_mobile").removeClass("active");
7532
7533    	$('.button_ordinamenti_alloggi_mobile').prop("disabled", false);
7534    	$("#button_ordinamento_"+session_ordinamento_lista_risultati).addClass("active");
7535    	$("#button_ordinamento_mobile_"+session_ordinamento_lista_risultati).addClass("active");
7536    	$("#tipo_ordinamento_"+session_ordinamento_lista_risultati).addClass("active");
7537    	$("#tipo_ordinamento_mobile_"+session_ordinamento_lista_risultati).addClass("active");
7538    	$("#tipo_ordinamento_"+session_ordinamento_lista_risultati+"_"+session_ordinamento_lista_risultati).addClass("active");
7539    	$("#tipo_ordinamento_mobile_"+session_ordinamento_lista_risultati+"_"+session_ordinamento_lista_risultati).addClass("active");
7540        $('#button_ordinamento_'+session_ordinamento_lista_risultati).prop("disabled", true);
7541        $('#button_ordinamento_mobile_'+session_ordinamento_lista_risultati).prop("disabled", true);
7542        	
7543    	if(session_tipo_vista_lista == 3){
7544    		$('#paginationContainer').css('display', 'none');
7545    		$('#button_sort_mobile').css('display', 'none');
7546    	}
7547    	else{
7548    		if($(window).width() > 992){  
7549    			$('#button_sort_mobile').css('display', 'none');
7550    		}
7551    		else{
7552    			$('#button_sort_mobile').css('display', 'flex');
7553    		}
7554    	}
7555	   
7556    	alloggiDataParams['pagina'] = session_numero_pagina_risultati;
7557    	alloggiDataParams['ppagina'] = numero_risultati_per_pagina_array[session_tipo_vista_lista][session_index_numero_risultati_per_pagina]['risultati_per_pagina_back_end'];
7558    	alloggiDataParams['ordinamento'] = session_ordinamento_lista_risultati;
7559    	
7560    	if(tipologie_alloggi){
7561    		alloggiDataParams['tipologie'] = tipologie_alloggi;
7562    	}
7563    	if(aree_alloggi){
7564    		alloggiDataParams['aree'] = aree_alloggi;
7565    	}
7566    	if(must_have_alloggi){
7567    		alloggiDataParams['must_have'] = must_have_alloggi;
7568    	} 
7569    	if(session_daterange_alloggi){
7570    		let date = session_daterange_alloggi.split("-");
7571
7572    		let startD = moment(date[0], 'DD/MM/YYYY');
7573    		let endD = moment(date[1], 'DD/MM/YYYY');
7574			let gg_diff = endD.diff(startD, 'days');
7575    		
7576    		alloggiDataParams['data_da'] = startD.format('YYYY-MM-DD');
7577    		alloggiDataParams['data_a'] = endD.format('YYYY-MM-DD');
7578    		alloggiDataParams['gg_diff'] = gg_diff + 1;
7579    	}
7580    	if(session_ospiti_alloggi){
7581    		alloggiDataParams['numero_persone'] = session_ospiti_alloggi;
7582    	}
7583    	if(camere_alloggi){
7584    		let camereArray = camere_alloggi.split("-");
7585    		
7586    		alloggiDataParams['camere_da'] = camereArray[0];
7587    		alloggiDataParams['camere_a'] = camereArray[1];
7588    	}
7589    	if(bagni_alloggi){
7590    		let bagniArray = bagni_alloggi.split("-");
7591    		
7592    		alloggiDataParams['bagni_da'] = bagniArray[0];
7593    		alloggiDataParams['bagni_a'] = bagniArray[1];
7594    	}
7595    	if(prezzo_alloggi){
7596    		let prezzoArray = prezzo_alloggi.split("-");
7597    		
7598    		alloggiDataParams['prezzo_da'] = prezzoArray[0];
7599    		alloggiDataParams['prezzo_a'] = prezzoArray[1];
7600    	}
7601    	if(animals_allowed_alloggi){
7602    		alloggiDataParams['animals_allowed'] = true;
7603    	}
7604    	if(sauna_alloggi){
7605    		alloggiDataParams['sauna'] = true;
7606    	}
7607    	if(bike_alloggi){
7608    		alloggiDataParams['bike'] = true;
7609    	}
7610    	if(gym_alloggi){
7611    		alloggiDataParams['gym'] = true;
7612    	}
7613    	if(fireplace_alloggi){
7614    		alloggiDataParams['fireplace'] = true;
7615    	}
7616    	if(jacuzzi_alloggi){
7617    		alloggiDataParams['jacuzzi'] = true;
7618    	}
7619    	if(eco_friendly_alloggi){
7620    		alloggiDataParams['eco_friendly'] = true;
7621    	}
7622    	if(golf_alloggi){
7623    		alloggiDataParams['golf'] = true;
7624    	}
7625    	if(pool_alloggi){
7626    		alloggiDataParams['pool'] = true;
7627    	}
7628    	if(tennis_alloggi){
7629    		alloggiDataParams['tennis'] = true;
7630    	}
7631    	if(smart_working_alloggi){
7632    		alloggiDataParams['smart_working'] = true;
7633    	}
7634    	if(wifi_alloggi){
7635    		alloggiDataParams['wifi'] = true;
7636    	}       	
7637    	if(barrier_free_alloggi){
7638    		alloggiDataParams['barrier_free'] = true;
7639    	}     
7640    	if(fenced_garden_alloggi){
7641    		alloggiDataParams['fenced_garden'] = true;
7642    	}     
7643    	if(air_conditioned_alloggi){
7644    		alloggiDataParams['air_conditioned'] = true;
7645    	}   
7646    	if(safe_for_kids_alloggi){
7647    		alloggiDataParams['safe_for_kids'] = true;
7648    	}    
7649    	if(virtual_tour_alloggi){
7650    		alloggiDataParams['virtual_tour'] = true;
7651    	}
7652    	if(video_alloggi){
7653    		alloggiDataParams['video'] = true;
7654    	}
7655    	if(ricerca_libera_alloggi){
7656    		ricerca_libera_alloggi = ricerca_libera_alloggi.replace(/'/g, "\\'");
7657    		ricerca_libera_alloggi = ricerca_libera_alloggi.replace(/[$£°§ç@%#?!|+*=]/g, '');
7658    		if($(window).width() > 992){  
7659    			$('#ricerca_liberaAlloggi').val(ricerca_libera_alloggi.replace(/\\/g, ''));
7660    		}
7661    		else {
7662    			$('#ricerca_liberaAlloggiMobile').val(ricerca_libera_alloggi.replace(/\\/g, ''));
7663    		}
7664    		alloggiDataParams['ricerca_libera'] = ricerca_libera_alloggi;
7665    	}
7666    	
7667    	alloggiDataParams['tipo_vista'] = session_tipo_vista_lista_gbl;
7668    	
7669    	var url = _api+'greatestate/lista_alloggi/'+_lang;
7670    	
7671    	$.ajax({
7672            url: url,
7673            type: 'POST',	            
7674            crossDomain: true,     
7675            data: alloggiDataParams,	       
7676            xhrFields:
7677            {
7678                withCredentials: true
7679            },
7680            error: function (error) {
7681            	console.log(error);
7682            	setTitoloPaginaRicerca(0);
7683            	return;
7684            }
7685        }).done(function(json) {
7686            if((json.rows == undefined) || (json.rows.length == 0)){
7687            	setTitoloPaginaRicerca(0);
7688            	$('#contactBoxDiv').removeClass('hidden');
7689            	$('.headerList').addClass('hidden');
7690            	$('#alloggiList').addClass('hidden');
7691            	$('#alloggiListGrid').addClass('hidden');
7692            	$('#alloggiListMap').addClass('hidden');
7693            	$('#alloggiListMapHeader').addClass('hidden');
7694            	return;
7695            }
7696
7697    		if(scrollToTop){
7698    	    	$('html,body').animate({
7699    	        	scrollTop: $(".headerList").offset().top - 96
7700    	    	}, 200);
7701    		}
7702    		
7703        	var html = '';
7704        	var html_paginazione = '';
7705        	var html_paginazione_separatore = '<li><a href="#" class="linkPaginazione">...</a></li>';
7706        	var alloggiLenght = json.rows.length;
7707        	var alloggi = json.rows;
7708			var alias = '';
7709			var menu_numero_risultati_max = numero_risultati_per_pagina_array[session_tipo_vista_lista][0]['risultati_per_pagina_front_end'];
7710			var menu_index_numero_risultati_max = 0;
7711
7712			var tipologieArrayTemp = new Array();
7713			if($('#tipologie').val()){
7714				tipologieArrayTemp = $('#tipologie_alloggi').val().split(',');
7715			}
7716			
7717			$('#alloggiListMapHeader').addClass('hidden');
7718        	$("#alloggiList").empty();
7719        	$("#alloggiListGrid").empty();
7720
7721			setTitoloPaginaRicerca(alloggi[0].numero_alloggi);
7722			
7723			$("#menu_numero_risultati_per_paginaList").empty();
7724			
7725			if((session_tipo_vista_lista == 1) || (session_tipo_vista_lista == 2)){
7726    			for (var r = 0; r <= 3; r++) {
7727    				if(alloggi[0].numero_alloggi > numero_risultati_per_pagina_array[session_tipo_vista_lista][r]['risultati_per_pagina_back_end']){
7728    					if(r == session_index_numero_risultati_per_pagina){
7729    						$("#menu_numero_risultati_per_paginaList").append('<li><a href="#" class="dropdown-item active"><div>'+numero_risultati_per_pagina_array[session_tipo_vista_lista][r]['risultati_per_pagina_front_end']+' for page</div></a></li>');
7730    					}
7731    					else{
7732    						$("#menu_numero_risultati_per_paginaList").append('<li><a href="#" class="dropdown-item" onclick="listaAlloggi(session_tipo_vista_lista_gbl, 1, '+r+', session_ordinamento_lista_risultati_gbl, false);"><div>'+numero_risultati_per_pagina_array[session_tipo_vista_lista][r]['risultati_per_pagina_front_end']+' for page</div></a></li>');
7733    					}	
7734    					menu_numero_risultati_max = numero_risultati_per_pagina_array[session_tipo_vista_lista][r]['risultati_per_pagina_front_end'];
7735    					menu_index_numero_risultati_max = r;
7736    				}
7737    			}
7738    		}
7739
7740			if(alloggi[0].numero_alloggi >= numero_risultati_per_pagina_array[session_tipo_vista_lista][session_index_numero_risultati_per_pagina]['risultati_per_pagina_front_end']){
7741				$("#menu_numero_risultati_per_paginaBtn").empty().append('<div>'+numero_risultati_per_pagina_array[session_tipo_vista_lista][session_index_numero_risultati_per_pagina]['risultati_per_pagina_front_end']+' for page</div>');
7742			}
7743			else{
7744				$("#menu_numero_risultati_per_paginaBtn").empty().append('<div>'+menu_numero_risultati_max+' for page</div>');
7745				session_index_numero_risultati_per_pagina = menu_index_numero_risultati_max;
7746				session_index_numero_risultati_per_pagina_gbl = menu_index_numero_risultati_max;
7747			}
7748			
7749    	    $.ajax({
7750    	        url: _root_web + "/inc/session_set_lista.php",
7751    	        type: 'POST',
7752    	        data: {
7753    	        	session_tipo_vista_lista_post: session_tipo_vista_lista,
7754    	        	session_numero_pagina_risultati_post: session_numero_pagina_risultati,
7755    	        	session_index_numero_risultati_per_pagina_post: session_index_numero_risultati_per_pagina,
7756    	        	session_ordinamento_lista_risultati_post: session_ordinamento_lista_risultati	        	        
7757    	        },
7758    	        cache: false
7759    	    });   
7760    	    
7761        	if(session_tipo_vista_lista == 1){
7762        		$('#risultatiPerPaginaDiv').removeClass('hidden');
7763        		$('.headerList').removeClass('hidden');
7764            	$('#alloggiList').removeClass('hidden');
7765            	$('#alloggiListGrid').addClass('hidden');
7766        		$('#alloggiListMap').addClass('hidden');
7767        		
7768        		for (var i = 0; i < alloggiLenght; i++) {
7769        			html = '';
7770
7771            		if(alloggi[i].alias_it_ge_units_old){
7772            			alias = eval('alloggi[i].alias_'+_lang+'_ge_units_old');
7773            		}
7774            		else {
7775            			alias = eval('alloggi[i].alias_'+_lang+'_ge_units');
7776            		}
7777            		alias = alias.replaceAll(' ', '-');
7778            		alias = alias.replaceAll("'", '');
7779            		alias = alias.replaceAll('\\', '-');
7780            		alias = alias.replaceAll("’", '');	
7781            		alias = alias.replaceAll("-at", '-AT');
7782            		
7783            		html += '<div class="row alloggiListItem" id="'+alias+'">';
7784                    	html += '<div class="col-lg-6 col-md-12 py-3 alloggiListItemSx">';
7785        	    			html += '<div class="position-relative">';
7786            					ggPubblicazione = moment().diff(moment(alloggi[i].publication_date), 'days');
7787                				if(alloggi[i].in_offer_unit){
7788                					html += '<div class="inOffer">PROMO</div>';
7789                				}
7790                				if((ggPubblicazione <= 15) && (alloggi[i].in_offer_unit)){
7791                					html += '<div class="newLower">
7791NEW</div>';
7792                				}
7793                				else if(ggPubblicazione <= 15){
7794                					html += '<div class="new">NEW</div>';
7795                				}
7796                				if(alloggi[i].fully_staffed_unit){
7797                					html += '<div class="fullyStaffed">Fully Staffed</div>';
7798                				}
7799            					
7800            	    			if(alloggi[i].video_virtual_tour_it){
7801            	    				html += '<div class="videoAndVirtualTour">';
7802            	    				if((alloggi[i].video_virtual_tour_it).find(a => a.includes('youtu'))){
7803            	    					html += '<div class="fa-video-background"><i class="fa-solid fa-play"></i></div>';
7804            	    				}
7805            	    				if((alloggi[i].video_virtual_tour_it).find(a => a.includes('matterport')) || (alloggi[i].video_virtual_tour_it).find(a => a.includes('realisti'))){
7806            	    					html += '<div class="fa-video-background"><i class="fa-solid fa-360-degrees"></i> Virtual Tour</div>';
7807            	    				}
7808            	    				html += '</div>';
7809            	    			}
7810            	    			if(alloggi[i].id_immobile_in_vendita){
7811            	    				html += '<div class="inVendita">';
7812            	    					html += 'for sale';
7813            	    				html += '</div>';
7814            	    			}
7815            	    			html += '<a aria-label="Go to the Property\'s page '+alloggi[i].unit_name+'" class="anchorImg" href="'+alias+'">';
7816            	    				html += '<div class="alloggiListItemHover"></div>';
7817            	    				if(alloggi[i].foto_box.length > 1){
7818            	    					carousel_box.push('carousel_box_' + alloggi[i].unit_id);
7819            	    					html += '<div id="carousel_box_' + alloggi[i].unit_id + '" class="carousel slide" data-bs-touch="true">';
7820            	    						html += '<div class="carousel-inner">';
7821                	    					for (var s = 0; s < alloggi[i].foto_box.length; s++) {
7822                            	    			html += '<div class="carousel-item ' + (s == 0 ? 'active' : '') + '">';
7823                            	    				html += '<img alt="Cover photo of ' + alloggi[i].unit_name + '" data-src="' + getFotoWithWtmrk(_root_foto_wtmrk_gs+'/'+alloggi[i].group_id+'/'+alloggi[i].foto_box[s], "900x600") + '" class="lazyload">';
7824                            	    			html += '</div>';
7825                        	    			}
7826                        	    			html += '</div>';
7827                    	    				html += '<div class="carousel-indicators carousel-indicators-box">';
7828                    	    					for (var s = 0; s < alloggi[i].foto_box.length; s++) {
7829                    	    						html += '<button type="button" data-bs-target="#carousel_box_' + alloggi[i].unit_id + '" data-bs-slide-to="' + s + '" class="' + (s == 0 ? 'active' : '') + '" ' + (s == 0 ? 'aria-current="true"' : '') + ' aria-label="Gallery ' + (s + 1) + ' Property ' + alloggi[i].unit_id + '"></button>';
7830                    	    					}
7831                    	    				html += '</div>';
7832                    	    			html += '</div>';
7833            	    				}
7834            	    				else {
7835            	    					html += '<img alt="Cover photo of ' + alloggi[i].unit_name + '" data-src="' + getFotoWithWtmrk(_root_foto_wtmrk_gs+'/'+alloggi[i].group_id+'/'+alloggi[i].foto_copertina, "900x600") + '" class="lazyload">';
7836            	    				} 
7837                    			html += '</a>';
7838                            html += '</div>';
7839                    	html += '</div>';
7840                    	html += '<div class="col-lg-6 col-md-12 py-3 dettagli">';
7841                    		html += '<a aria-label="Go to the Property\'s page '+alloggi[i].unit_name+'" href="'+alias+'">';
7842                        		html += '<h2><b>'+alloggi[i].unit_name+'</b></h2>';
7843                            	if((alloggi[i].avg_reviews) && (parseFloat(alloggi[i].avg_reviews).toFixed(1) > 4)){
7844									html += '<div class="avg_reviews" style="display: none;">';
7845                            			html += '<div class="rating_alloggio" id="rating_' + alloggi[i].unit_id + '"></div>';
7846                            			html += '<span>(' + alloggi[i].number_reviews + ')</span>';
7847                            		html += '</div>';
7848
7849                            		if(alloggi[i].exclusive_property){
7850                            			html += '<div class="priceBottom"><b>Exclusive properties</b></div>';
7851                            			html += '<input type="hidden" id="prezzo_alloggio_' + alloggi[i].unit_id + '" value="Exclusive properties" >';
7852                            		}
7853                            		else{
7854                            			html += '<div class="priceBottom"><span>starting from</span> <b>€ '+numeral(parseInt(alloggi[i].prezzo)).format('0,0')+'</b> <span>a day</span></div>';
7855                            			//html += '<input type="hidden" id="prezzo_alloggio_' + alloggi[i].unit_id + '" value="starting from € '+numeral(parseInt(alloggi[i].prezzo)).format('0,0')+' a day" >';
7856                            			if(alloggi[i].prezzo){
7857                            				html += '<input type="hidden" id="prezzo_alloggio_' + alloggi[i].unit_id + '" value="starting from € '+numeral((alloggi[i].prezzo).replace('.00','')).format('0,0')+' a day" >';
7858                            			}
7859                            			else {
7860                            				html += '<input type="hidden" id="prezzo_alloggio_' + alloggi[i].unit_id + '" value="" >';
7861                            			}
7862                            		}
7863                            	}
7864                            	else {
7865                            		if(alloggi[i].exclusive_property){
7866                            			html += '<div class="price"><b>Exclusive properties</b></div>';
7867                            			html += '<input type="hidden" id="prezzo_alloggio_' + alloggi[i].unit_id + '" value="Exclusive properties" >';
7868                            		}
7869                            		else{
7870                            			html += '<div class="price"><span>starting from</span> <b>€ '+numeral(parseInt(alloggi[i].prezzo)).format('0,0')+'</b> <span>a day</span></div>';
7871                            			//html += '<input type="hidden" id="prezzo_alloggio_' + alloggi[i].unit_id + '" value="starting from € '+numeral(parseInt(alloggi[i].prezzo)).format('0,0')+' a day" >';
7872                            			if(alloggi[i].prezzo){
7873                            				html += '<input type="hidden" id="prezzo_alloggio_' + alloggi[i].unit_id + '" value="starting from € '+numeral((alloggi[i].prezzo).replace('.00','')).format('0,0')+' a day" >';
7874                            			}
7875                            			else {
7876                            				html += '<input type="hidden" id="prezzo_alloggio_' + alloggi[i].unit_id + '" value="" >';
7877                            			}
7878                            		}
7879                            	}	
7880                    			if(tipologieArrayTemp.length == 1){
7881                    				html += '<div>'+nomi_tipologie_alloggi[tipologieArrayTemp[0]][_lang]+'</div>';
7882                    			}
7883                    			else {
7884                    				html += '<div>'+eval('alloggi[i].label_'+_lang+'_diz_types')+'</div>';
7885                    			}	
7886                        		html += '<div class="location">';
7887                        			var location_hidden = '';
7888                            		if(alloggi[i].label_touristic_area_it){
7889                            			html += eval('alloggi[i].nome_regione_'+_lang)+' - '+eval('alloggi[i].label_touristic_area_'+_lang);
7890                            			location_hidden += eval('alloggi[i].nome_regione_'+_lang)+' - '+eval('alloggi[i].label_touristic_area_'+_lang);
7891                            		}
7892                            		else {
7893                            			html += eval('alloggi[i].nome_regione_'+_lang);
7894                            			location_hidden += eval('alloggi[i].nome_regione_'+_lang);
7895                            		}
7896                        		html += '</div>';
7897                    		html += '</a>';
7898        					html += '<div class="icons">';
7899        						html += printAlloggiHtmlIcons(alloggi, i);
7900        					html += '</div>';
7901        					html += '<a aria-label="Go to the Property\'s page '+alloggi[i].unit_name+'" class="anchorText" href="'+alias+'">';
7902            					html += '<div class="specs">';
7903                        			if(tipologieArrayTemp.length == 1){
7904                        				html += '<p>'+nomi_tipologie_alloggi[tipologieArrayTemp[0]][_lang]+'</p>';
7905                        			}
7906                        			else {
7907                        				html += '<p>'+eval('alloggi[i].label_'+_lang+'_diz_types')+'</p>';
7908                        			}
7909            						if(alloggi[i].square_meters){
7910                						html += '<p>'+alloggi[i].square_meters+' sqm</p>';
7911            						}
7912            						if(alloggi[i].bedroomsnumber){
7913                						if(alloggi[i].bedroomsnumber == 1){
7914                							html += '<p>'+alloggi[i].bedroomsnumber+' Bedroom</p>';
7915                						}
7916                						else{
7917                    						html += '<p>'+alloggi[i].bedroomsnumber+' Bedrooms</p>';
7918                						}
7919            						}
7920            						if(alloggi[i].bathroomsnumber){
7921                						if(alloggi[i].bathroomsnumber == 1){
7922                							html += '<p>'+alloggi[i].bathroomsnumber+' Bathroom</p>';
7923                						}
7924                						else{
7925                    						html += '<p>'+alloggi[i].bathroomsnumber+' Bathrooms</p>';
7926                						}
7927            						}
7928            					html += '</div>';
7929            					if(alloggi[i].unit_short_description_it){
7930                        	        if(eval('alloggi[i].unit_short_description_'+_lang).length > limitCharDescBreveLista) {
7931                        	            var c = eval('alloggi[i].unit_short_description_'+_lang).substr(0, limitCharDescBreveLista);
7932                        	            var lastDot = c.lastIndexOf(".") + 1;
7933                        	            c = eval('alloggi[i].unit_short_description_'+_lang).substr(0, lastDot);
7934
7935                        	           	de = c.replace(regex_description, '<br>');
7936    									html += '<div class="description">' + de + '</div>';
7937                    		        }
7938                        	        else{
7939                        	        	de = eval('alloggi[i].unit_short_description_'+_lang).replace(regex_description, '<br>');
7940                        	        	html += '<div class="description">' + de + '</div>';
7941                        	        }
7942            					}
7943            				html += '</a>';
7944        					html += '<div class="buttonsSx">';
7945        						html += '<button type="button" class="btn btn-primary" onclick="apriModalRichiediInfoAlloggi(' + alloggi[i].unit_id + ', \'' + alias + '\');">Ask for information</button>';
7946        						html += '<input type="hidden" id="nome_alloggio_' + alloggi[i].unit_id + '" value="' + alloggi[i].unit_name + '" >';
7947        						html += '<input type="hidden" id="tipologia_alloggio_' + alloggi[i].unit_id + '" value="' + eval('alloggi[i].label_'+_lang+'_diz_types') + '" >';
7948        						html += '<input type="hidden" id="foto_alloggio_' + alloggi[i].unit_id + '" value="' + getFotoWithWtmrk(_root_foto_wtmrk_gs+'/'+alloggi[i].group_id+'/'+alloggi[i].foto_copertina, "525x350") + '" >';
7949        						html += '<input type="hidden" id="location_alloggio_' + alloggi[i].unit_id + '" value="' + location_hidden + '" >';
7950        					html += '</div>';
7951        					html += '<div class="buttonsRx">';
7952        						html += '<a aria-label="Share the listing" href="javascript:void(0)" onclick="apriModalCondividiPagineRicerca(2, 2, ' + alloggi[i].unit_id + ', \'' + alias + '\');"><i class="fa-solid fa-share-nodes"></i></a>';
7953        					html += '</div>';
7954                    	html += '</div>';
7955                    html += '</div>';
7956                    
7957                    /*
7958    				if((i == 3) && (session_numero_pagina_risultati_gbl == 1)){
7959    					html += '<div class="row alloggiListItem banner">';
7960    						html += appendBanner();
7961    					html += '</div>';
7962    				}
7963    				*/
7964    				
7965                    $("#alloggiList").append(html);	 
7966                    
7967                    if(alloggi[i].foto_copertina){
7968                    	obj['@graph'].push({
7969                        	"@type" : "VacationRental",
7970                        	"identifier": {
7971            	            	"@type" : "PropertyValue", 
7972            	            	"propertyID" : "Code", 
7973            	            	"value" : alloggi[i].unit_id
7974            	            }, 
7975            	            "name" : alloggi[i].nome, 
7976            	            "description" : eval('alloggi[i].unit_short_description_'+_lang), 
7977            	            "image" : alloggi[i].foto_copertina, 
7978            	            "url" : alias
7979            			});
7980                    }else{
7981                    	obj['@graph'].push({
7982                        	"@type" : "VacationRental", 
7983                        	"identifier": {
7984            	            	"@type": "PropertyValue", 
7985            	            	"propertyID": "Code", 
7986            	            	"value":  alloggi[i].unit_id
7987            	            }, 
7988            	            "name" : alloggi[i].nome, 
7989            	            "description" : eval('alloggi[i].unit_short_description_'+_lang), 
7990            	            "url" : alias
7991            			});
7992                    }
7993        		}
7994    			
7995				for (var i = 0; i < alloggiLenght; i++) {
7996                    if((alloggi[i].avg_reviews) && (parseFloat(alloggi[i].avg_reviews).toFixed(1) > 4)){
7997        	        	$('#rating_' + alloggi[i].unit_id).raty({ 
7998                            path: _root_cdn + '/img',
7999                            starOff : 'star-off-pink.png',
8000                            starOn  : 'star-on-pink.png',
8001                            starHalf: 'star-half-pink.png',
8002        	        		halfShow: true,
8003        	        		readOnly: true,
8004        	        		score: parseFloat(alloggi[i].avg_reviews).toFixed(1)
8005        	        	});
8006                    }
8007				}
8008				$(".avg_reviews").fadeIn("fast");
8009    			
8010        		$('#paginationContainer').css('display', 'block');
8011        	}
8012        	else if(session_tipo_vista_lista == 2){
8013        		var indexVistaGriglia = 0;
8014        		
8015        		$('#risultatiPerPaginaDiv').removeClass('hidden');
8016        		$('.headerList').removeClass('hidden');
8017            	$('#alloggiList').addClass('hidden');
8018            	$('#alloggiListGrid').removeClass('hidden');
8019        		$('#alloggiListMap').addClass('hidden');
8020
8021    			html = '';
8022    			
8023    			for (var i = 0; i < alloggiLenght; i++) {
8024            		if(alloggi[i].alias_it_ge_units_old){
8025            			alias = eval('alloggi[i].alias_'+_lang+'_ge_units_old');
8026            		}
8027            		else {
8028            			alias = eval('alloggi[i].alias_'+_lang+'_ge_units');
8029            		}
8030            		alias = alias.replaceAll(' ', '-');
8031            		alias = alias.replaceAll("'", '');
8032            		alias = alias.replaceAll('\\', '-');
8033            		alias = alias.replaceAll("’", '');		
8034            		alias = alias.replaceAll("-at", '-AT');
8035            		
8036            		if((((indexVistaGriglia % 3) == 0) && (indexVistaGriglia != alloggiLenght - 1) && (alloggiLenght == numero_risultati_per_pagina_array[session_tipo_vista_lista_gbl][session_index_numero_risultati_per_pagina_gbl]['risultati_per_pagina_back_end'])) ||
8037            		(((indexVistaGriglia % 3) == 0) && (indexVistaGriglia != alloggiLenght) && (alloggiLenght < numero_risultati_per_pagina_array[session_tipo_vista_lista_gbl][session_index_numero_risultati_per_pagina_gbl]['risultati_per_pagina_back_end']))){
8038            			html += '<div class="row">';
8039            		}
8040            		
8041                	html += '<div class="col-lg-4 col-md-12 py-3 alloggiListItem" id="'+alias+'">';
8042                		html += '<div class="card">';
8043                			html += '<div class="position-relative">';
8044            					ggPubblicazione = moment().diff(moment(alloggi[i].publication_date), 'days');
8045                				if(alloggi[i].in_offer_unit){
8046                					html += '<div class="inOffer">PROMO</div>';
8047                				}
8048                				if((ggPubblicazione <= 15) && (alloggi[i].in_offer_unit)){
8049                					html += '<div class="newLower">
8049NEW</div>';
8050                				}
8051                				else if(ggPubblicazione <= 15){
8052                					html += '<div class="new">NEW</div>';
8053                				}
8054                				if(alloggi[i].fully_staffed_unit){
8055                					html += '<div class="fullyStaffed">Fully Staffed</div>';
8056                				}
8057            					
8058            	    			if(alloggi[i].video_virtual_tour_it){
8059            	    				html += '<div class="videoAndVirtualTour">';
8060            	    				if((alloggi[i].video_virtual_tour_it).find(a => a.includes('youtu'))){
8061            	    					html += '<div class="fa-video-background"><i class="fa-solid fa-play"></i></div>';
8062            	    				}
8063            	    				if((alloggi[i].video_virtual_tour_it).find(a => a.includes('matterport')) || (alloggi[i].video_virtual_tour_it).find(a => a.includes('realisti'))){
8064            	    					html += '<div class="fa-video-background"><i class="fa-solid fa-360-degrees"></i> Virtual Tour</div>';
8065            	    				}
8066            	    				html += '</div>';
8067            	    			}
8068            	    			if(alloggi[i].id_immobile_in_vendita){
8069            	    				html += '<div class="inVendita">';
8070            	    					html += 'for sale';
8071            	    				html += '</div>';
8072            	    			}
8073            	    			html += '<a href="'+alias+'">';
8074                	    			html += '<div class="alloggiListGridItemHover"></div>';
8075            	    				if(alloggi[i].foto_box.length > 1){
8076            	    					carousel_box.push('carousel_box_' + alloggi[i].unit_id);
8077            	    					html += '<div id="carousel_box_' + alloggi[i].unit_id + '" class="carousel slide" data-bs-touch="true">';
8078            	    						html += '<div class="carousel-inner">';
8079                	    					for (var s = 0; s < alloggi[i].foto_box.length; s++) {
8080                            	    			html += '<div class="carousel-item ' + (s == 0 ? 'active' : '') + '">';
8081                            	    				html += '<img alt="Cover photo of ' + alloggi[i].unit_name + '" data-src="' + getFotoWithWtmrk(_root_foto_wtmrk_gs+'/'+alloggi[i].group_id+'/'+alloggi[i].foto_box[s], "525x350") + '" class="lazyload">';
8082                            	    			html += '</div>';
8083                        	    			}
8084                        	    			html += '</div>';
8085                    	    				html += '<div class="carousel-indicators carousel-indicators-box">';
8086                    	    					for (var s = 0; s < alloggi[i].foto_box.length; s++) {
8087                    	    						html += '<button type="button" data-bs-target="#carousel_box_' + alloggi[i].unit_id + '" data-bs-slide-to="' + s + '" class="' + (s == 0 ? 'active' : '') + '" ' + (s == 0 ? 'aria-current="true"' : '') + ' aria-label="Gallery ' + (s + 1) + ' Property ' + alloggi[i].unit_id + '"></button>';
8088                    	    					}
8089                    	    				html += '</div>';
8090                    	    			html += '</div>';
8091            	    				}
8092            	    				else {
8093            	    					html += '<img alt="Cover photo of ' + alloggi[i].unit_name + '" data-src="' + getFotoWithWtmrk(_root_foto_wtmrk_gs+'/'+alloggi[i].group_id+'/'+alloggi[i].foto_copertina, "525x350") + '" class="lazyload">';
8094            	    				} 
8095                	    		html += '</a>';
8096							html += '</div>';
8097                        	html += '<div class="dettagli">';
8098                        	html += '<a href="'+alias+'">';
8099                            	html += '<h2><b>'+alloggi[i].unit_name+'</b></h2>';
8100                            	
8101                            	if((alloggi[i].avg_reviews) && (parseFloat(alloggi[i].avg_reviews).toFixed(1) > 4)){
8102									html += '<div class="avg_reviews" style="display: none;">';
8103                            			html += '<div class="rating_alloggio" id="rating_' + alloggi[i].unit_id + '"></div>';
8104                            			html += '<span>(' + alloggi[i].number_reviews + ')</span>';
8105                            		html += '</div>';
8106                            		
8107                            		if(alloggi[i].exclusive_property){
8108                            			html += '<div class="exclusivePriceBottom"><b>Exclusive properties</b></div>';
8109                            			html += '<input type="hidden" id="prezzo_alloggio_' + alloggi[i].unit_id + '" value="Exclusive properties" >';
8110                            		}
8111                            		else{
8112                            			html += '<div class="priceBottom"><span>starting from</span><br><b>€ '+numeral(parseInt(alloggi[i].prezzo)).format('0,0')+'</b> <span>a day</span></div>';
8113                            			//html += '<input type="hidden" id="prezzo_alloggio_' + alloggi[i].unit_id + '" value="starting from € '+numeral(parseInt(alloggi[i].prezzo)).format('0,0')+' a day" >';
8114                            			if(alloggi[i].prezzo){
8115                            				html += '<input type="hidden" id="prezzo_alloggio_' + alloggi[i].unit_id + '" value="starting from € '+numeral((alloggi[i].prezzo).replace('.00','')).format('0,0')+' a day" >';
8116                            			}
8117                            			else {
8118                            				html += '<input type="hidden" id="prezzo_alloggio_' + alloggi[i].unit_id + '" value="" >';
8119                            			}
8120                            		}
8121                            	}
8122                            	else {
8123                            		if(alloggi[i].exclusive_property){
8124                            			html += '<div class="exclusivePrice"><b>Exclusive properties</b></div>';
8125                            			html += '<input type="hidden" id="prezzo_alloggio_' + alloggi[i].unit_id + '" value="Exclusive properties" >';
8126                            		}
8127                            		else{
8128                            			html += '<div class="price"><span>starting from</span><br><b>€ '+numeral(parseInt(alloggi[i].prezzo)).format('0,0')+'</b> <span>a day</span></div>';
8129                            			//html += '<input type="hidden" id="prezzo_alloggio_' + alloggi[i].unit_id + '" value="starting from € '+numeral(parseInt(alloggi[i].prezzo)).format('0,0')+' a day" >';
8130                            			if(alloggi[i].prezzo){
8131                            				html += '<input type="hidden" id="prezzo_alloggio_' + alloggi[i].unit_id + '" value="starting from € '+numeral((alloggi[i].prezzo).replace('.00','')).format('0,0')+' a day" >';
8132                            			}
8133                            			else {
8134                            				html += '<input type="hidden" id="prezzo_alloggio_' + alloggi[i].unit_id + '" value="" >';
8135                            			}
8136                            		}
8137                            	}
8138                    			if(tipologieArrayTemp.length == 1){
8139                    				html += '<div>'+nomi_tipologie_alloggi[tipologieArrayTemp[0]][_lang]+'</div>';
8140                    			}
8141                    			else {
8142                    				html += '<div>'+eval('alloggi[i].label_'+_lang+'_diz_types')+'</div>';
8143                    			}	
8144                          		html += '<div class="location">';
8145                          			var location_hidden = '';
8146                              		if(alloggi[i].label_touristic_area_it){
8147                              			html += eval('alloggi[i].nome_regione_'+_lang)+' - '+eval('alloggi[i].label_touristic_area_'+_lang);
8148                              			location_hidden += eval('alloggi[i].nome_regione_'+_lang)+' - '+eval('alloggi[i].label_touristic_area_'+_lang);
8149                              		}
8150                              		else {
8151                              			html += eval('alloggi[i].nome_regione_'+_lang);
8152                              			location_hidden += eval('alloggi[i].nome_regione_'+_lang);
8153                              		}
8154                          		html += '</div>';
8155                    		html += '</a>';
8156        					html += '<div class="icons">';
8157        						html += printAlloggiHtmlIcons(alloggi, i);
8158        					html += '</div>';
8159        					html += '<a href="'+alias+'">';
8160            					if(alloggi[i].unit_short_description_it){
8161                        	        if(eval('alloggi[i].unit_short_description_'+_lang).length >
8161 limitCharDescBreveGriglia) {
8162                        	            var c = eval('alloggi[i].unit_short_description_'+_lang).substr(0, limitCharDescBreveGriglia);
8163                        	            var lastDot = c.lastIndexOf(".") + 1;
8164                        	            c = eval('alloggi[i].unit_short_description_'+_lang).substr(0, lastDot);
8165
8166                        	           	de = c.replace(regex_description, '<br>');
8167    									html += '<div class="description">' + de + '</div>';
8168                    		        }
8169                        	        else{
8170                        	        	de = eval('alloggi[i].unit_short_description_'+_lang).replace(regex_description, '<br>');
8171                        	        	html += '<div class="description">' + de + '</div>';
8172                        	        }
8173            					}
8174            				html += '</a>';
8175        					html += '<div class="buttonsSx">';
8176        						html += '<button type="button" class="btn btn-primary" onclick="apriModalRichiediInfoAlloggi(' + alloggi[i].unit_id + ', \'' + alias + '\');">Ask for information</button>';
8177        						html += '<input type="hidden" id="nome_alloggio_' + alloggi[i].unit_id + '" value="' + alloggi[i].unit_name + '" >';
8178        						html += '<input type="hidden" id="tipologia_alloggio_' + alloggi[i].unit_id + '" value="' + eval('alloggi[i].label_'+_lang+'_diz_types') + '" >';
8179        						html += '<input type="hidden" id="foto_alloggio_' + alloggi[i].unit_id + '" value="' + getFotoWithWtmrk(_root_foto_wtmrk_gs+'/'+alloggi[i].group_id+'/'+alloggi[i].foto_copertina, "525x350") + '" >';
8180        						html += '<input type="hidden" id="location_alloggio_' + alloggi[i].unit_id + '" value="' + location_hidden + '" >';
8181        					html += '</div>';
8182        					html += '<div class="buttonsRx">';
8183        						html += '<a aria-label="Share the listing" href="javascript:void(0)" onclick="apriModalCondividiPagineRicerca(2, 2, ' + alloggi[i].unit_id + ', \'' + alias + '\');"><i class="fa-solid fa-share-nodes"></i></a>';
8184        					html += '</div>';
8185                    	html += '</div>';
8186                    	html += '</div>';
8187                    html += '</div>';
8188                    
8189                    /*
8190    				if((indexVistaGriglia == 3) && (session_numero_pagina_risultati_gbl == 1)){
8191    					html += '<div class="col-lg-4 col-md-12 py-3 alloggiListItem banner">';
8192    						html += appendBanner();
8193    					html += '</div>';
8194    					indexVistaGriglia++;
8195    				}
8196    				*/
8197    				
8198            		if((indexVistaGriglia != 0) && (((indexVistaGriglia + 4) % 3) == 0)){
8199            			html += '</div>';
8200            		}
8201            		indexVistaGriglia++;
8202            		
8203                    if(alloggi[i].foto_copertina){
8204                    	obj['@graph'].push({
8205                        	"@type" : "VacationRental",
8206                        	"identifier": {
8207            	            	"@type" : "PropertyValue", 
8208            	            	"propertyID" : "Code", 
8209            	            	"value" : alloggi[i].unit_id
8210            	            }, 
8211            	            "name" : alloggi[i].unit_name, 
8212            	            "description" : eval('alloggi[i].unit_short_description_'+_lang), 
8213            	            "image" : alloggi[i].foto_copertina, 
8214            	            "url" : alias
8215            			});
8216                    }else{
8217                    	obj['@graph'].push({
8218                        	"@type" : "VacationRental", 
8219                        	"identifier": {
8220            	            	"@type": "PropertyValue", 
8221            	            	"propertyID": "Code", 
8222            	            	"value":  alloggi[i].unit_id
8223            	            }, 
8224            	            "name" : alloggi[i].unit_name, 
8225            	            "description" : eval('alloggi[i].unit_short_description_'+_lang), 
8226            	            "url" : alias
8227            			});
8228                    }
8229    			}
8230    			$("#alloggiListGrid").append(html);
8231
8232				for (var i = 0; i < alloggiLenght; i++) {
8233                    if((alloggi[i].avg_reviews) && (parseFloat(alloggi[i].avg_reviews).toFixed(1) > 4)){
8234        	        	$('#rating_' + alloggi[i].unit_id).raty({ 
8235                            path: _root_cdn + '/img',
8236                            starOff : 'star-off-pink.png',
8237                            starOn  : 'star-on-pink.png',
8238                            starHalf: 'star-half-pink.png',
8239        	        		halfShow: true,
8240        	        		readOnly: true,
8241        	        		score: parseFloat(alloggi[i].avg_reviews).toFixed(1)
8242        	        	});
8243                    }
8244				}
8245				$(".avg_reviews").fadeIn("fast");
8246				
8247    			$('#paginationContainer').css('display', 'block');	 
8248        	}
8249    		else if(session_tipo_vista_lista == 3){
8250				$('#risultatiPerPaginaDiv').addClass('hidden');
8251    		   	$('.headerList').removeClass('hidden');
8252            	$('#alloggiList').addClass('hidden');
8253            	$('#alloggiListGrid').addClass('hidden');
8254            	$('#alloggiListMapHeader').removeClass('hidden');
8255            	$('#alloggiListMap').removeClass('hidden');
8256    			
8257    		   	marker_alloggi_id = new Array();
8258    		   	marker_array = new Array();
8259    		   	markers_alloggi = new L.markerClusterGroup({
8260    				spiderfyOnMaxZoom: true,
8261    			    showCoverageOnHover: false,
8262    			    zoomToBoundsOnClick: true
8263    			});
8264
8265    			html = '';
8266    			
8267    			for (var i = 0; i < alloggiLenght; i++) {
8268            		if(alloggi[i].alias_it_ge_units_old){
8269            			alias = eval('alloggi[i].alias_'+_lang+'_ge_units_old');
8270            		}
8271            		else {
8272            			alias = eval('alloggi[i].alias_'+_lang+'_ge_units');
8273            		}
8274            		alias = alias.replaceAll(' ', '-');
8275            		alias = alias.replaceAll("'", '');
8276            		alias = alias.replaceAll('\\', '-');
8277            		alias = alias.replaceAll("’", '');	
8278            		alias = alias.replaceAll("-at", '-AT');
8279        			
8280            		html += '<div class="card" id="'+alloggi[i].unit_id+'" onClick="showAlloggioInMap('+alloggi[i].unit_id+')">';
8281            			html += '<div class="colImg">';
8282                			html += '<div class="position-relative">';
8283            					ggPubblicazione = moment().diff(moment(alloggi[i].publication_date), 'days');
8284                				if(alloggi[i].in_offer_unit){
8285                					html += '<div class="inOffer">PROMO</div>';
8286                				}
8287                				if((ggPubblicazione <= 15) && (alloggi[i].in_offer_unit)){
8288                					html += '<div class="newLower">
8288NEW</div>';
8289                				}
8290                				else if(ggPubblicazione <= 15){
8291                					html += '<div class="new">NEW</div>';
8292                				}
8293            					
8294            	    			if(alloggi[i].video_virtual_tour_it){
8295            	    				html += '<div class="videoAndVirtualTour">';
8296            	    				if((alloggi[i].video_virtual_tour_it).find(a => a.includes('youtu'))){
8297            	    					html += '<div class="fa-video-background"><i class="fa-solid fa-play"></i></div>';
8298            	    				}
8299            	    				if((alloggi[i].video_virtual_tour_it).find(a => a.includes('matterport')) || (alloggi[i].video_virtual_tour_it).find(a => a.includes('realisti'))){
8300            	    					html += '<div class="fa-video-background"><i class="fa-solid fa-360-degrees"></i></div>';
8301            	    				}
8302            	    				html += '</div>';
8303            	    			}
8304                        		html += '<img alt="Cover photo of ' + alloggi[i].unit_name + '" data-src="' + getFotoWithWtmrk(_root_foto_wtmrk_gs+'/'+alloggi[i].group_id+'/'+alloggi[i].foto_copertina, "300x200") + '" class="lazyload">';
8305                    		html += '</div>';
8306                    	html += '</div>';
8307                    	html += '<div class="dettagli">';
8308                    		html += '<h2><b>'+alloggi[i].unit_name+'</b></h2>';
8309                    		if(alloggi[i].exclusive_property){
8310                    			html += '<div class="price"><b>Exclusive properties</b></div>';
8311                    		}
8312                    		else{
8313                    			html += '<div class="price"><span>starting from</span> <b>€ '+numeral(parseInt(alloggi[i].prezzo)).format('0,0')+'</b> <span>a day</span></div>';
8314                    		}
8315                    		if(alloggi[i].label_touristic_area_it){
8316                    			html += '<div class="location">'+eval('alloggi[i].label_touristic_area_'+_lang)+'</div>';
8317                    		}
8318                    		else {
8319                    			html += '<div class="location">'+eval('alloggi[i].nome_regione_'+_lang)+'</div>';
8320                    		}
8321                    		html += '<div class="icons">';
8322                        		if(alloggi[i].maxcapacity){
8323                        			html += '<div class="iconWithNumberDivMap">';
8324                            			html += '<a href="javascript:void(0)" data-bs-placement="top" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-content="'+alloggi[i].maxcapacity+' Sleeps" aria-label="'+alloggi[i].maxcapacity+' Sleeps">';
8325                            				html += '<i class="fa-solid fa-bed-front"></i><span class="iconWithNumber">'+alloggi[i].maxcapacity+'</span>';
8326                            			html += '</a>';
8327                            		html += '</div>';
8328                        		}
8329                        	html += '</div>';
8330							html += '<div class="dettagliGo text-uppercase"><a target="_blank" href="https://www.greatestate.it/en/'+alias+'"><b>Details </b></a></div>';
8331                    	html += '</div>';
8332                	html += '</div>';
8333    			}
8334    			$("#listMap").empty().append(html);
8335    			
8336    			/*
8337    			var containerMap = L.DomUtil.get('map');
8338    			if(containerMap != null){
8339    				containerMap._leaflet_id = null;
8340    			}
8341    			*/
8342
8343                if(map != undefined){
8344                	map.off();
8345                	map.remove();
8346                }
8347    			
8348    		    map = L.map('map', { 
8349        		    scrollWheelZoom: false,
8350        		    zoomControl: false,
8351        	        attributionControl: false,
8352        	        maxZoom: 10,
8353        	        dragging: !L.Browser.mobile,
8354        	        tap: !L.Browser.mobile
8355        		}).setView([_latitude, _longitude], _zoom);
8356        		
8357    		    L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
8358    		    	minZoom: 5
8359    		    }).addTo(map);
8360    		    
8361    		    L.control.zoom({
8362    		        position: 'bottomright'
8363    		    }).addTo(map);
8364    		    
8365    			map.on('click', function() {
8366    				if (map.scrollWheelZoom.enabled()) {
8367    					map.scrollWheelZoom.disable();
8368    				}
8369    				else {
8370    				    map.scrollWheelZoom.enable();
8371    				}
8372    			});	
8373
8374    			map.on('popupopen', function (e) {
8375					var center = map.project(e.target._popup._latlng);
8376        		    //center = new L.point(center.x,center.y - 160);
8377        		    var target = map.unproject(center);
8378        		    map.panTo(target);    
8379    			});
8380    			
8381    		    for (var i = 0; i < alloggiLenght; i++) {
8382					let popup = '';
8383
8384					if($(window).width() > 992){    	
8385	                	popup += '<div class="info">';
8386                        	popup += '<h2>' + alloggi[i].unit_name + '</h2>';
8387                        popup += '</div>'; 
8388					}		
8389					else{
8390                		if(alloggi[i].alias_it_ge_units_old){
8391                			alias = eval('alloggi[i].alias_'+_lang+'_ge_units_old');
8392                		}
8393                		else {
8394                			alias = eval('alloggi[i].alias_'+_lang+'_ge_units');
8395                		}
8396                		alias = alias.replaceAll(' ', '-');
8397                		alias = alias.replaceAll("'", '');
8398                		alias = alias.replaceAll('\\', '-');
8399                		alias = alias.replaceAll("’", '');	
8400                		alias = alias.replaceAll("-at", '-AT');
8401    						
8402    					popup += '<a target="_blank" href="https://www.greatestate.it/en/'+alias+'"><b></b>';
8403	    					ggPubblicazione = moment().diff(moment(alloggi[i].publication_date), 'days');
8404            				if(alloggi[i].in_offer_unit){
8405            					popup += '<div class="inOffer">PROMO</div>';
8406            				}
8407            				if((ggPubblicazione <= 15) && (alloggi[i].in_offer_unit)){
8408            					popup += '<div class="newLower">
8408NEW</div>';
8409            				}
8410            				else if(ggPubblicazione <= 15){
8411            					popup += '<div class="new">NEW</div>';
8412            				}
8413        					
8414	    	    			if(alloggi[i].video_virtual_tour_it){
8415	    	    				popup += '<div class="videoAndVirtualTour">';
8416	    	    				if((alloggi[i].video_virtual_tour_it).find(a => a.includes('youtu'))){
8417	    	    					popup += '<div class="fa-video-background"><i class="fa-solid fa-play"></i></div>';
8418	    	    				}
8419	    	    				if((alloggi[i].video_virtual_tour_it).find(a => a.includes('matterport')) || (alloggi[i].video_virtual_tour_it).find(a => a.includes('realisti'))){
8420	    	    					popup += '<div class="fa-video-background"><i class="fa-solid fa-360-degrees"></i></div>';
8421	    	    				}
8422	    	    				popup += '</div>';
8423	    	    			}
8424	                    	popup += '<img alt="Cover photo of ' + alloggi[i].unit_name + '" data-src="' + getFotoWithWtmrk(_root_foto_wtmrk_gs+'/'+alloggi[i].group_id+'/'+alloggi[i].foto_copertina, "300x200") + '" class="lazyload">';
8425	                    	popup += '<div class="info" style="padding: 10px 7px 10px 7px;">';
8426	                        	popup += '<h2 style="text-align: left;">' + alloggi[i].unit_name + '</h2>';
8427	                    		if(alloggi[i].exclusive_property){
8428	                    			popup += '<div class="price"><b>Exclusive properties</b></div>';
8429	                    		}
8430	                    		else{
8431	                    			popup += '<div class="price"><span>starting from</span> <b>€ '+numeral(parseInt(alloggi[i].prezzo)).format('0,0')+'</b> <span>a day</span></div>';
8432	                    		}
8433                        		if(alloggi[i].label_touristic_area_it){
8434                        			popup += '<div class="location text-uppercase">'+eval('alloggi[i].nome_regione_'+_lang)+' - '+eval('alloggi[i].label_touristic_area_'+_lang);
8435                        		}
8436                        		else {
8437                        			popup += '<div class="location">'+eval('alloggi[i].nome_regione_'+_lang);
8438                        		}
8439                        		popup += '</div>';
8440	                        	/*popup += '<div class="icons">';
8441	                        		popup += printAlloggiHtmlIcons(alloggi, i);
8442	                        	popup += '</div>';*/
8443	                        popup += '</div>';
8444	                    popup += '</a>';
8445					}
8446					
8447                    let marker = L.marker([alloggi[i].latitude, alloggi[i].longitude],{icon: icon}).bindPopup(popup);
8448                    
8449					marker['alloggio_id'] = alloggi[i].unit_id;
8450
8451					let marke = new Array();
8452					marke.alloggio_id = new Array();
8453					marke.alloggio_id = alloggi[i].unit_id;
8454					marke.coord = new Array();
8455					marke.coord = [alloggi[i].latitude, alloggi[i].longitude];
8456
8457					marker_alloggi_id.push(marke);
8458					
8459					marker.on('click', function() {
8460						marker.setIcon(iconSelected);
8461						$("#listMap>.card").removeClass("active");
8462						$("#listMap>.card>.dettagli>.dettagliGo>a").removeClass("active");
8463						$('#'+this.alloggio_id).addClass('active');
8464						$("#listMap>#"+this.alloggio_id+">.dettagli>.dettagliGo>a").addClass('active');
8465						
8466	            		$('#listMap').animate({
8467	            			scrollTop: $('#'+this.alloggio_id).offset().top - $('#listMap').offset().top + $('#listMap').scrollTop() - 220
8468		            	});
8469					});
8470
8471					marker.getPopup().on('remove', function() {
8472						marker.setIcon(icon);
8473						$("#listMap>.card").removeClass("active");
8474						$("#listMap>.card>.dettagli>.dettagliGo>a").removeClass("active");
8475					});
8476					
8477					markers_alloggi.addLayer(marker);
8478					
8479					marker_array.push(marker);
8480    		    }
8481
8482    		    marker_group = new L.featureGroup(marker_array);
8483
8484    		    markers_alloggi.addTo(map);
8485    		    
8486    		    map.fitBounds(marker_group.getBounds());
8487
8488    		    /*
8489    		    map.on('popupopen', function(){
8490    		        $(function () {
8491    		            $('[data-bs-toggle="popover"]').popover();
8492    		        });
8493    		    });
8494    		    */
8495    			
8496    		    map.on('zoomend', function() {
8497        		    refreshMarker();
8498        		    map.closePopup();
8499    		    });
8500
8501    		    map.on("moveend", function () {
8502        		    refreshMarker();
8503    		    });
8504    		}
8505
8506    		for (var i = 0; i < carousel_box.length; i++) {
8507            	var myCarouselElement = document.querySelector('#' + carousel_box[i]);
8508                var carousel = new bootstrap.Carousel(myCarouselElement, {});
8509    		}
8510    		
8511	        var pagine = 0;
8512	        var quotient;
8513	        var reminder;
8514	        
8515	        /*
8516	        if(alloggi[0].numero_alloggi >= 4){
8517	        	quotient = Math.floor((parseInt(alloggi[0].numero_alloggi) + 1) / numero_risultati_per_pagina_array[session_tipo_vista_lista][session_index_numero_risultati_per_pagina]['risultati_per_pagina_back_end']);
8518	        	reminder = (parseInt(alloggi[0].numero_alloggi) + 1) % numero_risultati_per_pagina_array[session_tipo_vista_lista][session_index_numero_risultati_per_pagina]['risultati_per_pagina_back_end'];
8519	        }
8520	        else{
8521	        	quotient = Math.floor(alloggi[0].numero_alloggi / numero_risultati_per_pagina_array[session_tipo_vista_lista][session_index_numero_risultati_per_pagina]['risultati_per_pagina_back_end']);
8522	        	reminder = alloggi[0].numero_alloggi % numero_risultati_per_pagina_array[session_tipo_vista_lista][session_index_numero_risultati_per_pagina]['risultati_per_pagina_back_end'];
8523	        }
8524	        */
8525
8526        	quotient = Math.floor(alloggi[0].numero_alloggi / numero_risultati_per_pagina_array[session_tipo_vista_lista][session_index_numero_risultati_per_pagina]['risultati_per_pagina_back_end']);
8527        	reminder = alloggi[0].numero_alloggi % numero_risultati_per_pagina_array[session_tipo_vista_lista][session_index_numero_risultati_per_pagina]['risultati_per_pagina_back_end'];
8528        	
8529	        if (reminder == 0) {
8530	        	pagine = quotient;
8531	        } else {
8532	        	pagine = quotient + 1;
8533	        }
8534
8535	        $("#pagination").empty();
8536	        
8537			for (var k = 1; k <= pagine; k++) {
8538                if (k == session_numero_pagina_risultati) {
8539	                html_paginazione = '<li class="page-item active" aria-current="page">';
8540	                html_paginazione += '<span class="page-link">'+k+'</span>';
8541	                html_paginazione += '</li>';
8542                } else {
8543	                html_paginazione = '<li class="page-item">';
8544	                html_paginazione += '<div href="javascript:void(0)" onclick="listaAlloggi('+session_tipo_vista_lista+', '+k+', '+session_index_numero_risultati_per_pagina+', '+session_ordinamento_lista_risultati+', true);">';
8545	                	html_paginazione += '<span class="page-link">'+k+'</span>';
8546	                html_paginazione += '</div>';
8547	                html_paginazione += '</li>';
8548                }
8549
8550                if (pagine <= 10) {
8551                    $("#pagination").append(html_paginazione);
8552                } else {
8553                    if (k == 1) {
8554                        $("#pagination").append(html_paginazione);
8555                    } else if (k == (session_numero_pagina_risultati - 2)) {
8556                        $("#pagination").append(html_paginazione);
8557                    } else if (k == (session_numero_pagina_risultati - 3)) {
8558                        $("#pagination").append(html_paginazione);
8559                    } else if (k == (session_numero_pagina_risultati - 4)) {
8560                        $("#pagination").append(html_paginazione_separatore);
8561                        $("#pagination").append(html_paginazione);                                                                                    
8562                    } else if (k == session_numero_pagina_risultati || k == session_numero_pagina_risultati - 1 || k == session_numero_pagina_risultati + 1) {
8563                        $("#pagination").append(html_paginazione);
8564                    } else if (k == (session_numero_pagina_risultati + 4)) {
8565                        $("#pagination").append(html_paginazione);
8566                        $("#pagination").append(html_paginazione_separatore);                                                        
8567                    } else if (k == (session_numero_pagina_risultati + 3)) {
8568                        $("#pagination").append(html_paginazione);                            
8569                    } else if (k == (session_numero_pagina_risultati + 2)) {
8570                        $("#pagination").append(html_paginazione);
8571                    } else  if (k == pagine) {
8572                        $("#pagination").append(html_paginazione);
8573                    } else {
8574
8575                    }
8576                }  
8577			} 
8578
8579    		var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'))
8580    		var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
8581    		  	return new bootstrap.Popover(popoverTriggerEl)
8582    		})
8583    		
8584            el.text += JSON.stringify(obj);
8585            document.querySelector('body').appendChild(el);
8586            
8587        					if(session_numero_pagina_risultati == 1){
8588    				_paq.push(['trackGoal', 6]);
8589				}
8590        	        });	
8591	}  
8592
8593	$(window).on('resize', function(){    	
8594		if($(window).width() > 992){    	
8595			setDivFullscreenTopPage('alloggi');  
8596			$('#button_view_mobile').css('display', 'none');
8597			$('#button_sort_mobile').css('display', 'none');
8598			window.addEventListener('scroll', scrollHeaderlistener);
8599		}		
8600		else{
8601			$('#button_view_mobile').css('display', 'flex');
8602
8603	    	if(session_tipo_vista_lista_gbl == 3){
8604	    		$('#button_sort_mobile').css('display', 'none');
8605	    	}
8606	    	else{
8607				$('#button_sort_mobile').css('display', 'flex');
8608	    	}
8609			$('.divImgFullscreenTopPage').css('height', 'auto');
8610			window.removeEventListener('scroll', scrollHeaderlistener);
8611		}
8612	});
8613
8614	function resetMap(){
8615		//map.setView([_latitude, _longitude], _zoom);
8616		map.fitBounds(marker_group.getBounds());
8617	}
8618	
8619    function refreshMarker(){ 
8620    	if($("#risultatiInMappaCheck").is(":checked") == true){
8621    	    marker_alloggi_id.forEach(function(mark) {
8622    	        $('#'+mark.alloggio_id).addClass('hidden');
8623    	    });
8624    	    
8625            map.eachLayer(function(layer) {
8626    			if(layer instanceof L.Marker && map.getBounds().contains(layer.getLatLng())) {	
8627    				if(layer.alloggio_id){
8628    					$('#'+layer.alloggio_id).removeClass('hidden');
8629    				}
8630    				else{
8631    					let allClusterMarker = layer.getAllChildMarkers();
8632    					
8633    					allClusterMarker.forEach(function(mark) {
8634    						$('#'+mark.alloggio_id).removeClass('hidden');
8635    					});
8636    				}
8637            	}    		        	
8638            });
8639    	}
8640    	else{
8641    	    marker_alloggi_id.forEach(function(mark) {
8642    	        $('#'+mark.alloggio_id).removeClass('hidden');
8643    	    });
8644    	}
8645
8646    	setTitoloPaginaRicerca($("#listMap>.card").not(".hidden").length);
8647    }
8648
8649    function setTitoloPaginaRicerca(numero_alloggi){ 
8650    	var titolo_pagina_ricerca = '';
8651    	var breadcrumb_link = '';
8652  		
8653		titolo_pagina_ricerca = 'For your ';
8654		
8655                    titolo_pagina_ricerca += 'search ';
8656            
8657        if(breadcrumb_link == ''){
8658        	breadcrumb_link = 'Tourist accommodation';
8659        }
8660        $('#breadcrumb_link').text(breadcrumb_link);
8661        
8662        if(numero_alloggi == 0){
8663        	$('#breadcrumbs').addClass('hidden');
8664        	titolo_pagina_ricerca += "there are no results";
8665        }
8666        else if(numero_alloggi == 1){
8667        	$('#breadcrumbs').removeClass('hidden');
8668        	titolo_pagina_ricerca += "present " + numero_alloggi + " accommodations to see";
8669        }
8670        else{
8671        	$('#breadcrumbs').removeClass('hidden');
8672        	titolo_pagina_ricerca += "there are " + numero_alloggi + " accommodations to see";
8673        }
8674		
8675		$("#numeroAlloggiTrovati").empty().html(titolo_pagina_ricerca);
8676    }
8677    
8678	function showAlloggioInMap(id){
8679		$("#listMap>.card").removeClass("active");
8680		$("#listMap>.card>.dettagli>.dettagliGo>a").removeClass("active");
8681
8682	    marker_alloggi_id.forEach(function(mark) {
8683			if(mark.alloggio_id == id){
8684				map.setView(mark.coord, 12);
8685
8686		        map.eachLayer(function(layer) {
8687					if(layer instanceof L.Marker) {	
8688						if(layer.alloggio_id){
8689							if(layer.alloggio_id == id){
8690								layer.setIcon(iconSelected);
8691		    					layer.openPopup();
8692		    					$('#'+id).addClass('active');
8693		    					$("#listMap>#"+id+">.dettagli>.dettagliGo>a").addClass('active');
8694		    					return;
8695							}
8696						}
8697		        	}    		        	
8698		        });
8699	        	
8700				return;
8701			}
8702	    });
8703	}
8704
8705	$("#risultatiInMappaCheck").click(function() {		
8706		refreshMarker();
8707	});
8708
8709			
8710	listaAlloggi(session_tipo_vista_lista, session_numero_pagina_risultati, session_index_numero_risultati_per_pagina, session_ordinamento_lista_risultati, false); 
8711
8712	function printInfoHeaderMustHave(){
8713		$.ajax({
8714	        url: _api+'greatstays/info_must_have_header/'+_lang+'/'+must_have_alloggi,
8715	        type: 'POST',	            
8716	        crossDomain: true,           
8717	        xhrFields:
8718	        {
8719	            withCredentials: true
8720	        },
8721	        error: function (error) {
8722	        	console.log(error);
8723	        	return;
8724	        }
8725	    }).done(function(json) {
8726            var html_carousel_pagine_ricerca = '';
8727            var videoExist = false;
8728
8729            for (var i = 0; i < json.rows[0].content_pagina.length; i++) {
8730            	if(json.rows[0].content_pagina[i].type == 2){
8731            		videoExist = true;
8732            	}
8733            }
8734
8735            if((videoExist == true) && ($(window).width() > 992)){
8736        		for (var i = 0; i < json.rows[0].content_pagina.length; i++) {
8737    				if(json.rows[0].content_pagina[i].type == 2){
8738						//html_carousel_pagine_ricerca += '<div class="carousel-item '+(i == 0 ? 'active' : '')+' divImgFullscreenTopPage" data-bs-interval="'+json.rows[0].content_pagina[i].time+'" type="2" video-index="'+i+'">';
8739						html_carousel_pagine_ricerca += '<div class="carousel-item active divImgFullscreenTopPage">';
8740    						html_carousel_pagine_ricerca += '<video id="videoPagineRicerca_'+i+'" class="videoPagineRicerca" autoplay muted loop preload="none" src="https://cdn.greatestate.it/ge/img/gs/header/must_have/'+json.rows[0].content_pagina[i].url+'"></video>';
8741    					html_carousel_pagine_ricerca += '</div>';
8742    				}
8743        		}
8744            }
8745            else{
8746        		for (var i = 0; i < json.rows[0].content_pagina.length; i++) {
8747    				if(json.rows[0].content_pagina[i].type == 1){
8748    					//html_carousel_pagine_ricerca += '<div class="carousel-item active divImgFullscreenTopPage" data-bs-interval="3000" type="1">';
8749    					html_carousel_pagine_ricerca += '<div class="carousel-item active divImgFullscreenTopPage" data-bs-interval="3000">';
8750    						html_carousel_pagine_ricerca += '<img alt="Gallery ' + ((json.rows[0].content_pagina[i].url).replace('.jpg','')).replace('_',' ') + '" class="w-100 lazyload" data-src="https://cdn.greatestate.it/ge/img/gs/header/must_have/'+json.rows[0].content_pagina[i].url+'">';
8751    					html_carousel_pagine_ricerca += '</div>';
8752    				}
8753        		}
8754            }
8755    		$("#carouselPagineRicercaContent").empty().append(html_carousel_pagine_ricerca);
8756
8757    		var carouselPagineRicercaElem = document.getElementById("carouselPagineRicerca");
8758    		var carouselPagineRicerca = new bootstrap.Carousel(carouselPagineRicercaElem, {
8759    			wrap: true,
8760    			pause: true
8761    		});
8762
8763    		if(($(window).width() > 992)){
8764        		/*
8765        		$('#carouselPagineRicerca').on('slid.bs.carousel', function () {  
8766        		    var type = parseInt($(this).find('.active').attr('type'));
8767    				var videoIndex;
8768    				var vid;
8769
8770    				allVideos = document.getElementsByClassName('videoPagineRicerca');
8771
8772    				if(allVideos){
8773    					for (var i = 0; i < allVideos.length; i++) {
8774    						let v = document.getElementById(allVideos[i].id);
8775    	      		  		v.currentTime = 0;
8776    	       		  		v.pause();
8777    					}
8778    				}	
8779    				
8780           		  	if(type == 2){       		  	
8781           		  		videoIndex = parseInt($(this).find('.active').attr('video-index'));
8782           		  		vid = document.getElementById('videoPagineRicerca_'+videoIndex);
8783           		  		vid.play();
8784           		  	}
8785        		})
8786        		*/
8787
8788        		/*
8789        		if(json.rows[0].content_pagina.length > 1){
8790        			$('#carouselPagineRicercaControlPrev').removeClass('hidden');
8791        			$('#carouselPagineRicercaControlNext').removeClass('hidden');
8792        		}
8793        		*/
8794    		}
8795
8796    		if($(window).width() > 992){    	
8797    			setDivFullscreenTopPage('alloggi');  
8798    		}		
8799    		else{
8800    			$('.divImgFullscreenTopPage').css('height', 'auto');
8801    		}
8802
8803	        $('#testoPageSearchCustom').append(json.rows[0].testo);
8804	        $('#testoPageSearchCustom').removeClass('hidden');
8805	    });	
8806	}
8807
8808	function printInfoHeaderAree(){
8809		if(aree_alloggi){
8810						
8811	    	$.ajax({
8812	            url: _api+'greatstays/info_area_header/'+_lang+'/'+aree_alloggi,
8813	            type: 'POST',	            
8814	            crossDomain: true,           
8815	            xhrFields:
8816	            {
8817	                withCredentials: true
8818	            },
8819	            error: function (error) {
8820	            	console.log(error);
8821	            	return;
8822	            }
8823	        }).done(function(json) {	        
8824	            var html_carousel_pagine_ricerca = '';
8825				var videoExist = false;
8826				
8827				if(json.rows[0].content_pagina){
8828    	            for (var i = 0; i < json.rows[0].content_pagina.length; i++) {
8829    	            	if(json.rows[0].content_pagina[i].type == 2){
8830    	            		videoExist = true;
8831    	            	}
8832    	            }
8833    
8834    	            if((videoExist == true) && ($(window).width() > 992)){
8835    		    		for (var i = 0; i < json.rows[0].content_pagina.length; i++) {
8836    						if(json.rows[0].content_pagina[i].type == 2){
8837        						//html_carousel_pagine_ricerca += '<div class="carousel-item '+(i == 0 ? 'active' : '')+' divImgFullscreenTopPage" data-bs-interval="'+json.rows[0].content_pagina[i].time+'" type="2" video-index="'+i+'">';
8838        						html_carousel_pagine_ricerca += '<div class="carousel-item active divImgFullscreenTopPage">';
8839        							html_carousel_pagine_ricerca += '<video id="videoPagineRicerca_'+i+'" class="videoPagineRicerca" autoplay muted loop preload="none" src="https://cdn.greatestate.it/ge/img/gs/header/aree/'+json.rows[0].content_pagina[i].url+'"></video>';
8840        						html_carousel_pagine_ricerca += '</div>';
8841    						}
8842    		    		}
8843    	            }
8844    	            else{
8845    		    		for (var i = 0; i < json.rows[0].content_pagina.length; i++) {
8846    						if(json.rows[0].content_pagina[i].type == 1){
8847    							//html_carousel_pagine_ricerca += '<div class="carousel-item '+(i == 0 ? 'active' : '')+' divImgFullscreenTopPage" data-bs-interval="3000" type="1">';
8848    							html_carousel_pagine_ricerca += '<div class="carousel-item active divImgFullscreenTopPage" data-bs-interval="3000">';
8849    								html_carousel_pagine_ricerca += '<img alt="Gallery ' + ((json.rows[0].content_pagina[i].url).replace('.jpg','')).replace('_',' ') + '" class="w-100 lazyload" data-src="https://cdn.greatestate.it/ge/img/gs/header/aree/'+json.rows[0].content_pagina[i].url+'">';
8850    							html_carousel_pagine_ricerca += '</div>';
8851    						}
8852    		    		}
8853    	            }
8854    	    		$("#carouselPagineRicercaContent").empty().append(html_carousel_pagine_ricerca);
8855    
8856    	    		var carouselPagineRicercaElem = document.getElementById("carouselPagineRicerca");
8857    	    		var carouselPagineRicerca = new bootstrap.Carousel(carouselPagineRicercaElem, {
8858    	    			wrap: true,
8859    	    			pause: true
8860    	    		});
8861    
8862    	    		if(($(window).width() > 992)){
8863    		    		/*
8864    		    		$('#carouselPagineRicerca').on('slid.bs.carousel', function () {  
8865    		    		    var type = parseInt($(this).find('.active').attr('type'));
8866    						var videoIndex;
8867    						var vid;
8868    
8869    						allVideos = document.getElementsByClassName('videoPagineRicerca');
8870    
8871    						if(allVideos){
8872    							for (var i = 0; i < allVideos.length; i++) {
8873    								let v = document.getElementById(allVideos[i].id);
8874    			      		  		v.currentTime = 0;
8875    			       		  		v.pause();
8876    							}
8877    						}	
8878    						
8879    		       		  	if(type == 2){       		  	
8880    		       		  		videoIndex = parseInt($(this).find('.active').attr('video-index'));
8881    		       		  		vid = document.getElementById('videoPagineRicerca_'+videoIndex);
8882    		       		  		vid.play();
8883    		       		  	}
8884    		    		})
8885    		    		*/
8886    
8887    		    		/*
8888    		    		if(json.rows[0].content_pagina.length > 1){
8889    		    			$('#carouselPagineRicercaControlPrev').removeClass('hidden');
8890    		    			$('#carouselPagineRicercaControlNext').removeClass('hidden');
8891    		    		}
8892    		    		*/
8893    	    		}
8894    
8895    	    		if($(window).width() > 992){    	
8896    	    			setDivFullscreenTopPage('alloggi');  
8897    	    		}		
8898    	    		else{
8899    	    			$('.divImgFullscreenTopPage').css('height', 'auto');
8900    	    		}
8901    	    		
8902    	            $('#testoPageSearchCustom').append(json.rows[0].testo);
8903    	            $('#testoPageSearchCustom').removeClass('hidden');
8904				}
8905				else{
8906					$('#nomePageSearchCustom').addClass('hidden');
8907				}
8908	        });	
8909		}
8910	}
8911	
8912    $(document).ready(function(){
8913    	if(_session_cliente_id != ''){
8914    		window.addEventListener('pagehide', (event) => {
8915    		   	if(parseInt(TimeMe.getTimeOnCurrentPageInSeconds()) > _secTimeEventTimeRecording){			   	
8916    		   		var headers = {type : 'application/json; charset=UTF-8'};
8917    		   		var request = {
8918    			        id_cliente : _session_cliente_id,
8919    			        id_diz_evento_sito: 3,		//Visualizzazione pagina
8920    			        tipo_pagina: 2,				//Pagine ricerca
8921    			        pagina_visitata: decodeURIComponent(window.location.href),
8922        				lingua: _lang,
8923        				durata_visualizzazione: parseInt(TimeMe.getTimeOnCurrentPageInSeconds())			        
8924    				};
8925    				var blob = new Blob([JSON.stringify(request)], headers);
8926    				navigator.sendBeacon(_api+'greatestate/set_evento_sito', blob );		        				   
8927    		   	}
8928    		});									
8929    	}   
8930    });
8931
8932    const input = document.querySelector("#telefono");
8933    const telefono = window.intlTelInput(input, {
8934    	countryOrder: ["it", "us", "gb", "de", "nl", "be"],
8935    	utilsScript: "https://cdn.greatestate.it/ge/js/utils.js?v=0.2.4",
8936    });
8937    var telefono_str = '';
8938    
8939    function apriModalRichiediInfoAlloggi(id_alloggio, link) {
8940    	$('#id_alloggio_richiedi_info').val(id_alloggio);
8941    	//$('#oggetto').val('Request information for '+$('#nome_alloggio_'+id_alloggio).val());
8942    	$("#nome_alloggio_richiedi_info").val($('#nome_alloggio_'+id_alloggio).val());
8943    	$("#link_alloggio_richiedi_info").val(_root_web + '/' + _lang + '/' + link);
8944    	$('#prezzo_alloggio_richiedi_info').val($('#prezzo_alloggio_'+id_alloggio).val());
8945    	$("#foto_alloggio_richiedi_info").val($('#foto_alloggio_'+id_alloggio).val());
8946    	$("#location_alloggio_richiedi_info").val($('#location_alloggio_'+id_alloggio).val());
8947    	$('.nome_annuncio_modal').empty().append($('#nome_alloggio_'+id_alloggio).val());
8948    	$('#titolo_alloggio_modal').empty().append('Request information for '+$('#nome_alloggio_'+id_alloggio).val());
8949    	$('.rif_annuncio_modal').empty().append('<b>Code</b> ' + id_alloggio);
8950    	$('.prezzo_annuncio_modal').empty().append('<b>Price</b> ' + $('#prezzo_alloggio_'+id_alloggio).val());
8951    	$('.tipologia_annuncio_modal').empty().append('<b>Typology</b> ' + $('#tipologia_alloggio_'+id_alloggio).val());
8952    	$('.tipologia_annuncio_modal').removeClass('hidden');
8953    	$('.foto_annuncio_modal').attr('src', $('#foto_alloggio_'+id_alloggio).val());
8954    	$('.foto_annuncio_modal').attr('alt', $('#nome_alloggio_'+id_alloggio).val());
8955    
8956    	new bootstrap.Modal(document.getElementById('modal-richiedi-info-pagine-ricerca')).show();
8957    }
8958    
8959    function fieldCheckSendMailAlloggi(){
8960    	let isValid = true;
8961    	let firstInvalid = '';
8962    	
8963    	if($('#email').val() == ''){
8964    		$('#email').addClass('is-invalid');
8965    		$('#email').removeClass('is-valid');
8966    		firstInvalid = 'email';
8967    		isValid = false;
8968    	}
8969    	else{
8970    		var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
8971    		if(regex.test($('#email').val()) == true){
8972    			$('#emailWrong').addClass('hidden');
8973    			$('#email').addClass('is-valid');
8974    			$('#email').removeClass('is-invalid');        			
8975    		}
8976    		else{
8977    			$('#emailWrong').removeClass('hidden');
8978    			$('#email').addClass('is-invalid');
8979    			$('#email').removeClass('is-valid');
8980    			firstInvalid = 'email';
8981    			isValid = false;        			
8982    		}
8983    	}   
8984    	
8985    	if($('#nome').val() == ''){
8986    		$('#nome').addClass('is-invalid');
8987    		$('#nome').removeClass('is-valid');
8988    		if(firstInvalid == ''){
8989    			firstInvalid = 'nome';
8990    		}
8991    		isValid = false;
8992    	}
8993    	else{
8994    		$('#nome').addClass('is-valid');
8995    		$('#nome').removeClass('is-invalid');
8996    	}    	
8997    
8998    	if($('#cognome').val() == ''){
8999    		$('#cognome').addClass('is-invalid');
9000    		$('#cognome').removeClass('is-valid');
9001    		if(firstInvalid == ''){
9002    			firstInvalid = 'cognome';
9003    		}
9004    		isValid = false;
9005    	}
9006    	else{
9007    		$('#cognome').addClass('is-valid');
9008    		$('#cognome').removeClass('is-invalid');
9009    	}    	
9010    
9011    	if($('#telefono').val() == ''){
9012    		$('#telefono').addClass('is-invalid');
9013    		$('#telefono').removeClass('is-valid');
9014    		if(firstInvalid == ''){
9015    			firstInvalid = 'telefono';
9016    		}
9017    		isValid = false;
9018    	}
9019    	else{
9020    		//if((($('#telefono').val()).indexOf("00") == -1) && (($('#telefono').val()).indexOf("+") == -1)){
9021    		if(!telefono.isValidNumber()) {
9022    			$('#telefonoWrong').removeClass('hidden');
9023    			$('#telefono').addClass('is-invalid');
9024    			$('#telefono').removeClass('is-valid');
9025    			if(firstInvalid == ''){
9026    				firstInvalid = 'telefono';
9027    			}
9028    			isValid = false;
9029    		}
9030    		else{
9031    			$('#telefonoWrong').addClass('hidden');
9032    			$('#telefono').addClass('is-valid');
9033    			$('#telefono').removeClass('is-invalid');
9034    		}
9035    	}  
9036    
9037    	if($('#messaggio').val() == ''){
9038    		$('#messaggio').addClass('is-invalid');
9039    		$('#messaggio').removeClass('is-valid');
9040    		isValid = false;
9041    	}
9042    	else{
9043    		$('#messaggio').addClass('is-valid');
9044    		$('#messaggio').removeClass('is-invalid');
9045    	}
9046    	
9047    	if($('#accetta_privacy').is(':checked')){
9048    		$('#accetta_privacy').addClass('is-valid');
9049    		$('#accetta_privacy').removeClass('is-invalid');
9050    	}
9051    	else{
9052    		$('#accetta_privacy').addClass('is-invalid');
9053    		$('#accetta_privacy').removeClass('is-valid');
9054    		isValid = false;
9055    	}
9056    	
9057    	if(isValid == false){
9058    		if(firstInvalid != ''){
9059    			$('#'+firstInvalid).focus();
9060    		}
9061    	}
9062    	return isValid;
9063    }
9064    
9065    $("#richiedi_info_pagine_ricerca_alloggi_form").on("submit", function(event){
9066    	event.preventDefault();
9067    	
9068    	let isValid;
9069    	isValid = fieldCheckSendMailAlloggi();   		
9070    	
9071    	if(isValid ==  true){    		
9072    	   	var recaptchaResponse = '';
9073    	   	
9074    	   	if(($("#g-recaptcha-response").val() != '') && ($("#g-recaptcha-response").val() != undefined)){
9075    	   		recaptchaResponse = $("#g-recaptcha-response").val();
9076    	   	}
9077    	   	else if(($("#g-recaptcha-response-1").val() != '') && ($("#g-recaptcha-response-1").val() != undefined)) {
9078    	   		recaptchaResponse = $("#g-recaptcha-response-1").val();
9079    	   	}
9080    	   	else if(($("#g-recaptcha-response-2").val() != '') && ($("#g-recaptcha-response-2").val() != undefined)) {
9081    	   		recaptchaResponse = $("#g-recaptcha-response-2").val();
9082    	   	}
9083    	   	else if(($("#g-recaptcha-response-3").val() != '') && ($("#g-recaptcha-response-3").val() != undefined)) {
9084    	   		recaptchaResponse = $("#g-recaptcha-response-3").val();
9085    	   	}
9086    	   	else if(($("#g-recaptcha-response-4").val() != '') && ($("#g-recaptcha-response-4").val() != undefined)) {
9087    	   		recaptchaResponse = $("#g-recaptcha-response-4").val();
9088    	   	}
9089    	   	
9090    	   	//recaptchaResponse = '121h78h98hklkj0980dhouihoHOIHJOnm-ssslklk';
9091	   	
9092              
9093    	   	if(recaptchaResponse === "") {
9094    	      	$('#recaptchaWrong').removeClass('hidden');
9095    	   	}
9096    	   	else{
9097    		   	$('#recaptchaWrong').addClass('hidden');
9098
9099        		if(telefono.getNumber().includes("+")){
9100        			telefono_str = telefono.getNumber();
9101        		}
9102        		else {
9103        			if(telefono.getSelectedCountryData().dialCode){
9104        				telefono_str = '+' + telefono.getSelectedCountryData().dialCode + telefono.getNumber();
9105        			}
9106        			else {
9107        				telefono_str = telefono.getNumber();
9108        			}
9109        		}
9110        		
9111    		    $.ajax({
9112    		        url: _root_web+'/inc/sendmail_gs_alloggio.php',
9113    		        type: 'POST',
9114    		        data: {
9115    					request: 'alloggi',
9116    					email: $('#email').val(),
9117    					nome: $('#nome').val(),
9118    					cognome: $('#cognome').val(),
9119    					telefono: telefono_str,
9120    					//oggetto: $('#oggetto').val(),
9121    					messaggio: $('#messaggio').val(),
9122    					lingua_sito: $('#lingua_sito_richiedi_info').val(),
9123    					id_alloggio: $('#id_alloggio_richiedi_info').val(),
9124    					nome_alloggio: $('#nome_alloggio_richiedi_info').val(),
9125    					link_alloggio: $('#link_alloggio_richiedi_info').val(),
9126    					prezzo_alloggio: $('#prezzo_alloggio_richiedi_info').val(),
9127    					foto_alloggio: $('#foto_alloggio_richiedi_info').val(),
9128    					location_alloggio: $('#location_alloggio_richiedi_info').val(),
9129                                                	captcha: recaptchaResponse
9130                            		        },
9131    		        crossDomain: true,
9132    		        xhrFields: {
9133    		            withCredentials: true
9134    		        },
9135    		        error: function(error) {
9136    		            console.log(error);
9137    		        },
9138    		        success: function(result) {
9139                                                	if(result == 1){
9140                            
9141        		        	
9142$('#messaggio_sent_mail').empty().html('Your request has been sent successfully. Thank y
9142ou for contacting us. You will receive a reply as soon as possible.<br><br>');
9143$('#contenuto_opzionale_sent_mail').empty().append('<b>Want an immediate response? Contact us on Whatsapp</b>');
9144//$('#contenuto_opzionale_sent_mail').append('<br><a class="button_wa" target="_blank" href="https://api.whatsapp.com/send?phone=393511667107&text=test"><i class="fa-brands fa-whatsapp"></i>Send a message</a>');
9145$('#contenuto_opzionale_sent_mail').append('<br><a class="button_wa" target="_blank" href="https://api.whatsapp.com/send?phone=393511667107"><i class="fa-brands fa-whatsapp"></i>Send a message</a>');
9146$('#contenuto_opzionale_sent_mail').append('<br>(number available from 9 a.m. to 6 p.m.)');
9147
9148			
9149	$('#contenuto_opzionale_sent_mail').append('<br><br><b>Discover additional information and services by logging into your private area.</b>');
9150	$('#contenuto_opzionale_sent_mail').append('<br><a class="btn btn-secondary buttonGreenBgWhite customButton" href="https://www.greatestate.it/en/login.html">Log in or register</a>');
9151  
9152    
9153    						_paq.push(['trackGoal', 3]);
9154    						
9155    						bootstrap.Modal.getOrCreateInstance(document.getElementById('modal-richiedi-info-pagine-ricerca')).hide();
9156                            new bootstrap.Modal(document.getElementById('modal_sent_mail_ge')).show();
9157    
9158            		        //$('#email').val('');
9159            		        //$('#nome').val('');
9160            		        //$('#cognome').val('');
9161            		        $('#telefono').val('');
9162            		        //$('#oggetto').val('');
9163            		        $('#messaggio').val('');
9164            		        $("#accetta_privacy").prop("checked", false);
9165            		        $('#accetta_privacy').removeClass('is-valid');
9166            		                                    	grecaptcha.reset();
9167                                                                            	}
9168                            		        }               		
9169    		    });  
9170    	   }
9171    	}
9172    });
9173
9174	$(document).ready(function(){
9175        if(ricerca_libera_alloggi){
9176    		if($(window).width() > 992){  
9177    			$('#ricerca_liberaAlloggi').val(ricerca_libera_alloggi.replace(/\\/g, ''));
9178    		}
9179    		else {
9180    			$('#ricerca_liberaAlloggiMobile').val(ricerca_libera_alloggi.replace(/\\/g, ''));
9181    		}
9182    	}
9183    	else{
9184        	setTimeout(function(){
9185    			$('#ricerca_liberaAlloggi').val('');
9186    			$('#ricerca_liberaAlloggiMobile').val('');
9187        	}, 1);
9188    	}
9189    });
9190	
9191	</script>
9191	
9192	
9193	
9194<div class="offcanvas offcanvas-end" tabindex="-1" id="contattiModal" aria-labelledby="contattiModalLabel">
9195  	<div class="offcanvas-header">
9196    	<h5 id="contattiModalLabel">Contacts</h5>
9197    	<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
9198  	</div>
9199  	<div class="line">
9200  		<hr>
9201  	</div>
9202	<div class="offcanvas-body">
9203		<form id="contact_form_richiedi_info_canvas" class="row formStyle g-3" autocomplete="off" novalidate>
9204          	<div class="col-lg-6 col-md-6 col-12">
9205            	<label for="nome_richiedi_info_canvas" class="form-label">Name</label>
9206            	<input type="text" class="form-control" id="nome_richiedi_info_canvas" placeholder="enter your name" value="">
9207          	</div>
9208          	<div class="col-lg-6 col-md-6 col-12">
9209            	<label for="cognome_richiedi_info_canvas" class="form-label">Last Name</label>
9210            	<input type="text" class="form-control" id="cognome_richiedi_info_canvas" placeholder="enter your last name" value="">
9211          	</div>
9212          	<div class="col-lg-6 col-md-6 col-12">
9213            	<label for="telefono_richiedi_info_canvas" class="form-label">Phone</label>
9214            	<input type="tel" class="form-control" id="telefono_richiedi_info_canvas" placeholder="enter your telephone number followed by the country code">
9215            	<p id="telefonoWrong_richiedi_info_canvas" class="wrongFieldForm hidden">Invalid phone</p>
9216          	</div>
9217			<div class="col-lg-6 col-md-6 col-12">
9218				<label for="email_richiedi_info_canvas" class="form-label">Email</label>
9219				<input type="email" class="form-control" id="email_richiedi_info_canvas" placeholder="Enter your email" value="">
9220				<p id="emailWrong_richiedi_info_canvas" class="wrongFieldForm hidden">Invalid email</p>
9221			</div>
9222          	<div class="col-12">
9223				<label for="messaggio_richiedi_info_canvas" class="form-label">Message</label>
9224				<textarea rows="6" class="form-control" id="messaggio_richiedi_info_canvas"></textarea>
9225          	</div>
9226          	<div class="col-12 form-check position-relative text-center custom_display">
9227                <input class="form-check-input checkStyle accetta_privacy" type="checkbox" value="" id="accetta_privacy_richiedi_info_canvas" name="accetta_privacy_richiedi_info_canvas">
9228                <label class="form-check-label checkLabelStyle" for="accetta_privacy_richiedi_info_canvas" id="accetta_privacyLabel">
9229                    I have read and accepted the <a target="_blank" href="privacy.html">privacy policy</a> and I authorize my personal data processing                </label>
9230          	</div>
9231                          	<div class="col-12 text-center">
9232					<div class="g-recaptcha recapForm" data-sitekey="6LfDluQoAAAAAMecTfW0UpSKnSPpoVLFEyStbFnp"></div>
9233					<p id="recaptchaWrong_richiedi_info_canvas" class="hidden">Prove you're not a robot</p>
9234              	</div>
9235                      	<!-- <div class="d-grid gap-2 col-5 mx-auto my-0"> -->
9236          	<div class="col-12 text-center">
9237          		<input type="hidden" id="pagina_di_provenienza_invio_mail_richiedi_info_canvas" value="https://www.greatestate.it/en/luxury-rentals-search.html">
9238          		<input type="hidden" id="lingua_sito_richiedi_info_canvas" value="en">
9239          		<button type="submit" class="btn btn-primary buttonGreenBgLightgrey">Send a request</button>
9240          	</div>
9241		</form>
9242	</div>
9243</div>
9244
9245<script>
9246
9247$('#contattiModal').on('show.bs.offcanvas', function (e) {
9248	$("#stickyMenu").addClass("hidden");
9249	$("#stickyMenuMobile").addClass("hidden");
9250	$("#back-to-top").addClass("hidden");
9251})
9252$('#contattiModal').on('hidden.bs.offcanvas', function (e) {
9253	$("#stickyMenu").removeClass("hidden");
9254	$("#stickyMenuMobile").removeClass("hidden");
9255	$("#back-to-top").removeClass("hidden");
9256})
9257
9258const input_richiedi_info_canvas = document.querySelector("#telefono_richiedi_info_canvas");
9259const telefono_richiedi_info_canvas = window.intlTelInput(input_richiedi_info_canvas, {
9260	countryOrder: ["it", "us", "gb", "de", "nl", "be"],
9261	utilsScript: "https://cdn.greatestate.it/ge/js/utils.js?v=0.2.4",
9262});
9263var telefono_richiedi_info_canvas_str = '';
9264
9265function fieldCheckContatti(){
9266	let isValid = true;
9267	let firstInvalid = '';
9268	
9269	if($('#email_richiedi_info_canvas').val() == ''){
9270		$('#email_richiedi_info_canvas').addClass('is-invalid');
9271		$('#email_richiedi_info_canvas').removeClass('is-valid');
9272		firstInvalid = 'email_richiedi_info_canvas';
9273		isValid = false;
9274	}
9275	else{
9276		var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
9277		if(regex.test($('#email_richiedi_info_canvas').val()) == true){
9278			$('#emailWrong_richiedi_info_canvas').addClass('hidden');
9279			$('#email_richiedi_info_canvas').addClass('is-valid');
9280			$('#email_richiedi_info_canvas').removeClass('is-invalid');        			
9281		}
9282		else{
9283			$('#emailWrong_richiedi_info_canvas').removeClass('hidden');
9284			$('#email_richiedi_info_canvas').addClass('is-invalid');
9285			$('#email_richiedi_info_canvas').removeClass('is-valid');
9286			firstInvalid = 'email_richiedi_info_canvas';
9287			isValid = false;        			
9288		}
9289	}   
9290	
9291	if($('#nome_richiedi_info_canvas').val() == ''){
9292		$('#nome_richiedi_info_canvas').addClass('is-invalid');
9293		$('#nome_richiedi_info_canvas').removeClass('is-valid');
9294		if(firstInvalid == ''){
9295			firstInvalid = 'nome_richiedi_info_canvas';
9296		}
9297		isValid = false;
9298	}
9299	else{
9300		$('#nome_richiedi_info_canvas').addClass('is-valid');
9301		$('#nome_richiedi_info_canvas').removeClass('is-invalid');
9302	}    	
9303
9304	if($('#cognome_richiedi_info_canvas').val() == ''){
9305		$('#cognome_richiedi_info_canvas').addClass('is-invalid');
9306		$('#cognome_richiedi_info_canvas').removeClass('is-valid');
9307		if(firstInvalid == ''){
9308			firstInvalid = 'cognome_richiedi_info_canvas';
9309		}
9310		isValid = false;
9311	}
9312	else{
9313		$('#cognome_richiedi_info_canvas').addClass('is-valid');
9314		$('#cognome_richiedi_info_canvas').removeClass('is-invalid');
9315	}    	
9316
9317	if($('#telefono_richiedi_info_canvas').val() == ''){
9318		$('#telefono_richiedi_info_canvas').addClass('is-invalid');
9319		$('#telefono_richiedi_info_canvas').removeClass('is-valid');
9320		if(firstInvalid == ''){
9321			firstInvalid = 'telefono_richiedi_info_canvas';
9322		}
9323		isValid = false;
9324	}
9325	else{
9326		//if((($('#telefono_richiedi_info_canvas').val()).indexOf("00") == -1) && (($('#telefono_richiedi_info_canvas').val()).indexOf("+") == -1)){
9327		if(!telefono_richiedi_info_canvas.isValidNumber()) {
9328			$('#telefonoWrong_richiedi_info_canvas').removeClass('hidden');
9329			$('#telefono_richiedi_info_canvas').addClass('is-invalid');
9330			$('#telefono_richiedi_info_canvas').removeClass('is-valid');
9331			if(firstInvalid == ''){
9332				firstInvalid = 'telefono_richiedi_info_canvas';
9333			}
9334			isValid = false;
9335		}
9336		else{
9337			$('#telefonoWrong_richiedi_info_canvas').addClass('hidden');
9338			$('#telefono_richiedi_info_canvas').addClass('is-valid');
9339			$('#telefono_richiedi_info_canvas').removeClass('is-invalid');
9340		}
9341	}  
9342
9343	if($('#messaggio_richiedi_info_canvas').val() == ''){
9344		$('#messaggio_richiedi_info_canvas').addClass('is-invalid');
9345		$('#messaggio_richiedi_info_canvas').removeClass('is-valid');
9346		isValid = false;
9347	}
9348	else{
9349		$('#messaggio_richiedi_info_canvas').addClass('is-valid');
9350		$('#messaggio_richiedi_info_canvas').removeClass('is-invalid');
9351	}
9352	
9353	if($('#accetta_privacy_richiedi_info_canvas').is(':checked')){
9354		$('#accetta_privacy_richiedi_info_canvas').addClass('is-valid');
9355		$('#accetta_privacy_richiedi_info_canvas').removeClass('is-invalid');
9356	}
9357	else{
9358		$('#accetta_privacy_richiedi_info_canvas').addClass('is-invalid');
9359		$('#accetta_privacy_richiedi_info_canvas').removeClass('is-valid');
9360		isValid = false;
9361	}
9362	
9363	if(isValid == false){
9364		if(firstInvalid != ''){
9365			$('#'+firstInvalid).focus();
9366		}
9367	}
9368	return isValid;
9369}
9370
9371$("#contact_form_richiedi_info_canvas").on("submit", function(event){
9372	event.preventDefault();
9373	
9374	let isValid;
9375	isValid = fieldCheckContatti();   		
9376	
9377	if(isValid ==  true){    		
9378	   	var recaptchaResponse = '';
9379	   	
9380	   	if(($("#g-recaptcha-response").val() != '') && ($("#g-recaptcha-response").val() != undefined)){
9381	   		recaptchaResponse = $("#g-recaptcha-response").val();
9382	   	}
9383	   	else if(($("#g-recaptcha-response-1").val() != '') && ($("#g-recaptcha-response-1").val() != undefined)) {
9384	   		recaptchaResponse = $("#g-recaptcha-response-1").val();
9385	   	}
9386	   	else if(($("#g-recaptcha-response-2").val() != '') && ($("#g-recaptcha-response-2").val() != undefined)) {
9387	   		recaptchaResponse = $("#g-recaptcha-response-2").val();
9388	   	}
9389	   	else if(($("#g-recaptcha-response-3").val() != '') && ($("#g-recaptcha-response-3").val() != undefined)) {
9390	   		recaptchaResponse = $("#g-recaptcha-response-3").val();
9391	   	}
9392	   	else if(($("#g-recaptcha-response-4").val() != '') && ($("#g-recaptcha-response-4").val() != undefined)) {
9393	   		recaptchaResponse = $("#g-recaptcha-response-4").val();
9394	   	}
9395	   	
9396	   	//recaptchaResponse = '121h78h98hklkj0980dhouihoHOIHJOnm-ssslklk';
9397	   	
9398          
9399	   	if(recaptchaResponse === "") {
9400	      	$('#recaptchaWrong_richiedi_info_canvas').removeClass('hidden');
9401	   	}
9402	   	else{
9403		   	$('#recaptchaWrong_richiedi_info_canvas').addClass('hidden');
9404
9405    		if(telefono_richiedi_info_canvas.getNumber().includes("+")){
9406    			telefono_richiedi_info_canvas_str = telefono_richiedi_info_canvas.getNumber();
9407    		}
9408    		else {
9409    			if(telefono_richiedi_info_canvas.getSelectedCountryData().dialCode){
9410    				telefono_richiedi_info_canvas_str = '+' + telefono_richiedi_info_canvas.getSelectedCountryData().dialCode + telefono_richiedi_info_canvas.getNumber();
9411    			}
9412    			else {
9413    				telefono_richiedi_info_canvas_str = telefono_richiedi_info_canvas.getNumber();
9414    			}
9415    		}
9416    		
9417		    $.ajax({
9418		        url: _root_web+'/inc/sendmail_ge.php',
9419		        type: 'POST',
9420		        data: {
9421					request: 'richiedi_info_canvas',
9422					email: $('#email_richiedi_info_canvas').val(),
9423					nome: $('#nome_richiedi_info_canvas').val(),
9424					cognome: $('#cognome_richiedi_info_canvas').val(),
9425					telefono: telefono_richiedi_info_canvas_str,
9426					messaggio: $('#messaggio_richiedi_info_canvas').val(),
9427					pagina_di_provenienza_invio_mail: $('#pagina_di_provenienza_invio_mail_richiedi_info_canvas').val(),
9428					lingua_sito: $('#lingua_sito_richiedi_info_canvas').val(),
9429                                        	captcha: recaptchaResponse
9430                    		        },
9431		        crossDomain: true,
9432		        xhrFields: {
9433		            withCredentials: true
9434		        },
9435		        error: function(error) {
9436		            console.log(error);
9437		        },
9438		        success: function(result) {
9439                                        	if(result == 1){
9440                    
9441    		        	
9442$('#messaggio_sent_mail').empty().html('Your request has been sent successfully. Thank you for contacting us. You will receive a reply as soon as possible.<br><br>');
9443$('#contenuto_opzionale_sent_mail').empty().append('<b>Want an immediate response? Contact us on Whatsapp</b>');
9444//$('#contenuto_opzionale_sent_mail').append('<br><a class="button_wa" target="_blank" href="https://api.whatsapp.com/send?phone=393511667107&text=test"><i class="fa-brands fa-whatsapp"></i>Send a message</a>');
9445$('#contenuto_opzionale_sent_mail').append('<br><a class="button_wa" target="_blank" href="https://api.whatsapp.com/send?phone=393511667107"><i class="fa-brands fa-whatsapp"></i>Send a message</a>');
9446$('#contenuto_opzionale_sent_mail').append('<br>(number available from 9 a.m. to 6 p.m.)');
9447
9448			
9449	$('#contenuto_opzionale_sent_mail').append('<br><br><b>Discover additional information and services by logging into your private area.</b>');
9450	$('#contenuto_opzionale_sent_mail').append('<br><a class="btn btn-secondary buttonGreenBgWhite customButton" href="https://www.greatestate.it/en/login.html">Log in or register</a>');
9451  
9452
9453						_paq.push(['trackGoal', 3]);
9454						
9455						bootstrap.Offcanvas.getOrCreateInstance(document.getElementById('contattiModal')).hide();
9456                        new bootstrap.Modal(document.getElementById('modal_sent_mail_ge')).show();
9457
9458        		        $('#telefono_richiedi_info_canvas').val('');
9459        		        $('#messaggio_richiedi_info_canvas').val('');
9460        		        $("#accetta_privacy_richiedi_info_canvas").prop("checked", false);
9461        		        $('#accetta_privacy_richiedi_info_canvas').removeClass('is-valid');
9462        		                                	grecaptcha.reset();
9463                                                                	}
9464                    		        }               		
9465		    });  
9466	   }
9467	}
9468});
9469
9470</script>
9470
9471
9472	
9473	
9474<div id="condividiModal" class="modal fade" tabindex="-1" aria-hidden="true">
9475  	<div class="modal-dialog modal-sm modal-dialog-centered modal-dialog-scrollable">
9476    	<div class="modal-content">
9477      		<div class="modal-header">
9478        		<h5 class="modal-title">Share the listing</h5>
9479        		<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
9480      		</div>
9481      		<div class="modal-body text-center">
9482        		<div class="row">
9483        			<div class="col-lg-12 mt-2">
9484                		<span id="email_share_button" class="btn btn-primary share_button text-uppercase" data-bs-target="#modal-invia-amico" data-bs-toggle="modal">
9485                			<div id="email_share_icon"><i class="fa-solid fa-envelope"></i></div><div class="share_text">Email</div>
9486                		</span>
9487        			</div>
9488        			<div class="col-lg-12 annuncio-only">
9489                		<a id="whatsapp_share_button" class="btn btn-primary share_button text-uppercase" target="_blank" href="" data-action="share/whatsapp/share">
9490                			<div id="whatsapp_share_icon"></div><div class="share_text">Whatsapp</div>
9491                		</a>
9492        			</div>
9493        			<div class="col-lg-12 annuncio-only">
9494                		<a id="telegram_share_button" class="btn btn-primary share_button text-uppercase" target="_blank">
9495                			<div id="telegram_share_icon"></div><div class="share_text">Telegram</div>
9496                		</a>
9497        			</div>
9498        			<div class="col-lg-12 annuncio-only">
9499                		<a id="facebook_share_button" class="btn btn-primary share_button text-uppercase" target="_blank" href="">
9500                			<div id="facebook_share_icon"></div><div class="share_text">Facebook</div>
9501                		</a>  
9502        			</div>
9503        			<div class="col-lg-12 annuncio-only">
9504                		<a id="x_share_button" class="btn btn-primary share_button text-uppercase" target="_blank">
9505                			<div id="x_share_icon"></div><div class="share_text">X</div>
9506                		</a>
9507        			</div>
9508        			<div class="col-lg-12 annuncio-only">
9509                		<a id="linkedin_share_button" class="btn btn-primary share_button text-uppercase" target="_blank">
9510                			<div id="linkedin_share_icon"></div><div class="share_text">LinkedIn</div>
9511                		</a>
9512        			</div>
9513        			<div class="col-lg-12 annuncio-only">
9514                		<span id="copy-link" class="btn btn-primary share_button text-uppercase" onclick="textcopy('https://www.greatestate.it/en/luxury-rentals-search.html')">
9515                			<i class="fa-regular fa-copy"></i><div class="share_text">Copy link</div>
9516                		</span>
9517					</div>
9518        		</div>
9519      		</div>
9520    	</div>
9521  	</div>
9522</div>
9523
9524<div id="modal-invia-amico" class="modal fade" tabindex='-1'>
9525  	<div class="modal-dialog modal-lg modal-dialog-centered modal-fullscreen-sm-down modal-dialog-scrollable">
9526    	<div class="modal-content">
9527      		<div class="modal-header">
9528        		<h5 class="modal-title">Send to a friend</h5>
9529        		<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
9530      		</div>
9531      		<div class="modal-body">
9532      			<div class="row">
9533          			<div class="col-8" id="left">
9534						<form id="invia_ad_un_amico_form" class="row formStyle g-3" autocomplete="off" novalidate>
9535                          	<div class="col-lg-6 col-md-6 col-12">
9536                            	<label for="nome_mittente_invia_amico" class="form-label">Name</label>
9537                            	<input type="text" class="form-control" id="nome_mittente_invia_amico" placeholder="enter your name" value="">
9538                          	</div>
9539                          	<div class="col-lg-6 col-md-6 col-12">
9540                            	<label for="cognome_mittente_invia_amico" class="form-label">Last Name</label>
9541                            	<input type="text" class="form-control" id="cognome_mittente_invia_amico" placeholder="enter your last name" value="">
9542                          	</div>
9543            				<div class="col-12">
9544            					<label for="email_mittente_invia_amico" class="form-label">Email address</label>
9545            					<input type="email" class="form-control" id="email_mittente_invia_amico" placeholder="Enter your email" value="">
9546            				</div>
9547            				<div class="col-12">
9548            					<label for="email_destinatario_invia_amico" class="form-label">Recipient's email address</label>
9549            					<input type="email" class="form-control" id="email_destinatario_invia_amico" placeholder="Enter recipient's email address" value="">
9550            					<p id="emailWrong_destinatario_invia_amico" class="wrongFieldForm hidden">Invalid email</p>
9551            				</div>
9552                          	<div class="col-12">
9553            					<label for="messaggio_invia_amico" class="form-label">Message</label>
9554            					<textarea rows="3" class="form-control" id="messaggio_invia_amico">I found a property on the Great Estate website that might interest you</textarea>
9555                          	</div>
9556                                                          	<div class="col-12 text-center">
9557                					<div class="g-recaptcha recapForm" data-sitekey="6LfDluQoAAAAAMecTfW0UpSKnSPpoVLFEyStbFnp"></div>
9558                					<p id="recaptchaWrong_invia_amico" class="hidden">Prove you're not a robot</p>
9559                              	</div>
9560                              
9561                          	<div class="col-12 text-center mt-0">
9562                          		<input type="hidden" id="id_annuncio_invia_amico" value="">
9563                          		<input type="hidden" id="tipo_annuncio_invia_amico" value="">
9564                          		<input type="hidden" id="link_annuncio_invia_amico" value="">
9565                          		<input type="hidden" id="nome_annuncio_invia_amico" value="">
9566                          		<input type="hidden" id="tipologia_annuncio_invia_amico" value="">
9567                          		<input type="hidden" id="prezzo_annuncio_invia_amico" value="">
9568                          		<input type="hidden" id="foto_annuncio_invia_amico" value="">
9569                          		<input type="hidden" id="location_annuncio_invia_amico" value="">
9570                          		<button type="submit" class="btn btn-primary buttonGreenBgWhite">Send</button>
9571                          	</div>
9572            			</form>	
9573          			</div>
9574          			<div class="col-4" id="right">
9575          				<div class="nome_annuncio_modal"></div>
9576          				<div class="rif_annuncio_modal"></div>
9577          				<div class="prezzo_annuncio_modal"></div>
9578          				<div class="hidden tipologia_annuncio_modal"></div>
9579          				<img alt="" class="foto_annuncio_modal w-100 mt-1" src="">
9580          			</div>
9581          		</div>
9582      		</div>
9583    	</div>
9584  	</div>
9585</div>
9586
9587<script>
9588		
9589    $('#condividiModal').on('hidden.bs.modal', function (e) {
9590    	$('#copy-link').html("<i class=\"fa-regular fa-copy\"></i>Copy link");
9591    })
9592
9593    function apriModalCondividiPagineRicerca(tipo_annuncio, tipo_pagina, id, link) {
9594    	$('#copy-link').html('<i class="fa-regular fa-copy"></i>Copy link');
9595    	$('#copy-link').attr('onclick', 'textcopy(\'' + _root_web + '/' + _lang + '/' + link + '\')');
9596    	
9597    	if(tipo_pagina == 2){
9598    		$('.annuncio-only').addClass('hidden');
9599    	}
9600    	else {
9601    		$('.annuncio-only').removeClass('hidden');
9602    	}
9603    	
9604    	$('.annuncio-only').removeClass('hidden');
9605
9606		$("#id_annuncio_invia_amico").val(id);
9607		$("#tipo_annuncio_invia_amico").val(tipo_annuncio);
9608		$("#link_annuncio_invia_amico").val(_root_web + '/' + _lang + '/' + link);
9609		
9610		if(tipo_annuncio == 1){
9611        	$('.nome_annuncio_modal').empty().append($('#nome_immobile_'+id).val());
9612        	$('.rif_annuncio_modal').empty().append('<b>Code</b> ' + id);
9613        	$('.prezzo_annuncio_modal').empty().append('<b>Price</b> ' + $('#prezzo_immobile_'+id).val());
9614        	if($('#tipologia_immobile_'+id).val()){
9615        		$('.tipologia_annuncio_modal').empty().append('<b>Typology</b> ' + $('#tipologia_immobile_'+id).val());
9616        		$('.tipologia_annuncio_modal').removeClass('hidden');
9617        	}
9618        	$('.foto_annuncio_modal').attr('src', $('#foto_immobile_'+id).val());
9619        	$('.foto_annuncio_modal').attr('alt', $('#nome_immobile_'+id).val());
9620        	
9621        	$("#nome_annuncio_invia_amico").val($('#nome_immobile_'+id).val());
9622        	if($('#tipologia_immobile_'+id).val()){
9623        		$("#tipologia_annuncio_invia_amico").val($('#tipologia_immobile_'+id).val());
9624        	}
9625        	$("#prezzo_annuncio_invia_amico").val($('#prezzo_immobile_'+id).val());
9626        	$("#foto_annuncio_invia_amico").val($('#foto_immobile_'+id).val());
9627        	$("#location_annuncio_invia_amico").val($('#location_immobile_'+id).val());
9628		_paq.push(['trackGoal', 9]);
9629		}
9630		else {
9631			$('.nome_annuncio_modal').empty().append($('#nome_alloggio_'+id).val());
9632			$('.rif_annuncio_modal').empty().append('<b>Code</b> ' + id);
9633        	$('.prezzo_annuncio_modal').empty().append('<b>Price</b> ' + $('#prezzo_alloggio_'+id).val());
9634        	if($('#tipologia_alloggio_'+id).val()){
9635        		$('.tipologia_annuncio_modal').empty().append('<b>Typology</b> ' + $('#tipologia_alloggio_'+id).val());
9636        		$('.tipologia_annuncio_modal').removeClass('hidden');
9637        	}
9638        	$('.foto_annuncio_modal').attr('src', $('#foto_alloggio_'+id).val());
9639			$('.foto_annuncio_modal').attr('alt', $('#nome_alloggio_'+id).val());
9640			
9641        	$("#nome_annuncio_invia_amico").val($('#nome_alloggio_'+id).val());
9642        	if($('#tipologia_alloggio_'+id).val()){
9643        		$("#tipologia_annuncio_invia_amico").val($('#tipologia_alloggio_'+id).val());
9644        	}
9645        	$("#prezzo_annuncio_invia_amico").val($('#prezzo_alloggio_'+id).val());
9646        	$("#foto_annuncio_invia_amico").val($('#foto_alloggio_'+id).val());
9647        	$("#location_annuncio_invia_amico").val($('#location_alloggio_'+id).val());
9648		}
9649    	
9650		$('#whatsapp_share_button').attr('href', 'https://api.whatsapp.com/send?text=' + _root_web + '/' + _lang + '/' + link);
9651		$('#telegram_share_button').attr('href', 'https://t.me/share/url?url=' + _root_web + '/' + _lang + '/' + link + '&text=' + $('#nome_immobile_'+id).val());
9652		$('#facebook_share_button').attr('href', 'https://www.facebook.com/dialog/share?app_id=2679461769011839&display=popup&href=' + _root_web + '/' + _lang + '/' + link + '&redirect_uri=' + _root_web + '/' + _lang + '/' + link);
9653		$('#x_share_button').attr('href', 'https://twitter.com/intent/tweet?text=' + $('#nome_immobile_'+id).val() + ' ' + _root_web + '/' + _lang + '/' + link);
9654		$('#linkedin_share_button').attr('href', 'https://www.linkedin.com/sharing/share-offsite/?url=' + _root_web + '/' + _lang + '/' + link);
9655		
9656    	new bootstrap.Modal(document.getElementById('condividiModal')).show();
9657    }
9658    
9659    function textcopy(text) {
9660    	var scrollPos = $(window).scrollTop();
9661        /*setTimeout(function() {
9662        	$('#copied_tip').fadeOut("slow");
9663        }, 2000);
9664        $('#copy-link').append("<div class='tip' id='copied_tip'>Link copied</div>");*/
9665        $('#copy-link').html("<i class=\"fa-regular fa-copy\"></i>  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>Link copied</b>");
9666        var textField = document.createElement('textarea');
9667        textField.innerText = text;
9668        document.body.appendChild(textField);
9669        textField.select();
9670        textField.focus();
9671        $('html,body').animate({
9672            scrollTop: scrollPos
9673        }, 0);
9674        document.execCommand('copy');
9675        textField.remove();
9676    }
9677
9678    function fieldCheck_invia_ad_un_amico_form(){
9679    	let isValid = true;
9680    	let firstInvalid = '';
9681
9682    	if($('#nome_mittente_invia_amico').val() == ''){
9683    		$('#nome_mittente_invia_amico').addClass('is-invalid');
9684    		$('#nome_mittente_invia_amico').removeClass('is-valid');
9685    		if(firstInvalid == ''){
9686    			firstInvalid = 'nome_mittente_invia_amico';
9687    		}
9688    		isValid = false;
9689    	}
9690    	else{
9691    		$('#nome_mittente_invia_amico').addClass('is-valid');
9692    		$('#nome_mittente_invia_amico').removeClass('is-invalid');
9693    	}    	
9694    
9695    	if($('#cognome_mittente_invia_amico').val() == ''){
9696    		$('#cognome_mittente_invia_amico').addClass('is-invalid');
9697    		$('#cognome_mittente_invia_amico').removeClass('is-valid');
9698    		if(firstInvalid == ''){
9699    			firstInvalid = 'cognome_mittente_invia_amico';
9700    		}
9701    		isValid = false;
9702    	}
9703    	else{
9704    		$('#cognome_mittente_invia_amico').addClass('is-valid');
9705    		$('#cognome_mittente_invia_amico').removeClass('is-invalid');
9706    	}   
9707    	
9708    	if($('#email_mittente_invia_amico').val() == ''){
9709    		$('#email_mittente_invia_amico').addClass('is-invalid');
9710    		$('#email_mittente_invia_amico').removeClass('is-valid');
9711    		firstInvalid = 'email_mittente_invia_amico';
9712    		isValid = false;
9713    	}
9714    	else{
9715    		var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
9716    		if(regex.test($('#email_mittente_invia_amico').val()) == true){
9717    			$('#emailWrong_mittente_invia_amico').addClass('hidden');
9718    			$('#email_mittente_invia_amico').addClass('is-valid');
9719    			$('#email_mittente_invia_amico').removeClass('is-invalid');        			
9720    		}
9721    		else{
9722    			$('#emailWrong_mittente_invia_amico').removeClass('hidden');
9723    			$('#email_mittente_invia_amico').addClass('is-invalid');
9724    			$('#email_mittente_invia_amico').removeClass('is-valid');
9725    			firstInvalid = 'email_mittente_invia_amico';
9726    			isValid = false;        			
9727    		}
9728    	}    	
9729
9730    	if($('#email_destinatario_invia_amico').val() == ''){
9731    		$('#email_destinatario_invia_amico').addClass('is-invalid');
9732    		$('#email_destinatario_invia_amico').removeClass('is-valid');
9733    		firstInvalid = 'email_destinatario_invia_amico';
9734    		isValid = false;
9735    	}
9736    	else{
9737    		var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
9738    		if(regex.test($('#email_destinatario_invia_amico').val()) == true){
9739    			$('#emailWrong_destinatario_invia_amico').addClass('hidden');
9740    			$('#email_destinatario_invia_amico').addClass('is-valid');
9741    			$('#email_destinatario_invia_amico').removeClass('is-invalid');        			
9742    		}
9743    		else{
9744    			$('#emailWrong_destinatario_invia_amico').removeClass('hidden');
9745    			$('#email_destinatario_invia_amico').addClass('is-invalid');
9746    			$('#email_destinatario_invia_amico').removeClass('is-valid');
9747    			firstInvalid = 'email_destinatario_invia_amico';
9748    			isValid = false;        			
9749    		}
9750    	}   
9751    	
9752    	if($('#messaggio_invia_amico').val() == ''){
9753    		$('#messaggio_invia_amico').addClass('is-invalid');
9754    		$('#messaggio_invia_amico').removeClass('is-valid');
9755    		isValid = false;
9756    	}
9757    	else{
9758    		$('#messaggio_invia_amico').addClass('is-valid');
9759    		$('#messaggio_invia_amico').removeClass('is-invalid');
9760    	}
9761    	
9762    	if(isValid == false){
9763    		if(firstInvalid != ''){
9764    			$('#'+firstInvalid).focus();
9765    		}
9766    	}
9767    	return isValid;
9768    }
9769    
9770    $("#invia_ad_un_amico_form").on("submit", function(event){
9771    	event.preventDefault();
9772    	
9773    	let isValid;
9774    	isValid = fieldCheck_invia_ad_un_amico_form();   		
9775
9776    	if(isValid ==  true){    	
9777	   	var recaptchaResponse = '';
9778	   	
9779	   	if(($("#g-recaptcha-response").val() != '') && ($("#g-recaptcha-response").val() != undefined)){
9780	   		recaptchaResponse = $("#g-recaptcha-response").val();
9781	   	}
9782	   	else if(($("#g-recaptcha-response-1").val() != '') && ($("#g-recaptcha-response-1").val() != undefined)) {
9783	   		recaptchaResponse = $("#g-recaptcha-response-1").val();
9784	   	}
9785	   	else if(($("#g-recaptcha-response-2").val() != '') && ($("#g-recaptcha-response-2").val() != undefined)) {
9786	   		recaptchaResponse = $("#g-recaptcha-response-2").val();
9787	   	}
9788	   	else if(($("#g-recaptcha-response-3").val() != '') && ($("#g-recaptcha-response-3").val() != undefined)) {
9789	   		recaptchaResponse = $("#g-recaptcha-response-3").val();
9790	   	}
9791	   	else if(($("#g-recaptcha-response-4").val() != '') && ($("#g-recaptcha-response-4").val() != undefined)) {
9792	   		recaptchaResponse = $("#g-recaptcha-response-4").val();
9793	   	}
9794	   	
9795	   	//recaptchaResponse = '121h78h98hklkj0980dhouihoHOIHJOnm-ssslklk';
9796	   	
9797              
9798    	   	if(recaptchaResponse === "") {
9799    	      	$('#recaptchaWrong_invia_amico').removeClass('hidden');
9800    	   	}
9801    	   	else{
9802    		   	$('#recaptchaWrong_invia_amico').addClass('hidden');
9803
9804    		    $.ajax({
9805    		        url: _root_web+'/inc/sendmail_invia_amico.php',
9806    		        type: 'POST',
9807    		        data: {
9808    					nome_mittente: $('#nome_mittente_invia_amico').val(),
9809    					cognome_mittente: $('#cognome_mittente_invia_amico').val(),
9810    					email_mittente: $('#email_mittente_invia_amico').val(),
9811    					email_destinatario: $('#email_destinatario_invia_amico').val(),
9812    					messaggio: $('#messaggio_invia_amico').val(),
9813    					id_annuncio: $('#id_annuncio_invia_amico').val(),
9814    					tipo_annuncio: $('#tipo_annuncio_invia_amico').val(),
9815    					link_annuncio: $('#link_annuncio_invia_amico').val(),
9816    					lingua_sito: _lang,
9817    					nome_annuncio: $('#nome_annuncio_invia_amico').val(),
9818    					tipologia_annuncio: $('#tipologia_annuncio_invia_amico').val(),
9819    					prezzo_annuncio: $('#prezzo_annuncio_invia_amico').val(),
9820    					foto_annuncio: $('#foto_annuncio_invia_amico').val(),
9821    					location_annuncio: $('#location_annuncio_invia_amico').val(),
9822                                                	captcha: recaptchaResponse
9823                            		        },
9824    		        crossDomain: true,
9825    		        xhrFields: {
9826    		            withCredentials: true
9827    		        },
9828    		        error: function(error) {
9829    		            console.log(error);
9830    		        },
9831    		        success: function(result) {
9832                                                	if(result == 1){
9833                        							
9834							$('#messaggio_sent_mail').empty().html('Your request has been sent successfully.');
9835    
9836    						_paq.push(['trackGoal', 3]);
9837    						
9838    						bootstrap.Modal.getOrCreateInstance(document.getElementById('modal-invia-amico')).hide();
9839                            new bootstrap.Modal(document.getElementById('modal_sent_mail_ge')).show();
9840    
9841            		        //$('#email').val('');
9842            		        //$('#nome').val('');
9843            		        //$('#cognome').val('');
9844            		        $('#messaggio').val('');
9845            		        $("#accetta_privacy").prop("checked", false);
9846            		        $('#accetta_privacy').removeClass('is-valid');
9847            		                                    	grecaptcha.reset();
9848                                                                            	}
9849                            		        }               		
9850    		    });  
9851    	   }
9852    	}
9853    });
9854
9855</script>
9855
9856
9857	
9857<script>
9858
9859(function(factory) {
9860	if (typeof define === 'function' && define.amd) {
9861    	// AMD
9862    	define(['jquery'], factory);
9863  	} else if (typeof module === 'object' && module.exports) {
9864    	// CommonJS
9865    	module.exports = factory(require('jquery'));
9866  	} else {
9867    	// Browser globals
9868    	factory(jQuery);
9869  	}
9870}(function($) {
9871    "use strict";
9872
9873    var defaults = {
9874		minHeight: 0,
9875      	elements: [],
9876      	percentage: true,
9877      	userTiming: true,
9878      	pixelDepth: true,
9879      	nonInteraction: true,
9880      	trackerName: false,
9881      	dataLayer: 'dataLayer'
9882    };
9883
9884    var $window = $(window),
9885    cache = [],
9886    scrollEventBound = false,
9887    lastPixelDepth = 0,
9888    standardEventHandler;
9889
9890    $.scrollDepth = function(options) {
9891      	var startTime = +new Date;
9892
9893      	options = $.extend({}, defaults, options);
9894
9895      	// Return early if document height is too small
9896      	if ( $(document).height() < options.minHeight ) {
9897        	return;
9898      	}
9899
9900      	if (typeof options.eventHandler === "function") {
9901        	standardEventHandler = options.eventHandler;
9902      	} else if (typeof window[options.dataLayer] !== "undefined" && typeof window[options.dataLayer].push === "function") {
9903        	standardEventHandler = function(data) {
9904          		window[options.dataLayer].push(data);
9905        	};
9906      	}
9907
9908      	function calculateMarks(docHeight) {
9909        	return {
9910          		'25%' : parseInt(docHeight * 0.25, 10),
9911          		'50%' : parseInt(docHeight * 0.50, 10),
9912          		'75%' : parseInt(docHeight * 0.75, 10),
9913          		// Cushion to trigger 100% event in iOS
9914          		'100%': docHeight - 5
9915        	};
9916      	}
9917      	
9918      	function checkMarks(marks, scrollDistance, timing) {
9919        	// Check each active mark
9920        	$.each(marks, function(key, val) {
9921          		if ( $.inArray(key, cache) === -1 && scrollDistance >= val ) {
9922            		if((key == '50%') || (key == '100%')){
9923            			 _paq.push(['trackEvent', 'Scroll_depth', key]);
9924            		}
9925            		cache.push(key);
9926          		}
9927        	});
9928      	}
9929
9930      	function rounded(scrollDistance) {
9931        	// Returns String
9932        	return (Math.floor(scrollDistance/250) * 250).toString();
9933      	}
9934
9935      	function init() {
9936        	bindScrollDepth();
9937      	}
9938
9939      	// Reset Scroll Depth with the originally initialized options
9940      	$.scrollDepth.reset = function() {
9941        	cache = [];
9942        	lastPixelDepth = 0;
9943        	$window.off('scroll.scrollDepth');
9944        	bindScrollDepth();
9945      	};
9946
9947      	// Add DOM elements to be tracked
9948      	$.scrollDepth.addElements = function(elems) {
9949        	if (typeof elems == "undefined" || !$.isArray(elems)) {
9950          		return;
9951        	}
9952
9953        	$.merge(options.elements, elems);
9954
9955        	// If scroll event has been unbound from window, rebind
9956        	if (!scrollEventBound) {
9957          		bindScrollDepth();
9958        	}
9959      	};
9960
9961      	// Remove DOM elements currently tracked
9962      	$.scrollDepth.removeElements = function(elems) {
9963        	if (typeof elems == "undefined" || !$.isArray(elems)) {
9964          		return;
9965        	}
9966
9967        	$.each(elems, function(index, elem) {
9968          		var inElementsArray = $.inArray(elem, options.elements);
9969          		var inCacheArray = $.inArray(elem, cache);
9970
9971          		if (inElementsArray != -1) {
9972            		options.elements.splice(inElementsArray, 1);
9973          		}
9974
9975          		if (inCacheArray != -1) {
9976            		cache.splice(inCacheArray, 1);
9977          		}
9978        	});
9979      	};
9980
9981      	function throttle(func, wait) {
9982        	var context, args, result;
9983        	var timeout = null;
9984        	var previous = 0;
9985        	var later = function() {
9986          		previous = new Date;
9987          		timeout = null;
9988          		result = func.apply(context, args);
9989        	};
9990        	return function() {
9991          		var now = new Date;
9992          		if (!previous) previous = now;
9993          		var remaining = wait - (now - previous);
9994          		context = this;
9995          		args = arguments;
9996          		if (remaining <= 0) {
9997            		clearTimeout(timeout);
9998            		timeout = null;
9999            		previous = now;
vendor: 1,300 bytes, lines 10000-10046
10000            		result = func.apply(context, args);
10001          		} else if (!timeout) {
10002            		timeout = setTimeout(later, remaining);
10003          		}
10004          		return result;
10005        	};
10006      	}
10007
10008      	function bindScrollDepth() {
10009        	scrollEventBound = true;
10010
10011        	$window.on('scroll.scrollDepth', throttle(function() {
10012
10013          		var docHeight = $(document).height(),
10014            	winHeight = window.innerHeight ? window.innerHeight : $window.height(),
10015            	scrollDistance = $window.scrollTop() + winHeight,
10016
10017            	// Recalculate percentage marks
10018            	marks = calculateMarks(docHeight),
10019
10020            	// Timing
10021            	timing = +new Date - startTime;
10022
10023          		// If all marks already hit, unbind scroll event
10024          		if (cache.length >= options.elements.length + (options.percentage ? 4:0)) {
10025            		$window.off('scroll.scrollDepth');
10026            		scrollEventBound = false;
10027            		return;
10028          		}
10029
10030          		// Check standard marks
10031          		if (options.percentage) {
10032            		checkMarks(marks, scrollDistance, timing);
10033          		}
10034        	}, 500));
10035      	}
10036
10037      	init();
10038    };
10039
10040    // UMD export
10041    return $.scrollDepth;
10042}));
10043
10044$.scrollDepth();
10045     
10046</script>
10046	
10047	
10047<script type="application/ld+json">
10048{ 
10049	"@context" : "https://schema.org",
10050  	"@type" : "RealEstateAgent",
10051	"@id" : "https://www.greatestate.it",	
10052  	"name" : "Great Estate",
10053	"url" : "https://www.greatestate.it",
10054	"logo" : "https://cdn.greatestate.it/ge/img/loghi/greatestate-logo.png",
10055	"image" : "https://cdn.greatestate.it/ge/img/loghi/greatestate-logo.png",
10056  	"description" : "The Great Estate group offers a careful selection of prestigious properties in Italy, innovative tools and a proven method for the management of real estate services at an international level. Great Estate's strength is its people, united by the sharing of common values that place humanity, professionalism and innovation at the centre.",  	
10057  	"telephone" : "+39057859050",
10058	"faxNumber": "+390578850004",
10059  	"email": "[email protected]",
10060	"areaServed": "Tuscany, Umbria, Marche, Lazio, Sardinia, Piedmont, Liguria, Apulia, Campania, Sicily, Lombardy, Emilia-Romagna",
10061  	"address" : {
10062    	"@type" : "PostalAddress",
10063    	"streetAddress" : "Via Piana 15 fraz. Palazzone",
10064    	"addressLocality" : "San Casciano dei Bagni (SI)",
10065    	"addressRegion" : "Toscana",
10066    	"postalCode" : "53040",
10067    	"addressCountry" : "IT"
10068  	},
10069	"founder": "Stefano Petri",
10070	"foundingDate": "2001"
10071}
10072</script>
10072	
10073</body>
10074</html>

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.