var thisLang = "en";
var pI = "6306";
var todaysDate = "24/02/2025";
var calendarTitle = "Please select a date range";
var bookedTitle = "Unavailable";
var availableTitle = "Available";
var unavailableUIAMDates = ["1-2-2025","2-8-2025","16-8-2025","20-12-2025"];
var unavailableUIPMDates = ["30-4-2025","16-8-2025","23-8-2025","31-5-2027"];
var unavailableUIDates = ["1-2-2025","2-2-2025","3-2-2025","4-2-2025","5-2-2025","6-2-2025","7-2-2025","8-2-2025","9-2-2025","10-2-2025","11-2-2025","12-2-2025","13-2-2025","14-2-2025","15-2-2025","16-2-2025","17-2-2025","18-2-2025","19-2-2025","20-2-2025","21-2-2025","22-2-2025","23-2-2025","24-2-2025","25-2-2025","26-2-2025","27-2-2025","28-2-2025","1-3-2025","2-3-2025","3-3-2025","4-3-2025","5-3-2025","6-3-2025","7-3-2025","8-3-2025","9-3-2025","10-3-2025","11-3-2025","12-3-2025","13-3-2025","14-3-2025","15-3-2025","16-3-2025","17-3-2025","18-3-2025","19-3-2025","20-3-2025","21-3-2025","22-3-2025","23-3-2025","24-3-2025","25-3-2025","26-3-2025","27-3-2025","28-3-2025","29-3-2025","30-3-2025","31-3-2025","1-4-2025","2-4-2025","3-4-2025","4-4-2025","5-4-2025","6-4-2025","7-4-2025","8-4-2025","9-4-2025","10-4-2025","11-4-2025","12-4-2025","13-4-2025","14-4-2025","15-4-2025","16-4-2025","17-4-2025","18-4-2025","19-4-2025","20-4-2025","21-4-2025","22-4-2025","23-4-2025","24-4-2025","25-4-2025","26-4-2025","27-4-2025","28-4-2025","29-4-2025","30-4-2025","2-8-2025","3-8-2025","4-8-2025","5-8-2025","6-8-2025","7-8-2025","8-8-2025","9-8-2025","10-8-2025","11-8-2025","12-8-2025","13-8-2025","14-8-2025","15-8-2025","16-8-2025","16-8-2025","17-8-2025","18-8-2025","19-8-2025","20-8-2025","21-8-2025","22-8-2025","23-8-2025","20-12-2025","21-12-2025","22-12-2025","23-12-2025","24-12-2025","25-12-2025","26-12-2025","27-12-2025","28-12-2025","29-12-2025","30-12-2025","31-12-2025","1-1-2026","2-1-2026","3-1-2026","4-1-2026","5-1-2026","6-1-2026","7-1-2026","8-1-2026","9-1-2026","10-1-2026","11-1-2026","12-1-2026","13-1-2026","14-1-2026","15-1-2026","16-1-2026","17-1-2026","18-1-2026","19-1-2026","20-1-2026","21-1-2026","22-1-2026","23-1-2026","24-1-2026","25-1-2026","26-1-2026","27-1-2026","28-1-2026","29-1-2026","30-1-2026","31-1-2026","1-2-2026","2-2-2026","3-2-2026","4-2-2026","5-2-2026","6-2-2026","7-2-2026","8-2-2026","9-2-2026","10-2-2026","11-2-2026","12-2-2026","13-2-2026","14-2-2026","15-2-2026","16-2-2026","17-2-2026","18-2-2026","19-2-2026","20-2-2026","21-2-2026","22-2-2026","23-2-2026","24-2-2026","25-2-2026","26-2-2026","27-2-2026","28-2-2026","1-3-2026","2-3-2026","3-3-2026","4-3-2026","5-3-2026","6-3-2026","7-3-2026","8-3-2026","9-3-2026","10-3-2026","11-3-2026","12-3-2026","13-3-2026","14-3-2026","15-3-2026","16-3-2026","17-3-2026","18-3-2026","19-3-2026","20-3-2026","21-3-2026","22-3-2026","23-3-2026","24-3-2026","25-3-2026","26-3-2026","27-3-2026","28-3-2026","29-3-2026","30-3-2026","31-3-2026","1-4-2026","2-4-2026","3-4-2026","4-4-2026","5-4-2026","6-4-2026","7-4-2026","8-4-2026","9-4-2026","10-4-2026","11-4-2026","12-4-2026","13-4-2026","14-4-2026","15-4-2026","16-4-2026","17-4-2026","18-4-2026","19-4-2026","20-4-2026","21-4-2026","22-4-2026","23-4-2026","24-4-2026","25-4-2026","26-4-2026","27-4-2026","28-4-2026","29-4-2026","30-4-2026","1-5-2026","2-5-2026","3-5-2026","4-5-2026","5-5-2026","6-5-2026","7-5-2026","8-5-2026","9-5-2026","10-5-2026","11-5-2026","12-5-2026","13-5-2026","14-5-2026","15-5-2026","16-5-2026","17-5-2026","18-5-2026","19-5-2026","20-5-2026","21-5-2026","22-5-2026","23-5-2026","24-5-2026","25-5-2026","26-5-2026","27-5-2026","28-5-2026","29-5-2026","30-5-2026","31-5-2026","1-6-2026","2-6-2026","3-6-2026","4-6-2026","5-6-2026","6-6-2026","7-6-2026","8-6-2026","9-6-2026","10-6-2026","11-6-2026","12-6-2026","13-6-2026","14-6-2026","15-6-2026","16-6-2026","17-6-2026","18-6-2026","19-6-2026","20-6-2026","21-6-2026","22-6-2026","23-6-2026","24-6-2026","25-6-2026","26-6-2026","27-6-2026","28-6-2026","29-6-2026","30-6-2026","1-7-2026","2-7-2026","3-7-2026","4-7-2026","5-7-2026","6-7-2026","7-7-2026","8-7-2026","9-7-2026","10-7-2026","11-7-2026","12-7-2026","13-7-2026","14-7-2026","15-7-2026","16-7-2026","17-7-2026","18-7-2026","19-7-2026","20-7-2026","21-7-2026","22-7-2026","23-7-2026","24-7-2026","25-7-2026","26-7-2026","27-7-2026","28-7-2026","29-7-2026","30-7-2026","31-7-2026","1-8-2026","2-8-2026","3-8-2026","4-8-2026","5-8-2026","6-8-2026","7-8-2026","8-8-2026","9-8-2026","10-8-2026","11-8-2026","12-8-2026","13-8-2026","14-8-2026","15-8-2026","16-8-2026","17-8-2026","18-8-2026","19-8-2026","20-8-2026","21-8-2026","22-8-2026","23-8-2026","24-8-2026","25-8-2026","26-8-2026","27-8-2026","28-8-2026","29-8-2026","30-8-2026","31-8-2026","1-9-2026","2-9-2026","3-9-2026","4-9-2026","5-9-2026","6-9-2026","7-9-2026","8-9-2026","9-9-2026","10-9-2026","11-9-2026","12-9-2026","13-9-2026","14-9-2026","15-9-2026","16-9-2026","17-9-2026","18-9-2026","19-9-2026","20-9-2026","21-9-2026","22-9-2026","23-9-2026","24-9-2026","25-9-2026","26-9-2026","27-9-2026","28-9-2026","29-9-2026","30-9-2026","1-10-2026","2-10-2026","3-10-2026","4-10-2026","5-10-2026","6-10-2026","7-10-2026","8-10-2026","9-10-2026","10-10-2026","11-10-2026","12-10-2026","13-10-2026","14-10-2026","15-10-2026","16-10-2026","17-10-2026","18-10-2026","19-10-2026","20-10-2026","21-10-2026","22-10-2026","23-10-2026","24-10-2026","25-10-2026","26-10-2026","27-10-2026","28-10-2026","29-10-2026","30-10-2026","31-10-2026","1-11-2026","2-11-2026","3-11-2026","4-11-2026","5-11-2026","6-11-2026","7-11-2026","8-11-2026","9-11-2026","10-11-2026","11-11-2026","12-11-2026","13-11-2026","14-11-2026","15-11-2026","16-11-2026","17-11-2026","18-11-2026","19-11-2026","20-11-2026","21-11-2026","22-11-2026","23-11-2026","24-11-2026","25-11-2026","26-11-2026","27-11-2026","28-11-2026","29-11-2026","30-11-2026","1-12-2026","2-12-2026","3-12-2026","4-12-2026","5-12-2026","6-12-2026","7-12-2026","8-12-2026","9-12-2026","10-12-2026","11-12-2026","12-12-2026","13-12-2026","14-12-2026","15-12-2026","16-12-2026","17-12-2026","18-12-2026","19-12-2026","20-12-2026","21-12-2026","22-12-2026","23-12-2026","24-12-2026","25-12-2026","26-12-2026","27-12-2026","28-12-2026","29-12-2026","30-12-2026","31-12-2026","1-1-2027","2-1-2027","3-1-2027","4-1-2027","5-1-2027","6-1-2027","7-1-2027","8-1-2027","9-1-2027","10-1-2027","11-1-2027","12-1-2027","13-1-2027","14-1-2027","15-1-2027","16-1-2027","17-1-2027","18-1-2027","19-1-2027","20-1-2027","21-1-2027","22-1-2027","23-1-2027","24-1-2027","25-1-2027","26-1-2027","27-1-2027","28-1-2027","29-1-2027","30-1-2027","31-1-2027","1-2-2027","2-2-2027","3-2-2027","4-2-2027","5-2-2027","6-2-2027","7-2-2027","8-2-2027","9-2-2027","10-2-2027","11-2-2027","12-2-2027","13-2-2027","14-2-2027","15-2-2027","16-2-2027","17-2-2027","18-2-2027","19-2-2027","20-2-2027","21-2-2027","22-2-2027","23-2-2027","24-2-2027","25-2-2027","26-2-2027","27-2-2027","28-2-2027","1-3-2027","2-3-2027","3-3-2027","4-3-2027","5-3-2027","6-3-2027","7-3-2027","8-3-2027","9-3-2027","10-3-2027","11-3-2027","12-3-2027","13-3-2027","14-3-2027","15-3-2027","16-3-2027","17-3-2027","18-3-2027","19-3-2027","20-3-2027","21-3-2027","22-3-2027","23-3-2027","24-3-2027","25-3-2027","26-3-2027","27-3-2027","28-3-2027","29-3-2027","30-3-2027","31-3-2027","1-4-2027","2-4-2027","3-4-2027","4-4-2027","5-4-2027","6-4-2027","7-4-2027","8-4-2027","9-4-2027","10-4-2027","11-4-2027","12-4-2027","13-4-2027","14-4-2027","15-4-2027","16-4-2027","17-4-2027","18-4-2027","19-4-2027","20-4-2027","21-4-2027","22-4-2027","23-4-2027","24-4-2027","25-4-2027","26-4-2027","27-4-2027","28-4-2027","29-4-2027","30-4-2027","1-5-2027","2-5-2027","3-5-2027","4-5-2027","5-5-2027","6-5-2027","7-5-2027","8-5-2027","9-5-2027","10-5-2027","11-5-2027","12-5-2027","13-5-2027","14-5-2027","15-5-2027","16-5-2027","17-5-2027","18-5-2027","19-5-2027","20-5-2027","21-5-2027","22-5-2027","23-5-2027","24-5-2027","25-5-2027","26-5-2027","27-5-2027","28-5-2027","29-5-2027","30-5-2027","31-5-2027"];
var unavailableAMDates = ["2025-02-01","2025-08-02","2025-08-16","2025-12-20"];
var unavailablePMDates = ["2025-04-30","2025-08-16","2025-08-23","2027-05-31"];
var unavailableDates = [["01/02/2025","02/02/2025","03/02/2025","04/02/2025","05/02/2025","06/02/2025","07/02/2025","08/02/2025","09/02/2025","10/02/2025","11/02/2025","12/02/2025","13/02/2025","14/02/2025","15/02/2025","16/02/2025","17/02/2025","18/02/2025","19/02/2025","20/02/2025","21/02/2025","22/02/2025","23/02/2025","24/02/2025","25/02/2025","26/02/2025","27/02/2025","28/02/2025","01/03/2025","02/03/2025","03/03/2025","04/03/2025","05/03/2025","06/03/2025","07/03/2025","08/03/2025","09/03/2025","10/03/2025","11/03/2025","12/03/2025","13/03/2025","14/03/2025","15/03/2025","16/03/2025","17/03/2025","18/03/2025","19/03/2025","20/03/2025","21/03/2025","22/03/2025","23/03/2025","24/03/2025","25/03/2025","26/03/2025","27/03/2025","28/03/2025","29/03/2025","30/03/2025","31/03/2025","01/04/2025","02/04/2025","03/04/2025","04/04/2025","05/04/2025","06/04/2025","07/04/2025","08/04/2025","09/04/2025","10/04/2025","11/04/2025","12/04/2025","13/04/2025","14/04/2025","15/04/2025","16/04/2025","17/04/2025","18/04/2025","19/04/2025","20/04/2025","21/04/2025","22/04/2025","23/04/2025","24/04/2025","25/04/2025","26/04/2025","27/04/2025","28/04/2025","29/04/2025","30/04/2025"],["02/08/2025","03/08/2025","04/08/2025","05/08/2025","06/08/2025","07/08/2025","08/08/2025","09/08/2025","10/08/2025","11/08/2025","12/08/2025","13/08/2025","14/08/2025","15/08/2025","16/08/2025"],["16/08/2025","17/08/2025","18/08/2025","19/08/2025","20/08/2025","21/08/2025","22/08/2025","23/08/2025"],["20/12/2025","21/12/2025","22/12/2025","23/12/2025","24/12/2025","25/12/2025","26/12/2025","27/12/2025","28/12/2025","29/12/2025","30/12/2025","31/12/2025","01/01/2026","02/01/2026","03/01/2026","04/01/2026","05/01/2026","06/01/2026","07/01/2026","08/01/2026","09/01/2026","10/01/2026","11/01/2026","12/01/2026","13/01/2026","14/01/2026","15/01/2026","16/01/2026","17/01/2026","18/01/2026","19/01/2026","20/01/2026","21/01/2026","22/01/2026","23/01/2026","24/01/2026","25/01/2026","26/01/2026","27/01/2026","28/01/2026","29/01/2026","30/01/2026","31/01/2026","01/02/2026","02/02/2026","03/02/2026","04/02/2026","05/02/2026","06/02/2026","07/02/2026","08/02/2026","09/02/2026","10/02/2026","11/02/2026","12/02/2026","13/02/2026","14/02/2026","15/02/2026","16/02/2026","17/02/2026","18/02/2026","19/02/2026","20/02/2026","21/02/2026","22/02/2026","23/02/2026","24/02/2026","25/02/2026","26/02/2026","27/02/2026","28/02/2026","01/03/2026","02/03/2026","03/03/2026","04/03/2026","05/03/2026","06/03/2026","07/03/2026","08/03/2026","09/03/2026","10/03/2026","11/03/2026","12/03/2026","13/03/2026","14/03/2026","15/03/2026","16/03/2026","17/03/2026","18/03/2026","19/03/2026","20/03/2026","21/03/2026","22/03/2026","23/03/2026","24/03/2026","25/03/2026","26/03/2026","27/03/2026","28/03/2026","29/03/2026","30/03/2026","31/03/2026","01/04/2026","02/04/2026","03/04/2026","04/04/2026","05/04/2026","06/04/2026","07/04/2026","08/04/2026","09/04/2026","10/04/2026","11/04/2026","12/04/2026","13/04/2026","14/04/2026","15/04/2026","16/04/2026","17/04/2026","18/04/2026","19/04/2026","20/04/2026","21/04/2026","22/04/2026","23/04/2026","24/04/2026","25/04/2026","26/04/2026","27/04/2026","28/04/2026","29/04/2026","30/04/2026","01/05/2026","02/05/2026","03/05/2026","04/05/2026","05/05/2026","06/05/2026","07/05/2026","08/05/2026","09/05/2026","10/05/2026","11/05/2026","12/05/2026","13/05/2026","14/05/2026","15/05/2026","16/05/2026","17/05/2026","18/05/2026","19/05/2026","20/05/2026","21/05/2026","22/05/2026","23/05/2026","24/05/2026","25/05/2026","26/05/2026","27/05/2026","28/05/2026","29/05/2026","30/05/2026","31/05/2026","01/06/2026","02/06/2026","03/06/2026","04/06/2026","05/06/2026","06/06/2026","07/06/2026","08/06/2026","09/06/2026","10/06/2026","11/06/2026","12/06/2026","13/06/2026","14/06/2026","15/06/2026","16/06/2026","17/06/2026","18/06/2026","19/06/2026","20/06/2026","21/06/2026","22/06/2026","23/06/2026","24/06/2026","25/06/2026","26/06/2026","27/06/2026","28/06/2026","29/06/2026","30/06/2026","01/07/2026","02/07/2026","03/07/2026","04/07/2026","05/07/2026","06/07/2026","07/07/2026","08/07/2026","09/07/2026","10/07/2026","11/07/2026","12/07/2026","13/07/2026","14/07/2026","15/07/2026","16/07/2026","17/07/2026","18/07/2026","19/07/2026","20/07/2026","21/07/2026","22/07/2026","23/07/2026","24/07/2026","25/07/2026","26/07/2026","27/07/2026","28/07/2026","29/07/2026","30/07/2026","31/07/2026","01/08/2026","02/08/2026","03/08/2026","04/08/2026","05/08/2026","06/08/2026","07/08/2026","08/08/2026","09/08/2026","10/08/2026","11/08/2026","12/08/2026","13/08/2026","14/08/2026","15/08/2026","16/08/2026","17/08/2026","18/08/2026","19/08/2026","20/08/2026","21/08/2026","22/08/2026","23/08/2026","24/08/2026","25/08/2026","26/08/2026","27/08/2026","28/08/2026","29/08/2026","30/08/2026","31/08/2026","01/09/2026","02/09/2026","03/09/2026","04/09/2026","05/09/2026","06/09/2026","07/09/2026","08/09/2026","09/09/2026","10/09/2026","11/09/2026","12/09/2026","13/09/2026","14/09/2026","15/09/2026","16/09/2026","17/09/2026","18/09/2026","19/09/2026","20/09/2026","21/09/2026","22/09/2026","23/09/2026","24/09/2026","25/09/2026","26/09/2026","27/09/2026","28/09/2026","29/09/2026","30/09/2026","01/10/2026","02/10/2026","03/10/2026","04/10/2026","05/10/2026","06/10/2026","07/10/2026","08/10/2026","09/10/2026","10/10/2026","11/10/2026","12/10/2026","13/10/2026","14/10/2026","15/10/2026","16/10/2026","17/10/2026","18/10/2026","19/10/2026","20/10/2026","21/10/2026","22/10/2026","23/10/2026","24/10/2026","25/10/2026","26/10/2026","27/10/2026","28/10/2026","29/10/2026","30/10/2026","31/10/2026","01/11/2026","02/11/2026","03/11/2026","04/11/2026","05/11/2026","06/11/2026","07/11/2026","08/11/2026","09/11/2026","10/11/2026","11/11/2026","12/11/2026","13/11/2026","14/11/2026","15/11/2026","16/11/2026","17/11/2026","18/11/2026","19/11/2026","20/11/2026","21/11/2026","22/11/2026","23/11/2026","24/11/2026","25/11/2026","26/11/2026","27/11/2026","28/11/2026","29/11/2026","30/11/2026","01/12/2026","02/12/2026","03/12/2026","04/12/2026","05/12/2026","06/12/2026","07/12/2026","08/12/2026","09/12/2026","10/12/2026","11/12/2026","12/12/2026","13/12/2026","14/12/2026","15/12/2026","16/12/2026","17/12/2026","18/12/2026","19/12/2026","20/12/2026","21/12/2026","22/12/2026","23/12/2026","24/12/2026","25/12/2026","26/12/2026","27/12/2026","28/12/2026","29/12/2026","30/12/2026","31/12/2026","01/01/2027","02/01/2027","03/01/2027","04/01/2027","05/01/2027","06/01/2027","07/01/2027","08/01/2027","09/01/2027","10/01/2027","11/01/2027","12/01/2027","13/01/2027","14/01/2027","15/01/2027","16/01/2027","17/01/2027","18/01/2027","19/01/2027","20/01/2027","21/01/2027","22/01/2027","23/01/2027","24/01/2027","25/01/2027","26/01/2027","27/01/2027","28/01/2027","29/01/2027","30/01/2027","31/01/2027","01/02/2027","02/02/2027","03/02/2027","04/02/2027","05/02/2027","06/02/2027","07/02/2027","08/02/2027","09/02/2027","10/02/2027","11/02/2027","12/02/2027","13/02/2027","14/02/2027","15/02/2027","16/02/2027","17/02/2027","18/02/2027","19/02/2027","20/02/2027","21/02/2027","22/02/2027","23/02/2027","24/02/2027","25/02/2027","26/02/2027","27/02/2027","28/02/2027","01/03/2027","02/03/2027","03/03/2027","04/03/2027","05/03/2027","06/03/2027","07/03/2027","08/03/2027","09/03/2027","10/03/2027","11/03/2027","12/03/2027","13/03/2027","14/03/2027","15/03/2027","16/03/2027","17/03/2027","18/03/2027","19/03/2027","20/03/2027","21/03/2027","22/03/2027","23/03/2027","24/03/2027","25/03/2027","26/03/2027","27/03/2027","28/03/2027","29/03/2027","30/03/2027","31/03/2027","01/04/2027","02/04/2027","03/04/2027","04/04/2027","05/04/2027","06/04/2027","07/04/2027","08/04/2027","09/04/2027","10/04/2027","11/04/2027","12/04/2027","13/04/2027","14/04/2027","15/04/2027","16/04/2027","17/04/2027","18/04/2027","19/04/2027","20/04/2027","21/04/2027","22/04/2027","23/04/2027","24/04/2027","25/04/2027","26/04/2027","27/04/2027","28/04/2027","29/04/2027","30/04/2027","01/05/2027","02/05/2027","03/05/2027","04/05/2027","05/05/2027","06/05/2027","07/05/2027","08/05/2027","09/05/2027","10/05/2027","11/05/2027","12/05/2027","13/05/2027","14/05/2027","15/05/2027","16/05/2027","17/05/2027","18/05/2027","19/05/2027","20/05/2027","21/05/2027","22/05/2027","23/05/2027","24/05/2027","25/05/2027","26/05/2027","27/05/2027","28/05/2027","29/05/2027","30/05/2027","31/05/2027"]];
var reserveURL = "https://www.coastalpropertiesmojacar.com/reservation.html";
$(document).ready(function() {
var cHeight = $("#mainPhotos").height();
$("#mainPhotos li a").height(cHeight + "px");
$('[data-fancybox="gallery"]').fancybox({
loop: true,
transitionEffect: "slide"
});
$('#mainPhotos').slick({
centerMode: true,
centerPadding:"0",
slidesToShow: 1,
infinite: true,
arrows: false,
adaptiveHeight:true,
speed: 600
});
$('#thumbsCarousel').slick({
slidesToShow: 1,
slidesToScroll: 1,
dots: false,
centerMode: true,
focusOnSelect: true,
arrows: false,
infinite: false,
asNavFor: '#mainPhotos'
});
$(document).on("click", "#previousPhoto", function () {
$('#mainPhotos').slick('slickPrev');
});
$(document).on("click", "#nextPhoto", function () {
$('#mainPhotos').slick('slickNext');
});
$("#mainPhotos").on("afterChange", function(event, slick, currentSlide) {
var slideCount = parseInt(currentSlide) + 1;
$("#slideCount span").html(slideCount);
var slideNo = parseInt(currentSlide);
$("#thumbsCarousel").slick('slickGoTo', slideNo);
});
$(document).on("click", "#propertyFeatureLinks a", function () {
var scrollDownTo = $(this).data("lt");
if ($.trim(scrollDownTo) != "") {
$("html,body").animate({
scrollTop:$("#" + scrollDownTo).offset().top - 60
},1000);
}
});
var sD = $("#propertyRentalDatesH").val();
$("#propertyRentalDates").dateRangePicker({
language:thisLang,
separator: " - ",
format: "DD/MM/YYYY",
startOfWeek: "monday",
startDate: todaysDate,
customArrowPrevSymbol: '',
customArrowNextSymbol: '',
setValue: function(s,s1,s2) {
$("#propertyRentalDates").val(s1 + ' - ' + s2);
$("#propertyRentalDatesH").val(s1 + '|' + s2);
var nD = s1 + '|' + s2;
if (sD == nD) {
} else {
getBookingPrices(pI);
sD = s1 + '|' + s2;
}
},
minDays: 1,
autoClose: true,
beforeShowDay: function(t) {
var thisDate = moment(t).format("DD/MM/YYYY");
var isValid = true;
var _class = "";
var _tooltip = "";
for (var ii = 0; ii < unavailableDates.length; ii++) {
var thisBlock = unavailableDates[ii];
for (var iii = 0; iii < thisBlock.length; iii++) {
if (thisDate == thisBlock[iii]) {
if (_class == "bookedDateEnd") {
_class = "bookedDate";
_tooltip = bookedTitle;
isValid = false;
} else if (iii == 0) {
_class = "bookedDateStart";
} else if (iii == thisBlock.length - 1) {
_class = "bookedDateEnd";
} else {
_class = "bookedDate";
_tooltip = bookedTitle;
isValid = false;
}
}
}
}
return [isValid,_class,_tooltip];
}
});
$(document).on("change", "#noGuests", function() {
getBookingPrices(pI);
});
$(document).on("click", ".showBookingBtn", function() {
if ($("#propertyBookingColumn").hasClass("showBooking")) {
$("body").removeClass("fixed");
$("#propertyBookingColumn").removeClass("showBooking");
} else {
$("body").addClass("fixed");
$("#propertyBookingColumn").addClass("showBooking");
}
});
$(document).on("click", "#closeBookingForm", function() {
var screenHeight = $(window).height();
var titleHeight = $("#propertyBookingTitle").height() + 20;
var closedOffset = screenHeight - titleHeight;
$("body").removeClass("fixed");
$("#propertyBookingColumn").removeClass("showBooking");
});
$(document).on("click", "#pbSendEnq, #pSendIEnq", function() {
$("body").addClass("fixed");
$("#enquiryBGContainer").addClass("unfold");
$("nav").removeClass("is-active");
$("#showMenu").removeClass("is-active");
});
$("#enquiryDates").dateRangePicker({
language:thisLang,
separator: " - ",
format: "DD/MM/YYYY",
startOfWeek: "monday",
startDate: todaysDate,
customArrowPrevSymbol: '',
customArrowNextSymbol: '',
minDays: 1,
setValue: function(s,s1,s2) {
$("#enquiryDates").val(s1 + ' - ' + s2);
$("#enquiryDatesH").val(s1 + '|' + s2);
}
});
/*
$(document).on("click", "#propertyBookingButton", function() {
var sVID = $("#sVID").val();
$("body").addClass("fixed");
$.ajax({
type:"GET",
url: "/property-booking-darcy.php?lang=" + thisLang,
data:"sVID=" + sVID,
cache:false,
success:function(popContent) {
$("#bookingIFContainer").html(popContent);
$("#bookingBGContainer").addClass("unfold");
$("nav").removeClass("is-active");
$("#showMenu").removeClass("is-active");
}
});
});
*/
$(document).on("click", "#sendContact", function() {
$("#sendContact, #eFormError").slideUp("fast");
$("#eFormEError").css("display", "none");
$("#enquiryName").parents(".formInput").removeClass("formError");
$("#enquiryEmail").parents(".formInput").removeClass("formError");
$("#enquiryMessage").parents(".formInput").removeClass("formError");
var eN = $("#enquiryName").val();
var eE = $("#enquiryEmail").val();
var eT = $("#enquiryTel").val();
var eD = $("#enquiryDatesH").val();
var eM = $("#enquiryMessage").val();
var dCon;
if ($("#dataConsent").is(":checked")) {
dCon = "&consent=true";
} else {
dCon = "";
}
var formValid = true;
if ($.trim(eN) == "") {
formValid = false;
$("#enquiryName").parents(".formInput").addClass("formError");
}
if ($.trim(eE) == "") {
formValid = false;
$("#enquiryEmail").parents(".formInput").addClass("formError");
}
if ($.trim(eM) == "") {
formValid = false;
$("#enquiryMessage").parents(".formInput").addClass("formError");
}
if (formValid == true) {
$("#contactWaiting").fadeIn('fast');
var dataVars = "pT=holiday&pI=" + pI + "&eN=" + encodeURIComponent(eN) + "&eE=" + encodeURIComponent(eE) + "&eT=" + encodeURIComponent(eT) + "&eD=" + encodeURIComponent(eD) + "&eM=" + encodeURIComponent(eM) + dCon;
$.ajax({
url:"/property-enquiry.php?lang=" + thisLang,
data: dataVars,
type: "POST",
dataType:"JSON",
cache: false,
success: function(data) {
var responseType = data.responseType;
if (responseType == 'valid') {
$("#enquiryResponse").html(data.contactResponse);
$("#enquiryFormInput").slideUp('slow', function(){
$("#contactWaiting").fadeOut('fast');
$("#enquiryResponse").slideDown("slow");
});
} else {
$("#eFormEOError").html(data.contactResponse);
$("#eFormEError").css("display", "none");
$("#eFormEOError").css("display", "block");
$("#sendContact").delay(600).fadeIn('slow', function(){
$("#contactWaiting").fadeOut('fast');
$("#eFormError").slideDown("slow");
});
}
}
});
} else {
$("#eFormEOError").css("display", "none");
$("#eFormEError").css("display", "block");
$("#sendContact, #eFormError").slideDown("slow");
}
return false;
});
$(document).on("click", "#enquiryBG", function(e) {
var thisID = $(e.target).attr('id');
if (thisID == "enquiryBG") {
$("#enquiryBGContainer").addClass("out");
setTimeout(function() {
$("#enquiryBGContainer").removeClass("unfold").removeClass("out");
$("body").removeClass("fixed");
}, 1200);
}
});
$(document).on("click", "#closeEnquiry", function() {
$("#enquiryBGContainer").addClass("out");
setTimeout(function() {
$("#enquiryBGContainer").removeClass("unfold").removeClass("out");
$("body").removeClass("fixed");
}, 1200);
});
$(document).on("click", "#showMoreFeatures", function() {
var isHidden = $("#moreFeatures").css("display");
if (isHidden == "none") {
$("#moreFeatures").slideDown("slow", function() {
$("#showMoreFeatures i").removeClass("fa-caret-down").addClass("fa-caret-up");
});
} else {
$("#moreFeatures").slideUp("slow", function() {
$("#showMoreFeatures i").removeClass("fa-caret-up").addClass("fa-caret-down");
});
}
});
$(document).on("click", "#bookingBG", function(e) {
var thisID = $(e.target).attr('id');
if (thisID == "bookingBG") {
$("#bookingBGContainer").addClass("out");
setTimeout(function() {
$("#bookingBGContainer").removeClass("unfold").removeClass("out");
$("body").removeClass("fixed");
}, 1200);
}
});
$(document).on("click", "#closeBooking", function() {
$("#bookingBGContainer").addClass("out");
setTimeout(function() {
$("#bookingBGContainer").removeClass("unfold").removeClass("out");
$("body").removeClass("fixed");
}, 1200);
});
$(document).on("click", "#termsBtn", function() {
if ($(this).hasClass("termsAccepted")) {
$(this).removeClass("termsAccepted");
$("#tca").val("0");
} else {
$(this).addClass("termsAccepted");
$("#tca").val("1");
}
});
$(document).on("click", "#reservationSubmit", function() {
var sVID = $("#sVID").val();
var bN = $("#bookingName").val();
var bT = $("#bookingTel").val();
var bE = $("#bookingEmail").val();
var uC = $("#userCode").val();
var tAC = $("#tca").val();
$("#rFormError").slideUp("fast");
$("#bookingName").parents(".formInput").removeClass("formError");
$("#bookingEmail").parents(".formInput").removeClass("formError");
$("#termsBtn").parents(".formInputW").removeClass("formError");
var formValid = true;
if ($.trim(bN) == "") {
formValid = false;
$("#bookingName").parents(".formInput").addClass("formError");
}
if ($.trim(bE) == "") {
formValid = false;
$("#bookingEmail").parents(".formInput").addClass("formError");
}
if (tAC == "0") {
formValid = false;
$("#termsBtn").parents(".formInputW").addClass("formError");
}
if (formValid == true) {
$("#reservationSubmit").slideUp("fast");
$("#reservationWaiting").fadeIn('fast');
var dataVars = "rC=true&sVID=" + sVID + "&bN=" + encodeURIComponent(bN) + "&bT=" + encodeURIComponent(bT) + "&bE=" + encodeURIComponent(bE) + "&uC=" + encodeURIComponent(uC);
$.ajax({
url:"/property-booking-darcy.php?lang=" + thisLang,
data: dataVars,
type: "POST",
dataType:"JSON",
cache: false,
success: function(data) {
var responseType = data.responseType;
if (responseType == 'valid') {
} else {
$("#rFormError").html(data.contactResponse);
$("#reservationSubmit").stop();
$("#reservationSubmit").delay(600).slideDown('slow', function(){
$("#reservationWaiting").fadeOut('fast');
$("#rFormError").slideDown("slow");
});
}
}
});
}
});
getBookingPrices(pI);
var screenWidth = $(window).width();
if ($("#availabilityCalendar").length) {
setupCalendar(screenWidth);
}
var doIt;
$(window).on("resize", function() {
clearTimeout(doIt);
doIt = setTimeout(resizedW, 100);
});
function resizedW() {
var screenDWidth = $(window).width();
if (screenDWidth != screenWidth) {
$("#availabilityCalendar").datepicker("destroy");
setupCalendar(screenDWidth);
screenWidth = $(window).width();
}
}
function setupCalendar(screenWidth) {
var divW = $("#availabilityCalendar").width();
var noMonthsS = Math.floor(divW / 270);
var noMonths;
var noSteps;
if (screenWidth < 1000) {
noMonths = [3,noMonthsS];
noSteps = 3 * noMonthsS;
} else if (screenWidth < 1400) {
noMonths = [4,noMonthsS];
noSteps = 4 * noMonthsS;
} else {
noMonths = [3,4];
noSteps = 12;
}
$('#availabilityCalendar').datepicker({
numberOfMonths:noMonths,
minDate: 0,
firstDay:1,
stepMonths: noSteps,
beforeShowDay:bookedDates
});
}
function bookedDates(date) {
dmy = date.getDate() + "-" + (date.getMonth()+1) + "-" + date.getFullYear();
if ( ($.inArray(dmy, unavailableUIDates) == -1)) {
return [true, "", "Available"];
} else {
if (($.inArray(dmy, unavailableUIAMDates) != -1) && ($.inArray(dmy, unavailableUIPMDates) != -1)) {
return [false,"datePickerChangeover", bookedTitle];
} else if ($.inArray(dmy, unavailableUIAMDates) != -1) {
return [true,"datePickerAMAvailable", availableTitle];
} else if ($.inArray(dmy, unavailableUIPMDates) != -1) {
return [true,"datePickerPMAvailable", availableTitle];
} else {
return [false,"datePickerLT", bookedTitle];
}
}
}
function getBookingPrices(propID) {
$("#propertyBookingButton").slideUp("fast", function() {
$("#propertyBookingResponse").slideUp("fast");
var setDates = $("#propertyRentalDatesH").val();
var noGuests =$("#noGuests").val();
if ( ($.trim(setDates) != "") && ($.trim(noGuests) != "") ) {
$.ajax({
url:"/property-booking-darcy.php?lang=" + thisLang,
data: "gV=true&pI=" + propID + "&bD=" + setDates + "&nG=" + noGuests,
type: "POST",
dataType: "JSON",
cache: false,
success: function(sessionData) {
var sessionVar = sessionData.sessionVar;
var dLink = sessionData.dLink;
$("#sVID").val(sessionVar);
if ($("#propertyBookingButton").hasClass("propertyBookingButtonDSB")) {
} else {
$("#propertyBookingButton").attr("href", dLink);
}
}
});
$.ajax({
url:"/property-booking-darcy.php?lang=" + thisLang,
data: "bC=true&pI=" + propID + "&bD=" + setDates + "&nG=" + noGuests,
type: "POST",
cache: false,
success: function(bookingCost) {
$("#propertyBookingResponse").html(bookingCost);
$("#propertyBookingResponse").slideUp();
$("#propertyBookingResponse").slideDown("slow", function() {
if ($("#bookingPriceWarning").length) {
} else {
if ($("#propertyBookingButton").hasClass("propertyBookingButtonDSB")) {
} else {
$("#propertyBookingButton").slideDown("slow");
}
}
});
}
});
}
});
}
});