PageSourceSearch

https://fundacionjpgc.org/wp-content/plugins/js_composer/assets/js/js_composer_front.js?ver=4.8.1

js fundacionjpgc.org collected 2026-10-05 18:13:11 UTC 28,230 bytes, 921 lines download raw bytes

1document.documentElement.className += ' js_active ';
2document.documentElement.className += 'ontouchstart' in document.documentElement ? ' vc_mobile ' : ' vc_desktop ';
3(function () {
4	var prefix = [
5		'-webkit-',
6		'-moz-',
7		'-ms-',
8		'-o-',
9		''
10	];
11	for ( var i = 0;
12		  i < prefix.length;
13		  i ++ ) {
14		if ( prefix[ i ] + 'transform' in document.documentElement.style ) {
15			document.documentElement.className += " vc_transform ";
16		}
17	}
18})();
19/*
20 On document ready jQuery will fire set of functions.
21 If you want to override function behavior then copy it to your theme js file
22 with the same name.
23 */
24function vc_js() {
25	vc_twitterBehaviour();
26	vc_toggleBehaviour();
27	vc_tabsBehaviour();
28	vc_accordionBehaviour();
29	vc_teaserGrid();
30	vc_carouselBehaviour();
31	vc_slidersBehaviour();
32	vc_prettyPhoto();
33	vc_googleplus();
34	vc_pinterest();
35	vc_progress_bar();
36	vc_plugin_flexslider();
37	vc_google_fonts();
38	vc_gridBehaviour();
39	vc_rowBehaviour();
40	vc_ttaActivation(); // @since 4.5
41	jQuery( document ).trigger( 'vc_js' );
42	window.setTimeout( vc_waypoints, 500 );
43}
44
45if ( 'function' !== typeof(window[ 'vc_plugin_flexslider' ]) ) {
46	window.vc_plugin_flexslider = function ( $parent ) {
47		var $slider = $parent ? $parent.find( '.wpb_flexslider' ) : jQuery( '.wpb_flexslider' );
48		$slider.each( function () {
49			var this_element = jQuery( this );
50			var sliderSpeed = 800,
51				sliderTimeout = parseInt( this_element.attr( 'data-interval' ) ) * 1000,
52				sliderFx = this_element.attr( 'data-flex_fx' ),
53				slideshow = true;
54			if ( 0 === sliderTimeout ) {
55				slideshow = false;
56			}
57
58			this_element.is( ':visible' ) && this_element.flexslider( {
59				animation: sliderFx,
60				slideshow: slideshow,
61				slideshowSpeed: sliderTimeout,
62				sliderSpeed: sliderSpeed,
63				smoothHeight: true
64			} );
65		} );
66	};
67}
68
69/* Twitter
70 ---------------------------------------------------------- */
71if ( 'function' !== typeof(window[ 'vc_twitterBehaviour' ]) ) {
72	window.vc_twitterBehaviour = function () {
73		jQuery( '.wpb_twitter_widget .tweets' ).each( function ( index ) {
74			var this_element = jQuery( this ),
75				tw_name = this_element.attr( 'data-tw_name' ),
76				tw_count = this_element.attr( 'data-tw_count' );
77
78			this_element.tweet( {
79				username: tw_name,
80				join_text: "auto",
81				avatar_size: 0,
82				count: tw_count,
83				template: "{avatar}{join}{text}{time}",
84				auto_join_text_default: "",
85				auto_join_text_ed: "",
86				auto_join_text_ing: "",
87				auto_join_text_reply: "",
88				auto_join_text_url: "",
89				loading_text: '<span class="loading_tweets">loading tweets...</span>'
90			} );
91		} );
92	};
93}
94
95/* Google plus
96 ---------------------------------------------------------- */
97if ( 'function' !== typeof(window[ 'vc_googleplus' ]) ) {
98	window.vc_googleplus = function () {
99		if ( 0 < jQuery( '.wpb_googleplus' ).length ) {
100			(function () {
101				var po = document.createElement( 'script' );
102				po.type = 'text/javascript';
103				po.async = true;
104				po.src = 'https://apis.google.com/js/plusone.js';
105				var s = document.getElementsByTagName( 'script' )[ 0 ];
106				s.parentNode.insertBefore( po, s );
107			})();
108		}
109	}
110}
111
112/* Pinterest
113 ---------------------------------------------------------- */
114if ( 'function' !== typeof(window[ 'vc_pinterest' ]) ) {
115	window.vc_pinterest = function () {
116		if ( 0 < jQuery( '.wpb_pinterest' ).length ) {
117			(function () {
118				var po = document.createElement( 'script' );
119				po.type = 'text/javascript';
120				po.async = true;
121				po.src = 'http://assets.pinterest.com/js/pinit.js';
122				var s = document.getElementsByTagName( 'script' )[ 0 ];
123				s.parentNode.insertBefore( po, s );
124			})();
125		}
126	}
127}
128
129/* Progress bar
130 ---------------------------------------------------------- */
131if ( 'function' !== typeof(window[ 'vc_progress_bar' ] ) ) {
132	window.vc_progress_bar = function () {
133		if ( 'undefined' !== typeof(jQuery.fn.waypoint) ) {
134
135			jQuery( '.vc_progress_bar' ).waypoint( function () {
136				jQuery( this ).find( '.vc_single_bar' ).each( function ( index ) {
137					var $this = jQuery( this ),
138						bar = $this.find( '.vc_bar' ),
139						val = bar.data( 'percentage-value' );
140
141					setTimeout( function () {
142						bar.css( { "width": val + '%' } );
143					}, index * 200 );
144				} );
145			}, { offset: '85%' } );
146		}
147	}
148}
149
150/* Waypoints magic
151 ---------------------------------------------------------- */
152if ( 'function' !== typeof(window[ 'vc_waypoints' ] ) ) {
153	window.vc_waypoints = function () {
154		if ( 'undefined' !== typeof(jQuery.fn.waypoint ) ) {
155			jQuery( '.wpb_animate_when_almost_visible:not(.wpb_start_animation)' ).waypoint( function () {
156				jQuery( this ).addClass( 'wpb_start_animation' );
157			}, { offset: '85%' } );
158		}
159	}
160}
161
162/* Toggle/FAQ
163 ---------------------------------------------------------- */
164if ( 'function' !== typeof(window[ 'vc_toggleBehaviour' ] ) ) {
165	window.vc_toggleBehaviour = function ( $el ) {
166		function event( e ) {
167			e && e.preventDefault && e.preventDefault();
168			var title = jQuery( this );
169			var element = title.closest( '.vc_toggle' );
170			var content = element.find( '.vc_toggle_content' );
171			if ( element.hasClass( 'vc_toggle_active' ) ) {
172				content.slideUp( {
173					duration: 300,
174					complete: function () {
175						element.removeClass( 'vc_toggle_active' );
176					}
177				} );
178			} else {
179				content.slideDown( {
180					duration: 300,
181					complete: function () {
182						element.addClass( 'vc_toggle_active' );
183					}
184				} );
185			}
186		}
187
188		if ( $el ) {
189			if ( $el.hasClass( 'vc_toggle_title' ) ) {
190				$el.unbind( 'click' ).click( event );
191			} else {
192				$el.find( ".vc_toggle_title" ).unbind( 'click' ).click( event );
193			}
194		} else {
195			jQuery( ".vc_toggle_title" ).unbind( 'click' ).on( 'click', event );
196		}
197	}
198}
199
200/* Tabs + Tours
201 ---------------------------------------------------------- */
202if ( 'function' !== typeof(window[ 'vc_tabsBehaviour' ] ) ) {
203	window.vc_tabsBehaviour = function ( $tab ) {
204		if ( jQuery.ui ) {
205			var $call = $tab || jQuery( '.wpb_tabs, .wpb_tour' ),
206				ver = jQuery.ui && jQuery.ui.version ? jQuery.ui.version.split( '.' ) : '1.10',
207				old_version = 1 === parseInt( ver[ 0 ] ) && 9 > parseInt( ver[ 1 ] );
208			$call.each( function ( index ) {
209				var $tabs,
210					interval = jQuery( this ).attr( "data-interval" ),
211					tabs_array = [];
212				//
213				$tabs = jQuery( this ).find( '.wpb_tour_tabs_wrapper' ).tabs( {
214					show: function ( event, ui ) {
215						wpb_prepare_tab_content( event, ui );
216					},
217					beforeActivate: function ( event, ui ) {
218						1 !== ui.newPanel.index() && ui.newPanel.find( '.vc_pie_chart:not(.vc_ready)' );
219					},
220					activate: function ( event, ui ) {
221						wpb_prepare_tab_content( event, ui );
222					}
223				} );
224				if ( interval && 0 < interval ) {
225					try {
226						$tabs.tabs( 'rotate', interval * 1000 );
227					} catch ( e ) {
228						// nothing.
229						window.console && window.console.log && console.log( e );
230					}
231				}
232
233				jQuery( this ).find( '.wpb_tab' ).each( function () {
234					tabs_array.push( this.id );
235				} );
236
237				jQuery( this ).find( '.wpb_tabs_nav li' ).click( function ( e ) {
238					e.preventDefault();
239					if ( old_version ) {
240						$tabs.tabs( "select", jQuery( 'a', this ).attr( 'href' ) );
241					} else {
242						$tabs.tabs( "option", "active", jQuery( this ).index() );
243					}
244					return false;
245				} );
246
247				jQuery( this ).find( '.wpb_prev_slide a, .wpb_next_slide a' ).click( function ( e ) {
248					e.preventDefault();
249					if ( old_version ) {
250						var index = $tabs.tabs( 'option', 'selected' );
251						if ( jQuery( this ).parent().hasClass( 'wpb_next_slide' ) ) {
252							index ++;
253						}
254						else {
255							index --;
256						}
257						if ( 0 > index ) {
258							index = $tabs.tabs( "length" ) - 1;
259						}
260						else if ( index >= $tabs.tabs( "length" ) ) {
261							index = 0;
262						}
263						$tabs.tabs( "select", index );
264					} else {
265						var index = $tabs.tabs( "option", "active" ),
266							length = $tabs.find( '.wpb_tab' ).length;
267
268						if ( jQuery( this ).parent().hasClass( 'wpb_next_slide' ) ) {
269							index = (index + 1) >= length ? 0 : index + 1;
270						} else {
271							index = 0 > index - 1 ? length - 1 : index - 1;
272						}
273
274						$tabs.tabs( "option", "active", index );
275					}
276
277				} );
278
279			} );
280		}
281	}
282}
283
284/* Tabs + Tours
285 ---------------------------------------------------------- */
286if ( 'function' !== typeof(window[ 'vc_accordionBehaviour' ]) ) {
287	window.vc_accordionBehaviour = function () {
288		jQuery( '.wpb_accordion' ).each( function ( index ) {
289			var $this = jQuery( this );
290			var $tabs,
291				interval = $this.attr( "data-interval" ),
292				active_tab = ! isNaN( jQuery( this ).data( 'active-tab' ) ) && 0 < parseInt( $this.data( 'active-tab' ) ) ? parseInt( $this.data( 'active-tab' ) ) - 1 : false,
293				collapsible = false === active_tab || 'yes' === $this.data( 'collapsible' );
294			$tabs = $this.find( '.wpb_accordion_wrapper' ).accordion( {
295				header: "> div > h3",
296				autoHeight: false,
297				heightStyle: "content",
298				active: active_tab,
299				collapsible: collapsible,
300				navigation: true,
301
302				activate: vc_accordionActivate,
303				change: function ( event, ui ) {
304					if ( 'undefined' !== typeof(jQuery.fn.isotope) ) {
305						ui.newContent.find( '.isotope' ).isotope( "layout" );
306					}
307					vc_carouselBehaviour( ui.newPanel );
308				}
309			} );
310			if ( true === $this.data( 'vcDisableKeydown' ) ) {
311				$tabs.data( 'uiAccordion' )._keydown = function () {
312				};
313			}
314		} );
315	}
316}
317
318/* Teaser grid: isotope
319 ---------------------------------------------------------- */
320if ( 'function' !== typeof(window[ 'vc_teaserGrid' ]) ) {
321	window.vc_teaserGrid = function () {
322		var layout_modes = {
323			fitrows: 'fitRows',
324			masonry: 'masonry'
325		};
326		jQuery( '.wpb_grid .teaser_grid_container:not(.wpb_carousel), .wpb_filtered_grid .teaser_grid_container:not(.wpb_carousel)' ).each( function () {
327			var $container = jQuery( this );
328			var $thumbs = $container.find( '.wpb_thumbnails' );
329			var layout_mode = $thumbs.attr( 'data-layout-mode' );
330			$thumbs.isotope( {
331				// options
332				itemSelector: '.isotope-item',
333				layoutMode: ('undefined' === typeof(layout_modes[ layout_mode ]) ? 'fitRows' : layout_modes[ layout_mode ])
334			} );
335			$container.find( '.categories_filter a' ).data( 'isotope', $thumbs ).click( function ( e ) {
336				e.preventDefault();
337				var $thumbs = jQuery( this ).data( 'isotope' );
338				jQuery( this ).parent().parent().find( '.active' ).removeClass( 'active' );
339				jQuery( this ).parent().addClass( 'active' );
340				$thumbs.isotope( { filter: jQuery( this ).attr( 'data-filter' ) } );
341			} );
342			jQuery( window ).bind( 'load resize', function () {
343				$thumbs.isotope( "layout" );
344			} );
345		} );
346	}
347}
348
349if ( 'function' !== typeof(window[ 'vc_carouselBehaviour' ]) ) {
350	window.vc_carouselBehaviour = function ( $parent ) {
351		var $carousel = $parent ? $parent.find( ".wpb_carousel" ) : jQuery( ".wpb_carousel" );
352		$carousel.each( function () {
353			var $this = jQuery( this );
354			if ( true !== $this.data( 'carousel_enabled' ) && $this.is( ':visible' ) ) {
355				$this.data( 'carousel_enabled', true );
356				var visible_count = getColumnsCount( jQuery( this ) ),
357					carousel_speed = 500;
358				if ( jQuery( this ).hasClass( 'columns_count_1' ) ) {
359					carousel_speed = 900;
360				}
361				/* Get margin-left value from the css grid and apply it to the carousele li items (margin-right), before carousele initialization */
362				var carousele_li = jQuery( this ).find( '.wpb_thumbnails-fluid li' );
363				carousele_li.css( { "margin-right": carousele_li.css( "margin-left" ), "margin-left": 0 } );
364
365				jQuery( this ).find( '.wpb_wrapper:eq(0)' ).jCarouselLite( {
366					btnNext: jQuery( this ).find( '.next' ),
367					btnPrev: jQuery( this ).find( '.prev' ),
368					visible: visible_count,
369					speed: carousel_speed
370				} )
371					.width( '100%' );
372
373				var fluid_ul = jQuery( this ).find( 'ul.wpb_thumbnails-fluid' );
374				fluid_ul.width( fluid_ul.width() + 300 );
375
376				jQuery( window ).resize( function () {
377					var before_resize = screen_size;
378					screen_size = getSizeName();
379					if ( before_resize != screen_size ) {
380						window.setTimeout( 'location.reload()', 20 );
381					}
382				} );
383			}
384
385		} );
386	}
387}
388
389if ( 'function' !== typeof(window[ 'vc_slidersBehaviour' ]) ) {
390	window.vc_slidersBehaviour = function () {
391		jQuery( '.wpb_gallery_slides' ).each( function ( index ) {
392			var this_element = jQuery( this );
393			var $imagesGrid;
394
395			if ( this_element.hasClass( 'wpb_slider_nivo' ) ) {
396				var sliderSpeed = 800,
397					sliderTimeout = this_element.attr( 'data-interval' ) * 1000;
398
399				if ( 0 === sliderTimeout ) {
400					sliderTimeout = 9999999999;
401				}
402
403				this_element.find( '.nivoSlider' ).nivoSlider( {
404					effect: 'boxRainGrow,boxRain,boxRainReverse,boxRainGrowReverse', // Specify sets like: 'fold,fade,sliceDown'
405					slices: 15, // For slice animations
406					boxCols: 8, // For box animations
407					boxRows: 4, // For box animations
408					animSpeed: sliderSpeed, // Slide transition speed
409					pauseTime: sliderTimeout, // How long each slide will show
410					startSlide: 0, // Set starting Slide (0 index)
411					directionNav: true, // Next & Prev navigation
412					directionNavHide: true, // Only show on hover
413					controlNav: true, // 1,2,3... navigation
414					keyboardNav: false, // Use left & right arrows
415					pauseOnHover: true, // Stop animation while hovering
416					manualAdvance: false, // Force manual transitions
417					prevText: 'Prev', // Prev directionNav text
418					nextText: 'Next' // Next directionNav text
419				} );
420			}
421			else if ( this_element.hasClass( 'wpb_image_grid' ) ) {
422				if ( jQuery.fn.imagesLoaded ) {
423					$imagesGrid = this_element.find( '.wpb_image_grid_ul' ).imagesLoaded( function () {
424						$imagesGrid.isotope( {
425							// options
426							itemSelector: '.isotope-item',
427							layoutMode: 'fitRows'
428						} );
429					} );
430				} else {
431					this_element.find( '.wpb_image_grid_ul' ).isotope( {
432						// options
433						itemSelector: '.isotope-item',
434						layoutMode: 'fitRows'
435					} );
436				}
437			}
438		} );
439	}
440}
441
442if ( 'function' !== typeof(window[ 'vc_prettyPhoto' ]) ) {
443	window.vc_prettyPhoto = function () {
444		try {
445			// just in case. maybe prettyphoto isn't loaded on this site
446			if ( jQuery && jQuery.fn && jQuery.fn.prettyPhoto ) {
447				jQuery( 'a.prettyphoto, .gallery-icon a[href*=".jpg"]' ).prettyPhoto( {
448					animationSpeed: 'normal', /* fast/slow/normal */
449					padding: 15, /* padding for each side of the picture */
450					opacity: 0.7, /* Value betwee 0 and 1 */
451					showTitle: true, /* true/false */
452					allowresize: true, /* true/false */
453					counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
454					//theme: 'light_square', /* light_rounded / dark_rounded / light_square / dark_square */
455					hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
456					deeplinking: false, /* Allow prettyPhoto to update the url to enable deeplinking. */
457					modal: false, /* If set to true, only the close button will close the window */
458					callback: function () {
459						var url = location.href;
460						var hashtag = (url.indexOf( '#!prettyPhoto' )) ? true : false;
461						if ( hashtag ) {
462							location.hash = "!";
463						}
464					} /* Called when prettyPhoto is closed */,
465					social_tools: ''
466				} );
467			}
468		} catch ( err ) {
469			window.console && window.console.log && console.log( err );
470		}
471	}
472}
473
474if ( 'function' !== typeof(window[ 'vc_google_fonts' ]) ) {
475	window.vc_google_fonts = function () {
476		return false; // TODO: check this for what this is needed
477	}
478}
479window.vcParallaxSkroll = false;
480if ( 'function' !== typeof(window[ 'vc_rowBehaviour' ]) ) {
481	window.vc_rowBehaviour = function () {
482		var $ = window.jQuery;
483
484		function localFunction() {
485			var $elements = $( '[data-vc-full-width="true"]' );
486			$.each( $elements, function ( key, item ) {
487				var $el = $( this );
488				$el.addClass( 'vc_hidden' );
489
490				var $el_full = $el.next( '.vc_row-full-width' );
491				var el_margin_left = parseInt( $el.css( 'margin-left' ), 10 );
492				var el_margin_right = parseInt( $el.css( 'margin-right' ), 10 );
493				var offset = 0 - $el_full.offset().left - el_margin_left;
494				var width = $( window ).width();
495				$el.css( {
496					'position': 'relative',
497					'left': offset,
498					'box-sizing': 'border-box',
499					'width': $( window ).width()
500				} );
501				if ( ! $el.data( 'vcStretchContent' ) ) {
502					var padding = (- 1 * offset);
503					if ( 0 > padding ) {
504						padding = 0;
505					}
506					var paddingRight = width - padding - $el_full.width() + el_margin_left + el_margin_right;
507					if ( 0 > paddingRight ) {
508						paddingRight = 0;
509					}
510					$el.css( { 'padding-left': padding + 'px', 'padding-right': paddingRight + 'px' } );
511				}
512				$el.attr( "data-vc-full-width-init", "true" );
513				$el.removeClass( 'vc_hidden' );
514			} );
515		}
516
517		/**
518		 * @todo refactor as plugin.
519		 * @returns {*}
520		 */
521		function parallaxRow() {
522			var vcSkrollrOptions, vcParallaxSkroll,
523				callSkrollInit = false;
524			if ( vcParallaxSkroll ) {
525				vcParallaxSkroll.destroy();
526			}
527			$( '.vc_parallax-inner' ).remove();
528			$( '[data-5p-top-bottom]' ).removeAttr( 'data-5p-top-bottom data-30p-top-bottom' );
529			$( '[data-vc-parallax]' ).each( function () {
530				var skrollrSpeed,
531					skrollrSize,
532					skrollrStart,
533					skrollrEnd,
534					$parallaxElement,
535					parallaxImage,
536					youtubeId;
537				callSkrollInit = true; // Enable skrollinit;
538				if ( 'on' === $( this ).data( 'vcParallaxOFade' ) ) {
539					$( this ).children().attr( 'data-5p-top-bottom', 'opacity:0;' ).attr( 'data-30p-top-bottom',
540						'opacity:1;' );
541				}
542
543				skrollrSize = $( this ).data( 'vcParallax' ) * 100;
544				$parallaxElement = $( '<div />' ).addClass( 'vc_parallax-inner' ).appendTo( $( this ) );
545				$parallaxElement.height( skrollrSize + '%' );
546
547				parallaxImage = $( this ).data( 'vcParallaxImage' );
548
549				youtubeId = vcExtractYoutubeId( parallaxImage );
550
551				if ( youtubeId ) {
552					insertYoutubeVideoAsBackground( $parallaxElement, youtubeId );
553				} else if ( 'undefined' !== typeof(parallaxImage) ) {
554					$parallaxElement.css( 'background-image', 'url(' + parallaxImage + ')' );
555				}
556
557				skrollrSpeed = skrollrSize - 100;
558				skrollrStart = - skrollrSpeed;
559				skrollrEnd = 0;
560
561				$parallaxElement.attr( 'data-bottom-top', 'top: ' + skrollrStart + '%;' ).attr( 'data-top-bottom',
562					'top: ' + skrollrEnd + '%;' );
563			} );
564
565			if ( callSkrollInit && window.skrollr ) {
566				vcSkrollrOptions = {
567					forceHeight: false,
568					smoothScrolling: false,
569					mobileCheck: function () {
570						return false;
571					}
572				};
573				vcParallaxSkroll = skrollr.init( vcSkrollrOptions );
574				return vcParallaxSkroll;
575			}
576			return false;
577		}
578
579		/**
580		 * @todo refactor as plugin.
581		 * @returns {*}
582		 */
583		function fullHeightRow() {
584			$( '.vc_row-o-full-height:first' ).each( function () {
585				var $window,
586					windowHeight,
587					offsetTop,
588					fullHeight;
589				$window = $( window );
590				windowHeight = $window.height();
591				offsetTop = $( this ).offset().top;
592				if ( offsetTop < windowHeight ) {
593					fullHeight = 100 - offsetTop / (windowHeight / 100);
594					$( this ).css( 'min-height', fullHeight + 'vh' );
595				}
596			} );
597		}
598
599		function fixIeFlexbox() {
600			var ua = window.navigator.userAgent;
601			var msie = ua.indexOf("MSIE ");
602
603			if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)){
604				$( '.vc_row-o-full-height' ).each( function () {
605					if ($( this ).css( 'display') === 'flex') {
606						$( this ).wrap('<div class="vc_ie-flexbox-fixer"></div>')
607					}
608				} );
609			}
610		}
611
612		$( window ).unbind( 'resize.vcRowBehaviour' ).bind( 'resize.vcRowBehaviour', localFunction );
613		$( window ).bind( 'resize.vcRowBehaviour', fullHeightRow );
614		localFunction();
615		fullHeightRow();
616		fixIeFlexbox();
617		initVideoBackgrounds(); // must be called before parallax
618		parallaxRow();
619	}
620}
621
622if ( 'function' !== typeof(window[ 'vc_gridBehaviour' ]) ) {
623	window.vc_gridBehaviour = function () {
624		jQuery.fn.vcGrid && jQuery( '[data-vc-grid]' ).vcGrid();
625	}
626}
627/* Helper
628 ---------------------------------------------------------- */
629if ( 'function' !== typeof(window[ 'getColumnsCount' ]) ) {
630	window.getColumnsCount = function ( el ) {
631		var find = false,
632			i = 1;
633
634		while ( false === find ) {
635			if ( el.hasClass( 'columns_count_' + i ) ) {
636				find = true;
637				return i;
638			}
639			i ++;
640		}
641	}
642}
643
644var screen_size = getSizeName();
645function getSizeName() {
646	var screen_w = jQuery( window ).width();
647
648	if ( 1170 < screen_w ) {
649		return 'desktop_wide';
650	}
651
652	if ( 960 < screen_w && 1169 > screen_w ) {
653		return 'desktop';
654	}
655
656	if ( 768 < screen_w && 959 > screen_w ) {
657		return 'tablet';
658	}
659
660	if ( 300 < screen_w && 767 > screen_w ) {
661		return 'mobile';
662	}
663
664	if ( 300 > screen_w ) {
665		return 'mobile_portrait';
666	}
667
668	return '';
669}
670
671function loadScript( url, $obj, callback ) {
672
673	var script = document.createElement( "script" );
674	script.type = "text/javascript";
675
676	if ( script.readyState ) {  //IE
677		script.onreadystatechange = function () {
678			if ( "loaded" === script.readyState ||
679				"complete" === script.readyState ) {
680				script.onreadystatechange = null;
681				callback();
682			}
683		};
684	} else {
685		//Others
686	}
687
688	script.src = url;
689	$obj.get( 0 ).appendChild( script );
690}
691
692if ( 'function' !== typeof(window[ 'wpb_prepare_tab_content' ]) ) {
693	/**
694	 * Prepare html to correctly display inside tab container
695	 *
696	 * @param event - ui tab event 'show'
697	 * @param ui - jquery ui tabs object
698	 */
699	window.wpb_prepare_tab_content = function ( event, ui ) {
700		var panel = ui.panel || ui.newPanel,
701			$pie_charts = panel.find( '.vc_pie_chart:not(.vc_ready)' ),
702			$round_charts = panel.find( '.vc_round-chart' ),
703			$line_charts = panel.find( '.vc_line-chart' ),
704			$carousel = panel.find( '[data-ride="vc_carousel"]' ),
705			$ui_panel, $google_maps;
706		vc_carouselBehaviour();
707		vc_plugin_flexslider( panel );
708		if ( ui.newPanel.find( '.vc_masonry_media_grid, .vc_masonry_grid' ).length ) {
709			ui.newPanel.find( '.vc_masonry_media_grid, .vc_masonry_grid' ).each( function () {
710				var grid = jQuery( this ).data( 'vcGrid' );
711				grid && grid.gridBuilder && grid.gridBuilder.setMasonry && grid.gridBuilder.setMasonry();
712			} );
713		}
714		if ( panel.find( '.vc_masonry_media_grid, .vc_masonry_grid' ).length ) {
715			panel.find( '.vc_masonry_media_grid, .vc_masonry_grid' ).each( function () {
716				var grid = jQuery( this ).data( 'vcGrid' );
717				grid && grid.gridBuilder && grid.gridBuilder.setMasonry && grid.gridBuilder.setMasonry();
718			} );
719		}
720		$pie_charts.length && jQuery.fn.vcChat && $pie_charts.vcChat();
721		$round_charts.length && jQuery.fn.vcRoundChart && $round_charts.vcRoundChart( { reload: false } );
722		$line_charts.length && jQuery.fn.vcLineChart && $line_charts.vcLineChart( { reload: false } );
723		$carousel.length && jQuery.fn.carousel && $carousel.carousel( 'resizeAction' );
724		$ui_panel = panel.find( '.isotope, .wpb_image_grid_ul' ); // why var name '$ui_panel'?
725		$google_maps = panel.find( '.wpb_gmaps_widget' );
726		if ( 0 < $ui_panel.length ) {
727			$ui_panel.isotope( "layout" );
728		}
729		if ( $google_maps.length && ! $google_maps.is( '.map_ready' ) ) {
730			var $frame = $google_maps.find( 'iframe' );
731			$frame.attr( 'src', $frame.attr( 'src' ) );
732			$google_maps.addClass( 'map_ready' );
733		}
734		if ( panel.parents( '.isotope' ).length ) {
735			panel.parents( '.isotope' ).each( function () {
736				jQuery( this ).isotope( "layout" );
737			} );
738		}
739	}
740}
741function vc_ttaActivation() {
742	jQuery( '[data-vc-accordion]' ).on( 'show.vc.accordion', function ( e ) {
743		var $ = window.jQuery, ui = {};
744		ui.newPanel = $( this ).data( 'vc.accordion' ).getTarget();
745		window.wpb_prepare_tab_content( e, ui );
746	} );
747}
748
749function vc_accordionActivate( event, ui ) {
750	if ( ui.newPanel.length && ui.newHeader.length ) {
751		var $pie_charts = ui.newPanel.find( '.vc_pie_chart:not(.vc_ready)' ),
752			$round_charts = ui.newPanel.find( '.vc_round-chart' ),
753			$line_charts = ui.newPanel.find( '.vc_line-chart' ),
754			$carousel = ui.newPanel.find( '[data-ride="vc_carousel"]' );
755		if ( 'undefined' !== typeof(jQuery.fn.isotope) ) {
756			ui.newPanel.find( '.isotope, .wpb_image_grid_ul' ).isotope( "layout" );
757		}
758		if ( ui.newPanel.find( '.vc_masonry_media_grid, .vc_masonry_grid' ).length ) {
759			ui.newPanel.find( '.vc_masonry_media_grid, .vc_masonry_grid' ).each( function () {
760				var grid = jQuery( this ).data( 'vcGrid' );
761				grid && grid.gridBuilder && grid.gridBuilder.setMasonry && grid.gridBuilder.setMasonry();
762			} );
763		}
764		vc_carouselBehaviour( ui.newPanel );
765		vc_plugin_flexslider( ui.newPanel );
766		$pie_charts.length && jQuery.fn.vcChat && $pie_charts.vcChat();
767		$round_charts.length && jQuery.fn.vcRoundChart && $round_charts.vcRoundChart( { reload: false } );
768		$line_charts.length && jQuery.fn.vcLineChart && $line_charts.vcLineChart( { reload: false } );
769		$carousel.length && jQuery.fn.carousel && $carousel.carousel( 'resizeAction' );
770		if ( ui.newPanel.parents( '.isotope' ).length ) {
771			ui.newPanel.parents( '.isotope' ).each( function () {
772				jQuery( this ).isotope( "layout" );
773			} );
774		}
775	}
776}
777
778/**
779 * Reinitialize all video backgrounds
780 */
781function initVideoBackgrounds() {
782	jQuery( '.vc_row' ).each( function () {
783		var $row = jQuery( this ),
784			youtubeUrl,
785			youtubeId;
786
787		if ( $row.data( 'vcVideoBg' ) ) {
788			youtubeUrl = $row.data( 'vcVideoBg' );
789			youtubeId = vcExtractYoutubeId( youtubeUrl );
790
791			if ( youtubeId ) {
792				$row.find( '.vc_video-bg' ).remove();
793				insertYoutubeVideoAsBackground( $row, youtubeId );
794			}
795
796			jQuery( window ).on( 'grid:items:added', function ( event, $grid ) {
797				if ( ! $row.has( $grid ).length ) {
798					return;
799				}
800
801				vcResizeVideoBackground( $row );
802			} );
803		} else {
804			$row.find( '.vc_video-bg' ).remove();
805		}
806	} );
807}
808
809/**
810 * Insert youtube video into element.
811 *
812 * Video will be w/o controls, muted, autoplaying and looping.
813 */
814function insertYoutubeVideoAsBackground( $element, youtubeId, counter ) {
815	if ( 'undefined' === typeof( YT.Player ) ) {
816		// wait for youtube iframe api to load. try for 10sec, then abort
817		counter = 'undefined' === typeof( counter ) ? 0 : counter;
818		if ( 100 < counter ) {
819			console.warn( 'Too many attempts to load YouTube api' );
820			return;
821		}
822
823		setTimeout( function () {
824			insertYoutubeVideoAsBackground( $element, youtubeId, counter ++ );
825		}, 100 );
826
827		return;
828	}
829
830	var $container = $element.prepend( '<div class="vc_video-bg"><div class="inner"></div></div>' ).find( '.inner' );
831
832	new YT.Player( $container[ 0 ], {
833		width: '100%',
834		height: '100%',
835		videoId: youtubeId,
836		playerVars: {
837			playlist: youtubeId,
838			iv_load_policy: 3, // hide annotations
839			enablejsapi: 1,
840			disablekb: 1,
841			autoplay: 1,
842			controls: 0,
843			showinfo: 0,
844			rel: 0,
845			loop: 1
846		},
847		events: {
848			onReady: function ( event ) {
849				event.target.mute().setLoop( true );
850			}
851		}
852	} );
853
854	vcResizeVideoBackground( $element );
855
856	jQuery( window ).bind( 'resize', function () {
857		vcResizeVideoBackground( $element );
858	} );
859}
860
861/**
862 * Resize background video iframe so that video content covers whole area
863 */
864function vcResizeVideoBackground( $element ) {
865	var iframeW,
866		iframeH,
867		marginLeft,
868		marginTop,
869		containerW = $element.innerWidth(),
870		containerH = $element.innerHeight(),
871		ratio1 = 16,
872		ratio2 = 9;
873
874	if ( ( containerW / containerH ) < ( ratio1 / ratio2 ) ) {
875		iframeW = containerH * (ratio1 / ratio2);
876		iframeH = containerH;
877
878		marginLeft = - Math.round( ( iframeW - containerW ) / 2 ) + 'px';
879		marginTop = - Math.round( ( iframeH - containerH ) / 2 ) + 'px';
880
881		iframeW += 'px';
882		iframeH += 'px';
883	} else {
884		iframeW = containerW;
885		iframeH = containerW * (ratio2 / ratio1);
886
887		marginTop = - Math.round( ( iframeH - containerH ) / 2 ) + 'px';
888		marginLeft = - Math.round( ( iframeW - containerW ) / 2 ) + 'px';
889
890		iframeW += 'px';
891		iframeH += 'px';
892	}
893
894	$element.find( '.vc_video-bg iframe' ).css( {
895		maxWidth: '1000%',
896		marginLeft: marginLeft,
897		marginTop: marginTop,
898		width: iframeW,
899		height: iframeH
900	} );
901}
902
903/**
904 * Extract video ID from youtube url
905 */
906function vcExtractYoutubeId( url ) {
907	if ( 'undefined' === typeof(url) ) {
908		return false;
909	}
910
911	var id = url.match( /(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/ );
912
913	if ( null !== id ) {
914		return id[ 1 ];
915	}
916
917	return false;
918}
919jQuery( document ).ready( function ( $ ) {
920	window.vc_js();
921} );

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.