PageSourceSearch

https://insuranceagentnearme.directory/wp-content/themes/listingpro/assets/js/main.js?ver=6.9.4

js insuranceagentnearme.directory collected 2026-10-05 06:53:57 UTC 222,347 bytes, 5,778 lines download raw bytes

1/* Main.js contains all main JS  */
2/*  Author : CrdioStudio Dev team */
3
4/*moin 31-03-017 strt*/
5jQuery.noConflict();
6
7jQuery(window).on("resize load live", function () {
8    jQuery(window).resize(function () {
9        if (jQuery(window).width() <= 768) {
10            jQuery("a.open-map-view").on("click", function (event) {
11                event.preventDefault();
12                jQuery(".sidemap-container").addClass("open-map");
13                jQuery("header").addClass("map-view-content");
14            });
15
16            jQuery("a.open-img-view").on("click", function (event) {
17                event.preventDefault();
18                jQuery(".sidemap-container").removeClass("open-map");
19                jQuery("header").removeClass("map-view-content");
20            });
21
22            if (jQuery("#wpadminbar").length > 0) {
23                jQuery("html body").css("margin-top", "-46px");
24            }
25        } else {
26            jQuery(".sidemap-container").removeClass("open-map");
27            if (jQuery("#wpadminbar").length > 0) {
28                jQuery("html body").css("margin-top", "0px");
29            }
30
31            jQuery("a.open-map-view").on("click", function (event) {
32                event.preventDefault();
33                jQuery(".sidemap-container").addClass("open-map");
34                jQuery("header").addClass("map-view-content");
35            });
36
37            jQuery("a.open-img-view").on("click", function (event) {
38                event.preventDefault();
39                jQuery(".sidemap-container").removeClass("open-map");
40                jQuery("header").removeClass("map-view-content");
41            });
42        }
43        if (jQuery(window).width() <= 480) {
44            jQuery("#more_filters").hide();
45        } else {
46            jQuery("#more_filters").show();
47        }
48    });
49});
50jQuery(document).ready(function () {
51    jQuery(".lp_cancel_notic").click(function (e) {
52        e.preventDefault();
53
54        jQuery(".lp_notification_wrapper").slideToggle(400);
55    });
56
57    jQuery(".claimformtrigger2").click(function () {
58        jQuery("header").addClass("lp-head-zindex");
59        var divHeight = jQuery(".leftside").height();
60        jQuery(".rightside").css("height", divHeight + "px");
61    });
62
63    jQuery(".lp-click-zindex").click(function () {
64        jQuery("header").removeClass("lp-head-zindex");
65    });
66
67    jQuery('.lp-tagline-submit-tagline label input[type="checkbox"]').click(
68        function (event) {
69            if (jQuery(this).prop("checked") == true) {
70                jQuery(".with-title-cond").fadeIn(700);
71            } else if (jQuery(this).prop("checked") == false) {
72                jQuery(".with-title-cond").fadeOut(700);
73            }
74        }
75    );
76
77    jQuery(".stickynavbar ul li").each(function (e) {
78        var tagetID = jQuery(this).find("a").attr("href");
79        if (jQuery(tagetID).length == 0) {
80            jQuery(this).remove();
81        }
82    });
83
84    // Search Top margin in map view
85    var hh = jQuery("header").outerHeight();
86    var ab = jQuery(".absolute");
87    ab.css("top", hh);
88
89    // Touch Behaviorr for Mobile devices
90    if (jQuery(".chosen-container").length > 0) {
91        jQuery(".chosen-container").on("touchstart", function (e) {
92            e.stopPropagation();
93            e.preventDefault();
94            // Trigger the mousedown event.
95            jQuery(this).trigger("mousedown");
96        });
97    }
98
99    jQuery("#see_filter").on("click", function (event) {
100        event.preventDefault();
101        var filter = jQuery("#more_filters");
102        jQuery(this).next("#more_filters").toggleClass("open_filter");
103        if (filter.hasClass("open_filter")) {
104            jQuery(this).next("#more_filters").slideDown(400);
105        } else {
106            jQuery(this).next("#more_filters").slideUp(400);
107        }
108    });
109});
110/*moin 31-03-017 ends*/
111
112/* by zaheer on 30 march */
113jQuery(document).ready(function ($) {
114    var loc = jQuery(".ui-widget").data("option");
115    var apiType = jQuery("#page").data("ipapi");
116
117    var currentlocationswitch = "1";
118
119    currentlocationswitch = jQuery("#page").data("lpcurrentloconhome");
120    if (currentlocationswitch == "0") {
121        loc = "locationifoff";
122        jQuery(".lp-location-search .ui-widget > i").fadeOut("fast");
123    }
124
125    if (loc == "yes") {
126        if (
127            (jQuery(".form-group").is(".lp-location-search") ||
128                jQuery(".form-group").is(".lp-location-inner-search")) &&
129            (jQuery("body").is(".home") || jQuery("body").is(".app-view-home"))
130        ) {
131            if (apiType === "ip_api") {
132                jQuery.get(
133                    "https://ipapi.co/json",
134                    function (location) {
135                        var c_loc = location.city;
136                        var lp_s_loc = c_loc;
137                        if (jQuery("#page").data("lpattern") == "with_region") {
138                            c_loc =
139                                location.city +
140                                " " +
141                                location.region_code +
142                                ", " +
143                                location.country_name;
144                            lp_s_loc = location.city + " " + location.region_code;
145                        }
146                        jQuery("#searchlocation")
147                            .prop("disabled", true)
148                            .trigger("chosen:updated");
149                        jQuery("#searchlocation").find("#def_location").text(c_loc);
150                        jQuery("#searchlocation").find("#def_location").val(c_loc);
151                        jQuery("#cities").val(c_loc);
152                        jQuery("input[name=lp_s_loc]").val(lp_s_loc);
153                        // jQuery(".select2-selection__rendered").attr("title",location.city).text(location.city);
154                        jQuery("#searchlocation")
155                            .prop("disabled", false)
156                            .trigger("chosen:updated");
157                        jQuery(".select2-selection__rendered")
158                            .parent(".select2-selection")
159                            .addClass("slide-right");
160                        jQuery(".lp-location-search .ui-widget > i").fadeOut("slow");
161                    },
162                    "json"
163                );
164            } else {
165                lpGetGpsLocName(function (lpgetcurrentcityvalue) {
166                    lpgpsclocation = lpgetcurrentcityvalue;
167                    jQuery("#searchlocation")
168                        .prop("disabled", true)
169                        .trigger("chosen:updated");
170                    jQuery("#searchlocation").find("#def_location").text(lpgpsclocation);
171                    jQuery("#searchlocation").find("#def_location").val(lpgpsclocation);
172                    jQuery("#cities").val(lpgpsclocation);
173                    jQuery("input[name=lp_s_loc]").val(lpgpsclocation);
174                    // jQuery(".select2-selection__rendered").attr("title",lpgpsclocation).text(lpgpsclocation);
175                    jQuery("#searchlocation")
176                        .prop("disabled", false)
177                        .trigger("chosen:updated");
178                    jQuery(".select2-selection__rendered")
179                        .parent(".select2-selection")
180                        .addClass("slide-right");
181                    jQuery(".lp-location-search .ui-widget > i").fadeOut("slow");
182                });
183            }
184            jQuery(".chosen-select2").chosen({
185                disable_search: true,
186            });
187            jQuery(".chosen-select1").chosen({
188                disable_search: true,
189            });
190            jQuery(".chosen-select7").chosen({
191                disable_search: true,
192            });
193            jQuery(".chosen-select5").chosen({
194                disable_search: true,
195            });
196        }
197    } else if (loc == "no") {
198        jQuery(".lp-location-search .ui-widget > i").on("click", function (event) {
199            event.preventDefault();
200            jQuery(this).addClass("fa-circle-o-notch fa-spin");
201            jQuery(this).removeClass("fa-crosshairs");
202            if (jQuery(".form-group").is(".lp-location-search")) {
203                if (apiType === "ip_api") {
204                    jQuery.get(
205                        "https://ipapi.co/json",
206                        function (location) {
207                            jQuery(".chosen-single").addClass("remove-margin");
208                            jQuery("#searchlocation")
209                                .prop("disabled", true)
210                                .trigger("chosen:updated");
211
212                            if (location.city == null) { } else {
213                                jQuery("#select2-searchlocation-container").text(location.city);
214                                // jQuery('#searchlocation').find('#def_location').text(location.city);
215                                jQuery("#searchlocation")
216                                    .find("#def_location")
217                                    .val(location.city)
218                                    .text(location.city);
219                                jQuery("#cities").val(location.city);
220                                jQuery("input[name=lp_s_loc]").val(location.city);
221                            }
222
223                            // jQuery(".select2-selection__rendered").attr("title",location.city).text(location.city);
224                            jQuery("#searchlocation")
225                                .prop("disabled", false)
226                                .trigger("chosen:updated");
227                            jQuery(".select2-selection__rendered")
228                                .parent(".select2-selection")
229                                .addClass("slide-right");
230                            jQuery(".lp-location-search .ui-widget > i").fadeOut("slow");
231                        },
232                        "json"
233                    );
234                } else {
235                    lpGetGpsLocName(function (lpgetcurrentcityvalue) {
236                        lpgpsclocation = lpgetcurrentcityvalue;
237                        jQuery(".chosen-single").addClass("remove-margin");
238                        jQuery("#searchlocation")
239                            .prop("disabled", true)
240                            .trigger("chosen:updated");
241                        jQuery("#select2-searchlocation-container").text(lpgpsclocation);
242                        jQuery("#searchlocation")
243                            .find("#def_location")
244                            .val(lpgpsclocation)
245                            .text(lpgpsclocation);
246                        jQuery("#cities").val(lpgpsclocation);
247                        jQuery("input[name=lp_s_loc]").val(lpgpsclocation);
248                        // jQuery(".select2-selection__rendered").attr("title",lpgpsclocation).text(lpgpsclocation);
249                        jQuery("#searchlocation")
250                            .prop("disabled", false)
251                            .trigger("chosen:updated");
252                        jQuery(".select2-selection__rendered")
253                            .parent(".select2-selection")
254                            .addClass("slide-right");
255                        jQuery(".lp-location-search .ui-widget > i").fadeOut("slow");
256                    });
257                }
258                jQuery(".chosen-select2").chosen({
259                    disable_search: true,
260                });
261                jQuery(".chosen-select1").chosen({
262                    disable_search: true,
263                });
264                jQuery(".chosen-select7").chosen({
265                    disable_search: true,
266                });
267                jQuery(".chosen-select5").chosen({
268                    disable_search: true,
269                });
270            }
271        });
272    }
273
274    jQuery("#lp-new-ad-compaignForm").on("submit", function (e) {
275        var $this = jQuery(this);
276        if ($this.data("type") == "adsperclick") {
277            totalPrice = jQuery('input[name="ads_price"]').val();
278            var spotlight = 0,
279                topos = 0,
280                sidebar = 0;
281            if ($this.find("#spotlightcmp").is(":checked")) {
282                spotlight = $this.find("#spotlightcmp").data("price");
283            }
284            if ($this.find("#camp-for-search").is(":checked")) {
285                topos = $this.find("#camp-for-search").data("price");
286            }
287            if ($this.find("#for-sidebar-camp").is(":checked")) {
288                sidebar = $this.find("#for-sidebar-camp").data("price");
289            }
290            var minbujet = spotlight + topos + sidebar;
291            if (totalPrice < minbujet) {
292                e.preventDefault();
293                e.stopPropagation();
294                alert($this.data("string") + " " + minbujet);
295                return false;
296            }
297        } else {
298            totalPrice = jQuery('input[name="ads_price"]').val();
299        }
300
301        method = jQuery('input[name="method"]:checked').val();
302        currency = $this.find('input[name="currency"]').val();
303        listing_id = jQuery("input[name=lp_ads_for_listing]").val();
304        listing_name = jQuery("input[name=lp_ads_title]").val();
305        taxRate = $this.find('input[name="taxprice"]').val();
306
307        if (listing_id === "" || method === "") {
308            alert(jQuery("input#ad-blank-errorMsg").val());
309            e.preventDefault();
310        } else if (method === "stripe") {
311            currency = $this.data("paid_currency");
312            totalPrice = parseFloat(totalPrice) * 100;
313            totalPrice = parseFloat(totalPrice).toFixed();
314
315            handler.open({
316                name: listing_name,
317                description: "",
318                zipCode: true,
319                amount: totalPrice,
320                currency: currency,
321            });
322            e.preventDefault();
323        } else if (method === "2checkout") {
324            var packages = [];
325            jQuery('input.checked_class[type="checkbox"]:checked').each(function () {
326                packages.push($this.data("package"));
327            });
328            jQuery("#myCCForm #tprice").val(totalPrice);
329            jQuery("#myCCForm #listing_id_2check").val(listing_id);
330            jQuery("#myCCForm #packages").val(packages);
331            jQuery("#myCCForm #taxprice").val(
332                $this.find('input[name="taxprice"]').val()
333            );
334            jQuery("button.lp-2checkout-modal2").trigger("click");
335            e.preventDefault();
336        }
337    });
338});
339/* end by zaheer on 30 march */
340
341jQuery(window).on("load", function () {
342    jQuery(".lp-suggested-search").on("click", function (event) {
343        jQuery("#input-dropdown").niceScroll({
344            cursorcolor: "#363F48",
345            cursoropacitymax: 1,
346            boxzoom: false,
347            cursorwidth: "10px",
348            cursorborderradius: "0px",
349            cursorborder: "0px solid #fff",
350            touchbehavior: true,
351            preventmultitouchscrolling: false,
352            cursordragontouch: true,
353            background: "#f7f7f7",
354            horizrailenabled: false,
355            autohidemode: false,
356            zindex: "999999",
357        });
358    });
359
360    // Notices Box Script
361    jQuery(".notice a.close").on("click", function (event) {
362        event.preventDefault();
363        jQuery(this).parent(".notice").fadeOut("slow");
364    });
365
366    jQuery(
367        ".lp-header-full-width .lp-menu-bar .header-filter, .lp-menu-bar .header-filter.pos-relative.form-group"
368    ).css("display", "block");
369
370    var logoH = jQuery(".lp-logo").outerHeight();
371    var acHgt = jQuery(".header-right-panel.clearfix");
372    var a = parseInt(logoH + 10);
373    var b = jQuery(".header-right-panel").height();
374    var c = a - b;
375    var d = c / 2;
376    //alert(b);
377    acHgt.css({
378        "padding-top": d + "px",
379    });
380
381    jQuery(".rating-symbol:nth-child(1)").hover(
382        function () {
383            jQuery(".review.angry").css({
384                opacity: "1",
385                visibility: "visible",
386            });
387        },
388        function () {
389            jQuery(".review.angry").css({
390                opacity: "0",
391                visibility: "hidden",
392            });
393        }
394    );
395    jQuery(".rating-symbol:nth-child(2)").hover(
396        function () {
397            jQuery(".review.cry").css({
398                opacity: "1",
399                visibility: "visible",
400            });
401        },
402        function () {
403            jQuery(".review.cry").css({
404                opacity: "0",
405                visibility: "hidden",
406            });
407        }
408    );
409    jQuery(".rating-symbol:nth-child(3)").hover(
410        function () {
411            jQuery(".review.sleeping").css({
412                opacity: "1",
413                visibility: "visible",
414            });
415        },
416        function () {
417            jQuery(".review.sleeping").css({
418                opacity: "0",
419                visibility: "hidden",
420            });
421        }
422    );
423    jQuery(".rating-symbol:nth-child(4)").hover(
424        function () {
425            jQuery(".review.smily").css({
426                opacity: "1",
427                visibility: "visible",
428            });
429        },
430        function () {
431            jQuery(".review.smily").css({
432                opacity: "0",
433                visibility: "hidden",
434            });
435        }
436    );
437    jQuery(".rating-symbol:nth-child(5)").hover(
438        function () {
439            jQuery(".review.cool").css({
440                opacity: "1",
441                visibility: "visible",
442            });
443        },
444        function () {
445            jQuery(".review.cool").css({
446                opacity: "0",
447                visibility: "hidden",
448            });
449        }
450    );
451
452    var rtngSym = jQuery(".rating-symbol");
453    var rtngTip = jQuery("input.rating-tooltip");
454
455    jQuery(".rating-symbol:first-of-type").hover(
456        function () {
457            jQuery(this).closest("span").addClass("active-stars-wrap");
458            jQuery(
459                ".active-stars-wrap .rating-symbol:first-of-type .rating-symbol-foreground span"
460            ).css("color", "#de9147");
461        },
462        function () {
463            jQuery(".active-stars-wrap").removeClass("active-stars-wrap");
464        }
465    );
466    jQuery(".rating-symbol:nth-of-type(2)").hover(
467        function () {
468            jQuery(this).closest("span").addClass("active-stars-wrap");
469            jQuery(
470                ".active-stars-wrap .rating-symbol:first-of-type .rating-symbol-foreground span"
471            ).css("color", "#de9147");
472            jQuery(
473                ".active-stars-wrap .rating-symbol:nth-of-type(2) .rating-symbol-foreground span"
474            ).css("color", "#de9147");
475        },
476        function () {
477            jQuery(".active-stars-wrap").removeClass("active-stars-wrap");
478        }
479    );
480    jQuery(".rating-symbol:nth-of-type(3)").hover(
481        function () {
482            jQuery(this).closest("span").addClass("active-stars-wrap");
483            jQuery(
484                ".active-stars-wrap .rating-symbol:first-of-type .rating-symbol-foreground span"
485            ).css("color", "#dec435");
486            jQuery(
487                ".active-stars-wrap .rating-symbol:nth-of-type(2) .rating-symbol-foreground span"
488            ).css("color", "#dec435");
489            jQuery(
490                ".active-stars-wrap .rating-symbol:nth-of-type(3) .rating-symbol-foreground span"
491            ).css("color", "#dec435");
492        },
493        function () {
494            jQuery(".active-stars-wrap").removeClass("active-stars-wrap");
495        }
496    );
497    jQuery(".rating-symbol:nth-of-type(4)").hover(
498        function () {
499            jQuery(this).closest("span").addClass("active-stars-wrap");
500            jQuery(
501                ".active-stars-wrap .rating-symbol:first-of-type .rating-symbol-foreground span"
502            ).css("color", "#c5de35");
503            jQuery(
504                ".active-stars-wrap .rating-symbol:nth-of-type(2) .rating-symbol-foreground span"
505            ).css("color", "#c5de35");
506            jQuery(
507                ".active-stars-wrap .rating-symbol:nth-of-type(3) .rating-symbol-foreground span"
508            ).css("color", "#c5de35");
509            jQuery(
510                ".active-stars-wrap .rating-symbol:nth-of-type(4) .rating-symbol-foreground span"
511            ).css("color", "#c5de35");
512        },
513        function () {
514            jQuery(".active-stars-wrap").removeClass("active-stars-wrap");
515        }
516    );
517    jQuery(".rating-symbol:nth-of-type(5)").hover(
518        function () {
519            jQuery(this).closest("span").addClass("active-stars-wrap");
520            jQuery(
521                ".active-stars-wrap .rating-symbol:first-of-type .rating-symbol-foreground span"
522            ).css("color", "#73cf42");
523            jQuery(
524                ".active-stars-wrap .rating-symbol:nth-of-type(2) .rating-symbol-foreground span"
525            ).css("color", "#73cf42");
526            jQuery(
527                ".active-stars-wrap .rating-symbol:nth-of-type(3) .rating-symbol-foreground span"
528            ).css("color", "#73cf42");
529            jQuery(
530                ".active-stars-wrap .rating-symbol:nth-of-type(4) .rating-symbol-foreground span"
531            ).css("color", "#73cf42");
532            jQuery(
533                ".active-stars-wrap .rating-symbol:nth-of-type(5) .rating-symbol-foreground span"
534            ).css("color", "#73cf42");
535        },
536        function () {
537            jQuery(".active-stars-wrap").removeClass("active-stars-wrap");
538        }
539    );
540
541    rtngSym.on("click", function (event) {
542        event.preventDefault();
543        var thsVal = jQuery("input.rating-tooltip").val();
544
545        //alert(thsVal);
546        if (thsVal == 1) {
547            jQuery(".review.angry").addClass("visible");
548            jQuery(".rating-symbol:first-of-type").addClass("angry");
549            jQuery(".rating-symbol").removeClass("cry");
550            jQuery(".rating-symbol").removeClass("sleeping");
551            jQuery(".rating-symbol").removeClass("smily");
552            jQuery(".rating-symbol").removeClass("cool");
553        } else {
554            jQuery(".review.angry").removeClass("visible");
555        }
556
557        if (thsVal == 2) {
558            jQuery(".review.cry").addClass("visible");
559            jQuery(".rating-symbol:first-of-type").addClass("cry");
560            jQuery(".rating-symbol:nth-of-type(2)").addClass("cry");
561            jQuery(".rating-symbol").removeClass("angry");
562            jQuery(".rating-symbol").removeClass("sleeping");
563            jQuery(".rating-symbol").removeClass("smily");
564            jQuery(".rating-symbol").removeClass("cool");
565        } else {
566            jQuery(".review.cry").removeClass("visible");
567        }
568
569        if (thsVal == 3) {
570            jQuery(".review.sleeping").addClass("visible");
571            jQuery(".rating-symbol:first-of-type").addClass("sleeping");
572            jQuery(".rating-symbol:nth-of-type(2)").addClass("sleeping");
573            jQuery(".rating-symbol:nth-of-type(3)").addClass("sleeping");
574            jQuery(".rating-symbol").removeClass("angry");
575            jQuery(".rating-symbol").removeClass("cry");
576            jQuery(".rating-symbol").removeClass("smily");
577            jQuery(".rating-symbol").removeClass("cool");
578        } else {
579            jQuery(".review.sleeping").removeClass("visible");
580        }
581
582        if (thsVal == 4) {
583            jQuery(".review.smily").addClass("visible");
584            jQuery(".rating-symbol:first-of-type").addClass("smily");
585            jQuery(".rating-symbol:nth-of-type(2)").addClass("smily");
586            jQuery(".rating-symbol:nth-of-type(3)").addClass("smily");
587            jQuery(".rating-symbol:nth-of-type(4)").addClass("smily");
588            jQuery(".rating-symbol").removeClass("angry");
589            jQuery(".rating-symbol").removeClass("cry");
590            jQuery(".rating-symbol").removeClass("sleeping");
591            jQuery(".rating-symbol").removeClass("cool");
592        } else {
593            jQuery(".review.smily").removeClass("visible");
594        }
595
596        if (thsVal == 5) {
597            jQuery(".review.cool").addClass("visible");
598            jQuery(".rating-symbol:first-of-type").addClass("cool");
599            jQuery(".rating-symbol:nth-of-type(2)").addClass("cool");
600            jQuery(".rating-symbol:nth-of-type(3)").addClass("cool");
601            jQuery(".rating-symbol:nth-of-type(4)").addClass("cool");
602            jQuery(".rating-symbol:nth-of-type(5)").addClass("cool");
603            jQuery(".rating-symbol").removeClass("angry");
604            jQuery(".rating-symbol").removeClass("cry");
605            jQuery(".rating-symbol").removeClass("sleeping");
606            jQuery(".rating-symbol").removeClass("smily");
607        } else {
608            jQuery(".review.cool").removeClass("visible");
609        }
610
611        var CheckMultiRatingState = jQuery("#rewies_form").data("multi-rating");
612        var ratingSumTotal = 0;
613        if (CheckMultiRatingState == 1) {
614            var activeRatingLength = jQuery(".lp-multi-rating-val").length;
615            jQuery(".lp-multi-rating-val").each(function (index) {
616                ratingSumTotal += Number(jQuery(this).val());
617            });
618            var activeRatingClass = Math.round(ratingSumTotal / activeRatingLength);
619
620            jQuery(".lp-review-stars").removeClass(function (index, css) {
621                return (css.match(/\bactive-rating-avg\S+/g) || []).join(" ");
622            });
623            jQuery(".lp-review-stars").addClass(
624                "active-rating-avg" + activeRatingClass
625            );
626
627            jQuery(
628                ".lp-review-stars i.fa:nth-child(" + Number(activeRatingClass + 1) + ")"
629            )
630                .removeClass("fa-star-o")
631                .addClass("fa-star");
632            jQuery(
633                ".lp-review-stars i.fa:nth-child(" + Number(activeRatingClass + 1) + ")"
634            )
635                .prevAll(".fa-star-o")
636                .removeClass("fa-star-o")
637                .addClass("fa-star");
638            jQuery(
639                ".lp-review-stars i.fa:nth-child(" + Number(activeRatingClass + 1) + ")"
640            )
641                .nextAll(".fa-star")
642                .removeClass("fa-star-o")
643                .addClass("fa-star-o");
644        }
645    });
646});
647
648var siteurl = jQuery("#page").data("site-url");
649var sitelogo = jQuery("#page").data("sitelogo");
650var $menu = jQuery("#menu");
651if ($menu.length > 0) {
652    $menu.css("visibility", "visible");
653    $menu.mmenu({
654        extensions: ["pagedim-black"],
655        iconPanels: true,
656        navbar: {
657            title: "",
658        },
659        navbars: {
660            height: 3,
661            content: [
662                '<a href="' +
663                siteurl +
664                '" class="userimage"><img class="icon icons8-Contacts" src="' +
665                sitelogo +
666                '" alt="user"></a>',
667            ],
668        },
669    });
670    jQuery("div#menu").removeClass("menu-height-0");
671    var API = $menu.data("mmenu");
672    jQuery(
673        ".lpl-button.md-trigger, .sign-login-wrap .md-trigger,.lpl-button.app-view-popup-style"
674    ).click(function () {
675        API.close();
676    });
677}
678
679jQuery(document).on(
680    "click",
681    ".footer-btn-right.map-view-btn, .v2-map-load .v2mapwrap, .listing-app-view-bar .right-icons a, .sidemap-fixed .sidemarpInside",
682    function (e) {
683        if (jQuery("#map").is(".mapSidebar")) {
684            var defmaplat = jQuery("body").data("defaultmaplat");
685            var defmaplong = jQuery("body").data("defaultmaplot");
686            jQuery(".map-pop").empty();
687            jQuery(".map-pop").html('<div class="mapSidebar" id="map"></div>');
688            var map = null;
689            $mtoken = jQuery("#page").data("mtoken");
690            $mtype = jQuery("#page").data("mtype");
691            $mapboxDesign = jQuery("#page").data("mstyle");
692
693            if ($mtoken !== "" && $mtype === "mapbox") {
694                L.mapbox.accessToken = $mtoken;
695                map = L.mapbox.map("map").setView([defmaplat, defmaplong], 2);
696                L.tileLayer(
697                    "https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}", {
698                    maxZoom: 18,
699                    id: jQuery("#page").data("mstyle"),
700                    accessToken: jQuery("#page").data("mtoken"),
701                }
702                ).addTo(map);
703
704                var markers = new L.MarkerClusterGroup();
705                initializeMap(markers);
706                map.fitBounds(markers.getBounds(), {
707                    padding: [50, 50],
708                });
709                jQuery(document).on("click", ".open-map-view", function () {
710                    L.Util.requestAnimFrame(map.invalidateSize, map, !1, map._container);
711                });
712            } else {
713                var map = new L.Map("map", {
714                    minZoom: 3,
715                }).setView(new L.LatLng(defmaplat, defmaplong), 6);
716                if ($mtype == "google") {
717                    L.tileLayer("http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}", {
718                        maxZoom: 6,
719                        subdomains: ["mt0", "mt1", "mt2", "mt3"],
720                        noWrap: true,
721                    });
722                    var googleLayer = new L.Google("ROADMAP");
723                    map.addLayer(googleLayer);
724                } else {
725                    L.tileLayer(
726                        "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
727                    ).addTo(map);
728                }
729
730                var markers = new L.MarkerClusterGroup();
731                var resmarkers = initializeMap(markers);
732                if (typeof resmarkers === "undefined") { } else {
733                    map.fitBounds(markers.getBounds(), {
734                        padding: [50, 50],
735                    });
736                    map.scrollWheelZoom.enable();
737                    map.invalidateSize();
738                    map.dragging.enable();
739                    jQuery(document).on("click", ".open-map-view", function () {
740                        L.Util.requestAnimFrame(
741                            map.invalidateSize,
742                            map,
743                            !1,
744                            map._container
745                        );
746                    });
747                }
748            }
749
750            function initializeMap(markers) {
751                if (jQuery(".lp-grid-box-contianer").length != 0) {
752                    markers.clearLayers();
753                    jQuery(".lp-grid-box-contianer").each(function (i) {
754                        var LPtitle = jQuery(this).data("title");
755                        var LPposturl = jQuery(this).data("posturl");
756                        var LPlattitue = jQuery(this).data("lattitue");
757                        var LPlongitute = jQuery(this).data("longitute");
758                        var LPpostid = jQuery(this).data("postid");
759                        var LPiconSrc = "";
760
761                        if (jQuery(".v2-map-load").length == 1) {
762                            if (jQuery(".v2-map-load").hasClass("v2_map_load_old")) {
763                                var LPaddress = jQuery(this).find(".gaddress").text();
764                                var LPimageSrc = jQuery(this)
765                                    .find(".lp-grid-box-thumb")
766                                    .find("img")
767                                    .attr("src");
768                                if (typeof jQuery("body").data("deficon") !== "undefined") {
769                                    // your code here
770                                    LPiconSrc = jQuery("body").data("deficon");
771                                } else {
772                                    LPiconSrc = jQuery(this)
773                                        .find(".cat-icon")
774                                        .find("img")
775                                        .attr("src");
776                                }
777                            } else {
778                                var LPaddress = jQuery(this)
779                                    .find(".lp-listing-location")
780                                    .find("a")
781                                    .text();
782                                var LPimageSrc = jQuery(this)
783                                    .find(".lp-listing-top-thumb")
784                                    .find("img")
785                                    .attr("src");
786
787                                if (typeof jQuery("body").data("deficon") !== "undefined") {
788                                    // your code here
789                                    LPiconSrc = jQuery("body").data("deficon");
790                                } else {
791                                    LPiconSrc = jQuery(this)
792                                        .find(".cat-icon")
793                                        .find("img")
794                                        .attr("src");
795                                }
796                            }
797                        } else if (jQuery(".lp-compact-view-outer").length > 0) {
798                            var LPaddress = jQuery(this).find(".lp_list_address").text();
799                            var LPimageSrc = jQuery(this)
800                                .find(".lp-listing-top-thumb")
801                                .find("img")
802                                .attr("src");
803                            var LPiconSrc = jQuery(this)
804                                .find(".cat-icon")
805                                .find("img")
806                                .attr("src");
807                            if (typeof jQuery("body").data("deficon") !== "undefined") {
808                                LPiconSrc = jQuery("body").data("deficon");
809                            }
810                        } else {
811                            var LPaddress = jQuery(this).find(".gaddress").text();
812                            var LPimageSrc = jQuery(this)
813                                .find(".listing-app-view-new-wrap")
814                                .find("img")
815                                .attr("src");
816                            if (LPimageSrc === undefined) {
817                                LPimageSrc = jQuery(this).data("feaimg");
818                            }
819                            if (LPimageSrc === undefined) {
820                                if (jQuery(".lp-grid-box-thumb .show-img").length > 0) {
821                                    LPimageSrc = jQuery(this)
822                                        .find(".lp-grid-box-thumb .show-img img")
823                                        .attr("src");
824                                } else {
825                                    LPimageSrc = jQuery(this)
826                                        .find(".lp-grid-box-thumb .show img")
827                                        .attr("src");
828                                }
829                            }
830                            if (typeof jQuery("body").data("deficon") !== "undefined") {
831                                // your code here
832                                LPiconSrc = jQuery("body").data("deficon");
833                            } else {
834                                LPiconSrc = jQuery(this)
835                                    .find(".cat-icon")
836                                    .find("img")
837                                    .attr("src");
838                            }
839                        }
840                        if (LPlattitue != "" && LPlongitute != "") {
841                            var LPimage = "";
842                            if (LPimageSrc != "") {
843                                LPimage = LPimageSrc;
844                            }
845
846                            var LPicon = "";
847                            if (LPiconSrc != "") {
848                                LPicon = LPiconSrc;
849                            }
850
851                            if (jQuery(this).find(".cat-icon i").length > 0) {
852                                LPicon = jQuery(this).find(".cat-icon").html();
853                            } else {
854                                LPicon = "<img alt='image' src='" + LPicon + "' />";
855                            }
856
857                            var markerLocation = new L.LatLng(LPlattitue, LPlongitute); // London
858
859                            var CustomHtmlIcon = L.divIcon({
860                                html: "<div class='lpmap-icon-shape pin card" +
861                                    LPpostid +
862                                    "'><div class='lpmap-icon-contianer'>" +
863                                    LPicon +
864                                    "</div></div>",
865                            });
866
867                            var marker = new L.Marker(markerLocation, {
868                                icon: CustomHtmlIcon,
869                            })
870                                .bindPopup(
871                                    '<div class="map-post"><div class="map-post-thumb"><a target="_blank" href="' +
872                                    LPposturl +
873                                    '"><img alt="image" src="' +
874                                    LPimage +
875                                    '" ></a></div><div class="map-post-des"><div class="map-post-title"><h5><a target="_blank" href="' +
876                                    LPposturl +
877                                    '">' +
878                                    LPtitle +
879                                    '</a></h5></div><div class="map-post-address"><p><i class="fa fa-map-marker"></i> ' +
880                                    LPaddress +
881                                    "</p></div></div></div>"
882                                )
883                                .addTo(map);
884                            markers.addLayer(marker);
885                            map.addLayer(markers);
886                        }
887                    });
888                    return true;
889                }
890            }
891        }
892    }
893);
894jQuery(document).ready(function () {
895    "use-strict";
896    // Disable next button
897    var checkdInput = jQuery(".checkboxx input.checked_class");
898    checkdInput.on("change", function (event) {
899        event.preventDefault();
900        if (checkdInput.is(":checked")) {
901            jQuery("a#lp-next").css("display", "block");
902            jQuery("a#lp-next").removeClass("hide");
903            jQuery("span.show").removeClass("show");
904            jQuery(
905                ".promotional-section > .lp-face.lp-pay-options.lp-dash-sec > span"
906            ).addClass("hide");
907        } else {
908            jQuery("a#lp-next").addClass("hide");
909            jQuery(
910                ".promotional-section > .lp-face.lp-pay-options.lp-dash-sec > span"
911            ).addClass("show");
912        }
913    });
914
915    var rdoInput = jQuery(".lp-method-wrap input.radio_checked");
916    rdoInput.on("change", function (event) {
917        event.preventDefault();
918        if (rdoInput.is(":checked")) {
919            jQuery("input.lp-next2.promotebtn").css("display", "block");
920            jQuery("input.lp-next2.promotebtn").removeClass("hide");
921            jQuery(".promotional-section span.proceed-btn").removeClass("show");
922            jQuery(".promotional-section span.proceed-btn").addClass("hide");
923        } else {
924            jQuery("input.lp-next2.promotebtn").addClass("hide");
925            jQuery(".promotional-section span.proceed-btn").addClass("show");
926        }
927    });
928
929    //Dashboard promotional script
930    jQuery(".promotional-section a.lp-submit-btn").on("click", function (event) {
931        event.preventDefault();
932        jQuery(this).parent(".promotional-section").slideUp(500);
933        jQuery(this)
934            .parent(".promotional-section")
935            .next(".lp-card > form#ads_promotion")
936            .slideDown(1000);
937    });
938
939    // Dashboard Left Panel Script
940
941    var dash = jQuery(
942        ".dashboard-tabs.lp-main-tabs.text-center > ul > li.dropdown > a"
943    );
944
945    var dashli = jQuery(
946        ".dashboard-tabs.lp-main-tabs.text-center > ul > li.dropdown"
947    );
948
949    var dashul = jQuery(
950        ".dashboard-tabs.lp-main-tabs.text-center > ul > li.dropdown > ul"
951    );
952
953    dash.on("click", function (event) {
954        event.preventDefault();
955
956        if (dashli.hasClass("opened")) {
957            jQuery(dashli).removeClass("opened");
958
959            jQuery(dashul).removeClass("opened");
960
961            jQuery(this).parent("li").addClass("opened");
962
963            jQuery(this).next("ul").addClass("opened");
964        } else {
965            //if(dashli.hasClass('dropdown'))
966
967            jQuery(dashul).removeClass("opened");
968
969            jQuery(dashli).removeClass("opened");
970
971            jQuery(this).parent("li").addClass("opened");
972
973            jQuery(this).next("ul").addClass("opened");
974        }
975    });
976
977    // Review Script
978    jQuery("h3#reply-title").on("click", function (event) {
979        event.preventDefault();
980        var thiss = jQuery(this);
981        if (thiss.hasClass("active")) {
982            jQuery(this).removeClass("active");
983            jQuery(this).next("#rewies_form").slideUp();
984            jQuery(this).next("#rewies_formm").slideUp();
985        } else {
986            jQuery(this).addClass("active");
987            jQuery(this).next("#rewies_form").slideDown();
988            jQuery(this).next("#rewies_formm").slideDown();
989        }
990
991        //jQuery(this).next('#rewies_form').toggleClass('open_review_form');
992    });
993    jQuery("#clicktoreview").on("click", function (event) {
994        event.preventDefault();
995
996        var thiss = jQuery("#reply-title");
997        thiss.addClass("active");
998        thiss.next("#rewies_form").slideDown();
999        thiss.next("#rewies_formm").slideDown();
1000        jQuery("html, body").animate({
1001            scrollTop: jQuery("#reply-title").offset().top,
1002        },
1003            2000
1004        );
1005    });
1006
1007    jQuery(".leadformtrigger").on("click", function (e) {
1008        e.preventDefault();
1009        jQuery(".app-view-lead-form").slideToggle(500);
1010    });
1011    jQuery(".open-lead-form-app-view").on("click", function (e) {
1012        if (jQuery(".app-view-lead-form")[0]) {
1013            jQuery(".app-view-lead-form").slideToggle(500);
1014            jQuery("html, body").animate({
1015                scrollTop: jQuery(".leadformtrigger").offset().top,
1016            },
1017                2000
1018            );
1019        }
1020    });
1021
1022    jQuery("#rewies_form input[type=file]").change(function (e) {
1023        $in = jQuery(this);
1024        $in.prev().prev().text($in.val());
1025    });
1026    // listing layout
1027    //jQuery('.listing-simple').addClass('listing_list_view');
1028    jQuery("a.grid").on("click", function (event) {
1029        event.preventDefault();
1030        jQuery("a.list").removeClass("active");
1031        jQuery(this).addClass("active");
1032        jQuery(".listing-simple").removeClass("listing_list_view");
1033
1034        if (
1035            jQuery("#list-grid-view-v2").length != 0 &&
1036            jQuery("#list-grid-view-v2").hasClass("swtch-ll")
1037        ) {
1038            jQuery("#list-grid-view-v2").attr("data-layout-class", "grid");
1039        }
1040
1041        if (jQuery("#content-grids").hasClass("v2-toggle")) {
1042            jQuery(".loop-switch-class").removeClass("col-md-12");
1043            jQuery(".loop-switch-class").addClass("col-md-6");
1044            jQuery(".lp-listings.active-view").removeClass("list-style");
1045            jQuery(".lp-listings.active-view").addClass("grid-style");
1046        } else {
1047            jQuery(".post-with-map-container")
1048                .find(".lp-grid-box-contianer.card1.lp-grid-box-contianer1")
1049                .removeClass("col-sm-12 list_view");
1050            jQuery(".post-with-map-container")
1051                .find(".lp-grid-box-contianer.card1.lp-grid-box-contianer1")
1052                .addClass("col-md-6 col-sm-12 grid_view2");
1053
1054            // Listing Simple
1055            if (
1056                jQuery("#content-grids").hasClass("listing-with-header-filters-wrap")
1057            ) {
1058                jQuery(".listing-simple")
1059                    .find(".lp-grid-box-contianer.card1.lp-grid-box-contianer1")
1060                    .removeClass("col-sm-12 list_view");
1061                jQuery(".listing-simple")
1062                    .find(".lp-grid-box-contianer.card1.lp-grid-box-contianer1")
1063                    .addClass("col-md-6 col-sm-12 grid_view2");
1064            } else {
1065                jQuery(".listing-simple")
1066                    .find(".lp-grid-box-contianer.card1.lp-grid-box-contianer1")
1067                    .removeClass("col-sm-12 list_view");
1068                jQuery(".listing-simple")
1069                    .find(".lp-grid-box-contianer.card1.lp-grid-box-contianer1")
1070                    .addClass("col-md-4 col-sm-12 grid_view2");
1071            }
1072
1073            // Listing Sidebar
1074            jQuery(".listing-with-sidebar")
1075                .find(".lp-grid-box-contianer.card1.lp-grid-box-contianer1")
1076                .removeClass("col-sm-12 list_view");
1077            jQuery(".listing-with-sidebar")
1078                .find(".lp-grid-box-contianer.card1.lp-grid-box-contianer1")
1079                .addClass("col-md-6 col-sm-12 grid_view2");
1080        }
1081
1082        // Listing with Map
1083    });
1084    jQuery("a.list").on("click", function (event) {
1085        event.preventDefault();
1086        jQuery("a.grid").removeClass("active");
1087        jQuery(this).addClass("active");
1088        jQuery(".listing-simple").addClass("listing_list_view");
1089
1090        if (
1091            jQuery("#list-grid-view-v2").length != 0 &&
1092            jQuery("#list-grid-view-v2").hasClass("swtch-ll")
1093        ) {
1094            jQuery("#list-grid-view-v2").attr("data-layout-class", "list");
1095        }
1096
1097        if (jQuery("#content-grids").hasClass("v2-toggle")) {
1098            jQuery(".loop-switch-class").removeClass("col-md-6");
1099            jQuery(".loop-switch-class").addClass("col-md-12");
1100            jQuery(".lp-listings.active-view").addClass("list-style");
1101            jQuery(".lp-listings.active-view").removeClass("grid-style");
1102        } else {
1103            // Listing with Map
1104            jQuery(".post-with-map-container")
1105                .find(".lp-grid-box-contianer.card1.lp-grid-box-contianer1")
1106                .removeClass("col-md-6 col-sm-6 grid_view2");
1107            jQuery(".post-with-map-container")
1108                .find(".lp-grid-box-contianer.card1.lp-grid-box-contianer1")
1109                .addClass("col-sm-12 list_view");
1110
1111            // Listing Simple
1112            if (
1113                jQuery("#content-grids").hasClass("listing-with-header-filters-wrap")
1114            ) {
1115                jQuery(".listing-simple")
1116                    .find(".lp-grid-box-contianer.card1.lp-grid-box-contianer1")
1117                    .removeClass("col-md-6 col-sm-6 grid_view2");
1118                jQuery(".listing-simple")
1119                    .find(".lp-grid-box-contianer.card1.lp-grid-box-contianer1")
1120                    .addClass("col-sm-12 list_view");
1121            } else {
1122                jQuery(".listing-simple")
1123                    .find(".lp-grid-box-contianer.card1.lp-grid-box-contianer1")
1124                    .removeClass("col-md-4 col-sm-6 grid_view2");
1125                jQuery(".listing-simple")
1126                    .find(".lp-grid-box-contianer.card1.lp-grid-box-contianer1")
1127                    .addClass("col-sm-12 list_view");
1128            }
1129
1130            jQuery(".listing-with-sidebar")
1131                .find(".lp-grid-box-contianer.card1.lp-grid-box-contianer1")
1132                .removeClass("col-md-6 col-sm-6 grid_view3");
1133            jQuery(".listing-with-sidebar")
1134                .find(".lp-grid-box-contianer.card1.lp-grid-box-contianer1")
1135                .addClass("col-sm-12 list_view");
1136        }
1137    });
1138
1139    //============================================ Harry Code ==================================================//
1140    // Open Hours Script
1141    jQuery("a.show-all-timings").on("click", function (event) {
1142        event.preventDefault();
1143        jQuery(this).toggleClass("opened");
1144        jQuery(this).next("ul.hidding-timings").slideToggle(400);
1145    });
1146
1147    // shebi Script
1148    jQuery(".detail-page2-tab-content .review-form h3").removeAttr("id");
1149
1150    jQuery(
1151        ".listing-app-view .listing-app-view-bar .pricy-form-group #lp-find-near-me-outer ul > li > a"
1152    ).click(function () {
1153        jQuery(this).toggleClass("margin-right-0 lp-remove-border");
1154    });
1155
1156    var inputs = document.querySelectorAll(".inputfile");
1157    Array.prototype.forEach.call(inputs, function (input) {
1158        var label = input.nextElementSibling,
1159            labelVal = label.innerHTML;
1160
1161        input.addEventListener("change", function (e) {
1162            var fileName = "";
1163            if (this.files && this.files.length > 1)
1164                fileName = (this.getAttribute("data-multiple-caption") || "").replace(
1165                    "{count}",
1166                    this.files.length
1167                );
1168            else fileName = e.target.value.split("\\").pop();
1169
1170            if (fileName) label.querySelector("span").innerHTML = fileName;
1171            else label.innerHTML = labelVal;
1172        });
1173
1174        // Firefox bug fix
1175        input.addEventListener("focus", function () {
1176            input.classList.add("has-focus");
1177        });
1178        input.addEventListener("blur", function () {
1179            input.classList.remove("has-focus");
1180        });
1181    });
1182
1183    /* from sheibi */
1184
1185    if (
1186        jQuery("body").hasClass("home") ||
1187        jQuery("body").hasClass("app-view-home")
1188    ) {
1189        jQuery(
1190            ".listing-app-view.home .map-view-list-container2,.listing-app-view.app-view-home .map-view-list-container2"
1191        ).slick({
1192            centerMode: false,
1193            centerPadding: "0px",
1194            infinite: true,
1195            accesibility: false,
1196            draggable: true,
1197            swipe: true,
1198            touchMove: false,
1199            autoplaySpeed: 1400,
1200            speed: 100,
1201            slidesToShow: 2,
1202            dots: true,
1203            arrows: false,
1204        });
1205
1206        jQuery(
1207            ".listing-app-view.home .lp-location-slider,.listing-app-view.app-view-home .lp-location-slider"
1208        ).slick({
1209            centerMode: false,
1210            centerPadding: "0px",
1211            infinite: true,
1212            accesibility: false,
1213            draggable: true,
1214            swipe: true,
1215            touchMove: false,
1216            autoplaySpeed: 1400,
1217            speed: 100,
1218            slidesToShow: 3,
1219            dots: true,
1220            arrows: false,
1221        });
1222    }
1223    if (jQuery(".listing-category-slider4").length > 0) {
1224        jQuery(".listing-category-slider4").slick({
1225            centerMode: false,
1226            centerPadding: "0px",
1227            infinite: true,
1228            accesibility: false,
1229            draggable: true,
1230            swipe: true,
1231            touchMove: false,
1232            autoplaySpeed: 1400,
1233            speed: 100,
1234            slidesToShow: 4,
1235            dots: false,
1236            arrows: true,
1237            responsive: [{
1238                breakpoint: 768,
1239                settings: {
1240                    arrows: false,
1241                    centerMode: false,
1242                    centerPadding: "0px",
1243                    slidesToShow: 4,
1244                },
1245            },
1246            {
1247                breakpoint: 480,
1248                settings: {
1249                    arrows: false,
1250                    centerMode: false,
1251                    centerPadding: "0px",
1252                    slidesToShow: 1,
1253                },
1254            },
1255            ],
1256        });
1257    }
1258
1259    jQuery("#map-view-icon2").click(function () {
1260        jQuery("#search-filter-attr-filter").animate({
1261            width: "toggle",
1262        },
1263            5
1264        );
1265    });
1266
1267    jQuery(".listing-app-view .lp-search-toggle .user-menu").click(function (e) {
1268        jQuery(".lp-user-menu").toggleClass("main");
1269    });
1270
1271    jQuery(document).mouseup(function (e) {
1272        var container = jQuery(".lp-user-menu");
1273        if (!container.is(e.target) && container.has(e.target).length === 0) {
1274            jQuery(".lp-user-menu").removeClass("main");
1275        }
1276    });
1277    jQuery(".lp-detail-page-template-3 #clicktoreview2").on(
1278        "click",
1279        function (event) {
1280            event.preventDefault();
1281            jQuery(".single-tabber2 ul li").removeClass("active");
1282            jQuery(".detail-page2-tab-content .tab-content .tab-pane").removeClass(
1283                "active"
1284            );
1285            jQuery(".single-tabber2 ul .lpreviews").addClass("active");
1286            jQuery(".detail-page2-tab-content .tab-content .lpreviews").addClass(
1287                "active"
1288            );
1289
1290            jQuery("html, body").animate({
1291                scrollTop: jQuery("#review-section").offset().top,
1292            },
1293                200
1294            );
1295        }
1296    );
1297    // end shoaib Script
1298
1299    jQuery('[data-toggle="tooltip"]').tooltip();
1300
1301    // Open review reply
1302    jQuery("a.see_more_btn").on("click", function (event) {
1303        event.preventDefault();
1304        var $this = jQuery(this);
1305        if ($this.hasClass("closedd")) {
1306            $this.removeClass("closedd");
1307            $this.addClass("openedd");
1308            jQuery(this).find("i").removeClass("fa-arrow-down");
1309            jQuery(this).find("i").addClass("fa-arrow-up");
1310        } else {
1311            $this.removeClass("openedd");
1312            $this.addClass("closedd");
1313            jQuery(this).find("i").removeClass("fa-arrow-up");
1314            jQuery(this).find("i").addClass("fa-arrow-down");
1315        }
1316        jQuery(this).next(".review-content").slideToggle(200);
1317    });
1318
1319    jQuery("a.open-reply").on("click", function (event) {
1320        event.preventDefault();
1321        var $this = jQuery(this);
1322        if ($this.hasClass("closeddd")) {
1323            $this.removeClass("closeddd");
1324            $this.addClass("openeddd");
1325            jQuery(this).find("i").removeClass("fa-arrow-down");
1326            jQuery(this).find("i").addClass("fa-arrow-up");
1327        } else {
1328            $this.removeClass("openeddd");
1329            $this.addClass("closeddd");
1330            jQuery(this).find("i").removeClass("fa-arrow-up");
1331            jQuery(this).find("i").addClass("fa-arrow-down");
1332        }
1333        jQuery(this).next(".post_response").slideToggle(200);
1334    });
1335
1336    jQuery(document).ready(function () {
1337        jQuery("select.hours-start2").prop("disabled", true);
1338        jQuery("select.hours-end2").prop("disabled", true);
1339        jQuery(".lp-check-doubletime .enable2ndday").change(function () {
1340            if (this.checked) {
1341                jQuery("select.hours-start2").prop("disabled", false);
1342                jQuery("select.hours-end2").prop("disabled", false);
1343                jQuery(".hours-select.lp-slot2-time").slideToggle(300);
1344            } else {
1345                jQuery("select.hours-start2").prop("disabled", true);
1346                jQuery("select.hours-end2").prop("disabled", true);
1347                jQuery(".hours-select.lp-slot2-time").slideToggle(300);
1348            }
1349        });
1350    });
1351
1352    // Remove Hours Script
1353
1354    jQuery(document).on("click", "a.remove-hours", function (event) {
1355        event.preventDefault();
1356        jQuery(this).parent(".hours").remove();
1357    });
1358    // Toggle Script for Currency area
1359    jQuery("a.toggle-currencey-area").on("click", function (event) {
1360        event.preventDefault();
1361        jQuery(this).next(".currency-area").slideToggle(400);
1362        jQuery(this).toggleClass("active");
1363    });
1364    // Magnific Popup
1365    jQuery(".review-img-slider").magnificPopup({
1366        delegate: "a",
1367        type: "image",
1368        tLoading: "Loading image #%curr%...",
1369        mainClass: "mfp-img-mobile",
1370        gallery: {
1371            enabled: true,
1372            navigateByImgClick: true,
1373            preload: [0, 1], // Will preload 0 - before current, and 1 after the current image
1374        },
1375        image: {
1376            tError: '<a href="%url%">The image #%curr%</a> could not be loaded.',
1377            titleSrc: function (item) {
1378                return item.el.attr("title") + "<small>by Listingpro team</small>";
1379            },
1380        },
1381    });
1382
1383    jQuery(document).ready(function () {
1384        jQuery(".fulldayopen").change(function () {
1385            if (this.checked) {
1386                jQuery("select.hours-start").prop("disabled", true);
1387                jQuery("select.hours-end").prop("disabled", true);
1388                jQuery("select.hours-start2").prop("disabled", true);
1389                jQuery("select.hours-end2").prop("disabled", true);
1390            } else {
1391                jQuery("select.hours-start").prop("disabled", false);
1392                jQuery("select.hours-end").prop("disabled", false);
1393                jQuery("select.hours-start2").prop("disabled", false);
1394                jQuery("select.hours-end2").prop("disabled", false);
1395            }
1396        });
1397    });
1398
1399    jQuery(document).ready(function () {
1400        jQuery(".add-more").click(function () {
1401            jQuery("#lp_feature_panel").slideToggle("slow");
1402        });
1403    });
1404    var hdrHeight = jQuery("header.header-normal").outerHeight();
1405
1406    jQuery(".top-section .absolute").css("top", hdrHeight);
1407
1408    if (jQuery("body").is(".single-listing")) {
1409        if (jQuery(window).width() >= 768) {
1410            // Listing Detail Gallery
1411            jQuery("a[rel^='prettyPhoto']").prettyPhoto({
1412                animation_speed: "fast",
1413                theme: "dark_rounded",
1414                slideshow: 7000,
1415                autoplay_slideshow: true,
1416                social_tools: "",
1417                deeplinking: false,
1418                show_title: false,
1419            });
1420        } else {
1421            jQuery("a[rel^='prettyPhoto']").prettyPhoto({
1422                animation_speed: "fast",
1423                theme: "dark_rounded",
1424                slideshow: 7000,
1425                autoplay_slideshow: true,
1426                social_tools: "",
1427                deeplinking: false,
1428                show_title: false,
1429            });
1430        }
1431    }
1432
1433    jQuery("a.onlineform").on("click", function (event) {
1434        event.preventDefault();
1435        jQuery(this).next(".booking-form").slideToggle(400);
1436        jQuery(this).toggleClass("active");
1437    });
1438
1439    jQuery(".listing-second-view .ask-question-area > a.ask_question_popup").on(
1440        "click",
1441        function (event) {
1442            event.preventDefault();
1443            jQuery(this).next(".faq-form").slideToggle(400);
1444        }
1445    );
1446
1447    if (jQuery("body").is(".single-listing")) {
1448        var sliderstyle = jQuery("body").data("sliderstyle");
1449
1450        if (sliderstyle == "style1") {
1451            var images = jQuery(".listing-slide").data("images-num");
1452            var center_mode = true;
1453            if (images > 5) {
1454                images = 5;
1455                center_mode = true;
1456            } else {
1457                center_mode = false;
1458            }
1459            // Listing Detail Slider
1460            jQuery(".listing-slide").slick({
1461                centerPadding: "10px",
1462                slidesToShow: images,
1463                autoplay: true,
1464                draggable: false,
1465                autoplaySpeed: 5000,
1466                centerMode: center_mode,
1467                focusOnSelect: true,
1468                arrows: true,
1469                responsive: [{
1470                    breakpoint: 768,
1471                    settings: {
1472                        arrows: false,
1473                        centerMode: false,
1474                        centerPadding: "0px",
1475                        slidesToShow: 5,
1476                    },
1477                },
1478                {
1479                    breakpoint: 480,
1480                    settings: {
1481                        arrows: true,
1482                        centerMode: false,
1483                        centerPadding: "0px",
1484                        slidesToShow: 1,
1485                    },
1486                },
1487                ],
1488            });
1489        } else if (sliderstyle == "style2") {
1490            var images = jQuery(".listing-slide").data("images-num");
1491            //alert(images);
1492            var center_mode = true;
1493            var variable = true;
1494            if (images > 3) {
1495                center_mode = false;
1496            } else if ((images = 3)) {
1497                //jQuery('.listing-slide img').css('height','auto');
1498                jQuery(".single-page-slider-container").addClass("three-imgs");
1499                variable = false;
1500            } else if ((images = 2)) {
1501                jQuery(".single-page-slider-container").addClass("new-cls");
1502            } else if ((images = 1)) {
1503                jQuery(".single-page-slider-container").addClass("one-img");
1504            } else {
1505                center_mode = false;
1506                variable = false;
1507            }
1508
1509            // Listing Detail Slider
1510            jQuery(".listing-slide").slick({
1511                slidesToShow: 2,
1512                autoplay: true,
1513                draggable: false,
1514                autoplaySpeed: 5000,
1515                centerMode: true,
1516                focusOnSelect: true,
1517                variableWidth: variable,
1518                adaptiveHeight: true,
1519                responsive: [{
1520                    breakpoint: 768,
1521                    settings: {
1522                        arrows: true,
1523                        centerMode: false,
1524                        centerPadding: "0px",
1525                        //slidesToShow: 5
1526                    },
1527                },
1528                {
1529                    breakpoint: 480,
1530                    settings: {
1531                        arrows: true,
1532                        centerMode: false,
1533                        centerPadding: "0px",
1534                        slidesToShow: 1,
1535                    },
1536                },
1537                ],
1538            });
1539        } else if (sliderstyle == "style3") {
1540            var images = jQuery(".listing-slide").data("images-num");
1541            var slidestoshow = 2;
1542            if (images == 1) {
1543                jQuery(".listing-slide img").css("width", "100%");
1544                slidestoshow = 1;
1545            } else if (images == 2) {
1546                slidestoshow = 2;
1547            } else if (images == 3) {
1548                slidestoshow = 2;
1549            } else if (images == 4) {
1550                slidestoshow = 3;
1551            } else if (images == 6) {
1552                slidestoshow = 4;
1553            } else if (images == 8) {
1554                slidestoshow = 6;
1555            } else if (images == 10) {
1556                slidestoshow = 8;
1557            } else if (images >= 12) {
1558                slidestoshow = 10;
1559            }
1560
1561            // Listing Detail Slider
1562            jQuery(".listing-slide").slick({
1563                slidesToShow: 2,
1564                autoplay: true,
1565                draggable: false,
1566                autoplaySpeed: 5000,
1567                centerMode: true,
1568                focusOnSelect: true,
1569                variableWidth: true,
1570                adaptiveHeight: true,
1571                responsive: [{
1572                    breakpoint: 9999,
1573                    settings: {
1574                        slidesToShow: slidestoshow,
1575                    },
1576                },
1577                {
1578                    breakpoint: 768,
1579                    settings: {
1580                        arrows: true,
1581                        centerMode: false,
1582                        centerPadding: "0px",
1583                        //slidesToShow: 5
1584                    },
1585                },
1586                {
1587                    breakpoint: 480,
1588                    settings: {
1589                        arrows: true,
1590                        centerMode: false,
1591                        centerPadding: "0px",
1592                        slidesToShow: 1,
1593                    },
1594                },
1595                ],
1596            });
1597        }
1598    }
1599
1600    // Listing Detail Slider
1601    if (jQuery(".listing-slide2").length != 0) {
1602        jQuery(".listing-slide2").slick({
1603            slidesToShow: 1,
1604            autoplay: false,
1605            draggable: false,
1606            autoplaySpeed: 5000,
1607            centerMode: true,
1608            centerPadding: "0px",
1609            focusOnSelect: true,
1610            variableWidth: variable,
1611            adaptiveHeight: true,
1612            responsive: [{
1613                breakpoint: 768,
1614                settings: {
1615                    arrows: true,
1616                    centerMode: false,
1617                    centerPadding: "0px",
1618                    //slidesToShow: 5
1619                },
1620            },
1621            {
1622                breakpoint: 480,
1623                settings: {
1624                    arrows: false,
1625                    centerMode: false,
1626                    centerPadding: "0px",
1627                    slidesToShow: 1,
1628                },
1629            },
1630            ],
1631        });
1632    }
1633
1634    jQuery(".select2").select2();
1635
1636    if (jQuery("body").is(".single-listing")) {
1637        jQuery(".review-img-slider").slick({
1638            infinite: true,
1639            slidesToShow: 3,
1640            slidesToScroll: 1,
1641            autoplay: false,
1642            autoplaySpeed: 5000,
1643            arrows: true,
1644            dots: false,
1645            responsive: [{
1646                breakpoint: 790,
1647                settings: {
1648                    arrows: false,
1649                    centerMode: true,
1650                    centerPadding: "40px",
1651                    slidesToShow: 2,
1652                },
1653            },
1654            {
1655                breakpoint: 480,
1656                settings: {
1657                    slidesToShow: 1,
1658                },
1659            },
1660            ],
1661        });
1662        /* end  by haroon */
1663
1664        /* code for tab style two of single list */
1665        if (
1666            jQuery(".single-inner-container .single-tabber2 ul .lpreviews").length > 0
1667        ) {
1668            jQuery(document).on(
1669                "click",
1670                ".single-inner-container .single-tabber2 ul .lpreviews",
1671                function () {
1672                    if (jQuery(".review-img-slider").hasClass("slick-initialized")) {
1673                        jQuery(".review-img-slider").slick("unslick");
1674                        jQuery(".review-img-slider").slick({
1675                            infinite: true,
1676                            slidesToShow: 3,
1677                            slidesToScroll: 1,
1678                            autoplay: false,
1679                            autoplaySpeed: 5000,
1680                            arrows: true,
1681                            dots: false,
1682                            responsive: [{
1683                                breakpoint: 790,
1684                                settings: {
1685                                    arrows: false,
1686                                    centerMode: true,
1687                                    centerPadding: "40px",
1688                                    slidesToShow: 2,
1689                                },
1690                            },
1691                            {
1692                                breakpoint: 480,
1693                                settings: {
1694                                    slidesToShow: 1,
1695                                },
1696                            },
1697                            ],
1698                        });
1699                    }
1700                }
1701            );
1702        }
1703
1704        jQuery(".post-slide").slick({
1705            infinite: true,
1706            slidesToShow: 2,
1707            slidesToScroll: 1,
1708            arrows: false,
1709            dots: true,
1710            responsive: [{
1711                breakpoint: 2,
1712                settings: {
1713                    arrows: false,
1714                    centerMode: true,
1715                    centerPadding: "40px",
1716                    slidesToShow: 3,
1717                },
1718            },
1719            {
1720                breakpoint: 480,
1721                settings: {
1722                    slidesToShow: 1,
1723                },
1724            },
1725            ],
1726        });
1727
1728        //Slick One Per Slide Testimonials
1729        jQuery(".testimonial-slider").slick({
1730            dots: true,
1731            infinite: true,
1732            autoplay: true,
1733            autoplaySpeed: 1000,
1734            speed: 1000,
1735            arrows: false,
1736            slidesToShow: 1,
1737        });
1738    }
1739    // Accordion
1740    var icons = {
1741        header: "fa fa-plus",
1742        activeHeader: "fa fa-minus",
1743    };
1744    jQuery("#accordion").accordion({
1745        icons: icons,
1746        heightStyle: "content",
1747    });
1748    jQuery("#toggle")
1749        .button()
1750        .on("click", function () {
1751            if (jQuery("#accordion").accordion("option", "icons")) {
1752                jQuery("#accordion").accordion("option", "icons", null);
1753            } else {
1754                jQuery("#accordion").accordion("option", "icons", icons);
1755            }
1756        });
1757    // Popup Gallery
1758    jQuery(".popup-youtube, .popup-vimeo, .popup-gmaps").magnificPopup({
1759        disableOn: 319,
1760        type: "iframe",
1761        iframe: {
1762            markup: '<div class="mfp-iframe-scaler">' +
1763                '<div class="mfp-close"></div>' +
1764                '<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>' +
1765                "</div>",
1766            patterns: {
1767                youtube: {
1768                    index: "youtube.com/",
1769                    id: "v=",
1770                    src: "//www.youtube.com/embed/%id%?rel=0&autoplay=1",
1771                },
1772            },
1773            srcAction: "iframe_src",
1774        },
1775        mainClass: "mfp-fade",
1776        removalDelay: 160,
1777        preloader: false,
1778        fixedContentPos: false,
1779    });
1780
1781    jQuery(".popup-gallery").magnificPopup({
1782        delegate: ".image-popup",
1783        type: "image",
1784        tLoading: "Loading image #%curr%...",
1785        mainClass: "mfp-img-mobile",
1786        gallery: {
1787            enabled: true,
1788            navigateByImgClick: true,
1789            preload: [0, 1], // Will preload 0 - before current, and 1 after the current image
1790        },
1791    });
1792    //Boostrap Rating
1793    //http://dreyescat.github.io/bootstrap-rating/
1794    jQuery("input.check").on("change", function () {
1795        alert("Rating: " + jQuery(this).val());
1796    });
1797    if (jQuery("body").is(".single-listing")) {
1798        jQuery("#programmatically-set").on("click", function () {
1799            jQuery("#programmatically-rating").rating(
1800                "rate",
1801                jQuery("#programmatically-value").val()
1802            );
1803        });
1804        jQuery("#programmatically-get").on("click", function () {
1805            alert(jQuery("#programmatically-rating").rating("rate"));
1806        });
1807
1808        jQuery(".rating-tooltip-manual").rating({
1809            extendSymbol: function () {
1810                var title;
1811                jQuery(this).tooltip({
1812                    container: "body",
1813                    placement: "bottom",
1814                    trigger: "manual",
1815                    title: function () {
1816                        return title;
1817                    },
1818                });
1819                jQuery(this)
1820                    .on("rating.rateenter", function (e, rate) {
1821                        title = rate;
1822                        jQuery(this).tooltip("show");
1823                    })
1824                    .on("rating.rateleave", function () {
1825                        jQuery(this).tooltip("hide");
1826                    });
1827            },
1828        });
1829        jQuery(".rating").each(function () {
1830            jQuery('<span class="label label-default"></span>')
1831                .text(jQuery(this).val() || " ")
1832                .insertAfter(this);
1833        });
1834        jQuery(".rating").on("change", function () {
1835            jQuery(this).next(".label").text(jQuery(this).val());
1836        });
1837    }
1838    // Mapbox
1839});
1840jQuery(window).on("load", function () {
1841    if (jQuery(this).width() < 981) {
1842        jQuery(".claimformtrigger").on("click", function () {
1843            if (jQuery(".claimform").hasClass("claimform-open")) {
1844                jQuery(".claimform").removeClass("claimform-open");
1845                jQuery(".claimform").hide();
1846            } else {
1847                jQuery(this).closest(".post-row").addClass("rowopen");
1848                jQuery(".claimform").addClass("claimform-open");
1849                jQuery(".claimform").show();
1850            }
1851        });
1852    }
1853
1854    jQuery(window)
1855        .resize(function () {
1856            if (jQuery(this).width() < 781) {
1857                jQuery(".mobilemap").removeAttr("id");
1858                jQuery(".mobilemap").removeClass("md-modal");
1859                jQuery(".mobilemap").removeClass("md-effect-3");
1860                jQuery(".mobilelink").removeClass("md-trigger");
1861                jQuery(".mobile-map-space .md-overlayi").removeClass("md-overlay");
1862                jQuery(".listing-container-right .md-overlayi").removeClass(
1863                    "md-overlay"
1864                );
1865                jQuery(".mobilelink").on("click", function () {
1866                    if (jQuery(".mobilemap").hasClass("map-open")) {
1867                        jQuery(".mobilemap").removeClass("map-open");
1868                        jQuery(".mobilemap .mapbilemap-content").css({
1869                            opacity: "0",
1870                            "margin-top": "-520px",
1871                        });
1872                        jQuery("a.mobilelink").text("View on map");
1873                    } else {
1874                        jQuery(".mobilemap").addClass("map-open");
1875                        jQuery(".mobilemap .mapbilemap-content").css({
1876                            opacity: "1",
1877                            "margin-top": "0px",
1878                        });
1879                        jQuery("a.mobilelink").text("Close map");
1880                    }
1881                });
1882                jQuery(".quickformtrigger").on("click", function () {
1883                    if (jQuery(".quickform").hasClass("quickform-open")) {
1884                        jQuery(".quickform").removeClass("quickform-open");
1885                        jQuery(".quickform").slideUp(600);
1886                    } else {
1887                        jQuery(".quickform").addClass("quickform-open");
1888                        jQuery(".quickform").slideDown(600);
1889                    }
1890                });
1891            } else {
1892                var headertop = jQuery("header").height();
1893                jQuery(".section-fixed").css("padding-top", headertop + "px");
1894            }
1895        })
1896        .resize(); //triggcurrentColorer the event manually when the page is loaded
1897
1898    jQuery(".listing-sidebar-left .form-inline").fadeTo(600, 1);
1899    jQuery(".post-with-map-container .form-inline").fadeTo(600, 1);
1900    jQuery(".spinner").css("display", "none");
1901    //jQuery('.single-page-slider-container').css("opacity","1");
1902
1903    /*
1904     * L.TileLayer is used for standard xyz-numbered tile layers.
1905     */
1906
1907    L.Google = L.Class.extend({
1908        includes: L.Mixin.Events,
1909
1910        options: {
1911            minZoom: 0,
1912            maxZoom: 18,
1913            tileSize: 256,
1914            subdomains: "abc",
1915            errorTileUrl: "",
1916            attribution: "",
1917            opacity: 1,
1918            continuousWorld: false,
1919            noWrap: false,
1920            mapOptions: {
1921                backgroundColor: "#dddddd",
1922            },
1923        },
1924
1925        // Possible types: SATELLITE, ROADMAP, HYBRID, TERRAIN
1926        initialize: function (type, options) {
1927            L.Util.setOptions(this, options);
1928
1929            this._ready = google.maps.Map != undefined;
1930            if (!this._ready) L.Google.asyncWait.push(this);
1931
1932            this._type = type || "SATELLITE";
1933        },
1934
1935        onAdd: function (map, insertAtTheBottom) {
1936            this._map = map;
1937            this._insertAtTheBottom = insertAtTheBottom;
1938
1939            // create a container div for tiles
1940            this._initContainer();
1941            this._initMapObject();
1942
1943            // set up events
1944            map.on("viewreset", this._resetCallback, this);
1945
1946            this._limitedUpdate = L.Util.limitExecByInterval(this._update, 150, this);
1947            map.on("move", this._update, this);
1948
1949            map.on("zoomanim", this._handleZoomAnim, this);
1950
1951            //20px instead of 1em to avoid a slight overlap with google's attribution
1952            map._controlCorners["bottomright"].style.marginBottom = "20px";
1953
1954            this._reset();
1955            this._update();
1956        },
1957
1958        onRemove: function (map) {
1959            this._map._container.removeChild(this._container);
1960            //this._container = null;
1961
1962            this._map.off("viewreset", this._resetCallback, this);
1963
1964            this._map.off("move", this._update, this);
1965
1966            this._map.off("zoomanim", this._handleZoomAnim, this);
1967
1968            map._controlCorners["bottomright"].style.marginBottom = "0em";
1969            //this._map.off('moveend', this._update, this);
1970        },
1971
1972        getAttribution: function () {
1973            return this.options.attribution;
1974        },
1975
1976        setOpacity: function (opacity) {
1977            this.options.opacity = opacity;
1978            if (opacity < 1) {
1979                L.DomUtil.setOpacity(this._container, opacity);
1980            }
1981        },
1982
1983        setElementSize: function (e, size) {
1984            e.style.width = size.x + "px";
1985            e.style.height = size.y + "px";
1986        },
1987
1988        _initContainer: function () {
1989            var tilePane = this._map._container,
1990                first = tilePane.firstChild;
1991
1992            if (!this._container) {
1993                this._container = L.DomUtil.create(
1994                    "div",
1995                    "leaflet-google-layer leaflet-top leaflet-left"
1996                );
1997                this._container.id = "_GMapContainer_" + L.Util.stamp(this);
1998                this._container.style.zIndex = "auto";
1999            }
2000
2001            tilePane.insertBefore(this._container, first);
2002
2003            this.setOpacity(this.options.opacity);
2004            this.setElementSize(this._container, this._map.getSize());
2005        },
2006
2007        _initMapObject: function () {
2008            if (!this._ready) return;
2009            this._google_center = new google.maps.LatLng(0, 0);
2010            var map = new google.maps.Map(this._container, {
2011                center: this._google_center,
2012                zoom: 0,
2013                tilt: 0,
2014                mapTypeId: google.maps.MapTypeId[this._type],
2015                disableDefaultUI: false,
2016                keyboardShortcuts: false,
2017                draggable: false,
2018                disableDoubleClickZoom: true,
2019                scrollwheel: false,
2020                streetViewControl: true,
2021                styles: this.options.mapOptions.styles,
2022                backgroundColor: this.options.mapOptions.backgroundColor,
2023            });
2024
2025            var _this = this;
2026            this._reposition = google.maps.event.addListenerOnce(
2027                map,
2028                "center_changed",
2029                function () {
2030                    _this.onReposition();
2031                }
2032            );
2033            this._google = map;
2034
2035            google.maps.event.addListenerOnce(map, "idle", function () {
2036                _this._checkZoomLevels();
2037            });
2038        },
2039
2040        _checkZoomLevels: function () {
2041            //setting the zoom level on the Google map may result in a different zoom level than the one requested
2042            //(it won't go beyond the level for which they have data).
2043            // verify and make sure the zoom levels on both Leaflet and Google maps are consistent
2044            if (this._google.getZoom() !== this._map.getZoom()) {
2045                //zoom levels are out of sync. Set the leaflet zoom level to match the google one
2046                this._map.setZoom(this._google.getZoom());
2047            }
2048        },
2049
2050        _resetCallback: function (e) {
2051            this._reset(e.hard);
2052        },
2053
2054        _reset: function (clearOldContainer) {
2055            this._initContainer();
2056        },
2057
2058        _update: function (e) {
2059            if (!this._google) return;
2060            this._resize();
2061
2062            var center = e && e.latlng ? e.latlng : this._map.getCenter();
2063            var _center = new google.maps.LatLng(center.lat, center.lng);
2064
2065            this._google.setCenter(_center);
2066            this._google.setZoom(this._map.getZoom());
2067
2068            this._checkZoomLevels();
2069            //this._google.fitBounds(google_bounds);
2070        },
2071
2072        _resize: function () {
2073            var size = this._map.getSize();
2074            if (
2075                this._container.style.width == size.x &&
2076                this._container.style.height == size.y
2077            )
2078                return;
2079            this.setElementSize(this._container, size);
2080            this.onReposition();
2081        },
2082
2083        _handleZoomAnim: function (e) {
2084            var center = e.center;
2085            var _center = new google.maps.LatLng(center.lat, center.lng);
2086
2087            this._google.setCenter(_center);
2088            this._google.setZoom(e.zoom);
2089        },
2090
2091        onReposition: function () {
2092            if (!this._google) return;
2093            google.maps.event.trigger(this._google, "resize");
2094        },
2095    });
2096
2097    L.Google.asyncWait = [];
2098    L.Google.asyncInitialize = function () {
2099        var i;
2100        for (i = 0; i < L.Google.asyncWait.length; i++) {
2101            var o = L.Google.asyncWait[i];
2102            o._ready = true;
2103            if (o._container) {
2104                o._initMapObject();
2105                o._update();
2106            }
2107        }
2108        L.Google.asyncWait = [];
2109    };
2110
2111    L.HtmlIcon = L.Icon.extend({
2112        options: {
2113            /*
2114                         html: (String) (required)
2115                         iconAnchor: (Point)
2116                         popupAnchor: (Point)
2117                         */
2118        },
2119
2120        initialize: function (options) {
2121            L.Util.setOptions(this, options);
2122        },
2123
2124        createIcon: function () {
2125            var div = document.createElement("div");
2126            div.innerHTML = this.options.html;
2127            if (div.classList) div.classList.add("leaflet-marker-icon");
2128            else div.className += " " + "leaflet-marker-icon";
2129            return div;
2130        },
2131
2132        createShadow: function () {
2133            return null;
2134        },
2135    });
2136
2137    jQuery(".all-list-map").on("click", function () {
2138        var defmaplat = jQuery("body").data("defaultmaplat");
2139        var defmaplong = jQuery("body").data("defaultmaplot");
2140        jQuery(".map-pop").empty();
2141        if (jQuery("#map-section").is(".map-container3")) {
2142            jQuery(".map-pop").html('<div class="mapSidebar" id="map"></div>');
2143        } else {
2144            jQuery(".map-pop").html('<div class="listingmap" id="map"></div>');
2145        }
2146        var map = null;
2147        $mtoken = jQuery("#page").data("mtoken");
2148        $mtype = jQuery("#page").data("mtype");
2149        $mapboxDesign = jQuery("#page").data("mstyle");
2150
2151        if ($mtoken != "" && $mtype == "mapbox") {
2152            L.mapbox.accessToken = $mtoken;
2153            map = L.mapbox.map("map");
2154            L.tileLayer(
2155                "https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}", {
2156                maxZoom: 18,
2157                attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
2158                    '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
2159                    'Imagery © <a href="http://mapbox.com">Mapbox</a>',
2160                id: jQuery("#page").data("mstyle"),
2161                accessToken: $mtoken,
2162            }
2163            ).addTo(map);
2164
2165            var markers = new L.MarkerClusterGroup();
2166            initializeMap(markers);
2167            if (markers === undefined) { } else {
2168                map.fitBounds(markers.getBounds());
2169                map.scrollWheelZoom.disable();
2170            }
2171        } else {
2172            var map = new L.Map("map", {
2173                minZoom: 3,
2174            }
2174).setView(new L.LatLng(defmaplat, defmaplong), 18);
2175            if ($mtype == "google") {
2176                L.tileLayer("http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}", {
2177                    maxZoom: 6,
2178                    subdomains: ["mt0", "mt1", "mt2", "mt3"],
2179                    noWrap: true,
2180                });
2181                var googleLayer = new L.Google("ROADMAP");
2182                map.addLayer(googleLayer);
2183            } else {
2184                L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png").addTo(
2185                    map
2186                );
2187            }
2188            var markers = new L.MarkerClusterGroup();
2189            initializeMap(markers);
2190            if (markers === undefined) { } else {
2191                map.fitBounds(markers.getBounds(), {
2192                    padding: [50, 50],
2193                });
2194            }
2195        }
2196
2197        function initializeMap(markers) {
2198            markers.clearLayers();
2199
2200            jQuery(".lp-grid-box-contianer").each(function (i) {
2201                var LPtitle = jQuery(this).data("title");
2202                var LPposturl = jQuery(this).data("posturl");
2203                var LPlattitue = jQuery(this).data("lattitue");
2204                var LPlongitute = jQuery(this).data("longitute");
2205                var LPpostid = jQuery(this).data("postid");
2206                if (jQuery(".v2-map-load").length == 1) {
2207                    var LPaddress = jQuery(this).find(".gaddress").text();
2208                    var LPimageSrc = jQuery(this)
2209                        .find(".lp-listing-top-thumb")
2210                        .find("img")
2211                        .attr("src");
2212                    var LPiconSrc = jQuery(this)
2213                        .find(".cat-icon")
2214                        .find("img")
2215                        .attr("src");
2216                    if (typeof jQuery("body").data("deficon") !== "undefined") {
2217                        LPiconSrc = jQuery("body").data("deficon");
2218                    }
2219                } else {
2220                    var LPaddress = jQuery(this).find(".gaddress").text();
2221                    var LPimageSrc = jQuery(this)
2222                        .find(".lp-grid-box-thumb")
2223                        .find("img")
2224                        .attr("src");
2225                    var LPiconSrc = jQuery(this)
2226                        .find(".cat-icon")
2227                        .find("img")
2228                        .attr("src");
2229                    if (typeof jQuery("body").data("deficon") !== "undefined") {
2230                        LPiconSrc = jQuery("body").data("deficon");
2231                    }
2232                }
2233
2234                if (LPlattitue != "" && LPlongitute != "") {
2235                    var LPimage = "";
2236                    if (LPimageSrc != "") {
2237                        LPimage = LPimageSrc;
2238                    }
2239
2240                    var LPicon = "";
2241                    if (LPiconSrc != "") {
2242                        LPicon = LPiconSrc;
2243                    }
2244                    if (jQuery(this).find(".cat-icon i").length > 0) {
2245                        LPicon = jQuery(this).find(".cat-icon").html();
2246                    } else {
2247                        LPicon = "<img alt='image' src='" + LPicon + "' />";
2248                    }
2249                    var markerLocation = new L.LatLng(LPlattitue, LPlongitute); // London
2250
2251                    var CustomHtmlIcon = L.HtmlIcon.extend({
2252                        options: {
2253                            html: "<div class='lpmap-icon-shape pin card" +
2254                                LPpostid +
2255                                "'><div class='lpmap-icon-contianer'>" +
2256                                LPicon +
2257                                "</div></div>",
2258                        },
2259                    });
2260
2261                    if (LPimage == "undefined") {
2262                        LPimage = jQuery(this)
2263                            .find(".lp-grid-box-thumb")
2264                            .find("img")
2265                            .attr("src");
2266                    }
2267
2268                    var customHtmlIcon = new CustomHtmlIcon();
2269
2270                    var marker = new L.Marker(markerLocation, {
2271                        icon: customHtmlIcon,
2272                    })
2273                        .bindPopup(
2274                            '<div class="map-post"><div class="map-post-thumb"><a href="' +
2275                            LPposturl +
2276                            '"><img alt="image" src="' +
2277                            LPimage +
2278                            '" ></a></div><div class="map-post-des"><div class="map-post-title"><h5><a href="' +
2279                            LPposturl +
2280                            '">' +
2281                            LPtitle +
2282                            '</a></h5></div><div class="map-post-address"><p><i class="fa fa-map-marker"></i> ' +
2283                            LPaddress +
2284                            "</p></div></div></div>"
2285                        )
2286                        .addTo(map);
2287                    markers.addLayer(marker);
2288                    map.addLayer(markers);
2289                }
2290            });
2291        }
2292    });
2293
2294    if (jQuery("#cpmap").is(".contactmap")) {
2295        jQuery("#cpmap").empty();
2296        var map = null;
2297        $mtoken = jQuery("#page").data("mtoken");
2298        $mtype = jQuery("#page").data("mtype");
2299        $siteURL = jQuery("#page").data("site-url");
2300        $lat = jQuery(".cp-lat").data("lat");
2301        $lan = jQuery(".cp-lan").data("lan");
2302        if ($mtoken != "" && $mtype == "mapbox") {
2303            L.mapbox.accessToken = $mtoken;
2304
2305            $mapboxDesign = jQuery("#page").data("mstyle");
2306            var map = L.mapbox.map("cpmap").setView([$lat, $lan], 14);
2307            L.tileLayer(
2308                "https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}", {
2309                id: jQuery("#page").data("mstyle"),
2310                accessToken: jQuery("#page").data("mtoken"),
2311            }
2312            ).addTo(map);
2313            map.scrollWheelZoom.disable();
2314        } else {
2315            var map = new L.Map("cpmap", "").setView(new L.LatLng($lat, $lan), 16);
2316            if ($mtype == "google") {
2317                var googleLayer = new L.Google("ROADMAP");
2318                map.addLayer(googleLayer);
2319            } else {
2320                L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png").addTo(
2321                    map
2322                );
2323            }
2324
2325            map.scrollWheelZoom.disable();
2326        }
2327
2328        var markers = new L.MarkerClusterGroup();
2329        var $pinicon = jQuery("#cpmap").data("pinicon");
2330        if ($pinicon === "") {
2331            $pinicon =
2332                "<div class='lpmap-icon-shape pin'><div class='lpmap-icon-contianer'><img alt='image' src='" +
2333                $siteURL +
2334                "wp-content/themes/listingpro/assets/images/pins/lp-logo.png'  /></div></div>";
2335        } else {
2336            $pinicon =
2337                "<div style='width:50px; height:50px; margin: -50px 0 0 -20px;'><img alt='image' src='" +
2338                $pinicon +
2339                "'  /></div>";
2340        }
2341
2342        var markerLocation = new L.LatLng($lat, $lan); // London
2343
2344        var CustomHtmlIcon = L.HtmlIcon.extend({
2345            options: {
2346                html: $pinicon,
2347            },
2348        });
2349
2350        var customHtmlIcon = new CustomHtmlIcon();
2351
2352        var marker = new L.Marker(markerLocation, {
2353            icon: customHtmlIcon,
2354        })
2355            .bindPopup("")
2356            .addTo(map);
2357        markers.addLayer(marker);
2358    } else if (jQuery("#map").is(".singlebigpost")) {
2359        jQuery(".singlebigmaptrigger").click(function () {
2360            $mtoken = jQuery("#page").data("mtoken");
2361            $siteURL = jQuery("#page").data("site-url");
2362            $mtype = jQuery("#page").data("mtype");
2363            $lat = jQuery(".singlebigmaptrigger").data("lat");
2364            $lan = jQuery(".singlebigmaptrigger").data("lan");
2365            if ($mtoken != "" && $mtype == "mapbox") {
2366                L.mapbox.accessToken = $mtoken;
2367                var map = L.mapbox.map("map").setView([$lat, $lan], 14);
2368                L.tileLayer(
2369                    "https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}", {
2370                    id: jQuery("#page").data("mstyle"),
2371                    accessToken: jQuery("#page").data("mtoken"),
2372                }
2373                ).addTo(map);
2374
2375                var markers = new L.MarkerClusterGroup();
2376
2377                var markerLocation = new L.LatLng($lat, $lan); // London
2378
2379                var CustomHtmlIcon = L.HtmlIcon.extend({
2380                    options: {
2381                        html: "<div class='lpmap-icon-shape pin '><div class='lpmap-icon-contianer'><img alt='image' src='" +
2382                            $siteURL +
2383                            "wp-content/themes/listingpro/assets/images/pins/lp-logo.png'  /></div></div>",
2384                    },
2385                });
2386
2387                var customHtmlIcon = new CustomHtmlIcon();
2388
2389                var marker = new L.Marker(markerLocation, {
2390                    icon: customHtmlIcon,
2391                })
2392                    .bindPopup("")
2393                    .addTo(map);
2394                markers.addLayer(marker);
2395                map.fitBounds(markers.getBounds());
2396
2397                map.scrollWheelZoom.disable();
2398                map.invalidateSize();
2399            } else {
2400                var map = new L.Map("map", {
2401                    center: new L.LatLng($lat, $lan),
2402                    zoom: 14,
2403                });
2404                if ($mtype == "google") {
2405                    var googleLayer = new L.Google("ROADMAP");
2406                    map.addLayer(googleLayer);
2407                } else {
2408                    L.tileLayer(
2409                        "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
2410                    ).addTo(map);
2411                }
2412                var markers = new L.MarkerClusterGroup();
2413                var markerLocation = new L.LatLng($lat, $lan); // London
2414                var CustomHtmlIcon = L.HtmlIcon.extend({
2415                    options: {
2416                        html: "<div class='lpmap-icon-shape pin '><div class='lpmap-icon-contianer'><img alt='image' src='" +
2417                            $siteURL +
2418                            "wp-content/themes/listingpro/assets/images/pins/lp-logo.png'  /></div></div>",
2419                    },
2420                });
2421
2422                var customHtmlIcon = new CustomHtmlIcon();
2423
2424                var marker = new L.Marker(markerLocation, {
2425                    icon: customHtmlIcon,
2426                })
2427                    .bindPopup("")
2428                    .addTo(map);
2429                markers.addLayer(marker);
2430                map.fitBounds(markers.getBounds());
2431
2432                map.scrollWheelZoom.disable();
2433                map.invalidateSize();
2434            }
2435        });
2436    }
2437});
2438jQuery(document).ready(function () {
2439    // Autocomplete
2440
2441    jQuery.widget("custom.combobox", {
2442        _create: function () {
2443            this.wrapper = jQuery("<span>")
2444                .addClass("custom-combobox")
2445                .insertAfter(this.element);
2446
2447            this.element.hide();
2448            this._createAutocomplete();
2449            this._createShowAllButton();
2450        },
2451        _createAutocomplete: function () {
2452            var selected = this.element.children(":selected"),
2453                value = selected.val() ? selected.text() : "";
2454
2455            this.input = jQuery("<input>")
2456                .appendTo(this.wrapper)
2457                .val(value)
2458                .attr("title", "")
2459                .addClass(
2460                    "custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left lp-search-input location_input lp-home-locaton-input"
2461                )
2462                .autocomplete({
2463                    delay: 0,
2464                    minLength: 0,
2465                    source: $.proxy(this, "_source"),
2466                })
2467                .tooltip({
2468                    tooltipClass: "ui-state-highlight",
2469                });
2470        },
2471
2472        _createShowAllButton: function () {
2473            var input = this.input,
2474                wasOpen = false;
2475
2476            jQuery("<a>")
2477                .attr("tabIndex", -1)
2478                .attr("title", "Show All Items")
2479                .tooltip()
2480                .appendTo(this.wrapper)
2481                .button({
2482                    icons: {
2483                        primary: "ui-icon-triangle-1-s",
2484                    },
2485                    text: false,
2486                })
2487                .removeClass("ui-corner-all")
2488                .addClass("custom-combobox-toggle ui-corner-right")
2489                .mousedown(function () {
2490                    wasOpen = input.autocomplete("widget").is(":visible");
2491                })
2492                .on("click", function () {
2493                    input.focus();
2494
2495                    // Close if already visible
2496                    if (wasOpen) {
2497                        return;
2498                    }
2499
2500                    // Pass empty string as value to search for, displaying all results
2501                    input.autocomplete("search", "");
2502                });
2503        },
2504
2505        _source: function (request, response) {
2506            var matcher = new RegExp(
2507                $.ui.autocomplete.escapeRegex(request.term),
2508                "i"
2509            );
2510            response(
2511                this.element.children("option").map(function () {
2512                    var text = jQuery(this).text();
2513                    if (this.value && (!request.term || matcher.test(text)))
2514                        return {
2515                            label: text,
2516                            value: text,
2517                            option: this,
2518                        };
2519                })
2520            );
2521        },
2522
2523        _removeIfInvalid: function (event, ui) {
2524            // Selected an item, nothing to do
2525            if (ui.item) {
2526                return;
2527            }
2528
2529            // Search for a match (case-insensitive)
2530            var value = this.input.val(),
2531                valueLowerCase = value.toLowerCase(),
2532                valid = false;
2533            this.element.children("option").each(function () {
2534                if (jQuery(this).text().toLowerCase() === valueLowerCase) {
2535                    this.selected = valid = true;
2536                    return false;
2537                }
2538            });
2539
2540            // Found a match, nothing to do
2541            if (valid) {
2542                return;
2543            }
2544
2545            // Remove invalid value
2546            this.input
2547                .val("")
2548                .attr("title", value + " didn't match any item")
2549                .tooltip("open");
2550            this.element.val("");
2551            this._delay(function () {
2552                this.input.tooltip("close").attr("title", "");
2553            }, 2500);
2554            this.input.autocomplete("instance").term = "";
2555        },
2556
2557        _destroy: function () {
2558            this.wrapper.remove();
2559            this.element.show();
2560        },
2561    });
2562
2563    jQuery(".comboboxs").combobox();
2564    jQuery("#toggle").on("click", function () {
2565        jQuery(".comboboxs").toggle();
2566    });
2567    // jQuery( "#searchcategory" ).combobox();
2568    jQuery("#toggle").on("click", function () {
2569        jQuery("#searchcategory").toggle();
2570    });
2571    jQuery(".ui-autocomplete").autocomplete({
2572        appendTo: ".input-group",
2573    });
2574    jQuery(".custom-combobox-input").autocomplete({
2575        minLength: 0,
2576    });
2577    jQuery(".custom-combobox-input").on("click", function () {
2578        jQuery(this).autocomplete("search", "");
2579    });
2580
2581    // Location Placeholder
2582    jQuery(".location_input").attr("placeholder", "Your Location");
2583    jQuery(".comboboxCategory .location_input").attr("placeholder", "Food");
2584    jQuery(".postSubmitCat .location_input").attr(
2585        "placeholder",
2586        "Chose one or more than one categories"
2587    );
2588
2589    jQuery(document).on("click", ".md-close", function () {
2590        jQuery(".md-modal").modal("hide");
2591        jQuery(".md-modal").removeClass("md-show");
2592        jQuery(".modal-backdrop").remove();
2593    });
2594
2595    // Popup Data
2596    jQuery(document).on("click", ".qickpopup", function () {
2597        // variables
2598        jQuery(".content-loading").removeAttr("style");
2599        var LPtitle = jQuery(this).closest(".lp-grid-box-contianer").data("title");
2600        var LPlattitue = jQuery(this)
2601            .closest(".lp-grid-box-contianer")
2602            .data("lattitue");
2603        var LPlongitute = jQuery(this)
2604            .closest(".lp-grid-box-contianer")
2605            .data("longitute");
2606        var LPpostID = jQuery(this)
2607            .closest(".lp-grid-box-contianer")
2608            .data("postid");
2609        var feaImg = jQuery(this).closest(".lp-grid-box-contianer").data("feaimg");
2610        var mapPin = jQuery(this).data("mappin");
2611        jQuery("#listing-preview-popup .md-close").hide();
2612        var docHeight = jQuery(document).height();
2613        jQuery("#listing-preview-popup .popup-inner-left-padding")
2614            .html("")
2615            .css("min-hegiht", "300px");
2616        if (jQuery("#listing-preview-popup").is(".md-show")) { } else {
2617            jQuery("#listing-preview-popup").modal({
2618                show: "true",
2619            });
2620            if (jQuery(this).closest(".classic-view-grid-saved-options").length > 0) {
2621                jQuery("#listing-preview-popup").addClass("lp-classic-preview-modal");
2622            }
2623            jQuery("#listing-preview-popup").addClass("md-show");
2624        }
2625        jQuery.ajax({
2626            url: ajax_search_term_object.ajaxurl,
2627            dataType: "json",
2628            data: {
2629                action: "quick_preivew_cb",
2630                LPpostID: LPpostID,
2631                lpNonce: jQuery("#lpNonce").val(),
2632            },
2633            success: function (data) {
2634                jQuery("#listing-preview-popup .md-close")
2635                    .show()
2636                    .children("i")
2637                    .css("right", "20px");
2638                jQuery("#listing-preview-popup .popup-inner-left-padding").html(data);
2639                var mapinSrc = "";
2640
2641                mapinSrc = jQuery(data).find("span.cat-icon").find("img").attr("src");
2642                if (mapinSrc != "") {
2643                    mapPin = mapinSrc;
2644                }
2645                if (jQuery(data).find(".cat-icon i").length > 0) {
2646                    mapPin = jQuery(data).find(".cat-icon").html();
2647                } else {
2648                    mapPin = "<img alt='image' src='" + mapPin + "' />";
2649                }
2650
2651                var markers = false;
2652                $mtoken = jQuery("#page").data("mtoken");
2653                $siteURL = jQuery("#page").data("site-url");
2654                $lat = LPlattitue;
2655                $lan = LPlongitute;
2656                $mapboxDesign = jQuery("#page").data("mstyle");
2657                $mtype = jQuery("#page").data("mtype");
2658                if ($mtoken != "" && $mtype == "mapbox") {
2659                    L.mapbox.accessToken = $mtoken;
2660                    map = L.mapbox.map("quickmap" + LPpostID);
2661                    L.tileLayer(
2662                        "https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}", {
2663                        id: jQuery("#page").data("mstyle"),
2664                        accessToken: jQuery("#page").data("mtoken"),
2665                    }
2666                    ).addTo(map);
2667                } else {
2668                    var map = new L.Map("quickmap" + LPpostID, {
2669                        center: new L.LatLng($lat, $lan),
2670                        zoom: 14,
2671                    });
2672                    if ($mtype == "google") {
2673                        var googleLayer = new L.Google("ROADMAP");
2674                        map.addLayer(googleLayer);
2675                    } else {
2676                        L.tileLayer(
2677                            "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
2678                        ).addTo(map);
2679                    }
2680                }
2681                map.setView([$lat, $lan], 14);
2682                markers = new L.MarkerClusterGroup();
2683                var markerLocation = new L.LatLng($lat, $lan); // London
2684                var CustomHtmlIcon = L.HtmlIcon.extend({
2685                    options: {
2686                        html: '<div class="lpmap-icon-shape pin"><div class="lpmap-icon-contianer">' +
2687                            mapPin +
2688                            "</div></div>",
2689                    },
2690                });
2691                var customHtmlIcon = new CustomHtmlIcon();
2692                var marker = new L.Marker(markerLocation, {
2693                    icon: customHtmlIcon,
2694                })
2695                    .bindPopup("")
2696                    .addTo(map);
2697                markers.addLayer(marker);
2698                //alert(data.cats_markup);
2699                jQuery(".content-loading").css("background-image", "none");
2700            },
2701            error: function (errorThrown) {
2702                alert(errorThrown);
2703            },
2704        });
2705    });
2706
2707    //href Smooth Scroll
2708
2709    // handle links with @href started with '#' only
2710    jQuery('.post-meta-right-box a.secondary-btn[href^="#"]').on(
2711        "click",
2712        function (e) {
2713            e.preventDefault();
2714
2715            var target = this.hash;
2716            var $target = jQuery(target);
2717
2718            jQuery("html, body")
2719                .stop()
2720                .animate({
2721                    scrollTop: $target.offset().top,
2722                },
2723                    900,
2724                    "swing",
2725                    function () {
2726                        window.location.hash = target;
2727                    }
2728                );
2729        }
2730    );
2731    //Tags Container
2732    jQuery(".chosen-select2").chosen({
2733        disable_search: true,
2734    });
2735    jQuery(".chosen-select1").chosen({
2736        disable_search: true,
2737    });
2738    jQuery(".chosen-select7").chosen({
2739        disable_search: true,
2740    });
2741    jQuery(".chosen-select5").chosen({
2742        disable_search: true,
2743    });
2744    // jQuery( ".chosen-select.chosen-select5" ).select2({minimumResultsForSearch: -1});
2745
2746    var $tags = jQuery("#searchtags").chosen(),
2747        LPnewTags = function () {
2748            jQuery(".LPtagsContainer").empty();
2749            $tags.find(":selected").each(function (i, obj) {
2750                jQuery(
2751                    '<div class="active-tag">' +
2752                    obj.value +
2753                    '<div class="remove-tag"><i class="fa fa-times"></i></div></div>'
2754                )
2755                    .appendTo(".LPtagsContainer")
2756                    .on("click", function () {
2757                        jQuery(this).remove();
2758                        jQuery(obj).attr("selected", false);
2759                        $tags.trigger("chosen:updated");
2760                        jQuery(
2761                            '.LPtagsContainer input[value="' + obj.value + '"]'
2762                        ).remove();
2763                    });
2764
2765                jQuery(
2766                    '<input type="hidden" name="select_tag" value="' + obj.value + '" />'
2767                ).appendTo(".LPtagsContainer");
2768            });
2769        };
2770
2771    $tags.on("change", LPnewTags);
2772
2773    /* Social Share */
2774    var social = jQuery(".post-stat li ul.social-icons.post-socials");
2775    var socialOvrly = jQuery(".reviews.sbutton .md-overlay");
2776
2777    jQuery(".sbutton a.reviews-quantity").on("click", function (event) {
2778        event.preventDefault();
2779        social.fadeIn(400);
2780
2781        if (socialOvrly.hasClass("hide")) {
2782            jQuery(socialOvrly).removeClass("hide");
2783            jQuery(socialOvrly).addClass("show");
2784        } else {
2785            jQuery(socialOvrly).removeClass("show");
2786            jQuery(socialOvrly).addClass("hide");
2787        }
2788    });
2789
2790    socialOvrly.on("click", function (event) {
2791        event.preventDefault();
2792        social.fadeOut(400);
2793
2794        if (socialOvrly.hasClass("show")) {
2795            jQuery(socialOvrly).removeClass("show");
2796            jQuery(socialOvrly).addClass("hide");
2797        } else {
2798            jQuery(socialOvrly).removeClass("hide");
2799            jQuery(socialOvrly).addClass("show");
2800        }
2801    });
2802
2803    // Reserwa Popup
2804    jQuery("a.make-reservation").on("click", function (event) {
2805        event.preventDefault();
2806        jQuery(".ifram-reservation").fadeIn(400);
2807    });
2808    jQuery("a.close-btn").on("click", function (event) {
2809        event.preventDefault();
2810        jQuery(".ifram-reservation").fadeOut(400);
2811    });
2812
2813    //Menu Popup
2814    if (jQuery(window).width() > 767) {
2815        //Menu Popup
2816        jQuery(".widget-box a.open-modal, .menu-hotel a.open-modal").on(
2817            "click",
2818            function (event) {
2819                event.preventDefault();
2820                jQuery(".hotel-menu").fadeIn(400);
2821            }
2822        );
2823        jQuery("a.close-menu-popup").on("click", function (event) {
2824            event.preventDefault();
2825            jQuery(".hotel-menu").fadeOut(400);
2826        });
2827    } else if (jQuery(window).width() < 767) {
2828        //Menu Popup
2829        jQuery(".widget-box a.open-modal, .menu-hotel a.open-modal").on(
2830            "click",
2831            function (event) {
2832                event.preventDefault();
2833                jQuery(".hotel-menu").slideToggle(400);
2834            }
2835        );
2836
2837        jQuery(".listing-app-view .hotel-menu a.close-menu-popup").on(
2838            "click",
2839            function (event) {
2840                event.preventDefault();
2841                jQuery(".hotel-menu").slideToggle(400);
2842            }
2843        );
2844    }
2845
2846    // Resurva Booking Switcher
2847    jQuery("a.switch-fields").on("click", function (event) {
2848        event.preventDefault();
2849        jQuery(this).toggleClass("active");
2850        jQuery(".hidden-items").fadeToggle(400);
2851    });
2852
2853    // Dashboard Notices
2854    jQuery("a.dismiss").on("click", function (event) {
2855        event.preventDefault();
2856        jQuery(this).parent(".panel-dash-dismiss").slideUp(400);
2857    });
2858
2859    /* Pins Hover */
2860
2861    jQuery(document).on("mouseenter", ".lp-grid-box-contianer", function () {
2862        var cardID = jQuery(this).data("postid");
2863        var cardclass = ".lpmap-icon-shape.card" + cardID;
2864        if (jQuery(cardclass).hasClass("cardHighlight")) {
2865            jQuery(cardclass).removeClass("cardHighlight");
2866        } else {
2867            jQuery(cardclass).addClass("cardHighlight");
2868        }
2869    });
2870    jQuery(document).on("mouseleave", ".lp-grid-box-contianer", function () {
2871        var cardID = jQuery(this).data("postid");
2872        var cardclass = ".lpmap-icon-shape.card" + cardID;
2873        jQuery(cardclass).removeClass("cardHighlight");
2874    });
2875
2876    /* Select Category */
2877    jQuery(".postsubmitSelect").on("change", function () {
2878        jQuery(".feature-fields-error-container").remove();
2879        jQuery(".featuresDataRow").show();
2880        var cvalue = jQuery(this).val();
2881        jQuery(".featuresData").css({
2882            opacity: "0",
2883            visibility: "hidden",
2884            display: "none",
2885        });
2886        jQuery(".featuresDataContainer")
2887            .find(".featuresData" + cvalue)
2888            .css({
2889                opacity: "1",
2890                visibility: "visible",
2891                display: "block",
2892            });
2893    });
2894});
2895jQuery(document).on("change", ".btn-file :file", function () {
2896    var input = jQuery(this),
2897        numFiles = input.get(0).files ? input.get(0).files.length : 1,
2898        label = input.val().replace(/\\/g, "/").replace(/.*\//, "");
2899    input.trigger("fileselect", [numFiles, label]);
2900});
2901
2902jQuery(document).ready(function () {
2903    if (jQuery("form").is("#lp-submit-formdf")) {
2904        var validator = new FormValidator(
2905            "lp-submit-form",
2906            [{
2907                name: "postTitle",
2908                display: "Title",
2909                rules: "required",
2910            },
2911            {
2912                name: "category",
2913                display: "Category",
2914                rules: "required",
2915            },
2916            {
2917                name: "postContent",
2918                display: "Description",
2919                rules: "required",
2920            },
2921            {
2922                name: "location",
2923                display: "Location",
2924                rules: "required",
2925            },
2926            {
2927                name: "gAddress",
2928                display: "Google Address",
2929                rules: "required",
2930            },
2931            {
2932                name: "email",
2933                rules: "valid_email",
2934            },
2935            {
2936                name: "username",
2937                display: "UserName",
2938                rules: "required",
2939            },
2940            {
2941                name: "policycheck",
2942                display: "Terms and Conditions Check",
2943                rules: "required",
2944            },
2945            ],
2946            function (errors, evt) {
2947                var SELECTOR_ERRORS = jQuery(".error_box"),
2948                    SELECTOR_SUCCESS = jQuery(".success_box");
2949
2950                if (errors.length > 0) {
2951                    SELECTOR_ERRORS.empty();
2952
2953                    for (var i = 0, errorLength = errors.length; i < errorLength; i++) {
2954                        SELECTOR_ERRORS.append(errors[i].message + "<br />");
2955                    }
2956
2957                    SELECTOR_SUCCESS.css({
2958                        display: "none",
2959                    });
2960                    SELECTOR_ERRORS.fadeIn(200);
2961                } else {
2962                    SELECTOR_ERRORS.css({
2963                        display: "none",
2964                    });
2965                    SELECTOR_SUCCESS.fadeIn(200);
2966                }
2967            }
2968        );
2969    }
2970});
2971var image_custom_uploader;
2972var $thisItem = "";
2973
2974jQuery(document).on("click", ".upload-author-image", function (e) {
2975    e.preventDefault();
2976
2977    $thisItem = jQuery(this);
2978    $form = jQuery("#profileupdate");
2979
2980    //If the uploader object has already been created, reopen the dialog
2981    if (image_custom_uploader) {
2982        image_custom_uploader.open();
2983        return;
2984    }
2985
2986    //Extend the wp.media object
2987    image_custom_uploader = wp.media.frames.file_frame = wp.media({
2988        title: "Choose Image",
2989        button: {
2990            text: "Choose Image",
2991        },
2992        library: {
2993            type: "image", // Restrict to images only
2994        },
2995        multiple: false,
2996    });
2997
2998    image_custom_uploader.on("open", function () {
2999        var filterable = image_custom_uploader.state().get("library");
3000        filterable.props.set("type", "image");
3001    });
3002
3003    //When a file is selected, grab the URL and set it as the text field's value
3004    image_custom_uploader.on("select", function () {
3005        attachment = image_custom_uploader
3006            .state()
3007            .get("selection")
3008            .first()
3009            .toJSON();
3010        var url = "";
3011        url = attachment["url"];
3012        var attachId = "";
3013        attachId = attachment["id"];
3014
3015        jQuery("img.author-avatar").attr({
3016            src: url,
3017        });
3018        $form.parent().parent().find(".criteria-image-url").attr({
3019            value: url,
3020        });
3021        $form.parent().parent().find(".criteria-image-id").attr({
3022            value: attachId,
3023        });
3024    });
3025
3026    //Open the uploader dialog
3027    image_custom_uploader.open();
3028});
3029
3030/* update by zaheer on 25 feb  */
3031jQuery(document).ready(function ($) {
3032    jQuery("#listings_checkout input[name=listing_id]").on("change", function () {
3033        jQuery("#listings_checkout input[name=post_id]").val(
3034            jQuery(this, "#listings_checkout").val()
3035        );
3036    });
3037    jQuery("#listings_checkout input[name=plan]").on("change", function () {
3038        jQuery("#listings_checkout input[name=method]").val(
3039            jQuery(this, "#listings_checkout").val()
3040        );
3041    });
3042
3043    jQuery(".lp-promotebtn").on("click", function () {
3044        var $this = jQuery(this);
3045        jQuery("#ads_promotion input[name=listing_id]").val(
3046            $this.data("listingnid")
3047        );
3048        var listtitle = $this.data("listingtitle");
3049        jQuery("input[name=cur_listing_title]").val(listtitle);
3050    });
3051    jQuery("#ads_promotion input[name=plan]").on("change", function () {
3052        jQuery("#ads_promotion input[name=method]").val(
3053            jQuery(this, "#listings_checkout").val()
3054        );
3055    });
3056});
3057/* by zaheer on 25 feb */
3058jQuery(".availableprice_options input").change(function ($) {
3059    var $total,
3060        taxrate = "",
3061        taxprice,
3062        taxTotal;
3063    if (jQuery("span").hasClass("pricetax")) {
3064        taxrate = jQuery("span.pricetax").data("taxprice");
3065    }
3066    $oldtotal = jQuery("#totalprice").val();
3067    oldTax = jQuery('input[name="taxprice"]').val();
3068    if (jQuery(this).is(":checked")) {
3069        var $val = jQuery(this).val();
3070        $total = parseFloat($val) + parseFloat($oldtotal);
3071        taxprice = parseFloat((taxrate / 100) * $val);
3072        taxTotal = parseFloat(oldTax) + parseFloat(taxprice);
3073        $total = $total + taxprice;
3074        $total = $total.toFixed(2);
3075        taxTotal = taxTotal.toFixed(2);
3076        jQuery("#totalprice").val($total);
3077        jQuery(".pricetotal #price").html($total);
3078        jQuery('input[name="lp_total_price"]').val($total);
3079        jQuery('input[name="taxprice"]').val(taxTotal);
3080    } else {
3081        var $val = jQuery(this).val();
3082        $total = parseFloat($oldtotal) - parseFloat($val);
3083        taxprice = parseFloat((taxrate / 100) * $val);
3084        taxTotal = parseFloat(oldTax) - parseFloat(taxprice);
3085        $total = $total - taxprice;
3086        $total = $total.toFixed(2);
3087        taxTotal = taxTotal.toFixed(2);
3088        if ($total > 0) {
3089            jQuery("#totalprice").val($total);
3090            jQuery(".pricetotal #price").html($total);
3091            jQuery('input[name="lp_total_price"]').val($total);
3092            jQuery('input[name="taxprice"]').val(taxTotal);
3093        } else {
3094            $total = 0.0;
3095            jQuery("#totalprice").val($total);
3096            jQuery(".pricetotal #price").html($total);
3097            jQuery('input[name="lp_total_price"]').val($total);
3098            jQuery('input[name="taxprice"]').val(taxTotal);
3099        }
3100    }
3101});
3102
3103/* update by zaheer on 25 feb  */
3104jQuery(".lp-front").on("click", ".lp-frontBtn", function (e) {
3105    e.preventDefault();
3106    //jQuery('.lp-front').hide(200);
3107    jQuery(".lp-front").slideUp(500);
3108    jQuery(".lp-back1").slideDown(1000);
3109    //jQuery('.lp-back').show(500);
3110});
3111jQuery(".lp-back1").on("click", "#lp-back1", function (e) {
3112    e.preventDefault();
3113    jQuery(".lp-back1").slideUp(500);
3114    jQuery(".lp-front").slideDown(1000);
3115});
3116jQuery(".lp-back1").on("click", "#lp-next", function (e) {
3117    e.preventDefault();
3118    jQuery(".lp-back1").slideUp(500);
3119    jQuery(".lp-back2").slideDown(1000);
3120});
3121jQuery(".lp-back2").on("click", "#lp-back2", function (e) {
3122    e.preventDefault();
3123    jQuery(".lp-back2").slideUp(500);
3124    jQuery(".lp-back1").slideDown(1000);
3125});
3126/* end update by zaheer on 25 feb  */
3127
3128//dynamic model for invoices by zaheer
3129jQuery(document).ready(function ($) {
3130    jQuery(".invoice-section a.showme").click(function (ev) {
3131        var $this = jQuery(this);
3132        $this.after('<i class="lp-modal-spinn fa-li fa fa-spinner fa-spin"></i>');
3133        ev.preventDefault();
3134        var rowid = jQuery(this).data("id");
3135        reqlink = jQuery(this).data("url");
3136        var invoiceFor = "";
3137        invoiceFor = jQuery(this).data("lpinvoice");
3138        //invoiceFor = 'dddf';
3139
3140        jQuery.get(
3141            reqlink + "?lp_p_id=" + rowid + "&lp_invoice=" + invoiceFor,
3142            function (html) {
3143                jQuery("#modal-invoice .modal-body").html("");
3144                jQuery("#modal-invoice .modal-body").html(html);
3145                jQuery("#modal-invoice").modal("show", {
3146                    backdrop: "static",
3147                });
3148                $this.next(".lp-modal-spinn").hide("");
3149                $this.next(".lp-modal-spinn").remove("");
3150            }
3151        );
3152    });
3153});
3154
3155/* print preview */
3156jQuery(function ($) {
3157    "use strict";
3158    jQuery("#modal-invoice")
3159        .find(".lp-print-list")
3160        .on("click", function () {
3161            //jQuery.print("#modal-invoice");
3162            /* jQuery("#modal-invoice").print({
3163                     noPrintSelector : ".modal-footer",
3164                     }); */
3165
3166            var divToPrint = document.getElementById("modal-invoice");
3167
3168            var newWin = window.open("", "Print-Window");
3169
3170            newWin.document.open();
3171
3172            newWin.document.write(
3173                '<html><body onload="window.print()">' +
3174                divToPrint.innerHTML +
3175                "</body></html>"
3176            );
3177
3178            newWin.document.close();
3179
3180            setTimeout(function () {
3181                newWin.close();
3182            }, 10);
3183        });
3184});
3185
3186jQuery(document).ready(function ($) {
3187    jQuery(".googleAddressbtn").on("click", function (e) {
3188        var dtype = jQuery(this).data("type");
3189        if (dtype == "gaddress") {
3190            if (jQuery(this).hasClass("events-dash")) {
3191                jQuery(".events-map-wrap #inputAddresss").slideUp(300);
3192                jQuery(".lp-custom-lat").slideUp(300);
3193                jQuery(".events-map-wrap #inputAddress").slideDown();
3194                jQuery(".events-map-wrap .googlefulladdress").slideDown(300);
3195                jQuery(".events-map-wrap #latitude").attr("type", "hidden");
3196                jQuery(".events-map-wrap #longitude").attr("type", "hidden");
3197                jQuery(this).next(".googleAddressbtn").removeClass("active");
3198                jQuery(this).addClass("active");
3199            } else {
3200                jQuery(".post-submit #inputAddresss").slideUp(300);
3201                jQuery(".lp-custom-lat").slideUp(300);
3202                jQuery(".post-submit #inputAddress").slideDown();
3203                jQuery(".post-submit .googlefulladdress").slideDown(300);
3204                jQuery(".post-submit #latitude").attr("type", "hidden");
3205                jQuery(".post-submit #longitude").attr("type", "hidden");
3206                jQuery(this).next(".googleAddressbtn").removeClass("active");
3207                jQuery(this).addClass("active");
3208            }
3209        } else {
3210            if (jQuery(this).hasClass("events-dash")) {
3211                jQuery(".events-map-wrap #inputAddress").slideUp();
3212                jQuery(".events-map-wrap .googlefulladdress").slideUp(300);
3213                jQuery(".events-map-wrap #inputAddresss").slideDown(300);
3214                jQuery(".lp-custom-lat").slideDown(300);
3215                jQuery(".events-map-wrap #latitude").attr("type", "text");
3216                jQuery(".events-map-wrap #longitude").attr("type", "text");
3217                jQuery(this).prev(".googleAddressbtn").removeClass("active");
3218                jQuery(this).addClass("active");
3219            } else {
3220                jQuery(".post-submit #inputAddress").slideUp();
3221                jQuery(".post-submit .googlefulladdress").slideUp(300);
3222                jQuery(".post-submit #inputAddresss").slideDown(300);
3223                jQuery(".lp-custom-lat").slideDown(300);
3224                jQuery(".post-submit #latitude").attr("type", "text");
3225                jQuery(".post-submit #longitude").attr("type", "text");
3226                jQuery(this).prev(".googleAddressbtn").removeClass("active");
3227                jQuery(this).addClass("active");
3228            }
3229        }
3230        e.preventDefault();
3231    });
3232});
3233
3234/* ======27 may mm=========== */
3235jQuery(document).ready(function ($) {
3236    jQuery("#slide-nav.navbar-inverse").after(
3237        jQuery('<div class="inverse" id="navbar-height-col"></div>')
3238    );
3239    jQuery("#slide-nav.navbar-default").after(
3240        jQuery('<div id="navbar-height-col"></div>')
3241    );
3242    var toggler = ".navbar-toggle";
3243    var pagewrapper = "#page-content";
3244    var navigationwrapper = ".navbar-header";
3245    var menuwidth = "100%";
3246    var slidewidth = "80%";
3247    var menuneg = "-100%";
3248    var slideneg = "-80%";
3249    jQuery("#slide-nav").on("click", toggler, function (e) {
3250        var selected = $(this).hasClass("slide-active");
3251        jQuery("#slidemenu")
3252            .stop()
3253            .animate({
3254                left: selected ? menuneg : "0px",
3255            });
3256        jQuery("#navbar-height-col")
3257            .stop()
3258            .animate({
3259                left: selected ? slideneg : "0px",
3260            });
3261        jQuery(pagewrapper)
3262            .stop()
3263            .animate({
3264                left: selected ? "0px" : slidewidth,
3265            });
3266        jQuery(navigationwrapper)
3267            .stop()
3268            .animate({
3269                left: selected ? "0px" : slidewidth,
3270            });
3271        jQuery(this).toggleClass("slide-active", !selected);
3272        jQuery("#slidemenu").toggleClass("slide-active");
3273        jQuery("#page-content, .navbar, body, .navbar-header").toggleClass(
3274            "slide-active"
3275        );
3276    });
3277    var selected = "#slidemenu, #page-content, body, .navbar, .navbar-header";
3278    jQuery(window).on("resize", function () {
3279        if (jQuery(window).width() > 767 && $(".navbar-toggle").is(":hidden")) {
3280            jQuery(selected).removeClass("slide-active");
3281        }
3282    });
3283
3284    jQuery(".lp_price_trigger_checkout input").on("click", function ($) {
3285        var taxEnable = jQuery(this).data("taxenable");
3286        plantitle = jQuery(this).data("title");
3287        planprice = jQuery(this).data("planprice");
3288        taxprice = "";
3289        totalprice = "";
3290        if (taxEnable == "1") {
3291            taxrate = jQuery(".lp_price_trigger_checkout input").data("taxrate");
3292            taxprice = (taxrate / 100) * planprice;
3293            taxprice = taxprice.toFixed(2);
3294            jQuery('input[name="listings_tax_price"]').attr("value", taxprice);
3295            totalprice = parseFloat(planprice) + parseFloat(taxprice);
3296            totalprice = totalprice.toFixed(2);
3297            jQuery("span#lp_price_plan").text(plantitle);
3298            jQuery("span#lp_price_plan_price").text(planprice);
3299            jQuery("span#lp_tax_price").text(taxprice);
3300            jQuery("span#lp_price_subtotal").text(totalprice);
3301            jQuery("input#lp_paypal_price").val(totalprice);
3302            jQuery(".lp_section_inner .lp_billing_total").show(400);
3303        } else {
3304            totalprice = parseFloat(planprice);
3305            jQuery("span#lp_price_plan").text(plantitle);
3306            jQuery("span#lp_price_plan_price").text(planprice);
3307            jQuery("span#lp_price_subtotal").text(totalprice);
3308            jQuery("input#lp_paypal_price").val(totalprice);
3309        }
3310    });
3311
3312    if (jQuery("form#register .check_policy").is(".termpolicy")) {
3313        jQuery("input#lp_usr_reg_btn").prop("disabled", true);
3314        jQuery(".check_policy").on("click", function () {
3315            if (jQuery("#check_policy").is(":checked")) {
3316                jQuery("input#lp_usr_reg_btn").prop("disabled", false);
3317            } else {
3318                jQuery("input#lp_usr_reg_btn").prop("disabled", true);
3319            }
3320        });
3321    }
3322
3323    if (jQuery(".blue-section .check_policy").is(".termpolicy")) {
3324        jQuery("#listingsubmitBTN").prop("disabled", true);
3325        jQuery("#listingsubmitBTN").addClass("dissablebutton");
3326        jQuery(".check_policy").on("click", function () {
3327            if (jQuery("#policycheck").is(":checked")) {
3328                jQuery("#listingsubmitBTN").prop("disabled", false);
3329                jQuery("#listingsubmitBTN").removeClass("dissablebutton");
3330            } else {
3331                jQuery("#listingsubmitBTN").prop("disabled", true);
3332                jQuery("#listingsubmitBTN").addClass("dissablebutton");
3333            }
3334        });
3335    }
3336    if (jQuery(".white-section .check_policy").is(".termpolicy")) {
3337        jQuery("#listingsubmitBTN").prop("disabled", true);
3338        jQuery("#listingsubmitBTN").addClass("dissablebutton");
3339        jQuery(".check_policy").on("click", function () {
3340            if (jQuery("#policycheck").is(":checked")) {
3341                jQuery("#listingsubmitBTN").prop("disabled", false);
3342                jQuery("#listingsubmitBTN").removeClass("dissablebutton");
3343            } else {
3344                jQuery("#listingsubmitBTN").prop("disabled", true);
3345                jQuery("#listingsubmitBTN").addClass("dissablebutton");
3346            }
3347        });
3348    }
3349});
3350
3351jQuery(window).ready(function () {
3352    if (jQuery(".header-container").hasClass(".lp-vedio-bg")) {
3353        jQuery("#lp_vedio").play();
3354    }
3355    if (jQuery("input").is(".rating-tooltip")) {
3356        jQuery(".rating-tooltip").rating({
3357            extendSymbol: function (rate) {
3358                jQuery(this).tooltip({
3359                    container: "body",
3360                    placement: "bottom",
3361                    title: "Rate " + rate,
3362                });
3363            },
3364        });
3365    }
3366});
3367
3368jQuery(document).ready(function ($) {
3369    if (jQuery(".lp-home-banner-contianer").is(".lp-home-banner-with-loc")) {
3370        var locType = jQuery(".lp_auto_loc_container h1,p.lp-app-view2-des").data(
3371            "locnmethod"
3372        );
3373
3374        var currentlocationswitch = "1";
3375        var currentlocationswitch = jQuery("#page").data("lpcurrentloconhome");
3376        if (currentlocationswitch == "0") {
3377            locType = "locationifoff";
3378        }
3379
3380        var apiType = jQuery("#page").data("ipapi");
3381
3382        if (locType == "withip") {
3383            if (apiType === "ip_api") {
3384                jQuery.get(
3385                    "https://ipapi.co/json",
3386                    function (location) {
3387                        var locc = location.city;
3388                        if (locc == null) { } else {
3389                            jQuery(".lp-dyn-city").text(location.city);
3390                        }
3391                    },
3392                    "json"
3393                );
3394            } else {
3395                lpGetGpsLocName(function (lpgetcurrentcityvalue) {
3396                    lpgpsclocation = lpgetcurrentcityvalue;
3397                    jQuery(".lp-dyn-city").text(lpgpsclocation);
3398                });
3399            }
3400        }
3401    }
3402
3403    if (jQuery(".lp-header-search-tagline").length != 0) {
3404        var locType = jQuery(
3405            ".lp_auto_loc_container .lp-header-search-tagline"
3406        ).data("locnmethod");
3407        var currentlocationswitch = "1";
3408        var currentlocationswitch = jQuery("#page").data("lpcurrentloconhome");
3409        if (currentlocationswitch == "0") {
3410            locType = "locationifoff";
3411        }
3412
3413        var apiType = jQuery("#page").data("ipapi");
3414
3415        if (locType == "withip") {
3416            if (apiType === "ip_api") {
3417                jQuery.get(
3418                    "https://ipapi.co/json",
3419                    function (location) {
3420                        var locc = location.city;
3421                        if (locc == null) { } else {
3422                            jQuery(".lp-dyn-city").text(location.city);
3423                        }
3424                    },
3425                    "json"
3426                );
3427            } else {
3428                lpGetGpsLocName(function (lpgetcurrentcityvalue) {
3429                    lpgpsclocation = lpgetcurrentcityvalue;
3430                    jQuery(".lp-dyn-city").text(lpgpsclocation);
3431                });
3432            }
3433        }
3434    }
3435
3436    // lp-header-search-tagline
3437});
3438
3439function hexToRGB(hexStr) {
3440    var col = {};
3441    col.r = parseInt(hexStr.substr(1, 2), 16);
3442    col.g = parseInt(hexStr.substr(3, 2), 16);
3443    col.b = parseInt(hexStr.substr(5, 2), 16);
3444    return col;
3445}
3446
3447/* for recurring stripe */
3448jQuery(document).ready(function () {
3449    var plantype = "";
3450    var recurringtext = "";
3451    var recurringhtml = "";
3452    var $thislisting = "";
3453    var $thisplan = "";
3454    var $recurringon = "";
3455    $recurringon = jQuery("form#listings_checkout").data("recurring");
3456    if ($recurringon === "yes") {
3457        jQuery("#listings_checkout input[type=radio]").on("change", function ($) {
3458            if (
3459                jQuery("#listings_checkout input[name=listing_id]").is(":checked") &&
3460                jQuery("#listings_checkout input[name=plan]").is(":checked")
3461            ) {
3462                $thislisting = jQuery(
3463                    "#listings_checkout input[name=listing_id]:checked"
3464                );
3465                $thisplan = jQuery("#listings_checkout input[name=plan]:checked").val();
3466                plantype = $thislisting.closest(".lp-user-listings").data("plantype");
3467                if (plantype === "Pay Per Listing") {
3468                    recurringtext = $thislisting
3469                        .closest(".lp-user-listings")
3470                        .data("recurringtext");
3471                    recurringhtml =
3472                        '<div class="checkbox"><input type="checkbox" id="listing-recurring-recurrsive" name="lp-recurring-option" value="yes"><label for="listing-recurring-recurrsive">' +
3473                        recurringtext +
3474                        "</label></div>";
3475                    if ($thisplan === "stripe") {
3476                        jQuery("div.lp-recurring-button-wrap").html(recurringhtml);
3477                    } else {
3478                        jQuery("div.lp-recurring-button-wrap").html("");
3479                    }
3480                } else {
3481                    jQuery("div.lp-recurring-button-wrap").html("");
3482                }
3483            } else {
3484                jQuery("div.lp-recurring-button-wrap").html("");
3485            }
3486        });
3487    }
3488
3489    /* for dynamic location */
3490    if (jQuery("input#cities").length) {
3491        jQuery("input#cities").cityAutocomplete();
3492    }
3493    if (jQuery("input#citiess").length) {
3494        jQuery("input#citiess").cityAutocomplete();
3495    }
3496
3497    if (jQuery("input#cities").length) {
3498        jQuery(document).on("click", "#cities", function (e) {
3499            jQuery("input#cities").cityAutocomplete();
3500        });
3501    }
3502    if (jQuery("input#citiess").length) {
3503        jQuery(document).on("click", "#citiess", function (e) {
3504            jQuery("input#citiess").cityAutocomplete();
3505        });
3506    }
3507
3508    jQuery(document).on("click", "#citiess", function (e) {
3509        var target = e.target;
3510        if (!jQuery(target).is(".help")) {
3511            if (jQuery("input#citiess").length) {
3512                var isseleted = jQuery("input#citiess").data("isseleted");
3513                if (isseleted == false) {
3514                    jQuery("input#citiess").val("");
3515                }
3516            }
3517        }
3518    });
3519
3520    if (jQuery("input#citiess").length) {
3521        jQuery("#citiess").on("input", function () {
3522            jQuery(this).data("isseleted", false);
3523        });
3524    }
3525});
3526/* for recurring stripe */
3527jQuery(document).ready(function ($) {
3528    jQuery("#select-plan-form .select-plan-form input[name=plans-posts]").on(
3529        "click",
3530        function () {
3531            jQuery("a.lp_change_plan_action").hide("");
3532            jQuery("div.lp-action-div form").hide("");
3533        }
3534    );
3535});
3536
3537/* for range slider */
3538var nearmeunit = jQuery("#lp-find-near-me").data("nearmeunit");
3539if (jQuery("#distance_range").length != 0) {
3540    jQuery("#distance_range").bootstrapSlider({
3541        formatter: function (value) {
3542            return value + " " + nearmeunit;
3543        },
3544        tooltip: "always",
3545    });
3546}
3547
3548/* for show click on div radius */
3549jQuery("li.lp-tooltip-outer").on("click", function () {
3550    var $this = jQuery(this);
3551    jQuery(".lp-tooltip-div").removeClass("active");
3552    $this.find(".lp-tooltip-div").addClass("active");
3553});
3554
3555/* for hide div on outer click to divs */
3556jQuery(document).mouseup(function (e) {
3557    var container = jQuery(".lp-tooltip-div");
3558    // if the target of the click isn't the container nor a descendant of the container
3559    if (!container.is(e.target) && container.has(e.target).length === 0) {
3560        jQuery(".lp-tooltip-div").removeClass("active");
3561    }
3562
3563    var containerr = jQuery(".lp-tooltip-div-hidden");
3564    if (!containerr.is(e.target) && containerr.has(e.target).length === 0) {
3565        jQuery(".lp-tooltip-div-hidden").removeClass("active");
3566    }
3567
3568    var foodmenucontainer = jQuery(".hotel-menu .inner-menu");
3569    if (
3570        !foodmenucontainer.is(e.target) &&
3571        foodmenucontainer.has(e.target).length === 0
3572    ) {
3573        jQuery(".hotel-menu").fadeOut();
3574    }
3575});
3576
3577jQuery("li.lp-tooltip-outer").hover(function () {
3578    var $this = jQuery(this);
3579    jQuery(".lp-tooltip-div").removeClass("active");
3580    jQuery(".lp-tooltip-div-hidden").removeClass("active");
3581    $this.find(".lp-tooltip-div").addClass("active");
3582    if ($this.find("a.near-me-btn, a.near-me-btn-style-3").hasClass("active")) {
3583        jQuery(".lp-tooltip-div-hidden").addClass("active");
3584    }
3585});
3586
3587/* for first tab auto active on listing detail page style 2 */
3588jQuery(document).ready(function ($) {
3589    jQuery(".lp-detail-page-template-3 #reply-title2 ul li")
3590        .first()
3591        .addClass("active");
3592    jQuery(".lp-detail-page-template-3 .detail-page2-tab-content .tab-pane")
3593        .first()
3594        .addClass("active");
3595
3596    /* app view search dumm loader */
3597    jQuery(document).on(
3598        "click",
3599        ".listing-app-view .app-view-filters .close",
3600        function () {
3601            var docHeight = jQuery(document).height();
3602            jQuery("body").prepend('<div id="full-overlay"></div>');
3603            jQuery("#full-overlay").css("height", docHeight + "px");
3604            jQuery("#full-overlay").addClass("content-loading");
3605            var timer = "";
3606
3607            function lpcloseloadnow() {
3608                jQuery("#full-overlay").remove();
3609                jQuery("#full-overlay").removeClass("content-loading");
3610                clearTimeout(timer);
3611            }
3612
3613            timer = setTimeout(lpcloseloadnow, 2000);
3614            if (jQuery("div.promoted-listings div.app-view-new-ads-sli
3614der").length) {
3615                jQuery("div.app-view-new-ads-slider").slick({
3616                    arrows: false,
3617                });
3618            }
3619            if (jQuery("div.promoted-listings div.app-view-new-ads-slider").length) {
3620                jQuery("div.app-view-new-ads-slider").slick({
3621                    arrows: false,
3622                });
3623            }
3624        }
3625    );
3626
3627    /* multiselect for google location  */
3628    jQuery(document).on("click", ".city-autocomplete .help", function () {
3629        var $thisSelected = jQuery(this).text();
3630        var $thisSelecteds = $thisSelected.split(",");
3631        if (
3632            $thisSelecteds[1] == "undefined" ||
3633            $thisSelecteds[1] == "" ||
3634            $thisSelecteds[1] == null
3635        ) {
3636            $thisSelected = $thisSelecteds[0];
3637        } else {
3638            $thisSelected = $thisSelecteds[0] + "," + $thisSelecteds[1];
3639        }
3640        var $selectLocationData =
3641            '<div class="lpsinglelocselected ' +
3642            $thisSelected +
3643            '">' +
3644            $thisSelected +
3645            '<i class="fa fa-times lp-removethisloc"></i><input type="hidden" name="location[]" value="' +
3646            $thisSelected +
3647            '"></div>';
3648        jQuery($selectLocationData).appendTo(".lp-selected-locs");
3649
3650        if (jQuery("div").hasClass("lp-selected-locs")) {
3651            jQuery("input#citiess").val("");
3652        }
3653    });
3654
3655    jQuery(document).on("click", ".lp-removethisloc", function () {
3656        jQuery(this).closest(".lpsinglelocselected").remove();
3657    });
3658
3659    jQuery(".top-search-form .lp-search-btn-header .lp-search-btn").on(
3660        "click",
3661        function () {
3662            var locvals = $.trim($("input#cities").val());
3663            if (locvals.length > 0) { } else {
3664                jQuery('input[name="lp_s_loc"]').val("");
3665            }
3666        }
3667    );
3668
3669    /* when google location and user don't select the suggestions and hit enters */
3670    jQuery("input#cities").on("change", function () {
3671        jQuery("input[name=lp_s_loc]").val(jQuery(this).val());
3672    });
3673
3674    jQuery(document).on("click", ".city-autocomplete .help", function () {
3675        //New update 2.7.0
3676        substrr = $(this).text();
3677        substrr = substrr.split(",");
3678        if (substrr[1] == "undefined" || substrr[1] == "" || substrr[1] == null) {
3679            substrr = substrr[0];
3680        } else {
3681            substrr = substrr[0] + "," + substrr[1];
3682        }
3683        //End New update 2.7.0
3684        jQuery("input[name=lp_s_loc]").val(substrr);
3685    });
3686
3687    /* overlay close on cross click */
3688    jQuery(".md-close.widget-map-click").on("click", function (e) {
3689        jQuery("#full-overlay").css("height", "0px");
3690    });
3691});
3692
3693function lpshowsidemap() {
3694    if (jQuery("#map").is(".mapSidebar")) {
3695        if (jQuery(".v2-map-load").length == 1) {
3696            jQuery("<div class='v2mapwrap'></div>").appendTo(jQuery(".v2-map-load"));
3697            jQuery(".v2-map-load .v2mapwrap").trigger("click");
3698        }
3699        jQuery("<div class='sidemarpInside'></div>").appendTo(
3700            jQuery(".sidemap-fixed")
3701        );
3702        jQuery(".sidemap-fixed .sidemarpInside").trigger("click");
3703    }
3704}
3705
3706if (window.attachEvent) {
3707    window.attachEvent("onload", lpshowsidemap);
3708} else if (window.addEventListener) {
3709    window.addEventListener("load", lpshowsidemap, false);
3710} else {
3711    document.addEventListener("load", lpshowsidemap, false);
3712}
3713
3714/* for 1.2.7 */
3715jQuery(document).ready(function ($) {
3716    if (jQuery("form#registertmp .check_policyy").is(".termpolicy")) {
3717        jQuery("input#lp-template-registerbtn").prop("disabled", true);
3718        jQuery(".check_policyy").on("click", function () {
3719            if (jQuery("#check_policyy").is(":checked")) {
3720                jQuery("input#lp-template-registerbtn").prop("disabled", false);
3721            } else {
3722                jQuery("input#lp-template-registerbtn").prop("disabled", true);
3723            }
3724        });
3725    }
3726
3727    jQuery(".lp-qoute-butn a#freeQuoteForm").click(function (e) {
3728        e.preventDefault();
3729        jQuery("html, body").animate({
3730            scrollTop: jQuery("#freeQuoteFormWrap").offset().top,
3731        },
3732            1000
3733        );
3734    });
3735    jQuery(".contact-right #contactMSGForm").submit(function (e) {
3736        var uname = jQuery(this).find("input[name=uname]").val();
3737        var uemail = jQuery(this).find("input[name=uemail]").val();
3738        var umessage = jQuery(this).find("textarea[name=umessage]").val();
3739
3740        if (uname == "" || uname == null) {
3741            jQuery(this).find("input[name=uname]").addClass("lp-required-field");
3742            e.preventDefault();
3743        }
3744
3745        if (uemail == "" || uemail == null) {
3746            jQuery(this).find("input[name=uemail]").addClass("lp-required-field");
3747            e.preventDefault();
3748        }
3749
3750        if (lpisValidEmailAddress(uemail)) { } else {
3751            jQuery(this).find("input[name=uemail]").addClass("lp-required-field");
3752            e.preventDefault();
3753        }
3754
3755        if (umessage == "" || umessage == null) {
3756            jQuery(this)
3757                .find("textarea[name=umessage]")
3758                .addClass("lp-required-field");
3759            e.preventDefault();
3760        }
3761    });
3762
3763    jQuery("input#lp-featuredimage").change(function () {
3764        lp_change_curerntImgUrl(this);
3765    });
3766
3767    /* end preview image*/
3768
3769    jQuery(
3770        ".app-view-header .lp-search-toggle .user-menu i, .app-view-popup-style, .event-by-going-wrap .app-view-popup-style"
3771    ).click(function () {
3772        jQuery("#app-view-login-popup").fadeIn(function () {
3773            jQuery("#app-view-login-popup").css({
3774                top: "20%",
3775                transform: "translateY(0%)",
3776                //'opacity': 1,
3777                overflow: "visible",
3778            });
3779        });
3780    });
3781    jQuery(".style2-popup-login .md-close").click(function (e) {
3782        jQuery("#app-view-login-popup").fadeOut(function () {
3783            jQuery("#app-view-login-popup").css({
3784                //'opacity': 1,
3785                display: "none",
3786            });
3787        });
3788    });
3789});
3790
3791/* preview image on listing edit change url of current image */
3792
3793function lp_change_curerntImgUrl(input) {
3794    if (input.files && input.files[0]) {
3795        jQuery(".submit_new_style-outer .lp-listing-featuredimage label").css({
3796            "max-width": "189px",
3797        });
3798        var reader = new FileReader();
3799
3800        reader.onload = function (e) {
3801            jQuery(".lpchangeinstantimg").attr("src", e.target.result);
3802            jQuery(".lpchangeinstantimg").css({
3803                width: "63px",
3804                height: "63px",
3805            });
3806        };
3807
3808        reader.readAsDataURL(input.files[0]);
3809    }
3810}
3811
3812jQuery(window).scroll(function () {
3813    //if you hard code, then use console
3814    //.log to determine when you want the
3815    //nav bar to stick.
3816
3817    if (jQuery(window).scrollTop() > 790) {
3818        jQuery(".profile-sticky-bar").addClass("navbar-fixed");
3819        jQuery(".profile-sticky-bar").fadeIn(500);
3820    }
3821    if (jQuery(window).scrollTop() < 790) {
3822        jQuery(".profile-sticky-bar").removeClass("navbar-fixed");
3823        jQuery(".profile-sticky-bar").fadeOut(500);
3824    }
3825});
3826jQuery(document).on("click", ".stickynavbar ul li a", function (e) {
3827    e.preventDefault();
3828    var targetID = jQuery(this).attr("href");
3829    jQuery("html,body").animate({
3830        scrollTop: jQuery(targetID).offset().top - 125,
3831    },
3832        500
3833    );
3834});
3835
3836/* for email address */
3837function lpisValidEmailAddress(emailAddress) {
3838    var pattern = new RegExp(
3839        /^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i
3840    );
3841    return pattern.test(emailAddress);
3842}
3843
3844/* for 1.2.15 */
3845jQuery(document).ready(function () {
3846    jQuery("#lp_delete_accountpopup input.lp_assign_data").on(
3847        "click",
3848        function () {
3849            jQuery(".lp_delte_user_confirm").removeAttr("disabled");
3850        }
3851    );
3852
3853    jQuery(".lp_privacy_policy_Wrap input.lpprivacycheckboxopt").on(
3854        "click",
3855        function () {
3856            if (jQuery(this).closest("#claimform").hasClass("lp-form-planclaim-st")) {
3857                var claimuserlogin = false,
3858                    ppolicy = false;
3859                if (jQuery("body").hasClass("logged-in")) {
3860                    claimuserlogin = true;
3861                }
3862                if (jQuery("#claimform .lpprivacycheckboxopt").length > 0) {
3863                    ppolicy = true;
3864                }
3865                claimformvalidation(claimuserlogin, ppolicy);
3866            } else {
3867                if (jQuery(this).is(":checked")) {
3868                    jQuery(this)
3869                        .closest("form")
3870                        .find("input[type=submit]")
3871                        .removeAttr("disabled");
3872                } else {
3873                    jQuery(this)
3874                        .closest("form")
3875                        .find("input[type=submit]")
3876                        .attr("disabled", "disabled");
3877                }
3878            }
3879        }
3880    );
3881});
3882/* end for 1.2.15 */
3883
3884/* for version 2.0 */
3885
3886jQuery(document).ready(function () {
3887    /* for claim submit checkout form  */
3888    jQuery("#claim_payment_checkout").on("submit", function (e) {
3889        var $this = jQuery(this);
3890        claimerID = $this.find("input[name=claimerID]").val();
3891        claimPost = $this.find("input[name=claimPost]").val();
3892        claimPrice = $this.find("input[name=claimPrice]").val();
3893        currency = $this.find("input[name=currency]").val();
3894        claimPrice = parseFloat(claimPrice) * 100;
3895        claimPrice = parseFloat(claimPrice).toFixed();
3896        handler.open({
3897            name: "For Claim",
3898            description: "",
3899            zipCode: true,
3900            amount: claimPrice,
3901            currency: currency,
3902        });
3903        e.preventDefault();
3904    });
3905});
3906
3907/* FOR ADDITIONAL FILTER */
3908/*-------------------------------------------------------------------------------------------------*/
3909
3910// More Filter Tooltip
3911
3912jQuery(document).ready(function () {
3913    jQuery(".lp_add_more_filter a").on("mouseover", function () {
3914        jQuery(".lp_more_filter_tooltip_outer").css("visibility", "visible");
3915    });
3916
3917    jQuery(".lp_add_more_filter a").on("mouseout", function () {
3918        jQuery(".lp_more_filter_tooltip_outer").css("visibility", "hidden");
3919    });
3920});
3921
3922// More Filter Button click and over lay on map
3923
3924jQuery(document).ready(function () {
3925    jQuery(".lp_add_more_filter a").click(function (e) {
3926        e.preventDefault();
3927        e.stopPropagation();
3928
3929        jQuery(".outer_all_page_overflow").toggleClass("hide-filters");
3930        jQuery(".outer_all_page_overflow").css("display", "block");
3931        // Map over lay display block
3932        if (jQuery(".overlay_on_map_for_filter").is(":hidden")) {
3933            jQuery(".overlay_on_map_for_filter").css("display", "block");
3934        } else {
3935            jQuery(".overlay_on_map_for_filter").css("display", "none");
3936        }
3937    });
3938
3939    jQuery(".outer_all_page_overflow").click(function (e) {
3940        //e.stopPropagation();
3941    });
3942
3943    // Hide on click out side div
3944    jQuery("body").click(function () {
3945        //jQuery('.outer_all_page_overflow').hide();
3946        // Map over lay display none
3947        jQuery(".overlay_on_map_for_filter").css("display", "none");
3948    });
3949
3950    jQuery("#filter_cancel_all").on("click", function () {
3951        jQuery(".outer_all_page_overflow").slideUp();
3952        jQuery(".overlay_on_map_for_filter").css("display", "none");
3953        // Map overlay display none
3954    });
3955});
3956
3957jQuery(document).on("click", "#filter_cancel_all", function () {
3958    jQuery(".outer_all_page_overflow").slideUp();
3959    jQuery(".overlay_on_map_for_filter").css("display", "none");
3960    jQuery(".outer_all_page_overflow").hide(500);
3961    // Map overlay display none
3962});
3963
3964/* **************************For payment checkout script******************************* */
3965
3966jQuery(document).ready(function () {
3967    jQuery("#listings_checkout_form input[name=listing_id]").click(function () {
3968        if (
3969            jQuery("#listings_checkout_form input[name=listing_id]").is(":checked")
3970        ) {
3971            if (jQuery("#listings_checkout_form input[name=plan]").is(":checked")) {
3972                //both are checked
3973                jQuery(".lp_payment_step_next.firstStep").addClass("active");
3974                lp_make_checkout_step_active("firstStep");
3975                jQuery(".lp_payment_step_next.firstStep").prop("disabled", false);
3976            } else {
3977                jQuery(".lp-checkout-steps .firstStep").removeClass("current");
3978                jQuery(".lp_payment_step_next.firstStep").removeClass("active");
3979                jQuery(".lp_payment_step_next.firstStep").prop("disabled", true);
3980            }
3981        }
3982    });
3983
3984    jQuery("#listings_checkout_form input[name=plan]").click(function () {
3985        if (jQuery("#listings_checkout_form input[name=plan]").is(":checked")) {
3986            jQuery("input[name=method]").val(jQuery(this).val());
3987            if (
3988                jQuery("#listings_checkout_form input[name=listing_id]").is(":checked")
3989            ) {
3990                //both are checked
3991                jQuery(".lp_payment_step_next.firstStep").addClass("active");
3992                lp_make_checkout_step_active("firstStep");
3993                jQuery(".lp_payment_step_next.firstStep").prop("disabled", false);
3994            } else {
3995                jQuery(".lp-checkout-steps .firstStep").removeClass("current");
3996                jQuery(".lp_payment_step_next.firstStep").removeClass("active");
3997                jQuery(".lp_payment_step_next.firstStep").prop("disabled", true);
3998            }
3999        }
4000    });
4001
4002    // add class for change border and background color lisitng section.
4003    jQuery(".lp-user-listings .radio-danger").click(function () {
4004        $this = jQuery(this);
4005        jQuery(".lp-user-listings").removeClass("active-checkout-listing");
4006        $this.closest(".lp-user-listings").addClass("active-checkout-listing");
4007    });
4008
4009    /* first step */
4010    jQuery(document).on("click", "button.firstStep", function () {
4011        if (jQuery(".inactive-payment-mode").length) {
4012            jQuery(".inactive-payment-mode").hide();
4013        }
4014        jQuery("#listings_checkout_form input[name=listing_id]")
4015            .not(":checked")
4016            .closest(".lp-user-listings")
4017            .css("display", "none");
4018        jQuery("#listings_checkout_form input[name=plan]")
4019            .not(":checked")
4020            .closest(".lp-method-wrap")
4021            .css("display", "none");
4022        lp_show_mini_subtotal();
4023        //update values in hidden fields
4024        lp_reset_mincart_checkout_form_data();
4025        //display block selected lisiting details.
4026        lp_show_recurring_switch();
4027        // display terms and conditions
4028        jQuery(".lp-new-term-style").css("display", "block");
4029        jQuery("button.lp_payment_step_next.secondStep").css("display", "block");
4030        jQuery(this).addClass("secondStep");
4031        jQuery(this).removeClass("firstStep");
4032        if (jQuery(".terms-checkbox-container input[type=checkbox]").length) {
4033            jQuery(".lp_payment_step_next.secondStep").prop("disabled", true);
4034        } else {
4035            lp_make_checkout_step_active("secondStep");
4036        }
4037    });
4038
4039    /* checkbox of terms and conditions */
4040    jQuery(".terms-checkbox-container input[type=checkbox]").on(
4041        "click",
4042        function () {
4043            if (jQuery(this).is(":checked")) {
4044                jQuery(".lp_payment_step_next.secondStep").prop("disabled", false);
4045                lp_make_checkout_step_active("secondStep");
4046                var urloftermcond = jQuery(".lpcheckouttac").attr("href");
4047                //window.open(urloftermcond, '_blank');
4048            } else {
4049                jQuery(".lp_payment_step_next.secondStep").prop("disabled", true);
4050                lp_make_checkout_step_passive("secondStep");
4051            }
4052        }
4053    );
4054    /* second step */
4055    jQuery(document).on(
4056        "click",
4057        "button.lp_payment_step_next.secondStep",
4058        function () {
4059            jQuery(".lp-checkout-steps .firstStep").addClass("completed");
4060            jQuery("button.lp_payment_step_next.thirdStep").css("display", "block");
4061            jQuery(this).addClass("thirdStep");
4062            jQuery(this).removeClass("secondStep");
4063            $planprice = jQuery("input[name=plan_price]").val();
4064
4065            if (jQuery('input[name="lp-recurring-option"]').is(":checked")) {
4066                jQuery(this).prop("type", "submit");
4067            } else {
4068                if (parseFloat($planprice) == 0) {
4069                    /* price zero or 100% discount */
4070                    $listings_id = jQuery("input[name=listings_id]").val();
4071                    lp_make_this_listing_publish_withdiscount($listings_id);
4072                } else {
4073                    jQuery(this).prop("type", "submit");
4074                }
4075            }
4076        }
4077    );
4078
4079    /* third step */
4080    jQuery(document).on(
4081        "click",
4082        "button.lp_payment_step_next.thirdStep",
4083        function () {
4084            jQuery(".lp-checkout-steps .secondStep").addClass("completed");
4085        }
4086    );
4087
4088    // script on click to open print section print specific div
4089    jQuery("#print-section-receipt").click(function () {
4090        var printContents = document.getElementById("printarea").innerHTML;
4091        var originalContents = document.body.innerHTML;
4092        document.body.innerHTML = printContents;
4093        window.print();
4094        document.body.innerHTML = originalContents;
4095        location.reload();
4096    });
4097
4098    /* script for coupon switch on checkout page*/
4099    jQuery("input[name=lp_checkbox_coupon]").on("click", function () {
4100        jQuery(this).toggleClass("active");
4101        if (jQuery(this).hasClass("active")) {
4102            lp_make_couponsfields_active();
4103        } else {
4104            lp_make_couponsfields_passive();
4105            /* reset the minicart and checkout form data */
4106            lp_reset_mincart_checkout_form_data();
4107            jQuery("li.checkout_discount_val").remove();
4108        }
4109    });
4110
4111    /* script for notification div */
4112    var $currHeight = jQuery(window).height();
4113    var $currDivHeight = jQuery(".lp_notification_wrapper").height();
4114    $currHeight = $currHeight - $currDivHeight;
4115    var $currHeight = $currHeight + "px";
4116    jQuery(".lp_notification_wrapper").css({
4117        top: $currHeight,
4118    });
4119
4120    /* script for on resize */
4121    jQuery(window).resize(function () {
4122        var $currHeight = jQuery(window).height();
4123        var $currDivHeight = jQuery(".lp_notification_wrapper").height();
4124        $currHeight = $currHeight - $currDivHeight;
4125        var $currHeight = $currHeight + "px";
4126        jQuery(".lp_notification_wrapper").css({
4127            top: $currHeight,
4128        });
4129    });
4130    /* cancel notice */
4131
4132    /* new dashborad menu */
4133    jQuery("#menu-toggle").click(function (e) {
4134        e.preventDefault();
4135        if (jQuery(window).width() > 767) {
4136            jQuery("#wrapper").toggleClass("active");
4137        }
4138    });
4139
4140    jQuery("p#reply-title").on("click", function (event) {
4141        event.preventDefault();
4142        var thiss = jQuery(this);
4143        if (thiss.hasClass("active")) {
4144            jQuery(this).removeClass("active");
4145            jQuery(this).next("#lp-ad-click-inner").slideUp();
4146            jQuery(this).next("#lp-ad-click-innerm").slideUp();
4147        } else {
4148            jQuery(this).addClass("active");
4149            jQuery(this).next("#lp-ad-click-inner").slideDown();
4150            jQuery(this).next("#lp-ad-click-innerm").slideDown();
4151        }
4152
4153        //jQuery(this).next('#rewies_form').toggleClass('open_review_form');
4154    });
4155    var TargetHeight = jQuery(".lp-inbox-outer").height();
4156    //jQuery('.user-recent-listings-inner .padding-0:last').height(TargetHeight+'px');
4157    jQuery(".user-recent-listings-inner .padding-0:first").height(
4158        TargetHeight + "px"
4159    );
4160    var TargetHeight = jQuery(".lp-left-panel-height").height(),
4161        TargetHeight = TargetHeight + 100;
4162
4163    /* for header search new*/
4164    jQuery("#click-search-view").on("click", function () {
4165        $this = jQuery(this);
4166        jQuery(".lp-search-section-header-view").toggleClass(
4167            "active-section-header-view"
4168        );
4169        if (!$this.hasClass("alreadyInIt")) {
4170            $this.addClass("alreadyInIt");
4171            setTimeout(function () {
4172                jQuery("input#cities").cityAutocomplete();
4173            }, 3500);
4174        }
4175    });
4176
4177    /* see more and see less activiey on user dashboard */
4178    jQuery("button.lp_see_more_activities").on("click", function () {
4179        $this = jQuery(this);
4180        $thisval = $this.text();
4181        $thisReplace = $this.data("replacetext");
4182        $this.toggleClass("active");
4183        jQuery("div.lp_hid_this_activity").slideToggle();
4184        $this.text($thisReplace);
4185        $this.data("replacetext", $thisval);
4186    });
4187
4188    /* invoices preview */
4189    var foldSettings = {
4190        easing: "linear",
4191        duration: 1000,
4192        size: 5,
4193        horizFirst: false,
4194        /* complete: function () {
4195                 $(this).toggleClass("active");
4196                 } */
4197    };
4198    jQuery("a.lp_preview_this_invoice, .lp_right_preview_this_invoice").on(
4199        "click",
4200        function (e) {
4201            var $this = jQuery(this);
4202            $inoviceno = $this
4203                .closest(".lp-listing-outer-container")
4204                .data("inoviceno");
4205            $date = $this.closest(".lp-listing-outer-container").data("date");
4206            $amount = $this.closest(".lp-listing-outer-container").data("amount");
4207            $amountOnly = $this
4208                .closest(".lp-listing-outer-container")
4209                .data("orprice");
4210            $tax = $this.closest(".lp-listing-outer-container").data("tax");
4211            $method = $this.closest(".lp-listing-outer-container").data("method");
4212            $plan = $this.closest(".lp-listing-outer-container").data("plan");
4213            $duration = $this.closest(".lp-listing-outer-container").data("duration");
4214            $status = $this.closest(".lp-listing-outer-container").data("status");
4215            $listTitle = $this
4216                .closest(".lp-listing-outer-container")
4217                .data("listtitle");
4218            $fullAmount = $amount;
4219            if ($this.hasClass("lp_preview_this_invoice")) {
4220                jQuery("div.lp_popup_preview_invoice .lppopinvoice").text($inoviceno);
4221                jQuery("div.lp_popup_preview_invoice .lppopdate").text($date);
4222                jQuery("div.lp_popup_preview_invoice .lppopsubamount").text($amount);
4223                jQuery("div.lp_popup_preview_invoice .lppopamount").text($amount);
4224                jQuery("div.lp_popup_preview_invoice .lppoptaxprice").text($tax);
4225                jQuery("div.lp_popup_preview_invoice .lppopplanprice").text(
4226                    $amountOnly
4227                );
4228                jQuery("div.lp_popup_preview_invoice .lppoplist").text($listTitle);
4229
4230                jQuery("#lpinvoiceforpdf .lppopinvoice").text($inoviceno);
4231                jQuery("#lpinvoiceforpdf .lppopdate").text($date);
4232                jQuery("#lpinvoiceforpdf .lppopamount").text($amount);
4233                jQuery("#lpinvoiceforpdf .lllistname").text($listTitle);
4234
4235                jQuery("#lpinvoiceforpdf .lppopamountqqq").text($tax);
4236                jQuery("#lpinvoiceforpdf .lppopamountwww").text($fullAmount);
4237
4238                if ($method == "wire") {
4239                    $imgSrc = jQuery("p.lp-pay-with img").data("srcwire");
4240                    jQuery("p.lp-pay-with img").attr("src", $imgSrc);
4241                } else if ($method == "stripe") {
4242                    $imgSrc = jQuery("p.lp-pay-with img").data("srcstripe");
4243                    jQuery("p.lp-pay-with img").attr("src", $imgSrc);
4244                } else if ($method == "paypal") {
4245                    $imgSrc = jQuery("p.lp-pay-with img").data("srcpaypal");
4246                    jQuery("p.lp-pay-with img").attr("src", $imgSrc);
4247                } else if ($method == "paystack") {
4248                    $imgSrc = jQuery("p.lp-pay-with img").data("srcpaystack");
4249                    jQuery("p.lp-pay-with img").attr("src", $imgSrc);
4250                } else if ($method == "razorpay") {
4251                    $imgSrc = jQuery("p.lp-pay-with img").data("srcrazorpay");
4252                    jQuery("p.lp-pay-with img").attr("src", $imgSrc);
4253                } else if ($method == "payfast") {
4254                    $imgSrc = jQuery("p.lp-pay-with img").data("srcpayfast");
4255                    jQuery("p.lp-pay-with img").attr("src", $imgSrc);
4256                } else if ($method == "payu") {
4257                    $imgSrc = jQuery("p.lp-pay-with img").data("srcpayu");
4258                    jQuery("p.lp-pay-with img").attr("src", $imgSrc);
4259                } else if ($method == "eway") {
4260                    $imgSrc = jQuery("p.lp-pay-with img").data("srceway");
4261                    jQuery("p.lp-pay-with img").attr("src", $imgSrc);
4262                } else if ($method == "mollie") {
4263                    $imgSrc = jQuery("p.lp-pay-with img").data("srcmollie");
4264                    jQuery("p.lp-pay-with img").attr("src", $imgSrc);
4265                } else if ($method == "mercadopago") {
4266                    $imgSrc = jQuery("p.lp-pay-with img").data("srcmercadopago");
4267                    jQuery("p.lp-pay-with img").attr("src", $imgSrc);
4268                } else if ($method == "stripe_ideal") {
4269                    $imgSrc = jQuery("p.lp-pay-with img").data("srcstripeideal");
4270                    jQuery("p.lp-pay-with img").attr("src", $imgSrc);
4271                } else if ($method == "flutterwave") {
4272                    $imgSrc = jQuery("p.lp-pay-with img").data("srcflutterwave");
4273                    jQuery("p.lp-pay-with img").attr("src", $imgSrc);
4274                } else if ($method == "mtn_momo") {
4275                    $imgSrc = jQuery("p.lp-pay-with img").data("srcmtn_momo");
4276                    jQuery("p.lp-pay-with img").attr("src", $imgSrc);
4277                }
4278                jQuery("div.lp_popup_preview_invoice .lppopmethod").text($method);
4279                jQuery("div.lp_popup_preview_invoice .lppopplan").text($plan);
4280                jQuery("div.lp_popup_preview_invoice .lppopduration").text($duration);
4281
4282                jQuery("#lpinvoiceforpdf .lppopmethod").text($method);
4283                jQuery("#lpinvoiceforpdf .lppopplan").text($plan);
4284                jQuery("#lpinvoiceforpdf .lppopduration").text($duration);
4285
4286                jQuery("div.lp_popup_preview_invoice").toggle("fold", foldSettings);
4287                $this
4288                    .closest(".lp-listing-outer-container")
4289                    .find(".lp_right_preview_this_invoice input")
4290                    .prop("checked", true);
4291                e.preventDefault();
4292            }
4293            if (
4294                $this.hasClass("lp_right_preview_this_invoice") ||
4295                $this.hasClass("lp_preview_this_invoice")
4296            ) {
4297                jQuery("div.lp_right_preview_invoice .lppopinvoice").text($inoviceno);
4298                jQuery("div.lp_right_preview_invoice .lppopdate").text($date);
4299                jQuery("div.lp_right_preview_invoice .lppopamount").text($amount);
4300                jQuery("div.lp_right_preview_invoice .lppopplanprice").text(
4301                    $amountOnly
4302                );
4303                jQuery("div.lp_right_preview_invoice .lppoptaxprice").text($tax);
4304                jQuery("div.lp_right_preview_invoice .lppopmethod").text($method);
4305                jQuery("div.lp_right_preview_invoice .lppopplan").text($plan);
4306                jQuery("div.lp_right_preview_invoice .lppopduration").text($duration);
4307                jQuery("div.lp_right_preview_invoice .lppopstatus").text($status);
4308
4309                jQuery("#lpinvoiceforpdf .lppopinvoice").text($inoviceno);
4310                jQuery("#lpinvoiceforpdf .lppopdate").text($date);
4311                jQuery("#lpinvoiceforpdf .lppopamount").text($amountOnly);
4312
4313                jQuery("#lpinvoiceforpdf .lppopmethod").text($method);
4314                jQuery("#lpinvoiceforpdf .lppopplan").text($plan);
4315                jQuery("#lpinvoiceforpdf .lppopduration").text($duration);
4316            }
4317
4318            //e.preventDefault();
4319        }
4320    );
4321
4322    /* close invoices preview */
4323    jQuery(document).on("click", ".close_invoice_prev", function (e) {
4324        $this = jQuery(this);
4325        jQuery("div.lp_popup_preview_invoice").toggle("fold", foldSettings);
4326        e.preventDefault();
4327    });
4328
4329    jQuery("button.lp-cancle-btn").on("click", function (e) {
4330        e.preventDefault();
4331        jQuery(".lp-ad-step-two").fadeOut(function () {
4332            jQuery(".lp_camp_invoice_wrp").fadeIn();
4333        });
4334    });
4335
4336    /* show preview of currnt ad place */
4337    jQuery('input[name="lpadsoftype[]"]').on("click", function () {
4338        $this = jQuery(this);
4339        adsduration_pd = "";
4340        lp_make_campaign_paybutton_active();
4341        $newprice = 0;
4342        $campType = lp_get_camp_type();
4343        if ($campType == "adsperduration") {
4344            lp_set_camp_duration_price_in_preview(
4345                jQuery("input[name=adsduration_pd]").val()
4346            );
4347        } else if ($campType == "adsperclick") {
4348            lp_set_camp_budget_price_in_preview(
4349                jQuery("input[name=adsprice_pc]").val()
4350            );
4351        }
4352
4353        if ($this.is(":checked")) {
4354            if ($this.val() == "lp_random_ads") {
4355                jQuery(
4356                    ".lp-invoices-all-stats li.spotlight span i.fa-check-circle"
4357                ).removeClass("lp-gray-this-ccircle");
4358                jQuery(".lpcampain-spotlight .greencheck").removeClass("graycheck");
4359            }
4360            if ($this.val() == "lp_top_in_search_page_ads") {
4361                jQuery(
4362                    ".lp-invoices-all-stats li.searchpage span i.fa-check-circle"
4363                ).removeClass("lp-gray-this-ccircle");
4364                jQuery(".lpcampain-topsearch .greencheck").removeClass("graycheck");
4365            }
4366            if ($this.val() == "lp_detail_page_ads") {
4367                jQuery(
4368                    ".lp-invoices-all-stats li.detailpage span i.fa-check-circle"
4369                ).removeClass("lp-gray-this-ccircle");
4370                jQuery(".lpcampain-sidebar .greencheck").removeClass("graycheck");
4371            }
4372        } else {
4373            if ($this.val() == "lp_random_ads") {
4374                jQuery(
4375                    ".lp-invoices-all-stats li.spotlight span i.fa-check-circle"
4376                ).addClass("lp-gray-this-ccircle");
4377                jQuery(".lpcampain-spotlight .greencheck").addClass("graycheck");
4378            }
4379            if ($this.val() == "lp_top_in_search_page_ads") {
4380                jQuery(
4381                    ".lp-invoices-all-stats li.searchpage span i.fa-check-circle"
4382                ).addClass("lp-gray-this-ccircle");
4383                jQuery(".lpcampain-topsearch .greencheck").addClass("graycheck");
4384            }
4385            if ($this.val() == "lp_detail_page_ads") {
4386                jQuery(
4387                    ".lp-invoices-all-stats li.detailpage span i.fa-check-circle"
4388                ).addClass("lp-gray-this-ccircle");
4389                jQuery(".lpcampain-sidebar .greencheck").addClass("graycheck");
4390            }
4391        }
4392    });
4393
4394    /* on type in days */
4395    jQuery(document).on("input", "input[name=adsduration_pd]", function () {
4396        jQuery(this).val(
4397            jQuery(this)
4398                .val()
4399                .replace(/[^\d].+/, "")
4400        );
4401        $thisval = jQuery(this).val();
4402        lp_set_camp_duration_price_in_preview($thisval);
4403        lp_make_campaign_paybutton_active();
4404    });
4405
4406    jQuery(document).on("click", ".lp-view-all-btn", function () {
4407        location.reload();
4408    });
4409
4410    /* exit preview */
4411    jQuery("button.lp-exist-preview").on("click", function () {
4412        jQuery(".lp_campaign_preview").hide(300);
4413        jQuery(".lp_selected_active_ad").hide(300);
4414        jQuery(".lp_campaign_invoice_pmethod").show(300);
4415    });
4416
4417    /* click on pay now btn */
4418    jQuery("button.lp_campaign_paynow").on("click", function () {
4419        //jQuery(this).attr('type', 'submit');
4420        jQuery(".lp_campaign_preview").hide(300);
4421        //jQuery('.lp_selected_active_ad').show(300);
4422        jQuery(".lp_campaign_invoice_pmethod").show(300);
4423        jQuery(this).addClass("startpayforcampaignsss");
4424    });
4425
4426    /* campaign popup code ends */
4427
4428    /* on type on ads price input */
4429    jQuery("input[name=adsprice_pc]").keyup(function () {
4430        $thisval = jQuery(this).val();
4431        lp_set_camp_budget_price_in_preview($thisval);
4432        lp_make_campaign_paybutton_active();
4433    });
4434
4435    jQuery("input[name=adsduration_pd]").keyup(function () {
4436        lp_make_campaign_paybutton_active();
4437    });
4438
4439    jQuery(".lp-search-listing-camp").on("change", function () {
4440        lp_make_campaign_paybutton_active();
4441    });
4442
4443    jQuery(".lpadspreview").on("click", function () {
4444        packeg = "";
4445        jQuery(".lploading").fadeIn();
4446        clicks = jQuery(this).attr("data-clicks");
4447        mode = jQuery(this).attr("data-mode");
4448        budget = jQuery(this).attr("data-budget");
4449        credit = jQuery(this).attr("data-credit");
4450        duration = jQuery(this).attr("data-duration");
4451        method = jQuery(this).attr("data-method");
4452        currency = jQuery(this).attr("data-currency");
4453        transid = jQuery(this).attr("data-transid");
4454        packeg = jQuery(this).attr("data-packeg0");
4455        packeg1 = jQuery(this).attr("data-packeg1");
4456        if (packeg1) {
4457            packeg += packeg1;
4458        }
4459        packeg2 = jQuery(this).attr("data-packeg2");
4460        if (packeg2) {
4461            packeg += packeg2;
4462        }
4463        if (mode == "perclick") {
4464            jQuery("#lp-ad-click-inner").show();
4465            jQuery(".adsremaining").html(credit);
4466            jQuery("#lp-ad-click-inner")
4467                .find(".lp-total-clicks-inner")
4468                .find("h4")
4469                .text(clicks);
4470
4471            taxPrice = jQuery(this).attr("data-taxPrice");
4472            budgetwithTax = jQuery(this).attr("data-budgetwithTax");
4473            jQuery(".lp-ad-payment-tax-price").html(taxPrice).show();
4474            jQuery(".lp-ad-payment-with-tax").html(budgetwithTax).show();
4475        } else {
4476            jQuery(".lp-ad-payment-tax-price").hide();
4477            jQuery(".lp-ad-payment-with-tax").hide();
4478            jQuery("#lp-ad-click-inner").hide();
4479            jQuery(".adsremaining").html(duration);
4480        }
4481
4482        jQuery(".lp-ad-all-attached-packages").html(packeg);
4483        jQuery(".lp-ad-payment-price").html(budget);
4484        jQuery(".lp-ad-payment-method").html(method);
4485        jQuery(".adstransid").html(transid);
4486
4487        jQuery(".lploading").fadeOut();
4488    });
4489});
4490
4491jQuery(document).ready(function () {
4492    jQuery(".lp-claim-plan-btn").click(function () {
4493        $sPlanID = jQuery("input[name=plan_id]:checked").val();
4494        if (
4495            typeof $sPlanID !== "undefined" &&
4496            typeof $sPlanID !== undefined &&
4497            $sPlanID !== ""
4498        ) {
4499            jQuery("input[name=lp_claimed_plan]").val($sPlanID);
4500            jQuery(".lp-claim-plan-container").addClass("active");
4501            jQuery(".lp-claim-plans").addClass("active");
4502        }
4503    });
4504});
4505
4506jQuery(document).ready(function () {
4507    jQuery(".lp-confi-bottom-bar").click(function () {
4508        jQuery(".lp_confirmation").slideToggle(700);
4509        jQuery(".unhidebar-section").slideToggle(700);
4510    });
4511
4512    jQuery(".unhidebar-section").click(function () {
4513        jQuery(".lp_confirmation").slideToggle(700);
4514        jQuery(".unhidebar-section").slideToggle(700);
4515    });
4516    // dashboard search bar click to show
4517    jQuery(".lp-filter-search-listing").click(function () {
4518        jQuery(".lp-dash-search-stats-inner").slideToggle(400);
4519    });
4520});
4521
4522// remove class dashboard menu width less then 768
4523jQuery(window).resize(function () {
4524    if (jQuery(window).width() < 768) {
4525        jQuery(".lp-dashboard-new").removeClass("active");
4526    }
4527});
4528/* aq on 31-7 */
4529
4530/*----------------lead form customizer---*/
4531jQuery(document).ready(function () {
4532    /*-------Lead form success area remove------*/
4533    jQuery(".lp-cross-suces-layout").click(function () {
4534        jQuery(".lp-lead-success-msg-outer").fadeOut("700");
4535    });
4536
4537    //lead form label color change on radio checked and unchecked
4538    jQuery(".lp-lead-radio-container input[type=radio]").click(function () {
4539        jQuery(".lp-lead-radio-container input[type=radio]:not(:checked)")
4540            .parent()
4541            .removeClass("active-radio");
4542        jQuery(".lp-lead-radio-container input[type=radio]:checked")
4543            .parent()
4544            .addClass("active-radio");
4545    });
4546    //lead form label color change on checkbox checked and unchecked
4547    jQuery(".lp-lead-check-container input[type=checkbox]").click(function () {
4548        jQuery(".lp-lead-check-container input[type=checkbox]:not(:checked)")
4549            .parent()
4550            .removeClass("active-checkbox");
4551        jQuery(".lp-lead-check-container input[type=checkbox]:checked")
4552            .parent()
4553            .addClass("active-checkbox");
4554    });
4555    // range slide color fill on move
4556    jQuery('input[type="range"].lp-range-slide').change(function () {
4557        var val =
4558            (jQuery(this).val() - jQuery(this).attr("min")) /
4559            (jQuery(this).attr("max") - jQuery(this).attr("min"));
4560        jQuery(this).css(
4561            "background-image",
4562            "-webkit-gradient(linear, left top, right top, " +
4563            "color-stop(" +
4564            val +
4565            ", #b3c0ce), " +
4566            "color-stop(" +
4567            val +
4568            ", #eef2f4)" +
4569            ")"
4570        );
4571    });
4572    // time picker
4573    if (jQuery(".datetimepicker1").length != 0) {
4574        var timeFormat = "LT";
4575        if (jQuery("#wp-timeformat").val() == "H:i") {
4576            timeFormat = "HH:mm";
4577        }
4578
4579        jQuery(".datetimepicker1").datetimepicker({
4580            format: timeFormat,
4581        });
4582    }
4583
4584    // calender picker
4585    if (jQuery(".datetimepicker2").length != 0) {
4586        jQuery(".datetimepicker2").datetimepicker({
4587            format: "L",
4588        });
4589    }
4590
4591    // calender and time picker
4592    if (jQuery(".datetimepicker3").length != 0) {
4593        jQuery(".datetimepicker3").datetimepicker();
4594    }
4595});
4596/* on 4auguest by z */
4597jQuery(document).ready(function () {
4598    jQuery("#listings_checkout_form").on("submit", function (e) {
4599        var $this = jQuery(this);
4600        var method = $this.find('input[name="plan"]:checked').val();
4601        if (method === "paypal") {
4602            if (
4603                jQuery('input[name="lp-recurring-option"]:checked').length > 0 &&
4604                jQuery('input[name="plan_time"]').val() == ""
4605            ) {
4606                alert("Sorry! A plan should have a duration for recurring payment");
4607                return false;
4608            }
4609        }
4610    });
4611
4612    /* for checkout stripe and 2checkout */
4613    jQuery("#listings_checkout_form").on("submit", function (e) {
4614        var $this = jQuery(this);
4615
4616        method = $this.find('input[name="plan"]:checked').val();
4617        listing_id = $this.find('input[name="listing_id"]:checked').val();
4618        post_title = $this.find('input[name="listing_id"]:checked').data("title");
4619        errormsg = jQuery('input[name="errormsg"]').val();
4620        plan_price = jQuery("span.lp-subtotal-total-price").data("subtotal");
4621        currency = jQuery("input[name=currency]").val();
4622        if (method === "stripe") {
4623            if (
4624                jQuery('input[name="lp-recurring-option"]:checked').length > 0 &&
4625                jQuery('input[name="plan_time"]').val() == ""
4626            ) {
4627                alert("Sorry! A plan should have a duration for recurring payment");
4628                return false;
4629            } else {
4630                if (jQuery("#lp_stripe_sca").length == 0) {
4631                    plan_price = plan_price * 100;
4632                    //jQuery('#stripe-submit').trigger( "click" );
4633                    handler.open({
4634                        name: post_title,
4635                        description: "",
4636                        zipCode: true,
4637                        amount: plan_price,
4638                        currency: currency,
4639                    });
4640                    e.preventDefault();
4641                }
4642            }
4643        } else if (method === "2checkout") {
4644            plan_price = jQuery("span.lp-subtotal-total-price").data("subtotal");
4645            listing_id = $this.find('input[name="listing_id"]:checked').val();
4646            jQuery("#myCCForm input#tprice").val(plan_price);
4647            jQuery("#myCCForm input#listing_id").val(listing_id);
4648            jQuery("button.lp-2checkout-modal").trigger("click");
4649            e.preventDefault();
4650        }
4651    });
4652
4653    jQuery(".lp_payment_methods_ads .lp-payement-images").on(
4654        "click",
4655        function (e) {
4656            $this = jQuery(this);
4657            lp_make_campaign_paybutton_active();
4658        }
4659    );
4660
4661    jQuery("button.lp-add-new-btn").on("click", function () {
4662        jQuery(".lp_camp_invoice_wrp").fadeOut(function () {
4663            jQuery(".lp-ad-step-two").fadeIn();
4664        });
4665    });
4666
4667    jQuery("a.lp-all-camp-bck").on("click", function (e) {
4668        jQuery(".lp-ad-step-two").hide(300);
4669        jQuery(".lp_camp_invoice_wrp").show(300);
4670        e.preventDefault();
4671    });
4672});
4673/* on 4auguest by z ends */
4674/* ends here */
4675
4676/* =====================for mini sub-total================== */
4677function lp_show_mini_subtotal() {
4678    var $tax = jQuery(
4679        "#listings_checkout_form input[name=listing_id]:checked"
4680    ).data("taxenable");
4681    var $taxRate = jQuery(
4682        "#listings_checkout_form input[name=listing_id]:checked"
4683    ).data("taxrate");
4684    var $method = jQuery(
4685        "#listings_checkout_form input[name=plan]:checked"
4686    ).val();
4687    var $price = jQuery(
4688        "#listings_checkout_form input[name=listing_id]:checked"
4689    ).data("planprice");
4690    var $orgPrice = $price;
4691    var $orgPrice = parseFloat($orgPrice).toFixed(2);
4692    var $planID = jQuery(
4693        "#listings_checkout_form input[name=listing_id]:checked"
4694    ).data("planid");
4695    var $planTime = jQuery(
4696        "#listings_checkout_form input[name=listing_id]:checked"
4697    ).data("plantime");
4698    var $listingID = jQuery(
4699        "#listings_checkout_form input[name=listing_id]:checked"
4700    ).val();
4701    var $lpRecurring = jQuery(
4702        "#listings_checkout_form .lp-onoff-switch-checkbox .switch-checkbox-label .switch-checkbox-label input:checked"
4703    ).val();
4704    var $taxPrice = "";
4705    var $currencyPos = jQuery("#listings_checkout_form").data("currencypos");
4706    var $currencySym = jQuery("#listings_checkout_form").data("currencysymbol");
4707    if ($tax == "1") {
4708        $taxPrice = ($taxRate / 100) * $price;
4709        $price = parseFloat($price) + parseFloat($taxPrice);
4710
4711        $taxPrice = parseFloat($taxPrice).toFixed(2);
4712    }
4713    $price = parseFloat($price).toFixed(2);
4714    jQuery("span.lp-subtotal-plan").text("");
4715    jQuery("span.lp-subtotal-price").text("");
4716    jQuery("span.lp-subtotal-taxamount").text("");
4717    jQuery("span.lp-subtotal-price").text("");
4718    jQuery("span.lp-subtotal-p-price").text("");
4719    jQuery("span.lp-subtotal-total-price").text("");
4720    jQuery("span.lp-subtotal-plan").text(
4721        jQuery("#listings_checkout_form input[name=listing_id]:checked").data(
4722            "title"
4723        )
4724    );
4725    //setting values in form
4726    lp_add_checkout_data_fields(
4727        $listingID,
4728        $planID,
4729        $price,
4730        $lpRecurring,
4731        $method,
4732        $planTime
4733    );
4734    switch ($currencyPos) {
4735        case "left":
4736            jQuery("span.lp-subtotal-p-price").text($currencySym + $orgPrice);
4737            jQuery("span.lp-subtotal-price").text($currencySym + $price);
4738            jQuery("span.lp-subtotal-taxamount").text($currencySym + $taxPrice);
4739            jQuery("span.lp-subtotal-total-price").text($currencySym + $price);
4740            jQuery("span.lp-subtotal-total-price").attr("data-subtotal", $price);
4741            break;
4742        case "right":
4743            jQuery("span.lp-subtotal-p-price").text($orgPrice + $currencySym);
4744            jQuery("span.lp-subtotal-price").text($price + $currencySym);
4745            jQuery("span.lp-subtotal-taxamount").text($taxPrice + $currencySym);
4746            jQuery("span.lp-subtotal-total-price").text($price + $currencySym);
4747            jQuery("span.lp-subtotal-total-price").attr("subtotal", $price);
4748            break;
4749        default:
4750            jQuery("span.lp-subtotal-p-price").text($currencySym + $orgPrice);
4751            jQuery("span.lp-subtotal-price").text($currencySym + $price);
4752            jQuery("span.lp-subtotal-taxamount").text($currencySym + $taxPrice);
4753            jQuery("span.lp-subtotal-total-price").text($currencySym + $price);
4754            jQuery("span.lp-subtotal-total-price").attr("datasubtotal", $price);
4755    }
4756
4757    jQuery(".lp-checkout-coupon-outer").css("display", "block");
4758    jQuery(".active-checkout-listing").addClass(
4759        "lp-checkout-wrapper-new-without-radius"
4760    );
4761}
4762
4763/* ====================function for recurring option====================== */
4764
4765function lp_show_recurring_switch() {
4766    var $sPlan = jQuery("input[name=plan]:checked").val();
4767    if ($sPlan == "stripe" || $sPlan == "paypal") {
4768        jQuery(".lp-checkout-recurring-wrap").css("display", "block");
4769    } else if ($sPlan == "wire") {
4770        jQuery(
4771            '.lp-checkout-recurring-wrap input[name="lp-recurring-option"]'
4772        ).prop("checked", false);
4773        jQuery(".lp-checkout-recurring-wrap").css("display", "none");
4774    }
4775}
4776
4777/* ====================function for recurring option====================== */
4778
4779function lp_add_checkout_data_fields(
4780    listingID,
4781    planID,
4782    price,
4783    recurring,
4784    method,
4785    $planTime
4786) {
4787    var $tax = jQuery(
4788        "#listings_checkout_form input[name=listing_id]:checked"
4789    ).data("taxenable");
4790    jQuery("input[name=post_id]").val(listingID);
4791    jQuery("input[name=method]").val(method);
4792    if ($tax == "1") {
4793        jQuery("input[name=listings_tax_price]").val(price);
4794    }
4795    jQuery("input[name=prc_plan]").val(planID);
4796    jQuery("input[name=lprecurring]").val(recurring);
4797    jQuery("input[name=plan_time]").val($planTime);
4798}
4799
4800/* ==================== function to show active fields of coupons============ */
4801function lp_make_couponsfields_active() {
4802    jQuery("input.coupon-text-field").prop("disabled", false);
4803    jQuery("button.coupon-apply-bt").prop("disabled", false);
4804}
4805
4806/* ==================== function to show disable fields of coupons============ */
4807function lp_make_couponsfields_passive() {
4808    jQuery("input.coupon-text-field").prop("disabled", true);
4809    jQuery("button.coupon-apply-bt").prop("disabled", true);
4810}
4811
4812/* ====================function for adding data in input hidden fields=========*/
4813
4814function lp_add_checkout_data_fields_in_form(
4815    listingID,
4816    post_title,
4817    planID,
4818    price,
4819    $tax,
4820    $taxRate
4821) {
4822    jQuery("input[name=plan_price]").val(price);
4823    jQuery("input[name=post_title]").val(post_title);
4824    jQuery("input[name=listings_id]").val(listingID);
4825    jQuery("input[name=post_id]").val(listingID);
4826    jQuery("input[name=plan_id]").val(planID);
4827    if ($tax) {
4828        taxprice = ($taxRate / 100) * price;
4829        taxprice = taxprice.toFixed(2);
4830        jQuery('input[name="listings_tax_price"]').val(taxprice);
4831    }
4832    lp_update_date_in_mini_cart(price, $tax, $taxRate);
4833}
4834
4835/* ====================function for update data in mini cart====================*/
4836function lp_update_date_in_mini_cart($price, $tax, $taxRate) {
4837    var $currencyPos = jQuery("#listings_checkout_form").data("currencypos");
4838    var $currencySym = jQuery("#listings_checkout_form").data("currencysymbol");
4839    var $orgPrice = $price;
4840    var $orgPrice = parseFloat($orgPrice).toFixed(2);
4841    var $taxPrice = "";
4842    var $currencyPos = jQuery("#listings_checkout_form").data("currencypos");
4843    var $currencySym = jQuery("#listings_checkout_form").data("currencysymbol");
4844    if ($tax == "1") {
4845        $taxPrice = ($taxRate / 100) * $price;
4846        $price = parseFloat($price) + parseFloat($taxPrice);
4847        $price = parseFloat($price).toFixed(2);
4848
4849        $taxPrice = parseFloat($taxPrice).toFixed(2);
4850    }
4851
4852    switch ($currencyPos) {
4853        case "left":
4854            //jQuery('span.lp-subtotal-p-price').text($currencySym+$orgPrice);
4855            jQuery("span.lp-subtotal-price").text($currencySym + $price);
4856            jQuery("span.lp-subtotal-taxamount").text($currencySym + $taxPrice);
4857            jQuery("span.lp-subtotal-total-price").text($currencySym + $price);
4858            jQuery("span.lp-subtotal-total-price").attr("data-subtotal", $price);
4859            break;
4860        case "right":
4861            //jQuery('span.lp-subtotal-p-price').text($orgPrice+$currencySym);
4862            jQuery("span.lp-subtotal-price").text($price + $currencySym);
4863            jQuery("span.lp-subtotal-taxamount").text($taxPrice + $currencySym);
4864            jQuery("span.lp-subtotal-total-price").text($price + $currencySym);
4865            jQuery("span.lp-subtotal-total-price").attr("data-subtotal", $price);
4866            break;
4867        default:
4868            jQuery("span.lp-subtotal-p-price").text($currencySym + $orgPrice);
4869            jQuery("span.lp-subtotal-price").text($currencySym + $price);
4870            jQuery("span.lp-subtotal-taxamount").text($currencySym + $taxPrice);
4871            jQuery("span.lp-subtotal-total-price").text($currencySym + $price);
4872            jQuery("span.lp-subtotal-total-price").attr("data-subtotal", $price);
4873    }
4874}
4875
4876/* =====================reset mincart and checkout data  ======================== */
4877function lp_reset_mincart_checkout_form_data() {
4878    var $price = jQuery("input[name=listing_id]:checked").data("planprice");
4879    var $listingID = jQuery("input[name=listing_id]:checked").val();
4880    var $post_title = jQuery("input[name=listing_id]:checked").data("title");
4881    var $planID = jQuery("input[name=listing_id]:checked").data("planid");
4882    var $tax = jQuery("input[name=listing_id]:checked").data("taxenable");
4883    var $taxRate = jQuery("input[name=listing_id]:checked").data("taxrate");
4884    lp_add_checkout_data_fields_in_form(
4885        $listingID,
4886        $post_title,
4887        $planID,
4888        $price,
4889        $tax,
4890        $taxRate
4891    );
4892}
4893
4894/* =====================active checkout steps bar  ======================== */
4895function lp_make_checkout_step_active($stepname) {
4896    jQuery(".lp_payment_steps_area li." + $stepname + "").addClass("current");
4897}
4898
4899/* =====================active checkout steps bar  ======================== */
4900function lp_make_checkout_step_passive($stepname) {
4901    jQuery(".lp_payment_steps_area li." + $stepname + "").removeClass("current");
4902}
4903
4904/* =====================active checkout steps button on all selections ======================== */
4905function lp_make_campaign_paybutton_active() {
4906    var selected_option = jQuery(".lp-search-listing-camp").val();
4907    var atLeastOnePlaceAd =
4908        jQuery('input[name="lpadsoftype[]"]:checked').length > 0;
4909    var atLeastOneMethodAd = jQuery('input[name="method"]:checked').length > 0;
4910    var adsterms = jQuery("#lp-campaignTerms:checked").length > 0;
4911    var listing_id = jQuery("select[name=lp_ads_for_listing]").val();
4912
4913    var adPriceField = 1;
4914    var adDurationField = 1;
4915
4916    if (jQuery('input[name="adsduration_pd"]').length > 0) {
4917        adDurationField = jQuery('input[name="adsduration_pd"]').val();
4918    }
4919
4920    if (jQuery('input[name="adsprice_pc"]').length > 0) {
4921        adPriceField = jQuery('input[name="adsprice_pc"]').val();
4922    }
4923
4924    if (
4925        selected_option != "" &&
4926        selected_option != "0" &&
4927        listing_id != "" &&
4928        listing_id != "0" &&
4929        atLeastOnePlaceAd != "" &&
4930        adsterms != "" &&
4931        adsterms != "0" &&
4932        atLeastOnePlaceAd != "0" &&
4933        atLeastOneMethodAd != "" &&
4934        atLeastOneMethodAd != "0" &&
4935        adDurationField != "" &&
4936        adDurationField != "0" &&
4937        adPriceField != "" &&
4938        adPriceField != "0"
4939    ) {
4940        jQuery("button.lp_campaign_paynow").attr("disabled", false);
4941        jQuery("button.lp_campaign_paynow").attr("type", "submit");
4942    } else {
4943        jQuery("button.lp_campaign_paynow").attr("disabled", true);
4944        jQuery("button.lp_campaign_paynow").attr("type", "button");
4945    }
4946}
4947
4948jQuery(document).on("change", "select[name=lp_ads_for_listing]", function () {
4949    lp_make_campaign_paybutton_active();
4950});
4951
4952jQuery(document).on("click", "#lp-campaignTerms", function () {
4953    lp_make_campaign_paybutton_active();
4954});
4955
4956jQuery(document).on("click", ".show-loop-map-popup", function (e) {
4957    e.preventDefault();
4958    if (jQuery("#grid-show-popup").is(".md-show")) { } else {
4959        jQuery("#grid-show-popup").modal({
4960            show: "true",
4961        });
4962        jQuery("#grid-show-popup").addClass("md-show");
4963    }
4964    var $this = jQuery(this),
4965        LAT = $this.data("lat"),
4966        LNG = $this.data("lng"),
4967        LPpostID = $this.data("lid");
4968    jQuery.ajax({
4969        url: ajax_search_term_object.ajaxurl,
4970        data: {
4971            action: "show_map_pop_cb",
4972            LPpostID: LPpostID,
4973            lpNonce: jQuery("#lpNonce").val(),
4974        },
4975        success: function (data) {
4976            jQuery("#grid-show-popup .grid-show-popup").html(data);
4977            var markerSrc = jQuery(
4978                "#grid-show-popup .grid-show-popup .quickmap"
4979            ).attr("data-marker-src");
4980            var markerElement;
4981            if (markerSrc.startsWith("fa-")) {
4982                markerElement = '<i class="' + markerSrc + '"></i>';
4983            } else if (
4984                markerSrc.startsWith("http://") ||
4985                markerSrc.startsWith("https://")
4986            ) {
4987                markerElement = '<img src="' + markerSrc + '" alt="Marker">';
4988            } else if (markerSrc.startsWith("data:image/")) {
4989                markerElement = '<img src="' + markerSrc + '" alt="Marker">';
4990            }
4991            var markers = false;
4992            $mtoken = jQuery("#page").data("mtoken");
4993            $mtype = jQuery("#page").data("mtype");
4994            $siteURL = jQuery("#page").data("site-url");
4995            $lat = LAT;
4996            $lan = LNG;
4997            if ($mtoken != "" && $mtype == "mapbox") {
4998                L.mapbox.accessToken = $mtoken;
4999                map = L.mapbox.map("quickmap" + LPpostID);
5000                L.tileLayer(
5001                    "https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}", {
5002                    id: jQuery("#page").data("mstyle"),
5003                    accessToken: jQuery("#page").data("mtoken"),
5004                }
5005                ).addTo(map);
5006            } else {
5007                var map = new L.Map("quickmap" + LPpostID, {
5008                    center: new L.LatLng($lat, $lan),
5009                    zoom: 14,
5010                });
5011                if ($mtype == "google") {
5012                    var googleLayer = new L.Google("ROADMAP");
5013                    map.addLayer(googleLayer);
5014                } else {
5015                    L.tileLayer(
5016                        "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
5017                    ).addTo(map);
5018                }
5019            }
5020            map.setView([$lat, $lan], 14);
5021            markers = new L.MarkerClusterGroup();
5022            var markerLocation = new L.LatLng($lat, $lan); // London
5023            var CustomHtmlIcon = L.HtmlIcon.extend({
5024                options: {
5025                    html: "<div class='lpmap-icon-shape pin '><div class='lpmap-icon-contianer'>" +
5026                        markerElement +
5027                        "'</div></div>",
5028                },
5029            });
5030            var customHtmlIcon = new CustomHtmlIcon();
5031            var marker = new L.Marker(markerLocation, {
5032                icon: customHtmlIcon,
5033            })
5034                .bindPopup("")
5035                .addTo(map);
5036            markers.addLayer(marker);
5037            jQuery(".md-close.widget-map-click").click(function (e) {
5038                var loaderImg = jQuery("#grid-show-popup .grid-show-popup").data(
5039                    "loader"
5040                );
5041                jQuery("#full-overlay").remove();
5042                jQuery("#grid-show-popup .grid-show-popup").html(
5043                    '<img alt="image" src="' + loaderImg + '" />'
5044                );
5045            });
5046            //alert(data.cats_markup);
5047        },
5048        error: function (errorThrown) {
5049            alert(errorThrown);
5050        },
5051    });
5052});
5053
5054jQuery(document).on("click", ".open-multi-rate-box", function (e) {
5055    e.preventDefault();
5056    var $this = jQuery(this),
5057        targetBox = "#" + $this.data("rate-box");
5058    jQuery(targetBox).slideToggle(500);
5059});
5060
5061jQuery("button.printthisinvoice").click(function (e) {
5062    var printContents = document.querySelector(
5063        "#listing-invoices-popup .modal-body"
5064    ).innerHTML;
5065    var originalContents = document.body.innerHTML;
5066    document.body.innerHTML = printContents;
5067    window.print();
5068    document.body.innerHTML = originalContents;
5069    location.reload();
5070    e.preventDefault();
5071});
5072
5073jQuery(document).ready(function () {
5074    if (jQuery(".lp-user-listings.active-checkout-listing").length) {
5075        jQuery(".lp-user-listings").each(function (index) {
5076            if (jQuery(this).hasClass("active-checkout-listing")) { } else {
5077                jQuery(this).remove();
5078            }
5079        });
5080    }
5081});
5082
5083// App view menu in tabs
5084jQuery(document).ready(function () {
5085    jQuery(".lp-menu-type-heading").on("click", function () {
5086        //jQuery('.lp-menu-type-heading').removeClass('active');
5087        jQuery(this).toggleClass("active");
5088        jQuery(".active-menu-toggle").slideUp("slow", function () {
5089            jQuery(".active-menu-toggle").removeClass("active-menu-toggle");
5090        });
5091        var getmenutype = "." + jQuery(this).attr("data-target");
5092        jQuery(getmenutype).slideToggle("slow");
5093    });
5094    jQuery(".lp-appview-group-heading").on("click", function () {
5095        //jQuery('.lp-appview-group-heading').removeClass('active');
5096        jQuery(this).toggleClass("active");
5097        var getmenugroup = "." + jQuery(this).attr("data-target");
5098        //jQuery('.lp-appview-menu-items-bygroup').slideUp('slow');
5099        jQuery(this).next(getmenugroup).slideToggle("slow");
5100    });
5101});
5102
5103jQuery(document).ready(function () {
5104    //dashboard weekly monthly active
5105    jQuery(".lp_stats_duration_filter li button").on("click", function () {
5106        jQuery(".lp_stats_duratonBtn").removeClass("active");
5107
5108        jQuery(this).addClass("active");
5109    });
5110
5111    //If width is less than 640
5112    if (jQuery(window).width() < 641) {
5113        jQuery("#main_icon").on("click", function () {
5114            jQuery("#main_icon").toggleClass("fa fa-times");
5115            jQuery("#sidebar").toggle(300);
5116        });
5117    }
5118
5119    //New archive style grid switcher
5120    jQuery(".lp-grid-two").on("click", function () {
5121        jQuery(".lp-sidebar-filters-style").removeClass("lp-grid-width1");
5122        jQuery(".lp-sidebar-filters-style").removeClass("lp-grid-width3");
5123
5124        jQuery(".lp-sidebar-filters-style").addClass("lp-grid-width2");
5125        jQuery(".lp-grid-two").addClass("active");
5126        jQuery(".lp-grid-one").removeClass("active");
5127        jQuery(".lp-grid-three").removeClass("active");
5128    });
5129    jQuery(".lp-grid-one").on("click", function () {
5130        jQuery(".lp-sidebar-filters-style").removeClass("lp-grid-width2");
5131        jQuery(".lp-sidebar-filters-style").removeClass("lp-grid-width3");
5132
5133        jQuery(".lp-sidebar-filters-style").addClass("lp-grid-width1");
5134        jQuery(".lp-grid-one").addClass("active");
5135        jQuery(".lp-grid-two").removeClass("active");
5136        jQuery(".lp-grid-three").removeClass("active");
5137    });
5138    jQuery(".lp-grid-three").on("click", function () {
5139        jQuery(".lp-sidebar-filters-style").removeClass("lp-grid-width1");
5140        jQuery(".lp-sidebar-filters-style").removeClass("lp-grid-width2");
5141
5142        jQuery(".lp-sidebar-filters-style").addClass("lp-grid-width3");
5143        jQuery(".lp-grid-three").addClass("active");
5144        jQuery(".lp-grid-two").removeClass("active");
5145        jQuery(".lp-grid-one").removeClass("active");
5146    });
5147});
5148
5149jQuery(document).on("click", ".app-view-popup-style", function () {
5150    jQuery('<div id="full-overlay-lp"></div>').insertBefore(
5151        "#app-view-login-popup"
5152    );
5153    jQuery("#full-overlay-lp").css({
5154        width: "100vw",
5155        height: "100vh",
5156        position: "fixed",
5157        background: "#000000c7",
5158        "z-index": 3,
5159        top: 0,
5160        left: 0,
5161    });
5162    jQuery(".md-close i").click(function () {
5163        jQuery("#full-overlay-lp").remove();
5164        jQuery("#app-view-login-popup").fadeOut(function () {
5165            jQuery("#app-view-login-popup").css({
5166                //'opacity': 0,
5167                display: "none",
5168            });
5169        });
5170    });
5171});
5172
5173/* ======function to get currency symbol===== */
5174
5175function lp_get_currency_sysmbol() {
5176    $code = jQuery("#lp-new-ad-compaignForm").data("camp-currency");
5177    return $code;
5178}
5179
5180/* ======function to get tax percent===== */
5181
5182function lp_get_tax_percent() {
5183    $code = jQuery("#lp-new-ad-compaignForm").data("tax-percent");
5184    return $code;
5185}
5186
5187/* ======function to get selected campaigns org price===== */
5188
5189function lp_get_selected_camp_price() {
5190    $totalCamPrice = 0;
5191    jQuery('input[name="lpadsoftype[]"]:checked').each(function () {
5192        $thisAd = jQuery(this).data("orgprice");
5193        $totalCamPrice = parseFloat($totalCamPrice) + parseFloat($thisAd);
5194    });
5195    //console.log($totalCamPrice);
5196    return $totalCamPrice;
5197}
5198
5199/* ======function to get selected campaigns with tax price===== */
5200function lp_get_selected_camp_withtax_price() {
5201    $totalCamPrice = 0;
5202    jQuery('input[name="lpadsoftype[]"]:checked').each(function () {
5203        $thisAd = jQuery(this).data("price");
5204        $totalCamPrice = parseFloat($totalCamPrice) + parseFloat($thisAd);
5205    });
5206    //console.log($totalCamPrice);
5207    return $totalCamPrice;
5208}
5209
5210/* ======function to get tax price of campaigns===== */
5211function lp_get_selected_camp_onlytax_price() {
5212    $totalCamPrice = 0;
5213    jQuery('input[name="lpadsoftype[]"]:checked').each(function () {
5214        $thisAd = jQuery(this).data("taxprice");
5215        $totalCamPrice = parseFloat($totalCamPrice) + parseFloat($thisAd);
5216    });
5217    //console.log($totalCamPrice);
5218    return $totalCamPrice;
5219}
5220
5221/* ======function to set camp duration price in preview===== */
5222function lp_set_camp_duration_price_in_preview($thisval) {
5223    $daysString = jQuery(".lp-cmp-duration").data("days-text");
5224    $taxPercent = lp_get_tax_percent();
5225    $taxtotalPrice = lp_get_selected_camp_onlytax_price();
5226    $taxtotalPrice = $thisval * $taxtotalPrice;
5227    $taxtotalPrice = $taxtotalPrice.toFixed(2);
5228    jQuery("input[name=taxprice]").val($taxtotalPrice);
5229    jQuery("input[name=ads_days]").val($thisval);
5230    $thisvalWithDays = $thisval + " " + $daysString;
5231    jQuery(".lp-cmp-duration h6").text($thisvalWithDays);
5232    $totalCamPrice = lp_get_selected_camp_price();
5233    $totalCamPrice = parseFloat($thisval) * parseFloat($totalCamPrice);
5234    console.log($totalCamPrice);
5235    $totalCamPrice = $totalCamPrice.toFixed(2);
5236    jQuery(".lp-cmp-subtotal h6").text(
5237        lp_get_currency_sysmbol() + "" + $totalCamPrice
5238    );
5239    $totalCamPriceWithTax = lp_get_selected_camp_withtax_price();
5240    $totalCamPriceWithTax =
5241        parseFloat($thisval) * parseFloat($totalCamPriceWithTax);
5242    $totalCamPriceWithTax = $totalCamPriceWithTax.toFixed(2);
5243    console.log($totalCamPriceWithTax);
5244    jQuery(".lp-cmp-alltotal h5").text(
5245        lp_get_currency_sysmbol() + "" + $totalCamPriceWithTax
5246    );
5247    jQuery("input[name=ads_price]").val($totalCamPriceWithTax);
5248
5249    jQuery(".lp-cmp-taxtotal h6").text($taxtotalPrice);
5250}
5251
5252/* ======function to set camp price in preview===== */
5253function lp_set_camp_budget_price_in_preview($thisval) {
5254    $taxPercent = lp_get_tax_percent();
5255    $thisvalWithCurr = lp_get_currency_sysmbol() + "" + $thisval;
5256    jQuery(".lp-cmp-budget h6").text($thisvalWithCurr);
5257    jQuery(".lp-cmp-subtotal h6").text($thisvalWithCurr);
5258    $taxPrice = 0;
5259    if ($taxPercent) {
5260        $taxPrice = ($taxPercent / 100) * $thisval;
5261        $taxPrice = $taxPrice.toFixed(2);
5262        jQuery("input[name=taxprice]").val($taxPrice);
5263        $taxPriceWithCurr = lp_get_currency_sysmbol() + "" + $taxPrice;
5264        jQuery(".lp-cmp-taxtotal h6").text($taxPriceWithCurr);
5265    }
5266
5267    $totalAmount = parseFloat($thisval) + parseFloat($taxPrice);
5268    jQuery("input[name=ads_price]").val($totalAmount);
5269    jQuery(".lp-cmp-alltotal h5").text(
5270        lp_get_currency_sysmbol() + "" + $totalAmount
5271    );
5272}
5273
5274/* ======function to set camp type===== */
5275function lp_get_camp_type() {
5276    $camptype = jQuery("#lp-new-ad-compaignForm").data("type");
5277    return $camptype;
5278}
5279
5280// Add hours
5281jQuery(document).on("click", "button.add-hours", function (event) {
5282    event.preventDefault();
5283    var is_safari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
5284    var $this = jQuery(this);
5285    var lp2times = $this
5286        .closest("#day-hours-BusinessHours")
5287        .data("lpenabletwotimes");
5288    var sorryMsg = jQuery(this).data("sorrymsg");
5289    var alreadyadded = jQuery(this).data("alreadyadded");
5290    var error = false;
5291    var fullday = "";
5292    var fullhoursclass = "";
5293
5294    var lpdash = "~";
5295
5296    if (lp2times == "disable") {
5297        var weekday = jQuery("select.weekday").val();
5298        if (jQuery(".fulldayopen").is(":checked")) {
5299            jQuery(".fulldayopen").attr("checked", false);
5300            jQuery("select.hours-start").prop("disabled", false);
5301            jQuery("select.hours-end").prop("disabled", false);
5302            var startVal = "";
5303            var endVal = "";
5304            var hrstart = "";
5305            var hrend = "";
5306            fullday = $this.data("fullday");
5307            fullhoursclass = "fullhours";
5308            lpdash = "";
5309        } else {
5310            var startVal = jQuery("select.hours-start").val();
5311            var endVal = jQuery("select.hours-end").val();
5312            var hrstart = jQuery("select.hours-start").find("option:selected").val();
5313            var hrend = jQuery("select.hours-end").find("option:selected").val();
5314
5315            var startVal_digit = hrstart.replace(":", "");
5316            var endVal_digit = hrend.replace(":", "");
5317
5318            if (startVal_digit.indexOf("am") > -1) {
5319                startVal_digit = startVal_digit.replace("am", "");
5320            } else if (startVal_digit.indexOf("pm") > -1) {
5321                startVal_digit = startVal_digit.replace("pm", "");
5322                if (startVal_digit != "1200" && startVal_digit != "1230") {
5323                    startVal_digit = parseInt(startVal_digit) + 1200;
5324                }
5325            }
5326            if (endVal_digit.indexOf("am") > -1) {
5327                endVal_digit = endVal_digit.replace("am", "");
5328                endVal_digit = parseInt(endVal_digit);
5329                if (endVal_digit >= 1200) {
5330                    endVal_digit = parseInt(endVal_digit) - 1200;
5331                }
5332            } else if (endVal_digit.indexOf("pm") > -1) {
5333                endVal_digit = endVal_digit.replace("pm", "");
5334                endVal_digit = parseInt(endVal_digit) + 1200;
5335            }
5336
5337            if (startVal_digit > endVal_digit) {
5338                nextWeekday = jQuery("select.weekday option:selected+option").val();
5339                if (typeof nextWeekday === "undefined") {
5340                    nextWeekday = jQuery("select.weekday")
5341                        .find("option:first-child")
5342                        .val();
5343                }
5344
5345                weekday = weekday + "~" + nextWeekday;
5346            }
5347        }
5348
5349        if ($this.hasClass("lp-add-hours-st")) {
5350            var remove = '<i class="fa fa-times"></i>';
5351        } else {
5352            var remove = jQuery(this).data("remove");
5353        }
5354        jQuery(".hours-display .hours").each(function (index, element) {
5355            var weekdayTExt = jQuery(element).children(".weekday").text();
5356            if (weekdayTExt == weekday) {
5357                alert(sorryMsg + "! " + weekday + " " + alreadyadded);
5358                error = true;
5359            }
5360        });
5361        if (error != true) {
5362            jQuery(".hours-display").append(
5363                "<div class='hours " +
5364                fullhoursclass +
5365                "'><span class='weekday'>" +
5366                weekday +
5367                "</span><span class='start-end fullday'>" +
5368                fullday +
5369                "</span><span class='start'>" +
5370                hrstart +
5371                "</span><span>" +
5372                lpdash +
5373                "</span><span class='end'>" +
5374                hrend +
5375                "</span><a class='remove-hours' href='#'>" +
5376                remove +
5377                "</a><input name='business_hours[" +
5378                weekday +
5379                "][open]' value='" +
5380                startVal +
5381                "' type='hidden'><input name='business_hours[" +
5382                weekday +
5383                "][close]' value='" +
5384                endVal +
5385                "' type='hidden'></div>"
5386            );
5387
5388            if (is_safari) { } else {
5389                var current = jQuery("select.weekday").find("option:selected");
5390                var nextval = current.next();
5391                current.removeAttr("selected");
5392                nextval.attr("selected", "selected");
5393                jQuery("select.weekday").trigger("change.select2");
5394            }
5395        }
5396    } else {
5397        var lptwentlyfourisopen = "";
5398        /* 2times */
5399        var weekday = jQuery("select.weekday").val();
5400        var weekday1 = weekday;
5401        var weekday2 = weekday;
5402
5403        if (jQuery(".fulldayopen").is(":checked")) {
5404            lptwentlyfourisopen = "yes";
5405
5406            jQuery(".fulldayopen").attr("checked", false);
5407            jQuery("select.hours-start").prop("disabled", false);
5408            jQuery("select.hours-end").prop("disabled", false);
5409
5410            jQuery("select.hours-start2").prop("disabled", false);
5411            jQuery("select.hours-end2").prop("disabled", false);
5412
5413            var startVal1 = "";
5414            var endVal1 = "";
5415            var hrstart1 = "";
5416            var hrend1 = "";
5417
5418            var startVal2 = "";
5419            var endVal2 = "";
5420            var hrstart2 = "";
5421            var hrend2 = "";
5422
5423            fullday = $this.data("fullday");
5424            fullhoursclass = "fullhours";
5425
5426            lpdash = "";
5427        } else {
5428            var startVal1 = jQuery("select.hours-start").val();
5429            var endVal1 = jQuery("select.hours-end").val();
5430            var hrstart1 = jQuery("select.hours-start").find("option:selected").val();
5431            var hrend1 = jQuery("select.hours-end").find("option:selected").val();
5432
5433            var startVal1_digit = hrstart1.replace(":", "");
5434            var endVal1_digit = hrend1.replace(":", "");
5435
5436            if (startVal1_digit.indexOf("am") > -1) {
5437                startVal1_digit = startVal1_digit.replace("am", "");
5438            } else if (startVal1_digit.indexOf("pm") > -1) {
5439                startVal1_digit = startVal1_digit.replace("pm", "");
5440                if (startVal1_digit != "1200" && startVal1_digit != "1230") {
5441                    startVal1_digit = parseInt(startVal1_digit) + 1200;
5442                }
5443            }
5444            if (endVal1_digit.indexOf("am") > -1) {
5445                endVal1_digit = endVal1_digit.replace("am", "");
5446                endVal1_digit = parseInt(endVal1_digit);
5447                if (endVal1_digit >= 1200) {
5448                    endVal1_digit = parseInt(endVal1_digit) - 1200;
5449                }
5450            } else if (endVal1_digit.indexOf("pm") > -1) {
5451                endVal1_digit = endVal1_digit.replace("pm", "");
5452                endVal1_digit = parseInt(endVal1_digit) + 1200;
5453            }
5454
5455            if (startVal1_digit > endVal1_digit) {
5456                nextWeekday = jQuery("select.weekday option:selected+option").val();
5457                if (typeof nextWeekday === "undefined") {
5458                    nextWeekday = jQuery("select.weekday")
5459                        .find("option:first-child")
5460                        .val();
5461                }
5462
5463                weekday1 = weekday + "~" + nextWeekday;
5464                jQuery(".hours-display .hours").each(function (e) {
5465                    var $this = jQuery(this);
5466                    if (
5467                        $this.find('span.weekday:contains("' + weekday1 + '")').length > 0
5468                    ) {
5469                        alert(sorryMsg + "! " + weekday1 + " " + alreadyadded);
5470                        error = true;
5471                    }
5472                });
5473            }
5474
5475            var startVal2 = jQuery("select.hours-start2").val();
5476            var endVal2 = jQuery("select.hours-end2").val();
5477            var hrstart2 = jQuery("select.hours-start2")
5478                .find("option:selected")
5479                .text();
5480            var hrend2 = jQuery("select.hours-end2").find("option:selected").text();
5481
5482            var startVal2_digit = hrstart2.replace(":", "");
5483            var endVal2_digit = hrend2.replace(":", "");
5484
5485            if (startVal2_digit.indexOf(" AM") > -1) {
5486                startVal2_digit = parseInt(startVal2_digit.replace(" AM", ""));
5487            } else if (startVal2_digit.indexOf(" PM") > -1) {
5488                startVal2_digit = parseInt(startVal2_digit.replace(" PM", ""));
5489                if (startVal2_digit != "1200" && startVal2_digit != "1230") {
5490                    startVal2_digit = parseInt(startVal2_digit) + 1200;
5491                }
5492            }
5493            if (endVal2_digit.indexOf(" AM") > -1) {
5494                endVal2_digit = endVal2_digit.replace(" AM", "");
5495                endVal2_digit = parseInt(endVal2_digit);
5496                if (endVal2_digit >= 1200) {
5497                    endVal2_digit = parseInt(endVal2_digit) - 1200;
5498                }
5499            } else if (endVal2_digit.indexOf(" PM") > -1) {
5500                endVal2_digit = endVal2_digit.replace(" PM", "");
5501                endVal2_digit = parseInt(endVal2_digit) + 1200;
5502            }
5503            nextWeekday = jQuery("select.weekday option:selected+option").val();
5504            if (typeof nextWeekday === "undefined") {
5505                nextWeekday = jQuery("select.weekday").find("option:first-child").val();
5506            }
5507            weekday2 = weekday;
5508            jQuery(".hours-display .hours").each(function (e) {
5509                var $this = jQuery(this);
5510                if (
5511                    $this.find('span.weekday:contains("' + weekday2 + '")').length > 0
5512                ) {
5513                    alert(sorryMsg + "! " + weekday2 + " " + alreadyadded);
5514                    error = true;
5515                }
5516            });
5517        }
5518
5519        if ($this.hasClass("lp-add-hours-st")) {
5520            var remove = '<i class="fa fa-times"></i>';
5521        } else {
5522            var remove = jQuery(this).data("remove");
5523        }
5524        jQuery(".hours-display .hours").each(function (index, element) {
5525            var weekdayTExt = jQuery(element).children(".weekday").text();
5526            if (weekdayTExt == weekday) {
5527                alert(sorryMsg + "! " + weekday + " " + alreadyadded);
5528                error = true;
5529            }
5530        });
5531        if (error != true) {
5532            hrstart1 = hrstart1.replace(/am/i, ' AM').replace(/pm/i, ' PM');
5533            hrend1   = hrend1.replace(/am/i, ' AM').replace(/pm/i, ' PM');
5534            if (jQuery(".lp-check-doubletime .enable2ndday").is(":checked") && lptwentlyfourisopen === "") {
5535                jQuery(".hours-display").append(
5536                    "<div class='hours " +
5537                    fullhoursclass +
5538                    "'><span class='weekday'>" +
5539                    weekday +
5540                    "</span><span class='start-end fullday'>" +
5541                    fullday +
5542                    "</span><span class='start'>" +
5543                    hrstart1 +
5544                    "</span><span>" +
5545                    lpdash +
5546                    "</span><span class='end'>" +
5547                    hrend1 +
5548                    "</span><a class='remove-hours' href='#'>" +
5549                    remove +
5550                    "</a><br><span class='weekday'>&nbsp;</span><span class='start'>" +
5551                    hrstart2 +
5552                    "</span><span>" +
5553                    lpdash +
5554                    "</span><span class='end'>" +
5555                    hrend2 +
5556                    "</span><input name='business_hours[" +
5557                    weekday1 +
5558                    "][open][0]' value='" +
5559                    startVal1 +
5560                    "' type='hidden'><input name='business_hours[" +
5561                    weekday1 +
5562                    "][close][0]' value='" +
5563                    endVal1 +
5564                    "' type='hidden'><input name='business_hours[" +
5565                    weekday2 +
5566                    "][open][1]' value='" +
5567                    startVal2 +
5568                    "' type='hidden'><input name='business_hours[" +
5569                    weekday2 +
5570                    "][close][1]' value='" +
5571                    endVal2 +
5572                    "' type='hidden'></div>"
5573                );
5574            } else {
5575                jQuery(".hours-display").append(
5576                    "<div class='hours " +
5577                    fullhoursclass +
5578                    "'><span class='weekday'>" +
5579                    weekday1 +
5580                    "</span><span class='start-end fullday'>" +
5581                    fullday +
5582                    "</span><span class='start'>" +
5583                    hrstart1 +
5584                    "</span><span>" +
5585                    lpdash +
5586                    "</span><span class='end'>" +
5587                    hrend1 +
5588                    "</span><a class='remove-hours' href='#'>" +
5589                    remove +
5590                    "</a><input name='business_hours[" +
5591                    weekday1 +
5592                    "][open]' value='" +
5593                    startVal1 +
5594                    "' type='hidden'><input name='business_hours[" +
5595                    weekday1 +
5596                    "][close]' value='" +
5597                    endVal1 +
5598                    "' type='hidden'></div>"
5599                );
5600            }
5601            if (is_safari) { } else {
5602                var current = jQuery("select.weekday").find("option:selected");
5603                var nextval = current.next();
5604                current.removeAttr("selected");
5605                nextval.attr("selected", "selected");
5606                jQuery("select.weekday").trigger("change.select2");
5607            }
5608        }
5609
5610        /* 2times */
5611    }
5612});
5613
5614jQuery(document).on("click", ".lp-dot-extra-buttons", function (e) {
5615    jQuery(this).find(".lp-user-menu").toggleClass("main");
5616});
5617
5618jQuery(document).ready(function () {
5619    jQuery(
5620        ".lp-secondary-btn.btn-second-hover.lp-secondary-choose.lp-claim-plan-btn"
5621    ).attr("disabled", true);
5622    jQuery(
5623        ".lp-secondary-btn.btn-second-hover.lp-secondary-choose.lp-claim-plan-btn"
5624    ).addClass("LPdisabled");
5625    if (jQuery(".form-group.lp-claim-form-check-circle input").is(":checked")) {
5626        jQuery(
5627            ".lp-secondary-btn.btn-second-hover.lp-secondary-choose.lp-claim-plan-btn"
5628        ).attr("disabled", false);
5629        jQuery(
5630            ".lp-secondary-btn.btn-second-hover.lp-secondary-choose.lp-claim-plan-btn"
5631        ).removeClass("LPdisabled");
5632    } else {
5633        jQuery(
5634            ".lp-secondary-btn.btn-second-hover.lp-secondary-choose.lp-claim-plan-btn"
5635        ).attr("disabled", true);
5636
5637        jQuery(
5638            ".lp-secondary-btn.btn-second-hover.lp-secondary-choose.lp-claim-plan-btn"
5639        ).addClass("LPdisabled");
5640    }
5641    jQuery(".form-group.lp-claim-form-check-circle input").click(function () {
5642        if (jQuery(".form-group.lp-claim-form-check-circle input").is(":checked")) {
5643            jQuery(
5644                ".lp-secondary-btn.btn-second-hover.lp-secondary-choose.lp-claim-plan-btn"
5645            ).attr("disabled", false);
5646            jQuery(
5647                ".lp-secondary-btn.btn-second-hover.lp-secondary-choose.lp-claim-plan-btn"
5648            ).removeClass("LPdisabled");
5649        } else {
5650            jQuery(
5651                ".lp-secondary-btn.btn-second-hover.lp-secondary-choose.lp-claim-plan-btn"
5652            ).attr("disabled", true);
5653            jQuery(
5654                ".lp-secondary-btn.btn-second-hover.lp-secondary-choose.lp-claim-plan-btn"
5655            ).addClass("LPdisabled");
5656        }
5657    });
5658});
5659jQuery("#pop").on("click", function (e) {
5660    e.preventDefault();
5661    jQuery("#imagemodal").modal("show"); // imagemodal is the id attribute assigned to the bootstrap modal, then i use the show function
5662    var img_src = jQuery(this).data("imgsrc");
5663    jQuery("#imagemodal").find("img").attr("src", img_src);
5664});
5665jQuery("#my_file").change(function () {
5666    var i = jQuery(this).prev("label").clone();
5667    var file = jQuery("#my_file")[0].files[0].name;
5668    jQuery(this).prev("label").text(file);
5669});
5670jQuery(document).ready(function () {
5671    if (jQuery(".payment-recurring-message").length > 0) {
5672        jQuery(document).on("change", ".lp-checkout-recurring-wrap", function () {
5673            var checkboxVal = jQuery(
5674                '.lp-checkout-recurring-wrap input[name="lp-recurring-option"]'
5675            ).is(":checked");
5676            if (checkboxVal === false) {
5677                jQuery(".payment-recurring-message").fadeOut("slow");
5678            }
5679        });
5680        jQuery(".rec_alert_remove").click(function () {
5681            jQuery(".payment-recurring-message").fadeOut("slow");
5682        });
5683    }
5684});
5685jQuery(document).on("clic
5685k", ".sidebar-filters-map-pop", function (e) {
5686    if (jQuery(".sidemap-container").hasClass("sidebar-filters-map-full")) {
5687        jQuery(".sidemap-container").removeClass("sidebar-filters-map-full");
5688        jQuery(this).text(jQuery(this).attr("data-full-map"));
5689    } else {
5690        jQuery(".sidemap-container").addClass("sidebar-filters-map-full");
5691        jQuery(this).text(jQuery(this).attr("data-close-map"));
5692        setTimeout(function () {
5693            jQuery(".all-list-map").trigger("click");
5694        }, 1000);
5695    }
5696});
5697/* new classic setting js  */
5698jQuery(document).ready(function () {
5699    jQuery(".classic-search .what-placeholder .down-search-q").click(function () {
5700        jQuery("#input-dropdown").toggleClass("active");
5701        jQuery(".classic-search .what-placeholder .down-search-q").toggleClass(
5702            "active"
5703        );
5704    });
5705    jQuery(
5706        ".classic-search .form-group.lp-suggested-search .lp-search-input.form-control.ui-autocomplete-input"
5707    ).click(function () {
5708        jQuery("#input-dropdown").addClass("active");
5709        jQuery(".classic-search .what-placeholder .down-search-q").addClass(
5710            "active"
5711        );
5712    });
5713    jQuery(function () {
5714        jQuery(document).click(function (e) {
5715            var target = e.target;
5716            if (
5717                !jQuery(target).is(".classic-search .what-placeholder") &&
5718                !jQuery(target).parents().is(".classic-search .what-placeholder")
5719            ) {
5720                jQuery(".classic-search .what-placeholder .down-search-q").removeClass(
5721                    "active"
5722                );
5723                jQuery(".classic-search #input-dropdown").removeClass("active");
5724            }
5725        });
5726    });
5727});
5728
5729jQuery(window).on("load", function () {
5730    if (jQuery(".lp-theme-loader").length > 0) {
5731        jQuery(".lp-theme-loader").css({
5732            opacity: "0",
5733            visibility: "hidden",
5734        });
5735    }
5736    jQuery(
5737        ".lp-home-banner-contianer .lp-search-bar .chosen-container .chosen-results"
5738    ).niceScroll();
5739    jQuery(
5740        ".lp-customize-header-outer.lp-color-header-style.lp-header-style-classic .lp-search-bar.lp-search-bar-header .chosen-drop .chosen-results"
5741    ).niceScroll();
5742});
5743jQuery(document).ready(function ($) {
5744    if ($(".lp-activities-classic-slider").length > 0) {
5745        $(".lp-activities-classic-slider").slick({
5746            dots: true,
5747            infinite: false,
5748            speed: 300,
5749            slidesToShow: 3,
5750            arrows: false,
5751            slidesToScroll: 1,
5752            responsive: [{
5753                breakpoint: 1024,
5754                settings: {
5755                    slidesToShow: 2,
5756                    slidesToScroll: 1,
5757                    infinite: true,
5758                    dots: true,
5759                },
5760            },
5761            {
5762                breakpoint: 600,
5763                settings: {
5764                    slidesToShow: 1,
5765                    slidesToScroll: 1,
5766                },
5767            },
5768            {
5769                breakpoint: 480,
5770                settings: {
5771                    slidesToShow: 1,
5772                    slidesToScroll: 1,
5773                },
5774            },
5775            ],
5776        });
5777    }
5778});

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.