PageSourceSearch

https://ghayb.com/wp-content/plugins/frontend_builder/js/shortcodes.js?ver=1.0

js ghayb.com collected 2026-09-25 04:30:37 UTC 63,143 bytes, 1,627 lines download raw bytes

1if(typeof window.onYouTubeIframeAPIReady == 'undefined') {
2	window.onYouTubeIframeAPIReady = function() {};
3	
4}
5	function fbuilderYoutube() {};
6
7(function($){
8	
9		
10	$.fn.frb_refresh = function(bodyRefresh){
11		
12		//			audio - - start
13		$(this).find('.frb_audio_player').each(function(){
14			var options = $(this).data('frb_options').split('|'), volume = 1, thisReference = $(this);
15			
16			thisReference.find('.frb_mute_button,.frb_muted_button').data('volume',volume);
17			thisReference.find('.frb_mute_button,.frb_muted_button').data('volume');
18
19			if (options[3]=='true'){$(this).css('display','none');}
20			var duration=0, src_mp3=options[4], src_ogg=options[5], startingTime = parseInt(options[6]), song = thisReference.find('audio')[0];
21			
22			song.preload = 'metadata';
23			if (song.canPlayType('audio/mpeg;')) {
24			    song.type= 'audio/mpeg';
25			    song.src= src_mp3;
26			} else {
27			    song.type= 'audio/ogg';
28			    song.src= src_ogg;
29			}
30			 
31			song.addEventListener('loadedmetadata', function() {
32				duration = song.duration;
33	 
34				var hours = parseInt( duration / 3600 ) % 24, minutes = parseInt( duration / 60 ) % 60, seconds = Math.ceil(duration % 60),
35					result = (hours!=0 ? (hours < 10 ? "0" + hours + ":" : hours + ":" ) : '' ) + (minutes!=0 ? ( minutes < 10 ? "0" + minutes : minutes) : "00") + ":" + (seconds  < 10 ? "0" + seconds : seconds);
36
37				thisReference.find(".frb_full_time").text(result);
38				thisReference.find(".frb_time_slider").slider({
39					create: function(event, ui) {
40						$(this).slider("option", "value",startingTime);
41						song.currentTime = $(this).slider("option", "value");
42					},
43					stop: function( event, ui ) {
44						song.currentTime = $(this).slider("option", "value");
45			 		},
46		 			change: function(event, ui){
47				 		var value = $(this).slider("option", "value");
48				 		hours = parseInt( value / 3600 ) % 24;
49					 	minutes = parseInt( value / 60 ) % 60;
50						seconds = Math.ceil(value % 60);
51						result = (hours!=0 ? (hours < 10 ? "0" + hours + ":" : hours + ":" ) : '' ) + (minutes!=0 ? ( minutes < 10 ? "0" + minutes : minutes) : "00") + ":" + (seconds  < 10 ? "0" + seconds : seconds);
52						thisReference.find(".frb_current_time").text(result);
53					},
54				 	max: Math.ceil(duration),
55				 	step: 0.01, 
56				 	range:"min"
57			 	});	
58			 	
59			 	
60			 	thisReference.find(".frb_volume_slider").slider({
61				 	slide: function(event, ui){
62				 		song.volume = $(this).slider("option", "value");
63				 		if (song.volume == 0) {
64						thisReference.find('.frb_mute_button, .frb_muted_button').removeClass('frb_mute_button frb_muted_button frb_volume_down').addClass('frb_muted_button');
65						} else if (song.volume<0.5) {
66						thisReference.find('.frb_mute_button, .frb_muted_button').removeClass('frb_mute_button frb_muted_button frb_volume_down').addClass('frb_mute_button frb_volume_down');
67						} else {
68						thisReference.find('.frb_mute_button, .frb_muted_button').removeClass('frb_mute_button frb_muted_button frb_volume_down').addClass('frb_mute_button');	
69						}
70						
71					},
72					change: function( event, ui ) {
73						if ($(this).slider("option", "value")!=0) {
74							volume = $(this).slider("option", "value");
75							thisReference.find('.frb_mute_button,.frb_muted_button').data('volume',volume);
76						}
77						song.volume = $(this).slider("option", "value");
78
79				 		if (song.volume == 0) {
80						thisReference.find('.frb_mute_button, .frb_muted_button').removeClass('frb_mute_button frb_muted_button frb_volume_down').addClass('frb_muted_button');
81						} else if (song.volume<0.5) {
82						thisReference.find('.frb_mute_button, .frb_muted_button').removeClass('frb_mute_button frb_muted_button frb_volume_down').addClass('frb_mute_button frb_volume_down');
83						} else {
84						thisReference.find('.frb_mute_button, .frb_muted_button').removeClass('frb_mute_button frb_muted_button frb_volume_down').addClass('frb_mute_button');	
85						}
86				 	},
87				 	max: 1,
88				 	min: 0,
89				 	step: 0.01, 
90				 	range:"min",
91				 	value:1
92				 });	
93			 	
94			 	
95				var timeBarWidth = thisReference.width()-thisReference.find('.frb_play_button').outerWidth(true)-thisReference.find('.frb_mute_button').outerWidth(true)-thisReference.find('.frb_stop_button').outerWidth(true)-thisReference.find(".frb_volume_slider").outerWidth(true)-85;
96				var timeBarWidthSmall = thisReference.width()-thisReference.find('.frb_play_button').outerWidth(true)-thisReference.find('.frb_stop_button').outerWidth(true)-85;
97
98				if (timeBarWidth>0){
99					thisReference.find(".frb_time_slider").outerWidth(timeBarWidth);
100				} else {
101					thisReference.find(".frb_time_slider").outerWidth(timeBarWidthSmall);
102				}
103				
104				if (options[0]=='true') {
105					thisReference.find('.frb_play_button').removeClass('frb_play_button').addClass('frb_pause_button');
106					song.autoplay=true;
107				}
108				if (options[1]=='true') {song.loop=true;}
109				if (options[2]=='true') {
110					song.volume=0;
111					thisReference.find('.frb_mute_button').removeClass('frb_mute_button').addClass('frb_muted_button');
112			  		thisReference.find('.frb_volume_slider').slider( "option", "value", 0 );
113				}
114				song.addEventListener('timeupdate',function (){
115 					curtime = parseFloat(song.currentTime);
116   					if (!thisReference.find(".frb_time_slider .ui-slider-handle").hasClass('ui-state-active')){
117       					thisReference.find( ".frb_time_slider" ).slider( "option", "value", curtime );
118       				}
119    				});
120				song.addEventListener('ended',function (){
121    				thisReference.find('.frb_pause_button').removeClass('frb_pause_button').addClass('frb_play_button');
122    				thisReference.find(".frb_time_slider" ).slider( "option", "value", 0 );
123    				});
124 			});
125		});
126		
127		//			audio - - end
128		
129		$(this).find('.frb_accordion').each(function(){
130			var collapse = true;
131			var collapseInd = false;
132			var heightStyle;
133			if($(this).attr('data-fixedheight') != 'true')
134				heightStyle = 'content';
135			else
136				heightStyle = 'auto';
137				
138			$(this).find('h3').each(function(index){
139				if($(this).hasClass('ui-state-active')) {
140					collapse = false;
141					collapseInd = index;
142					return false;
143				}
144			});
145			$(this).accordion({
146				collapsible : collapse,
147				active : collapseInd,
148				heightStyle : heightStyle
149			});
150		});
151		$(this).find('.frb_tabs').each(function(){
152			var hashtag = window.location.hash;
153			if(hashtag != '' && $(this).find(hashtag).length > 0) {
154				$(this).children('ul').find('a.active').removeClass('active');
155				$(this).chldren('ul').find('a[href='+hashtag+']').trigger('click');
156			}
157			else if($(this).children('ul').find('.active').length>0) {
158				$(this).children('ul').find('a.active').removeClass('active').trigger('click');
159			}
160			else {
161				$(this).children('ul').find('a:first').trigger('click');
162			}
163		});
164		
165		$(this).find('.frb_tour').each(function(){
166			var hashtag = window.location.hash;
167			if(hashtag != '' && $(this).find(hashtag).length > 0) {
168				$(this).children('ul').find('a.active').removeClass('active');
169				$(this).children('ul').find('a[href='+hashtag+']').trigger('click');
170			}
171			else if($(this).children('ul').find('.active').length>0) {
172				$(this).children('ul').find('a.active').removeClass('active').trigger('click');
173			}
174			else {
175				$(this).children('ul').find('a:first').trigger('click');
176			}
177			
178			$(this).find(".frb_tour-content").css("min-height", $(this).find("ul:first").height()+"px");
179		});
180		
181		$(this).find('.frb_toggle').each(function(){
182			var maxHeight = -1;
183			var itemContent = $(this).find(".frb_toggle_item_content");
184			
185			if ($(this).hasClass('frb_fixed_h')) {
186				maxHeight = itemContent.map(function ()
187					{
188			 		   return $(this).height();
189					}).get();
190					
191					maxHeight = Math.max.apply(null, maxHeight);
192			}
193			
194			$(this).find('.frb_toggle_item').each(function(){	
195
196			var itemContent = $(this).children(".frb_toggle_item_content");
197			if (maxHeight == -1)
198				$(this).data("itemHeight",itemContent.height());
199			else
200				$(this).data("itemHeight",maxHeight);
201			
202				if ($(this).children("input:checked").length != 0 )
203					itemContent.height($(this).data("itemHeight")+"px").prev().find("i").addClass("ba-minus");
204				else 
205					itemContent.height("0px").prev().find("i").addClass("ba-plus");
206			});
207		});
208	  
209		//swiper slider
210
211		$(this).find('.frb-swiper-container').each(function(){
212			if(!$(this).hasClass('initiated')) {
213				$(this).addClass('initiated');
214				var modid = $(this).closest('.fbuilder_module').attr('data-modid');
215				var sliderId = $(this).parent().attr('id');
216				var options = {
217			    	pagination: '#'+sliderId+' .frb-swiper-pagination',
218			   		loop:true,
219			   	 	grabCursor: true,
220			   	 	slidesPerView: parseInt($(this).attr('data-slidesPerView')),
221				    paginationClickable: true,
222					calculateHeight:true, 
223					resizeReInit: true,
224					updateOnImagesReady: true, 
225					mode: $(this).attr('data-mode')
226				}
227				if(typeof $(this).attr('data-min-res-width') == 'undefined') {
228					$(this).attr('data-min-res-width', 1);
229				}
230				if($(this).attr('data-autoplay') != '') options['autoplay'] = parseInt($(this).attr('data-autoplay'));
231				
232				var height = 0;
233
234					$(this).find('.swiper-slide').each(function(){
235						if (options['mode'] != 'horizontal') {
236						$(this).css('width','100%');
237						if($(this).height() > height) height = $(this).height()*options['slidesPerView'];
238						$(this).css('height', height+'px');
239					    options['calculateHeight'] = false;
240					}
241					});
242					
243
244				if(typeof bodyRefresh != 'undefined' && bodyRefresh == true) {
245					$('#'+sliderId+' .frb-swiper-container').hide();
246					$(window).load(function(){
247						$('#'+sliderId+' .frb-swiper-container').each(function(){
248							$(this).show();
249							var mySwiper = new Swiper(this, options);
250							$(this).find('.frb-swiper-nav-left').click(function(){mySwiper.swipePrev()});
251							$(this).find('.frb-swiper-nav-right').click(function(){mySwiper.swipeNext()});
252							$(this).data('swiper_controls', mySwiper);
253							frbSliderResponsive($(this));
254							$(this).find('a[rel^="frbprettyphoto"]').prettyPhoto();
255							mySwiper.swipeTo(0, 0, false);
256						});
257					});
258				}
259				else {
260					$('#'+sliderId+' .frb-swiper-container').each(function(){
261						var mySwiper = new Swiper(this, options);
262						$(this).find('.frb-swiper-nav-left').click(function(){mySwiper.swipePrev()});
263						$(this).find('.frb-swiper-nav-right').click(function(){mySwiper.swipeNext()});
264						$(this).data('swiper_controls', mySwiper);
265						frbSliderResponsive($(this));
266						$(this).find('a[rel^="frbprettyphoto"]').prettyPhoto();
267						mySwiper.swipeTo(0, 0, false);
268					});
269				}
270			}
271		});
272		
273		
274		
275		if($(this).find('.frb_percentage_bar').attr('data-onscreen') == 'true'){
276			$(this).find('.frb_percentage_bar').each(function(){
277				$(this).frbPercentageBars();});
278		}
279		
280		if($(this).attr('data-onscreen') == 'true'){
281			$(this).find('.frb_scrolling_counter').each(function(){$(this).frbScrollingCounters();});
282		}
283	
284		if($(this).attr('data-onscreen') == 'true'){
285			$(this).find('.frb_percentage_chart').frbPercentageChart();
286		}
287
288		//	gauge 
289		if($(this).find('.frb_gauge_chart').attr('data-onscreen') == 'true'){
290			frbGaugeChartRefresh($(this));	
291		}
292
293	
294		contactFormResize();
295
296		
297		frbGalleryInit($(this).find('.frb_gallery_container'));
298		galleryShortcodeRefresh($(this).find('.frb_gallery_container'));
299		
300		
301			
302		$(this).find('a[rel^="frbprettyphoto"]').prettyPhoto();
303			
304		frbScrollAnimations();
305	}
306
307	
308
309	
310	var parallaxTimeout;	
311	
312	$(window).resize(function(){
313		galleryShortcodeRefresh($('.frb_gallery_container'));
314		$('.frb_percentage_chart').each(function(){$(this).frbPercentageChart();});
315	});
316
317
318	
319	/* DOCUMENT READY */
320	$(document).ready(function(){
321		
322		
323		if('ontouchstart' in window) {
324			$('#fbuilder_wrapper').addClass('fbuilder_touch');
325		}
326
327		$(document).on("onscreen", '.frb_percentage_chart', function(){
328			$(this).frbPercentageChart();
329		});
330		
331		$(document).on('onscreen', '.frb_scrolling_counter', function(){
332			$(this).frbScrollingCounters();
333			$(this).attr('data-onscreen', true);
334		});
335		
336		$(document).on('onscreen', '.frb_percentage_bar', function(){
337			$(this).frbPercentageBars();
338			$(this).attr('data-onscreen', true);
339		});
340
341		$(document).on('onscreen', '.frb_gauge_chart', function(){
342			frbGaugeChartRefresh($(this).closest('.fbuilder_module'));
343			$(this).attr('data-onscreen', true);
344		});
345		
346		
347		$('.fbuilder_module').each(function(){
348			$(this).frb_refresh(true);
349		});
350		frbParallaxBackground();
351		if(window.location.hash != '')
352			window.location.hash = window.location.hash;
353		//frbParallax();
354		
355		
356		/* FULL WIDTH ROW */
357		var winW = $(window).width();
358		var winH = $(window).height();
359		var rowW = $('#fbuilder_wrapper').width();
360		$('<style id="fbuilder_dynamic_row_css" type="text/css"> .fbuilder_row.fbuilder_row_full_width{margin:0 '+( (-winW + rowW)/2 - 1500  )+'px; } .fbuilder_row .fbuilder_row_video >
360 div {width:'+(winW+200)+'px; height:'+(winH+200)+'px; margin:-'+((winH+200)/2)+'px 0 0 -'+((winW+200)/2)+'px !important;} </style>').appendTo('head');
361		
362		
363		$(window).resize(function(){
364			var winW = $(window).width();
365			var winH = $(window).height();
366			var rowW = $('#fbuilder_wrapper').width();
367			$('#fbuilder_dynamic_row_css').html('.fbuilder_row.fbuilder_row_full_width{margin:0 '+( (-winW + rowW)/2 - 1500  )+'px;} .fbuilder_row .fbuilder_row_video > div {width:'+(winW+200)+'px; height:'+(winH+200)+'px; margin:-'+((winH+200)/2)+'px 0 0 -'+((winW+200)/2)+'px !important;} ');
368		});
369		
370		
371		$(this).find('.YTPlayer').mb_YTPlayer();
372		
373		
374	});
375	
376	$(window).load(function(){
377		$(this).scrollTop($(this).scrollTop()+1);
378		$(this).scrollTop($(this).scrollTop()-1);
379	});
380	
381
382	/* MODULE REFRESH */
383	
384	$(document).on('refresh','.fbuilder_module', function(){
385		$(this).frb_refresh(false);
386	});
387	$(document).on('refresh','.fbuilder_row', function(){
388		$(this).find('.YTPlayer').mb_YTPlayer();
389	});
390	
391	$(window).scroll(function(){
392		frbScrollAnimations();
393		frbParallaxBackground();
394	});
395
396	function frbScrollAnimations() {
397		if ($('#fbuilder_wrapper').hasClass('fbuilder_touch')) {
398			$('.frb_animated').each(function(){$(this).addClass('frb_onScreen').trigger('onscreen');});
399		}
400		$('.frb_animated').each(function(){
401			if(!$(this).hasClass('frb_onScreen') && isScrolledIntoView(this, $('#fbuilder_wrapper').hasClass('fbuilder_touch'))) {
402				if(typeof $(this).attr('data-agroup') != 'undefined') {
403					$('[data-agroup=' + $(this).attr('data-agroup') + ']').each(function(){
404						if(typeof $(this).attr('data-adelay') != 'undefined' && parseInt($(this).attr('data-adelay')) != 0) {
405							if(!$(this).hasClass('frb_onScreenDelay')) {
406								$(this).addClass('frb_onScreenDelay');
407								var $this = $(this);
408								setTimeout(function(){
409									$this.addClass('frb_onScreen').trigger('onscreen');
410								}, parseInt($(this).attr('data-adelay')));
411							}
412						}
413						else {
414							$(this).addClass('frb_onScreen').trigger('onscreen');
415						}
416					});
417				}
418				else {	
419					if(typeof $(this).attr('data-adelay') != 'undefined' && parseInt($(this).attr('data-adelay')) != 0) {
420						if(!$(this).hasClass('frb_onScreenDelay')) {
421							$(this).addClass('frb_onScreenDelay');
422							var $this = $(this);
423							setTimeout(function(){
424								$this.addClass('frb_onScreen').trigger('onscreen');
425							}, parseInt($(this).attr('data-adelay')))
426						}
427					}
428					else {
429						$(this).addClass('frb_onScreen').trigger('onscreen');
430					}
431					
432				}
433			}
434			
435		})
436	}
437	function isScrolledIntoView(elem, isTouch){
438		if($.fn.scrollBro != 'undefined' && $('.scb_main_wrap').length > 0) {
439			var $wrap = $('.scb_main_wrap');
440			var docViewTop = $wrap.scrollBro('scrollTop');
441		    var docViewLimit = $(window).height()/1.1;
442			
443			var wrapTop = $wrap.offset().top;
444		    var elemTop = $(elem).offset().top;
445			
446		    return ((elemTop <= docViewLimit+wrapTop) && (elemTop >= wrapTop));
447		}
448		else {
449
450		    var docViewTop = $(window).scrollTop();
451		    var docViewLimit = docViewTop + $(window).height()/1.1;
452
453		    var elemTop = $(elem).offset().top;
454		    var elemBottom = elemTop + $(elem).height();
455		    if(isTouch){
456		    	return true;
457		    } else {
458			    return ((elemTop <= docViewLimit) && (elemTop >= docViewTop));
459			}
460		}
461	}
462		
463	function frbParallaxEvent(){
464		$('.fbuilder_row_parallax').each(function(){
465			if(typeof $(this).data('backH') == 'undefined') {
466				var imageSrc = $(this).css('background-image').replace(/url\((['"])?(.*?)\1\)/gi, '$2').split(',')[0];
467			    var image = new Image();
468			    image.src = imageSrc;
469			    $(this).data('backH', image.height);
470			}
471			var parallaxPos = (window.myScroll.y/($(this).data('backH') - $(window).height() ))*100 + 50;
472			$(this).css('background-position', '50% '+parallaxPos+'%');
473		});
474	}
475	
476	function frbParallaxBackground(){
477		if(!('ontouchstart' in window)) {
478			$('.fbuilder_row_background_parallax, .fbuilder_row_background_fixed').each(function(){
479				var scrTop = $(window).scrollTop();
480				var winH = $(window).height();
481				var elTop = $(this).offset().top-50;
482				var elH = $(this).height();
483				var zero = elTop -winH/2 + elH/2;
484				var fadeVal = 1;
485				var scaleVal = 'auto';
486				var calc = Math.abs((scrTop-elTop-elH)/elH);
487				if($(this).hasClass('fbuilder_row_background_fade')){
488					if(calc < 1 || calc > 0) {
489						fadeVal = calc;
490					}
491				}
492				if($(this).hasClass('fbuilder_row_background_scale')){
493					if(calc < 1 && calc > 0) {
494						scaleVal = (5 + calc)*20;
495					} else {
496						scaleVal = 120;
497					}
498				}
499				
500				
501				if(zero < 0) zero;
502				if($(this).hasClass('fbuilder_row_background_fixed')) {
503					var parallaxPos = scrTop - zero -winH/2 + elH/2;
504				}
505				else {
506					var parallaxPos = (scrTop - zero)*0.6 -winH/2 + elH/2;
507				}
508				$(this).find('.fbuilder_row_back_image:first').css({'background-size' : scaleVal*$(window).width()/100, top : parallaxPos, height : winH, opacity : fadeVal});
509			});
510		}
511		
512	}
513
514
515
516	/* AUDIO */
517	
518	$(document).on('click', '.frb_play_button' ,function(e){
519	  	e.preventDefault();
520		$(this).siblings('audio')[0].play();
521	  	$(this).removeClass('frb_play_button').addClass('frb_pause_button');
522	});
523  
524	$(document).on('click', '.frb_pause_button' ,function(e){
525	  	e.preventDefault();
526	  	$(this).siblings('audio')[0].pause();
527	  	$(this).removeClass('frb_pause_button').addClass('frb_play_button');
528	});
529  
530	$(document).on('click', '.frb_mute_button' ,function(e){
531	  	e.preventDefault();
532	  	$(this).siblings('audio')[0].volume = 0;
533	  	$(this).removeClass('frb_mute_button').addClass('frb_muted_button');
534	  	$(this).parent().find('.frb_volume_slider').slider( "option", "value", 0 );
535	});
536	
537	$(document).on('click', '.frb_muted_button' ,function(e){
538	  	e.preventDefault();
539	  	$(this).siblings('audio')[0].volume=$(this).data('volume');
540	  	$(this).removeClass('frb_muted_button').addClass('frb_mute_button');
541	  	$(this).parent().find('.frb_volume_slider').slider( "option", "value", $(this).data('volume') );
542	});
543  
544	$(document).on('click', '.frb_stop_button' ,function(e){
545	  	e.preventDefault();
546	  	$(this).siblings('audio')[0].pause();
547	  	$(this).siblings('audio')[0].currentTime = 0;
548	  	$(".frb_pause_button").removeClass('frb_pause_button').addClass('frb_play_button');
549	});
550	
551	/* TABS */
552	
553	$(document).on('click','.frb_tabs > ul a', function(e){
554		e.preventDefault();
555		if(!$(this).hasClass('active')) {
556			$(this).parent().parent().find('a').removeClass("active");
557			$(this).addClass('active');
558			
559			var $containter = $(this).closest('.frb_tabs'),
560				tabId = $(this).attr('href');
561			$containter.children('.frb_tabs-content').stop(true, true).hide();
562			$containter.find(tabId).fadeIn();
563		}
564	});
565	
566	
567	/* TOGGLE */
568	
569	$(document).on('click','.frb_toggle label', function(e){
570		var $itemContent = $(this).next();
571		if ($itemContent.outerHeight()>0) {	
572			$itemContent.outerHeight("0px").prev().find("i").removeClass("ba-minus").addClass("ba-plus");
573		}
574		else {
575			$itemContent.outerHeight($(this).parent().data("itemHeight")+"px").prev().find("i").removeClass("ba-plus").addClass("ba-minus");
576		}
577		
578	});
579	
580	
581	/* TOUR */
582	
583	$(document).on('click','.frb_tour > ul a', function(e){
584		e.preventDefault();
585		if(!$(this).hasClass('active')) {
586			$(this).parent().parent().find('a').removeClass("active");
587			$(this).addClass('active').parent().next().find("a");
588			var $containter = $(this).closest('.frb_tour'),
589				tabId = $(this).attr('href');
590			$containter.children('.frb_tour-content').stop(true, true).hide();
591			$containter.find(tabId).fadeIn();
592		}
593	});
594
595	/* BUTTONS */
596
597	$(document).on('mouseenter','.frb_button', function(){
598		var backcolor = $(this).attr('data-hoverbackcolor'); if(backcolor == '') backcolor = 'transparent';
599		var textcolor = $(this).attr('data-hovertextcolor'); if(textcolor == '') textcolor = 'transparent';
600		if(!$(this).hasClass('frb_nofill')) 
601			$(this).stop(true).animate({backgroundColor: backcolor, color: textcolor},300).find('.frb_button_icon i').stop(true).animate({color: textcolor},300);
602		else
603			$(this).stop(true).animate({borderColor: backcolor, color: textcolor},300).find('.frb_button_icon i').stop(true).animate({color: textcolor},300);
604	});
605	$(document).on('mouseleave','.frb_button', function(){
606		var backcolor = $(this).attr('data-backcolor'); if(backcolor == '') backcolor = 'transparent';
607		var textcolor = $(this).attr('data-textcolor'); if(textcolor == '') textcolor = 'transparent';
608		if(!$(this).hasClass('frb_nofill')) 
609			$(this).stop(true).animate({backgroundColor: backcolor, color: textcolor},300).find('.frb_button_icon i').stop(true).animate({color: textcolor},300);
610		else
611			$(this).stop(true).animate({borderColor: backcolor, color: textcolor},300).find('.frb_button_icon i').stop(true).animate({color: textcolor},300);
612	});
613	
614	
615	
616	/* FEATURES */
617	
618	$(document).on('mouseenter','.frb_features', function(){
619		var backColor = $(this).attr('data-hovercolor'); if(backColor == '') backColor = 'transparent';
620		var titleColor = $(this).find('.frb_features_title').attr('data-hovercolor'); if(titleColor == '') titleColor = 'transparent';
621		var iconColor = $(this).find('.frb_features_icon').attr('data-hovercolor'); if(iconColor == '') iconColor = 'transparent';
622		var textColor = $(this).find('.frb_features_content').attr('data-hovercolor'); if(textColor == '') textColor = 'transparent';
623		
624		$(this).find('.frb_features_title').stop(true).animate({color: titleColor},300);
625		$(this).find('.frb_features_icon').stop(true).animate({color: iconColor},300);
626		$(this).find('.frb_features_content').stop(true).animate({color: textColor},300);
627		if(!$(this).hasClass('frb_features_clean')) 
628			$(this).stop(true).animate({backgroundColor: backColor},300);
629	});
630	
631	
632	/* ICON MENU */
633	
634	$(document).on('mouseenter','.frb_iconmenu_link', function(){
635		var backColor = $(this).attr('data-backhover'); if(backColor == '') backColor = 'transparent';
636		var iconColor = $(this).find('i').attr('data-hovercolor'); if(iconColor == '') iconColor = 'transparent';
637		$(this).find('i').stop(true).animate({color: iconColor},300);
638		$(this).stop(true).animate({backgroundColor: backColor},300);
639	});
640	$(document).on('mouseleave','.frb_iconmenu_link', function(){
641		var backColor = $(this).attr('data-backcolor'); if(backColor == '') backColor = 'transparent';
642		var iconColor = $(this).find('i').attr('data-color'); if(iconColor == '') iconColor = 'transparent';
643		$(this).find('i').stop(true).animate({color: iconColor},300);
644		$(this).stop(true).animate({backgroundColor: backColor},300);
645	});
646	
647	
648	/* SEARCHFORM */
649	
650	$(document).on('focus','.frb_searchform input', function(){
651		if($(this).val() == $(this).attr('data-value')) $(this).val('');
652	
653		$this = $(this).parent().parent().parent();
654		var backColor = $this.attr('data-backfocus'); if(backColor == '') backColor = 'transparent';
655		var borderColor = $this.attr('data-borderfocus'); if(borderColor == '') borderColor = 'transparent';
656		var textColor = $(this).attr('data-focuscolor'); if(textColor == '') textColor = 'transparent';
657		
658		$this.find('i').stop(true).animate({color: textColor},300);
659		$this.stop(true).animate({backgroundColor: backColor, borderColor : borderColor},300);
660		$(this).stop(true).animate({color: textColor},300);
661	});
662	$(document).on('blur','.frb_searchform input', function(){
663		if($(this).val() == '') $(this).val($(this).attr('data-value'));
664		
665		$this = $(this).parent().parent().parent();
666		var backColor = $this.attr('data-backcolor'); if(backColor == '') backColor = 'transparent';
667		var borderColor = $this.attr('data-bordercolor'); if(borderColor == '') borderColor = 'transparent';
668		var textColor = $(this).attr('data-color'); if(textColor == '') textColor = 'transparent';
669		
670		$this.find('i').stop(true).animate({color: textColor},300);
671		$this.stop(true).animate({backgroundColor: backColor, borderColor : borderColor},300);
672		$(this).stop(true).animate({color: textColor},300);
673	});
674	$(document).on('click', '.frb_searchform .frb_searchright', function(){
675		var $input = $(this).parent().find('input');
676		if($input.val() != $input.attr('data-value') && $input.val() != ''){
677			$(this).parent().submit();
678		}
679		
680	});
681	
682	
683	/*	CONTACT FORM	*/
684	
685	
686	$(document).on('submit', '.frb_contact_form > form', function(e){
687		e.preventDefault();
688		var $this = $(this);
689		var sendAllow = true;
690		$this.find('.frb_required').each(function(){
691			if($(this).val() != '' || $(this).html() != ''){
692				sendAllow = sendAllow == true ? true : false;
693				$(this).removeClass('frb_req_error');
694				if($(this).is('input[name="e-mail"]') && ($(this).val().indexOf('@')<0 || $(this).val().indexOf('.')<0)) {
695					sendAllow = false;
696					$(this).addClass('frb_req_error');
697				}
698			} else {
699				sendAllow = false;
700				$(this).addClass('frb_req_error');
701			}
702			
703		});
704		
705		var $customFieldSelect = $this.find('.frb_input_wrapper input[name="custom"]'),
706			submission = {}, 
707			defaults = $this.serializeArray(), 
708			customName = $customFieldSelect.length > 0 ? $customFieldSelect.attr('placeholder') : null;
709			responseText = $('.frb_contact_response').attr('data-text');
710			
711		submission = {'action' : 'fbuilder_contact_form', 'defaults' :defaults, 'customname' : customName, 'response' : responseText, 'recipient_email' : $this.data('email'), 'recipient_name' : $this.data('name')};
712		if(sendAllow){
713			var tempVal = $this.find('.frb_contact_submit > input').val(),
714				$submitSel = $this.find('.frb_contact_submit > input');
715			
716			$submitSel.attr('value', $submitSel.attr('data-proc-val'));
717			$.post(ajaxurl, submission).done(function(){
718				$this.children(':not(.frb_contact_form_overlay)').animate({opacity : 0.4},400);
719				$this.find('.frb_contact_form_overlay').show().animate({opacity: 1}, 400);
720				setTimeout(function(){
721					$this.children(':not(.frb_contact_form_overlay)').animate({opacity : 1},400);
722					$this.find('.frb_contact_form_overlay').animate({opacity: 0}, 400, function(){$(this).hide();});
723					$submitSel.attr('value', tempVal);
724				}, $this.data('responseDelay'));
725				
726			});
727		}
728	});
729	
730	$(window).resize(function(){
731		contactFormResize();
732	});
733	
734	function contactFormResize(){
735		$('.frb_contact_form').each(function(){
736			 var $this = $(this),
737				$inputWrap = $this.find('.frb_input_wrapper'), 
738				inputCount = $this.find('.frb_input_wrapper input').length,
739				maxItems = Math.floor($this.width()/190),
740				maxItems = maxItems < 1 ? 1 : maxItems;
741			
742			if(inputCount == 3) {$inputWrap.css('width', '33.3333%');}	
743			if(inputCount%4 == 0 && maxItems >= 2 && maxItems < inputCount) {
744				$inputWrap.removeClass('frb_fullw').addClass('frb_halfw');
745			} else if(maxItems < inputCount){
746				$inputWrap.removeClass('frb_halfw').addClass('frb_fullw');
747			} else {$inputWrap.removeClass('frb_halfw frb_fullw');}	
748			
749			
750		});
751	}
752	
753	
754
755	
756	/* IMAGE */
757	
758	$(document).on('mouseenter','.frb_image a', function(){
759		// $(this).find('.frb_image_hover').stop(true).animate({opacity:$(this).find('.frb_image_hover').attr('data-transparency')},300);
760		$(this).find('i.fawesome, i.frb_icon').stop(true).animate({opacity:1},300);
761		$this = $(this).parent();
762		
763		var borderColor = $this.find('.frb_image_inner').attr('data-borderhover'); if(borderColor == '') borderColor = 'transparent';
764		$this.find('.frb_image_inner').stop(true).animate({borderColor:borderColor},300);
765		
766		if($this.find('.frb_image_desc').length >0) {
767			var backColor = $this.find('.frb_image_desc').attr('data-backhover'); if(backColor == '') backColor = 'transparent';
768			var descColor = $this.find('.frb_image_desc').attr('data-hovercolor'); if(descColor == '') descColor = 'transparent';
769			$this.find('.frb_image_desc').stop(true).animate({backgroundColor:backColor, color:descColor},300);
770		}
771		
772	});
773	$(document).on('mouseleave','.frb_image a', function(){
774		// $(this).find('.frb_image_hover').stop(true).animate({opacity:0}
774,300);
775		$(this).find('i.fawesome, i.frb_icon').stop(true).animate({opacity:0},300);
776		$this = $(this).parent();
777		var borderColor = $this.find('.frb_image_inner').attr('data-bordercolor'); if(borderColor == '') borderColor = 'transparent';
778		$this.find('.frb_image_inner').stop(true).animate({borderColor:borderColor},300);
779		
780		if($this.find('.frb_image_desc').length >0) {
781			var descColor = $this.find('.frb_image_desc').attr('data-color'); if(descColor == '') descColor = 'transparent';
782			var backColor = $this.find('.frb_image_desc').attr('data-backcolor'); if(backColor == '') backColor = 'transparent';
783			$this.find('.frb_image_desc').stop(true).animate({backgroundColor:backColor,color:descColor},300);
784		}
785	});
786	
787	
788	/* NAV MENU */
789	
790	$(document).on('mouseenter','.frb_menu li', function(){
791		var $mainlist = $(this);
792		var submenu = false;
793		while(!$mainlist.hasClass('frb_menu')) {
794			if($mainlist.hasClass('sub-menu')) submenu = true;
795			$mainlist = $mainlist.parent();
796		}
797		var textColor = $mainlist.attr('data-textcolor'); if(textColor == '') textColor = 'transparent';
798		var subTextColor = $mainlist.attr('data-subtextcolor'); if(subTextColor == '') subTextColor = 'transparent';
799		var hoverColor = $mainlist.attr('data-hovercolor'); if(hoverColor == '') hoverColor = 'transparent';
800		var hoverTextColor = $mainlist.attr('data-hovertextcolor'); if(hoverTextColor == '') hoverTextColor = 'transparent';
801			
802		if($mainlist.hasClass('frb_menu_horizontal-clean') || $mainlist.hasClass('frb_menu_horizontal-squared') || $mainlist.hasClass('frb_menu_horizontal-rounded')) {	
803			if(submenu) $(this).children('a').stop(true).animate({color : hoverColor}, 300);
804			else $(this).children('a').stop(true).animate({color : hoverTextColor, backgroundColor: hoverColor}, 300);
805			
806			if($(this).children('ul').length > 0) {
807				$(this).children('ul').stop(true).show().animate({marginTop:'10px', opacity:1}, 300);
808			}
809		}
810		else if($mainlist.hasClass('frb_menu_vertical-clean') || $mainlist.hasClass('frb_menu_vertical-squared') || $mainlist.hasClass('frb_menu_vertical-rounded')) {
811			if(submenu) {
812				$(this).children('a').stop(true).animate({color : textColor}, 300);
813			}
814			else {
815				$(this).stop(true).animate({backgroundColor: hoverColor}, 300);
816				$(this).children('a').stop(true).animate({color : hoverTextColor}, 300);
817				$(this).find('ul a').stop(true).animate({color : hoverTextColor}, 300);
818			}
819		}
820		else {
821			$(this).children('a').stop(true).animate({color : hoverTextColor, backgroundColor: hoverColor}, 300);
822		}
823	});
824	$(document).on('mouseleave','.frb_menu li', function(){
825		var $mainlist = $(this);
826		var submenu = false;
827		while(!$mainlist.hasClass('frb_menu')) {
828			if($mainlist.hasClass('sub-menu')) submenu = true;
829			$mainlist = $mainlist.parent();
830		}
831		var textColor = $mainlist.attr('data-textcolor'); if(textColor == '') textColor = 'transparent';
832		var subTextColor = $mainlist.attr('data-subtextcolor'); if(subTextColor == '') subTextColor = 'transparent';
833		var hoverColor = $mainlist.attr('data-hovercolor'); if(hoverColor == '') hoverColor = 'transparent';
834		var hoverTextColor = $mainlist.attr('data-hovertextcolor'); if(hoverTextColor == '') hoverTextColor = 'transparent';
835		
836		if($mainlist.hasClass('frb_menu_horizontal-clean') || $mainlist.hasClass('frb_menu_horizontal-squared') || $mainlist.hasClass('frb_menu_horizontal-rounded')) {	
837			if(submenu) $(this).children('a').stop(true).animate({color : subTextColor}, 300);
838			else $(this).children('a').stop(true).animate({color : textColor, backgroundColor: 'transparent'}, 300);
839			
840			if($(this).children('ul').length > 0) {
841				$(this).children('ul').stop(true).animate({marginTop:'0px', opacity:0}, 300, function(){ $(this).hide(); });
842			}
843		}
844		else if($mainlist.hasClass('frb_menu_vertical-clean') || $mainlist.hasClass('frb_menu_vertical-squared') || $mainlist.hasClass('frb_menu_vertical-rounded')) {
845			if(submenu) {
846				$(this).children('a').stop(true).animate({color : hoverTextColor}, 300);
847			}
848			else {
849				$(this).stop(true).animate({backgroundColor: 'transparent'}, 300);
850				$(this).find('a').stop(true).animate({color : subTextColor}, 300);
851			}
852		}
853		else {
854			$(this).children('a').stop(true).animate({color : subTextColor, backgroundColor: 'transparent'}, 300);
855		}
856	});
857	
858	$(document).on('click','.frb_menu_container[class*="dropdown"] .frb_menu_header', function(){
859		if(!$(this).hasClass('active')) {
860			$(this).addClass('active');
861			$(this).parent().find('ul.frb_menu').stop(true).show().animate({marginTop:'10px', opacity:1}, 300);
862		}
863		else {
864			$(this).removeClass('active');
865			$(this).parent().find('ul.frb_menu').stop(true).animate({marginTop:'0px', opacity:0}
865, 300, function(){ $(this).hide(); });
866		}
867	});
868	
869	
870	/* PRICING TABLE */
871	
872	$(document).on('click','.frb_pricing_controls a', function(e){
873		e.preventDefault();
874		var $cont = $(this).closest('.frb_pricing_container');
875		var $ctrl = $(this).closest('.frb_pricing_controls');
876		if(typeof $cont.data('slide') == 'undefined') $cont.data('slide',0);
877		if($(this).hasClass('frb_pricing_left') && $cont.data('slide') !=0 ) {
878			$cont.data('slide',$cont.data('slide')-1);
879			$cont.find('table').stop(true).animate({'margin-left':(-$cont.data('slide')*100)+'%'},300);
880		}
881		else if($(this).hasClass('frb_pricing_right') && $cont.data('slide') != parseInt($cont.attr('data-colnum'))-1 ) {
882			$cont.data('slide',$cont.data('slide')+1);
883			$cont.find('table').stop(true).animate({'margin-left':(-$cont.data('slide')*100)+'%'}, 300);
884		}
885	});
886	$(window).resize(function(){
887		$('.frb_pricing_container').data('slide',0).find('table').css('margin-left',0);
888		
889		
890		if ($('.frb_charts_wrapper canvas').length > 0) { 
891			$('.frb_charts_wrapper').each(function(ind){ 
892				if ($(this).hasClass('frb_onScreen')) { 
893					$(this).parent().parent().frbChartsDraw(); 
894					$(this).attr('data-onscreen', true); 
895				} 
896			}); 
897		} 
898		if ($('.frb_graph_wrapper canvas').length > 0) { 
899			$('.frb_graph_wrapper').each(function(ind){ 
900				if ($(this).hasClass('frb_onScreen')) { 
901					$(this).parent().parent().frbGraphDraw(); 
902					$(this).attr('data-onscreen', true); 
903				} 
904			}); 
905		}  
906	});
907	
908	$('.fbuilder_row').on('row_width_change', function() {
909		contactFormResize();
910		if ($(this).find('.frb_charts_wrapper canvas').length > 0) { 
911			$(this).find('.frb_charts_wrapper').each(function(ind){ 
912				if ($(this).hasClass('frb_onScreen')) { 
913					$(this).parent().parent().frbChartsDraw(); 
914					$(this).attr('data-onscreen', true); 
915				} 
916			}); 
917		} 
918		if ($(this).find('.frb_graph_wrapper canvas').length > 0) { 
919			$(this).find('.frb_graph_wrapper').each(function(ind){ 
920				if ($(this).hasClass('frb_onScreen')) { 
921					$(this).parent().parent().frbGraphDraw(); 
922					$(this).attr('data-onscreen', true); 
923				} 
924			}); 
925		}  
926	});
927	
928// 			Gallery
929
930
931$(document).on('click', '.frb_gallery_hover', function(){
932	var href = $(this).siblings('.frb_gallery_new_tab_link').attr('href');
933	 if(typeof href != 'undefined') {
934	 	window.open(href,'_blank');
935	 } else {
936	 	$(this).siblings('a').trigger('click');
937	 }
938});
939
940function frbGalleryInit($this) {
941	$this.each(function(){
942
943		var categories_height = 0;
944		if ($(this).find('.frb_gallery_categories').length!=0)
945		var categories_height = $(this).find('.frb_gallery_categories').outerHeight(true);
946		var itemPaddingTop = parseInt($(this).find('.frb_media_file').first().css("padding-top"));
947
948		//$(this).find('.frb_gallery_inner').css('top',categories_height-itemPaddingTop);
949		$(this).find('.frb_gallery_cat').each(function(index){
950			$(this).click(function(e){
951				e.preventDefault();
952				$(this).siblings().removeClass('frb_cat_active');
953				$(this).addClass('frb_cat_active');
954				$(this).closest('.frb_gallery_container').find('.frb_media_file').removeClass('frb_cat_active');
955
956				if (index==0 ) {
957					if ($(this).attr('href')=='All')
958						$(this).closest('.frb_gallery_container').find('.frb_gallery_inner').isotope({filter: '.frb_media_file'});		
959					else 
960						$(this).closest('.frb_gallery_container').find('.frb_gallery_inner').isotope({filter: '.frb_gallery_cat_0'});
961				}
962				else {
963					if ($(this).siblings().first().attr('href')=='All')
964						$(this).closest('.frb_gallery_container').find('.frb_gallery_inner').isotope({filter: '.frb_gallery_cat_'+(index-1)});
965					else
966						$(this).closest('.frb_gallery_container').find('.frb_gallery_inner').isotope({filter: '.frb_gallery_cat_'+index});
967				}
968
969
970			});
971		});
972
973	});
974
975}	
976
977function galleryShortcodeRefresh($this) {
978
979		 $this.each(function(){
980		
981		$(this).find('.frb_cat_active').last().siblings().removeClass('frb_cat_active');//fail safe da samo jedna klasa bude active
982
983		 var index = $(this).find('.frb_cat_active').last().index('.frb_gallery_cat');//indeks aktivne klase ili -1 ako nije nadjena
984
985		var numOfCats = $('.frb_gallery_cat').length;
986
987		var aspect_ratio = $(this).data('frb_aspect_ratio');
988		var width = $(this).width();
989		var itemWidth = $(this).find('.frb_media_file').width();
990		var itemHeight = 0;
991
992		switch(aspect_ratio) {
993			case '4:3':
994			    itemHeight = itemWidth/1.33; 
995			    break;
996			case '16:9':
997			    itemHeight = itemWidth/1.78; 
998			    break;
999			case '16:10':
1000			    itemHeight = itemWidth/1.6; 
1001			    break;
1002			case '1:2':
1003			    itemHeight = itemWidth*2; 
1004			    break;
1005			default:
1006			    itemHeight = itemWidth;
1007			}
1008
1009
1010			$(this).find('.frb_media_file, .frb_media_file_inner, .frb_media_file_inner video').height(itemHeight+"px");
1011
1012			$(this).find('.frb_media_file_inner img').each(function(){
1013				var picWidth = $(this).attr('width');
1014				var picHeight = $(this).attr('height');
1015				$(this).css({'margin-left' : (itemWidth-picWidth)/2, 'margin-top' : (itemHeight - picHeight)/2});
1016			});
1017
1018			//$(this).find('.frb_gallery_inner').isotope({itemSelector: '.frb_media_file'});
1019
1020			if (numOfCats!=0) {
1021				if (index==0 ) {
1022						if ($(this).attr('href')=='All')
1023							$(this).find('.frb_gallery_inner').isotope({filter: '.frb_media_file'});		
1024						else 
1025							$(this).find('.frb_gallery_inner').isotope({filter: '.frb_gallery_cat_0'});
1026					}
1027					else {
1028						if ($(this).siblings().first().attr('href')=='All')
1029							$(this).find('.frb_gallery_inner').isotope({filter: '.frb_gallery_cat_'+(index-1)});
1030						else
1031							$(this).find('.frb_gallery_inner').isotope({filter: '.frb_gallery_cat_'+index});
1032					}
1033
1034					if ($(this).find('.frb_cat_active').length > 0)
1035						$(this).find('.frb_cat_active').trigger('click');
1036					else
1037						$(this).find('.frb_gallery_inner').isotope({filter: '.frb_media_file'});
1038
1039				} else {
1040					$(this).find('.frb_gallery_inner').isotope({filter: '.frb_media_file'});
1041				}
1042
1043
1044		 });
1045				
1046
1047}		
1048	
1049	/*	SLIDER	*/
1050
1051	$(document).on('mousedown touchstart', '.frb-swiper-container .frb_lightbox_link', function(e){
1052		var date = new Date();
1053		$(this).data({'time' : date.getTime()});
1054		$(this).off('click');
1055		e.preventDefault();
1056	});
1057	
1058	$(document).on('mouseup touchend', '.frb-swiper-container .frb_lightbox_link', function(e){
1059		$(this).on('click', function(e){
1060			e.preventDefault();
1061		});
1062		var date = new Date();
1063		e.preventDefault();
1064		var oldTime = $(this).data('time');
1065		if(date.getTime() - oldTime < 150) {
1066			$(this).prettyPhoto();	
1067		}
1068	});
1069	
1070	$(window).resize(function(){
1071		$('.frb-swiper-container').each(function(){
1072			frbSliderResponsive($(this));
1073		});
1074	});
1075	
1076	$(document).on("row_width_change", ".fbuilder_row", function() {
1077		$(this).find('.frb-swiper-container').each(function(){
1078			frbSliderResponsive($(this));
1079		});
1080	});
1081	
1082	
1083	function frbSliderResponsive($this) {
1084		var swp = $this.data('swiper_controls'),
1085			calcSPV,
1086			minWidth = parseInt($this.attr('data-min-res-width')),
1087			moduleWidth = $this.closest('.fbuilder_module').width(),
1088			SPV = parseInt($this.attr('data-slidesPerView')),
1089			maxSPV = Math.floor(moduleWidth/minWidth);
1090
1091		
1092		calcSPV = SPV > maxSPV ? maxSPV : SPV;
1093		if(typeof swp != 'undefined' && swp.params.mode == 'horizontal') {
1094			swp.params.slidesPerView=calcSPV;
1095			swp.reInit();
1096		}
1097		 
1098
1099		var height = 0, hgt = 0;
1100		$this.find('.swiper-slide').each(function(){
1101			var content_height = $(this).children().first().innerHeight();
1102 			
1103			if (typeof swp != 'undefined' && swp.params.mode != 'horizontal') {
1104			$(this).height(content_height);
1105				$(this).css('width','100%');
1106				if($(this).height() > height) height = $(this).height();
1107			} else if (typeof swp != 'undefined' && swp.params.mode == 'horizontal') { 
1108				hgt = hgt < $(this).children().outerHeight(true) ? $(this).children().outerHeight(true) : hgt;
1109//				$this.height(hgt);
1110			
1111			}
1112		});
1113				
1114		if (typeof swp != 'undefined' && swp.params.mode != 'horizontal') {
1115			$this.css('height', height*swp.params.slidesPerView+'px');
1116			$this.find('.swiper-slide').each(function(){
1117			$(this).height(height);
1118			});
1119		}
1120		if(typeof swp != 'undefined') {swp.reInit();}
1121	}
1122	
1123	/*	CREATIVE POST SLIDER		*/
1124	
1125	$(document).on('click', '.frb_creative_link_icon', function(){
1126		$(this).siblings('.frb_creative_post_slider_img_wrapper').trigger('click');
1127	});
1128	
1129	$(document).on('mousedown touchstart', '.frb_creative_post_slider_img_wrapper[rel^="frbprettyphoto"]', function(e){
1130		var date = new Date();
1131		$(this).data({'time' : date.getTime()});
1132		$(this).off('click');
1133		e.preventDefault();
1134	});
1135	
1136	$(document).on('mouseup touchend', '.frb_creative_post_slider_img_wrapper[rel^="frbprettyphoto"]', function(e){
1137		$(this).on('click', function(e){
1138			e.preventDefault();
1139		});
1140		var date = new Date();
1141		e.preventDefault();
1142		var oldTime = $(this).data('time');
1143		if(date.getTime() - oldTime < 120) {
1144			$(this).prettyPhoto();	
1145		}
1146	});
1147	
1148	
1149	$(document).on('mouseenter', '.frb_creative_post_slide_inner', function(){
1150		var $this = $(this);
1151		if(!$this.hasClass('frb_record')) {
1152			$this.addClass('frb_record').attr('data-height', $this.children('.frb_creative_post_slider_hover').outerHeight());
1153			$this.children('.frb_creative_post_slider_hover').css('bottom', -$this.children('.frb_creative_post_slider_hover').outerHeight());
1154		}
1155		$this.children('.frb_creative_post_slider_hover').stop(true).animate({'bottom' : 0}, 250);
1156		$this.children('.frb_creative_post_slider_img_wrapper').stop(true).animate({'top' : -40}, 250);
1157	
1158		var iconPos = ($(this).closest('.frb_creative_post_slider_container').height() - parseInt($(this).attr('data-height'))-parseInt($(this).closest('.frb_creative_post_slider_container').attr('data-icnh')))/2;
1159		$(this).closest('.frb_creative_post_slider_container').data('iconPos', iconPos);
1160		$this.children('.frb_creative_link_icon').stop(true).animate({'top' : $(this).closest('.frb_creative_post_slider_container').data('iconPos')}, 250);
1161		
1162	});
1163		
1164	$(document).on('mouseleave', '.frb_creative_post_slide_inner', function(){
1165		$(this).children('.frb_creative_post_slider_hover').stop(true).animate({'bottom' : -parseInt($(this).attr('data-height'))}, 250);
1166		$(this).children('.frb_creative_post_slider_img_wrapper').stop(true).animate({'top' : 0}, 250);
1167		var iconPos = ($(this).closest('.frb_creative_post_slider_container').height()+parseInt($(this).closest('.frb_creative_post_slider_container').attr('data-icnh')));
1168		$(this).children('.frb_creative_link_icon').stop(true).animate({'top' : iconPos}, 250);
1169	});
1170	
1171	$(window).resize(function(){
1172		$('.frb_creative_post_slide_inner.frb_record').attr('data-height', $('.frb_creative_post_slide_inner.frb_record > .frb_creative_post_slider_hover').outerHeight())
1173		$('.frb_creative_post_slide_inner.frb_record > .frb_creative_post_slider_hover').css('bottom', -$('.frb_creative_post_slide_inner.frb_record > .frb_creative_post_slider_hover').outerHeight());
1174	});
1175	
1176	$('.fbuilder_row').on('row_width_change', function() {
1177		if($(this).find('.frb_creative_post_slider_container').length > 0) {
1178			$(this).find('.frb_creative_post_slide_inner.frb_record').attr('data-height', $(this).find('.frb_creative_post_slide_inner.frb_record > .frb_creative_post_slider_hover').children('.frb_creative_post_slider_hover').outerHeight());
1179			$(this).find('.frb_creative_post_slide_inner.frb_record > .frb_creative_post_slider_hover').css('bottom', -$(this).find('.frb_creative_post_slide_inner.frb_record > .frb_creative_post_slider_hover').outerHeight());
1180		}
1181	});
1182	
1183	
1184	$(document).ready(function(){
1185		$('.frb_creative_post_slider_container').each(function(){	
1186			frbCreativePostSlider($(this));
1187		});
1188	});
1189	
1190	$(document).on('refresh', '.fbuilder_module', function(){
1191		if($(this).find('.frb_creative_post_slider_container').length > 0) {
1192			frbCreativePostSlider($(this).find('.frb_creative_post_slider_container'));
1193		}
1194	});
1195	
1196	$(window).resize(function(){
1197		$('.frb_creative_post_slider_container').each(function(){
1198			frbCreativePostSliderResize($(this));
1199		});
1200	});
1201	
1202	$(document).on("row_width_change", ".fbuilder_row", function() {
1203		$(this).find('.frb_creative_post_slider_container').each(function(){
1204			frbCreativePostSliderResize($(this));
1205		});
1206	});
1207	
1208	function frbCreativePostSlider($this){
1209		var settings = {};
1210		settings['spv'] = parseInt($this.attr('data-spv'));
1211		settings['asr'] = $this.attr('data-asr');
1212		settings['rref'] = parseInt($this.attr('data-rref'));
1213		settings['ratio'] = parseInt(settings['asr'].split(':')[1])/parseInt(settings['asr'].split(':')[0]);
1214		settings['swiper'] = $this.swiper({
1215			mode:'horizontal',
1216			loop: true,
1217			slidesPerView: settings['spv'],
1218			resizeReInit : true,
1219			wrapperClass : 'frb_creative_post_slider_wrapper',
1220			slideClass: 'frb_creative_post_slide',
1221			preventLinks : true,
1222			preventLinksPropagation : true
1223		});
1224		$this.data('settings', settings);
1225		
1226		$this.height($this.find('.frb_creative_post_slide:first').width()*settings['ratio']);
1227		$this.find('.frb_creative_post_slide').height($this.height());
1228		frbCpsImageCentering($this, $this.find('img.wp-post-image'));
1229
1230		var iconPos = ($this.height()+parseInt($this.attr('data-icnh')));
1231		$this.find('.frb_creative_link_icon').css({'top' : iconPos});
1232		$('.frb_creative_post_slider_img_wrapper[rel^="frbprettyphoto"]').prettyPhoto();
1233	}
1234	
1235	function frbCreativePostSliderResize($this){
1236		var settings = $this.data('settings'), calculatedNum = Math.floor($this.width()/settings['rref']);
1237		settings['spvRecalc'] = calculatedNum > settings['spv'] ? settings['spv'] : calculatedNum;
1238		settings['spvRecalc'] = settings['spvRecalc'] < 1 ? 1 : settings['spvRecalc'];
1239		settings['swiper'].params.slidesPerView=settings['spvRecalc'];
1240		settings['swiper'].reInit();
1241		$this.height($this.find('.frb_creative_post_slide:first').width()*settings['ratio']);
1242		$this.find('.frb_creative_post_slide').height($this.height());
1243		var iconPos = ($this.height()+parseInt($this.attr('data-icnh')));
1244		$this.data('iconPos', iconPos);
1245		settings['swiper'].setWrapperTranslate(0,0,0);
1246		frbCpsImageCentering($this, $this.find('img.wp-post-image'));
1247	}
1248
1249	function frbCpsImageCentering($wrpThis, $cThis) {
1250		var width = parseInt($cThis.attr('width')), 
1251			height = parseInt($cThis.attr('height')),
1252			wrpWidth = parseInt($cThis.closest('.frb_creative_post_slide').css('width')),
1253			wrpHeight =parseInt($wrpThis.css('height'));
1254		$cThis.css({'margin-left' : (wrpWidth-width)/2, 'margin-top' : (wrpHeight - height)/2});
1255	}
1256	
1257	
1258//			COUNTER
1259
1260$.fn.frbScrollingCounters = function() {
1261		var $this = $(this), rawResultStr = $this.attr('data-result'), rawResult = parseInt(rawResultStr), tempResult = rawResult, curPosVal, fSize = parseInt($this.css('font-size')), rawStartStr = $this.attr('data-startval'), rawStart = parseInt(rawStartStr), tempStart = rawStart, lengthFactor, difference = rawStart - rawResult, directionControl = $this.attr('data-direction');
1262		$this.css({'height' : fSize+'px', 'line-height' : fSize+'px'});
1263		$this.append('<div class="frb_clear" />');
1264		if(directionControl =='' || typeof directionControl == 'undefined'){directionControl = 'auto'}
1265		if(rawResultStr.length >
1265 rawStartStr.length){lengthFactor = rawResultStr.length;} else {lengthFactor = rawStartStr.length;}
1266		if(difference > 0 && directionControl == 'auto') {directionControl = 'upward';} else if(difference <= 0 && directionControl == 'auto') {directionControl = 'downward';}
1267		for (i=0; i<lengthFactor; i++) {	
1268			var curPosVal = tempResult%10;
1269			tempResult = Math.floor(tempResult/10);
1270			curPosStart = tempStart%10;
1271			if(curPosStart < 1){curPosStart = 0;}
1272			tempStart = Math.floor(tempStart/10);
1273			scrlCounterDigitSetup($this, curPosVal, curPosStart, difference, directionControl);
1274		}
1275		
1276		$this.children('.frb_scrl_count_digit_wrap').each(function(){
1277			scrlDigitAnimate($(this), fSize, directionControl);
1278		});
1279}
1280
1281function scrlCounterDigitSetup($scrlSel, CPV, CPS, difference, directionControl) {
1282	$scrlSel.prepend('<div class="frb_scrl_count_digit_wrap" />');
1283	if(directionControl == 'upward'){
1284		var transite = CPS;
1285		while (transite != CPV) {
1286			$scrlSel.children('.frb_scrl_count_digit_wrap:first').append('<div>'+transite+'</div>');
1287			transite++;
1288			if(transite > 9) {transite = 0;}
1289		}
1290		$scrlSel.children('.frb_scrl_count_digit_wrap:first').append('<div>'+transite+'</div>');
1291	}
1292	if(directionControl == 'downward'){
1293		var transite = CPS;
1294		while (transite != CPV) {
1295			$scrlSel.children('.frb_scrl_count_digit_wrap:first').prepend('<div>'+transite+'</div>');
1296			transite--;
1297			if(transite < 0) {transite = 9;}
1298		}
1299		$scrlSel.children('.frb_scrl_count_digit_wrap:first').prepend('<div>'+transite+'</div>');
1300	}
1301	$scrlSel.children('.frb_scrl_count_digit_wrap:first').append('<div class="frb_clear" />');
1302}
1303
1304function scrlDigitAnimate($digitSel, fSize, directionControl) {
1305	var targetTop = fSize - $digitSel.height();
1306	if(directionControl == 'upward'){
1307		$digitSel.each(function(){
1308			$(this).css('top', 0).animate({'top' : targetTop}, 2000);;
1309		});
1310	}
1311	if(directionControl == 'downward'){
1312		$digitSel.each(function(){
1313			$(this).css('top', targetTop).animate({'top' : 0}, 2000);;
1314		});	
1315	}
1316}
1317	
1318//			CHARTS
1319
1320$.fn.frbPercentageBars = function() {
1321	var $bar = $(this).find('.frb_pbar_line'), 
1322		$pin = $(this).find('.frb_pbar_pin'),
1323		wrapWidth = $(this).find('.frb_pbar_single_bar_wrapper').width(),
1324		pinWidth = $pin.eq(0).outerWidth(),
1325		numberOfBars = $(this).find('.frb_pbar_single_bar_wrapper').length,
1326		target = [],
1327		speed = [],
1328		direction = [],
1329		dest = [];
1330		
1331		target = $(this).attr('data-percentage').split('|');
1332		speed = $(this).attr('data-aspd').split('|'), 
1333		direction = $(this).attr('data-dir').split('|');
1334		
1335	for(i=0; i< numberOfBars; i++) {	
1336		dest[i] = {};
1337		dest[i] = direction[i] == "rtl" ? {'right' : wrapWidth*Math.abs(parseInt(target[i]))/100 - pinWidth/2} : {'left' : wrapWidth*Math.abs(parseInt(target[i]))/100 - pinWidth/2};
1338		$bar.eq(i).stop(true).animate({'width' : Math.abs(parseInt(target[i]))+'%'}, parseInt(speed[i]));
1339		$pin.eq(i).html('<span>'+Math.abs(parseInt(target[i]))+'%</span>').stop(true).animate(dest[i], parseInt(speed[i]), function(){
1340			$(this).closest('.frb_pbar_single_bar_wrapper').find('h5').stop(true).animate({opacity : 1}, 300);
1341			$(this).children('span').stop(true).animate({opacity : 1}, 300);
1342		});
1343	}
1344}
1345	
1346$.fn.frbPercentageChart = function() {
1347	var $this = $(this), width = $this.width(), rad = parseInt($this.attr('data-radius'));
1348	if(width < rad) {
1349		$this.find('.frb_perchart_canvas, .frb_perchart_bg').attr({'width' : $this.innerWidth(), 'height' : $this.innerWidth()});	
1350		$this.find('.frb_perchart_percent').height($this.innerWidth());
1351		frbPercentageChartDraw($this);
1352	} else {
1353		$this.find('.frb_perchart_canvas, .frb_perchart_bg').attr({'width' : rad, 'height' : rad});
1354		$this.find('.frb_perchart_percent').height(rad);
1355		frbPercentageChartDraw($this);	
1356	}
1357}
1358
1359function frbPercentageChartDraw($this) {
1360	var percent = parseInt($this.attr('data-percent')), cut = 98 - parseInt($this.attr('data-linewidth')), clr = $this.attr('data-barcolor'), bgClr = $this.attr('data-bgcolor'), dgnt = [{value: percent, color:clr}, {value: 100-percent, color:"transparent"}];
1361	var myChart = new Chart($this.find('.frb_perchart_canvas').get(0).getContext("2d")).Doughnut(dgnt, {
1362			percentageInnerCutout : cut, 
1363			segmentShowStroke : false,
1364			animationEasing : "easeOutQuad",
1365			animationSteps : 75,
1366			segmentStrokeColor : "transparent",
1367			onAnimationComplete : function(){
1368				$this.find('.frb_perchart_percent').animate({opacity : 1}, 300);
1369			}
1370		});
1371		var myChart = new Chart($this.find('.frb_perchart_bg').get(0).getContext("2d")).Doughnut([{value: 100, color:bgClr}], {
1372			percentageInnerCutout : cut, 
1373			segmentShowStroke : false,
1374			animation : false,
1375			segmentStrokeColor : "transparent"
1376		});
1377}
1378	
1379$.fn.frbChartsLegendSetup = function(relation) {
1380		
1381			var $this = $(this);
1382			$this.children('div:not(.frb_clear)').append('<div class="frb_charts_legend" />');
1383			var $legend = $this.find('.frb_charts_legend'), chSel;
1384			
1385			if ($this.children().children(':first').hasClass('frb_charts_wrapper')) {chSel= false;} else {chSel = true;}
1386			var chColor, chCaption;
1387			
1388			var chCount = chSel ? relation.datasets.length : relation.length;
1389			for(i=0;i<chCount; i++){
1390				chColor = chSel ? relation.datasets[i].strokeColor : relation[i].color;
1391				chCaption = chSel ? relation.datasets[i].caption : relation[i].caption;
1392				$legend.append('<div class="frb_charts_legend_row" />').children('.frb_charts_legend_row:last').append('<div /><span />').children('div').css({'background-color' : chColor}).parent().children('span').html(chCaption);	
1393			}
1394			$this.append('<div class="frb_clear" />');
1395};
1396
1397
1398$.fn.frbChartsDraw = function() {
1399	var $this = $(this), width = $this.innerWidth(), rad = parseInt($this.data('radius'));
1400	if(width - rad <= parseInt($this.data('font-size'))*0.75*15) {$this.addClass('frb_chart_resp');} else {$this.removeClass('frb_chart_resp');}
1401	if(width < rad) {
1402		$this.find('.frb_charts_wrapper canvas').attr('width', $this.innerWidth()).attr('height', $this.innerWidth());
1403		var myChart = new Chart($(this).find('.frb_piechart_canvas').get(0).getContext("2d")).Doughnut($this.data('obj'),{
1404			percentageInnerCutout : $this.data('percentageInnerCutout'), 
1405			segmentShowStroke : $this.data('segmentShowStroke'), 
1406			segmentStrokeWidth : parseInt($this.data('segmentStrokeWidth')),
1407			animationEasing : "easeOutQuad",
1408			animationSteps : 30,
1409			segmentStrokeColor : $this.data('segmentStrokeColor'),
1410			onAnimationComplete : function(){
1411				$this.find(".frb_charts_legend").children(".frb_charts_legend_row").each(function(ind){
1412					$(this).delay(ind*150).animate({opacity : 1}, 300);
1413				});
1414			}
1415		});	
1416	} else {
1417		$this.find('.frb_charts_wrapper canvas').attr('width', rad).attr('height', rad);
1418		var myChart = new Chart($(this).find('.frb_piechart_canvas').get(0).getContext("2d")).Doughnut($this.data('obj'),{
1419			percentageInnerCutout : $this.data('percentageInnerCutout'), 
1420			segmentShowStroke : $this.data('segmentShowStroke'), 
1421			segmentStrokeWidth : parseInt($this.data('segmentStrokeWidth')),
1422			animationEasing : "easeOutQuad",
1423			animationSteps : 30,
1424			segmentStrokeColor : $this.data('segmentStrokeColor'),
1425			onAnimationComplete : function(){
1426				$this.find(".frb_charts_legend").children(".frb_charts_legend_row").each(function(ind){
1427					$(this).delay(ind*150).animate({opacity : 1}, 300);
1428				});
1429			}
1430		});	
1431	}
1432	if($(window).width() < 440*window.devicePixelRatio){$this.addClass('frb_chart_force_centering');} else {$this.removeClass('frb_chart_force_centering');}
1433	
1434	
1435
1436}
1437
1438$.fn.frbGraphDraw = function() {
1439	var $this = $(this), 
1440		graphData = $(this).data("graphData"), 
1441		curve = $(this).data("curve") == 'true' ? true : false, 
1442		fill = $(this).data("fill") == 'true' ? true : false, 
1443		stroke = $(this).data("barStroke") == 'true' ? true : false, 
1444		wWidth = $this.innerWidth(), 
1445		iWidth = $this.data('itemWidth'), 
1446		typeSel = $this.data('graph_style'), 
1447		legFontSize = $this.data('legend_font_size');
1448	if(wWidth - iWidth <= parseInt(legFontSize)*0.75*15) {$this.addClass('frb_chart_resp');} else {$this.removeClass('frb_chart_resp');}
1449	if(wWidth < iWidth) {$this.find('.frb_graph_wrapper canvas').attr('width', wWidth);
1450	} else {$this.find('.frb_graph_wrapper canvas').attr('width', iWidth);}
1451	
1452	var controlSet = {
1453			segmentShowStroke : true, 
1454			segmentStrokeWidth : 5, 
1455			animationEasing : "easeOutQuad",
1456			animationSteps : 75,
1457			scaleFontColor : $(this).data("scale_font_color"),
1458			scaleFontSize : 12,
1459			barShowStroke : stroke,
1460			scaleFontStyle : "italic",
1461			bezierCurve : curve,
1462			datasetFill :  fill,
1463			animateRotate : true,
1464			onAnimationComplete : function(){
1465				$this.find('.frb_charts_legend').children('.frb_charts_legend_row').each(function(ind){
1466					$(this).delay(ind*150).animate({opacity : 1}, 300);
1467				});
1468			} // callback
1469		}
1470	
1471	
1472	
1473	
1474	if(typeSel == 'line'){
1475		graphData = new Chart($this.find('.frb_graph_canvas')[0].getContext("2d")).Line(graphData, controlSet);
1476	} else if(typeSel == 'bar') {
1477		graphData = new Chart($this.find('.frb_graph_canvas')[0].getContext("2d")).Bar(graphData, controlSet);	
1478	}
1479	
1480	
1481	
1482}
1483
1484
1485//			gauge
1486
1487function frbGaugeChartRefresh(thisReference) {
1488	var initData, g, gaugeValue, gaugeWidth, parentWidth, sideMargin, topMargin;
1489	thisReference.find(".frb_gauge_shortcode").each(function(){
1490		gaugeWidth = $(this).width();
1491		parentWidth = $(this).parent().width();
1492
1493		if (gaugeWidth>parentWidth) {
1494			$(this).width(parentWidth).height(parentWidth*0.6);
1495		}
1496		
1497		initData = $(this).data("gauge_init");
1498		gaugeValue = $(this).data("gauge_value");
1499		g = new JustGage(initData);
1500		g.refresh(gaugeValue);
1501		gaugeWidth = $(this).width();
1502		sideMargin = gaugeWidth*0.17;
1503		topMargin = gaugeWidth * 0.12;
1504		$(this).css({"margin-left":"-"+sideMargin+"px","margin-right":"-"+sideMargin+"px", "margin-top":"-"+topMargin+"px" });
1505	});
1506}
1507
1508
1509var frb_gauge_resize;
1510$(window).resize(function(){
1511	clearTimeout(frb_gauge_resize);
1512	frb_gauge_resize = setTimeout(function(){
1513		var initData, gaugeValue, gaugeWidth, parentWidth;
1514		$(".frb_gauge_shortcode").each(function(){
1515			$(this).empty();
1516			gaugeWidth = $(this).data('gauge_width');
1517			parentWidth = $(this).parent().width();
1518
1519			if (gaugeWidth>parentWidth) {
1520				$(this).width(parentWidth).height(parentWidth*0.6);
1521			} else {
1522				$(this).width(gaugeWidth).height(gaugeWidth*0.6);
1523			}
1524
1525			initData = $(this).data("gauge_init");
1526			gaugeValue = $(this).data("gauge_value");
1527			var g = new JustGage(initData);
1528			g.refresh(gaugeValue);
1529		});
1530	},250);
1531});
1532
1533
1534var FRBpointerEventToXY = function(e){
1535  var out = {x:0, y:0};
1536  if(e.type == 'touchstart' || e.type == 'touchmove' || e.type == 'touchend' || e.type == 'touchcancel'){
1537    var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
1538    out.x = touch.pageX;
1539    out.y = touch.pageY;
1540  } else if (e.type == 'mousedown' || e.type == 'mouseup' || e.type == 'mousemove' || e.type == 'mouseover'|| e.type=='mouseout' || e.type=='mouseenter' || e.type=='mouseleave') {
1541    out.x = e.pageX;
1542    out.y = e.pageY;
1543   } else if ( e.type == 'MSPointerDown' || e.type == 'MSPointerMove' || e.type == 'MSPointerUp') { 
1544     var touch = e.originalEvent; 
1545      out.x = touch.pageX; 
1546      out.y = touch.pageY;
1547  }
1548  return out;
1549};
1550
1551
1552
1553
1554//			YouTube
1555	
1556fbuilderYoutube = function(domid, videoid, atts){
1557	
1558	var settings = $.extend({
1559		height : '480',
1560		width : '600',
1561		autoplay : true,
1562		controls : false,
1563		loop : true,
1564		mute : true,
1565		hd : false
1566	}, atts);
1567	if(typeof window.onYouTubeIframeAPIReady == 'undefined') {
1568		window.onYouTubeIframeAPIReady = function() {
1569			fbuilderYouTubeIframeAPIReady();
1570		}
1571		
1572	}
1573	else {
1574		var oldfunction = window.onYouTubeIframeAPIReady;
1575		window.onYouTubeIframeAPIReady = function() {
1576			oldfunction();
1577			fbuilderYouTubeIframeAPIReady();
1578		}
1579	}
1580	
1581		var tag = document.createElement('script');
1582		tag.id = 'frb_youtube_api';
1583		tag.src = "https://www.youtube.com/iframe_api";
1584		var firstScriptTag = document.getElementsByTagName('script')[0];
1585		firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
1586
1587	
1588	
1589	
1590	function fbuilderYouTubeIframeAPIReady() {
1591		if(videoid != '') {
1592			function onPlayerReady(event) {
1593				event.target.playVideo();
1594				if(settings['mute']) player.mute();
1595				if(settings['hd']) player.setPlaybackQuality('hd720');
1596			}
1597			
1598			var ytopts = {
1599				height: settings['height'],
1600				width: settings['width'],
1601				videoId: videoid,
1602			playerVars: { 
1603					'autoplay': (settings['autoplay'] ? 1 : 0),
1604					'wmode' : 'transparent',
1605					'version' : 3
1606					 },
1607				events: {
1608					'onReady': onPlayerReady
1609				}
1610			} 
1611			if(!settings['controls']) {
1612				ytopts['playerVars']['controls'] = 0;
1613				ytopts['playerVars']['showinfo'] = 0;
1614				ytopts['playerVars']['disablekb'] = 1;
1615				ytopts['playerVars']['iv_load_policy'] = 3;
1616			}
1617			if(settings['loop']) {
1618				ytopts['playerVars']['playlist'] = videoid;
1619				ytopts['playerVars']['loop'] = 1;
1620			}
1621			
1622			player = new YT.Player(domid, ytopts);
1623		}
1624	}
1625}
1626
1627})(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.