PageSourceSearch

https://www.forestry.gov.jm/js/designesia.js

js forestry.gov.jm collected 2026-10-02 16:35:46 UTC 79,060 bytes, 2,184 lines download raw bytes

1 /* --------------------------------------------------
2  * © Copyright 2024 - Gardyn by Designesia
3  * --------------------------------------------------*/
4(function($) {
5	'use strict';
6
7    var rtl_mode = 'off'; // on - for enable RTL, off - for deactive RTL
8    var preloader = 'on'; // on - for enable preloader, off - for disable preloader
9    var header_autoshow = "off"; // on - for enable fixed header, off - for disable fixed header
10    var topbar = "on"; // on - for enable fixed topbar, off - for disable fixed topbar
11    var show_scroll_to_top = "on"; // on - for enable scroll to top button
12
13    /* predefined vars begin */
14    var mobile_menu_show = 0;
15    var v_count = '0';
16    var mb;
17    var instances = [];
18    var $window = $(window);
19	var $op_header_autoshow = 0;
20	var grid_size = 10;
21
22    // scroll magic begin
23    var new_scroll_position = 0;
24    var last_scroll_position;
25    var header = $("header");
26
27    /* predefined vars end */
28
29
30    if(topbar==="off"){
31        jQuery('#topbar').hide();
32    }
33
34    if(show_scroll_to_top==="off"){
35        jQuery("#back-to-top, .float-text, .scrollbar-v ").hide();
36    }
37
38
39    //jQuery('#buy-now, #back-to-top').hide();
40	 
41     /* --------------------------------------------------
42      * header | sticky
43      * --------------------------------------------------*/
44     function header_sticky() {
45         jQuery("header").addClass("clone", 1000, "easeOutBounce");
46         var $document = $(document);
47         var vscroll = 0;
48		 var header = jQuery("header.autoshow");
49         if ($document.scrollTop() >= 50 && vscroll === 0) {
50             header.removeClass("scrollOff");
51             header.addClass("scrollOn");
52             header.css("height", "auto");
53             vscroll = 1;
54         } else {
55             header.removeClass("scrollOn");
56             header.addClass("scrollOff");
57             vscroll = 0;
58         }
59     }
60     /* --------------------------------------------------
61      * plugin | magnificPopup
62      * --------------------------------------------------*/
63     function load_magnificPopup() {
64         jQuery('.simple-ajax-popup-align-top').magnificPopup({
65             type: 'ajax',
66             alignTop: true,
67             overflowY: 'scroll'
68         });
69         jQuery('.simple-ajax-popup').magnificPopup({
70             type: 'ajax'
71         });
72         // zoom gallery
73         jQuery('.zoom-gallery').magnificPopup({
74             delegate: 'a',
75             type: 'image',
76             closeOnContentClick: false,
77             closeBtnInside: false,
78             mainClass: 'mfp-with-zoom mfp-img-mobile',
79             image: {
80                 verticalFit: true,
81                 titleSrc: function(item) {
82                     return item.el.attr('title');
83                     //return item.el.attr('title') + ' &middot; <a class="image-source-link" href="'+item.el.attr('data-source')+'" target="_blank">image source</a>';
84                 }
85             },
86             gallery: {
87                 enabled: true
88             },
89             zoom: {
90                 enabled: true,
91                 duration: 300, // don't foget to change the duration also in CSS
92                 opener: function(element) {
93                     return element.find('img');
94                 }
95             }
96         });
97         // popup youtube, video, gmaps
98         jQuery('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({
99             disableOn: 700,
100             type: 'iframe',
101             mainClass: 'mfp-fade',
102             removalDelay: 160,
103             preloader: false,
104             fixedContentPos: false
105         });
106         // Initialize popup as usual
107         $('.image-popup').magnificPopup({
108             type: 'image',
109             mainClass: 'mfp-with-zoom', // this class is for CSS animation below
110
111             zoom: {
112                 enabled: true, // By default it's false, so don't forget to enable it
113
114                 duration: 300, // duration of the effect, in milliseconds
115                 easing: 'ease-in-out', // CSS transition easing function
116
117                 // The "opener" function should return the element from which popup will be zoomed in
118                 // and to which popup will be scaled down
119                 // By defailt it looks for an image tag:
120                 opener: function(openerElement) {
121                     // openerElement is the element on which popup was initialized, in this case its <a> tag
122                     // you don't need to add "opener" option if this code matches your needs, it's defailt one.
123                     return openerElement.is('img') ? openerElement : openerElement.find('img');
124                 }
125             }
126
127         });
128         $('.image-popup-vertical-fit').magnificPopup({
129             type: 'image',
130             closeOnContentClick: true,
131             mainClass: 'mfp-img-mobile',
132             image: {
133                 verticalFit: true
134             }
135         });
136         $('.image-popup-fit-width').magnificPopup({
137             type: 'image',
138             closeOnContentClick: true,
139             image: {
140                 verticalFit: false
141             }
142         });
143         $('.image-popup-no-margins').magnificPopup({
144             type: 'image',
145             closeOnContentClick: true,
146             closeBtnInside: false,
147             fixedContentPos: true,
148             mainClass: 'mfp-no-margins mfp-with-zoom', // class to remove default margin from left and right side
149             image: {
150                 verticalFit: true
151             },
152             zoom: {
153                 enabled: true,
154                 duration: 300 // don't foget to change the duration also in CSS
155             }
156         });
157         $('.image-popup-gallery').magnificPopup({
158             type: 'image',
159             closeOnContentClick: false,
160             closeBtnInside: false,
161             mainClass: 'mfp-with-zoom mfp-img-mobile',
162             image: {
163                 verticalFit: true,
164                 titleSrc: function(item) {
165                     return item.el.attr('title');
166                     //return item.el.attr('title') + ' &middot; <a class="image-source-link" href="'+item.el.attr('data-source')+'" target="_blank">image source</a>';
167                 }
168             },
169             gallery: {
170                 enabled: true
171             }
172         });
173         $('.images-group').each(function() { // the containers for all your galleries
174             $(this).magnificPopup({
175                 delegate: 'a', // the selector for gallery item
176                 type: 'image',
177                 gallery: {
178                     enabled: true
179                 }
180             });
181         });
182
183         $('.images-popup').magnificPopup({
184             delegate: 'a', // child items selector, by clicking on it popup will open
185             type: 'image'
186             // other options
187         });
188     }
189     /* --------------------------------------------------
190      * plugin | enquire.js
191      * --------------------------------------------------*/
192     function init_resize() {
193         enquire.register("screen and (min-width: 993px)", {
194             match: function() {
195                 mobile_menu_show = 1;
196             },
197             unmatch: function() {
198                 mobile_menu_show = 0;
199                 jQuery("#menu-btn").show();
200             }
201         });
202         enquire.register("screen and (max-width: 993px)", {
203             match: function() {
204                 $('header').addClass("header-mobile");
205				 var body = jQuery('body');
206                 if (body.hasClass('side-content')) {
207                     body.removeClass('side-layout');
208                 }
209             },
210             unmatch: function() {
211                 $('header').removeClass("header-mobile");
212				 var body = jQuery('body');
213                 if (body.hasClass('side-content')) {
214                     body.addClass('side-layout');
215                 }
216             }
217         });
218         init();
219         video_autosize();
220		 
221		 var header = $('header');
222         header.removeClass('smaller');
223         header.removeClass('logo-smaller');
224         header.removeClass('clone');
225
226         var mx = window.matchMedia("(max-width: 992px)");
227		 var osw = jQuery('.owl-slide-wrapper');
228         if (mx.matches) {			 
229             osw.find("img").css("height", $(window).innerHeight());
230             osw.find("img").css("width", "auto");
231			 if($op_header_autoshow===1){
232				 header.removeClass('autoshow');
233			 }
234			 
235         } else {
236             osw.find("img").css("width", "100%");
237             osw.find("img").css("height", "auto");
238			 if($op_header_autoshow===1){
239				 header.addClass('autoshow');
240			 }
241         }
242
243
244     };
245     /* --------------------------------------------------
246      * plugin | owl carousel
247      * --------------------------------------------------*/
248     function load_owl() {
249        jQuery("#items-carousel").owlCarousel({
250            center: false,
251            items:4,
252            rewind:true,
253            margin:25,
254            nav:true,
255            navText : ["<i class='fa fa-chevron-left'></i>","<i class='fa fa-chevron-right'></i>"],
256            dots:false,
257            responsive:{
258                1000:{
259                    items:4
260                },
261                600:{
262                    items:2
263                },
264                0:{
265                    items:1
266                }
267            }
268         });
269
270        jQuery("#item-carousel-big").owlCarousel({
271           center:true,
272           loop:true,
273           margin:0,
274           nav:false,
275           dots:false,
276           responsive:{
277               1000:{
278                   items:4
279               },
280               600:{
281                   items:2
282               },
283               0:{
284                   items:2
285               }
286           }
287        });
288
289        jQuery(".owl-2-cols").owlCarousel({
290           center:false,
291           loop:true,
292           margin:30,
293           nav:false,
294           dots:false,
295           responsive:{
296               1000:{
297                   items:2
298               },
299               600:{
300                   items:2
301               },
302               0:{
303                   items:1
304               }
305           }
306        });
307
308        jQuery(".owl-2-cols-no-margin").owlCarousel({
309           center:false,
310           loop:true,
311           margin:0,
312           nav:false,
313           dots:false,
314           responsive:{
315               1000:{
316                   items:2
317               },
318               600:{
319                   items:2
320               },
321               0:{
322                   items:1
323               }
324           }
325        });
326
327        jQuery(".owl-3-cols").owlCarousel({
328           center:false,
329           loop:true,
330           margin:30,
331           nav:false,
332           dots:false,
333           responsive:{
334               1000:{
335                   items:3
336               },
337               600:{
338                   items:2
339               },
340               0:{
341                   items:1
342               }
343           }
344        });
345
346        jQuery(".owl-4-cols").owlCarousel({
347           center:false,
348           loop:true,
349           margin:30,
350           nav:false,
351           dots:false,
352           responsive:{
353               1000:{
354                   items:4
355               },
356               600:{
357                   items:2
358               },
359               0:{
360                   items:1
361               }
362           }
363        });
364
365        jQuery(".owl-3-cols-autowidth").owlCarousel({
366           center:true,
367           loop:true,
368           autoWidth:true,
369           margin:0,
370           nav:false,
371           dots:false,
372           /*autoplay: true,
373            slideTransition: 'linear',
374            autoplayTimeout: 6000,
375            autoplaySpeed: 6000,
376            autoplayHoverPause: false,*/
377           responsive:{
378               1000:{
379                   items:4
380               },
381               600:{
382                   items:3
383               },
384               0:{
385                   items:1
386               }
387           }
388        });
389
390        jQuery(".owl-2-cols-center").owlCarousel({
391           center:true,
392           loop:true,
393           margin:30,
394           nav:false,
395           dots:false,
396           responsive:{
397               1000:{
398                   items:2
399               },
400               600:{
401                   items:2
402               },
403               0:{
404                   items:1
405               }
406           }
407        });
408
409        jQuery("#slider-carousel").owlCarousel({
410                loop: true,
411                items: 1,
412                dots: false,
413                thumbs: true,
414                thumbImage: true,
415                thumbContainerClass: 'owl-thumbs',
416                thumbItemClass: 'owl-thumb-item'
417            });
418
419         jQuery("#item-carousel-big").owlCarousel({
420            loop:true,
421            margin:25,
422            nav:false,
423            dots:false,
424            responsive:{
425                1000:{
426                    items:3
427                },
428                600:{
429                    items:2
430                },
431                0:{
432                    items:1
433                }
434            }
435         });
436
437         jQuery(".owl-single-dots").owlCarousel({
438            loop:true,
439            items: 1,
440            nav:false,
441            dots:true,
442         });
443
444         var owl = $('#item-carousel-big');
445         owl.owlCarousel();
446         $('.d-carousel .d-arrow-right').on("click", function() {
447             owl.trigger('next.owl.carousel');
448         })
449         $('.d-carousel .d-arrow-left').on("click", function() {
450             owl.trigger('prev.owl.carousel');
451         });
452
453         var owl_2 = $('#item-carousel-big-type-2');
454         owl_2.owlCarousel();
455         $('.d-carousel .d-arrow-right').on("click", function() {
456             owl_2.trigger('next.owl.carousel');
457         })
458         $('.d-carousel .d-arrow-left').on("click", function() {
459             owl_2.trigger('prev.owl.carousel');
460         });
461
462        jQuery(".rtl #testimonial-carousel").owlCarousel({
463            center: false,
464            loop:true,
465            margin:30,
466            rtl: true,
467            responsive:{
468                1000:{
469                    items:3
470                },
471                600:{
472                    items:1
473                },
474                0:{
475                    items:1
476                }
477            }
478         });
479		 
480         jQuery("#testimonial-carousel").owlCarousel({
481            center: false,
482			loop:true,
483			margin:25,
484			responsive:{
485				1200:{
486					items:4
487				},
488                1000:{
489                    items:3
490                },
491				600:{
492					items:2
493				},
494                0:{
495                    items:1
496                }
497			}
498         });
499
500         jQuery("#testimonial-carousel-2-cols").owlCarousel({
501            center: true,
502            loop:true,
503            margin:25,
504            responsive:{
505                1200:{
506                    items:2
507                },
508                1000:{
509                    items:2
510                },
511                600:{
512                    items:2
513                },
514                0:{
515                    items:1
516                }
517            }
518         });
519
520         jQuery("#testimonial-carousel-1-col").owlCarousel({
521            center: false,
522            loop:true,
523            margin:30,
524            responsive:{
525                1000:{
526                    items:1
527                },
528                600:{
529                    items:1
530                },
531                0:{
532                    items:1
533                }
534            }
535         });
536		 
537		 jQuery("#blog-carousel").owlCarousel({
538            center: false,
539			items:3,
540			loop:true,
541			margin:25,
542			responsive:{
543				1000:{
544					items:3
545				},
546				600:{
547					items:2
548				},
549				0:{
550					items:1
551				}
552			}
553         });
554		 
555		 jQuery("#owl-logo").owlCarousel({
556            center: false,
557			items:6,
558			loop:true,
559			dots: false,
560			margin:40,
561			autoplay:true,
562			autoplayTimeout:2000,
563			responsive:{
564				1000:{
565					items:5
566				},
567				600:{
568					items:4
569				},
570				0:{
571					items:2
572				}
573			}
574         });
575
576         jQuery("#owl-logo-4").owlCarousel({
577            center: false,
578            items:4,
579            loop:true,
580            dots: false,
581            margin:40,
582            autoplay:true,
583            autoplayTimeout:2000,
584            responsive:{
585                1000:{
586                    items:4
587                },
588                600:{
589                    items:4
590                },
591                0:{
592                    items:2
593                }
594            }
595         });
596		 
597         jQuery("#owl-logo-small").owlCarousel({
598            center: false,
599            items:4,
600            loop:true,
601            dots: false,
602            margin:10,
603            autoplay:true,
604            autoplayTimeout:2000,
605            responsive:{
606                1000:{
607                    items:4
608                },
609                600:{
610                    items:3
611                },
612                0:{
613                    items:2
614                }
615            }
616         });
617         
618
619		 jQuery(".project-carousel-4-nav").owlCarousel({
620            center: true,
621			items:4,
622			loop:true,
623			margin:15,
624			responsive:{
625				1000:{
626					items:4
627				},
628				600:{
629					items:3
630				},
631				0:{
632					items:1
633				}
634			}
635         });
636		 
637		 jQuery("#owl-features").owlCarousel({
638            center: true,
639			items:4,
640			loop:true,
641			dots: true,
642			margin:25,
643			autoplay:false,
644			autoplayTimeout:0,
645			responsive:{
646				1000:{
647					items:4
648				},
649				600:{
650					items:2
651				},
652				0:{
653					items:1
654				}
655			}
656         });
657		 
658         // Custom Navigation owlCarousel
659         $(".next").on("click", function() {
660             $(this).parent().parent().find('.blog-slide').trigger('owl.next');
661         });
662         $(".prev").on("click", function() {
663             $(this).parent().parent().find('.blog-slide').trigger('owl.prev');
664         });
665
666         jQuery('.owl-custom-nav').each(function() {
667             var owl = $('.owl-custom-nav').next();
668             var ow = parseInt(owl.css("height"), 10);
669             $(this).css("margin-top", (ow / 2) - 25);
670             owl.owlCarousel();
671             // Custom Navigation Events
672             $(".btn-next").on("click", function() {
673                 owl.trigger('owl.next');
674             });
675             $(".btn-prev").on("click", function() {
676                 owl.trigger('owl.prev');
677             });
678         });
679
680
681         // custom navigation for slider
682         var ows = $('#custom-owl-slider');
683         var arr = $('.owl-slider-nav');
684         var doc_height = $(window).innerHeight();
685         arr.css("top", (doc_height / 2) - 25);
686         ows.owlCarousel();
687         // Custom Navigation Events
688         arr.find(".next").on("click", function() {
689             ows.trigger('owl.next');
690         });
691         arr.find(".prev").on("click", function() {
692             ows.trigger('owl.prev');
693         });
694
695         jQuery(".owl-slide-wrapper").on("mouseenter", function() {
696             arr.find(".next").css("right", "40px");
697             arr.find(".prev").css("left", "40px");
698         }).on("mouseleave", function() {
699             arr.find(".next").css("right", "-50px");
700             arr.find(".prev").css("left", "-50px");
701         })
702     }
703     /* --------------------------------------------------
704      * plugin | isotope
705      * --------------------------------------------------*/
706     function filter_gallery() {
707         var $container = jQuery('#gallery');
708         $container.isotope({
709             itemSelector: '.item',
710             filter: '*'
711         });
712         jQuery('#filters a').on("click", function() {
713             var $this = jQuery(this);
714             if ($this.hasClass('selected')) {
715                 return false;
716             }
717             var $optionSet = $this.parents();
718             $optionSet.find('.selected').removeClass('selected');
719             $this.addClass('selected');
720             var selector = jQuery(this).attr('data-filter');
721             $container.isotope({
722                 filter: selector
723             });
724             return false;
725         });
726     }
727
728     function masonry() {
729         var $container = jQuery('.masonry');
730         $container.isotope({
731             itemSelector: '.item',
732         });
733         jQuery('#filters a').on("click", function() {
734             var $this = jQuery(this);
735             if ($this.hasClass('selected')) {
736                 return false;
737             }
738             var $optionSet = $this.parents();
739             $optionSet.find('.selected').removeClass('selected');
740             $this.addClass('selected');
741             var selector = jQuery(this).attr('data-filter');
742             $container.isotope({
743                 filter: selector
744             });
745             return false;
746         });
747     }
748     /* --------------------------------------------------
749      * plugin | fitvids
750      * --------------------------------------------------*/
751     /*!
752      * FitVids 1.0
753      *
754      * Copyright 2011, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
755      * Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
756      * Released under the WTFPL license - http://sam.zoy.org/wtfpl/
757      *
758      * Date: Thu Sept 01 18:00:00 2011 -0500
759      */
760     ! function(a) {
761         a.fn.fitVids = function(b) {
762             var c = {
763                     customSelector: null
764                 },
765                 d = document.createElement("div"),
766                 e = document.getElementsByTagName("base")[0] || document.getElementsByTagName("script")[0];
767             return d.className = "fit-vids-style", d.innerHTML = "&shy;<style> .fluid-width-video-wrapper { width: 100%; position: relative; padding: 0; } .fluid-width-video-wrapper iframe, .fluid-width-video-wrapper object, .fluid-width-video-wrapper embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } </style>", e.parentNode.insertBefore(d, e), b && a.extend(c, b), this.each(function() {
768                 var b = ["iframe[src*='player.vimeo.com']", "iframe[src*='www.youtube.com']", "iframe[src*='www.kickstarter.com']", "object", "embed"];
769                 c.customSelector && b.push(c.customSelector);
770                 var d = a(this).find(b.join(","));
771                 d.each(function() {
772                     var b = a(this);
773                     if (!("embed" === this.tagName.toLowerCase() && b.parent("object").length || b.parent(".fluid-width-video-wrapper").length)) {
774                         var c = "object" === this.tagName.toLowerCase() || b.attr("height") ? b.attr("height") : b.height(),
775                             d = b.attr("width") ? b.attr("width") : b.width(),
776                             e = c / d;
777                         if (!b.attr("id")) {
778                             var f = "fitvid" + Math.floor(999999 * Math.random());
779                             b.attr("id", f)
780                         }
781                         b.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top", 100 * e + "%"), b.removeAttr("height").removeAttr("width")
782                     }
783                 })
784             })
785         }
786     }(jQuery);
787     /* --------------------------------------------------
788      * back to top
789      * --------------------------------------------------*/
790     var scrollTrigger = 100; // px
791     var t = 0;
792
793     function backToTop() {
794         var scrollTop = $(window).scrollTop();
795         if (scrollTop > scrollTrigger) {
796             $('#back-to-top').addClass('show');
797             $('#back-to-top').removeClass('hide');
798             $('.show-on-scroll').addClass('show');
799             $('.show-on-scroll').removeClass('hide');
800             t = 1;
801         }
802
803         if (scrollTop < scrollTrigger && t === 1) {
804             $('#back-to-top').addClass('hide');
805             $('.show-on-scroll').addClass('hide');
806         }
807
808         $('#back-to-top').on('click', function(e) {
809             e.preventDefault();
810             $('html,body').stop(true).animate({
811                 scrollTop: 0
812             }, 700);
813         });
814     };
815     /* --------------------------------------------------
816      * plugin | scroll to
817      * --------------------------------------------------*/
818     /*!
819      * jquery.scrollto.js 0.0.1 - https://github.com/yckart/jquery.scrollto.js
820      * Scroll smooth to any element in your DOM.
821      *
822      * Copyright (c) 2012 Yannick Albert (http://yckart.com)
823      * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php).
824      * 2013/02/17
825      **/
826     $.scrollTo = $.fn.scrollTo = function(x, y, options) {
827         if (!(this instanceof $)) return $.fn.scrollTo.apply($('html, body'), arguments);
828
829         options = $.extend({}, {
830             gap: {
831                 x: 0,
832                 y: 0
833             },
834             animation: {
835                 easing: 'easeInOutExpo',
836                 duration: 600,
837                 complete: $.noop,
838                 step: $.noop
839             }
840         }, options);
841
842         return this.each(function() {
843
844             if (!jQuery('body').hasClass('side-layout')) {
845                 var h = 69;
846             } else {
847                 var h = 0;
848             }
849
850             var elem = $(this);
851             elem.stop().animate({
852                 scrollLeft: !isNaN(Number(x)) ? x : $(y).offset().left + options.gap.x,
853                 scrollTop: !isNaN(Number(y)) ? y : $(y).offset().top + options.gap.y - h // *edited
854             }, options.animation);
855         });
856     };
857     /* --------------------------------------------------
858      * counting number
859      * --------------------------------------------------*/
860     function de_counter() {
861         jQuery('.timer').each(function() {
862             var imagePos = jQuery(this).offset().top;
863             var topOfWindow = jQuery(window).scrollTop();
864             if (imagePos < topOfWindow + jQuery(window).height() && v_count === '0') {
865                 jQuery(function($) {
866                     // start all the timers
867                     jQuery('.timer').each(count);
868
869                     function count(options) {
870                         v_count = '1';
871                         var $this = jQuery(this);
872                         options = $.extend({}, options || {}, $this.data('countToOptions') || {});
873                         $this.countTo(options);
874                     }
875                 });
876             }
877         });
878     }
879     /* --------------------------------------------------
880      * progress bar
881      * --------------------------------------------------*/
882
883     function text_rotate() {
884         var quotes = $(".text-rotate-wrap .text-item");
885         var quoteIndex = -1;
886
887         function showNextQuote() {
888             ++quoteIndex;
889             quotes.eq(quoteIndex % quotes.length)
890                 .fadeIn(1)
891                 .delay(1500)
892                 .fadeOut(1, showNextQuote);
893         }
894
895         showNextQuote();
896
897     };
898     /* --------------------------------------------------
899      * custom background
900      * --------------------------------------------------*/
901     function custom_bg() {
902         $("body,div,section,span,form,img").css('background-color', function() {
903            if ($(this).is('[data-bgcolor]')) {
904                jQuery(this).addClass("bgcustom");
905            }
906             return jQuery(this).data('bgcolor');
907         });
908         $("body,div,section").css('background', function() {
909            if ($(this).is('[data-bgimage]')) {
910                jQuery(this).addClass("bgcustom");
911            }
912             return jQuery(this).data('bgimage');
913         });
914         $("body,div,section").css('background-size', function() {
915             return 'cover';
916         });
917
918         $("body,div,section").css('background-repeat', function() {
919             return 'no-repeat';
920         });
921     }
922     /* --------------------------------------------------
923      * custom elements
924      * --------------------------------------------------*/
925     function custom_elements() {
926         // --------------------------------------------------
927         // tabs
928         // --------------------------------------------------
929         jQuery('.de_tab').find('.de_tab_content > div').hide();
930         jQuery('.de_tab').find('.de_tab_content > div:first').show();
931         jQuery('li').find('.v-border').fadeTo(150, 0);
932         jQuery('li.active').find('.v-border').fadeTo(150, 1);
933         jQuery('.de_nav li').on("click", function() {
934             jQuery(this).parent().find('li').removeClass("active");
935             jQuery(this).addClass("active");
936             jQuery(this).parent().parent().find('.v-border').fadeTo(150, 0);
937             jQuery(this).parent().parent().find('.de_tab_content > div').hide();
938             var indexer = jQuery(this).index(); //gets the current index of (this) which is #nav li
939             jQuery(this).parent().parent().find('.de_tab_content > div:eq(' + indexer + ')').fadeIn(); //uses whatever index the link has to open the corresponding box 
940             jQuery(this).find('.v-border').fadeTo(150, 1);
941         });
942         // request quote function
943         var rq_step = 1;
944         jQuery('#request_form .btn-right').on("click", function() {
945             var rq_name = $('#rq_name').val();
946             var rq_email = $('#rq_email').val();
947             var rq_phone = $('#rq_phone').val();
948             if (rq_step === 1) {
949                 if (rq_name.length === 0) {
950                     $('#rq_name').addClass("error_input");
951                 } else {
952                     $('#rq_name').removeClass("error_input");
953                 }
954                 if (rq_email.length === 0) {
955                     $('#rq_email').addClass("error_input");
956                 } else {
957                     $('#rq_email').removeClass("error_input");
958                 }
959                 if (rq_phone.length === 0) {
960                     $('#rq_phone').addClass("error_input");
961                 } else {
962                     $('#rq_phone').removeClass("error_input");
963                 }
964             }
965             if (rq_name.length === 0 && rq_email.length === 0 && rq_phone.length === 0) {
966                 jQuery("#rq_step_1").hide();
967                 jQuery("#rq_step_2").fadeIn();
968             }
969         });
970         // --------------------------------------------------
971         // tabs
972         // --------------------------------------------------
973         jQuery('.de_review').find('.de_tab_content > div').hide();
974         jQuery('.de_review').find('.de_tab_content > div:first').show();
975         //jQuery('.de_review').find('.de_nav li').fadeTo(150,.5);
976         jQuery('.de_review').find('.de_nav li:first').fadeTo(150, 1);
977         jQuery('.de_nav li').on("click", function() {
978             jQuery(this).parent().find('li').removeClass("active");
979             //jQuery(this).parent().find('li').fadeTo(150,.5);
980             jQuery(this).addClass("active");
981             jQuery(this).fadeTo(150, 1);
982             jQuery(this).parent().parent().find('.de_tab_content > div').hide();
983             var indexer = jQuery(this).index(); //gets the current index of (this) which is #nav li
984             jQuery(this).parent().parent().find('.de_tab_content > div:eq(' + indexer + ')').show(); //uses whatever index the link has to open the corresponding box 
985         });
986         // --------------------------------------------------
987         // toggle
988         // --------------------------------------------------
989         jQuery(".toggle-list h2").addClass("acc_active");
990         jQuery(".toggle-list h2").toggle(function() {
991             jQuery(this).addClass("acc_noactive");
992             jQuery(this).next(".ac-content").slideToggle(200);
993         }, function() {
994             jQuery(this).removeClass("acc_noactive").addClass("acc_active");
995             jQuery(this).next(".ac-content").slideToggle(200);
996         })
997		 // --------------------------------------------------
998         // toggle
999         // --------------------------------------------------
1000         jQuery(".expand-custom .toggle").on("click", function() {
1001			 jQuery(this).stop().toggleClass("clicked");
1002             jQuery(this).stop().parent().parent().parent().find(".details").slideToggle(500);
1003         })
1004     }
1005     /* --------------------------------------------------
1006      * video autosize
1007      * --------------------------------------------------*/
1008     function video_autosize() {
1009         jQuery('.de-video-container').each(function() {
1010             var height_1 = jQuery(this).css("height");
1011             var height_2 = jQuery(this).find(".de-video-content").css("height");
1012             var newheight = (height_1.substring(0, height_1.length - 2) - height_2.substring(0, height_2.length - 2)) / 2;
1013             jQuery(this).find('.de-video-overlay').css("height", height_1);
1014             jQuery(this).find(".de-video-content").animate({
1015                 'margin-top': newheight
1016             }, 'fast');
1017         });
1018     }     
1019     /* --------------------------------------------------
1020      * add arrow for mobile menu
1021      * --------------------------------------------------*/
1022     function menu_arrow() {
1023         // mainmenu create span
1024         jQuery('#mainmenu li a').each(function() {
1025             if ($(this).next("ul").length > 0) {
1026                 $("<span></span>").insertAfter($(this));
1027             }
1028         });
1029         // mainmenu arrow click
1030         jQuery("#mainmenu > li > span").on("click", function() {
1031             
1032             var iteration = $(this).data('iteration') || 1;
1033             switch (iteration) {
1034                 case 1:
1035                     $(this).addClass("active");
1036                     $(this).parent().find("ul:first").css("height", "auto");
1037                     var curHeight = $(this).parent().find("ul:first").height();
1038                     $(this).parent().find("ul:first").css("height", "0");
1039                     $(this).parent().find("ul:first").animate({
1040                         'height': curHeight
1041                     }, 300, 'easeOutQuint');
1042                     break;
1043                 case 2:
1044					var curHeight = $(this).parent().find("ul:first").height();
1045                     $(this).removeClass("active");
1046                     $(this).parent().find("ul:first").animate({
1047                         'height': "0"
1048                     }, 300, 'easeOutQuint');
1049                     break;
1050             }
1051             iteration++;
1052             if (iteration > 2) iteration = 1;
1053             $(this).data('iteration', iteration);
1054         });
1055         jQuery("#mainmenu > li > ul > li > span").on("click", function() {
1056             var iteration = $(this).data('iteration') || 1;
1057             switch (iteration) {
1058                 case 1:
1059                     $(this).addClass("active");
1060                     $(this).parent().find("ul:first").css("height", "auto");
1061                     $(this).parent().parent().parent().find("ul:first").css("height", "auto");
1062                     var curHeight = $(this).parent().find("ul:first").height();
1063                     $(this).parent().find("ul:first").css("height", "0");
1064                     $(this).parent().find("ul:first").animate({
1065                         'height': curHeight
1066                     }, 400, 'easeInOutQuint');
1067                     break;
1068                 case 2:
1069                     $(this).removeClass("active");
1070                     $(this).parent().find("ul:first").animate({
1071                         'height': "0"
1072                     }, 400, 'easeInOutQuint');
1073                     break;
1074             }
1075             iteration++;
1076             if (iteration > 2) iteration = 1;
1077             $(this).data('iteration', iteration);
1078         });
1079
1080         jQuery(".de-country .d-title").on("click", function() {
1081             var iteration = $(this).data('iteration') || 1;
1082             
1083             switch (iteration) {
1084                 case 1:
1085                     jQuery(this).parent().addClass("expand");
1086                     break;
1087                 case 2:
1088                     jQuery(this).parent().removeClass("expand");
1089                     break;
1090             }
1091             iteration++;
1092             if (iteration > 2) iteration = 1;
1093             $(this).data('iteration', iteration);
1094         });
1095
1096         jQuery("#de-click-menu-profile").on("click", function() {
1097             var iteration = $(this).data('iteration') || 1;
1098             
1099             switch (iteration) {
1100                 case 1:
1101                     $('#de-submenu-profile').show();
1102                     $('#de-submenu-profile').addClass('open');
1103                     $('#de-submenu-notification').removeClass('open');
1104                     $('#de-submenu-notification').hide();
1105                     $('#de-click-menu-notification').data('iteration', 1);
1106                     break;
1107                 case 2:
1108                     $('#de-submenu-profile').removeClass('open');
1109                     $('#de-submenu-profile').hide();        
1110                     break;
1111             }
1112             iteration++;
1113             if (iteration > 2) iteration = 1;
1114             $(this).data('iteration', iteration);
1115         });
1116
1117
1118         jQuery("#de-click-menu-notification").on("click", function() {
1119             var iteration = $(this).data('iteration') || 1;
1120             
1121             switch (iteration) {
1122                 case 1:
1123                     $('#de-submenu-notification').show();
1124                     $('#de-submenu-notification').addClass('open');
1125                     $('#de-submenu-profile').removeClass('open');
1126                     $('#de-submenu-profile').hide();
1127                     $('#de-click-menu-profile').data('iteration', 1);
1128                     break;
1129                 case 2:
1130                     $('#de-submenu-notification').removeClass('open');
1131                     $('#de-submenu-notification').hide();        
1132                     break;
1133             }
1134             iteration++;
1135             if (iteration > 2) iteration = 1;
1136             $(this).data('iteration', iteration);
1137         });
1138     }
1139     /* --------------------------------------------------
1140      * show gallery item sequence
1141      * --------------------------------------------------*/
1142     function sequence() {
1143         var sq = jQuery(".sequence > .gallery-item .de-item,.sequence > .gallery-item .d_demo_img");
1144         var count = sq.length;
1145		 sq.addClass("fadeInRight");
1146         sq.find("img").addClass("slideInUp");
1147         for (var i = 0; i <= count; i++) {
1148             var sqx = jQuery(".sequence > .gallery-item:eq(" + i + ") .de-item");
1149			 sqx.attr('data-wow-delay', (i / 8) + 's');
1150             sqx.find("img").attr('data-wow-delay', (i / 16) + 's');
1151         }
1152     }
1153     /* --------------------------------------------------
1154      * show gallery item sequence
1155      * --------------------------------------------------*/
1156     function sequence_a() {
1157         var sq = jQuery(".sequence").find(".sq-item");
1158         var count = sq.length;
1159         sq.addClass("fadeInUp");
1160         for (var i = 0; i <= count; i++) {
1161             var sqx = jQuery(".sequence").find(".sq-item:eq(" + i + ")");
1162             sqx.attr('data-wow-delay', (i / 8) + 's');
1163			 sqx.attr('data-wow-speed', '1s');
1164         }
1165     }
1166     /* --------------------------------------------------
1167      * custom scroll
1168      * --------------------------------------------------*/
1169     $.fn.moveIt = function() {
1170         $(this).each(function() {
1171             instances.push(new moveItItem($(this)));
1172         });
1173     }
1174
1175     function moveItItemNow() {
1176         var scrollTop = $window.scrollTop();
1177         instances.forEach(function(inst) {
1178             inst.update(scrollTop);
1179         });
1180     }
1181
1182     function moveItItem(el) {
1183         this.el = $(el);
1184         this.speed = parseInt(this.el.attr('data-scroll-speed'));
1185     };
1186     moveItItem.prototype.update = function(scrollTop) {
1187         var pos = scrollTop / this.speed;
1188         this.el.css('transform', 'translateY(' + pos + 'px)');
1189     };
1190     $(function() {
1191         $('[data-scroll-speed]').moveIt();
1192     });
1193     /* --------------------------------------------------
1194      * multiple function
1195      * --------------------------------------------------*/
1196     function init() {
1197         var sh = jQuery('#de-sidebar').css("height");
1198         var dh = jQuery(window).innerHeight();
1199         var h = parseInt(sh) - parseInt(dh);
1200
1201         function scrolling() {
1202             var mq = window.matchMedia("(min-width: 993px)");
1203             var ms = window.matchMedia("(min-width: 768px)");
1204             if (mq.matches) {
1205                 var distanceY = window.pageYOffset || document.documentElement.scrollTop,
1206                     shrinkOn = 0,
1207                     header = jQuery("header");
1208                 if (distanceY > shrinkOn) {
1209                     header.addClass("smaller");
1210                 } else {
1211                     if (header.hasClass('smaller')) {
1212                         header.removeClass('smaller');
1213                     }
1214                 }
1215             }
1216             if (mq.matches) {
1217                 if (jQuery("header").hasClass("side-header")) {
1218                     if (jQuery(document).scrollTop() >= h) {
1219                         jQuery('#de-sidebar').css("position", "fixed");
1220                         if (parseInt(sh) > parseInt(dh)) {
1221                             jQuery('#de-sidebar').css("top", -h);
1222                         }
1223                         jQuery('#main').addClass("col-md-offset-3");
1224                         jQuery('h1#logo img').css("padding-left", "7px");
1225                         jQuery('header .h-content').css("padding-left", "7px");
1226                         jQuery('#mainmenu li').css("width", "103%");
1227                     } else {
1228                         jQuery('#de-sidebar').css("position", "relative");
1229                         if (parseInt(sh) > parseInt(dh)) {
1230                             jQuery('#de-sidebar').css("top", 0);
1231                         }
1232                         jQuery('#main').removeClass("col-md-offset-3");
1233                         jQuery('h1#logo img').css("padding-left", "0px");
1234                         jQuery('header .h-content').css("padding-left", "0px");
1235                         jQuery('#mainmenu li').css("width", "100%");
1236                     }
1237                 }
1238
1239             }
1240         }
1241
1242         // --------------------------------------------------
1243         // looping background
1244         // --------------------------------------------------
1245
1246         scrolling();
1247
1248
1249         jQuery(".activity-filter > li").on("click", function() {
1250             var iteration = $(this).data('iteration') || 1;
1251             switch (iteration) {
1252                 case 1:
1253                    jQuery('.activity-list > li').hide();                    
1254                    if(jQuery(this).hasClass("filter_by_followings")){                        
1255                        jQuery('li.act_follow').show();
1256                    }else if(jQuery(this).hasClass("filter_by_sales")){                        
1257                        jQuery('li.act_sale').show();
1258                    }else if(jQuery(this).hasClass("filter_by_offers")){                        
1259                        jQuery('li.act_offer').show();
1260                    }else if(jQuery(this).hasClass("filter_by_likes")){                        
1261                        jQuery('li.act_like').show();
1262                    };
1263                    jQuery('.activity-filter > li').removeClass('active');
1264                    jQuery(this).addClass('active');
1265                    break;
1266                 case 2:
1267                     
1268                     break;
1269             }
1270             iteration++;
1271             if (iteration > 2) iteration = 1;
1272             $(this).data('iteration', iteration);
1273         });
1274
1275         jQuery(".filter__r").on("click", function() {
1276            jQuery('.activity-filter > li').removeClass('active');
1277            jQuery('.activity-list > li').show();   
1278         });
1279
1280         jQuery(".btn-close").on("click", function() {
1281             var iteration = $(this).data('iteration') || 1;
1282             switch (iteration) {
1283                 case 1:
1284                     jQuery('#popup-box').addClass('popup-hide');
1285                     jQuery('#popup-box').removeClass('popup-show');
1286                     break;
1287                 case 2:
1288
1289                     break;
1290             }
1291             iteration++;
1292             if (iteration > 2) iteration = 1;
1293             $(this).data('iteration', iteration);
1294         });
1295
1296         jQuery('#extra-content').addClass('wow');
1297
1298         jQuery("#btn-extra, #btn-cart").on("click", function() {
1299            jQuery('#extra-wrap').addClass('open');
1300            //jQuery('body').addClass('no-scroll');
1301            jQuery('#extra-content').addClass('fadeInRight');
1302         });
1303
1304         jQuery("#btn-close").on("click", function() {
1305            jQuery('#extra-wrap').removeClass('open');
1306            //jQuery('body').removeClass('no-scroll');
1307            jQuery('#extra-content').removeClass('fadeInRight');
1308         });
1309         
1310     }
1311
1312
1313	 
1314     // rtl begin //
1315      if (rtl_mode==="on") {
1316            jQuery("body").addClass('rtl');
1317            jQuery("#bootstrap").attr("href", 'css/bootstrap.rtl.min.css');
1318            jQuery("#bootstrap-grid").attr("href", 'css/bootstrap-grid.rtl.min.css');
1319            jQuery("#bootstrap-reboot").attr("href", 'css/bootstrap-reboot.rtl.min.css');
1320            jQuery("#mdb").attr("href", 'css/mdb.rtl.min.css');
1321            jQuery('html').attr("dir","rtl")
1322        };
1323     // rtl end // 
1324
1325     if(preloader==="off"){
1326            jQuery("#de-loader").hide();
1327     }
1328
1329     function f_rtl(){
1330         jQuery("#selector #demo-rtl").on("click", function() {
1331            var iteration = $(this).data('iteration') || 1;
1332             switch (iteration) {
1333                 case 1:
1334                     jQuery("body").addClass('rtl');
1335                     jQuery("#bootstrap").attr("href", 'css/bootstrap.rtl.min.css');
1336                     jQuery("#bootstrap-grid").attr("href", 'css/bootstrap-grid.rtl.min.css');
1337                     jQuery("#bootstrap-reboot").attr("href", 'css/bootstrap-reboot.rtl.min.css');
1338                     jQuery("#mdb").attr("href", 'css/mdb.rtl.min.css');
1339                     jQuery('html').attr("dir","rtl");
1340                     jQuery(this).find(".sc-val").text('Click to Disable');
1341                     break;
1342                 case 2:
1343                    jQuery("body").removeClass('rtl');
1344                    jQuery("#bootstrap").attr("href", 'css/bootstrap.min.css');
1345                    jQuery("#bootstrap-grid").attr("href", 'css/bootstrap-grid.min.css');
1346                    jQuery("#bootstrap-reboot").attr("href", 'css/bootstrap-reboot.min.css');
1347                    jQuery("#mdb").attr("href", 'css/mdb.min.css');
1348                    jQuery('html').attr("dir","ltr");
1349                    jQuery(this).find(".sc-val").text('Click to Enable');
1350                    break;
1351             }
1352             iteration++;
1353             if (iteration > 2) iteration = 1;
1354             $(this).data('iteration', iteration);
1355         });
1356     }
1357
1358     jQuery("#dark-mode").on("click", function() {
1359        if(jQuery('body').hasClass('dark-scheme')){
1360            window.location.href = 'https://www.designesia.com/themes/gospace/index.html';
1361        }else{
1362            window.location.href = 'https://www.designesia.com/themes/gospace/02_dark-index.html';
1363        }
1364     });
1365
1366	 function grid_gallery() {
1367            jQuery('.grid-item').each(function () {
1368                var this_col = Number(jQuery(this).parent().attr('data-col'));
1369                var this_gridspace = Number(jQuery(this).parent().attr('data-gridspace'));
1370                var this_ratio = eval($(this).parent().attr('data-ratio'));
1371                jQuery(this).parent().css('padding-left', this_gridspace);
1372                var w = (($(document).width() - (this_gridspace * this_col + 1)) / this_col) - (this_gridspace / this_col);
1373                var gi = $(this);
1374                var h = w * this_ratio;
1375                gi.css('width', w)
1376                gi.css('height', h);
1377                gi.find(".pf_title").css('margin-top', (h / 2) - 10);
1378                gi.css('margin-right', this_gridspace);
1379                gi.css('margin-bottom', this_gridspace);
1380				$(this).parent().css('padding-top',this_gridspace);
1381                if (gi.hasClass('large')) {
1382                    $(this).css('width', (w * 2) + this_gridspace);
1383                    $(this).css('height', (h * 2) + this_gridspace);
1384                }
1385                if (gi.hasClass('large-width')) {
1386                    $(this).css('width', (w * 2) + this_gridspace);
1387                    $(this).css('height', h);
1388                }
1389                if (gi.hasClass('large-height')) {
1390                    $(this).css('height', (h * 2) + this_gridspace);
1391                    gi.find(".pf_title").css('margin-top', (h) - 20);
1392                }
1393            })
1394        }
1395
1396     /* --------------------------------------------------
1397      * center-y
1398      * --------------------------------------------------*/
1399     function centerY() {
1400         jQuery('.full-height').each(function() {
1401             var dh = jQuery(window).innerHeight();
1402             jQuery(this).css("min-height", dh);
1403         });
1404     }
1405
1406     /* --------------------------------------------------
1407      * progress bar
1408      * --------------------------------------------------*/
1409     function de_progress() {
1410         jQuery('.de-progress').each(function() {
1411             var pos_y = jQuery(this).offset().top;
1412             var value = jQuery(this).find(".progress-bar").attr('data-value');
1413             var topOfWindow = jQuery(window).scrollTop();
1414             if (pos_y < topOfWindow + 550) {
1415                 jQuery(this).find(".progress-bar").css({
1416                     'width': value
1417                 }, "slow");
1418             }
1419
1420             jQuery(this).find('.value').text(jQuery(this).find('.progress-bar').attr('data-value'));
1421         });
1422     }
1423
1424     function de_countdown() {
1425         $('.de_countdown').each(function() {
1426             var y = $(this).data('year');
1427             var m = $(this).data('month');
1428             var d = $(this).data('day');
1429             var h = $(this).data('hour');
1430             $(this).countdown({until: new Date(y, m-1, d, h)});
1431         });
1432    }
1433
1434    // --------------------------------------------------
1435    // custom dropdown
1436    // --------------------------------------------------   
1437    function dropdown(e){
1438        var obj = $(e+'.dropdown');
1439        var btn = obj.find('.btn-selector');
1440        var dd = obj.find('ul');
1441        var opt = dd.find('li');
1442        
1443            obj.on("mouseenter", function() {
1444                dd.show();
1445            }).on("mouseleave", function() {
1446                dd.hide();
1447            })
1448            
1449            opt.on("click", function() {
1450                dd.hide();
1451                var txt = $(this).text();
1452                opt.removeClass("active");
1453                $(this).addClass("active");
1454                btn.text(txt);
1455            });
1456    }
1457
1458    function de_sidebar(){
1459        enquire.register("screen and (min-width: 993px)", {
1460             match: function() {
1461                if ($('.sidebar_inner').length){
1462                     $('.sidebar_inner').sticky({
1463                         top: 130,
1464                         bottom: 20,
1465                         stopOn: 'footer',
1466                         disableOn: 993
1467                     });
1468                };
1469
1470                if ($('#search_location').length){
1471                     $('#search_location').sticky({
1472                         top: 130,
1473                         bottom: 20,
1474                         stopOn: 'footer',
1475                         disableOn: 993
1476                     });
1477                };
1478            }
1479         });
1480    }
1481
1482    function de_share(){
1483        var url = window.location.href;
1484        $('.fa-twitter').on("click", function() { window.open('https://twitter.com/share?url='+url,'_blank'); });
1485        $('.fa-facebook').on("click", function() { window.open('https://www.facebook.com/sharer/sharer.php?u='+url,'_blank'); });
1486        $('.fa-reddit').on("click", function() { window.open('http://www.reddit.com/submit?url='+url,'_blank'); });
1487        $('.fa-linkedin').on("click", function() { window.open('https://www.linkedin.com/shareArticle?mini=true&url='+url,'_blank'); });
1488        $('.fa-pinterest').on("click", function() { window.open('https://www.pinterest.com/pin/create/button/?url='+url,'_blank'); });
1489        $('.fa-stumbleupon').on("click", function() { window.open('http://www.stumbleupon.com/submit?url='+url,'_blank'); });
1490        $('.fa-delicious').on("click", function() { window.open('https://delicious.com/save?v=5&noui&jump=close&url='+url,'_blank'); });
1491        $('.fa-envelope').on("click", function() { window.open('mailto:?subject=Share With Friends&body='+url,'_blank'); });
1492
1493    }
1494
1495     /* --------------------------------------------------
1496      * document ready
1497      * --------------------------------------------------*/
1498     $(function(){
1499        $('#de-loader').prepend($('<div class="lds-roller"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>'));
1500         'use strict';
1501         f_rtl();
1502         load_magnificPopup();
1503		 grid_gallery();
1504         init_resize();
1505         de_progress();
1506         de_countdown();
1507         dropdown('#item_category');
1508         dropdown('#item_collection');
1509         dropdown('#buy_category');
1510         dropdown('#items_type');
1511         dropdown('#filter_by_duration');
1512         dropdown('#filter_by_category');
1513         de_sidebar();
1514         de_share();         
1515         load_owl();  
1516         $(".jarallax").jarallax();
1517         //skrollr.init();
1518
1519        $(function() {
1520            $('.lazy').lazy();
1521        });
1522
1523        // switch
1524
1525        $('.opt-2').css('display','none');
1526
1527         $("#sw-1").on("click", function() {
1528            if($(this).is(":checked")){
1529                $('.opt-1').css('display','none');
1530                $('.opt-2').css('display','inline-block');
1531            }else{
1532                $('.opt-2').css('display','none');
1533                $('.opt-1').css('display','inline-block');
1534            }
1535        });
1536
1537         /* detepicker */
1538         
1539         $('#date-picker').daterangepicker({
1540                 "showISOWeekNumbers": true,
1541                 "timePicker": false,
1542                 "autoUpdateInput": true,
1543                 "locale": {
1544                     "format": "MMM DD",
1545                     "separator": " - ",
1546                     "applyLabel": "Apply",
1547                     "cancelLabel": "Cancel",
1548                     "fromLabel": "From",
1549                     "toLabel": "To",
1550                     "customRangeLabel": "Custom",
1551                     "weekLabel": "W",
1552                     "daysOfWeek": [
1553                         "Su",
1554                         "Mo",
1555                         "Tu",
1556                         "We",
1557                         "Th",
1558                         "Fr",
1559                         "Sa"
1560                     ],
1561                     "monthNames": [
1562                         "January",
1563                         "February",
1564                         "March",
1565                         "April",
1566                         "May",
1567                         "June",
1568                         "July",
1569                         "August",
1570                         "September",
1571                         "October",
1572                         "November",
1573                         "December"
1574                     ],
1575                     "firstDay": 1
1576                 },
1577                 "linkedCalendars": true,
1578                 "showCustomRangeLabel": false,
1579                 "startDate": 1,
1580                 "endDate": moment().startOf('hour').add(24, 'hour'),
1581                 "opens": "right"
1582             });
1583
1584         /* de-number begin */
1585
1586        $('.d-minus').on("click", function () {
1587            var $input = $(this).parent().find('input');
1588            var count = parseInt($input.val()) - 1;
1589            count = count < 0 ? 0 : count;
1590            $input.val(count);
1591            $input.change();
1592            return false;
1593        });
1594        $('.d-plus').on("click", function () {
1595            var $input = $(this).parent().find('input');
1596            var count = parseInt($input.val()) + 1;
1597            count = count > 10 ? 10 : count;
1598             $input.val(count);
1599            $input.change();
1600            return false;
1601        });
1602        /* de-number close */
1603
1604        /* copy elements */
1605
1606        var e = $('.select-room');
1607        var room_count = 10;
1608        var d_copy;
1609           for (var i = room_count; i > 1; i--) {
1610             e.clone().attr('id', 'room-'+ i).insertAfter(e);
1611           }
1612        
1613
1614        for (var n = 0; n <= room_count; n++) {
1615          $("#room-" + n).hide();
1616          $("#room-" + n).find("select").attr('id', 'room-type'+ n);
1617          $("#room-" + n).find("select").attr('name', 'Room Type '+ n);
1618          $("#room-" + n).find("select").attr('disabled',true);
1619          $("#room-" + n).find("h4").text("Select Room #" + n);
1620        }
1621
1622        $('#d-room-count .d-minus').on("click", function () {
1623           var $value = parseInt($('#room-count').val())+1;
1624            $("#room-" + $value).hide();
1625            $("#room-" + n).find("select").attr('disabled',true);
1626        });
1627
1628        $('#d-room-count .d-plus').on("click", function () {
1629            var $value = parseInt($('#room-count').val());
1630            for (var n = 1; n <= $value; n++) {
1631              $("#room-" + n).show();
1632              $("#room-" + n).find("select").attr('disabled',false);
1633            }
1634        });
1635
1636            function owlnavcenter(){
1637             jQuery('.owl-custom-nav').each(function () {
1638                 var owl = $($(this).data('target'));
1639
1640                 owl.owlCarousel();
1641
1642                 // Custom Navigation Events
1643                 $(".btn-next").on("click", function () {
1644                     owl.trigger('next.owl.carousel');
1645                 });
1646                 $(".btn-prev").on("click", function () {
1647                     owl.trigger('prev.owl.carousel');
1648                 });
1649             });
1650            }
1651            
1652            owlnavcenter();
1653         
1654         // marquee end
1655
1656         // --------------------------------------------------
1657         // custom positiion
1658         // --------------------------------------------------
1659         var $doc_height = jQuery(window).innerHeight();
1660         jQuery('#homepage #content.content-overlay').css("margin-top", $doc_height);
1661         //jQuery('.full-height').css("height", $doc_height);
1662         //var picheight = jQuery('.center-y').css("height");
1663         //picheight = parseInt(picheight, 10);
1664         //jQuery('.center-y').css('margin-top', (($doc_height - picheight) / 2)-100);
1665         jQuery('.full-height .de-video-container').css("min-height", $doc_height);
1666
1667		 
1668		if(jQuery('header').hasClass("autoshow")){
1669			$op_header_autoshow = 1;
1670		}
1671
1672        
1673        $('#mainmenu > li:has(ul)').addClass('menu-item-has-children');
1674
1675        $(".d-item").slice(0, 8).show();
1676          $("#loadmore").on("click", function(e){
1677            e.preventDefault();
1678            $(".d-item:hidden").slice(0, 4).slideDown();
1679            if($(".d-item:hidden").length === 0) {
1680              //$("#loadmore").text("No Content").addClass("noContent");
1681              $("#loadmore").hide();
1682            }
1683        });
1684
1685         centerY();
1686
1687         $('#mainmenu li:has(ul)').addClass('has-child');
1688
1689         // bootstrap
1690         var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
1691         var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
1692           return new bootstrap.Tooltip(tooltipTriggerEl)
1693         })
1694
1695         var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'))
1696         var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
1697           return new bootstrap.Popover(popoverTriggerEl)
1698         })
1699
1700         // close bootstrap
1701
1702         // --------------------------------------------------
1703         // blog list hover
1704         // --------------------------------------------------
1705         jQuery(".blog-list").on("mouseenter", function() {
1706             var v_height = jQuery(this).find(".blog-slide").css("height");
1707             var v_width = jQuery(this).find(".blog-slide").css("width");
1708             var newheight = (v_height.substring(0, v_height.length - 2) / 2) - 40;
1709			 var owa = jQuery(this).find(".owl-arrow");
1710             owa.css("margin-top", newheight);
1711             owa.css("width", v_width);
1712             owa.fadeTo(150, 1);
1713             //alert(v_height);
1714         }).on("mouseleave", function() {
1715             jQuery(this).find(".owl-arrow").fadeTo(150, 0);
1716         })
1717         // carousel hover
1718         jQuery(".d-carousel").on("mouseenter", function() {
1719             jQuery('.d-arrow-left').fadeTo(50, 1);
1720             jQuery('.d-arrow-right').fadeTo(50, 1);
1721         }).on("mouseleave", function() {
1722             jQuery('.d-arrow-left').fadeTo(50, 0);
1723             jQuery('.d-arrow-right').fadeTo(50, 0);
1724         })
1725
1726         function formatState (state) {
1727           if (!state.id) { return state.text; }
1728           var $state = $(
1729             '<span><img src="' + $(state.element).attr('data-src') + '" class="img-flag" /> ' + state.text + '</span>'
1730           );
1731           return $state;
1732         };
1733
1734         $('.room-type').select2({
1735           minimumResultsForSearch: Infinity,
1736           templateResult: formatState,
1737           templateSelection: formatState,
1738           width: '100%'
1739         });
1740         
1741         // --------------------------------------------------
1742         // navigation for mobile
1743         // --------------------------------------------------
1744         jQuery('#menu-btn').on("click", function() {
1745
1746            var h = jQuery('header')[0].scrollHeight;
1747			
1748             if (mobile_menu_show === 0) {
1749                 jQuery('header').addClass('menu-open');
1750                 jQuery('header').css('height',$(window).innerHeight());
1751                 mobile_menu_show = 1;
1752                 jQuery(this).addClass("menu-open");
1753             } else {
1754                jQuery('header').removeClass('menu-open');
1755                jQuery('header').css('height','auto');
1756                 mobile_menu_show = 0;
1757                 jQuery(this).removeClass("menu-open");
1758             }
1759         })
1760         jQuery("a.btn").on("click", function(evn) {
1761             if (this.href.indexOf('#') === -1) {
1762                 evn.preventDefault();
1763                 jQuery('html,body').scrollTo(this.hash, this.hash);
1764             }
1765         });
1766         // btn arrow up
1767         jQuery(".arrow-up").on("click", function() {
1768             jQuery(".coming-soon .coming-soon-content").fadeOut("medium", function() {
1769                 jQuery("#hide-content").fadeIn(600, function() {
1770                     jQuery('.arrow-up').animate({
1771                         'bottom': '-40px'
1772                     }, "slow");
1773                     jQuery('.arrow-down').animate({
1774                         'top': '0'
1775                     }, "slow");
1776                 });
1777             });
1778         });
1779         // btn arrow down
1780         jQuery(".arrow-down").on("click", function() {
1781             jQuery("#hide-content").fadeOut("slow", function() {
1782                 jQuery(".coming-soon .coming-soon-content").fadeIn(800, function() {
1783                     jQuery('.arrow-up').animate({
1784                         'bottom': '0px'
1785                     }, "slow");
1786                     jQuery('.arrow-down').animate({
1787                         'top': '-40'
1788                     }, "slow");
1789                 });
1790             });
1791         });
1792         /* --------------------------------------------------
1793          after window load
1794          * --------------------------------------------------*/
1795		 
1796        setTimeout(function () {
1797        $("#cookieConsent").fadeIn(400);
1798         }, 2000);
1799        $("#closeCookieConsent, .cookieConsentOK").on("click", function() {
1800            $("#cookieConsent").fadeOut(400);
1801        });
1802
1803        $(".switch-with-title .checkbox").change(function() {
1804            if(this.checked) {
1805                jQuery(this).parent().parent().find('.hide-content').show();
1806            }else{
1807                jQuery(this).parent().parent().find('.hide-content').hide();
1808            }
1809        });
1810
1811         video_autosize();
1812         custom_bg();
1813         menu_arrow();
1814         custom_elements();
1815         init(); 
1816         
1817         new WOW().init();
1818
1819         
1820         // one page navigation
1821         /**
1822          * This part causes smooth scrolling using scrollto.js
1823          * We target all a tags inside the nav, and apply the scrollto.js to it.
1824          */
1825         $("#homepage nav a, .scroll-to").on("click", function(evn) {
1826             if (this.href.indexOf('#') === -1) {
1827                 evn.preventDefault();
1828                 jQuery('html,body').scrollTo(this.hash, this.hash);
1829             }
1830         });
1831         sequence();
1832         sequence_a();
1833
1834         // product click notification begin
1835         $("<div/>").attr('id','de_notif').appendTo('body');
1836
1837         function de_atc(n) {
1838             $("#de_notif").html(n);
1839         };
1840
1841         jQuery(".de__pcard .atr__wish-list").on("click", function () {
1842             
1843            var iteration = $(this).data('iteration') || 1;
1844            
1845            switch (iteration) {
1846                case 1:
1847                     jQuery(this).addClass("active");
1848                     $("#de_notif").removeClass("active");
1849                     de_atc('Product added to wishlist');
1850                     $("#de_notif").addClass("active");
1851                     setTimeout(function() {
1852                         $("#de_notif").removeClass("active");
1853                     }, 1500);
1854                     break;
1855                case 2:
1856                     jQuery(this).removeClass("active");
1857                     $("#de_notif").addClass("active");
1858                     de_atc('Product removed from wishlist');
1859                     setTimeout(function() {
1860                         $("#de_notif").removeClass("active");
1861                     }, 1500);
1862                     break;
1863             }
1864             iteration++;
1865             if (iteration > 2) iteration = 1;
1866             $(this).data('iteration', iteration);
1867         
1868         });
1869
1870         jQuery(".de__pcard .atr__add-cart").on("click", function () {
1871             
1872            $("#de_notif").removeClass("active");
1873            de_atc('Product added to cart');
1874            $("#de_notif").addClass("active");
1875            setTimeout(function() {
1876                $("#de_notif").removeClass("active");
1877            }, 1500);
1878         
1879         });
1880         // product click notification close
1881	   
1882         // ecommerce
1883         jQuery(".de__pcard .atr__opt div").on("click", function () {
1884             var img_url = jQuery(this).attr('data-image');
1885             var sc = jQuery(this).parent().parent().parent().find(".atr__image-main");
1886             sc.attr('src',img_url);
1887             jQuery(this).parent().find("div").removeClass("active");
1888             jQuery(this).addClass("active");
1889         });
1890
1891         jQuery(".de__pcard .atr__colors div").on("click", function () {
1892             var img_url = jQuery(this).attr('data-image');
1893             var sc = jQuery(this).parent().parent().parent().find(".atr__image-main");
1894             sc.attr('src',img_url);
1895             jQuery(this).parent().find("div").removeClass("active");
1896             jQuery(this).addClass("active");
1897         });
1898
1899		$('.accordion-section-title').on("click", function(e) {
1900         var currentAttrvalue = $(this).data('tab');
1901         if($(e.target).is('.active')){
1902             $(this).removeClass('active');
1903             $('.accordion-section-content:visible').slideUp(300);
1904         } else {
1905             $('.accordion-section-title').removeClass('active').filter(this).addClass('active');
1906             $('.accordion-section-content').slideUp(300).filter(currentAttrvalue).slideDown(300);
1907         }
1908        });
1909
1910        jQuery.each(jQuery('textarea[data-autoresize]'), function() {
1911            var offset = this.offsetHeight - this.clientHeight;
1912         
1913            var resizeTextarea = function(el) {
1914                jQuery(el).css('height', 'auto').css('height', el.scrollHeight + offset);
1915            };
1916            jQuery(this).on('keyup input', function() { resizeTextarea(this); }).removeAttr('data-autoresize');
1917        });
1918		
1919
1920         /* --------------------------------------------------
1921          * window | on resize
1922          * --------------------------------------------------*/
1923         $(window).resize(function() {
1924             init_resize();
1925             centerY();
1926			 grid_gallery();
1927         });
1928
1929         /* --------------------------------------------------
1930          * window | on scroll
1931          * --------------------------------------------------*/
1932         jQuery(window).on("scroll", function() {
1933             /* functions */
1934             header_sticky();
1935             de_counter();
1936             de_progress();
1937             init();
1938             backToTop();
1939             moveItItemNow();
1940			 
1941             /* fade base scroll position */
1942             var target = $('.fadeScroll');
1943             var targetHeight = target.outerHeight();
1944             var scrollPercent = (targetHeight - window.scrollY) / targetHeight;
1945             if (scrollPercent >= 0) {
1946                 target.css('opacity', scrollPercent);
1947             } else {
1948                 target.css('opacity', 0);
1949             }
1950             /* custom page with background on side
1951             jQuery('.side-bg').each(function() {
1952                 jQuery(this).find(".image-container").css("height", jQuery(this).find(".image-container").parent().css("height"));
1953             }); */
1954             /* go to anchor */
1955             jQuery('#mainmenu li a').each(function() {
1956                 var cur = jQuery(this);
1957                 if (this.href.indexOf('#') === -1) {
1958                     var href = jQuery(this).attr('href');
1959					
1960                 }
1961             });
1962
1963             // magic begin
1964               if (Array.prototype.some.call($('.section-dark'), function(element) {
1965                var h = $(window).innerHeight();
1966                var scrollPosition = $(window).scrollTop()+h/2;
1967                var elementTop = $(element).offset().top;
1968                var elementBottom = $(element).outerHeight() + elementTop;
1969                if (scrollPosition > elementTop && scrollPosition < elementBottom) {
1970                  return true;
1971                }
1972                else {
1973                  return false;
1974                }
1975               })) {
1976                $('.float-text').addClass('dark');
1977                $('.scrollbar-v').addClass('dark');
1978               } else {
1979                $('.float-text').removeClass('dark');
1980                $('.scrollbar-v').removeClass('dark');
1981               }
1982             // magic close
1983			 
1984			 // acc
1985			 $('.toggle').on("click", function(e) {
1986				e.preventDefault();
1987			  
1988				var $this = $(this);
1989			  
1990				if ($this.next().hasClass('show')) {
1991					$this.next().removeClass('show');
1992					$this.next().slideUp(350);
1993				} else {
1994					$this.parent().parent().find('li .inner').removeClass('show');
1995					$this.parent().parent().find('li .inner').slideUp(350);
1996					$this.next().toggleClass('show');
1997					$this.next().slideToggle(350);
1998				}
1999			});
2000
2001             if(header_autoshow==="on"){
2002                 last_scroll_position = window.scrollY;
2003
2004                 // Scrolling down
2005                 if (new_scroll_position < last_scroll_position && last_scroll_position > 80) {
2006                   // header.removeClass('slideDown').addClass('nav-up');
2007                   header.addClass("scroll-down");
2008                   header.removeClass("nav-up");
2009
2010                 // Scrolling up
2011                 } else if (new_scroll_position > last_scroll_position) {
2012                   // header.removeClass('nav-up').addClass('slideDown');
2013                   header.removeClass("scroll-down");
2014                   header.addClass("nav-up");
2015                 }
2016
2017                 new_scroll_position = last_scroll_position;
2018            }
2019
2020            // scroll indicator
2021            var pixels = $(document).scrollTop();
2022            var pageHeight = $(document).height() - $(window).height();
2023            var progress = (100 * pixels) / pageHeight;
2024            $("div.scrollbar").css("width", progress + "%");
2025            $("div.scrollbar-v").css("height", progress + "px");
2026
2027
2028         });
2029         $(function() {
2030             "use strict";
2031             var x = 0;
2032             setInterval(function() {
2033                 x -= 1;
2034                 $('.bg-loop').css('background-position', x + 'px 0');
2035             }, 50);
2036         })	 
2037		
2038     });
2039
2040    // owl sync begin
2041    var sync1 = $("#sync1");
2042        var sync2 = $("#sync2");
2043        var slidesPerPage = 5; //globaly define number of elements per page
2044        var syncedSecondary = true;
2045
2046        sync1.owlCarousel({
2047            items: 1,
2048            slideSpeed: 2000,
2049            nav: true,
2050            autoplay: false, 
2051            dots: false,
2052            nav: true,
2053            loop: true,
2054            responsiveRefreshRate: 200,
2055            navText: ['<svg width="100%" height="100%" viewBox="0 0 11 20"><path style="fill:none;stroke-width: 1px;stroke: #000;" d="M9.554,1.001l-8.607,8.607l8.607,8.606"/></svg>', '<svg width="100%" height="100%" viewBox="0 0 11 20" version="1.1"><path style="fill:none;stroke-width: 1px;stroke: #000;" d="M1.054,18.214l8.606,-8.606l-8.606,-8.607"/></svg>'],
2056        }).on('changed.owl.carousel', syncPosition);
2057
2058        sync2
2059            .on('initialized.owl.carousel', function() {
2060                sync2.find(".owl-item").eq(0).addClass("current");
2061            })
2062            .owlCarousel({
2063                items: slidesPerPage,
2064                dots: false,
2065                nav: false,
2066                smartSpeed: 200,
2067                slideSpeed: 500,
2068                slideBy: slidesPerPage, //alternatively you can slide by 1, this way the active slide will stick to the first item in the second carousel
2069                responsiveRefreshRate: 100
2070            }).on('changed.owl.carousel', syncPosition2);
2071
2072        function syncPosition(el) {
2073            //if you set loop to false, you have to restore this next line
2074            //var current = el.item.index;
2075
2076            //if you disable loop you have to comment this block
2077            var count = el.item.count - 1;
2078            var current = Math.round(el.item.index - (el.item.count / 2) - .5);
2079
2080            if (current < 0) {
2081                current = count;
2082            }
2083            if (current > count) {
2084                current = 0;
2085            }
2086
2087            //end block
2088
2089            sync2
2090                .find(".owl-item")
2091                .removeClass("current")
2092                .eq(current)
2093                .addClass("current");
2094            var onscreen = sync2.find('.owl-item.active').length - 1;
2095            var start = sync2.find('.owl-item.active').first().index();
2096            var end = sync2.find('.owl-item.active').last().index();
2097
2098            if (current > end) {
2099                sync2.data('owl.carousel').to(current, 100, true);
2100            }
2101            if (current < start) {
2102                sync2.data('owl.carousel').to(current - onscreen, 100, true);
2103            }
2104        }
2105
2106        function syncPosition2(el) {
2107            if (syncedSecondary) {
2108                var number = el.item.index;
2109                sync1.data('owl.carousel').to(number, 100, true);
2110            }
2111        }
2112
2113        sync2.on("click", ".owl-item", function(e) {
2114            e.preventDefault();
2115            var number = $(this).index();
2116            sync1.data('owl.carousel').to(number, 300, true);
2117        });
2118        // owl sync end
2119
2120            // price range slider
2121
2122            const rangeInput = document.querySelectorAll(".range-input input"),
2123              priceInput = document.querySelectorAll(".price-input input"),
2124              range = document.querySelector(".slider .progress");
2125            let priceGap = 0;
2126
2127            priceInput.forEach((input) => {
2128              input.addEventListener("input", (e) => {
2129                let minPrice = parseInt(priceInput[0].value),
2130                  maxPrice = parseInt(priceInput[1].value);
2131
2132                if (maxPrice - minPrice >= priceGap && maxPrice <= rangeInput[1].max) {
2133                  if (e.target.className === "input-min") {
2134                    rangeInput[0].value = minPrice;
2135                    range.style.left = (minPrice / rangeInput[0].max) * 100 + "%";
2136                  } else {
2137                    rangeInput[1].value = maxPrice;
2138                    range.style.right = 100 - (maxPrice / rangeInput[1].max) * 100 + "%";
2139                  }
2140                }
2141              });
2142            });
2143
2144            rangeInput.forEach((input) => {
2145              input.addEventListener("input", (e) => {
2146                let minVal = parseInt(rangeInput[0].value),
2147                  maxVal = parseInt(rangeInput[1].value);
2148
2149                if (maxVal - minVal < priceGap) {
2150                  if (e.target.className === "range-min") {
2151                    rangeInput[0].value = maxVal - priceGap;
2152                  } else {
2153                    rangeInput[1].value = minVal + priceGap;
2154                  }
2155                } else {
2156                  priceInput[0].value = minVal;
2157                  priceInput[1].value = maxVal;
2158                  if($('body').hasClass('rtl')){
2159                   range.style.right = (minVal / rangeInput[0].max) * 100 + "%";
2160                   range.style.left = 100 - (maxVal / rangeInput[1].max) * 100 + "%";
2161                  }else{                
2162                   range.style.left = (minVal / rangeInput[0].max) * 100 + "%";
2163                   range.style.right = 100 - (maxVal / rangeInput[1].max) * 100 + "%";
2164                  }
2165                }
2166              });
2167            });
2168        // price range slider end
2169
2170    $(window).on('load', function() {
2171        jQuery('#de-loader').fadeOut(500);
2172        filter_gallery();
2173        window.dispatchEvent(new Event('resize'));        
2174         filter_gallery();
2175         masonry();
2176
2177        $('.grid').isotope({
2178            itemSelector: '.grid-item'
2179        });
2180        grid_gallery();
2181        // $('#buy-now,#back-to-top ').hide();
2182    });
2183    
2184 })(jQuery);

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.