PageSourceSearch

https://www.outincanberra.com.au/wp-content/themes/OutInExtra/js/custom.js?ver=1.1.2

js outincanberra.com.au collected 2026-10-02 08:04:44 UTC 93,957 bytes, 3,069 lines download raw bytes

1jQuery.noConflict();
2
3var cat_map_initialize; // function name
4var bounds;
5
6(function ($, window, undefined) {
7	function oic_duplicate_menu(menu, append_to, menu_id, menu_class) {
8		var $cloned_nav;
9		menu
10			.clone()
11			.attr('id', menu_id)
12			.removeClass()
13			.attr('class', menu_class)
14			.appendTo(append_to);
15		$cloned_nav = append_to.find('> ul');
16		$cloned_nav.find('.menu_slide').remove();
17		$cloned_nav.find('li:first').addClass('et_first_mobile_item');
18		append_to.find('a').click(function (event) {
19			event.stopPropagation();
20		});
21	}
22	oic_duplicate_menu(
23		$('#oic-navigation ul.nav'),
24		$('#et-mobile-navigation nav'),
25		'et-extra-mobile-menu',
26		'et_extra_mobile_menu'
27	);
28	$(window).on('scroll', function () {
29		var h_offset = $('#main-header').outerHeight();
30		if ($('#wpadminbar').length) h_offset += $('#wpadminbar').height();
31		if ($(this).scrollTop() >= h_offset) $('body').addClass('header-sticky');
32		else $('body').removeClass('header-sticky');
33	});
34	/* Functions Page Forms */
35	if (
36		$('.function-search-form').length > 0 &&
37		$('.booking-form-wrap').length > 0
38	) {
39		$(document).bind('gform_post_render', function () {
40			$('.function-type-dropdown select').html('');
41			var ft_selected = $('.function-occasion-select select').val();
42			$('.function-occasion-select option').each(function () {
43				$('.function-type-dropdown select').append(
44					'<option ' +
45						($(this).attr('value') == ft_selected
46							? 'selected="selected"'
47							: '') +
48						' value="' +
49						$(this).text() +
50						'">' +
51						$(this).text() +
52						'</option>'
53				);
54				$('.function-type-dropdown select option')
55					.first()
56					.text('Select Function Type');
57			});
58			$('.menu-type-dropdown select').html('');
59			var mt_selected = $('.function-menu-type-select select').val();
60			$('.function-menu-type-select option').each(function () {
61				$('.menu-type-dropdown select').append(
62					'<option ' +
63						($(this).attr('value') == mt_selected
64							? 'selected="selected"'
65							: '') +
66						' value="' +
67						$(this).text() +
68						'">' +
69						$(this).text() +
70						'</option>'
71				);
72				$('.menu-type-dropdown select option').first().text('Select Menu Type');
73			});
74		});
75	}
76
77	/*----------------Gourmay Page script------------------------*/
78	if (
79		$('body').hasClass('page-id-28440') ||
80		$('body').hasClass('page-id-56385')
81	) {
82		$(window).load(function () {
83			if ($(window).width() > 991) {
84				var sliderHeight = $('#slider').height();
85				$('.slider-info-inner').height(sliderHeight);
86				$('.wine-section').height(sliderHeight);
87				$('.slider-image').height(sliderHeight);
88			}
89		});
90		$(document).ready(function () {
91			var d = new Date();
92			var n = d.getDate();
93			var m = d.getMonth();
94			m = 5;
95
96			var first_id = $('.slider #slider li').first().attr('id');
97			var slide_id = first_id;
98
99			var active = $('#slideid1').html();
100			slide_id = active;
101
102			$('#slider').slick({
103				fade: true,
104				asNavFor: '#carousel',
105			});
106			$('#carousel').slick({
107				slidesToShow: 9,
108				centerMode: true,
109				focusOnSelect: true,
110				focusOnChange: true,
111				asNavFor: '#slider',
112				responsive: [
113					{
114						breakpoint: 1500,
115						settings: {
116							slidesToShow: 7,
117						},
118					},
119					{
120						breakpoint: 991,
121						settings: {
122							slidesToShow: 5,
123						},
124					},
125					{
126						breakpoint: 750,
127						settings: {
128							slidesToShow: 3,
129						},
130					},
131				],
132			});
133
134			$('.paired-beverage').click(function () {
135				$('.tab-1').hide();
136				$('.tab-2').show();
137			});
138
139			$('.featured-dish').click(function () {
140				$('.tab-1').show();
141				$('.tab-2').hide();
142			});
143
144			$('.prompt').on('click', function (e) {
145				e.preventDefault();
146				var $t = $(this);
147
148				var dialog = $('<div />').text($t.data('prompt'));
149				dialog.dialog({
150					resizable: false,
151					height: 'auto',
152					width: 400,
153					modal: true,
154					buttons: {
155						Okay: function () {
156							$(this).dialog('close');
157							window.open($t.attr('href'), '_blank', 'noopener,noreferrer');
158						},
159					},
160				});
161			});
162		});
163	}
164
165	/*----------------Gourmay Page script END------------------------*/
166
167	/*-------------ISCROLL EFFECT --------------------------------*/
168	$(document).ready(function () {
169		var male_select_mob1 = false;
170		var female_select_mob1 = false;
171		var male_select_mob2 = false;
172		var female_select_mob2 = false;
173		var male_select_mob3 = false;
174		var female_select_mob3 = false;
175
176		$('#normal1').click(function () {
177			$(this).parent().find('.wrapper').show();
178			$(this).hide();
179			$('.male-one-0').addClass('active');
180
181			$('.male-box1').each(function () {
182				if ($(this).parent().hasClass('active')) {
183					window.male_select_mob1 = true;
184				}
185			});
186			$('.female-box1').each(function () {
187				if ($(this).parent().hasClass('active')) {
188					window.female_select_mob1 = true;
189				}
190			});
191			if (window.male_select_mob1 && window.female_select_mob1) {
192				$('.save').addClass('locked_user1');
193			}
194			var myScroller1 = new IScroll('#wrapper1', {
195				mouseWheel: true,
196				snap: 'section',
197				momentum: false,
198				bounce: false,
199			});
200			myScroller1.on('scrollEnd', function () {
201				var currentSection = myScroller1.currentPage.pageY;
202				var curr_class = '.male-one-' + currentSection;
203				$('#wrapper1 section').removeClass('active');
204				$(curr_class).addClass('active');
205
206				if ($('#wrapper1 section').hasClass('active')) {
207					window.male_select_mob1 = true;
208				} else {
209					window.male_select_mob1 = false;
210				}
211
212				if (window.male_select_mob1 && window.female_select_mob1) {
213					$('.save').addClass('locked_user1');
214				}
215			});
216			$('#m1next').click(function () {
217				var m1last = $('#wrapper1 .scroller').children().last().attr('class');
218				m1last = m1last.split('-');
219				m1last = m1last[2];
220				if (parseInt(m1last) == parseInt(myScroller1.currentPage.pageY)) {
221					myScroller1.goToPage(0, 0, 1);
222					return false;
223				}
224				myScroller1.next();
225				return false;
226			});
227			$('#m1prev').click(function () {
228				var m1last = $('#wrapper1 .scroller').children().last().attr('class');
229				m1last = m1last.split('-');
230				m1last = m1last[2];
231				if (0 == parseInt(myScroller1.currentPage.pageY)) {
232					myScroller1.goToPage(0, m1last, 1);
233					return false;
234				}
235				myScroller1.prev();
236				return false;
237			});
238		});
239
240		$('.running-pulse').click(function () {
241			$(this).removeClass('running-pulse');
242		});
243		$('#normal2').click(function () {
244			$(this).parent().find('.wrapper').show();
245			$(this).hide();
246			$('.female-one-0').addClass('active');
247
248			$('.male-box1').each(function () {
249				if ($(this).parent().hasClass('active')) {
250					window.male_select_mob1 = true;
251				}
252			});
253			$('.female-box1').each(function () {
254				if ($(this).parent().hasClass('active')) {
255					window.female_select_mob1 = true;
256				}
257			});
258			if (window.male_select_mob1 && window.female_select_mob1) {
259				$('.save').addClass('locked_user1');
260			}
261			var myScroller2 = new IScroll('#wrapper2', {
262				mouseWheel: true,
263				snap: 'section',
264				momentum: false,
265				bounce: false,
266			});
267			myScroller2.on('scrollEnd', function () {
268				var currentSection = myScroller2.currentPage.pageY;
269				var curr_class = '.female-one-' + currentSection;
270				$('#wrapper2 section').removeClass('active');
271				$(curr_class).addClass('active');
272
273				if ($('#wrapper2 section').hasClass('active')) {
274					window.female_select_mob1 = true;
275				} else {
276					window.female_select_mob1 = false;
277				}
278
279				if (window.male_select_mob1 && window.female_select_mob1) {
280					$('.save').addClass('locked_user1');
281				}
282			});
283			$('#f1next').click(function () {
284				var f1last = $('#wrapper2 .scroller').children().last().attr('class');
285				f1last = f1last.split('-');
286				f1last = f1last[2];
287				if (parseInt(f1last) == parseInt(myScroller2.currentPage.pageY)) {
288					myScroller2.goToPage(0, 0, 1);
289					return false;
290				}
291				myScroller2.next();
292				return false;
293			});
294			$('#f1prev').click(function () {
295				var f1last = $('#wrapper2 .scroller').children().last().attr('class');
296				f1last = f1last.split('-');
297				f1last = f1last[2];
298				if (0 == parseInt(myScroller2.currentPage.pageY)) {
299					myScroller2.goToPage(0, f1last, 1);
300					return false;
301				}
302				myScroller2.prev();
303				return false;
304			});
305		});
306
307		$('#normal3').click(function () {
308			$(this).parent().find('.wrapper').show();
309			$(this).hide();
310			$('.male-two-0').addClass('active');
311
312			$('.male-box2').each(function () {
313				if ($(this).parent().hasClass('active')) {
314					window.male_select_mob2 = true;
315				}
316			});
317			$('.female-box2').each(function () {
318				if ($(this).parent().hasClass('active')) {
319					window.female_select_mob2 = true;
320				}
321			});
322			if (window.male_select_mob2 && window.female_select_mob2) {
323				$('.save').addClass('locked_user2');
324			}
325			var myScroller3 = new IScroll('#wrapper3', {
326				mouseWheel: true,
327				snap: 'section',
328				momentum: false,
329				bounce: false,
330			});
331			myScroller3.on('scrollEnd', function () {
332				var currentSection = myScroller3.currentPage.pageY;
333				var curr_class = '.male-two-' + currentSection;
334				$('#wrapper3 section').removeClass('active');
335				$(curr_class).addClass('active');
336
337				if ($('#wrapper3 section').hasClass('active')) {
338					window.male_select_mob2 = true;
339				} else {
340					window.male_select_mob2 = false;
341				}
342
343				if (window.male_select_mob2 && window.female_select_mob2) {
344					$('.save').addClass('locked_user2');
345				}
346			});
347			$('#m2next').click(function () {
348				var m2last = $('#wrapper3 .scroller').children().last().attr('class');
349				m2last = m2last.split('-');
350				m2last = m2last[2];
351				if (parseInt(m2last) == parseInt(myScroller3.currentPage.pageY)) {
352					myScroller3.goToPage(0, 0, 1);
353					return false;
354				}
355				myScroller3.next();
356				return false;
357			});
358			$('#m2prev').click(function () {
359				var m2last = $('#wrapper3 .scroller').children().last().attr('class');
360				m2last = m2last.split('-');
361				m2last = m2last[2];
362				if (0 == parseInt(myScroller3.currentPage.pageY)) {
363					myScroller3.goToPage(0, m2last, 1);
364					return false;
365				}
366				myScroller3.prev();
367				return false;
368			});
369		});
370
371		$('#normal4').click(function () {
372			$(this).parent().find('.wrapper').show();
373			$(this).hide();
374			$('.female-two-0').addClass('active');
375
376			$('.male-box2').each(function () {
377				if ($(this).parent().hasClass('active')) {
378					window.male_select_mob2 = true;
379				}
380			});
381			$('.female-box2').each(function () {
382				if ($(this).parent().hasClass('active')) {
383					window.female_select_mob2 = true;
384				}
385			});
386			if (window.male_select_mob2 && window.female_select_mob2) {
387				$('.save').addClass('locked_user2');
388			}
389			var myScroller4 = new IScroll('#wrapper4', {
390				mouseWheel: true,
391				snap: 'section',
392				momentum: false,
393				bounce: false,
394			});
395			myScroller4.on('scrollEnd', function () {
396				var currentSection = myScroller4.currentPage.pageY;
397				var curr_class = '.female-two-' + currentSection;
398				$('#wrapper4 section').removeClass('active');
399				$(curr_class).addClass('active');
400
401				if ($('#wrapper4 section').hasClass('active')) {
402					window.female_select_mob2 = true;
403				} else {
404					window.female_select_mob2 = false;
405				}
406
407				if (window.male_select_mob2 && window.female_select_mob2) {
408					$('.save').addClass('locked_user2');
409				}
410			});
411			$('#f2next').click(function () {
412				var f2last = $('#wrapper4 .scroller').children().last().attr('class');
413				f2last = f2last.split('-');
414				f2last = f2last[2];
415				if (parseInt(f2last) == parseInt(myScroller4.currentPage.pageY)) {
416					myScroller4.goToPage(0, 0, 1);
417					return false;
418				}
419				myScroller4.next();
420				return false;
421			});
422			$('#f2prev').click(function () {
423				var f2last = $('#wrapper4 .scroller').children().last().attr('class');
424				f2last = f2last.split('-');
425				f2last = f2last[2];
426				if (0 == parseInt(myScroller4.currentPage.pageY)) {
427					myScroller4.goToPage(0, f2last, 1);
428					return false;
429				}
430				myScroller4.prev();
431				return false;
432			});
433		});
434
435		$('#normal5').click(function () {
436			$(this).parent().find('.wrapper').show();
437			$(this).hide();
438			$('.male-three-0').addClass('active');
439
440			$('.male-box3').each(function () {
441				if ($(this).parent().hasClass('active')) {
442					window.male_select_mob3 = true;
443				}
444			});
445			$('.female-box3').each(function () {
446				if ($(this).parent().hasClass('active')) {
447					window.female_select_mob3 = true;
448				}
449			});
450			if (window.male_select_mob3 && window.female_select_mob3) {
451				$('.save').addClass('locked_user3');
452			}
453			var myScroller5 = new IScroll('#wrapper5', {
454				mouseWheel: true,
455				snap: 'section',
456				momentum: false,
457				bounce: false,
458			});
459			myScroller5.on('scrollEnd', function () {
460				var currentSection = myScroller5.currentPage.pageY;
461				var curr_class = '.male-three-' + currentSection;
462				$('#wrapper5 section').removeClass('active');
463				$(curr_class).addClass('active');
464
465				if ($('#wrapper5 section').hasClass('active')) {
466					window.male_select_mob3 = true;
467				} else {
468					window.male_select_mob3 = false;
469				}
470
471				if (window.male_select_mob3 && window.female_select_mob3) {
472					$('.save').addClass('locked_user3');
473				}
474			});
475			$('#m3next').click(function () {
476				var m3last = $('#wrapper5 .scroller').children().last().attr('class');
477				m3last = m3last.split('-');
478				m3last = m3last[2];
479				if (parseInt(m3last) == parseInt(myScroller5.currentPage.pageY)) {
480					myScroller5.goToPage(0, 0, 1);
481					return false;
482				}
483				myScroller5.next();
484				return false;
485			});
486			$('#m3prev').click(function () {
487				var m3last = $('#wrapper5 .scroller').children().last().attr('class');
488				m3last = m3last.split('-');
489				m3last = m3last[2];
490				if (0 == parseInt(myScroller5.currentPage.pageY)) {
491					myScroller5.goToPage(0, m3last, 1);
492					return false;
493				}
494				myScroller5.prev();
495				return false;
496			});
497		});
498
499		$('#normal6').click(function () {
500			$(this).parent().find('.wrapper').show();
501			$(this).hide();
502			$('.female-three-0').addClass('active');
503
504			$('.male-box3').each(function () {
505				if ($(this).parent().hasClass('active')) {
506					window.male_select_mob3 = true;
507				}
508			});
509			$('.female-box3').each(function () {
510				if ($(this).parent().hasClass('active')) {
511					window.female_select_mob3 = true;
512				}
513			});
514			if (window.male_select_mob3 && window.female_select_mob3) {
515				$('.save').addClass('locked_user3');
516			}
517			var myScroller6 = new IScroll('#wrapper6', {
518				mouseWheel: true,
519				snap: 'section',
520				momentum: false,
521				bounce: false,
522			});
523			myScroller6.on('scrollEnd', function () {
524				var currentSection = myScroller6.currentPage.pageY;
525				var curr_class = '.female-three-' + currentSection;
526				$('#wrapper6 section').removeClass('active');
527				$(curr_class).addClass('active');
528
529				if ($('#wrapper6 section').hasClass('active')) {
530					window.female_select_mob3 = true;
531				} else {
532					window.female_select_mob3 = false;
533				}
534
535				if (window.male_select_mob3 && window.female_select_mob3) {
536					$('.save').addClass('locked_user3');
537				}
538			});
539			$('#f3next').click(function () {
540				var f3last = $('#wrapper6 .scroller').children().last().attr('class');
541				f3last = f3last.split('-');
542				f3last = f3last[2];
543				if (parseInt(f3last) == parseInt(myScroller6.currentPage.pageY)) {
544					myScroller6.goToPage(0, 0, 1);
545					return false;
546				}
547				myScroller6.next();
548				return false;
549			});
550			$('#f3prev').click(function () {
551				var f3last = $('#wrapper6 .scroller').children().last().attr('class');
552				f3last = f3last.split('-');
553				f3last = f3last[2];
554				if (0 == parseInt(myScroller6.currentPage.pageY)) {
555					myScroller6.goToPage(0, f3last, 1);
556					return false;
557				}
558				myScroller6.prev();
559				return false;
560			});
561		});
562		if (document.location.search.length) {
563			if ($('body').hasClass('page-id-21062')) {
564				if (jQuery.cookie('male-one')) {
565					var m1 = jQuery.cookie('male-one');
566					$('#normal1').parent().find('.wrapper').show();
567					$('#normal1').hide();
568					var myScrollerm1 = new IScroll('#wrapper1', {
569						mouseWheel: true,
570						snap: 'section',
571						momentum: false,
572						bounce: false,
573					});
574					var m1_id = $('#male-one-' + m1).attr('class');
575					m1_id = m1_id.split('-');
576					m1_id = m1_id[2];
577					myScrollerm1.goToPage(0, m1_id, 100);
578
579					$('#male-one-' + m1).addClass('active');
580					myScrollerm1.on('scrollEnd', function () {
581						var currentSection = myScrollerm1.currentPage.pageY;
582						var curr_class = '.male-one-' + currentSection;
583						$('#wrapper1 section').removeClass('active');
584						$(curr_class).addClass('active');
585
586						if ($('#wrapper1 section').hasClass('active')) {
587							window.male_select_mob1 = true;
588						} else {
589							window.male_select_mob1 = false;
590						}
591
592						if (window.male_select_mob1 && window.female_select_mob1) {
593							$('.save').addClass('locked_user1');
594						}
595					});
596					$('#m1next').click(function () {
597						var m1last = $('#wrapper1 .scroller')
598							.children()
599							.last()
600							.attr('class');
601						m1last = m1last.split('-');
602						m1last = m1last[2];
603						if (parseInt(m1last) == parseInt(myScrollerm1.currentPage.pageY)) {
604							myScrollerm1.goToPage(0, 0, 1);
605							return false;
606						}
607						myScrollerm1.next();
608						return false;
609					});
610					$('#m1prev').click(function () {
611						var m1last = $('#wrapper1 .scroller')
612							.children()
613							.last()
614							.attr('class');
615						m1last = m1last.split('-');
616						m1last = m1last[2];
617						if (0 == parseInt(myScrollerm1.currentPage.pageY)) {
618							myScrollerm1.goToPage(0, m1last, 1);
619							return false;
620						}
621						myScrollerm1.prev();
622						return false;
623					});
624				}
625
626				if (jQuery.cookie('female-one')) {
627					var f1 = jQuery.cookie('female-one');
628					$('#normal2').parent().find('.wrapper').show();
629					$('#normal2').hide();
630					var myScrollerf1 = new IScroll('#wrapper2', {
631						mouseWheel: true,
632						snap: 'section',
633						momentum: false,
634						bounce: false,
635					});
636					var f1_id = $('#female-one-' + f1).attr('class');
637					f1_id = f1_id.split('-');
638					f1_id = f1_id[2];
639					myScrollerf1.goToPage(0, f1_id, 100);
640					myScrollerf1.scrollToElement('#female-one-' + f1);
641					$('#female-one-' + f1).addClass('active');
642					myScrollerf1.on('scrollEnd', function () {
643						var currentSection = myScrollerf1.currentPage.pageY;
644						var curr_class = '.female-one-' + currentSection;
645						$('#wrapper2 section').removeClass('active');
646						$(curr_class).addClass('active');
647
648						if ($('#wrapper2 section').hasClass('active')) {
649							window.female_select_mob1 = true;
650						} else {
651							window.female_select_mob1 = false;
652						}
653
654						if (window.male_select_mob1 && window.female_select_mob1) {
655							$('.save').addClass('locked_user1');
656						}
657					});
658					$('#f1next').click(function () {
659						var f1last = $('#wrapper2 .scroller')
660							.children()
661							.last()
662							.attr('class');
663						f1last = f1last.split('-');
664						f1last = f1last[2];
665						if (parseInt(f1last) == parseInt(myScrollerf1.currentPage.pageY)) {
666							myScrollerf1.goToPage(0, 0, 1);
667							return false;
668						}
669						myScrollerf1.next();
670						return false;
671					});
672					$('#f1prev').click(function () {
673						var f1last = $('#wrapper2 .scroller')
674							.children()
675							.last()
676							.attr('class');
677						f1last = f1last.split('-');
678						f1last = f1last[2];
679						if (0 == parseInt(myScrollerf1.currentPage.pageY)) {
680							myScrollerf1.goToPage(0, f1last, 1);
681							return false;
682						}
683						myScrollerf1.prev();
684						return false;
685					});
686				}
687
688				if (jQuery.cookie('male-two')) {
689					var m2 = jQuery.cookie('male-two');
690					$('#normal3').parent().find('.wrapper').show();
691					$('#normal3').hide();
692					var myScrollerm2 = new IScroll('#wrapper3', {
693						mouseWheel: true,
694						snap: 'section',
695						momentum: false,
696						bounce: false,
697					});
698					var m2_id = $('#male-two-' + m2).attr('class');
699					m2_id = m2_id.split('-');
700					m2_id = m2_id[2];
701					myScrollerm2.goToPage(0, m2_id, 100);
702
703					$('#male-two-' + m2).addClass('active');
704					myScrollerm2.on('scrollEnd', function () {
705						var currentSection = myScrollerm2.currentPage.pageY;
706						var curr_class = '.male-two-' + currentSection;
707						$('#wrapper3 section').removeClass('active');
708						$(curr_class).addClass('active');
709
710						if ($('#wrapper3 section').hasClass('active')) {
711							window.male_select_mob2 = true;
712						} else {
713							window.male_select_mob2 = false;
714						}
715
716						if (window.male_select_mob2 && window.female_select_mob2) {
717							$('.save').addClass('locked_user2');
718						}
719					});
720					$('#m2next').click(function () {
721						var m2last = $('#wrapper3 .scroller')
722							.children()
723							.last()
724							.attr('class');
725						m2last = m2last.split('-');
726						m2last = m2last[2];
727						if (parseInt(m2last) == parseInt(myScrollerm2.currentPage.pageY)) {
728							myScrollerm2.goToPage(0, 0, 1);
729							return false;
730						}
731						myScrollerm2.next();
732						return false;
733					});
734					$('#m2prev').click(function () {
735						var m2last = $('#wrapper3 .scroller')
736							.children()
737							.last()
738							.attr('class');
739						m2last = m2last.split('-');
740						m2last = m2last[2];
741						if (0 == parseInt(myScrollerm2.currentPage.pageY)) {
742							myScrollerm2.goToPage(0, m2last, 1);
743							return false;
744						}
745						myScrollerm2.prev();
746						return false;
747					});
748				}
749
750				if (jQuery.cookie('female-two')) {
751					var f2 = jQuery.cookie('female-two');
752					$('#normal4').parent().find('.wrapper').show();
753					$('#normal4').hide();
754					var myScrollerf2 = new IScroll('#wrapper4', {
755						mouseWheel: true,
756						snap: 'section',
757						momentum: false,
758						bounce: false,
759					});
760					var f2_id = $('#female-two-' + f2).attr('class');
761					f2_id = f2_id.split('-');
762					f2_id = f2_id[2];
763					myScrollerf2.goToPage(0, f2_id, 100);
764
765					$('#female-two-' + f2).addClass('active');
766					myScrollerf2.on('scrollEnd', function () {
767						var currentSection = myScrollerf2.currentPage.pageY;
768						var curr_class = '.female-two-' + currentSection;
769						$('#wrapper4 section').removeClass('active');
770						$(curr_class).addClass('active');
771
772						if ($('#wrapper4 section').hasClass('active')) {
773							window.female_select_mob2 = true;
774						} else {
775							window.female_select_mob2 = false;
776						}
777
778						if (window.male_select_mob2 && window.female_select_mob2) {
779							$('.save').addClass('locked_user2');
780						}
781					});
782					$('#f2next').click(function () {
783						var f2last = $('#wrapper4 .scroller')
784							.children()
785							.last()
786							.attr('class');
787						f2last = f2last.split('-');
788						f2last = f2last[2];
789						if (parseInt(f2last) == parseInt(myScrollerf2.currentPage.pageY)) {
790							myScrollerf2.goToPage(0, 0, 1);
791							return false;
792						}
793						myScrollerf2.next();
794						return false;
795					});
796					$('#f2prev').click(function () {
797						var f2last = $('#wrapper4 .scroller')
798							.children()
799							.last()
800							.attr('class');
801						f2last = f2last.split('-');
802						f2last = f2last[2];
803						if (0 == parseInt(myScrollerf2.currentPage.pageY)) {
804							myScrollerf2.goToPage(0, f2last, 1);
805							return false;
806						}
807						myScrollerf2.prev();
808						return false;
809					});
810				}
811
812				if (jQuery.cookie('male-three')) {
813					var m3 = jQuery.cookie('male-three');
814					$('#normal5').parent().find('.wrapper').show();
815					$('#normal5').hide();
816					var myScrollerm3 = new IScroll('#wrapper5', {
817						mouseWheel: true,
818						snap: 'section',
819						momentum: false,
820						bounce: false,
821					});
822					var m3_id = $('#male-three-' + m3).attr('class');
823					m3_id = m3_id.split('-');
824					m3_id = m3_id[2];
825					myScrollerm3.goToPage(0, m3_id, 100);
826
827					$('#male-three-' + m3).addClass('active');
828					myScrollerm3.on('scrollEnd', function () {
829						var currentSection = myScrollerm3.currentPage.pageY;
830						var curr_class = '.male-three-' + currentSection;
831						$('#wrapper5 section').removeClass('active');
832						$(curr_class).addClass('active');
833
834						if ($('#wrapper5 section').hasClass('active')) {
835							window.male_select_mob3 = true;
836						} else {
837							window.male_select_mob3 = false;
838						}
839
840						if (window.male_select_mob3 && window.female_select_mob3) {
841							$('.save').addClass('locked_user3');
842						}
843					});
844					$('#m3next').click(function () {
845						var m3last = $('#wrapper5 .scroller')
846							.children()
847							.last()
848							.attr('class');
849						m3last = m3last.split('-');
850						m3last = m3last[2];
851						if (parseInt(m3last) == parseInt(myScrollerm3.currentPage.pageY)) {
852							myScrollerm3.goToPage(0, 0, 1);
853							return false;
854						}
855						myScrollerm3.next();
856						return false;
857					});
858					$('#m3prev').click(function () {
859						var m3last = $('#wrapper5 .scroller')
860							.children()
861							.last()
862							.attr('class');
863						m3last = m3last.split('-');
864						m3last = m3last[2];
865						if (0 == parseInt(myScrollerm3.currentPage.pageY)) {
866							myScrollerm3.goToPage(0, m3last, 1);
867							return false;
868						}
869						myScrollerm3.prev();
870						return false;
871					});
872				}
873
874				if (jQuery.cookie('female-three')) {
875					var f3 = jQuery.cookie('female-three');
876					$('#normal6').parent().find('.wrapper').show();
877					$('#normal6').hide();
878					var myScrollerf3 = new IScroll('#wrapper6', {
879						mouseWheel: true,
880						snap: 'section',
881						momentum: false,
882						bounce: false,
883					});
884					var f3_id = $('#female-three-' + f3).attr('class');
885					f3_id = f3_id.split('-');
886					f3_id = f3_id[2];
887					myScrollerf3.goToPage(0, f3_id, 100);
888
889					$('#female-three-' + f3).addClass('active');
890					myScrollerf3.on('scrollEnd', function () {
891						var currentSection = myScrollerf3.currentPage.pageY;
892						var curr_class = '.female-three-' + currentSection;
893						$('#wrapper6 section').removeClass('active');
894						$(curr_class).addClass('active');
895
896						if ($('#wrapper6 section').hasClass('active')) {
897							window.female_select_mob3 = true;
898						} else {
899							window.female_select_mob3 = false;
900						}
901
902						if (window.male_select_mob3 && window.female_select_mob3) {
903							$('.save').addClass('locked_user3');
904						}
905					});
906					$('#f3next').click(function () {
907						var f3last = $('#wrapper6 .scroller')
908							.children()
909							.last()
910							.attr('class');
911						f3last = f3last.split('-');
912						f3last = f3last[2];
913						if (parseInt(f3last) == parseInt(myScrollerf3.currentPage.pageY)) {
914							myScrollerf3.goToPage(0, 0, 1);
915							return false;
916						}
917						myScrollerf3.next();
918						return false;
919					});
920					$('#f3prev').click(function () {
921						var f3last = $('#wrapper6 .scroller')
922							.children()
923							.last()
924							.attr('class');
925						f3last = f3last.split('-');
926						f3last = f3last[2];
927						if (0 == parseInt(myScrollerf3.currentPage.pageY)) {
928							myScrollerf3.goToPage(0, f3last, 1);
929							return false;
930						}
931						myScrollerf3.prev();
932						return false;
933					});
934				}
935			}
936		}
937
938		function delete_cookie(name) {
939			document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
940		}
941		$('#sub_2').click(function () {
942			delete_cookie('male-one');
943			delete_cookie('female-one');
944			delete_cookie('male-two');
945			delete_cookie('female-two');
946			delete_cookie('male-three');
947			delete_cookie('female-three');
948			console.log('delet');
949		});
950
951		if ($(window).width() < 768) {
952			$('body').addClass('short');
953		}
954
955		/*----------Dialog box open on click------------------*/
956		$('.user-link').css('cursor', 'pointer');
957		var clickHandler =
958			'ontouchstart' in document.documentElement ? 'touchstart' : 'click';
959
960		$('.user-link').bind(clickHandler, function (event) {
961			event.preventDefault();
962			var id = $(this).parent().parent().parent().parent().attr('id');
963			id = id.split('-');
964			id = id[2];
965			var responseOutput = jQuery('.popup-' + id).html();
966			console.log(responseOutput);
967			$.fancybox({
968				overlayColor: '#000',
969				padding: 15,
970				centerOnScroll: true,
971				content: responseOutput,
972			});
973		});
974	});
975	//document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
976
977	/*------------------------X---------------------------*/
978
979	$(document).on('ready', function () {
980		if ($('body').hasClass('page-template-template-venue-functions-page')) {
981			jQuery('.fsrp-posts-wrap.not-featured').before(jQuery('.cat-search-bar'));
982		}
983		var curr_url = $(location).attr('href');
984		var protocoll = $(location).attr('protocol');
985		var protocol = protocoll + '//';
986		var domain = $(location).attr('hostname');
987		var pathname = '/singled-out/?change=yes';
988		var active_url = protocol + domain + pathname;
989		if (curr_url == active_url) {
990			$('.save').addClass('locked_user1');
991			$('.save').addClass('locked_user2');
992			$('.save').addClass('locked_user3');
993		}
994
995		if ($('body').hasClass('page-id-21062')) {
996			var forms = document.getElementById('singled-form');
997			forms.noValidate = true;
998			forms.addEventListener(
999				'submit',
1000				function (event) {
1001					if (!event.target.checkValidity()) {
1002						event.preventDefault();
1003					}
1004				},
1005				false
1006			);
1007		}
1008
1009		/*-----on click on change selection redirect to previous page-----*/
1010		$('.change-button-step-2').click(function () {
1011			var protocoll = $(location).attr('protocol');
1012			var protocol = protocoll + '//';
1013			var domain = $(location).attr('hostname');
1014			var pathname = '/singled-out?change=yes';
1015			var active_url = protocol + domain + pathname;
1016			window.location.replace(active_url);
1017		});
1018
1019		$('.overlay1').click(function () {
1020			male_selection1();
1021			female_selection1();
1022			var male_active = $('input.male-radio1').is(':checked');
1023			var female_active = $('input.female-radio1').is(':checked');
1024			if (male_active && female_active) {
1025				$('.save-message-1').show();
1026			}
1027		});
1028
1029		$('.overlay2').click(function () {
1030			male_selection2();
1031			female_selection2();
1032			var male_active = $('input.male-radio2').is(':checked');
1033			var female_active = $('input.female-radio2').is(':checked');
1034			if (male_active && female_active) {
1035				$('.save-message-2').show();
1036			}
1037		});
1038
1039		$('.show').click(function () {
1040			var female1 = $('input.female-radio1').is(':checked');
1041			var male2 = $('input.male-radio2').is(':checked');
1042			var female2 = $('input.female-radio2').is(':checked');
1043			var male3 = $('input.male-radio3').is(':checked');
1044			var female3 = $('input.female-radio3').is(':checked');
1045			if (male1 && female1 && male2 && female2 && male3 && female3) {
1046				$('.msg-show-next').hide();
1047			} else {
1048				$('.msg-show-next').show();
1049			}
1050		});
1051
1052		$('.form-match-two').addClass('disabled');
1053		$('.form-match-three').addClass('disabled');
1054
1055		function male_selection1() {
1056			$('.male-box1').each(function () {
1057				if ($(this).parent().hasClass('active')) {
1058					$(this).find('input[type="radio"]').attr('checked', true);
1059				}
1060			});
1061		}
1062
1063		function male_Deselection1() {
1064			$('.male-box1').each(function () {
1065				if ($(this).parent().hasClass('active')) {
1066					$(this).find('input[type="radio"]').attr('checked', false);
1067				}
1068			});
1069		}
1070
1071		function female_selection1() {
1072			$('.female-box1').each(function () {
1073				if ($(this).parent().hasClass('active')) {
1074					$(this).find('input[type="radio"]').attr('checked', true);
1075				}
1076			});
1077		}
1078
1079		function female_Deselection1() {
1080			$('.female-box1').each(function () {
1081				if ($(this).parent().hasClass('active')) {
1082					$(this).find('input[type="radio"]').attr('checked', false);
1083				}
1084			});
1085		}
1086
1087		function male_selection2() {
1088			$('.male-box2').each(function () {
1089				if ($(this).parent().hasClass('active')) {
1090					$(this).find('input[type="radio"]').attr('checked', true);
1091				}
1092			});
1093		}
1094
1095		function male_Deselection2() {
1096			$('.male-box2').each(function () {
1097				if ($(this).parent().hasClass('active')) {
1098					$(this).find('input[type="radio"]').attr('checked', false);
1099				}
1100			});
1101		}
1102
1103		function female_selection2() {
1104			$('.female-box2').each(function () {
1105				if ($(this).parent().hasClass('active')) {
1106					$(this).find('input[type="radio"]').attr('checked', true);
1107				}
1108			});
1109		}
1110
1111		function female_Deselection2() {
1112			$('.female-box2').each(function () {
1113				if ($(this).parent().hasClass('active')) {
1114					$(this).find('input[type="radio"]').attr('checked', false);
1115				}
1116			});
1117		}
1118
1119		function male_selection3() {
1120			$('.male-box3').each(function () {
1121				if ($(this).parent().hasClass('active')) {
1122					$(this).find('input[type="radio"]').attr('checked', true);
1123				}
1124			});
1125		}
1126
1127		function male_Deselection3() {
1128			$('.male-box3').each(function () {
1129				if ($(this).parent().hasClass('active')) {
1130					$(this).find('input[type="radio"]').attr('checked', false);
1131				}
1132			});
1133		}
1134
1135		function female_selection3() {
1136			$('.female-box3').each(function () {
1137				if ($(this).parent().hasClass('active')) {
1138					$(this).find('input[type="radio"]').attr('checked', true);
1139				}
1140			});
1141		}
1142
1143		function female_Deselection3() {
1144			$('.female-box3').each(function () {
1145				if ($(this).parent().hasClass('active')) {
1146					$(this).find('input[type="radio"]').attr('checked', false);
1147				}
1148			});
1149		}
1150		/*--------------------------*/
1151		$('.save-button1').click(function () {
1152			$('.save-message-1').hide();
1153			male_selection1();
1154			female_selection1();
1155			var male = $('input.male-radio1').is(':checked');
1156			var female = $('input.female-radio1').is(':checked');
1157			if (male) {
1158				$('.show-message-male-1').show();
1159				$('.show-message-female-1').hide();
1160			}
1161			if (female) {
1162				$('.show-message-male-1').hide();
1163				$('.show-message-female-1').show();
1164			}
1165			if (male && female) {
1166				$('.form-match-one').addClass('saved');
1167				$('.save-button1').hide();
1168				$('.change-button1').show();
1169				$('.form-match-two').removeClass('disabled');
1170				$('.show-message-male-1').hide();
1171				$('.show-message-female-1').hide();
1172			}
1173		});
1174
1175		$('.change-button1').click(function () {
1176			male_Deselection1();
1177			female_Deselection1();
1178			var male = $('input.male-radio1').is(':checked');
1179			var female = $('input.female-radio1').is(':checked');
1180			if (!male && !female) {
1181				$('.form-match-one').removeClass('saved');
1182				$('.save-button1').show();
1183				$('.change-button1').hide();
1184				$('.form-match-two').addClass('disabled');
1185			}
1186		});
1187
1188		$('.save-button2').click(function () {
1189			$('.save-message-2').hide();
1190			male_selection2();
1191			female_selection2();
1192			var male = $('input.male-radio2').is(':checked');
1193			var female = $('input.female-radio2').is(':checked');
1194			if (male) {
1195				$('.show-message-male-2').show();
1196				$('.show-message-female-2').hide();
1197			}
1198			if (female) {
1199				$('.show-message-male-2').hide();
1200				$('.show-message-female-2').show();
1201			}
1202			if (male && female) {
1203				$('.form-match-two').addClass('saved');
1204				$('.save-button2').hide();
1205				$('.change-button2').show();
1206				$('.form-match-three').removeClass('disabled');
1207				$('.show-message-male-2').hide();
1208				$('.show-message-female-2').hide();
1209			}
1210		});
1211
1212		$('.change-button2').click(function () {
1213			$('.save-message-2').hide();
1214			male_Deselection2();
1215			female_Deselection2();
1216			var male = $('input.male-radio2').is(':checked');
1217			var female = $('input.female-radio2').is(':checked');
1218			if (!male && !female) {
1219				$('.form-match-two').removeClass('saved');
1220				$('.save-button2').show();
1221				$('.change-button2').hide();
1222				$('.form-match-three').addClass('disabled');
1223			}
1224		});
1225
1226		$('.save-button3').click(function () {
1227			$('.save-message-3').hide();
1228			male_selection3();
1229			female_selection3();
1230			var male = $('input.male-radio3').is(':checked');
1231			var female = $('input.female-radio3').is(':checked');
1232			if (male) {
1233				$('.show-message-male-3').show();
1234				$('.show-message-female-3').hide();
1235			}
1236			if (female) {
1237				$('.show-message-male-3').hide();
1238				$('.show-message-female-3').show();
1239			}
1240			if (male && female) {
1241				$('.form-match-three').addClass('saved');
1242				$('.save-button3').hide();
1243				$('.change-button3').show();
1244				$('.show-message-male-3').hide();
1245				$('.show-message-female-3').hide();
1246			}
1247		});
1248
1249		$('.change-button3').click(function () {
1250			$('.save-message-3').hide();
1251			male_Deselection3();
1252			female_Deselection3();
1253			var male = $('input.male-radio3').is(':checked');
1254			var female = $('input.female-radio3').is(':checked');
1255			if (!male && !female) {
1256				$('.form-match-three').removeClass('saved');
1257				$('.save-button3').show();
1258				$('.change-button3').hide();
1259			}
1260		});
1261
1262		/* Function Utility Wizard */
1263		$('.planner-steps-headings li a').on('click', function (e) {
1264			e.preventDefault();
1265			var target_index = parseInt($(this).closest('li').data('step-index'));
1266			if (target_index == 5) {
1267				function_utility_load_events();
1268			}
1269			if (target_index == 6) {
1270				generate_recap_section();
1271				fill_in_gfields();
1272			}
1273			if ($(this).closest('li').hasClass('pl-s-active')) return false;
1274			var cr_index = parseInt($('.pl-s-active').data('step-index'));
1275
1276			var should_move = false;
1277
1278			if (target_index > cr_index) {
1279				if ($('.pl-step-' + cr_index).hasClass('pl-step-selection-made')) {
1280					should_move = true;
1281				}
1282			} else {
1283				should_move = true;
1284			}
1285			if (should_move) {
1286				$('.pl-current-step').removeClass('pl-current-step');
1287				$('.pl-s-active').removeClass('pl-s-active');
1288				$('.pl-s-' + target_index).addClass('pl-s-active');
1289				$('.pl-step[data-tab-index="' + target_index + '"]').addClass(
1290					'pl-current-step'
1291				);
1292				$('.planner-current-step-heading .oic-custom-heading h2').html(
1293					$('.pl-s-' + target_index).data('step-title')
1294				);
1295
1296				pl_mark_steps_done();
1297			} else {
1298				return false; // conditions for moving to target_index not met
1299			}
1300		});
1301		$('#cat-search-filter').on('click', function () {
1302			if ($('.cat-search-bar .cat-search-form').is(':hidden')) {
1303				$('.cat-search-bar .cat-search-form').slideDown('slow');
1304			} else {
1305				$('.cat-search-bar .cat-search-form').slideUp('slow');
1306			}
1307		});
1308		$('.pl-occasion-item,.pl-venue_type-item').on('click', function (e) {
1309			var max_selections = $(this).closest('.pl-step').data('max-selections');
1310			if (max_selections) {
1311				max_selections = parseInt(max_selections);
1312			} else max_selections = 9999;
1313			if (
1314				$(this).closest('.pl-step').find('.pl-item-selected').length >=
1315					max_selections &&
1316				!$(this).hasClass('pl-item-selected')
1317			) {
1318				$(this)
1319					.closest('.pl-step')
1320					.find('.pl-item-selected')
1321					.first()
1322					.removeClass('pl-item-selected');
1323			}
1324
1325			$(this).toggleClass('pl-item-selected');
1326			if ($(this).closest('.pl-step').find('.pl-item-selected').length > 0) {
1327				$(this).closest('.pl-step').addClass('pl-step-selection-made');
1328			} else {
1329				$(this).closest('.pl-step').removeClass('pl-step-selection-made');
1330			}
1331		});
1332
1333		$('.pl-guest-select-item').on('change', function () {
1334			if ($(this).val() != 'NO. OF GUESTS') {
1335				$(this).closest('.pl-step').addClass('pl-step-selection-made');
1336				$(this).addClass('pl-item-selected');
1337				$(this).attr('data-value', $(this).val());
1338			} else {
1339				$(this).closest('.pl-step').removeClass('pl-step-selection-made');
1340				$(this).removeClass('pl-item-selected');
1341				$(this).attr('data-value', '');
1342			}
1343		});
1344
1345		function validate_pl_date() {
1346			if (
1347				$('.pl-date-choose .date').val().length > 0 ||
1348				$('.flexible-time-container #flex-time').attr('checked')
1349			) {
1350				$('.pl-date-choose .date')
1351					.closest('.pl-step')
1352					.addClass('pl-step-selection-made');
1353			} else {
1354				$('.pl-date-choose .date')
1355					.closest('.pl-step')
1356					.removeClass('pl-step-selection-made');
1357			}
1358		}
1359
1360		$('.pl-date-choose .date').on('change', function () {
1361			validate_pl_date();
1362		});
1363
1364		jQuery('.flexible-time-container #flex-time').on('change', function () {
1365			validate_pl_date();
1366		});
1367		$('.pl-step-5').on('click', '.pl-venue-item', function (e) {
1368			if ($(e.target).is('a')) {
1369				return;
1370			}
1371			if (
1372				$(this).closest('.pl-step').find('.pl-item-selected').length > 5 &&
1373				!$(this).hasClass('pl-item-selected')
1374			)
1375				return false;
1376
1377			$(this).toggleClass('pl-item-selected');
1378			$(this).find('span').toggle();
1379			if ($(this).closest('.pl-step').find('.pl-item-selected').length > 0) {
1380				$(this).closest('.pl-step').addClass('pl-step-selection-made');
1381			} else {
1382				$(this).closest('.pl-step').removeClass('pl-step-selection-made');
1383			}
1384		});
1385
1386		$('#pl-submission-form').submit(validate_fp_form);
1387
1388		$('#functions-page-list-link').click(function () {
1389			$([document.documentElement, document.body]).animate(
1390				{
1391					scrollTop: $('#functions-page-list').offset().top,
1392				},
1393				500
1394			);
1395		});
1396
1397		$('.pl-date-choose .time').timepicker({
1398			showDuration: false,
1399			timeFormat: 'g:ia',
1400			minTime: '06',
1401			maxTime: '12:00am',
1402		});
1403		if ($('.pl-load-backed-up-data').length > 0) {
1404			var cr_date = $('.pl-date-choose .date').val();
1405		}
1406		$('.pl-date-choose .date').datepicker({
1407			format: 'yyyy-d-m',
1408			autoclose: true,
1409			minDate: '+1',
1410		});
1411		$('.pl-date-choose .date').datepicker('option', 'dateFormat', 'dd/mm/yy');
1412		// initialize datepair
1413		$('.pl-date-choose').datepair();
1414		var run_generate_section = false;
1415		if ($('.pl-load-backed-up-data').length > 0) {
1416			$('.pl-date-choose .date').val(cr_date);
1417			run_generate_section = true;
1418			function_utility_load_events();
1419		}
1420		function function_utility_load_events() {
1421			console.log('loading events');
1422			$('.pl-step-5-inner').html(
1423				'<div class="utility-event-loader"><i class="fa fa-spin fa-spinner"></i></div>'
1424			);
1425			var data = {
1426				action: 'oic_load_function_utility_events',
1427			};
1428
1429			data.occasions = '';
1430			data.venue_types = '';
1431			data.num_of_people = '';
1432			$('.pl-step-1 .pl-item-selected').each(function () {
1433				data.occasions += ' ' + $(this).data('value');
1434			});
1435			$('.pl-step-2 .pl-item-selected').each(function () {
1436				data.venue_types += ' ' + $(this).data('value');
1437			});
1438
1439			data.num_of_people = $('.pl-guest-select-item.pl-item-selected').val();
1440			data.start_date = $('.pl-step-3 .date').val();
1441			data.start_time = $('.pl-step-3 .time.start').val();
1442			data.end_time = $('.pl-step-3 .time.end').val();
1443			$('.pl-step-5').removeClass('pl-step-selection-made');
1444			$.ajax({
1445				type: 'post',
1446				dataType: 'json',
1447				url: oic_custom.ajax_url,
1448				data: data,
1449				success: function (d) {
1450					$('.pl-step-5-inner').html(d.content);
1451					var searchField = $('<input />')
1452						.prop('type', 'search')
1453						.prop('placeholder', 'search')
1454						.on('keyup', function () {
1455							var searchValue = $(this).val().trim().toLowerCase();
1456							if (!searchValue || !searchValue.length) {
1457								$('.pl-step-5-inner .pl-venue-item').show();
1458							} else {
1459								$('.pl-step-5-inner .pl-venue-item').each(function () {
1460									var text = $(this).text().trim().toLowerCase();
1461
1462									if (text.indexOf(searchValue) === -1) {
1463										$(this).hide();
1464									} else {
1465										$(this).show();
1466									}
1467								});
1468							}
1469						});
1470					searchField.prependTo($('.pl-step-5-inner'));
1471					if (run_generate_section) {
1472						for (var i = 0; i < backed_up_venues.length; i++)
1473							$(
1474								'.pl-venue-item[data-value="' + backed_up_venues[i] + '"]'
1475							).addClass('pl-item-selected');
1476						$('.pl-step-5').addClass('pl-step-selection-made');
1477						generate_recap_section();
1478						$('.pl-step-5').addClass('pl-step-selection-made');
1479						run_generate_section = false;
1480						fill_in_gfields();
1481					}
1482				},
1483			});
1484		}
1485		function generate_recap_section() {
1486			$('.pl-recap-selections-section').html('');
1487			$('.pl-recap-selections-section').append(
1488				'<div id="pl-recap-selections-left"</div>'
1489			);
1490			$('.pl-recap-selections-section').append(
1491				'<div id="pl-recap-selections-right"</div>'
1492			);
1493			$('.pl-recap-enquiries-selections').html('');
1494			var pl_occassion_item = $(
1495				'.pl-occasion-item.pl-item-selected .pl-occasion-item-thumb'
1496			)
1497				.text()
1498				.trim();
1499			$('#pl-recap-selections-left').append(
1500				'<div class="recap-upper-section"><span class="recap-section-edit" data-tab-target="1"></span><span class="recap-section-trash" data-tab-target="1"></span><h3>Ocassion: </h3>' +
1501					pl_occassion_item +
1502					'</div>'
1503			);
1504
1505			var pl_all_venues = '';
1506			$('.pl-venue_type-item.pl-item-selected .pl-venue_type-item-thumb').each(
1507				function () {
1508					var pl_venue_item = $(this).text().trim();
1509					pl_all_venues += pl_venue_item + ', ';
1510				}
1511			);
1512			pl_all_venues = pl_all_venues.substring(0, pl_all_venues.length - 2);
1513			$('#pl-recap-selections-left').append(
1514				'<div class="recap-upper-section venue-type"><span class="recap-section-edit" data-tab-target="2"></span><span class="recap-section-trash" data-tab-target="2"></span><h3>Venue Type: </h3><span>' +
1515					pl_all_venues +
1516					'</span></div>'
1517			);
1518			var pl_num_of_guests = $(
1519				'.pl-guest-select-item.pl-item-selected option:selected'
1520			).text();
1521			$('#pl-recap-selections-left').append(
1522				'<div class="recap-upper-section"><span class="recap-section-edit" data-tab-target="4"></span><span class="recap-section-trash" data-tab-target="4"></span><h3>Guest Capacity: </h3>' +
1523					pl_num_of_guests +
1524					'</div>'
1525			);
1526			var start_date = $('.pl-date-choose input.date').val();
1527			$('#pl-recap-selections-right').append(
1528				'<div class="recap-upper-section"><span class="recap-section-edit" data-tab-target="3"></span><span class="recap-section-trash" data-tab-target="3"></span><h3>Function Date: </h3>' +
1529					start_date +
1530					'</div>'
1531			);
1532			var start_time = $('.pl-date-choose input.time.start').val();
1533			var end_time = $('.pl-date-choose input.time.end').val();
1534			$('#pl-recap-selections-right').append(
1535				'<div class="recap-upper-section"><span class="recap-section-edit" data-tab-target="3"></span><span class="recap-section-trash" data-tab-target="3"></span><h3>Function Time: </h3>' +
1536					start_time +
1537					' - ' +
1538					end_time +
1539					'</div>'
1540			);
1541			$('.pl-recap-selections-section').append('<div class="clear"></div>');
1542			// copy venues in recap section
1543			$('.pl-venue-item.pl-item-selected').each(function () {
1544				$('.pl-recap-enquiries-selections').append(
1545					'<div class="recap-lower-section">' +
1546						$(this).find('.pl-venue-item-thumb').html() +
1547						'</div>'
1548				);
1549			});
1550			$('.pl-recap-enquiries-selections').append('<div class="clear"></div>');
1551			jQuery('html, body').animate(
1552				{
1553					scrollTop: jQuery('.planner-steps-headings').offset().top + 'px',
1554				},
1555				'fast'
1556			);
1557		}
1558		// create icon for enquiries edit
1559		$('.pl-recap-enquiries-section .oic-custom-heading a').html(
1560			'<span class="pl-enquiries-edit" data-tab-target="5"></span>'
1561		);
1562		$('.pl-step-6-inner').on(
1563			'click',
1564			'.recap-section-edit,.pl-enquiries-edit,.recap-section-trash',
1565			function (e) {
1566				e.preventDefault();
1567				var target_tab = $(this).data('tab-target');
1568
1569				if ($('.pl-step[data-tab-index="' + target_tab + '"]').length > 0) {
1570					$('.pl-current-step').removeClass('pl-current-step');
1571					$('.pl-s-active').removeClass('pl-s-active');
1572					$('.pl-s-' + target_tab).addClass('pl-s-active');
1573					$('.pl-step[data-tab-index="' + target_tab + '"]').addClass(
1574						'pl-current-step'
1575					);
1576					$('.planner-current-step-heading .oic-custom-heading h2').html(
1577						$('.pl-s-' + target_tab).data('step-title')
1578					);
1579					if ($(this).hasClass('recap-section-trash')) {
1580						$('.pl-current-step')
1581							.find('.pl-item-selected')
1582							.removeClass('pl-item-selected');
1583						$('.pl-current-step').find('input').val('');
1584					}
1585
1586					pl_mark_steps_done();
1587				}
1588			}
1589		);
1590		function fill_in_gfields() {
1591			$('.oi-g-occasion input').val(
1592				$('.pl-occasion-item.pl-item-selected h3').text()
1593			);
1594			$('.oi-g-venue-type input').val(
1595				$('.pl-venue_type-item.pl-item-selected h3').text()
1596			);
1597			$('.oi-g-num-of-people input').val(
1598				$('.pl-guest-select-item.pl-item-selected').val()
1599			);
1600			$('.oi-g-start-date input').val($('.pl-date-choose input.date').val());
1601			$('.oi-g-start-time input').val(
1602				$('.pl-date-choose input.time.start').val()
1603			);
1604			$('.oi-g-end-time input').val($('.pl-date-choose input.time.end').val());
1605			var venue_items = '';
1606			var venue_emails = '';
1607			$('.pl-venue-item.pl-item-selected').each(function () {
1608				venue_items += $(this).find('h3').text() + '\r\n';
1609				if ($(this).data('venue-email'))
1610					venue_emails += $(this).data('venue-email') + ',';
1611			});
1612			$('.oi-g-fv-emails input').val(venue_emails);
1613			$('.oi-g-venues-selected textarea').val(venue_items);
1614			$('.oi-g-user-id input').val($('.pl-signup-section').data('user-id'));
1615			$('.oi-g-user-name input').val($('.pl-signup-section').data('user-name'));
1616			$('.oi-g-user-email input').val(
1617				$('.pl-signup-section').data('user-email')
1618			);
1619			// we will backup each of the values in session using ajax
1620			backup_planner_data();
1621		}
1622		function backup_planner_data() {
1623			var pl_all_venues = '';
1624			$('.pl-venue_type-item.pl-item-selected .pl-venue_type-item-thumb').each(
1625				function () {
1626					var pl_venue_item = $(this).text().trim();
1627					pl_all_venues += pl_venue_item + ', ';
1628				}
1629			);
1630			pl_all_venues = pl_all_venues.substring(0, pl_all_venues.length - 2);
1631			var data = {};
1632			data.occassion = $('.pl-occasion-item.pl-item-selected h3').text();
1633			data.venue_type = pl_all_venues;
1634			data.num_of_people = $('.pl-guest-select-item.pl-item-selected').val();
1635			data.start_date = $('.pl-date-choose input.date').val();
1636			data.start_time = $('.pl-date-choose input.time.start').val();
1637			data.end_time = $('.pl-date-choose input.time.end').val();
1638			data.flex_date = $('.pl-date-choose #flex-date').prop('checked');
1639			data.flex_time = $('.pl-date-choose #flex-time').prop('checked');
1640			data.venue_items = [];
1641			data.venue_emails = [];
1642			var venue_items = '';
1643			var venue_emails = '';
1644
1645			$('.pl-venue-item.pl-item-selected').each(function () {
1646				venue_items += $(this).find('h3').text() + '\r\n';
1647				data.venue_items.push($(this).data('value'));
1648				if ($(this).data('venue-email')) {
1649					data.venue_emails.push($(this).data('venue-email') + ',');
1650					venue_emails += $(this).data('venue-email') + ',';
1651				}
1652			});
1653			data.venue_emails_text = venue_emails;
1654			data.venue_items_text = venue_items;
1655			data = { data: data, action: 'pl_backup_everything' };
1656
1657			$.ajax({
1658				type: 'post',
1659				dataType: 'json',
1660				url: oic_custom.ajax_url,
1661				data: data,
1662				success: function (d) {
1663					console.log('backedup');
1664				},
1665			});
1666		}
1667		function print_planner_selections() {
1668			var myWindow = window.open(
1669				'',
1670				'',
1671				'width=' + $(window).width() + ',height=' + $(window).height()
1672			);
1673			var w_content =
1674				'<h1 style="border-bottom: 1px solid #000;">Function Planner</h1>';
1675			w_content +=
1676				'<div style="margin-bottom:10px;border-bottom:1px dashed #343434;padding-bottom:20px;">';
1677			w_content +=
1678				'<div><strong>Occasion:</strong>' +
1679				$('.recap-upper-section:first-child h3').html() +
1680				'</div>';
1681			w_content +=
1682				'<div><strong>Venue Type:</strong>' +
1683				$('.recap-upper-section.venue-type span').text() +
1684				'</div>';
1685			w_content +=
1686				'<div><strong>Number of People:</strong>' +
1687				$('.recap-upper-section:nth-child(3) h3').html() +
1688				'</div>';
1689			w_content +=
1690				'<div><strong>Start Time:</strong>' +
1691				$('.recap-upper-section:nth-child(4) h3').html() +
1692				'</div>';
1693			w_content +=
1694				'<div><strong>End Time:</strong>' +
1695				$('.recap-upper-section:nth-child(5) h3').html() +
1696				'</div>';
1697			w_content += '</div>';
1698			w_content += '<div>';
1699			w_content += '<h3>Function Venue Chosen</h3>';
1700			$('.pl-venue-item.pl-item-selected').each(function () {
1701				w_content += '<strong>' + $(this).find('h3').text() + '</strong><br/>';
1702			});
1703			w_content += '</div>';
1704			myWindow.document.write(w_content);
1705			myWindow.document.close();
1706			myWindow.focus();
1707			myWindow.print();
1708			myWindow.close();
1709		}
1710
1711		//////////////////////////////
1712		var onloadCallback = function () {
1713			var grecaptchaid = grecaptcha.render('emplacementRecaptcha', {
1714				sitekey: '6LeDZWIUAAAAAPnM-wn8R2TMlyGTwBHYqDFN4Xql',
1715				badge: 'inline',
1716				type: 'image',
1717				size: 'invisible',
1718				callback: send_planner_data_in_email,
1719			});
1720			console.log('grecaptcha id');
1721			console.log(grecaptchaid);
1722		};
1723		window.onloadCallback = onloadCallback;
1724
1725		function validate_fp_form(event) {
1726			event.preventDefault();
1727			console.log('validating form');
1728			grecaptcha.execute();
1729		}
1730		////////////////////
1731
1732		function send_planner_data_in_email(rec_token) {
1733			console.log('submitting form');
1734			$(
1735				'#pl-submission-form .planner-wizard-enquiry-btns, #pl-submission-form .pl-signup-box, #emplacementRecaptcha'
1736			).hide();
1737			$('#pl-submission-form').append(
1738				'<div class="zm_alr_ajax_loader"><i class="fa fa-spin fa-spinner"></i></div>'
1739			);
1740			$('.pl-signup-section').hide();
1741
1742			var w_content =
1743				'<h1 style="border-bottom: 1px solid #000;">Function Planner</h1>';
1744			w_content +=
1745				'<div style="margin-bottom:10px;border-bottom:1px dashed #343434;padding-bottom:20px;">';
1746			w_content +=
1747				'<div><strong>Customer Name:</strong> ' +
1748				$('<div>').text($('.pl-signup-box #s_fname').val()).html() +
1749				' ' +
1750				$('<div>').text($('.pl-signup-box #s_lname').val()).html() +
1751				'</div>';
1752			w_content +=
1753				'<div><strong>Phone:</strong> ' +
1754				$('<div>').text($('.pl-signup-box #s_contactn').val()).html() +
1755				'</div>';
1756			w_content +=
1757				'<div><strong>Email:</strong> ' +
1758				$('<div>').text($('.pl-signup-box #s_contactn').val()).html() +
1759				'</div>';
1760			w_content +=
1761				'<div><strong>Comment:</strong> ' +
1762				$('<div>').text($('.pl-signup-box #s_comment').val()).html() +
1763				'</div>';
1764			w_content +=
1765				'<div><strong>Budget per person:</strong> ' +
1766				$('<div>').text($('.pl-signup-box #s_budget').val()).html() +
1767				'</div>';
1768			w_content +=
1769				'<div><strong>Occasion:</strong> ' +
1770				$('.pl-occasion-item.pl-item-selected h3').text() +
1771				'</div>';
1772			w_content +=
1773				'<div><strong>Venue Type:</strong> ' +
1774				$('.recap-upper-section.venue-type span').text() +
1775				'</div>';
1776			w_content +=
1777				'<div><strong>Number of People:</strong> ' +
1778				$('<div>')
1779					.text($('.pl-guest-select-item.pl-item-selected').val())
1780					.html() +
1781				'</div>';
1782			w_content +=
1783				'<div><strong>Event Date:</strong> ' +
1784				$('<div>').text($('.pl-date-choose input.date').val()).html() +
1785				'</div>';
1786			w_content +=
1787				'<div><strong>Flexible Date:</strong> ' +
1788				$('.pl-date-choose #flex-date').prop('checked').toString() +
1789				'</div>';
1790			w_content +=
1791				'<div><strong>Start Time:</strong> ' +
1792				$('<div>').text($('.pl-date-choose input.time.start').val()).html() +
1793				'</div>';
1794			w_content +=
1795				'<div><strong>End Time:</strong> ' +
1796				$('<div>').text($('.pl-date-choose input.time.end').val()).html() +
1797				'</div>';
1798			w_content +=
1799				'<div><strong>Flexible Time:</strong> ' +
1800				$('.pl-date-choose #flex-time').prop('checked').toString() +
1801				'</div>';
1802			w_content += '</div>';
1803			w_content += '<div>';
1804
1805			w_content += '</div>';
1806			var selected_venue_ids = '';
1807			jQuery('.pl-step-5-inner .pl-venue-item.pl-item-selected').each(
1808				function () {
1809					var pl_venue_id = $(this).attr('data-value');
1810					selected_venue_ids += pl_venue_id + ',';
1811				}
1812			);
1813			selected_venue_ids = selected_venue_ids.substring(
1814				0,
1815				selected_venue_ids.length - 1
1816			);
1817
1818			var selected_venue_names = '<ul>';
1819			jQuery('.recap-lower-section h3').each(function () {
1820				var pl_venue_name = jQuery(this).text();
1821				selected_venue_names += '<li>' + pl_venue_name + '</li>';
1822			});
1823			selected_venue_names += '</ul>';
1824
1825			var submission_meta = {
1826				num_of_people: $('.pl-guest-select-item.pl-item-selected').val(),
1827				start_date: $('.pl-date-choose input.date').val(),
1828				start_time: $('.pl-date-choose input.time.start').val(),
1829				end_time: $('.pl-date-choose input.time.end').val(),
1830				flex_date: $('.pl-date-choose #flex-date').prop('checked'),
1831				flex_time: $('.pl-date-choose #flex-time').prop('checked'),
1832				s_contactn: $('.pl-signup-box #s_contactn').val(),
1833				s_comment: $('.pl-signup-box #s_comment').val(),
1834				s_budget: $('.pl-signup-box #s_budget').val(),
1835			};
1836
1837			var data = {
1838				email: $('.pl-signup-section').data('user-email'),
1839				content: w_content,
1840				occassion: $('.pl-occasion-item.pl-item-selected h3').text(),
1841				occassionID: $('.pl-occasion-item.pl-item-selected').attr('data-value'),
1842				venue_type: $('.recap-upper-section.venue-type span').text(),
1843				s_fname: $('.pl-signup-box #s_fname').val(),
1844				s_lname: $('.pl-signup-box #s_lname').val(),
1845				s_email: $('.pl-signup-box #s_email').val(),
1846				s_venue_ids: selected_venue_ids,
1847				s_venue_names: selected_venue_names,
1848				s_meta: submission_meta,
1849				s_token: rec_token,
1850				action: 'send_pl_email',
1851			};
1852			$.ajax({
1853				type: 'post',
1854				dataType: 'json',
1855				url: oic_custom.ajax_url,
1856				data: data,
1857				success: function (d) {
1858					console.log('Submit success');
1859					console.log(d);
1860					$(
1861						'<div class="pl-email-sent"><p>' + d.msg + '</p></div>'
1862					).insertAfter('.pl-recap-enquiries-selections');
1863					$('.pl-recap-enquiries-section .oic-heading').text(
1864						'You have sent enquiries to'
1865					);
1866					$('.planner-steps-headings').hide();
1867					$('.pl-step-6-inner > .pl-full-separator').hide();
1868					$('.pl-step-6-inner > .pl-full-separator.second-separator').show();
1869					$('#pl-submission-form .zm_alr_ajax_loader').hide();
1870					$('.recap-section-edit').hide();
1871					$('.planner-wizard-steps-contents').css('padding-top', '0px');
1872					$('.pl-step.pl-current-step').css('margin-top', '0px');
1873					$('.recap-section-e
1873dit, .pl-enquiries-edit').hide();
1874					/*
1875								window.setTimeout(function() {
1876	            		$('.pl-email-sent').fadeOut();
1877	            	}, 5000);
1878								*/
1879				},
1880				error: function (d) {
1881					$(
1882						'<div class="pl-email-sent error"><p>' + d.msg + '</p></div>'
1883					).insertAfter('.planner-wizard-enquiry-btns');
1884					$('.planner-steps-headings').hide();
1885					$('.pl-step-6-inner > .pl-full-separator').hide();
1886					$('.pl-step-6-inner > .pl-full-separator.second-separator').show();
1887					$('#pl-submission-form .zm_alr_ajax_loader').hide();
1888					$('.recap-section-edit').hide();
1889					$('.planner-wizard-steps-contents').css('padding-top', '0px');
1890					$('.pl-step.pl-current-step').css('margin-top', '0px');
1891					$('.recap-section-edit, .pl-enquiries-edit').hide();
1892					console.log(d);
1893				},
1894			});
1895		}
1896		$('.pl-print-btn').on('click', function (e) {
1897			e.preventDefault();
1898			print_planner_selections();
1899		});
1900		$('.pl-email-btn').on('click', function (e) {
1901			e.preventDefault();
1902			console.log('executing grecaptcha');
1903			grecaptcha.execute();
1904		});
1905		function show_enquiry_form_popup() {
1906			var venue_items = '';
1907			$('.pl-venue-item.pl-item-selected').each(function () {
1908				venue_items += $(this).find('h3').text() + '\r\n';
1909			});
1910			$('.pl-enq-venues-names').html(venue_items);
1911			$('.planner-wizard-popup-overlay').fadeIn(200, function () {
1912				$('.planner-wizard-popup').fadeIn(200);
1913			});
1914		}
1915		$('.pl-popup-done-btn,.pl-popup-close').on('click', function (e) {
1916			e.preventDefault();
1917			$('.planner-wizard-popup').fadeOut(200, function () {
1918				$('.planner-wizard-popup-overlay').fadeOut(200);
1919			});
1920			$('.planner-wizard-wrap').html(
1921				'<h2 class="pl-everything-done">Thank You.</h2>'
1922			);
1923		});
1924		$(document).bind('gform_confirmation_loaded', function (event, formId) {
1925			if (formId == 5 && $('.gforms_confirmation_message').length > 0) {
1926				show_enquiry_form_popup();
1927			}
1928		});
1929		function pl_mark_steps_done() {
1930			var cr_step = $('.pl-current-step').data('tab-index');
1931			$('.planner-steps-headings li').removeClass('pl-step-done');
1932			for (var i = 1; i <= cr_step; i++)
1933				$('.planner-steps-headings li.pl-s-' + i).addClass('pl-step-done');
1934		}
1935		/* Function Utility Navigation */
1936		$('a.pl-next-btn').on('click', function (e) {
1937			e.preventDefault();
1938			// move to next tab
1939			var cr_index = $('.pl-current-step').data('tab-index');
1940			// check if there is tab with index cr_index+1
1941			if ($('.pl-step[data-tab-index="' + (cr_index + 1) + '"]').length > 0) {
1942				$('.pl-current-step').removeClass('pl-current-step');
1943				$('.pl-s-active').removeClass('pl-s-active');
1944				$('.pl-s-' + (cr_index + 1)).addClass('pl-s-active');
1945				$('.pl-step[data-tab-index="' + (cr_index + 1) + '"]').addClass(
1946					'pl-current-step'
1947				);
1948				// check if we moved to the fourth tab
1949				if (cr_index + 1 == 5) {
1950					// load events with ajax
1951					function_utility_load_events();
1952				}
1953				if (cr_index + 1 == 6) {
1954					generate_recap_section();
1955					fill_in_gfields();
1956				}
1957				$('.planner-current-step-heading .oic-custom-heading h2').html(
1958					$('.pl-s-' + (cr_index + 1)).data('step-title')
1959				);
1960
1961				pl_mark_steps_done();
1962			}
1963		});
1964		$('a.pl-prev-btn').on('click', function (e) {
1965			e.preventDefault();
1966			// move to prev tab
1967			var cr_index = $('.pl-current-step').data('tab-index');
1968			// check if there is tab with index cr_index-1
1969			if ($('.pl-step[data-tab-index="' + (cr_index - 1) + '"]').length > 0) {
1970				$('.pl-current-step').removeClass('pl-current-step');
1971				$('.pl-s-active').removeClass('pl-s-active');
1972				$('.pl-s-' + (cr_index - 1)).addClass('pl-s-active');
1973				$('.pl-step[data-tab-index="' + (cr_index - 1) + '"]').addClass(
1974					'pl-current-step'
1975				);
1976				$('.planner-current-step-heading .oic-custom-heading h2').html(
1977					$('.pl-s-' + (cr_index - 1)).data('step-title')
1978				);
1979				$('html,body').animate({
1980					scrollTop:
1981						$('.planner-wizard-wrap').offset().top -
1982						$('.et-fixed-header #main-header').outerHeight(),
1983				});
1984				pl_mark_steps_done();
1985			}
1986		});
1987		// login signup system
1988		$('.pl-signup-section .oic-custom-heading h2').append(
1989			'<span class="pl-signup pl-ajax-btn-hide">Sign UP</span>'
1990		);
1991		$('.pl-signup-section .oic-custom-heading h2').append(
1992			'<span class="pl-signin">Sign In</span>'
1993		);
1994		$('.pl-login-box').hide();
1995		$('.pl-signup-box').hide();
1996		$('.pl-signup-box').show();
1997		$('.pl-signin').on('click', function (e) {
1998			e.preventDefault();
1999			$('.pl-signup-box').hide();
2000			$('.pl-login-box').show();
2001			$(this).addClass('pl-ajax-btn-hide');
2002			$('.pl-signup').removeClass('pl-ajax-btn-hide');
2003		});
2004		$('.pl-signup').on('click', function (e) {
2005			e.preventDefault();
2006			$('.pl-login-box').hide();
2007			$('.pl-signup-box').show();
2008			$(this).addClass('pl-ajax-btn-hide');
2009			$('.pl-signin').removeClass('pl-ajax-btn-hide');
2010		});
2011		$('.zm_alr_register_form_container').append(
2012			'<div class="zm_alr_ajax_loader"><i class="fa fa-spin fa-spinner"></i></div>'
2013		);
2014		$('.zm_alr_login_form_container').append(
2015			'<div class="zm_alr_ajax_loader"><i class="fa fa-spin fa-spinner"></i></div>'
2016		);
2017		$('body').on('ajax_login_success', function () {
2018			// grab the current user data using ajax and load it in the .pl-signup-section attribs
2019			var data = {
2020				action: 'oic_ajax_get_current_user',
2021			};
2022			$.ajax({
2023				type: 'post',
2024				dataType: 'json',
2025				url: oic_custom.ajax_url,
2026				data: data,
2027				success: function (d) {
2028					if (d.status == false) {
2029						return false;
2030					} else {
2031						$(
2032							'.zm_alr_register_form_container,.zm_alr_login_form_container'
2033						).hide();
2034						$('.pl-signup-section').attr('data-user-id', d.user.ID);
2035						$('.pl-signup-section').attr('data-user-name', d.user.name);
2036						$('.pl-signup-section').attr('data-user-email', d.user.email);
2037						$('.pl-signup-section .oic-custom-heading h2').html(
2038							'Hi, ' + d.user.name
2039						);
2040					}
2041				},
2042			});
2043		});
2044		/* End of Function Utility Wizard */
2045		/* Paid Venue Images Slider*/
2046		var oic_venue_slider = $('.paid-venue-slider');
2047		oic_venue_slider.owlCarousel({
2048			items: 1,
2049			navigation: true,
2050			pagination: true,
2051			navigationText: ['prev', 'next'],
2052		});
2053		var featured_tickets_carousel = $('.featured-tickets');
2054		featured_tickets_carousel.owlCarousel({
2055			items: 1,
2056			navigation: false,
2057			pagination: false,
2058			navigationText: ['prev', 'next'],
2059			itemsDesktop: [1220, 1],
2060			itemsDesktopSmall: [979, 1],
2061			itemsTablet: [768, 1],
2062		});
2063		var tickets_selling_carousel = $('.selling-tickets-slider');
2064		tickets_selling_carousel.owlCarousel({
2065			items: 3,
2066			navigation: true,
2067			pagination: false,
2068			navigationText: ['prev', 'next'],
2069		});
2070		var too_late_tickets = $('.toolate-tickets-slider');
2071		too_late_tickets.owlCarousel({
2072			items: 3,
2073			navigation: true,
2074			pagination: false,
2075			navigationText: ['prev', 'next'],
2076		});
2077		var function_gallery_slider = $('.oic-fvenues-gallery');
2078		function_gallery_slider.owlCarousel({
2079			items: 1,
2080			navigation: true,
2081			pagination: false,
2082			itemsDesktop: [1220, 1],
2083			itemsDesktopSmall: [979, 1],
2084			itemsTablet: [768, 1],
2085			navigationText: ['prev', 'next'],
2086		});
2087		$('.paid-venue-linked-function-veneues')
2088			.detach()
2089			.appendTo('#related-venue-items');
2090		if ($('.paid-venue-map').length > 0) {
2091			// When the window has finished loading create our google map below
2092			google.maps.event.addDomListener(window, 'load', init_venue_map);
2093
2094			function init_venue_map() {
2095				var mapOptions = {
2096					zoom: 14,
2097					zoomControl: true,
2098					panControl: true,
2099					panControlOptions: {
2100						position: google.maps.ControlPosition.LEFT_TOP,
2101					},
2102					zoomControlOptions: {
2103						position: google.maps.ControlPosition.LEFT_TOP,
2104					},
2105					draggable: !('ontouchend' in document),
2106					center: new google.maps.LatLng(
2107						$('.paid-venue-map').data('lat'),
2108						$('.paid-venue-map').data('lng')
2109					),
2110					styles: [
2111						{
2112							featureType: 'water',
2113							elementType: 'geometry',
2114							stylers: [{ color: '#e9e9e9' }, { lightness: 17 }],
2115						},
2116						{
2117							featureType: 'landscape',
2118							elementType: 'geometry',
2119							stylers: [{ color: '#f5f5f5' }, { lightness: 20 }],
2120						},
2121						{
2122							featureType: 'road.highway',
2123							elementType: 'geometry.fill',
2124							stylers: [{ color: '#ffffff' }, { lightness: 17 }],
2125						},
2126						{
2127							featureType: 'road.highway',
2128							elementType: 'geometry.stroke',
2129							stylers: [
2130								{ color: '#ffffff' },
2131								{ lightness: 29 },
2132								{ weight: 0.2 },
2133							],
2134						},
2135						{
2136							featureType: 'road.arterial',
2137							elementType: 'geometry',
2138							stylers: [{ color: '#ffffff' }, { lightness: 18 }],
2139						},
2140						{
2141							featureType: 'road.local',
2142							elementType: 'geometry',
2143							stylers: [{ color: '#ffffff' }, { lightness: 16 }],
2144						},
2145						{
2146							featureType: 'poi',
2147							elementType: 'geometry',
2148							stylers: [{ color: '#f5f5f5' }, { lightness: 21 }],
2149						},
2150						{
2151							featureType: 'poi.park',
2152							elementType: 'geometry',
2153							stylers: [{ color: '#dedede' }, { lightness: 21 }],
2154						},
2155						{
2156							elementType: 'labels.text.stroke',
2157							stylers: [
2158								{ visibility: 'on' },
2159								{ color: '#ffffff' },
2160								{ lightness: 16 },
2161							],
2162						},
2163						{
2164							elementType: 'labels.text.fill',
2165							stylers: [
2166								{ saturation: 36 },
2167								{ color: '#333333' },
2168								{ lightness: 40 },
2169							],
2170						},
2171						{ elementType: 'labels.icon', stylers: [{ visibility: 'off' }] },
2172						{
2173							featureType: 'transit',
2174							elementType: 'geometry',
2175							stylers: [{ color: '#f2f2f2' }, { lightness: 19 }],
2176						},
2177						{
2178							featureType: 'administrative',
2179							elementType: 'geometry.fill',
2180							stylers: [{ color: '#fefefe' }, { lightness: 20 }],
2181						},
2182						{
2183							featureType: 'administrative',
2184							elementType: 'geometry.stroke',
2185							stylers: [
2186								{ color: '#fefefe' },
2187								{ lightness: 17 },
2188								{ weight: 1.2 },
2189							],
2190						},
2191					],
2192				};
2193				var mapElement = document.getElementById('venue-map');
2194				var venue_map = new google.maps.Map(mapElement, mapOptions);
2195				// Let's also add a marker while we're at it
2196				var marker = new google.maps.Marker({
2197					position: new google.maps.LatLng(
2198						$('.paid-venue-map').data('lat'),
2199						$('.paid-venue-map').data('lng')
2200					),
2201					map: venue_map,
2202					icon: {
2203						url: $('.paid-venue-map').data('pin'),
2204						size: new google.maps.Size(21, 35),
2205						anchor: new google.maps.Point(21, 35),
2206					},
2207					title: $('.paid-venue-map').data('address'),
2208				});
2209			}
2210		}
2211		/* Latest Social Slider for Unpaid Venue */
2212		var oic_latest_socials = $('.unpaid-venue-social-galleries .lsp-list');
2213		oic_latest_socials.owlCarousel({
2214			items: 4,
2215			navigation: true,
2216			navigationText: ['prev', 'next'],
2217		});
2218		if ($('.paid-venue-tabs-hds').length > 0) {
2219			if (
2220				$('.paid-venue-linked-function-veneues .pvl-venue-item').length <= 0
2221			) {
2222				$(
2223					'.paid-venue-linked-function-veneues,.tab-functions,.paid-venue-tabs-hds a[data-target="functions"]'
2224				).hide();
2225			}
2226			if ($('.no_events').length > 0) {
2227				$(
2228					'.tab-whats-on,.paid-venue-tabs-hds a[data-target="whats-on"]'
2229				).hide();
2230			}
2231		}
2232		/*Paid Venue Page Tabs*/
2233		$('.paid-venue-tabs-hds a').on('click', function (e) {
2234			e.preventDefault();
2235			if ($(this).hasClass('pvt-active')) return false;
2236			$('.pvt-active').removeClass('pvt-active');
2237			$(this).addClass('pvt-active');
2238			$('.tab-' + $(this).data('target')).addClass('pvt-active');
2239			$('.pvh-reservation-btn').css('opacity', 1).css('visibility', 'visible');
2240			$('.map-sidebar-enquiry-btn-reservation').removeClass(
2241				'disable-enquiry-btn'
2242			);
2243			if ($(this).data('target') == 'functions') {
2244				$('#related-venue-items').addClass('pvt-active');
2245			} else {
2246				$('#related-venue-items').removeClass('pvt-active');
2247			}
2248
2249			parent.location.hash = $(this).data('target');
2250		});
2251
2252		if (parent.location.hash !== '') {
2253			jQuery(
2254				'.paid-venue-tabs-hds a[data-target=' +
2255					parent.location.hash.substring(1) +
2256					']'
2257			).click();
2258		}
2259		$(
2260			'.venue-reservation-btn, .map-sidebar-enquiry-btn-reservation a.reservation'
2261		).on('click', function (e) {
2262			e.preventDefault();
2263			if ($('.tab-reservation-form').hasClass('pvt-active')) return false;
2264			$('.pvt-active').removeClass('pvt-active');
2265			$('.tab-reservation-form').addClass('pvt-active');
2266			$('html,body').animate({
2267				scrollTop:
2268					$('.paid-venue-tabs-hds').offset().top -
2269					$('.et-fixed-header #main-header').outerHeight(),
2270			});
2271			$('.tab-reservation-form input[type="text"]').first().focus();
2272			$('.pvh-reservation-btn').css('opacity', 0).css('visibility', 'hidden');
2273			$('.map-sidebar-enquiry-btn-reservation').addClass('disable-enquiry-btn');
2274		});
2275		$('.show-more-features-toggle span').on('click', function (e) {
2276			e.preventDefault();
2277			$('.vcb-features').addClass('show-all-features');
2278		});
2279		/*Social Gallery*/
2280		$('.oi-social-gallery-items a').fancybox();
2281		/* Functions Page Scripts */
2282		$('a.function-fav-btn').on('click', function (e) {
2283			e.preventDefault();
2284			$(this).toggleClass('function-favorited');
2285		});
2286		
2287		$('a.function-enquire-btn').on('click', function (e) {
2288			e.preventDefault();
2289			var ids = '' + $(this).data('id');
2290			var titles = '' + $(this).data('title');
2291			var email = $(this).data('email');
2292			$('#field_3_10 input').val(ids);
2293			$('#field_3_11 input').val(titles);
2294			$('#input_3_14').val(email);
2295			$('#input_3_5').datepicker('option', 'minDate', '+1');
2296			$('.booking-form-background').show();
2297			$('.booking-form-wrap').slideDown(function () {
2298				$('.booking-form-wrap input:visible').first().focus();
2299			});
2300			$('html, body').animate(
2301				{
2302					scrollTop: $('.booking-form-wrap.venue-form').offset().top - 190,
2303				},
2304				1000
2305			);
2306		});
2307
2308		$('.booking-form-background, .venue-form #close-form').on(
2309			'click',
2310			function (e) {
2311				$('.booking-form-wrap').hide();
2312				$('.booking-form-background').hide();
2313			}
2314		);
2315		/* Search Results Tags remove */
2316		$('.oic-dsrp-close').on('click', function (e) {
2317			e.preventDefault();
2318			var target = $(this).closest('strong').data('field');
2319			$('.cat-search-form select[name="' + target + '"]').val('0');
2320			$('.cat-search-form input[name="' + target + '"]').val('');
2321			$('.cat-search-form').submit();
2322		});
2323
2324		/* OIC Tabs */
2325		$('.oic-tab-hd').on('click', function (e) {
2326			e.preventDefault();
2327			if ($(this).hasClass('oic-tab-active')) return false;
2328			var t = $(this).data('target');
2329			$(this)
2330				.closest('.oic-fe-tabs')
2331				.find('.oic-tab-active')
2332				.removeClass('oic-tab-active');
2333			$(this)
2334				.closest('.oic-fe-tabs')
2335				.find('a[data-target="' + t + '"],div[data-target="' + t + '"]')
2336				.addClass('oic-tab-active');
2337		});
2338		/* OIC Posts Slider */
2339		var oic_posts_slider = $('.oic-post-slider');
2340		oic_posts_slider.owlCarousel({
2341			items: 3,
2342			navigation: true,
2343			navigationText: ['prev', 'next'],
2344		});
2345		$('.set-widget-inner').slick({
2346			dots: false,
2347			infinite: true,
2348			arrows: true,
2349			appendArrows: $('.set-slider-arrows'),
2350			speed: 300,
2351			slidesToShow: 1,
2352			adaptiveHeight: true,
2353			nextArrow:
2354				'<button class="oic-next-arrow"><i class="fa fa-chevron-right"></i></button>',
2355			prevArrow:
2356				'<button class="oic-prev-arrow"><i class="fa fa-chevron-left"></i></button>',
2357		});
2358		if ($('.win-widget-inner .win-post').length > 0) {
2359			$('.win-widget-inner').slick({
2360				dots: false,
2361				infinite: true,
2362				arrows: true,
2363				appendArrows: $('.win-slider-arrows'),
2364				speed: 300,
2365				slidesToShow: 1,
2366				adaptiveHeight: true,
2367				nextArrow:
2368					'<button class="oic-next-arrow"><i class="fa fa-chevron-right"></i></button>',
2369				prevArrow:
2370					'<button class="oic-prev-arrow"><i class="fa fa-chevron-left"></i></button>',
2371			});
2372		}
2373		/*Wineries Map*/
2374		var $et_pb_map = $('.et_pb_layout_map_container');
2375		if ($et_pb_map.length) {
2376			function et_pb_init_custom_maps() {
2377				$et_pb_map.each(function () {
2378					var $this_map_container = $(this),
2379						$this_map = $this_map_container.children('.et_pb_map'),
2380						this_map_grayscale = $this_map_container.data('grayscale') || 0,
2381						infowindow_active;
2382					if (this_map_grayscale !== 0) {
2383						this_map_grayscale = '-' + this_map_grayscale.toString();
2384					}
2385					$this_map_container.data(
2386						'map',
2387						new google.maps.Map($this_map[0], {
2388							zoom: parseInt($this_map.data('zoom')),
2389							center: new google.maps.LatLng(
2390								parseFloat($this_map.data('center-lat')),
2391								parseFloat($this_map.data('center-lng'))
2392							),
2393							mapTypeId: google.maps.MapTypeId.ROADMAP,
2394							scrollwheel: $this_map.data('mouse-wheel') == 'on' ? true : false,
2395							mapTypeControl: false,
2396							zoomControl: true,
2397							panControl: true,
2398							panControlOptions: {
2399								position: $this_map_container.is('.et_beneath_transparent_nav')
2400									? google.maps.ControlPosition.LEFT_BOTTOM
2401									: google.maps.ControlPosition.LEFT_TOP,
2402							},
2403							zoomControlOptions: {
2404								position: $this_map_container.is('.et_beneath_transparent_nav')
2405									? google.maps.ControlPosition.LEFT_BOTTOM
2406									: google.maps.ControlPosition.LEFT_TOP,
2407							},
2408							styles: [
2409								{
2410									featureType: 'water',
2411									elementType: 'geometry',
2412									stylers: [{ color: '#e9e9e9' }, { lightness: 17 }],
2413								},
2414								{
2415									featureType: 'landscape',
2416									elementType: 'geometry',
2417									stylers: [{ color: '#f5f5f5' }, { lightness: 20 }],
2418								},
2419								{
2420									featureType: 'road.highway',
2421									elementType: 'geometry.fill',
2422									stylers: [{ color: '#ffffff' }, { lightness: 17 }],
2423								},
2424								{
2425									featureType: 'road.highway',
2426									elementType: 'geometry.stroke',
2427									stylers: [
2428										{ color: '#ffffff' },
2429										{ lightness: 29 },
2430										{ weight: 0.2 },
2431									],
2432								},
2433								{
2434									featureType: 'road.arterial',
2435									elementType: 'geometry',
2436									stylers: [{ color: '#ffffff' }, { lightness: 18 }],
2437								},
2438								{
2439									featureType: 'road.local',
2440									elementType: 'geometry',
2441									stylers: [{ color: '#ffffff' }, { lightness: 16 }],
2442								},
2443								{
2444									featureType: 'poi',
2445									elementType: 'geometry',
2446									stylers: [{ color: '#f5f5f5' }, { lightness: 21 }],
2447								},
2448								{
2449									featureType: 'poi.park',
2450									elementType: 'geometry',
2451									stylers: [{ color: '#dedede' }, { lightness: 21 }],
2452								},
2453								{
2454									elementType: 'labels.text.stroke',
2455									stylers: [
2456										{ visibility: 'on' },
2457										{ color: '#ffffff' },
2458										{ lightness: 16 },
2459									],
2460								},
2461								{
2462									elementType: 'labels.text.fill',
2463									stylers: [
2464										{ saturation: 36 },
2465										{ color: '#333333' },
2466										{ lightness: 40 },
2467									],
2468								},
2469								{
2470									elementType: 'labels.icon',
2471									stylers: [{ visibility: 'off' }],
2472								},
2473								{
2474									featureType: 'transit',
2475									elementType: 'geometry',
2476									stylers: [{ color: '#f2f2f2' }, { lightness: 19 }],
2477								},
2478								{
2479									featureType: 'administrative',
2480									elementType: 'geometry.fill',
2481									stylers: [{ color: '#fefefe' }, { lightness: 20 }],
2482								},
2483								{
2484									featureType: 'administrative',
2485									elementType: 'geometry.stroke',
2486									stylers: [
2487										{ color: '#fefefe' },
2488										{ lightness: 17 },
2489										{ weight: 1.2 },
2490									],
2491								},
2492							],
2493						})
2494					);
2495					$this_map_container.find('.et_pb_map_pin').each(function () {
2496						var $this_marker = $(this);
2497						var marker = new google.maps.Marker({
2498							position: new google.maps.LatLng(
2499								parseFloat($this_marker.data('lat')),
2500								parseFloat($this_marker.data('lng'))
2501							),
2502							map: $this_map_container.data('map'),
2503							title: $this_marker.data('title'),
2504							icon: {
2505								url: $this_map_container.data('pin'),
2506								size: new google.maps.Size(21, 35),
2507								anchor: new google.maps.Point(21, 35),
2508							},
2509						});
2510						if ($this_marker.find('.infowindow').length) {
2511							var infowindow = new google.maps.InfoWindow({
2512								content: $this_marker.html(),
2513							});
2514							google.maps.event.addListener(
2515								$this_map_container.data('map'),
2516								'click',
2517								function () {
2518									infowindow.close();
2519								}
2520							);
2521							google.maps.event.addListener(marker, 'click', function () {
2522								if (infowindow_active) {
2523									infowindow_active.close();
2524								}
2525								infowindow_active = infowindow;
2526								infowindow.open($this_map_container.data('map'), marker);
2527							});
2528						}
2529					});
2530				});
2531			}
2532			if (window.et_load_event_fired) {
2533				et_pb_init_custom_maps();
2534			} else {
2535				google.maps.event.addDomListener(window, 'load', function () {
2536					et_pb_init_custom_maps();
2537				});
2538			}
2539		}
2540	}); // end ready handler
2541
2542	if ($('.all-venues-load-more').length > 0) {
2543		var all_venues_total_pages = parseInt($('.all-venues').data('pages'));
2544		var pages_done = 1;
2545		var ajax_fetching_enabled = true;
2546		$(window).on('scroll', function () {
2547			if ($('.all-venues-load-more').isInViewport().length > 0) {
2548				// check if we have more pages
2549				if (pages_done < all_venues_total_pages && ajax_fetching_enabled) {
2550					ajax_fetching_enabled = false;
2551					$('.all-venues-load-more').addClass('venues-loading');
2552					var data = {
2553						action: 'oic_all_venues_load_more',
2554						page: ++pages_done,
2555						cat: $('.all-venues').data('cat-id'),
2556					};
2557					$.ajax({
2558						type: 'post',
2559						dataType: 'json',
2560						url: oic_custom.ajax_url,
2561						data: data,
2562						success: function (d) {
2563							$(d.venues_markup).insertBefore('.all-venues-load-more');
2564							ajax_fetching_enabled = true;
2565							$('.all-venues-load-more').removeClass('venues-loading');
2566							$('#cat-map').trigger('newPinsLoaded', [d.map_json]);
2567						},
2568					});
2569				}
2570			}
2571		});
2572	}
2573	if ($('.all-posts-load-more').length > 0) {
2574		var all_posts_total_pages = parseInt($('.all-posts').data('pages'));
2575		var pages_done = 1;
2576		var ajax_fetching_enabled = true;
2577		$(window).on('scroll', function () {
2578			if ($('.all-posts-load-more').isInViewport().length > 0) {
2579				// check if we have more pages
2580				if (pages_done < all_posts_total_pages && ajax_fetching_enabled) {
2581					ajax_fetching_enabled = false;
2582					$('.all-posts-load-more').addClass('venues-loading');
2583					var data = {
2584						action: 'oic_all_posts_load_more',
2585						page: ++pages_done,
2586						cat: $('.all-posts').data('cat-id'),
2587					};
2588					$.ajax({
2589						type: 'post',
2590						dataType: 'json',
2591						url: oic_custom.ajax_url,
2592						data: data,
2593						success: function (d) {
2594							$(d.posts_markup).insertBefore('.all-posts-load-more');
2595							ajax_fetching_enabled = true;
2596							$('.all-posts-load-more').removeClass('venues-loading');
2597						},
2598					});
2599				}
2600			}
2601		});
2602	}
2603	if ($('.the-vault-posts').length > 0) {
2604		var vault_masonry = $('.the-vault-row').packery({
2605			itemSelector: '.vault-single-item',
2606			gutter: 0,
2607		});
2608		vault_masonry.imagesLoaded().progress(function () {
2609			vault_masonry.packery();
2610		});
2611		var all_posts_total_pages = parseInt($('.the-vault-posts').data('pages'));
2612		var pages_done = 1;
2613		var ajax_fetching_enabled = true;
2614		$(window).on('scroll', function () {
2615			if ($('.the-vault-load-more').isInViewport().length > 0) {
2616				// check if we have more pages
2617				if (pages_done < all_posts_total_pages && ajax_fetching_enabled) {
2618					ajax_fetching_enabled = false;
2619					$('.the-vault-load-more').addClass('venues-loading');
2620					var data = {
2621						action: 'oic_vault_load_more',
2622						page: ++pages_done,
2623					};
2624					$.ajax({
2625						type: 'post',
2626						dataType: 'json',
2627						url: oic_custom.ajax_url,
2628						data: data,
2629						success: function (d) {
2630							var new_items = $(d.posts_markup);
2631							vault_masonry.append(new_items).packery('appended', new_items);
2632							vault_masonry.imagesLoaded().progress(function () {
2633								vault_masonry.packery();
2634							});
2635							ajax_fetching_enabled = true;
2636							$('.the-vault-load-more').removeClass('venues-loading');
2637						},
2638					});
2639				}
2640			}
2641		});
2642	}
2643	// the search results
2644	if ($('.the-search-results-posts').length > 0) {
2645		var vault_masonry = $('.the-search-results-row').packery({
2646			itemSelector: '.vault-single-item',
2647			gutter: 0,
2648		});
2649		vault_masonry.imagesLoaded().progress(function () {
2650			vault_masonry.packery();
2651		});
2652		var all_posts_total_pages = parseInt(
2653			$('.the-search-results-posts').data('pages')
2654		);
2655		var pages_done = 1;
2656		var ajax_fetching_enabled = true;
2657		$(window).on('scroll', function () {
2658			if ($('.the-search-results-load-more').isInViewport().length > 0) {
2659				// check if we have more pages
2660				if (pages_done < all_posts_total_pages && ajax_fetching_enabled) {
2661					ajax_fetching_enabled = false;
2662					$('.the-search-results-load-more').addClass('venues-loading');
2663					var data = {
2664						action: 'oic_search_results_load_more',
2665						page: ++pages_done,
2666						s: $('input[name=s]').val(),
2667					};
2668					$.ajax({
2669						type: 'post',
2670						dataType: 'json',
2671						url: oic_custom.ajax_url,
2672						data: data,
2673						success: function (d) {
2674							var new_items = $(d.posts_markup);
2675							vault_masonry.append(new_items).packery('appended', new_items);
2676							vault_masonry.imagesLoaded().progress(function () {
2677								vault_masonry.packery();
2678							});
2679							ajax_fetching_enabled = true;
2680							$('.the-search-results-load-more').removeClass('venues-loading');
2681						},
2682					});
2683				}
2684			}
2685		});
2686	}
2687	// the guide
2688	if ($('.guide-load-view-more').length > 0) {
2689		var all_venues_total_pages = parseInt(
2690			$('.the-guide-results').data('pages')
2691		);
2692		var pages_done = 1;
2693		var ajax_fetching_enabled = true;
2694		$(window).on('scroll', function () {
2695			if ($('.guide-load-view-more').isInViewport().length > 0) {
2696				// check if we have more pages
2697				if (pages_done < all_venues_total_pages && ajax_fetching_enabled) {
2698					ajax_fetching_enabled = false;
2699					$('.guide-load-view-more').addClass('venues-loading');
2700					var data = {
2701						action: 'oic_guide_venues_load_more',
2702						page: ++pages_done,
2703						st: $('.the-guide-results').data('st'),
2704						'cat-venue-type': $('.the-guide-results').data('type'),
2705						'cat-venue-cuisine': $('.the-guide-results').data('cuisine'),
2706						'cat-venue-occasion': $('.the-guide-results').data('occasion'),
2707						'cat-venue-menu': $('.the-guide-results').data('menu'),
2708						'cat-venue-location': $('.the-guide-results').data('location'),
2709					};
2710					$.ajax({
2711						type: 'post',
2712						dataType: 'json',
2713						url: oic_custom.ajax_url,
2714						data: data,
2715						success: function (d) {
2716							$(d.venues_markup).insertBefore('.guide-load-view-more');
2717							ajax_fetching_enabled = true;
2718							$('.guide-load-view-more').removeClass('venues-loading');
2719							$('#cat-map').trigger('newPinsLoaded', [d.map_json]);
2720							$('.guide-total-showing').html($('.vp-single-item').length);
2721							if (pages_done == all_venues_total_pages)
2722								$('.guide-load-view-more').fadeOut();
2723						},
2724					});
2725				}
2726			}
2727		});
2728	}
2729	$('.checkbox-dropdown').click(function () {
2730		if ($('.checkbox-dropdown').hasClass('is-active')) {
2731			$('.checkbox-dropdown').removeClass('is-active');
2732		} else {
2733			$(this).addClass('is-active');
2734		}
2735	});
2736	$('.checkbox-dropdown ul').click(function (e) {
2737		e.stopPropagation();
2738	});
2739	$('#filterToggle').click(function () {
2740		$('#function-filters').slideToggle();
2741	});
2742	$('#reset-filter').click(function () {
2743		$('.checkbox-dropdown').removeClass('is-active');
2744		$('#function-filters :checked').prop('checked', false);
2745		$('#function-filters [name=st]').val('');
2746	});
2747})(jQuery, window);
2748// Cat Maps
2749var cat_map, bounds;
2750function cat_map_initialize() {
2751	if (cat_map_json.length > 0)
2752		var map_center = new google.maps.LatLng(
2753			cat_map_json[0].lat_lng.lat,
2754			cat_map_json[0].lat_lng.lng
2755		);
2756	else var map_center = new google.maps.LatLng(-35.3075, 149.265575);
2757	var myOptions = {
2758		zoom: 12,
2759		mapTypeControl: false,
2760		scrollwheel: false,
2761		zoomControl: true,
2762		zoomControlOptions: {
2763			position: google.maps.ControlPosition.LEFT_TOP,
2764		},
2765		center: map_center,
2766		mapTypeId: google.maps.MapTypeId.ROADMAP,
2767		styles: [
2768			{
2769				featureType: 'water',
2770				elementType: 'geometry',
2771				stylers: [{ color: '#e9e9e9' }, { lightness: 17 }],
2772			},
2773			{
2774				featureType: 'landscape',
2775				elementType: 'geometry',
2776				stylers: [{ color: '#f5f5f5' }, { lightness: 20 }],
2777			},
2778			{
2779				featureType: 'road.highway',
2780				elementType: 'geometry.fill',
2781				stylers: [{ color: '#ffffff' }, { lightness: 17 }],
2782			},
2783			{
2784				featureType: 'road.highway',
2785				elementType: 'geometry.stroke',
2786				stylers: [{ color: '#ffffff' }, { lightness: 29 }, { weight: 0.2 }],
2787			},
2788			{
2789				featureType: 'road.arterial',
2790				elementType: 'geometry',
2791				stylers: [{ color: '#ffffff' }, { lightness: 18 }],
2792			},
2793			{
2794				featureType: 'road.local',
2795				elementType: 'geometry',
2796				stylers: [{ color: '#ffffff' }, { lightness: 16 }],
2797			},
2798			{
2799				featureType: 'poi',
2800				elementType: 'geometry',
2801				stylers: [{ color: '#f5f5f5' }, { lightness: 21 }],
2802			},
2803			{
2804				featureType: 'poi.park',
2805				elementType: 'geometry',
2806				stylers: [{ color: '#dedede' }, { lightness: 21 }],
2807			},
2808			{
2809				elementType: 'labels.text.stroke',
2810				stylers: [
2811					{ visibility: 'on' },
2812					{ color: '#ffffff' },
2813					{ lightness: 16 },
2814				],
2815			},
2816			{
2817				elementType: 'labels.text.fill',
2818				stylers: [{ saturation: 36 }, { color: '#333333' }, { lightness: 40 }],
2819			},
2820			{ elementType: 'labels.icon', stylers: [{ visibility: 'off' }] },
2821			{
2822				featureType: 'transit',
2823				elementType: 'geometry',
2824				stylers: [{ color: '#f2f2f2' }, { lightness: 19 }],
2825			},
2826			{
2827				featureType: 'administrative',
2828				elementType: 'geometry.fill',
2829				stylers: [{ color: '#fefefe' }, { lightness: 20 }],
2830			},
2831			{
2832				featureType: 'administrative',
2833				elementType: 'geometry.stroke',
2834				stylers: [{ color: '#fefefe' }, { lightness: 17 }, { weight: 1.2 }],
2835			},
2836		],
2837	};
2838	var map;
2839	cat_map = map = new google.maps.Map(
2840		document.getElementById('cat-map'),
2841		myOptions
2842	);
2843	bounds = new google.maps.LatLngBounds();
2844	set_cat_map_markers(map);
2845}
2846/*Following Variables are made global*/
2847var flags = [];
2848var loop_index;
2849var markers = [];
2850var info_window_open = false;
2851function cat_map_activate_marker(activate_index) {
2852	var normal_icon = jQuery('#cat-map').data('normal-icon');
2853	jQuery('#cat-map-info').removeClass('map-info-visible');
2854	if (activate_index != -1) {
2855		normal_icon = jQuery('#cat-map').data('disabled-icon');
2856		jQuery('#cat-map-info').addClass('map-info-visible');
2857	}
2858	for (var i = markers.length - 1; i >= 0; i--) {
2859		if (i != activate_index) {
2860			markers[i].setIcon(normal_icon);
2861			flags[i].status = 'closed';
2862		} else {
2863			markers[i].setIcon(jQuery('#cat-map').data('large-icon'));
2864			flags[i].status = 'open';
2865		}
2866	}
2867}
2868function set_cat_map_markers(map) {
2869	var marker, i;
2870	bounds = new google.maps.LatLngBounds();
2871	for (i = 0; i < cat_map_json.length; i++) {
2872		loop_index = i;
2873		latlngset = new google.maps.LatLng(
2874			cat_map_json[i].lat_lng.lat,
2875			cat_map_json[i].lat_lng.lng
2876		);
2877		var marker = new google.maps.Marker({
2878			map: map,
2879			title: cat_map_json[i].title,
2880			position: latlngset,
2881		});
2882		marker.setIcon(jQuery('#cat-map').data('normal-icon'));
2883		markers[i] = marker;
2884		bounds.extend(marker.position);
2885
2886		var content = cat_map_json[i].info_window;
2887		flags[i] = { status: 'closed' };
2888		google.maps.event.addListener(
2889			marker,
2890			'click',
2891			(function (marker, content, loop_index, info_window_open) {
2892				return function () {
2893					if (flags[loop_index].status == 'closed') {
2894						jQuery('#cat-map-info').html(content);
2895						info_window_open = true;
2896						cat_map_activate_marker(loop_index);
2897					} else {
2898						jQuery('#cat-map-info').html('');
2899						info_window_open = false;
2900						cat_map_activate_marker(-1);
2901					}
2902				};
2903			})(marker, content, loop_index, info_window_open)
2904		);
2905	}
2906}
2907function set_cat_map_new_markers(map, new_pins) {
2908	var marker, i, j;
2909	for (
2910		i = cat_map_json.length, j = 0;
2911		i < cat_map_json.length + new_pins.length, j < new_pins.length;
2912		i++, j++
2913	) {
2914		loop_index = i;
2915		cat_map_json[i] = new_pins[j];
2916		latlngset = new google.maps.LatLng(
2917			cat_map_json[i].lat_lng.lat,
2918			cat_map_json[i].lat_lng.lng
2919		);
2920		var marker = new google.maps.Marker({
2921			map: map,
2922			title: cat_map_json[i].title,
2923			position: latlngset,
2924		});
2925		marker.setIcon(jQuery('#cat-map').data('normal-icon'));
2926		markers[i] = marker;
2927		bounds.extend(marker.position);
2928
2929		var content = cat_map_json[i].info_window;
2930		flags[i] = { status: 'closed' };
2931		google.maps.event.addListener(
2932			marker,
2933			'click',
2934			(function (marker, content, loop_index, info_window_open) {
2935				return function () {
2936					if (flags[loop_index].status == 'closed') {
2937						jQuery('#cat-map-info').html(content);
2938						info_window_open = true;
2939						cat_map_activate_marker(loop_index);
2940					} else {
2941						jQuery('#cat-map-info').html('');
2942						info_window_open = false;
2943						cat_map_activate_marker(-1);
2944					}
2945				};
2946			})(marker, content, loop_index, info_window_open)
2947		);
2948	}
2949	map.fitBounds(bounds);
2950}
2951var xyz;
2952if (jQuery('#cat-map').length > 0) {
2953	function loadScript() {
2954		var script = document.createElement('script');
2955		script.type = 'text/javascript';
2956		script.src =
2957			'https://maps.googleapis.com/maps/api/js?key=AIzaSyCt8X3WIx5zzK82mERc1MlXMbMoPFhNZw0&v=3.exp&' +
2958			'callback=cat_map_initialize';
2959		document.body.appendChild(script);
2960	}
2961	jQuery('#cat-map').on('newPinsLoaded', function (e, pins_json) {
2962		set_cat_map_new_markers(cat_map, JSON.parse(pins_json));
2963	});
2964	window.onload = loadScript;
2965}
2966jQuery(window).load(function () {
2967	jQuery('.ccf-page .slider').show();
2968	jQuery('.page-template-template-gourmay-page .slider').show();
2969	jQuery('#loadinggif').hide();
2970	jQuery('.loader').addClass('hidepre');
2971});
2972
2973/***post Soical*/
2974
2975if (jQuery('.the-social-results-posts').length > 0) {
2976	var vault_masonry = jQuery('.the-social-results-row').packery({
2977		itemSelector: '.vault-single-item',
2978		gutter: 0,
2979	});
2980	vault_masonry.imagesLoaded().progress(function () {
2981		vault_masonry.packery();
2982	});
2983	var all_posts_total_pages = parseInt(
2984		jQuery('.the-social-results-posts').data('pages')
2985	);
2986	var pages_done = 1;
2987	var ajax_fetching_enabled = true;
2988	jQuery(window).on('scroll', function () {
2989		if (jQuery('.the-social-results-load-more').isInViewport().length > 0) {
2990			// check if we have more pages
2991			if (pages_done < all_posts_total_pages && ajax_fetching_enabled) {
2992				ajax_fetching_enabled = false;
2993				jQuery('.the-social-results-load-more').addClass('venues-loading');
2994				var data = {
2995					action: 'oic_social_results_load_more',
2996					page: ++pages_done,
2997				};
2998				jQuery.ajax({
2999					type: 'post',
3000					dataType: 'json',
3001					url: oic_custom.ajax_url,
3002					data: data,
3003					success: function (d) {
3004						var new_items = jQuery(d.posts_markup);
3005
3006						vault_masonry.append(new_items).packery('appended', new_items);
3007						vault_masonry.imagesLoaded().progress(function () {
3008							vault_masonry.packery();
3009						});
3010						ajax_fetching_enabled = true;
3011						jQuery('.the-social-results-load-more').removeClass(
3012							'venues-loading'
3013						);
3014					},
3015				});
3016			}
3017		}
3018	});
3019}
3020jQuery(document).ready(function () {
3021	var events = jQuery('.all-events-row');
3022
3023	var pages_done = 1;
3024	var more_to_load = true;
3025	var ajax_fetching_enabled = true;
3026	jQuery(window).on('scroll', function () {
3027		if (
3028			jQuery('.guide-load-view-more').isInViewport().length > 0 &&
3029			jQuery('.all-events-row').length
3030		) {
3031			// check if we have more pages
3032			if (more_to_load && ajax_fetching_enabled) {
3033				ajax_fetching_enabled = false;
3034				jQuery('.guide-load-view-more').addClass('venues-loading');
3035				var data = {
3036					action: 'oic_all_events_load_more',
3037					page: ++pages_done,
3038					start: jQuery('.the-guide-results').data('start'),
3039					'cat-event-type': jQuery('.the-guide-results').data('type'),
3040					s: jQuery('input[name=s]').val(),
3041				};
3042				jQuery.ajax({
3043					type: 'post',
3044					dataType: 'json',
3045					url: oic_custom.ajax_url,
3046					data: data,
3047					success: function (d) {
3048						new_items = jQuery(d.events_markup);
3049						events.append(new_items).packery('appended', new_items);
3050						ajax_fetching_enabled = true;
3051						jQuery('.guide-load-view-more').removeClass('venues-loading');
3052						more_to_load = d.more_to_load;
3053						if (!more_to_load) {
3054							jQuery('.guide-load-view-more').fadeOut();
3055						}
3056					},
3057				});
3058			}
3059		}
3060	});
3061	jQuery('#anchorButton').click(function () {
3062		jQuery([document.documentElement, document.body]).animate(
3063			{
3064				scrollTop: jQuery('#carousel').offset().top - 150,
3065			},
3066			500
3067		);
3068	});
3069});

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.