PageSourceSearch

https://www.surfbahia.com.br/js/theme-functions.js?Friday%202nd%20of%20October%202026%2010:31:09%20PM

js surfbahia.com.br collected 2026-10-03 01:31:48 UTC 36,588 bytes, 1,398 lines download raw bytes

1//Global var
2var INSPIRO = {};
3
4(function ($) {
5
6	// USE STRICT
7	"use strict";
8
9	//----------------------------------------------------/
10	// Predefined Variables
11	//----------------------------------------------------/
12	var $window = $(window),
13		$document = $(document),
14		$body = $('body'),
15		$topbar = $('#topbar'),
16		$header = $('#header'),
17		$transparentHeader = $header.hasClass('header-transparent') || $header.hasClass('header-light-transparent') || $header.hasClass('header-dark-transparent'),
18
19		//Logo
20		logo = $('#logo').find('.logo'),
21		logoImg = logo.find('img').attr('src'),
22		logoDark = logo.attr('data-dark-logo'),
23
24		//Main menu
25		mainmenu = $('#mainMenu'),
26		mainmenuitems = mainmenu.find('li.dropdown > a'),
27		mainsubmenuitems = mainmenu.find('li.dropdown-submenu > a, li.dropdown-submenu > span'),
28
29		//Vertical Dot Menu
30		navigationItems = $('#vertical-dot-menu a'),
31
32		//Side panel
33		sidePanel = $('#side-panel'),
34		sidePanellogo = $('#panel-logo').find('.logo'),
35		sidePanellogoImg = sidePanellogo.find('img').attr('src'),
36		sidePanellogoDark = sidePanellogo.attr('data-dark-logo'),
37
38		//Fullscreen panel
39		fullScreenPanel = $('#fullscreen-panel'),
40
41		$topSearch = $('#top-search'),
42		$parallax = $('.parallax'),
43		$textRotator = $('.text-rotator'),
44
45		//Window size control
46		$fullScreen = $('.fullscreen') || $('.section-fullscreen'),
47		$halfScreen = $('.halfscreen'),
48
49
50		//Mouse Scroll
51		$mouseScroll = $('.mouse-scroll'),
52
53		//Elements
54		dataAnimation = $("[data-animation]"),
55		$counter = $('.counter:not(.counter-instant)'),
56		$countdownTimer = $('.countdown'),
57		$progressBar = $('.progress-bar'),
58		$pieChart = $('.pie-chart'),
59		$map = $('.map'),
60		accordionType = "accordion",
61		toogleType = "toggle",
62		accordionItem = "ac-item",
63		itemActive = "ac-active",
64		itemTitle = "ac-title",
65		itemContent = "ac-content",
66
67		$lightbox_gallery = $('[data-lightbox-type="gallery"]'),
68		$lightbox_image = $('[data-lightbox-type="image"]'),
69		$lightbox_iframe = $('[data-lightbox-type="iframe"]'),
70		$lightbox_ajax = $('[data-lightbox-type="ajax"]'),
71
72		//Widgets
73		$flickr_widget = $('.flickr-widget'),
74
75		$ytPlayer = $('.youtube-background'),
76
77		//Utilites
78		classFinder = ".";
79
80
81
82	//----------------------------------------------------/
83	// UTILITIES
84	//----------------------------------------------------/
85
86	//Check if function exists
87	$.fn.exists = function () {
88		return this.length > 0;
89	};
90
91
92	//----------------------------------------------------/
93	// MOBILE CHECK
94	//----------------------------------------------------/
95	var isMobile = {
96		Android: function () {
97			return navigator.userAgent.match(/Android/i);
98		},
99		BlackBerry: function () {
100			return navigator.userAgent.match(/BlackBerry/i);
101		},
102		iOS: function () {
103			return navigator.userAgent.match(/iPhone|iPad|iPod/i);
104		},
105		Opera: function () {
106			return navigator.userAgent.match(/Opera Mini/i);
107		},
108		Windows: function () {
109			return navigator.userAgent.match(/IEMobile/i);
110		},
111		any: function () {
112			return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
113		}
114	};
115
116
117	//----------------------------------------------------/
118	// RESPONSIVE CLASSES
119	//----------------------------------------------------/
120	INSPIRO.responsiveClasses = function () {
121
122		var jRes = jRespond([
123			{
124				label: 'smallest',
125				enter: 0,
126				exit: 479
127                }, {
128				label: 'handheld',
129				enter: 480,
130				exit: 767
131                }, {
132				label: 'tablet',
133				enter: 768,
134				exit: 991
135                }, {
136				label: 'laptop',
137				enter: 992,
138				exit: 1199
139                }, {
140				label: 'desktop',
141				enter: 1200,
142				exit: 10000
143                }
144            ]);
145		jRes.addFunc([
146			{
147				breakpoint: 'desktop',
148				enter: function () {
149					$body.addClass('device-lg');
150				},
151				exit: function () {
152					$body.removeClass('device-lg');
153				}
154                }, {
155				breakpoint: 'laptop',
156				enter: function () {
157					$body.addClass('device-md');
158				},
159				exit: function () {
160					$body.removeClass('device-md');
161				}
162                }, {
163				breakpoint: 'tablet',
164				enter: function () {
165					$body.addClass('device-sm');
166				},
167				exit: function () {
168					$body.removeClass('device-sm');
169				}
170                }, {
171				breakpoint: 'handheld',
172				enter: function () {
173					$body.addClass('device-xs');
174				},
175				exit: function () {
176					$body.removeClass('device-xs');
177				}
178                }, {
179				breakpoint: 'smallest',
180				enter: function () {
181					$body.addClass('device-xxs');
182				},
183				exit: function () {
184					$body.removeClass('device-xxs');
185				}
186                }
187        ]);
188	};
189
190	//----------------------------------------------------/
191	// PAGE LOADER
192	//----------------------------------------------------/
193	INSPIRO.loader = function () {
194		if ($(".loader-wrapper").exists()) {
195
196			$('#mainMenu a:not([target="_blank"]):not([href^=#]), a.animation-link').on("click", function () {
197				// Grab the link's href
198				var href = this.href;
199
200				$(".loader").fadeIn(300);
201				// Slide up the content you want to slide up
202				$(".loader-wrapper").fadeIn(function () {
203					// Slide is finished, navigate
204					location.href = href;
205
206				});
207
208				// Prevent the default action of the link
209				return false;
210			});
211
212			$window.load(function () {
213				$(".loader:not(.demo-loader)").fadeOut(200);
214				$(".loader-wrapper:not(.demo-loader)").delay(100).fadeOut(400);
215			});
216		}
217	};
218
219	//----------------------------------------------------/
220	// CAROUSEL SLIDER
221	//----------------------------------------------------/
222	INSPIRO.carouselInspiro = function () {
223
224		var $sliderCarousel = $('.carousel') || $('.owl-carousel'),
225			$postCarousel = $(".post-mini-slider");
226
227		if ($sliderCarousel.exists()) {
228			$sliderCarousel.each(function () {
229				var element = $(this),
230
231					sliderCarouselColumns = element.attr('data-carousel-col') || "4",
232					sliderCarouselColumnsMedium = element.attr('data-carousel-col-md') || "4",
233					sliderCarouselColumnsSmall = element.attr('data-carousel-col-sm') || "3",
234					sliderCarouselColumnsExtraSmall = element.attr('data-carousel-col-xs') || "1",
235					$sliderCarouselMargins = element.attr('data-carousel-margins') || "20",
236					$sliderCarouseDots = element.attr('data-carousel-dots') || false,
237					$sliderCarouseNav = false,
238					$sliderCarouseAutoPlay = element.attr('data-carousel-autoplay') || false,
239					$sliderCarouseVideo = element.attr('data-carousel-video') || false;
240
241
242				if ($sliderCarouseDots === false) {
243					$sliderCarouseNav = true;
244				} else {
245					$sliderCarouseDots = true;
246				}
247
248				if (sliderCarouselColumns == 1) {
249					element.owlCarousel({
250						margin: Number($sliderCarouselMargins),
251						nav: $sliderCarouseNav,
252						navText: ['<i class="fa fa-arrow-left icon-white"></i>',
253                              '<i class="fa fa-arrow-right icon-white"></i>'],
254						autoplay: $sliderCarouseAutoPlay,
255						autoplayHoverPause: true,
256						dots: $sliderCarouseDots,
257						items: 1,
258						autoHeight: false,
259						video: $sliderCarouseVideo,
260
261					});
262
263
264				} else {
265
266					element.owlCarousel({
267						margin: Number($sliderCarouselMargins),
268						nav: $sliderCarouseNav,
269						navText: ['<i class="fa fa-arrow-left icon-white"></i>',
270                              '<i class="fa fa-arrow-right icon-white"></i>'],
271						autoplay: $sliderCarouseAutoPlay,
272						autoplayHoverPause: true,
273						dots: $sliderCarouseDots,
274						video: $sliderCarouseVideo,
275						responsive: {
276							0: {
277								items: sliderCarouselColumnsExtraSmall
278							},
279							600: {
280								items: sliderCarouselColumnsSmall
281							},
282							1000: {
283								items: sliderCarouselColumnsMedium
284							},
285							1200: {
286								items: sliderCarouselColumns
287							}
288						}
289					});
290
291
292				}
293
294			});
295		}
296
297		if ($postCarousel.exists()) {
298			$postCarousel.each(function () {
299				$postCarousel.owlCarousel({
300					autoplay: true,
301					autoplayHoverPause: true,
302					dots: true,
303					mouseDrag: false,
304					touchDrag: false,
305					items: 1,
306				});
307
308			});
309		}
310
311		if ($("#slider-carousel").exists()) {
312			$("#slider-carousel").each(function () {
313				$("#slider-carousel").owlCarousel({
314					margin: 0,
315					loop: true,
316					nav: true,
317					navText: ['<i class="fa fa-arrow-left icon-white"></i>',
318                              '<i class="fa fa-arrow-right icon-white"></i>'],
319					autoplay: true,
320					dots: false,
321					autoplayHoverPause: true,
322					navigation: true,
323					items: 1,
324					animateOut: 'fadeOut'
325
326
327				});
328
329				var owl = $("#slider-carousel");
330
331				$('.owl-item.active .slider-content').addClass("animated fadeIn");
332
333
334				owl.on('changed.owl.carousel', function (event) {
335
336					$('.owl-item:not(.active)').siblings().find(".slider-content").removeClass("animated fadeIn");
337					setTimeout(function () {
338						$('.owl-item.active .slider-content').addClass("animated fadeIn");
339					}, 300);
340
341
342					//stop embed videos if they exists
343					if ($("#slider-carousel .owl-item.active .slider-content iframe").length) {
344						var url = $("#slider-carousel .owl-item.active .slider-content iframe").attr("src");
345						$('iframe').attr('src', '');
346						$('iframe').attr('src', url);
347
348					}
349
350				});
351
352
353
354
355
356			});
357		}
358		// News ticker
359		if ($('.news-ticker-content').exists()) {
360			$('.news-ticker-content').each(function () {
361				$('.news-ticker-content').owlCarousel({
362					autoplay: true,
363					autoplayHoverPause: true,
364					dots: false,
365					mouseDrag: true,
366					touchDrag: true,
367					margin: 40,
368					autoWidth: true,
369					autoplayTimeout: "3000",
370					loop: true,
371				});
372
373			});
374		}
375	};
376	/*$("#slider-carousel2").owlCarousel({
377					margin: 0,
378					loop: true,
379					nav: true,
380					navText: ['<i class="fa fa-arrow-left icon-white"></i>',
381                              '<i class="fa fa-arrow-right icon-white"></i>'],
382					autoplay: true,
383					dots: false,
384					autoplayHoverPause: true,
385					navigation: true,
386					singleItem: true,
387					items: 6,
388					autoHeight: true,
389
390				});*/
391	//----------------------------------------------------/
392	// SMOTH SCROLL NAVIGATION
393	//----------------------------------------------------/
394	INSPIRO.naTo = function () {
395		$('a.scroll-to, a.nav-to').on('click', function () {
396			var $anchor = $(this);
397
398			$('html, body').stop(true, false).animate({
399				scrollTop: $($anchor.attr('href')).offset().top
400			}, 1500, 'easeInOutExpo');
401			return false;
402		});
403
404	};
405
406	//----------------------------------------------------/
407	// MULTI SCROLL
408	//----------------------------------------------------/
409	INSPIRO.multiScroll = function () {
410
411		if ($('#multiscroll').exists()) {
412
413			$('#multiscroll').multiscroll({
414				navigation: true
415			});
416
417		}
418
419	};
420
421	//----------------------------------------------------/
422	// GO TO TOP
423	//----------------------------------------------------/
424	INSPIRO.goToTop = function () {
425
426		var $goToTop = $('.gototop'),
427			scrollOffsetFromTop = 800;
428
429		if ($window.scrollTop() > scrollOffsetFromTop) {
430			$goToTop.fadeIn("slow");
431		} else {
432			$goToTop.fadeOut("slow");
433		}
434
435		$goToTop.on("click", function () {
436			$('body,html').stop(true).animate({
437				scrollTop: 0
438			}, 1500, 'easeInOutExpo');
439			return false;
440		});
441
442	};
443
444
445
446	//----------------------------------------------------/
447	// LOGO STATUS
448	//----------------------------------------------------/
449	INSPIRO.logoStatus = function () {
450
451		if ($header.hasClass('header-navigation-light') && $window.width() < 991) {
452			logo.find('img').attr('src', logoImg);
453		} else {
454
455			if ($header.hasClass('header-dark')) {
456
457				if (logoDark) {
458					logo.find('img').attr('src', logoDark);
459				} else {
460					logo.find('img').attr('src', logoImg);
461				}
462
463			} else {
464				logo.find('img').attr('src', logoImg);
465			}
466		}
467
468	};
469
470	//----------------------------------------------------/
471	// STICKY HEADER
472	//----------------------------------------------------/
473	INSPIRO.stickyHeaderStatus = function () {
474		if ($header.exists()) {
475			var headerOffset = $header.offset().top;
476
477			if ($window.scrollTop() > headerOffset) {
478
479				if ($body.hasClass('device-lg') || $body.hasClass('device-md')) {
480					$header.addClass('header-sticky');
481					if ($header.hasClass('header-navigation-light')) {
482						logo.find('img').attr('src', logoImg);
483					}
484				} else {
485					$header.removeClass('header-sticky');
486				}
487			} else {
488				$header.removeClass('header-sticky');
489			}
490		}
491	};
492
493	INSPIRO.stickyHeader = function () {
494		$window.on('scroll', function () {
495			INSPIRO.logoStatus();
496			INSPIRO.stickyHeaderStatus();
497
498		});
499	};
500
501	//----------------------------------------------------/
502	// SCREEN SIZE CONTROL
503	//----------------------------------------------------/
504	INSPIRO.screenSizeControl = function () {
505		if ($fullScreen.exists()) {
506
507			var headerHeight = $header.height();
508			var topbarHeight = $topbar.height();
509
510			$fullScreen.each(function () {
511				var $elem = $(this),
512					elemHeight = $window.height();
513
514				$elem.css('height', elemHeight);
515
516				/*if ($body.hasClass('device-lg') || $body.hasClass('device-md')) {
517					$elem.css('height', elemHeight);
518				}else {
519					if ($topbar) {
520						$elem.css('height', elemHeight - (headerHeight + topbarHeight));
521					} else {
522						$elem.css('height', elemHeight - (headerHeight));
523					}
524				}*/
525
526			});
527		}
528
529		if ($halfScreen.exists()) {
530			$halfScreen.each(function () {
531				var $elem = $(this),
532					elemHeight = $window.height();
533
534				$elem.css('height', elemHeight / 1.5);
535			});
536		}
537	};
538
539	//----------------------------------------------------/
540	// TOP SEARCH
541	//----------------------------------------------------/
542	$("#top-search-trigger").on("click", function () {
543		$body.toggleClass('top-search-active');
544		$topSearch.find('input').focus();
545		return false;
546	});
547
548	//----------------------------------------------------/
549	// MAIN MENU FIXES
550	//----------------------------------------------------/
551
552	if (mainmenu.hasClass('mega-menu')) {
553
554		mainmenuitems.on('click', function () {
555			$(this).parent('ul li').toggleClass("resp-active", 1000, "easeOutSine");
556			return false;
557
558		});
559
560		mainsubmenuitems.on('click', function () {
561			$(this).parent('li').toggleClass('resp-active');
562			return false;
563		});
564
565	}
566
567
568
569	INSPIRO.menuFix = function () {
570
571		if ($body.hasClass('device-lg') || $body.hasClass('device-md')) {
572			$('ul.main-menu .dropdown:not(.mega-menu-item) ul ul').each(function (index, element) {
573				if ($window.width() - ($(element).width() + $(element).offset().left) < 0) {
574					$(element).addClass('menu-invert');
575				}
576			});
577		}
578	};
579
580
581
582	//----------------------------------------------------/
583	// Button lines
584	//----------------------------------------------------/
585	$(".lines-button").on("click", function () {
586		$(this).toggleClass("lines-button-close");
587	});
588
589	//----------------------------------------------------/
590	// Side panel
591	//----------------------------------------------------/
592
593	INSPIRO.sidePanel = function () {
594		if (sidePanel.exists()) {
595
596			if ($body.hasClass("side-panel-static")) {
597				$body.addClass("side-push-panel side-panel-left side-panel-active");
598
599			} else {
600				$(".side-panel-button button").on("click", function () {
601					if ($body.hasClass("side-panel-active")) {
602						$body.removeClass("side-panel-active");
603					} else {
604						$body.addClass("side-panel-active");
605					}
606					return false;
607				});
608
609				$body.removeClass("side-panel-active");
610				$body.addClass("side-push-panel side-panel-left");
611			}
612
613		} else {
614			$body.removeClass("side-push-panel side-panel-left");
615		}
616
617
618		//Side Panel Dark logo version
619		if (sidePanel.hasClass('side-panel-dark')) {
620
621			if (sidePanellogoDark) {
622				sidePanellogo.find('img').attr('src', sidePanellogoDark);
623			} else {
624				sidePanellogo.find('img').attr('src', sidePanellogoImg);
625			}
626
627		} else {
628			sidePanellogo.find('img').attr('src', sidePanellogoImg);
629		}
630
631
632
633	};
634	//----------------------------------------------------/
635	// VERTICAL MENU (DOTS)
636	//----------------------------------------------------/
637
638	INSPIRO.verticalDotMenu = function () {
639		if (navigationItems.exists()) {
640			navigationItems.on('click', function () {
641				navigationItems.removeClass('active');
642				$(this).addClass('active');
643				return false;
644			});
645		}
646	};
647
648
649	//----------------------------------------------------/
650	// FULLSCREEN MENU
651	//----------------------------------------------------/
652
653	INSPIRO.fullScreenPanel = function () {
654		if (fullScreenPanel.exists()) {
655			$("#fullscreen-panel-button").on("click", function () {
656				$body.toggleClass('fullscreen-panel-active');
657				return false;
658			});
659		}
660	};
661
662
663	//----------------------------------------------------/
664	// TEXT ROTATOR
665	//----------------------------------------------------/
666	INSPIRO.textRotator = function () {
667		if ($textRotator.exists()) {
668			$textRotator.each(function () {
669				var $elem = $(this),
670					dataTextSeperator = $elem.attr('data-rotate-separator') || ",",
671					dataTextEffect = $elem.attr('data-rotate-effect') || "flipInX",
672					dataTextSpeed = $elem.attr('data-rotate-speed') || 2000;
673
674				$textRotator.Morphext({
675					animation: dataTextEffect,
676					separator: dataTextSeperator,
677					speed: Number(dataTextSpeed)
678				});
679			});
680		}
681	};
682
683	//----------------------------------------------------/
684	// ACCORDION
685	//----------------------------------------------------/
686	INSPIRO.accordion = function () {
687		var $accs = $(classFinder + accordionItem);
688
689
690		$accs.length && ($accs.each(function () {
691			var $item = $(this);
692
693
694			$item.hasClass(itemActive) ? $item.addClass(itemActive) : $item.find(classFinder + itemContent).hide();
695		}), $(classFinder + itemTitle).on("click", function (e) {
696
697			var $link = $(this),
698				$item = $link.parents(classFinder + accordionItem),
699				$acc = $item.parents(classFinder + accordionType);
700
701			$item.hasClass(itemActive) ? $acc.hasClass(toogleType) ? ($item.removeClass(itemActive), $link.next(classFinder + itemContent).slide
701Up("fast")) : ($acc.find(classFinder + accordionItem).removeClass(itemActive), $acc.find(classFinder + itemContent).slideUp("fast")) : ($acc.hasClass(toogleType) || ($acc.find(classFinder + accordionItem).removeClass(itemActive), $acc.find(classFinder + itemContent).slideUp("fast")), $item.addClass(itemActive),
702					$link.next(classFinder + itemContent).slideToggle("fast")
703				),
704				e.preventDefault();
705			return false;
706		}));
707
708	};
709
710	/* ---------------------------------------------------------------------------
711	 * TABS
712	 * --------------------------------------------------------------------------- */
713	INSPIRO.tabs = function () {
714		var $tabNavigation = $(".tabs-navigation a");
715		if ($tabNavigation.exists()) {
716			$tabNavigation.on("click", function (e) {
717				$(this).tab("show"), e.preventDefault();
718				return false;
719			});
720
721
722		}
723	};
724
725	/* ---------------------------------------------------------------------------
726	 * Animations
727	 * --------------------------------------------------------------------------- */
728	INSPIRO.animations = function () {
729		if (dataAnimation.exists() && $body.hasClass('device-lg') || $body.hasClass('device-md')) {
730			dataAnimation.each(function () {
731				$(this).addClass("animated");
732				var $elem = $(this),
733					animationType = $elem.attr("data-animation") || "fadeIn",
734					animationDelay = $elem.attr("data-animation-delay") || 200,
735					animationDirection = ~animationType.indexOf("Out") ? "back" : "forward";
736
737
738				if (animationDirection == "forward") {
739
740					$elem.appear(function () {
741
742
743						setTimeout(function () {
744							$elem.addClass(animationType + " visible");
745						}, animationDelay);
746
747
748					}, {
749						accX: 0,
750						accY: -120
751					}, 'easeInCubic');
752
753				} else {
754					$elem.addClass("visible");
755					$elem.on("click", function () {
756						$elem.addClass(animationType);
757						return false;
758					});
759				}
760
761
762				if ($elem.parents('.demo-play-animations').length) {
763					$elem.on("click", function () {
764						$elem.removeClass(animationType);
765						setTimeout(function () {
766							$elem.addClass(animationType);
767						}, 50);
768						return false;
769					});
770				}
771			});
772
773		}
774	};
775
776	/* ---------------------------------------------------------------------------
777	 * PARALLAX
778	 * --------------------------------------------------------------------------- */
779	INSPIRO.parallax = function () {
780		if ($parallax.exists() || $(".page-title-parallax")) {
781
782			if ($body.hasClass('device-lg') || $body.hasClass('device-md')) {
783				$.stellar({
784					horizontalScrolling: false,
785					verticalScrolling: true,
786					horizontalOffset: 0,
787					verticalOffset: 0,
788				});
789
790			}
791		}
792	};
793
794
795
796
797	/* ---------------------------------------------------------------------------
798	 * RESPONSIVE VIDEOS
799	 * --------------------------------------------------------------------------- */
800	INSPIRO.resposniveVideos = function () {
801		if ($().fitVids) {
802			$("section, .content, .post-content, .ajax-quick-view,#slider:not(.revslider-wrap)").fitVids();
803		}
804	};
805
806
807	/* ---------------------------------------------------------------------------
808	 * COUNTER NUMBERS
809	 * --------------------------------------------------------------------------- */
810	INSPIRO.counters = function () {
811		if ($counter.exists()) {
812			$counter.each(function () {
813				var $elem = $(this);
814				$elem.appear(function () {
815					$elem.find('span').countTo();
816				});
817			});
818		}
819	};
820
821	/* ---------------------------------------------------------------------------
822	 * COUNTDOWN TIMER
823	 * --------------------------------------------------------------------------- */
824	INSPIRO.countdownTimer = function () {
825
826		if ($countdownTimer.exists()) {
827			setTimeout(function () {
828				$('[data-countdown]').each(function () {
829					var $this = $(this),
830						finalDate = $(this).data('countdown');
831					$this.countdown(finalDate, function (event) {
832						$this.html(event.strftime('<div class="countdown-container"><div class="countdown-box"><div class="number">%-D</div><span>Day%!d</span></div>' + '<div class="countdown-box"><div class="number">%H</div><span>Hours</span></div>' + '<div class="countdown-box"><div class="number">%M</div><span>Minutes</span></div>' + '<div class="countdown-box"><div class="number">%S</div><span>Seconds</span></div></div>'));
833
834					});
835				});
836			}, 300);
837		}
838	};
839
840
841	/* ---------------------------------------------------------------------------
842	 * PROGRESS BARS
843	 * --------------------------------------------------------------------------- */
844	INSPIRO.progressBar = function () {
845
846		if ($progressBar.exists()) {
847			$progressBar.each(function (i, elem) {
848				var $elem = $(this),
849					percent = $elem.attr('data-percent') || "100",
850					delay = $elem.attr('data-delay') || "100",
851					type = $elem.attr('data-type') || "%";
852
853				if (!$elem.hasClass('progress-animated')) {
854					$elem.css({
855						'width': '0%'
856					});
857				}
858
859				var progressBarRun = function () {
860					$elem.animate({
861						'width': percent + '%'
862					}, 'easeInOutCirc').addClass('progress-animated');
863
864
865				};
866
867				if ($body.hasClass('device-lg') || $body.hasClass('device-md')) {
868					$(elem).appear(function () {
869						setTimeout(function () {
870							progressBarRun();
871						}, delay);
872					});
873				} else {
874					progressBarRun();
875
876				}
877
878
879
880
881
882			});
883
884
885		}
886	};
887
888	/* ---------------------------------------------------------------------------
889	 * PRI CHARTS
890	 * --------------------------------------------------------------------------- */
891	INSPIRO.pieChart = function () {
892
893		if ($pieChart.exists()) {
894			$pieChart.each(function () {
895
896				var $elem = $(this),
897					pieChartSize = $elem.attr('data-size') || "160",
898					pieChartAnimate = $elem.attr('data-animate') || "2000",
899					pieChartWidth = $elem.attr('data-width') || "6",
900					pieChartColor = $elem.attr('data-color') || "#00c0e9",
901					pieChartTrackColor = $elem.attr('data-trackcolor') || "rgba(0,0,0,0.10)";
902
903				$elem.find('span, i').css({
904					'width': pieChartSize + 'px',
905					'height': pieChartSize + 'px',
906					'line-height': pieChartSize + 'px'
907				});
908
909				$elem.appear(function () {
910					$elem.easyPieChart({
911						size: Number(pieChartSize),
912						animate: Number(pieChartAnimate),
913						trackColor: pieChartTrackColor,
914						lineWidth: Number(pieChartWidth),
915						barColor: pieChartColor,
916						scaleColor: false,
917						lineCap: 'square',
918						onStep: function (from, to, percent) {
919							$elem.find('span.percent').text(Math.round(percent));
920						}
921					});
922				});
923			});
924		}
925	};
926
927	/* ---------------------------------------------------------------------------
928	 * GOOGLE MAPS
929	 * --------------------------------------------------------------------------- */
930	INSPIRO.maps = function () {
931
932		if ($map.exists()) {
933
934
935			$map.each(function () {
936
937				var $elem = $(this),
938					mapAddress = $elem.attr('data-map-address') ? $elem.attr('data-map-address') : "Melbourne, Australia",
939					mapType = $elem.attr('data-map-type') ? $elem.attr('data-map-type') : "ROADMAP",
940					mapZoom = $elem.attr('data-map-zoom') ? $elem.attr('data-map-zoom') : "14",
941					mapIcon = $elem.attr('data-map-icon') ? $elem.attr('data-map-icon') : "images/markers/marker2.png";
942
943				var markers = [{
944					address: mapAddress,
945					html: mapAddress,
946					icon: {
947						image: mapIcon,
948						iconsize: [40, 63],
949						iconanchor: [18, 60],
950					},
951                    }];
952
953				$elem.gMap({
954
955					address: mapAddress,
956					maptype: mapType,
957					markers: markers,
958					zoom: Number(mapZoom),
959					doubleclickzoom: true,
960					controls: {
961						panControl: true,
962						zoomControl: true,
963						mapTypeControl: false,
964						scaleControl: true,
965						streetViewControl: false,
966						overviewMapControl: true
967					}
968
969				});
970			});
971
972
973
974
975
976		}
977	};
978
979	/* ---------------------------------------------------------------------------
980	 * MASONRY ISOTOPE
981	 * --------------------------------------------------------------------------- */
982	INSPIRO.masonryIsotope = function () {
983
984		var $isotops = $(".isotope");
985		$isotops.each(function () {
986			var isotopeTime,
987				$elem = $(this),
988				defaultFilter = $elem.data("isotopeDefaultFilter") || 0,
989				id = $elem.attr("id"),
990				mode = $elem.attr('data-isotope-mode') || "masonry",
991				columns = $elem.attr('data-isotope-col') || "4",
992				$elemContainer = $elem,
993				itemElement = $elem.attr('data-isotope-item') || ".isotope-item",
994				itemElementSpace = $elem.attr('data-isotope-item-space') || 0;
995
996
997			$elem.isotope({
998					filter: '.onde-surfar',
999					itemSelector: itemElement,
1000					layoutMode: mode,
1001					transitionDuration: '0.6s',
1002					resizesContainer: true,
1003					resizable: true,
1004					animationOptions: {
1005						duration: 400,
1006						queue: !1
1007					}
1008
1009				}),
1010
1011				$window.resize(function () {
1012
1013
1014					$elemContainer.css('margin-right', '-' + itemElementSpace + '%');
1015
1016					if ($body.hasClass('device-sm') || $body.hasClass('device-xs')) {
1017						itemWidth(2, $elemContainer, itemElement, itemElementSpace);
1018					} else if ($body.hasClass('device-xxs')) {
1019						itemWidth(1, $elemContainer, itemElement, itemElementSpace);
1020					} else {
1021						itemWidth(columns, $elemContainer, itemElement, itemElementSpace);
1022					}
1023
1024					if (columns == 1 && $body.hasClass('device-sm') || columns == 1 && $body.hasClass('device-xs')) {
1025						itemWidth(1, $elemContainer, itemElement, itemElementSpace);
1026					}
1027
1028					clearTimeout(isotopeTime), isotopeTime = setTimeout(function () {
1029						$elem.isotope("layout");
1030					}, 300);
1031				});
1032
1033
1034
1035
1036			var $menu = $('[data-isotope-nav="' + id + '"]');
1037
1038			$menu.length && $menu.find("li").on("click", function (e) {
1039				var $link = $(this);
1040
1041				$(".filter-active-title").empty().append($link.text());
1042
1043				if (!$link.hasClass("ptf-active")) {
1044					var selector = $link.attr("data-filter");
1045					$link.parents(".portfolio-filter").eq(0).find(".ptf-active").removeClass("ptf-active"), $link.addClass("ptf-active"), $elem.isotope({
1046						filter: selector
1047					});
1048				}
1049
1050				e.preventDefault();
1051				return false;
1052			}), $window.resize();
1053
1054
1055		});
1056
1057	};
1058
1059	// Intellegent Grid
1060	var itemWidth = function (columns, $elemContainer, itemElement, itemElementSpace) {
1061
1062		var $findElement = $elemContainer.find(itemElement);
1063		var $findElementLarge = $elemContainer.find(".large-item");
1064
1065		var itemElementMargins = {
1066			"margin-right": itemElementSpace + "%",
1067			"margin-bottom": itemElementSpace + "%",
1068		};
1069
1070		if (columns == 1) {
1071			$findElement.width('100%');
1072			$findElementLarge.width('100%');
1073		}
1074
1075		if (columns == 2) {
1076			$findElement.width(50 - itemElementSpace + '%').css(itemElementMargins);
1077			$findElementLarge.width(50 - itemElementSpace + '%').css(itemElementMargins);
1078		}
1079
1080		if (columns == 3) {
1081			$findElement.width(33.333333 - itemElementSpace + '%').css(itemElementMargins);
1082			$findElementLarge.width(66.666666 - itemElementSpace + '%').css(itemElementMargins);
1083		}
1084
1085		if (columns == 4) {
1086			$findElement.width(25 - itemElementSpace + '%').css(itemElementMargins);
1087			$findElementLarge.width(50 - itemElementSpace + '%').css(itemElementMargins);
1088		}
1089
1090		if (columns == 5) {
1091			$findElement.width(20 - itemElementSpace + '%').css(itemElementMargins);
1092			$findElementLarge.width(40 - itemElementSpace + '%').css(itemElementMargins);
1093		}
1094
1095		if (columns == 6) {
1096			$findElement.width(16.666666 - itemElementSpace + '%').css(itemElementMargins);
1097			$findElementLarge.width(33.333333 - itemElementSpace + '%').css(itemElementMargins);
1098		}
1099
1100
1101
1102	};
1103
1104
1105
1106	/* ---------------------------------------------------------------------------
1107	 * TOOLTIPS
1108	 * --------------------------------------------------------------------------- */
1109	INSPIRO.tooltip = function () {
1110
1111		var $tooltip = $('[data-toggle="tooltip"]');
1112		if ($tooltip.exists()) {
1113			$('[data-toggle="tooltip"]').tooltip();
1114		}
1115
1116	};
1117
1118	/* ---------------------------------------------------------------------------
1119	 * POPOVER
1120	 * --------------------------------------------------------------------------- */
1121	INSPIRO.popover = function () {
1122
1123		var $popover = $('[data-toggle="popover"]');
1124		if ($popover.exists()) {
1125			$('[data-toggle="popover"]').popover({
1126				container: 'body',
1127				html: true
1128			});
1129
1130		}
1131
1132	};
1133
1134	/* ---------------------------------------------------------------------------
1135	 * LIGHTBOX
1136	 * --------------------------------------------------------------------------- */
1137	INSPIRO.lightBoxInspiro = function () {
1138
1139		if ($lightbox_image.exists()) {
1140			$lightbox_image.magnificPopup({
1141				type: 'image'
1142			});
1143		}
1144
1145		if ($lightbox_gallery.exists()) {
1146			$lightbox_gallery.each(function () {
1147				$(this).magnificPopup({
1148					delegate: 'a',
1149					type: 'image',
1150					titleSrc: 'Vanessa',
1151					gallery: {
1152						enabled: true
1153					}
1154				});
1155			});
1156		}
1157
1158		if ($lightbox_iframe.exists()) {
1159			$lightbox_iframe.each(function () {
1160				$(this).magnificPopup({
1161					type: 'iframe'
1162				});
1163			});
1164		}
1165
1166		if ($lightbox_ajax.exists()) {
1167			$lightbox_ajax.each(function () {
1168				$(this).magnificPopup({
1169					type: 'ajax',
1170					callbacks: {
1171						ajaxContentAdded: function (mfpResponse) {
1172							INSPIRO.carouselInspiro();
1173							INSPIRO.resposniveVideos();
1174							INSPIRO.accordion();
1175						}
1176					}
1177				});
1178			});
1179		}
1180	}
1181
1182
1183	/* ---------------------------------------------------------------------------
1184	 * FLICKR WIDGET
1185	 * --------------------------------------------------------------------------- */
1186	INSPIRO.flickr_widget = function () {
1187
1188		if ($flickr_widget.exists()) {
1189			$flickr_widget.each(function () {
1190
1191				var $elem = $(this),
1192					$flickrId = $elem.attr('data-flickr-id') || "52617155@N08",
1193					$flickrImages = $elem.attr('data-flickr-images') || "9";
1194
1195				$flickr_widget.jflickrfeed({
1196					limit: $flickrImages,
1197					qstrings: {
1198						id: $flickrId
1199					},
1200					itemTemplate: '<a href="{{image}}" title="{{title}}"><img src="{{image_s}}" alt="{{title}}" /></a>'
1201				}, function () {
1202					$elem.magnificPopup({
1203						delegate: 'a',
1204						type: 'image',
1205						gallery: {
1206							enabled: true
1207						}
1208					});
1209				});
1210			});
1211		}
1212	}
1213
1214	/* ---------------------------------------------------------------------------
1215	 * YOUTUBE BACKGROUND PLAYER
1216	 * --------------------------------------------------------------------------- */
1217	INSPIRO.youTubeBgPlayer = function () {
1218
1219		if ($ytPlayer.exists()) {
1220			$ytPlayer.each(function () {
1221
1222
1223				var elem = $(this),
1224					ytPlayerVideo = elem.attr('data-youtube-url') || null,
1225					ytPlayerMute = elem.attr('data-youtube-mute') || false,
1226					ytPlayerRatio = elem.attr('data-youtube-ratio') || '16/9',
1227					ytPlayerQuality = elem.attr('data-youtube-quality') || 'hd720',
1228					ytPlayerOpacity = elem.attr('data-youtube-opacity') || 1,
1229					ytPlayerContainer = elem.attr('data-youtube-container') || 'self',
1230					ytPlayerOptimize = elem.attr('data-youtube-optimize') || true,
1231					ytPlayerLoop = elem.attr('data-youtube-loop') || true,
1232					ytPlayerVolume = elem.attr('data-youtube-volume') || 1,
1233					ytPlayerStart = elem.attr('data-youtube-start') || 0,
1234					ytPlayerStop = elem.attr('data-youtube-stop') || 0,
1235					ytPlayerAutoPlay = elem.attr('data-youtube-autoplay') || false,
1236					ytPlayerFullScreen = elem.attr('data-youtube-fullscreen') || true,
1237					ytPlayerControls = elem.attr('data-youtube-controls') || false,
1238					ytPlayerLogo = elem.attr('data-youtube-controls') || false,
1239					ytPlayerAutoPause = elem.attr('data-youtube-autopause') || false;
1240
1241
1242				elem.mb_YTPlayer({
1243					videoURL: ytPlayerVideo,
1244					mute: ytPlayerMute,
1245					ratio: ytPlayerRatio,
1246					quality: ytPlayerQuality,
1247					opacity: ytPlayerOpacity,
1248					containment: ytPlayerContainer,
1249					optimizeDisplay: ytPlayerOptimize,
1250					loop: ytPlayerLoop,
1251					vol: ytPlayerVolume,
1252					startAt: ytPlayerStart,
1253					stopAt: ytPlayerStop,
1254					autoPlay: ytPlayerAutoPlay,
1255					realfullscreen: ytPlayerFullScreen,
1256					showYTLogo: ytPlayerLogo,
1257					showControls: ytPlayerControls
1258				});
1259
1260
1261
1262
1263				if (!ytPlayerAutoPlay) {
1264					elem.find("#youtube-background-controls").addClass("video-is-playing");
1265				}
1266
1267				elem.on("YTPReady", function () {
1268					$("#youtube-background-controls").on("click", function () {
1269
1270						if (!$(this).hasClass("video-is-playing")) {
1271							$(this).addClass("video-is-playing");
1272							$ytPlayer.YTPPause();
1273						} else {
1274							$(this).removeClass("video-is-playing");
1275							$ytPlayer.YTPPlay();
1276						}
1277						return false;
1278					});
1279
1280					var elemContainerHeight = elem.height();
1281
1282					if (ytPlayerAutoPause) {
1283						$window.on('scroll', function () {
1284							if ($window.scrollTop() > elemContainerHeight) {
1285								$("#youtube-background-controls").addClass("video-is-playing");
1286								$ytPlayer.YTPPause();
1287							}
1288
1289						});
1290
1291					}
1292
1293				});
1294
1295
1296
1297
1298			});
1299		}
1300	}
1301
1302
1303
1304
1305	//----------------------------------------------------/
1306	// Smoth Scroll
1307	//----------------------------------------------------/
1308	INSPIRO.smothScroll = function () {
1309
1310		if (!$mouseScroll.exists() && !$('#multiscroll').length) {
1311
1312			var platform = navigator.platform.toLowerCase(),
1313				scrollspeed = $body.attr('data-scroll-speed') || "600";
1314
1315			if (platform.indexOf('win') === 0 || platform.indexOf('linux') === 0) {
1316				$.srSmoothscroll({
1317					step: 120,
1318					speed: scrollspeed,
1319					ease: 'swing',
1320					target: $('body'),
1321					container: $window
1322				});
1323			}
1324		}
1325	};
1326
1327	//----------------------------------------------------/
1328	// Mouse Scroll
1329	//----------------------------------------------------/
1330	INSPIRO.mouseScroll = function () {
1331
1332		if ($mouseScroll.exists() && $body.hasClass('device-lg') || $body.hasClass('device-md')) {
1333						
1334			$.scrollify({
1335				section: "section",
1336				sectionName: "section-name",
1337				scrollSpeed: 1100,
1338				offset: - $header.height(),
1339				scrollbars: true,
1340			});
1341		}
1342	}
1343
1344	//Window load functions
1345	$window.load(function () {
1346		INSPIRO.progressBar(),
1347			INSPIRO.pieChart(),
1348			INSPIRO.masonryIsotope(),
1349			INSPIRO.carouselInspiro(),
1350			INSPIRO.animations()
1351	});
1352
1353
1354	//Document ready functions
1355	$document.ready(
1356		//INSPIRO.loader(),
1357		INSPIRO.responsiveClasses(),
1358		INSPIRO.stickyHeader(),
1359		INSPIRO.logoStatus(),
1360		INSPIRO.menuFix(),
1361		INSPIRO.verticalDotMenu(),
1362		INSPIRO.screenSizeControl(),
1363		INSPIRO.parallax(),
1364		INSPIRO.naTo(),
1365		INSPIRO.sidePanel(),
1366		INSPIRO.fullScreenPanel(),
1367		INSPIRO.multiScroll(),
1368		INSPIRO.smothScroll(),
1369		INSPIRO.mouseScroll(),
1370		INSPIRO.textRotator(),
1371		INSPIRO.accordion(),
1372		INSPIRO.tabs(),
1373		INSPIRO.counters(),
1374		INSPIRO.countdownTimer(),
1375		INSPIRO.youTubeBgPlayer(),
1376		INSPIRO.maps(),
1377		INSPIRO.lightBoxInspiro(),
1378		INSPIRO.resposniveVideos(),
1379		INSPIRO.tooltip(),
1380		INSPIRO.popover(),
1381		INSPIRO.flickr_widget(),
1382		INSPIRO.goToTop()
1383	);
1384
1385	//Document resize functions
1386	$window.resize(function () {
1387		INSPIRO.logoStatus(),
1388			INSPIRO.screenSizeControl(),
1389			INSPIRO.menuFix()
1390	});
1391
1392	//Document scrool functions
1393	$window.scroll(function () {
1394		INSPIRO.goToTop()
1395	});
1396
1397
1398})(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.