PageSourceSearch

https://spajadore.com/js/custom/theme.shortcodes.js

js spajadore.com collected 2026-10-04 10:24:52 UTC 43,471 bytes, 1,287 lines download raw bytes

1// Init actions
2function jacqueline_sc_init_actions() {
3	"use strict";
4	setTimeout(function() {
5		jacqueline_sc_animation();
6	}, 600);
7	
8	// MenuItems - init once
9	jacqueline_menuitems_init();
10
11	// Init sc in container
12	jacqueline_sc_init(jQuery('body').eq(0));
13}
14
15
16// Resize actions
17function jacqueline_sc_resize_actions() {
18	"use strict";
19	jacqueline_sc_sliders_resize();
20}
21
22// Scroll actions
23function jacqueline_sc_scroll_actions() {
24	"use strict";
25	jacqueline_sc_animation();
26}
27
28// Animation
29function jacqueline_sc_animation() {
30	jQuery('[data-animation^="animated"]:not(.animated)').each(function() {
31		"use strict";
32		if (jQuery(this).offset().top < jQuery(window).scrollTop() + jQuery(window).height())
33			jQuery(this).addClass(jQuery(this).data('animation'));
34	});
35}
36
37// Shortcodes init
38function jacqueline_sc_init(container) {
39
40	// Call theme specific action (if exists)
41	if (window.jacqueline_theme_sc_init) jacqueline_theme_sc_init(container);
42
43	// Accordion
44	if (container.find('.sc_accordion:not(.inited)').length > 0) {
45		container.find(".sc_accordion:not(.inited)").each(function () {
46			"use strict";
47			var init = jQuery(this).data('active');
48			if (isNaN(init)) init = 0;
49			else init = Math.max(0, init);
50			jQuery(this)
51				.addClass('inited')
52				.accordion({
53					active: init,
54					heightStyle: "content",
55					header: "> .sc_accordion_item > .sc_accordion_title",
56					create: function (event, ui) {
57						"use strict";
58						jacqueline_sc_init(ui.panel);
59						if (window.jacqueline_init_hidden_elements) jacqueline_init_hidden_elements(ui.panel);
60						ui.header.each(function () {
61							"use strict";
62							jQuery(this).parent().addClass('sc_active');
63						});
64					},
65					activate: function (event, ui) {
66						"use strict";
67						jacqueline_sc_init(ui.newPanel);
68						if (window.jacqueline_init_hidden_elements) jacqueline_init_hidden_elements(ui.newPanel);
69						ui.newHeader.each(function () {
70							"use strict";
71							jQuery(this).parent().addClass('sc_active');
72						});
73						ui.oldHeader.each(function () {
74							"use strict";
75							jQuery(this).parent().removeClass('sc_active');
76						});
77					}
78				});
79		});
80	}
81
82	// Blogger: style Polaroid
83	if (container.find('.sc_blogger.layout_polaroid .photostack:not(.inited)').length > 0) {
84		container.find(".sc_blogger.layout_polaroid .photostack:not(.inited)").each(function () {
85			"use strict";
86			var obj = jQuery(this);
87			var id = obj.attr('id');
88			if (id == undefined) {
89				id = 'photostack_'+Math.random();
90				id = id.replace('.', '');
91				obj.attr('id', id);
92			}
93			setTimeout(function() {
94				"use strict";
95				obj.addClass('inited').parent().height("auto");
96				new Photostack( obj.get(0), {
97					callback: function( item ) {
98					}
99				} );
100			}, 10);
101		});
102	}
103
104	// Blogger: Scroll horizontal
105	if (container.find('.sc_blogger .sc_scroll_horizontal .sc_scroll_wrapper:not(.inited)').length > 0) {
106		container.find(".sc_blogger .sc_scroll_horizontal .sc_scroll_wrapper:not(.inited)").each(function () {
107			"use strict";
108			var obj = jQuery(this);
109			var width = 0;
110			obj.find('.isotope_item').each(function(){
111				"use strict";
112				width += jQuery(this).outerWidth();
113			});
114			obj.addClass('inited').width(width);
115		});
116	}
117	
118	// Blogger: Scroll horizontal
119	setTimeout(function(){
120		if (container.find('.isotope_item_portfolio').length > 0) {
121			container.find(".isotope_item_portfolio").each(function () {
122				"use strict";
123				var obj = jQuery(this);
124				var width = jQuery(this).width();
125				if(width < 460){
126					jQuery(this).addClass('smaller');
127				}
128			});
129		}}, 500);
130
131	// Form
132	if (container.find('.sc_form:not(.inited) form').length > 0) {
133		container.find(".sc_form:not(.inited) form").each(function() {
134			"use strict";
135			jQuery(this).addClass('inited');
136			jQuery(this).submit(function(e) {
137				"use strict";
138				jacqueline_sc_form_validate(jQuery(this));
139				e.preventDefault();
140				return false;
141			});
142			if (jQuery(this).find('.js__datepicker').length > 0) {
143				jQuery(this).find('.js__datepicker').pickadate({
144					// Work-around for some mobile browsers clipping off the picker.
145					onOpen: function() {
146						"use strict";
147						jQuery('pre').css('overflow', 'hidden');
148						},
149					onClose: function() {
150						"use strict";
151						jQuery('pre').css('overflow', '');
152					},
153					monthsShort: [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec' ],
154					showMonthsShort: true,
155					format: 'dd.mm.yyyy',
156					formatSubmit: 'yyyy-mm-dd',
157					min: true
158				});
159			}
160			if (jQuery(this).find('.js__timepicker').length > 0) {
161				jQuery(this).find('.js__timepicker').pickatime();
162			}
163		});
164	}
165
166	//Countdown
167	if (container.find('.sc_countdown:not(.inited)').length > 0) {
168		container.find('.sc_countdown:not(.inited)')
169			.each(function () {
170				"use strict";
171				jQuery(this).addClass('inited');
172				var id = jQuery(this).attr('id');
173				var curDate = new Date(); 
174				var curDateTimeStr = curDate.getFullYear()+'-'+(curDate.getMonth()<9 ? '0' : '')+(curDate.getMonth()+1)+'-'+(curDate.getDate()<10 ? '0' : '')+curDate.getDate()
175					+' '+(curDate.getHours()<10 ? '0' : '')+curDate.getHours()+':'+(curDate.getMinutes()<10 ? '0' : '')+curDate.getMinutes()+':'+(curDate.getSeconds()<10 ? '0' : '')+curDate.getSeconds(); 
176				var interval = 1;	//jQuery(this).data('interval');
177				var endDateStr = jQuery(this).data('date');
178				var endDateParts = endDateStr.split('-');
179				var endTimeStr = jQuery(this).data('time');
180				var endTimeParts = endTimeStr.split(':');
181				if (endTimeParts.length < 3) endTimeParts[2] = '00';
182				var endDateTimeStr = endDateStr+' '+endTimeStr;
183				if (curDateTimeStr < endDateTimeStr) {
184					jQuery(this).find('.sc_countdown_placeholder').countdown({
185						until: new Date(endDateParts[0], endDateParts[1]-1, endDateParts[2], endTimeParts[0], endTimeParts[1], endTimeParts[2]), 
186						tickInterval: interval,
187						onTick: jacqueline_countdown
188					}); 
189				} else {
190					jQuery(this).find('.sc_countdown_placeholder').countdown({
191						since: new Date(endDateParts[0], endDateParts[1]-1, endDateParts[2], endTimeParts[0], endTimeParts[1], endTimeParts[2]), 
192						tickInterval: interval,
193						onTick: jacqueline_countdown
194					}); 
195				}
196			});
197	}
198
199	// Emailer form
200	if (container.find('.sc_emailer:not(.inited)').length > 0) {
201		container.find(".sc_emailer:not(.inited)")
202			.addClass('inited')
203			.on('click', '.sc_emailer_button', function(e) {
204				"use strict";
205				var form = jQuery(this).parents('form');
206				var parent = jQuery(this).parents('.sc_emailer');
207				if (parent.hasClass('sc_emailer_opened')) {
208					if (form.length>0 && form.find('input').val()!='') {
209						var group = jQuery(this).data('group');
210						var email = form.find('input').val();
211						var regexp = new RegExp(JACQUELINE_STORAGE['email_mask']);
212						if (!regexp.test(email)) {
213							form.find('input').get(0).focus();
214							jacqueline_message_warning(JACQUELINE_STORAGE['strings']['email_not_val
214id']);
215						} else {
216							jQuery.post(JACQUELINE_STORAGE['ajax_url'], {
217								action: 'emailer_submit',
218								nonce: JACQUELINE_STORAGE['ajax_nonce'],
219								group: group,
220								email: email
221							}).done(function(response) {
222								"use strict";
223								var rez = {};
224								try {
225									rez = JSON.parse(response);
226								} catch (e) {
227									rez = { error: JACQUELINE_STORAGE['ajax_error'] };
228									console.log(response);
229								}
230								if (rez.error === '') {
231									jacqueline_message_info(JACQUELINE_STORAGE['strings']['email_confirm'].replace('%s', email));
232									form.find('input').val('');
233								} else {
234									jacqueline_message_warning(rez.error);
235								}
236							});
237						}
238					} else
239						form.get(0).submit();
240				} else {
241					parent.addClass('sc_emailer_opened');
242				}
243				e.preventDefault();
244				return false;
245			});
246	}
247	
248	// Googlemap init
249	// if (container.find('.sc_googlemap:not(.inited)').length > 0) {
250	// 	container.find('.sc_googlemap:not(.inited)')
251	// 		.each(function () {
252	// 			"use strict";
253	// 			if (jQuery(this).parents('div:hidden,article:hidden').length > 0) return;
254	// 			var map = jQuery(this).addClass('inited');
255	// 			var map_id		= map.attr('id');
256	// 			var map_zoom	= map.data('zoom');
257	// 			var map_style	= map.data('style');
258	// 			var map_markers = [];
259	// 			map.find('.sc_googlemap_marker').each(function() {
260	// 				"use strict";
261	// 				var marker = jQuery(this);
262	// 				map_markers.push({
263	// 					point:			marker.data('point'),
264	// 					address:		marker.data('address'),
265	// 					latlng:			marker.data('latlng'),
266	// 					description:	marker.data('description'),
267	// 					title:			marker.data('title')
268	// 				});
269	// 			});
270	// 			jacqueline_googlemap_init( jQuery('#'+map_id).get(0), {style: map_style, zoom: map_zoom, markers: map_markers});
271	// 		});
272	// }
273
274	// Infoboxes
275	if (container.find('.sc_infobox.sc_infobox_closeable:not(.inited)').length > 0) {
276		container.find('.sc_infobox.sc_infobox_closeable:not(.inited)')
277			.addClass('inited')
278			.on('click', function (e) {
279				"use strict";
280				jQuery(this).slideUp();
281				e.preventDefault();
282				return false;
283			});
284	}
285
286	// Matches
287	if (container.find('.sc_matches:not(.inited)').length > 0) {
288		container.find('.sc_matches:not(.inited)')
289			.each(function () {
290				"use strict";
291				jQuery(this).find('.sc_matches_next .sc_matches_list .sc_match').on('click', function () {
292					"use strict";
293					jQuery(this).parents('.sc_matches').find('.sc_matches_current .sc_match').hide();
294					var item = jQuery(this).data('item');
295					jQuery(item).fadeIn();
296				});
297			});
298	}
299
300	// Matches & Players: Sort players by points
301	if (container.find('.sc_players_table:not(.inited)').length > 0) {
302		container.find('.sc_players_table:not(.inited)')
303			.addClass('inited')
304			.on('click', '.sort', function (e) {
305				"use strict";
306				var table = jQuery(this).parents('.sc_players_table');
307				var id = jQuery(table).attr('id')
308				var sort = jQuery(table).data('sort') == 'asc' ? 'desc' : 'asc';
309				jQuery.post(JACQUELINE_STORAGE['ajax_url'], {
310					action: 'sort_by_points',
311					nonce: JACQUELINE_STORAGE['ajax_nonce'],
312					sort: sort,
313					table: JACQUELINE_STORAGE['ajax_' + id]
314				}).done(function(response) {
315					var rez = {};
316					try {
317						rez = JSON.parse(response);
318					} catch (e) {
319						rez = { error: JACQUELINE_STORAGE['ajax_error'] };
320						console.log(response);
321					}
322					if (rez.error === '') { 
323						jQuery(table).find('.sc_table').remove();
324						jQuery(table).find('script').after(rez.data);
325						jQuery(table).data('sort', sort);
326						jacqueline_select_players_category(jQuery(table).find('.sc_players_table_category select'));		
327					}
328				});
329				e.preventDefault();
330				return false;
331			});
332	}
333	
334	// Matches & Players: Select category in the points table
335	if (container.find('.sc_players_table_category:not(.inited)').length > 0) {
336		container.find('.sc_players_table_category:not(.inited)')
337			.addClass('inited')
338			.on('change', function () {
339				"use strict";
340				jacqueline_select_players_category(jQuery(this));		
341			});
342	}
343
344	// Popup links
345	if (container.find('.sc_popup_link:not(.inited)').length > 0) {
346		container.find('.sc_popup_link:not(.inited)').each(function() {
347			var popup_id = jQuery(this).attr('href');
348			jQuery(this)
349				.addClass('inited')
350				.magnificPopup({
351					type: 'inline',
352					removalDelay: 500,
353					midClick: true,
354					callbacks: {
355						beforeOpen: function () {
356							this.st.mainClass = 'mfp-zoom-in';
357						},
358						open: function() {
359							"use strict";
360							jacqueline_sc_init(jQuery(popup_id));
361							jacqueline_resize_actions();
362							if (window.jacqueline_init_hidden_elements) jacqueline_init_hidden_elements(jQuery(popup_id));
363						},
364						close: function() {}
365					}
366				});
367		});
368	}
369
370	// Recent news widget and sc
371	if (container.find('.sc_recent_news_header_category_item_more:not(.inited)').length > 0) {
372		container.find('.sc_recent_news_header_category_item_more:not(.inited)').each(function() {
373			"use strict";
374			jQuery(this)
375				.addClass('inited')
376				.on('click', function(e) {
377					"use strict";
378					jQuery(this).toggleClass('opened').find('.sc_recent_news_header_more_categories').slideToggle();
379					e.preventDefault();
380					return false;
381				});
382		});
383	}
384
385	// Search form
386	if (container.find('.search_wrap:not(.inited)').length > 0) {
387		container.find('.search_wrap:not(.inited)').each(function() {
388			"use strict";
389			jQuery(this)
390				.addClass('inited')
391				.on('click', '.search_submit', function(e) {
392					"use strict";
393					var search_wrap = jQuery(this).parents('.search_wrap');
394					if (!search_wrap.hasClass('search_state_fixed')) {
395						if (search_wrap.hasClass('search_state_opened')) {
396							if (search_wrap.find('.search_field').val() != '')
397								search_wrap.find('form').get(0).submit();
398							else
399								search_wrap.removeClass('search_state_opened').addClass('search_state_closed').find('.search_results').fadeOut();
400						} else
401							search_wrap.removeClass('search_state_closed').addClass('search_state_opened').find('.search_field').get(0).focus();
402					} else {
403						if (search_wrap.find('.search_field').val() != '')
404							search_wrap.find('form').get(0).submit();
405						else {
406							search_wrap.find('.search_field').val('');
407							search_wrap.find('.search_results').fadeOut();
408						}
409					}
410					e.preventDefault();
411					return false;
412				})
413				.on('click', '.search_results_close', function(e) {
414					"use strict";
415					jQuery(this).parent().fadeOut();
416					e.preventDefault();
417					return false;
418				})
419				.on('click', '.search_more', function(e) {
420					"use strict";
421					if (jQuery(this).parents('.search_wrap').find('.search_field').val() != '')
422						jQuery(this).parents('.search_wrap').find('form').get(0).submit();
423					e.preventDefault();
424					return false;
425				});
426			if (jQuery(this).hasClass('search_ajax')) {
427				var ajax_timer = null;
428				jQuery(this).find('.search_field').keyup(function(e) {
429					"use strict";
430					var search_field = jQuery(this);
431					var s = search_field.val();
432					if (ajax_timer) {
433						clearTimeout(ajax_timer);
434						ajax_timer = null;
435					}
436					if (s.length >= JACQUELINE_STORAGE['ajax_search_min_length']) {
437						ajax_timer = setTimeout(function() {
438							"use strict";
439							jQuery.post(JACQUELINE_STORAGE['ajax_url'], {
440								action: 'ajax_search',
441								nonce: JACQUELINE_STORAGE['ajax_nonce'],
442								text: s
443							}).done(function(response) {
444								"use strict";
445								clearTimeout(ajax_timer);
446								ajax_timer = null;
447								var rez = {};
448								try {
449									rez = JSON.parse(response);
450								} catch (e) {
451									rez = { error: JACQUELINE_STORAGE['ajax_error'] };
452									console.log(response);
453								}
454								if (rez.error === '') {
455									search_field.parents('.search_ajax').find('.search_results_content').empty().append(rez.data);
456									search_field.parents('.search_ajax').find('.search_results').fadeIn();
457								} else {
458									jacqueline_message_warning(JACQUELINE_STORAGE['strings']['search_error']);
459								}
460							});
461						}, JACQUELINE_STORAGE['ajax_search_delay']);
462					}
463				});
464			}
465		});
466	}
467
468	
469	// Section Pan init
470	if (container.find('.sc_pan:not(.inited_pan)').length > 0) {
471		container.find('.sc_pan:not(.inited_pan)')
472			.each(function () {
473				"use strict";
474				if (jQuery(this).parents('div:hidden,article:hidden').length > 0) return;
475				var pan = jQuery(this).addClass('inited_pan');
476				var cont = pan.parent();
477				cont.mousemove(function(e) {
478					"use strict";
479					var anim = {};
480					var tm = 0;
481					var pw = pan.width(), ph = pan.height();
482					var cw = cont.width(), ch = cont.height();
483					var coff = cont.offset();
484					if (pan.hasClass('sc_pan_vertical'))
485						pan.css('top', -Math.floor((e.pageY - coff.top) / ch * (ph-ch)));
486					if (pan.hasClass('sc_pan_horizontal'))
487						pan.css('left', -Math.floor((e.pageX - coff.left) / cw * (pw-cw)));
488				});
489				cont.mouseout(function(e) {
490					"use strict";
491					pan.css({'left': 0, 'top': 0});
492				});
493			});
494	}
495
496	// Scroll
497	if (container.find('.sc_scroll:not(.inited)').length > 0) {
498		container.find('.sc_scroll:not(.inited)')
499			.each(function () {
500				"use strict";
501				if (jQuery(this).parents('div:hidden,article:hidden').length > 0) return;
502				JACQUELINE_STORAGE['scroll_init_counter'] = 0;
503				jacqueline_sc_init_scroll_area(jQuery(this));
504			});
505	}
506
507
508	// Swiper Slider
509	if (container.find('.sc_slider_swiper:not(.inited)').length > 0) {
510		container.find('.sc_slider_swiper:not(.inited)')
511			.each(function () {
512				"use strict";
513				if (jQuery(this).parents('div:hidden,article:hidden').length > 0) return;
514				//if (jQuery(this).parents('.isotope_wrap:not(.inited)').length > 0) return;
515				jQuery(this).addClass('inited');
516				jacqueline_sc_slider_autoheight(jQuery(this));
517				if (jQuery(this).parents('.sc_slider_pagination_area').length > 0) {
518					jQuery(this).parents('.sc_slider_pagination_area').find('.sc_slider_pagination .post_item').eq(0).addClass('active');
519				}
520				var id = jQuery(this).attr('id');
521				if (id == undefined) {
522					id = 'swiper_'+Math.random();
523					id = id.replace('.', '');
524					jQuery(this).attr('id', id);
525				}
526				jQuery(this).addClass(id);
527				jQuery(this).find('.slides .swiper-slide').css('position', 'relative');
528				var width = jQuery(this).width();
529				if (width == 0) width = jQuery(this).parent().width();
530				var spv = jQuery(this).data('slides-per-view');
531				if (spv == undefined) spv = 1;
532				var min_width = jQuery(this).data('slides-min-width');
533				if (min_width == undefined) min_width = 50;
534				if (width / spv < min_width) spv = Math.max(1, Math.floor(width / min_width));
535				var space = jQuery(this).data('slides-space');
536				if (space == undefined) space = 0;
537				if (JACQUELINE_STORAGE['swipers'] === undefined) JACQUELINE_STORAGE['swipers'] = {};
538				JACQUELINE_STORAGE['swipers'][id] = new Swiper('.'+id, {
539					calculateHeight: !jQuery(this).hasClass('sc_slider_height_fixed'),
540					resizeReInit: true,
541					autoResize: true,
542					loop: true,
543					grabCursor: true,
544			        nextButton: jQuery(this).hasClass('sc_slider_controls') ? '#'+id+' .sc_slider_next' : false,
545			        prevButton: jQuery(this).hasClass('sc_slider_controls') ? '#'+id+' .sc_slider_prev' : false,
546					pagination: jQuery(this).hasClass('sc_slider_pagination') ? '#'+id+' .sc_slider_pagination_wrap' : false,
547				    paginationClickable: true,
548					autoplay: jQuery(this).hasClass('sc_slider_noautoplay') ? false : (isNaN(jQuery(this).data('interval')) ? 7000 : jQuery(this).data('interval')),
549					autoplayDisableOnInteraction: false,
550					initialSlide: 0,
551					slidesPerView: spv,
552					loopedSlides: spv,
553					spaceBetween: space,
554					speed: 600,
555					// Autoheight on start
556					onFirstInit: function (slider){
557						"use strict";
558						var cont = jQuery(slider.container);
559						if (!cont.hasClass('sc_slider_height_auto')) return;
560						var li = cont.find('.swiper-slide').eq(1);
561						var h = li.data('height_auto');
562						if (h > 0) {
563							var pt = parseInt(li.css('paddingTop')), pb = parseInt(li.css('paddingBottom'));
564							li.height(h);
565							cont.height(h + (isNaN(pt) ? 0 : pt) + (isNaN(pb) ? 0 : pb));
566							cont.find('.swiper-wrapper').height(h + (isNaN(pt) ? 0 : pt) + (isNaN(pb) ? 0 : pb));
567						}
568					},
569					// Autoheight on slide change
570					onSlideChangeStart: function (slider){
571						"use strict";
572						var cont = jQuery(slider.container);
573						if (!cont.hasClass('sc_slider_height_auto')) return;
574						var idx = slider.activeIndex;
575						var li = cont.find('.swiper-slide').eq(idx);
576						var h = li.data('height_auto');
577						if (h > 0) {
578							var pt = parseInt(li.css('paddingTop')), pb = parseInt(li.css('paddingBottom'));
579							li.height(h);
580							cont.height(h + (isNaN(pt) ? 0 : pt) + (isNaN(pb) ? 0 : pb));
581							cont.find('.swiper-wrapper').height(h + (isNaN(pt) ? 0 : pt) + (isNaN(pb) ? 0 : pb));
582						}
583					},
584					// Change current item in 'full' or 'over' pagination wrap
585					onSlideChangeEnd: function (slider, dir) {
586						"use strict";
587						var cont = jQuery(slider.container);
588						if (cont.parents('.sc_slider_pagination_area').length > 0) {
589							var li = cont.parents('.sc_slider_pagination_area').find('.sc_slider_pagination .post_item');
590							var idx = slider.activeIndex > li.length ? 0 : slider.activeIndex-1;
591							jacqueline_sc_change_active_pagination_in_slider(cont, idx);
592						}
593					}
594				});
595				
596				jQuery(this).data('settings', {mode: 'horizontal'});		// VC hook
597				
598				var curSlide = jQuery(this).find('.slides').data('current-slide');
599				if (curSlide > 0)
600					JACQUELINE_STORAGE['swipers'][id].slideTo(curSlide-1);
601
602				jacqueline_sc_prepare_slider_navi(jQuery(this));
603
604			});
605			
606		// Check slides per view
607		jacqueline_sc_sliders_resize();
608	}
609
610	//Skills init
611	if (container.find('.sc_skills_item:not(.inited)').length > 0) {
612		jacqueline_sc_init_skills(container);
613		jQuery(window).scroll(function () { jacqueline_sc_init_skills(container); });
614	}
615	//Skills type='arc' init
616	if (container.find('.sc_skills_arc:not(.inited)').length > 0) {
617		jacqueline_sc_init_skills_arc(container);
618		jQuery(window).scroll(function () { jacqueline_sc_init_skills_arc(container); });
619	}
620
621	// Tabs
622	if (container.find('.sc_tabs:not(.inited):not(.no_jquery_ui),.tabs_area:not(.inited)').length > 0) {
623		container.find('.sc_tabs:not(.inited):not(.no_jquery_ui),.tabs_area:not(.inited)').each(function () {
624			"use strict";
625			var init = jQuery(this).data('active');
626			if (isNaN(init)) init = 0;
627			else init = Math.max(0, init);
628			jQuery(this)
629				.addClass('inited')
630				.tabs({
631					active: init,
632					show: {
633						effect: 'fadeIn',
634						duration: 300
635					},
636					hide: {
637						effect: 'fadeOut',
638						duration: 300
639					},
640					create: function (event, ui) {
641						"use strict";
642						jacqueline_sc_init(ui.panel);
643						if (window.jacqueline_init_hidden_elements) jacqueline_init_hidden_elements(ui.panel);
644					},
645					activate: function (event, ui) {
646						"use strict";
647						jacqueline_sc_init(ui.newPanel);
648						if (window.jacqueline_init_hidden_elements) jacqueline_init_hidden_elements(ui.newPanel);
649					}
650				});
651		});
652	}
653	if (container.find('.sc_tabs.no_jquery_ui:not(.inited)').length > 0) {
654		container.find('.sc_tabs.no_jquery_ui:not(.inited)').each(function () {
655			"use strict";
656			jQuery(this)
657				.addClass('inited')
658				.on('click', '.sc_tabs_titles li a', function(e) {
659					"use strict";
660					if (!jQuery(this).parent().hasClass('sc_tabs_active')) {
661						var id_act = jQuery(this).parent().siblings('.sc_tabs_active').find('a').attr('href');
662						var id = jQuery(this).attr('href');
663						jQuery(this).parent().addClass('sc_tabs_active').siblings().removeClass('sc_tabs_active');
664						jQuery(id_act).fadeOut(function() {
665							"use strict";
666							jQuery(id).fadeIn(function() {
667								"use strict";
668								jacqueline_sc_init(jQuery(this));
669								if (window.jacqueline_init_hidden_elements) jacqueline_init_hidden_elements(jQuery(this));
670							});
671						});
672					}
673					e.preventDefault();
674					return false;
675				});
676			jQuery(this).find('.sc_tabs_titles li').eq(0).addClass('sc_tabs_active');
677			jQuery(this).find('.sc_tabs_content').eq(0).fadeIn(function() {
678				"use strict";
679				jacqueline_sc_init(jQuery(this));
680				if (window.jacqueline_init_hidden_elements) jacqueline_init_hidden_elements(jQuery(this));
681			});
682		});
683	}
684	if (container.find('.sc_tabs_style_2 .sc_tabs_content').length > 0) {
685		container.find('.sc_tabs_style_2 .sc_tabs_content').each(function () {
686			"use strict";
687			if(jQuery(this).data('icon') != '')
688			{
689				var icon = jQuery(this).data('icon');
690				var id = jQuery(this).attr('id');
691				jQuery(".sc_tabs_title[aria-controls='" + id + "']").addClass(icon).addClass('icon');
692				
693			}
694		});
695	}
696
697	// Toggles
698	if (container.find('.sc_toggles .sc_toggles_title:not(.inited)').length > 0) {
699		container.find('.sc_toggles .sc_toggles_title:not(.inited)')
700			.addClass('inited')
701			.on('click', function () {
702				"use strict";
703				jQuery(this).toggleClass('ui-state-active').parent().toggleClass('sc_active');
704				jQuery(this).parent().find('.sc_toggles_content').slideToggle(300, function () { 
705					"use strict";
706					jacqueline_sc_init(jQuery(this).parent().find('.sc_toggles_content')); 
707					if (window.jacqueline_init_hidden_elements) jacqueline_init_hidden_elements(jQuery(this).parent().find('.sc_toggles_content'));
708				});
709			});
710	}
711
712	//Zoom
713	if (container.find('.sc_zoom:not(.inited)').length > 0) {
714		container.find('.sc_zoom:not(.inited)')
715			.each(function () {
716				"use strict";
717				if (jQuery(this).parents('div:hidden,article:hidden').length > 0) return;
718				jQuery(this).addClass('inited');
719				jQuery(this).find('img').elevateZoom({
720					zoomType: "lens",
721					lensShape: "round",
722					lensSize: 200,
723					lensBorderSize: 4,
724					lensBorderColour: '#ccc'
725				});
726			});
727	}
728
729}
730
731// Scrolled areas
732function jacqueline_sc_init_scroll_area(obj) {
733	"use strict";
734
735	// Wait for images loading
736	if (!jacqueline_check_images_complete(obj) && JACQUELINE_STORAGE['scroll_init_counter']++ < 30) {
737		setTimeout(function() { jacqueline_sc_init_scroll_area(obj); }, 200);
738		return;
739	}
740
741	// Start init scroll area
742	obj.addClass('inited');
743
744	var id = obj.attr('id');
745	if (id == undefined) {
746		id = 'scroll_'+Math.random();
747		id = id.replace('.', '');
748		obj.attr('id', id);
749	}
750	obj.addClass(id);
751
752	var parent_obj = obj.parent();
753	var parent_id  = parent_obj.attr('id');
754	if (parent_id == undefined) {
755		parent_id = 'scroll_wrap_'+Math.random();
756		parent_id = parent_id.replace('.', '');
757		parent_obj.attr('id', parent_id);
758	}
759	parent_obj.addClass(parent_id);
760
761	var bar = obj.find('#'+id+'_bar');
762	if (bar.length > 0 && !bar.hasClass(id+'_bar')) {
763		bar.addClass(id+'_bar');
764	}
765	
766	// Correct wrapper width (if scroll dir = horizontal)
767	if (obj.hasClass('sc_scroll_horizontal')) {
768		obj.find('.sc_scroll_wrapper > .sc_scroll_slide').css('width', 'auto');
769		obj.find('.sc_scroll_wrapper').css('width', obj.find('.sc_scroll_wrapper > .sc_scroll_slide').width()+10);
770		obj.find('.sc_scroll_wrapper > .sc_scroll_slide').css('width', '100%')
771	}
772
773	// Init Swiper with scroll plugin
774	if (JACQUELINE_STORAGE['swipers'] === undefined) JACQUELINE_STORAGE['swipers'] = {};
775	JACQUELINE_STORAGE['swipers'][id] = new Swiper('.'+id, {
776		calculateHeight: false,
777		resizeReInit: true,
778		autoResize: true,
779		freeMode: true,
780		freeModeFluid: true,
781		grabCursor: true,
782		mode: obj.hasClass('sc_scroll_vertical') ? 'vertical' : 'horizontal',
783		direction: obj.hasClass('sc_scroll_vertical') ? 'vertical' : 'horizontal',
784		slidesPerView: obj.hasClass('sc_scroll') ? 'auto' : 1,
785        nextButton: parent_obj.hasClass('sc_scroll_controls') ? '#'+parent_id+' .sc_scroll_next' : false,
786        prevButton: parent_obj.hasClass('sc_scroll_controls') ? '#'+parent_id+' .sc_scroll_prev' : false,
787        scrollbar: '.'+id+'_bar',
788        scrollbarHide: true,
789	})
790	
791	// VC hook
792	obj.data('settings', {mode: 'horizontal'});
793}
794
795// Slider navigation
796function jacqueline_sc_prepare_slider_navi(slider) {
797	"use strict";
798	var navi = null;
799	
800	// Pagination with slide's title
801	navi = slider.siblings('.sc_slider_pagination');
802	if (navi.length > 0) {
803		navi.on('click', '.post_item', function(e){
804			var swiper = jQuery(this).parents('.sc_slider_pagination_area').find('.swiper-slider-container');
805			var id = swiper.attr('id');
806			JACQUELINE_STORAGE['swipers'][id].slideTo(jQuery(this).index()+1);
807			e.preventDefault();
808			return false;
809		});
810	}
811}
812
813// Sliders: Pagination
814function jacqueline_sc_change_active_pagination_in_slider(slider, idx) {
815	"use strict";
816	var pg = slider.parents('.sc_slider_pagination_area').find('.sc_slider_pagination');
817	if (pg.length==0) return;
818	pg.find('.post_item').removeClass('active').eq(idx).addClass('active');
819	var h = pg.height();
820	var off = pg.find('.active').offset().top - pg.offset().top;
821	var off2 = pg.find('.sc_scroll_wrapper').offset().top - pg.offset().top;
822	var h2  = pg.find('.active').height();
823	if (off < 0) {
824		pg.find('.sc_scroll_wrapper').css({'transform': 'translate3d(0px, 0px, 0px)', 'transition-duration': '0.3s'});
825	} else if (h <= off+h2) {
826		pg.find('.sc_scroll_wrapper').css({'transform': 'translate3d(0px, -'+(Math.abs(off2)+off-h/4)+'px, 0px)', 'transition-duration': '0.3s'});
827	}
828}
829
830// Sliders: Autoheight
831function jacqueline_sc_slider_autoheight(slider) {
832	"use strict";
833	if (slider.hasClass('.sc_slider_height_auto')) {
834		slider.find('.swiper-slide').each(function() {
835			"use strict";
836			if (jQuery(this).data('height_auto') == undefined) {
837				jQuery(this).attr('data-height_auto', jQuery(this).height());
838			}
839		});
840	}
841}
842
843// Sliders: Resize
844function jacqueline_sc_sliders_resize() {
845	"use strict";
846	var slider = arguments[0]!==undefined ? arguments[0] : '.sc_slider_swiper.inited';
847	var resize = arguments[1]!==undefined ? arguments[1] : true;
848
849	jQuery(slider).each(function() {
850		"use strict";
851		var id = jQuery(this).attr('id');
852		var width = jQuery(this).width();
853		var last_width = jQuery(this).data('last-width');
854		if (isNaN(last_width)) last_width = 0;
855		
856		// Change slides_per_view
857		if (last_width==0 || last_width!=width) {
858			var spv = jQuery(this).data('slides-per-view');
859			if (spv == undefined) spv = 1;
860			var min_width = jQuery(this).data('slides-min-width');
861			if (min_width == undefined) min_width = 50;
862			if (width / spv < min_width) spv = Math.max(1, Math.floor(width / min_width));
863			jQuery(this).data('last-width', width);
864			if (JACQUELINE_STORAGE['swipers'][id].params.slidesPerView != spv) {
865				JACQUELINE_STORAGE['swipers'][id].params.slidesPerView = spv;
866				JACQUELINE_STORAGE['swipers'][id].params.loopedSlides = spv;
867				//JACQUELINE_STORAGE['swipers'][id].reInit();
868			}
869		}
870		
871		// Resize slider
872		if ( resize && !jQuery(this).hasClass('sc_slider_height_fixed') ) {
873			var h = 0;
874			if ( jQuery(this).find('.swiper-slide > img').length > 0 ) {
875				jQuery(this).find('.swiper-slide > img').each(function() {
876					"use strict";
877					if (jQuery(this).height() > h) h = jQuery(this).height();
878				});
879				jQuery(this).height(h);
880			} else if ( jQuery(this).find('.swiper-slide').css('backgroundImage')!='none' ) {
881				h = Math.floor(width/16*9);
882				jQuery(this).height(h).find('.swiper-slide').height(h);
883			}
884		}
885	});
886	
887	// Resize slider pagination area
888	jQuery('.sc_slider_pagination_area').each(function() {
889		"use strict";
890		var h = jQuery(this).find('.sc_slider').height();
891		if (h) {
892			jQuery(this).height(h);
893			jQuery(this).find('.sc_slider_pagination').height(h);
894			jQuery(this).find('.sc_slider_pagination .sc_scroll_vertical').height(h);
895		}
896	});
897}
898
899// Skills init
900function jacqueline_sc_init_skills(container) {
901	"use strict";
902	if (arguments.length==0) var container = jQuery('body');
903	var scrollPosition = jQuery(window).scrollTop() + jQuery(window).height();
904
905	container.find('.sc_skills_item:not(.inited)').each(function () {
906		"use strict";
907		var skillsItem = jQuery(this);
908		var scrollSkills = skillsItem.offset().top;
909		if (scrollPosition > scrollSkills) {
910			skillsItem.addClass('inited');
911			var skills = skillsItem.parents('.sc_skills').eq(0);
912			var type = skills.data('type');
913			var total = (type=='pie' && skills.hasClass('sc_skills_compact_on')) ? skillsItem.find('.sc_skills_data .pie') : skillsItem.find('.sc_skills_total').eq(0);
914			var start = parseInt(total.data('start'));
915			var stop = parseInt(total.data('stop'));
916			var maximum = parseInt(total.data('max'));
917			var startPercent = Math.round(start/maximum*100);
918			var stopPercent = Math.round(stop/maximum*100);
919			var ed = total.data('ed');
920			var duration = parseInt(total.data('duration'));
921			var speed = parseInt(total.data('speed'));
922			var step = parseInt(total.data('step'));
923			if (type == 'bar') {
924				var dir = skills.data('dir');
925				var count = skillsItem.find('.sc_skills_count').eq(0);
926				if (dir=='horizontal')
927					count.css('width', startPercent + '%').animate({ width: stopPercent + '%' }, duration);
928				else if (dir=='vertical')
929					count.css('height', startPercent + '%').animate({ height: stopPercent + '%' }, duration);
930				jacqueline_sc_animate_skills_counter(start, stop, speed-(dir!='unknown' ? 5 : 0), step, ed, total);
931			} else if (type == 'counter') {
932				jacqueline_sc_animate_skills_counter(start, stop, speed - 5, step, ed, total);
933			} else if (type == 'pie') {
934				var steps = parseInt(total.data('steps'));
935				var bg_color = total.data('bg_color');
936				var border_color = total.data('border_color');
937				var cutout = parseInt(total.data('cutout'));
938				var easing = total.data('easing');
939				var options = {
940					segmentShowStroke: true,
941					segmentStrokeColor: border_color,
942					segmentStrokeWidth: 1,
943					percentageInnerCutout : cutout,
944					animationSteps: steps,
945					animationEasing: easing,
946					animateRotate: true,
947					animateScale: false,
948				};
949				var pieData = [];
950				total.each(function() {
951					"use strict";
952					var color = jQuery(this).data('color');
953					var stop = parseInt(jQuery(this).data('stop'));
954					var stopPercent = Math.round(stop/maximum*100);
955					pieData.push({
956						value: stopPercent,
957						color: color
958					});
959				});
960				if (total.length == 1) {
961					jacqueline_sc_animate_skills_counter(start, stop, Math.round(1500/steps), step, ed, total);
962					pieData.push({
963						value: 100-stopPercent,
964						color: bg_color
965					});
966				}
967				var canvas = skillsItem.find('canvas');
968				canvas.attr({width: skillsItem.width(), height: skillsItem.width()}).css({width: skillsItem.width(), height: skillsItem.height()});
969				new Chart(canvas.get(0).getContext("2d")).Doughnut(pieData, options);
970			}
971		}
972	});
973}
974
975// Skills counter animation
976function jacqueline_sc_animate_skills_counter(start, stop, speed, step, ed, total) {
977	"use strict";
978	start = Math.min(stop, start + step);
979	total.text(start+ed);
980	if (start < stop) {
981		setTimeout(function () {
982			jacqueline_sc_animate_skills_counter(start, stop, speed, step, ed, total);
983		}, speed);
984	}
985}
986
987// Skills arc init
988function jacqueline_sc_init_skills_arc(container) {
989	"use strict";
990	if (arguments.length==0) var container = jQuery('body');
991	container.find('.sc_skills_arc:not(.inited)').each(function () {
992		var arc = jQuery(this);
993		arc.addClass('inited');
994		var items = arc.find('.sc_skills_data .arc');
995		var canvas = arc.find('.sc_skills_arc_canvas').eq(0);
996		var legend = arc.find('.sc_skills_legend').eq(0);
997		var w = Math.round(arc.width() - legend.width());
998		var c = Math.floor(w/2);
999		var o = {
1000			random: function(l, u){
1001				"use strict";
1002				return Math.floor((Math.random()*(u-l+1))+l);
1003			},
1004			diagram: function(){
1005				"use strict";
1006				var r = Raphael(canvas.attr('id'), w, w),
1007					hover = Math.round(w/2/items.length),
1008					rad = hover,
1009					step = Math.round(((w-20)/2-rad)/items.length),
1010					stroke = Math.round(w/9/items.length),
1011					speed = 400;
1012				
1013				
1014				r.circle(c, c, Math.round(w/2)).attr({ stroke: 'none', fill: JACQUELINE_STORAGE['theme_skin_bg_color'] ? JACQUELINE_STORAGE['theme_skin_bg_color'] : '#ffffff' });
1015				
1016				var title = r.text(c, c, arc.data('caption')).attr({
1017					font: Math.round(rad*0.75)+'px "'+JACQUELINE_STORAGE['theme_font']+'"',
1018					fill: JACQUELINE_STORAGE['theme_skin_color'] ? JACQUELINE_STORAGE['theme_skin_color'] : '#909090'
1019				}).toFront();
1020				
1021				rad -= Math.round(step/2);
1022
1023				r.customAttributes.arc = function(value, color, rad){
1024					"use strict";
1025					var v = 3.6 * value,
1026						alpha = v == 360 ? 359.99 : v,
1027						rand = o.random(91, 240),
1028						a = (rand-alpha) * Math.PI/180,
1029						b = rand * Math.PI/180,
1030						sx = c + rad * Math.cos(b),
1031						sy = c - rad * Math.sin(b),
1032						x = c + rad * Math.cos(a),
1033						y = c - rad * Math.sin(a),
1034						path = [['M', sx, sy], ['A', rad, rad, 0, +(alpha > 180), 1, x, y]];
1035					return { path: path, stroke: color }
1036				}
1037				
1038				items.each(function(i){
1039					"use strict";
1040					var t = jQuery(this), 
1041						color = t.find('.color').val(),
1042						value = t.find('.percent').val(),
1043						text = t.find('.text').text();
1044					
1045					rad += step;
1046					var z = r.path().attr({ arc: [value, color, rad], 'stroke-width': stroke });
1047					
1048					z.mouseover(function(){
1049						"use strict";
1050						this.animate({ 'stroke-width': hover, opacity: .75 }, 1000, 'elastic');
1051						if (Raphael.type != 'VML') //solves IE problem
1052							this.toFront();
1053						title.stop().animate({ opacity: 0 }, speed, '>', function(){
1054							this.attr({ text: (text ? text + '\n' : '') + value + '%' }).animate({ opacity: 1 }, speed, '<');
1055						});
1056					}).mouseout(function(){
1057						"use strict";
1058						this.stop().animate({ 'stroke-width': stroke, opacity: 1 }, speed*4, 'elastic');
1059						title.stop().animate({ opacity: 0 }, speed, '>', function(){
1060							title.attr({ text: arc.data('caption') }).animate({ opacity: 1 }, speed, '<');
1061						});	
1062					});
1063					
1064				});
1065				
1066			}
1067		}
1068		o.diagram();
1069	});
1070}
1071
1072// Countdown update
1073function jacqueline_countdown(dt) {
1074	"use strict";
1075	var counter = jQuery(this).parent();
1076	for (var i=3; i<dt.length; i++) {
1077		var v = (dt[i]<10 ? '0' : '') + dt[i];
1078		counter.find('.sc_countdown_item').eq(i-3).find('.sc_countdown_digits span').addClass('hide');
1079		for (var ch=v.length-1; ch>=0; ch--) {
1080			counter.find('.sc_countdown_item').eq(i-3).find('.sc_countdown_digits span').eq(ch+(i==3 && v.length<3 ? 1 : 0)).removeClass('hide').text(v.substr(ch, 1));
1081		}
1082	}
1083}
1084
1085// Contact form handlers
1086function jacqueline_sc_form_validate(form){
1087	"use strict";
1088	var url = form.attr('action');
1089	if (url == '') return false;
1090	form.find('input').removeClass('error_fields_class');
1091	var error = false;
1092	var form_custom = form.data('formtype')=='form_custom';
1093	if (!form_custom) {
1094		error = jacqueline_form_validate(form, {
1095			error_message_show: true,
1096			error_message_time: 4000,
1097			error_message_class: "sc_infobox sc_infobox_style_error",
1098			error_fields_class: "error_fields_class",
1099			exit_after_first_error: false,
1100			rules: [
1101				{
1102					field: "username",
1103					min_length: { value: 1,	 message: JACQUELINE_STORAGE['strings']['name_empty'] },
1104					max_length: { value: 60, message: JACQUELINE_STORAGE['strings']['name_long'] }
1105				},
1106				{
1107					field: "email",
1108					min_length: { value: 7,	 message: JACQUELINE_STORAGE['strings']['email_empty'] },
1109					max_length: { value: 60, message: JACQUELINE_STORAGE['strings']['email_long'] },
1110					mask: { value: JACQUELINE_STORAGE['email_mask'], message: JACQUELINE_STORAGE['strings']['email_not_valid'] }
1111				},
1112				{
1113					field: "subject",
1114					min_length: { value: 1,	 message: JACQUELINE_STORAGE['strings']['subject_empty'] },
1115					max_length: { value: 100, message: JACQUELINE_STORAGE['strings']['subject_long'] }
1116				},
1117				{
1118					field: "message",
1119					min_length: { value: 1,  message: JACQUELINE_STORAGE['strings']['text_empty'] },
1120					max_length: { value: JACQUELINE_STORAGE['contacts_maxlength'], message: JACQUELINE_STORAGE['strings']['text_long'] }
1121				}
1122			]
1123		});
1124	}
1125	if (!error && url!='#') {
1126		jQuery.post(url, {
1127			action: "send_form",
1128			nonce: JACQUELINE_STORAGE['ajax_nonce'],
1129			type: form.data('formtype'),
1130			data: form.serialize()
1131		}).done(function(response) {
1132			"use strict";
1133			var rez = {};
1134			try {
1135				rez = JSON.parse(response);
1136			} catch (e) {
1137				rez = { error: JACQUELINE_STORAGE['ajax_error'] };
1138				console.log(response);
1139			}
1140			var result = form.find(".result").toggleClass("sc_infobox_style_error", false).toggleClass("sc_infobox_style_success", false);
1141			if (rez.error === '') {
1142				form.get(0).reset();
1143				result.addClass("sc_infobox_style_success").html(JACQUELINE_STORAGE['strings']['send_complete']);
1144				var return_url = form.find('input[name="return_url"]');
1145				if (return_url.length > 0 && return_url.val()!='') {
1146					setTimeout(function() {
1147						"use strict";
1148						window.location.href = return_url.val();
1149					}, 3300);
1150				}
1151			} else {
1152				result.addClass("sc_infobox_style_error").html(JACQUELINE_STORAGE['strings']['send_error'] + ' ' + rez.error);
1153			}
1154			result.fadeIn().delay(3000).fadeOut();
1155		});
1156	}
1157	return !error;
1158}
1159
1160// Get players by category
1161function jacqueline_select_players_category(sel) {
1162	var value = sel.find(':selected').data('cat');
1163	var table = sel.parents('.sc_players_table');
1164	if (value == 'all') 
1165		jQuery(table).find('.sc_table tr:nth-child(n+2)').show();
1166	else {
1167		jQuery(table).find('.sc_table tr:nth-child(n+2)').hide();
1168		jQuery(table).find('.sc_table tr').each(function() { 
1169			var cat = jQuery(this).data('cat'); 
1170			if (cat != null && cat.indexOf(value)!=-1)
1171			   jQuery(this).show();
1172		});
1173	}
1174}
1175
1176// Display menuitem in the popup
1177function jacqueline_menuitems_init() {
1178	"use strict";
1179
1180	jQuery('.sc_menuitems_wrap').on('click', '.show_popup_menuitem', function(e) {
1181		var id = jQuery(this).parents('.sc_menuitems_item').attr('id');
1182		jacqueline_menuitems_show_popup(id);
1183		
1184		e.preventDefault();
1185		return false;
1186	});
1187	
1188	jQuery('body').on('click', '.close_menuitem', function(e) {	
1189		console.log('close click');
1190		jQuery(".popup_menuitem").remove();
1191		
1192		e.preventDefault();
1193		return false;
1194	});	
1195	jQuery('body').on('click', '.popup_menuitem', function(e) {
1196		if (e.target !== this)
1197		return;
1198	
1199		console.log('close click');
1200		jQuery(".popup_menuitem").remove();
1201		
1202		e.preventDefault();
1203		return false;
1204	});
1205}
1206
1207function jacqueline_menuitems_show_popup(id) {
1208	"use strict";
1209	var menuitem = jQuery('#' + id);
1210	var columns_wrap = menuitem.parents('.sc_menuitems_wrap').find('.columns_wrap');
1211		
1212	var url = menuitem.data('url');
1213	
1214	if(url != null) {
1215		// Create popup
1216		if (jQuery('.popup_menuitem').length == 0) {
1217			jQuery('body').append('<div class="popup_menuitem"></div>');
1218		} 
1219		// load html file 
1220		jQuery(".popup_menuitem").load( url, function( response, status, xhr ) {
1221		  if (status == "error") {
1222			var msg = "Sorry but there was an error: ";
1223			alert(msg + xhr.status + " " + xhr.statusText);
1224		  }else{
1225			jQuery(".popup_menuitem").show();
1226			jacqueline_menuitems_navigation(columns_wrap, menuitem);
1227			
1228			jQuery(".popup_menuitem").find('.show_popup_menuitem').on('click', function(e){
1229				id = jQuery(this).data('id');
1230				jacqueline_menuitems_show_popup(id);
1231				
1232				e.preventDefault();
1233				return false;
1234			});
1235		 }
1236		});
1237	}
1238		
1239}
1240
1241// menuitems navigation
1242function jacqueline_menuitems_navigation(columns_wrap, menuitem) {
1243	"use strict";
1244	//navigation
1245	if(jQuery(".popup_menuitem").find('.show_popup_menuitem').length > 0){
1246		
1247		// prev arrow
1248		var prev_arrow = jQuery(".popup_menuitem").find('.show_popup_menuitem.prev_menuitem');
1249		var prev_menuitem = menuitem.parent().prev().find('.sc_menuitems_item');
1250		if( !prev_menuitem.length ){
1251			prev_menuitem = columns_wrap.find('[class*="column-"]').last().find('.sc_menuitems_item');
1252		}
1253		if( prev_menuitem.length ){
1254			
1255			var prev_id = prev_menuitem.attr('id');
1256			if(prev_id != null){
1257				prev_arrow.attr('data-id', prev_id);
1258			}
1259			else {
1260				prev_arrow.remove();
1261			}
1262		}
1263		else {
1264			prev_arrow.remove();
1265		}
1266		
1267		// next arrow
1268		var next_arrow = jQuery(".popup_menuitem").find('.show_popup_menuitem.next_menuitem');
1269		var next_menuitem = menuitem.parent().next().find('.sc_menuitems_item');
1270		if( !next_menuitem.length ){
1271			next_menuitem = columns_wrap.find('[class*="column-"]').first().find('.sc_menuitems_item');
1272		}
1273		if( next_menuitem.length ){
1274			
1275			var next_id = next_menuitem.attr('id');
1276			if(next_id != null){
1277				next_arrow.attr('data-id', next_id);
1278			}
1279			else {
1280				next_arrow.remove();
1281			}
1282		}
1283		else {
1284			next_arrow.remove();
1285		}
1286	}
1287}

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.