PageSourceSearch

https://www.pullmanguarulhos.com/wp-content/themes/pullman-template/js/function.js?

js pullmanguarulhos.com collected 2026-09-29 00:55:27 UTC 151,210 bytes, 3,545 lines download raw bytes

1jQuery(document).ready(function ($) {
2          function replace_fullsizeurl_srcs() {
3            if (!_is_mobile) {
4              return;
5            }
6            if ($(window).width() > 767) {
7              $('img[data-fullsizeurl]').each(function () {
8                var img = $(this), fullsizeurl = img.data('fullsizeurl');
9                if (typeof fullsizeurl !== 'undefined' && fullsizeurl != '') {
10                  img.removeAttr('srcset');
11                  img.removeAttr('sizes');
12                  img.attr('src', fullsizeurl);
13                  img.removeAttr('data-fullsizeurl');
14                }
15              });
16            }
17          }
18
19          replace_fullsizeurl_srcs();
20
21          // Seobar
22          $('#seobar').appendTo('footer').show();
23
24          // Equilibrate the left and right columns
25          if(!_is_mobile){
26          var _left_h = $('.left-column').innerHeight();
27          var _right_h = $('.right-column').innerHeight();
28          if (_left_h >= _right_h) {
29            $('.right-column').height(_left_h);
30          } else {
31            $('.left-column').height(_right_h);
32          }
33          }
34
35          // Main book button
36          if (_is_mobile === false) {
37            $('#book_button').appendTo($('nav > div.w-container'));
38            $(document).trigger('book_button_alter');
39          }
40          window.__toggle_book_panel = function () {
41            if ($('#book_panel').hasClass('open')) {
42              $('#book_panel').removeClass('open');
43              $('div.book_overlay').fadeOut(250, function () {
44                $('html, body').css('overflow', 'auto');
45              });
46            } else {
47              $(document).trigger('accor_event.open_calendar');
48              $('div.book_overlay').fadeIn(250, function () {
49                $('html, body').css('overflow', 'hidden');
50                $('#book_panel').addClass('open');
51              });
52            }
53          };
54          $('#book_button').on('click', __toggle_book_panel);
55
56          // Book button for rooms
57          $('.roomtype li a.book, #bookthisroom > a').accorBookNowLink();
58
59          // Booking form
60          if ($('body').hasClass('home')) {
61            $('#booking').insertAfter($('#main_slideshow'));
62            var mincheckout, checkin_date, checkout_date, checkin_dp = $('#bookingform-check #checkin-check'),
63                checkout_dp = $('#bookingform-check #checkout-check');
64            $('#bookingform-check').accorBookingInitDatepickers(
65                {
66                  onSelect: function (dateText, inst) {
67                    $('#bookingform-check label[for="checkin-check"] > span').text(dateText);
68                    checkin_date = checkin_dp.datepicker('getDate');
69                    checkout_date = checkout_dp.datepicker('getDate');
70                    if (checkout_date <= checkin_date) {
71                      mincheckout = new Date(checkin_date.getTime() + 86400000);
72                      checkout_dp.datepicker('option', 'minDate', mincheckout);
73                      checkout_dp.datepicker('setDate', mincheckout);
74                      var _month = mincheckout.getMonth() + 1;
75                      $('#bookingform-check label[for="checkout-check"] > span').text(mincheckout.getDate() + '/' + (_month < 10 ? '0' + _month : _month) + '/' + mincheckout.getFullYear());
76                    }
77                    checkin_dp.trigger('change');
78                    checkout_dp.trigger('change');
79                  }
80                },
81                {
82                  onSelect: function (dateText, inst) {
83                    $('#bookingform-check label[for="checkout-check"] > span').text(dateText);
84                    checkin_date = checkin_dp.datepicker('getDate');
85                    checkout_date = checkout_dp.datepicker('getDate');
86                    if (checkin_date >= checkout_date) {
87                      maxcheckin = new Date(checkout_date.getTime() - 86400000);
88                      checkin_dp.datepicker('option', 'minDate', maxcheckin);
89                      checkin_dp.datepicker('setDate', maxcheckin);
90                      var _month = maxcheckin.getMonth() + 1;
91                      $('#bookingform-check label[for="checkin-check"] > span').text(maxcheckin.getDate() + '/' + (_month < 10 ? '0' + _month : _month) + '/' + maxcheckin.getFullYear());
92                    }
93                    checkin_dp.trigger('change');
94                    checkout_dp.trigger('change');
95                  }
96                }
97            );
98            $('#bookingform-check').accorBookingForm();
99            $('#bookingform-check').appendTo($('#booking'));
100            $('#bookingform-check label').on('click', function () {
101              $(this).next('input').trigger('click');
102              $('ul.select_children').stop(true, true).fadeOut();
103              $('ul.select_adults').stop(true, true).fadeOut();
104            });
105            var _adults_text = $('label[for="adultNumber-check"]').text();
106            var _children_text = $('label[for="childrenNumber-check"]').text();
107            var _select_adults = $('<ul class="select_adults"></ul>');
108            var _select_children = $('<ul class="select_children"></ul>');
109            $('#adultNumber-check').children().each(function () {
110              var _li = $('<li>' + $(this).attr('value') + '</li>');
111              _li.appendTo(_select_adults);
112            });
113            _select_adults.appendTo($('#bookingform-check div.adults'));
114            $('#childrenNumber-check').children().each(function () {
115              var _li = $('<li>' + $(this).attr('value') + '</li>');
116              _li.appendTo(_select_children);
117            });
118            _select_children.appendTo($('#bookingform-check div.children'));
119            $('label[for="adultNumber-check"]').data('text', _adults_text).on('click', function () {
120              checkin_dp.datepicker('hide');
121              checkout_dp.datepicker('hide');
122              $('ul.select_children').stop(true, true).fadeOut();
123              $('ul.select_adults').stop(true, true).fadeIn();
124            });
125            $('label[for="childrenNumber-check"]').data('text', _children_text).on('click', function () {
126              checkin_dp.datepicker('hide');
127              checkout_dp.datepicker('hide');
128              $('ul.select_adults').stop(true, true).fadeOut();
129              $('ul.select_children').stop(true, true).fadeIn();
130            });
131            $('.select_adults li, .select_children li').each(function () {
132              $(this).on('click', function () {
133                var _parent = $(this).parents('div.field').first();
134                var _label = _parent.find('label').first();
135                _parent.find('select option[value="' + $(this).text() + '"]').prop('selected', true);
136                _label.text(_label.data('text') + ' : ' + $(this).text());
137                $(this).parents('ul').first().fadeOut();
138              });
139            });
140
141            /* Extended fields - July 2019 */
142            var extend_button = $('#bookingform-check .extend_fields');
143            var extended_fields = $('#bookingform-check .extended_fields');
144            var childrenages_row = extended_fields.find('.childrenages_row');
145            extend_button.click(function () {
146              $(this).toggleClass('open');
147              extended_fields.toggleClass('hidden');
148            });
149            $('#bookingform-check select[name=childrenNumber]').change(function () {
150              var nChildren = parseInt($(this).val(), 10);
151              if (nChildren > 0) {
152                extend_button.addClass('open');
153                childrenages_row.removeClass('hidden');
154                extended_fields.removeClass('hidden');
155              } else {
156                childrenages_row.addClass('hidden');
157              }
158              $('.field.childrenAge0,.field.childrenAge1,.field.childrenAge2').addClass('hidden');
159              for (var i = 0; i < nChildren; i++) {
160                $('.field.childrenAge' + i).removeClass('hidden');
161              }
162            });
163            $('#bookingform-check .select_children li').on('click', function () {
164              setTimeout(function () {
165                $('#bookingform-check select[name=childrenNumber]').trigger('change');
166              }, 50);
167            });
168            /* END Extended fields - July 2019 */
169
170            /**/
171            $('#bookingform').accorBookingInitDatepickers();
172            $('#bookingform').accorBookingForm();
173            $('#childrenNumber').on('change', function () {
174              $('div[class*="childrenAge"]').stop(true, true).hide();
175              var _val = $(this).val();
176              for (_i = 0; _i < _val; _i++) {
177                $('div.childrenAge' + _i).stop(true, true).slideDown();
178              }
179            });
180            $('img.book_close').on('click', __toggle_book_panel);
181            /**/
182          } else {
183            $('#bookingform').accorBookingInitDatepickers();
184            $('#bookingform').accorBookingForm();
185            $('#childrenNumber').on('change', function () {
186              $('div[class*="childrenAge"]').stop(true, true).hide();
187              var _val = $(this).val();
188              for (_i = 0; _i < _val; _i++) {
189                $('div.childrenAge' + _i).stop(true, true).slideDown();
190              }
191            });
192            $('img.book_close').on('click', __toggle_book_panel);
193          }
194
195          // homepage
196          if ($('body').hasClass('home')) {
197            if ($(window).scrollTop() > $('#booking').offset().top + $('#booking').innerHeight() - $('#header').innerHeight()) {
198              $('#book_button').addClass('shown');
199            } else {
200              $('#book_button').removeClass('shown');
201            }
202            $(document).trigger('book_button_alter');
203          }
204
205
206          // Homepage Video
207          if ($('#video-container').length > 0) {
208            $('body').addClass('hasVideo');
209            $('#video-container').appendTo('#main_slideshow');
210            var _video_play = $('<span id="hp_video_play" class="video-play"></span>');
211            _video_play.appendTo('#main_slideshow');
212            _video_play.on('click', function () {
213              if (player !== undefined) {
214                $('#booking').css('opacity', 0);
215                player.playVideo();
216                $('.main_slideshow').animate({'opacity': 0}, function () {
217                  $('#main_slideshow').height(player_h);
218                  $('body').addClass('playing-video');
219                });
220              }
221            });
222            $('.stop_video').on('click', function () {
223              onPlayerStateChange({'data': 0});
224            });
225            $('.mute_video').on('click', function () {
226              if ($(this).hasClass('muted')) {
227                $(this).removeClass('muted');
228                player.setVolume(100);
229              } else {
230                $(this).addClass('muted');
231                (typeof riseVolume !== 'undefined') && clearInterval(riseVolume);
232                player.setVolume(0);
233              }
234            });
235          }
236
237          // Main slideshow
238          function detectIE() {
239            var ua = window.navigator.userAgent;
240            var msie = ua.indexOf('MSIE ');
241            if (msie > 0) {
242              return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
243            }
244            var trident = ua.indexOf('Trident/');
245            if (trident > 0) {
246              var rv = ua.indexOf('rv:');
247              return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);
248            }
249            var edge = ua.indexOf('Edge/');
250            if (edge > 0) {
251              return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);
252            }
253            return false;
254          }
255
256          // - Fix for IE
257          var IEversion = detectIE();
258          if (IEversion !== false) {
259            $('.main_slideshow li img').each(function () {
260              if (!$(this).attr('srcset')) return;
261              var _img = $(this).attr('srcset').split(', ');
262              _img = _img[_img.length - 1].split(' ');
263              $(this).attr('src', _img[0]);
264            });
265          }
266          $('.main_slideshow').each(function () {
267            var _self = $(this);
268            var window_width = $(window).innerWidth();
269            var _height = window_width * 25 / 100;
270            if (_is_mobile === true) {
271              if (window_width > 767 && _height < 350) {
272                _height = 350;
273              } else {
274                _height = window_width * 60 / 100;
275              }
276            }
277            _self.height(_height);
278            $('#main_slideshow').height(_height + $('#header').innerHeight());
279            _self.resizeCenter({
280              onLoad: function () {
281                _self.appendTo($('#main_slideshow'));
282                _self.find('ul.cycle').on('cycle-initialized', function (event, opts) {
283                  _self.find('img').animate({'opacity': 1});
284                });
285                $('#main_slideshow').removeClass('loading');
286                _self.find('ul.cycle').cycle({
287                  fx: 'fadeout',
288                  timeout: 6000,
289                  swipe: true,
290                  slides: '> li',
291                  sync: true
292                });
293              }
294            });
295          });
296          $('div.see-gallery').appendTo($('#main_slideshow')).show();
297
298          // Webfonts
299          /*
300					 WebFont.load({
301					 custom: {
302					 families: ['FuturaStd-Book']
303					 },
304					 fontactive: function(familyName, fvd) {
305					 */
306
307          // Main menu : submenus
308          $('nav li.has-child').each(function () {
309            var _self = $(this);
310            if (_is_mobile === false) {
311              var _submenu = _self.find('> ul');
312              // Make the li the containing block so the dropdown aligns naturally via CSS left:0
313              _self.css('position', 'relative');
314              if ($('body').hasClass('rtl')) {
315                _submenu.css('left', _self.innerWidth() - _submenu.innerWidth());
316              } else {
317                _submenu.css('left', 0);
318              }
319            }
320            console.log('a');
321          });
322
323          // Rooms menu
324          if ($('#room-nav div.room_slider').length > 0) {
325            $('#room-nav div.room_slider').attr('data-initial-width', $('#room-nav div.room_slider').innerWidth());
326            var _slider_w = $('#room-nav div.room_slider').innerWidth() + $('.previous_room').innerWidth() + $('.next_room').innerWidth();
327            var _slider_diff = $('#room-nav').innerWidth() - _slider_w;
328            if (_slider_diff < 0) {
329              $('#room-nav div.room_slider').width($('#room-nav div.room_slider').innerWidth() + _slider_diff);
330            } else {
331              $('#room-nav div.room_slider').width($('#room-nav div.room_slider').data('initital-width'));
332            }
333            var _w = 1;
334            $('#room-nav div.room_slider li').each(function () {
335              _w += Math.ceil($(this).outerWidth(true));
336            });
337            $('#room-nav div.room_slider ul').width(_w);
338            var _p = _k = 0, _w = $('#room-nav div.room_slider').innerWidth(), _current = 1, _pos = {};
339            $('#room-nav div.room_slider li').each(function (i) {
340              if (i === 0) {
341                _k++;
342                $(this).addClass('step-' + _k);
343                _pos[_k] = i;
344              }
345              _p += Math.ceil($(this).outerWidth(true));
346              if (_p >= _w) {
347                _k++;
348                $(this).addClass('step-' + _k);
349                _p = 0;
350                _pos[_k] = $('#room-nav div.room_slider li').index(this);
351              }
352            });
353            $('a.previous_room').click(function () {
354              _current--;
355              if (_current <= 0) {
356                _current = _k;
357              }
358              $('#room-nav div.room_slider ul').animate({'left': -$('li.step-' + _current).position().left});
359            });
360            $('a.next_room').click(function () {
361              _current++;
362              if (_current > _k) {
363                _current = 1;
364              }
365              $('#room-nav div.room_slider ul').animate({'left': -$('li.step-' + _current).position().left});
366            });
367            var _c = $('#room-nav div.room_slider li').index($('li.room-active'));
368            for (var n in _pos) {
369              if (_c > _pos[n] && _c < _pos[(parseInt(n) + 1)] && typeof (_pos[(parseInt(n) + 1)]) !== 'undefined') {
370                $('#room-nav div.room_slider ul').css('left', -$('li.step-' + n).position().left);
371                _current = parseInt(n);
372                break;
373              } else if (typeof (_pos[(parseInt(n) + 1)]) === 'undefined') {
374                $('#room-nav div.room_slider ul').css('left', -$('li.step-' + n).position().left);
375                _current = parseInt(n);
376                break;
377              } else if (_c === _pos[n]) {
378                $('#room-nav div.room_slider ul').css('left', -$('li.step-' + n).position().left);
379                _current = parseInt(n);
380                break;
381              }
382            }
383          } else {
384            $('#room-nav .horizontal-nav').horizontalNav();
385          }
386          if ($(window).scrollTop() > $('.main_slideshow').innerHeight()) {
387            $('#room-nav').addClass('fixed');
388          } else {
389            $('#room-nav').removeClass('fixed');
390          }
391
392          /*
393					 }
394					 });
395					 */
396
397          // Languages
398          $('#lang').on('click', function () {
399            if (_is_mobile === false) {
400              var content_html = $(this).find('.languages').html();
401              $.fancybox({
402                padding: 0,
403                href: '',
404                content: '<div id="popup_content"><strong>' + _choose_language + '</strong><hr><ul>' + content_html + '</ul></div>',
405                scrolling: 'no',
406                helpers: {overlay: {locked: false}},
407                afterShow: function () {
408                  $('#popup_content li.select > select').attr('data-xiti', 'transverse::language::selection').on('change', function () {
409                    var _url = $(this).find('option:selected').data('url');
410                    if (_url !== undefined) {
411                      $(document).trigger('accor_event.other_language');
412                      var w = window.open(_url, '_blank');
413                      w.focus();
414                    }
415                  });
416                }
417              });
418            }
419          });
420
421          // Homepage highlighted pages PD1
422          if (_is_mobile === false) {
423            $('#highlighted ul li').each(function () {
424              var _height = parseFloat($('#highlighted ul li:first').innerWidth() * 80 / 100);
425              $(this).css('height', _height);
426              // we want to optimize the google pagespeed score and give the user the joy to enjoy nice images
427              if (typeof $.fn.waypoint !== 'undefined') {
428                $(this).find('img').waypoint(function () {
429                  var _self = $(this);
430                  var _src = _self.data('src');
431                  var _parent = $(this).parents('li.w-resp').first();
432                  _self.get(0).onload = function () {
433                    _parent.resizeCenter({
434                      onLoad: function () {
435                        _self.animate({'opacity': 1});
436                      }
437                    });
438                  }
439                  _self.attr('src', _src);
440                }, {
441                  offset: '100%'
442                });
443              } else {
444                var _self = $(this).find('img');
445                var _src = _self.data('src');
446                _self.attr('src', _src).css({'opacity': 1});
447              }
448            });
449          } else {
450            $('#highlighted ul li').each(function () {
451              var _self = $(this).find('img');
452              var _src = _self.data('src');
453              _self.attr('src', _src).css({'opacity': 1});
454            });
455          }
456
457          // Map
458          if (typeof (_hotel) != 'undefined' && typeof ($.fn.FBMap) != 'undefined') {
459            $('#map_canvas').FBMap({
460              lat: _hotel.lat,
461              lng: _hotel.lng,
462              marker: _hotel.marker,
463              train_station: _hotel.img_path + 'point.png',
464              airport: _hotel.img_path + 'point.png',
465              subway_station: _hotel.img_path + 'point.png',
466              taxi_stand: _hotel.img_path + 'point.png',
467              cafe: _hotel.img_path + 'point.png',
468              restaurant: _hotel.img_path + 'point.png',
469              museum: _hotel.img_path + 'point.png',
470              art_gallery: _hotel.img_path + 'point.png',
471              blank: _hotel.img_path + 'point.png',
472              noplaces_text: map_noplaces_text,
473              link_text: map_directions_text,
474              zoomControl: {
475                'display': true,
476                'style': 'LARGE',
477                'position': ($('body').hasClass('rtl')) ? 'LEFT_TOP' : 'RIGHT_TOP'
478              },
479              'infobox_options': {
480                'boxStyle': {
481                  'background': ""
482                },
483                'closeBoxURL': ""
484              },
485              mapStyle: [
486                {"featureType": "landscape.man_made", "elementType": "geometry", "stylers": [{"color": "#f7f1df"}]},
487                {"featureType": "landscape.natural", "elementType": "geometry", "stylers": [{"color": "#d0e3b4"}]},
488                {
489                  "featureType": "landscape.natural.terrain",
490                  "elementType": "geometry",
491                  "stylers": [{"visibility": "off"}]
492                },
493                {"featureType": "poi", "elementType": "labels", "stylers": [{"visibility": "off"}]},
494                {"featureType": "poi.business", "elementType": "all", "stylers": [{"visibility": "off"}]},
495                {"featureType": "poi.medical", "elementType": "geometry", "stylers": [{"color": "#fbd3da"}]},
496                {"featureType": "poi.park", "elementType": "geometry", "stylers": [{"color": "#bde6ab"}]},
497                {"featureType": "road", "elementType": "geometry.stroke", "stylers": [{"visibility": "off"}]},
498                {"featureType": "road.highway", "elementType": "geometry.fill", "stylers": [{"color": "#ffe15f"}]},
499                {"featureType": "road.highway", "elementType": "geometry.stroke", "stylers": [{"color": "#efd151"}]},
500                {"featureType": "road.arterial", "elementType": "geometry.fill", "stylers": [{"color": "#ffffff"}]},
501                {"featureType": "road.local", "elementType": "geometry.fill", "stylers": [{"color": "black"}]},
502                {
503                  "featureType": "transit.station.airport",
504                  "elementType": "geometry.fill",
505                  "stylers": [{"color": "#cfb2db"}]
506                },
507                {"featureType": "water", "elementType": "geometry", "stylers": [{"color": "#a2daf2"}]}
508              ],
509              pois: ((typeof (pois) !== 'undefined') ? pois : null),
510              display_pois: true,
511              group_fit_bounds: false
512            });
513            $('#map_buttons > span').on('click', function () {
514              $('#map_buttons > span').removeClass('active');
515              $(this).addClass('active');
516            });
517            var _wait_poi = setInterval(function () {
518              if ($('#monuments > li').first().children().length > 0) {
519                clearInterval(_wait_poi);
520                $('#monuments').horizontalNav();
521                $('#monuments li > label').each(function () {
522                  $(this).on('click', function () {
523                    if (!$(this).parents('li').first().hasClass('current')) {
524                      $('#monuments li').removeClass('current');
525                      $(this).parents('li').first().addClass('current');
526                      $('#places_content').css({'display': 'block'});
527                    } else {
528                      $('#monuments li').removeClass('current');
529                      $('#places_content').css({'display': 'none'});
530                    }
531                  });
532                });
533                $('#monuments li > strong').each(function () {
534                  $(this).on('click', function () {
535                    var _category = $(this).text();
536                    if (!$(this).parents('li').first().hasClass('current')) {
537                      $('#places_list').html('');
538                      $('#monuments li').removeClass('current');
539                      $(this).parents('li').first().addClass('current');
540                      $($(this).next('ul').html()).clone().appendTo($('#places_list'));
541                      $('#places_content').css({'display': 'block'});
542                    } else {
543                      $('#monuments li').removeClass('current');
544                      $('#places_content').css({'display': 'none'});
545                    }
546                  });
547                });
548              }
549            }, 50);
550            $('#streetview').on('click', function () {
551              $('#places_content').hide();
552            });
553            if (_is_mobile === true) {
554              $('#map_ctx, #map_canvas').height($(window).innerWidth());
555            }
556          }
557
558          // Resize and center images
559          $('.w-resp').each(function () {
560            var _self = $(this);
561            _self.resizeCenter({
562              onLoad: function () {
563                setTimeout(function () {
564                  _self.find('img.resp').animate({'opacity': 1});
565                }, 200);
566              }
567            });
568          });
569
570          // Tripadvisor
571          $('#tripadvisor ul').first().cycle({slides: "> li", timeout: 6000});
572          $('a.tripadvisor_reviews').fancybox({
573            maxWidth: 800,
574            maxHeight: 600,
575            fitToView: false,
576            width: '70%',
577            height: '70%',
578            padding: 0
579          });
580
581          // Location link
582          if ($('body').hasClass('home')) {
583            $('a.location_link').attr('href', '#location').on('click', function (e) {
584              e.preventDefault();
585              $('html,body').stop(0, 0).animate({
586                scrollTop: $('#location').offset().top - $('#header').innerHeight()
587              }, 1000);
588            });
589            if (window.location.hash !== '') {
590              $('html,body').animate({
591                scrollTop: $(window.location.hash).offset().top - $('#header').innerHeight()
592              }, 1000);
593            }
594          }
595
596          // Page section (move the title into the slideshow)
597          if (_is_mobile === false) {
598            $('h3.slideshow_title').appendTo($('div.main_slideshow')).css({
599              'height': $('div.main_slideshow').innerHeight() + 'px',
600              'line-height': $('div.main_slideshow').innerHeight() + 'px'
601            }).show();
602          }
603
604          // Gallery popin
605          if (_is_mobile === false) {
606            $('div.see-gallery a').attr('href', 'javascript:void(0);').on('click', function (e) {
607              e.preventDefault();
608              var gallery_cat = $(this).data('gallerycat');
609              galleryPopin(0, true, gallery_cat);
610            });
611          }
612
613          // Gallery page
614          var photogallery_category = location.hash.replace('#___', '');
615          var $container = $('#gallery');
616          $container.imagesLoaded(function () {
617            var _l = $container.find('div.elm').length;
618
619            function appear(i) {
620              if ((i + 1) <= _l) {
621                $($container.find('div.elm').get(i)).animate({'opacity': 1}, 10, function () {
622                  $(this).addClass('set');
623                  appear(i + 1);
624                });
625              }
626            }
627
628            appear(0);
629
630            if (_is_mobile === false) {
631
632              $('.fancy a').attr('href', 'javascript:void(0);').on('click', function () {
633                galleryPopin($(this).data('id'));
634                return false;
635              });
636              var _tags = $('#gallery-tags li');
637              _tags.each(function () {
638                $(this).on('click', function () {
639                  _tags.removeClass('active');
640                  $(this).addClass('active');
641                  var _tag = $(this).data('tag');
642                  if (_tag !== undefined) {
643                    $container.isotope({filter: '.' + _tag});
644                  } else {
645                    $container.isotope({filter: '*'});
646                  }
647                });
648              });
649
650              if (photogallery_category != '') {
651                $('#gallery-tags li[data-tag=' + photogallery_category + ']').trigger('click');
652              }
653
654            } else {
655
656              $('#video').prependTo('#gallery');
657              $('.fancy.video > a').each(function () {
658                var _href = '//www.youtube.com/embed/' + YouTubeGetID($(this).attr('href')) + '?showinfo=0&rel=0&modestbranding=1&autoplay=1&wmode=opaque';
659                $(this).attr('data-href', _href).attr('href', 'javascript:void(0);');
660                $(this).addClass('fancybox.iframe').fancybox({
661                  fitToView: true,
662                  href: _href,
663                  openEffect: 'none',
664                  closeEffect: 'none',
665                  padding: 0
666                });
667              });
668              $('.fancy.virtualtour > a').each(function () {
669                var _href = $(this).attr('href');
670                $(this).attr('data-href', _href).attr('href', 'javascript:void(0);');
671                $(this).addClass('fancybox.iframe').fancybox({
672                  fitToView: true,
673                  href: _href,
674                  openEffect: 'none',
675                  closeEffect: 'none',
676                  padding: 0
677                });
678              });
679              $('.fancy.image a').each(function () {
680                var _href = $(this).attr('href');
681                $(this).attr('data-href', _href).attr('href', 'javascript:void(0);');
682                $(this).on('click', function () {
683                  $.fancybox({
684                    openEffect: 'elastic',
685                    closeEffect: 'elastic',
686                    href: _href,
687                    padding: 0
688                  });
689                });
690              });
691
692              var _tags = $('#gallery-tags li');
693              var _select_photos = $('<select></select>');
694              _select_photos.appendTo('#gallery-tags');
695              _tags.each(function () {
696                var _option = $('<option value="' + $(this).data('tag') + '">' + $(this).text() + '</option>');
697                _option.appendTo(_select_photos);
698              });
699              $('#gallery-tags ul').remove();
700              $('#gallery-tags').insertAfter('#header').show();
701              _select_photos.on('change', function () {
702                var _tag = $(this).val();
703                if (_tag !== 'undefined') {
704                  $container.isotope({filter: '.' + _tag});
705                } else {
706                  $container.isotope({filter: '*'});
707                }
708                $('html, body').scrollTop(0);
709              });
710
711              if (photogallery_category != '') {
712                _select_photos.val(photogallery_category).trigger('change');
713              }
714
715              $('#gallery div.elm').each(function () {
716                if ($(this).hasClass('video')) {
717                  var _src = $(this).find('img').attr('src').replace(/hqdefault/g, 'maxresdefault');
718                } else if ($(this).hasClass('fancy')) {
719                  var _src = $(this).find('img').attr('src');
720                } else {
721                  var _src = $(this).find('a').first().data('href');
722                }
723                $(this).find('img').attr('src', _src);
724              });
725              $('#video, #video-ctx, #gallery div.video, #gallery .video-ctx, #gallery div.elm').each(function () {
726                var _self = $(this);
727                $(this).parents().each(function () {
728                  var _w = $(this).width();
729                  if (_w !== 0) {
730                    _self.css({'width': _w, 'height': _w * 9 / 16});
731                    return false;
732                  }
733                });
734
735              });
736              $('.w-resp, #gallery div.elm').each(function () {
737                var _self = $(this);
738                setTimeout(function () {
739                  _self.resizeCenter();
740                }, 250);
741              });
742              $(window).on('resize', function () {
743                $('#video, #video-ctx, #gallery div.video, #gallery .video-ctx, #gallery div.elm').each(function () {
744                  var _self = $(this);
745                  $(this).parents().each(function () {
746                    var _w = $(this).width();
747                    if (_w !== 0) {
748                      _self.css({'width': _w, 'height': _w * 9 / 16}
748);
749                      return false;
750                    }
751                  });
752
753                });
754                $('.w-resp, #gallery div.elm').each(function () {
755                  var _self = $(this);
756                  setTimeout(function () {
757                    _self.resizeCenter();
758                  }, 250);
759                });
760              });
761            }
762
763            $container.isotope({
764              itemSelector: '.fancy',
765              layoutMode: 'masonry',
766              isOriginLeft: ($('body').hasClass('rtl')) ? false : true,
767              masonry: {
768                columnWidth: '.elm'
769              }
770            });
771
772          });
773
774          // News main page
775          var _news_max = $('.news-section ul li').length;
776          $('.news-section span.load_more').on('click', function () {
777            var _min = $('.news-section ul li:visible').length;
778            var _max = _min + 9;
779            for (i = _min; i < _max; i++) {
780              $($('.news-section ul li').get(i)).removeClass('hidden');
781            }
782            if (_max >= _news_max) {
783              $(this).remove();
784            }
785          });
786
787          // News single page
788          $('.slideshow_title > strong').css('margin-top', -$('.slideshow_title > strong').innerHeight() / 2);
789
790          // Meeting single page || Restaurant single page || Spa main page
791          if ($('body').hasClass('single-offers') || $('body').hasClass('page-template-template-meeting') || $('body').hasClass('page-template-template-restaurant') || $('body').hasClass('page-template-template-spa') || $('body').hasClass('page-template-template-wedding-single')) {
792
793            function updateForm(_content, _form, _lang, _title) {
794
795              $('input[name="restaurant"]').val(_title);
796              var _hours = $('#form_hours > option:disabled');
797              var _minutes = $('#form_minutes > option:disabled');
798
799              $('#form_date,.contact_form_datepicker').datepicker({
800                numberOfMonths: 2,
801                minDate: new Date(),
802                onSelect: function (dateText, inst) {
803                  var _date = new Date();
804
805                  if ($('body').hasClass('page-template-template-restaurant') && $(this).datepicker('getDate').toDateString() === _date.toDateString()) {
806                    $('#form_hours > option').each(function (i) {
807                      if (typeof (_hours[i]) !== 'undefined') {
808                        $(this).prop('disabled', true);
809                      }
810                    });
811                    $('#form_minutes > option').each(function (i) {
812                      if (typeof (_minutes[i]) !== 'undefined') {
813                        $(this).prop('disabled', false);
814                      }
815                    });
816                  } else {
817                    $('#form_hours > option, #form_minutes > option').each(function () {
818                      $(this).prop('disabled', false);
819                    });
820                  }
821                }
822              });
823
824              if ($('#g-recaptcha').length > 0) {
825                var _key = $('#g-recaptcha', _content).attr('data-sitekey');
826                grecaptcha.render('g-recaptcha', {'sitekey': _key});
827              }
828
829              $('.tableplus-submit').click(function () {
830                $(this).trigger('accor_event.submit_form');
831                $.fancybox.close();
832                return true;
833              });
834
835              $('form.form').on('submit', function (e) {
836                e.preventDefault();
837                $(this).trigger('accor_event.submit_form');
838                var data = $('form.form').serialize() + '&action=hotel_form&form=' + _form + '&lang=' + _lang;
839                $(this).find('input[type=submit]').attr('disabled', 'disabled');
840
841                var post_id = $('meta[name=accor_post_id]').attr('content');
842                if (post_id && post_id !== '0') {
843                  data = data + '&source_post_id=' + post_id;
844                }
845                jQuery.post(ajax_url, data, function (response) {
846                  $('.fancybox-inner').html(response);
847                  $.fancybox.update();
848                  $.fancybox.reposition();
849                  $(this).find('input[type=submit]').removeAttr('disabled');
850
851                  updateForm(response, _form, _lang, _title);
852                });
853                return false;
854              });
855
856            }
857
858            $('a[data-form]').on('click', function () {
859              $(this).trigger('accor_event.open_form');
860              var _form = $(this).data('form');
861              var _title = $(this).data('post');
862              var _id = $(this).data('id');
863              var data = {
864                'action': 'hotel_form',
865                'form': _form,
866                'title': _title,
867                'restaurant_post_id': _id,
868                'lang': _lang
869              };
870              var post_id = $('meta[name=accor_post_id]').attr('content');
871              if (post_id && post_id !== '0') {
872                data.source_post_id = post_id;
873              }
874              jQuery.get(ajax_url, data, function (response) {
875                $.fancybox({
876                  padding: 0,
877                  href: '',
878                  content: response,
879                  scrolling: 'no',
880                  fitToView: false,
881                  width: '70%',
882                  height: '70%',
883                  autoSize: true,
884                  helpers: {overlay: {locked: false}},
885                  afterShow: function () {
886                    updateForm(this.content, _form, _lang, _title);
887                    if (typeof (xiti_tracking) !== 'undefined') {
888                      xiti_tracking();
889                    }
890                  }
891                });
892              });
893              return false;
894            });
895
896            if ($(window).scrollTop() > $('.main_slideshow').innerHeight()) {
897              $('.subnav').addClass('fixed');
898            } else {
899              $('.subnav').removeClass('fixed');
900            }
901            $('.subnav ul a').each(function () {
902              $(this).on('click', function () {
903                $('.subnav li').removeClass('current');
904                $(this).parents('li').first().addClass('current');
905                var _href = $(this).attr('href');
906                $('html,body').addClass('scrolling').stop(0, 0).animate({
907                  scrollTop: $(_href).offset().top - $('#header').innerHeight() - $('.subnav').innerHeight()
908                }, 1000, function () {
909                  $(this).removeClass('scrolling');
910                });
911              });
912            });
913            if (window.location.hash !== '') {
914              $('.subnav ul a[href="' + window.location.hash + '"]').parents('li').first().addClass('current');
915              $('html,body').animate({
916                scrollTop: $(window.location.hash).offset().top - $('#header').innerHeight() - $('.subnav').innerHeight()
917              }, 1000);
918            }
919          }
920
921          // Offers Main Page
922          $('a[data-offer]').each(function () {
923            $(this).on('click', function () {
924              var _offer = $(this).data('offer').split(':');
925              if (_offer[1] !== '') {
926                var _dayIn = _offer[1];
927                var _monthIn = _offer[2];
928                var _yearIn = _offer[3];
929              }
930              if (_offer[0] !== '') {
931                var _tk = _offer[0];
932                accorBookNow({"preferredCode": _tk, "dayIn": _dayIn, "monthIn": _monthIn, "yearIn": _yearIn});
933              } else {
934                accorBookNow();
935              }
936              return false;
937            });
938          });
939          $('#choose_offers').on('change', function () {
940            $('li.offer_detail').removeClass('last').hide();
941            var _val = $(this).find('option:selected').data('category');
942            if (_val !== 'all') {
943              $('li.offer_detail[data-category="' + _val + '"]').show();
944            } else {
945              $('li.offer_detail').show();
946            }
947            $('li.offer_detail:visible').each(function (n) {
948              if ((n + 1) % 3 === 0) {
949                $(this).addClass('last');
950              }
951            });
952          });
953
954
955          var _getUrlParams = function () {
956            var regex = /[?&]([^=#]+)=([^&#]*)/g,
957                url = window.location.href,
958                params = {},
959                match;
960            while (match = regex.exec(url)) {
961              params[match[1]] = match[2];
962            }
963            return params;
964          };
965
966          var urlParams = _getUrlParams();
967          if (typeof urlParams.category !== 'undefined' && $('#choose_offers').length > 0) {
968            $('#choose_offers option').each(function () {
969              var option = $(this);
970              var select = option.parent();
971              if (option.data('category').toLowerCase() === urlParams.category.toLowerCase()) {
972                select.find('option:selected').removeAttr('selected');
973                option.attr('selected', 'selected');
974                select.trigger('change');
975              }
976            });
977          }
978
979          // Offers single page
980          $('div.terms h5').on('click', function () {
981            $(this).next('div').slideDown();
982          });
983
984          // Newsletter page
985          $('select[name="brand_news_language"], select[name="news_language"]').on('change', function () {
986            var _checkbox = $(this).parents('p.checkbox').first().find('input[type="checkbox"]');
987            if ($(this).val() !== '') {
988              _checkbox.prop('checked', true);
989            } else {
990              _checkbox.prop('checked', false);
991            }
992          });
993
994          // Fix font support for Vietnamese language
995          // if($('html').hasClass('lang_vi')) {
996          // 	$('*').each(function(n, elm) {
997          // 		if($(elm).css('font-family') !== '') {
998          // 			var _s = '';
999          // 			if(elm.getAttribute('style') !== null) {
1000          // 				var _s = elm.getAttribute('style');
1001          // 				if(_s.slice(-1) !== ';') { _s += ';'; }
1002          // 			}
1003          // 			elm.setAttribute('style', _s + 'font-family : sans-serif !important');
1004          // 		}
1005          // 	});
1006          // }
1007          $('.gfield .datepicker').datepicker();
1008        });
1009
1010        $(window).resize(function () {
1011          //$('.single_offer .w-resp').css('style', '');
1012          $('.single_offer .w-resp').css('width', '100%');
1013          $('.single_offer .w-resp').resizeCenter();
1014          $('.single_offer .w-resp img').css('opacity', 1.0);
1015
1016          // homepage
1017          if (_is_mobile === false) {
1018            $('.main_slideshow').each(function () {
1019              var _self = $(this);
1020              var _height = _self.innerWidth() * 25 / 100;
1021              _self.height(_height);
1022              $('#main_slideshow').height(_height + $('#header').innerHeight());
1023            });
1024          }
1025
1026          // Main menu
1027          $('nav li.has-child').each(function () {
1028            var _self = $(this);
1029            if (_self.find('> ul').hasClass('set')) {
1030              _self.find('> ul').css('left', _self.position().left);
1031            }
1032          });
1033
1034          // Equilibrate the left and right columns
1035          if(!_is_mobile){
1036          $('.left-column, .right-column').css('height', 'auto');
1037          var _left_h = $('.left-column').innerHeight();
1038          var _right_h = $('.right-column').innerHeight();
1039          if (_left_h >= _right_h) {
1040            $('.right-column').height(_left_h);
1041          } else {
1042            $('.left-column').height(_right_h);
1043          }
1044          }
1045
1046          // Homepage highlighted pages PD2
1047          if (_is_mobile === false) {
1048            $('#highlighted ul li').each(function () {
1049              var _height = parseFloat($('#highlighted ul li:first').innerWidth() * 80 / 100);
1050              $(this).css('height', _height);
1051              // we want to optimize the google pagespeed score and give the user the joy to enjoy nice images
1052              if (typeof $.fn.waypoint !== 'undefined') {
1053                $(this).find('img').waypoint(function () {
1054                  var _self = $(this);
1055                  var _src = _self.data('src');
1056                  var _parent = $(this).parents('li.w-resp').first();
1057                  _self.get(0).onload = function () {
1058                    _parent.resizeCenter({
1059                      onLoad: function () {
1060                        _self.animate({'opacity': 1});
1061                      }
1062                    });
1063                  }
1064                  _self.attr('src', _src);
1065                }, {
1066                  offset: '100%'
1067                });
1068              } else {
1069                var _self = $(this).find('img');
1070                var _src = _self.data('src');
1071                _self.attr('src', _src).css({'opacity': 1});
1072              }
1073            });
1074          } else {
1075            $('#highlighted ul li').each(function () {
1076              var _self = $(this).find('img');
1077              var _src = _self.data('src');
1078              _self.attr('src', _src).css({'opacity': 1});
1079            });
1080          }
1081
1082          //
1083          $('#rooms ul li').each(function () {
1084            var _height = parseFloat($('#rooms ul li:first').innerWidth() * 80 / 100);
1085            $(this).css('height', _height);
1086          });
1087
1088          // Rooms menu
1089          if ($('#room-nav div.room_slider').length > 0) {
1090            var _slider_w = $('#room-nav div.room_slider').data('initial-width') + $('.previous_room').innerWidth() + $('.next_room').innerWidth();
1091            var _slider_diff = $('#room-nav').innerWidth() - _slider_w;
1092            if (_slider_diff < 0) {
1093              $('#room-nav div.room_slider').width($('#room-nav div.room_slider').data('initial-width') + _slider_diff);
1094            } else {
1095              $('#room-nav div.room_slider').width($('#room-nav div.room_slider').data('initial-width'));
1096            }
1097          }
1098
1099          // Page section (adjust the title)
1100          if (_is_mobile === false) {
1101            $('h3.slideshow_title').css({
1102              'height': $('div.main_slideshow').innerHeight() + 'px',
1103              'line-height': $('div.main_slideshow').innerHeight() + 'px'
1104            });
1105          }
1106
1107          // News single page
1108          $('.slideshow_title > strong').css('margin-top', -$('.slideshow_title > strong').innerHeight() / 2);
1109
1110          // Gallery popin
1111          if ($('#gallery_popin').hasClass('shown')) {
1112            makeGalleryScrollable();
1113          }
1114
1115          //
1116
1117        }).blur(function () {
1118
1119          // pause the main slideshow
1120          $('.main_slideshow ul.cycle').cycle('pause');
1121
1122        }).focus(function () {
1123
1124          // resume the main slideshow
1125          $('.main_slideshow ul.cycle').cycle('resume');
1126
1127        }).scroll(function () {
1128          if ($('body').hasClass('page-template-template-special-offers') || $('body').hasClass('post-type-archive-offers') || $('body').hasClass('page-template-template-gallery-wp') || $('body').hasClass('single-offers')) {
1129            $('body').addClass('fixed');
1130          } else {
1131            if ($(window).scrollTop() >= $('#main_slideshow').innerHeight()) {
1132              $('body').addClass('fixed');
1133            } else {
1134              $('body').removeClass('fixed');
1135            }
1136          }
1137          // homepage
1138          if ($('body').hasClass('home')) {
1139            if ($(window).scrollTop() > $('#booking').offset().top + $('#booking').innerHeight() - $('#header').innerHeight()) {
1140              $('#book_button').addClass('shown');
1141            } else {
1142              $('#book_button').removeClass('shown');
1143            }
1144            $(document).trigger('book_button_alter');
1145          }
1146
1147          // rooms menu
1148          if ($(window).scrollTop() > $('.main_slideshow').innerHeight()) {
1149            $('#room-nav').addClass('fixed');
1150          } else {
1151            $('#room-nav').removeClass('fixed');
1152          }
1153
1154          // restaurant menu
1155          if ($(window).scrollTop() > $('.main_slideshow').innerHeight()) {
1156            $('.subnav').addClass('fixed');
1157          } else {
1158            $('.subnav').removeClass('fixed');
1159          }
1160          if (!$('html,body').hasClass('scrolling')) {
1161            var _subnav = new Array();
1162            $('.subnav ul a').each(function () {
1163              _subnav.push($(this).attr('href'));
1164            });
1165            $.map(_subnav, function (el) {
1166              if ($(window).scrollTop() >= ($(el).offset().top - $('#header').innerHeight() - $('.subnav').innerHeight())) {
1167                $('.subnav li').removeClass('current');
1168                $('.subnav ul a[href="' + el + '"]').parents('li').first().addClass('current');
1169              }
1170            });
1171          }
1172          //
1173
1174        }).load(function () {
1175
1176          // Bug with defer loading of js files
1177          //$(window).resize();
1178
1179        }).keydown(function (e) {
1180
1181          // Gallery popin
1182          if ($('#gallery_popin').hasClass('shown')) {
1183            switch (e.which) {
1184              case 37:
1185                $('.gallery_prev').trigger('click');
1186                break;
1187              case 39:
1188                $('.gallery_next').trigger('click');
1189                break;
1190              default:
1191                return;
1192            }
1193            e.preventDefault();
1194          }
1195
1196        });
1197
1198
1199var galleryPopin = function (id, panel, category) {
1200  if (typeof category === 'undefined') {
1201    category = false;
1202  }
1203  $.ajax({
1204    type: "GET",
1205    data: {'action': 'gallery', 'lang': ((_lang !== undefined) ? _lang : 'en')},
1206    url: ajax_url,
1207    error: function () {
1208      if (window.console && console.log) {
1209        console.log("error while getting the gallery data !");
1210      }
1211    },
1212    success: function (gallery) {
1213      if (gallery !== 'error') {
1214        gallery_html = gallery;
1215      } else {
1216        if (window.console && console.log) {
1217          console.log("error during success while getting the gallery data !");
1218        }
1219      }
1220    },
1221    complete: function () {
1222      if (gallery_html !== undefined) {
1223
1224        $('.main_slideshow ul.cycle').cycle('pause');
1225
1226        var gallery_current = 0;
1227
1228        $('html, body').css('overflow', 'hidden');
1229        $('#gallery_popin').html(gallery_html);
1230
1231        var _width = $('#gallery_thumbnails_ctx li:visible').length * $('#gallery_thumbnails_ctx li:visible').outerWidth(true);
1232        var $container = $('#gallery_thumbnails_ctx > ul');
1233        $container.width(_width);
1234        $container.isotope({
1235          itemSelector: '.thumb',
1236          layoutMode: 'masonry',
1237          isOriginLeft: ($('body').hasClass('rtl')) ? false : true,
1238          masonry: {
1239            columnWidth: '.elm'
1240          }
1241        });
1242
1243        //Helper boolean variable to check whether the "arrangeComplete" event was fired
1244        //Whenever a category is clicked.
1245        var arrangeCompleteTriggered = false;
1246        $container.on('arrangeComplete', function (event, filteredItems) {
1247          arrangeCompleteTriggered = true;
1248          $('#gallery_caption i.gallery_total').text($('#gallery_thumbnails_ctx li[data-type!="video"]:visible').length - $('#gallery_thumbnails_ctx li[data-type="virtual"]:visible').length);
1249          gallery_current = 0;
1250          $($('#gallery_thumbnails_ctx li:visible').get(gallery_current)).trigger('click');
1251          makeGalleryScrollable();
1252        });
1253
1254        $('#gallery_categories li').each(function () {
1255          $(this).on('click', function () {
1256            $('#gallery_categories li').removeClass('active');
1257            $(this).addClass('active');
1258            var _tag = $(this).data('tag');
1259            $container.width(_width);
1260            arrangeCompleteTriggered = false;
1261            if (_tag !== undefined) {
1262              $container.isotope({filter: '.' + _tag});
1263            } else {
1264              $container.isotope({filter: '*'});
1265            }
1266            $('.gallery_info').text($(this).text());
1267
1268            // sometimes isotope doesn't fire "arrangeComplete" after filtering
1269            // so we trigger it after 500ms if it didn't fire after last category click
1270            setTimeout(function () {
1271              if (!arrangeCompleteTriggered) {
1272                console.log('emulated arrangeComplete event on $container');
1273                $container.trigger('arrangeComplete');
1274              }
1275            }, 500);
1276          });
1277        });
1278        $('#gallery_thumbnails_ctx li').each(function () {
1279          $(this).on('click', function () {
1280
1281            var _self = $(this);
1282            var _caption = _self.data('caption');
1283            var _category = _self.data('cat');
1284            gallery_current = $('#gallery_thumbnails_ctx li:visible').index(this);
1285
1286            if (gallery_current <= 0) {
1287              $('.gallery_prev').hide();
1288              $('.gallery_next').show();
1289            } else if (gallery_current + 1 >= $('#gallery_thumbnails_ctx li:visible').length) {
1290              $('.gallery_next').hide();
1291              $('.gallery_prev').show();
1292            } else {
1293              $('.gallery_next, .gallery_prev').show();
1294            }
1295
1296            if ($('#gallery_thumbnails_ctx li:visible').length <= 1) {
1297              $('.gallery_next, .gallery_prev').hide();
1298            }
1299
1300            $('#gallery_thumbnails_ctx li').removeClass('current');
1301            _self.addClass('current');
1302
1303            $('#gallery_preview > img.resp, #gallery_preview > iframe').fadeOut(750, function () {
1304              $(this).remove();
1305            });
1306
1307            if (_self.data('type') == 'image') {
1308              var _img = new Image();
1309              _img.onload = function () {
1310                var _image = $(_img).addClass('resp');
1311                _image.prependTo($('#gallery_preview'));
1312                $('#gallery_preview').resizeCenter({
1313                  onLoad: function () {
1314                    $('#gallery_preview > img.resp').animate({'opacity': 1});
1315                    $('#gallery_caption').show();
1316                    var _index = $('#gallery_thumbnails_ctx li[data-type!="video"]:visible').not('[data-type="virtual"]').index(_self.get(0)) + 1;
1317                    $('#gallery_caption i.gallery_current').text(_index);
1318                    $('#gallery_caption strong').text(_caption);
1319                    $('#gallery_caption span').text(_category);
1320                    $('.gallery_info').text(_category);
1321                  }
1322                });
1323                $('#gallery_thumbnails').css({'bottom': '0', 'left': '0'});
1324              };
1325              _img.src = $(this).data('big');
1326            } else if (_self.data('type') == 'virtual') {
1327              $('#gallery_caption').hide();
1328              $('#gallery_thumbnails').css({'bottom': '-999999px', 'left': '-999999px'});
1329              if (!($('#gallery_categories').hasClass('closed'))) {
1330                $('#gallery_categories').addClass('closed');
1331              }
1332              var _iframe = $('<iframe width="100%" height="100%" src="' + _self.data('big') + '" style="border:0" frameborder="0" allowfullscreen></iframe>');
1333              if (_is_mobile === true && $('html').hasClass('portrait')) {
1334                var _mhv = $('#gallery_preview').innerHeight(), _mwv = $('#gallery_preview').innerWidth();
1335                _iframe.css({
1336                  'width': _mhv,
1337                  'height': _mwv,
1338                  'left': -(_mhv - _mwv) / 2,
1339                  'bottom': (_mhv - _mwv) / 2
1340                });
1341              }
1342              _iframe.prependTo($('#gallery_preview'));
1343            } else {
1344              $('#gallery_caption').hide();
1345              $('#gallery_thumbnails').css({'bottom': '0', 'left': '0'});
1346              var _video = $('<iframe width="100%" height="100%" src="https://www.youtube.com/embed/' + _self.data('big') + '?showinfo=0&rel=0&modestbranding=1&autoplay=1&wmode=opaque" frameborder="0" allowfullscreen></iframe>');
1347              _video.prependTo($('#gallery_preview'));
1348            }
1349
1350            var _center = $('#gallery_thumbnails_ctx').innerWidth() / _self.outerWidth(true) / 2;
1351            $('#gallery_thumbnails_ctx').animate({scrollLeft: _self.position().left - _center * _self.innerWidth()});
1352          });
1353        });
1354        /***/
1355        $('.gallery_menu').on('click', function () {
1356          if ($('#gallery_categories').hasClass('closed')) {
1357            $('#gallery_categories').removeClass('closed');
1358            $('#gallery_preview').removeClass('closed');
1359          } else {
1360            $('#gallery_categories').addClass('closed');
1361            $('#gallery_preview').addClass('closed');
1362          }
1363        });
1364        $('.gallery_next').on('click', function () {
1365          gallery_current = gallery_current + 1;
1366          $('.gallery_prev, .gallery_next').show();
1367          $($('#gallery_thumbnails_ctx li:visible').get(gallery_current)).trigger('click');
1368        });
1369        $('.gallery_prev').on('click', function () {
1370          gallery_current = gallery_current - 1;
1371          $($('#gallery_thumbnails_ctx li:visible').get(gallery_current)).trigger('click');
1372        });
1373        $('#gallery_popin span.close').on('click', function () {
1374          $('#gallery_popin_ctx').fadeOut(750, function () {
1375            $('#gallery_popin').children().remove();
1376            $('#gallery_popin').html('').removeClass('shown');
1377            $('html, body').css('overflow', 'auto');
1378            $('.main_slideshow ul.cycle').cycle('resume');
1379          });
1380        });
1381
1382        if (gallery_current == 0) {
1383          $('.gallery_prev').hide();
1384        }
1385        if (gallery_current + 1 >= $('#gallery_thumbnails_ctx li:visible').length) {
1386          $('.gallery_next').hide();
1387        }
1388        makeGalleryScrollable();
1389        /**/
1390        if (id === undefined) {
1391          id = 0;
1392        }
1393        if (panel !== undefined) {
1394          $('.gallery_menu').trigger('click');
1395        }
1396        $('#gallery_thumbnails_ctx li.thumb.' + category).eq(0).trigger('click');
1397        $('#gallery_caption i.gallery_total').text($('#gallery_thumbnails_ctx li[data-type!="video"]:visible').length - $('#gallery_thumbnails_ctx li[data-type="virtual"]:visible').length);
1398        $($('#gallery_thumbnails_ctx li:visible').get(id)).trigger('click');
1399
1400        $('#gallery_popin').addClass('shown');
1401
1402        if (category) {
1403          $('#gallery_popin li[data-tag=' + category + ']').trigger('click');
1404        }
1405
1406      } else {
1407        console.log('gallery_html === undefined');
1408      }
1409    }
1410  });
1411
1412}
1413
1414var makeGalleryScrollable = function () {
1415
1416  var _width = $('#gallery_thumbnails_ctx li:visible').length * $('#gallery_thumbnails_ctx li:visible').outerWidth(true);
1417  var $container = $('#gallery_thumbnails_ctx > ul');
1418  $container.width(_width);
1419
1420  var $scrollable = $('#gallery_thumbnails_ctx'),
1421      $scrollbar = $('.gallery_scrollbar_track'),
1422      _w = $scrollable.outerWidth(true) - $('.gallery_scrollbar_bar').position().left,
1423      _sW = $scrollable[0].scrollWidth,
1424      _sbW = _w * _w / _sW;
1425
1426  $('.gallery_scrollbar_track').width(_sbW).draggable({
1427    axis: 'x',
1428    containment: '.gallery_scrollbar_bar',
1429    drag: function (e, ui) {
1430      $scrollable.scrollLeft(_sW / _w * ui.position.left);
1431    }
1432  });
1433
1434  $scrollable.on("scroll", function () {
1435    $scrollbar.css({left: $scrollable.scrollLeft() / _w * _sbW});
1436  });
1437
1438};
1439
1440/**
1441 * Get YouTube ID from various YouTube URL
1442 * @author: takien
1443 * @url: http://takien.com
1444 * For PHP YouTube parser, go here http://takien.com/864
1445 */
1446
1447function YouTubeGetID(url) {
1448  var ID = '';
1449  url = url.replace(/(>|<)/gi, '').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/);
1450  if (url[2] !== undefined) {
1451    ID = url[2].split(/[^0-9a-z_\-]/i);
1452    ID = ID[0];
1453  } else {
1454    ID = url;
1455  }
1456  return ID;
1457}
1458
1459/*!
1460 * imagesLoaded PACKAGED v3.1.8
1461 * JavaScript is all like "You images are done yet or what?"
1462 * MIT License
1463 */
1464
1465(function () {
1466  function e() {
1467  }
1468
1469  function t(e, t) {
1470    for (var n = e.length; n--;
1470) if (e[n].listener === t) return n;
1471    return -1
1472  }
1473
1474  function n(e) {
1475    return function () {
1476      return this[e].apply(this, arguments)
1477    }
1478  }
1479
1480  var i = e.prototype, r = this, o = r.EventEmitter;
1481  i.getListeners = function (e) {
1482    var t, n, i = this._getEvents();
1483    if ("object" == typeof e) {
1484      t = {};
1485      for (n in i) i.hasOwnProperty(n) && e.test(n) && (t[n] = i[n])
1486    } else t = i[e] || (i[e] = []);
1487    return t
1488  }, i.flattenListeners = function (e) {
1489    var t, n = [];
1490    for (t = 0; e.length > t; t += 1) n.push(e[t].listener);
1491    return n
1492  }, i.getListenersAsObject = function (e) {
1493    var t, n = this.getListeners(e);
1494    return n instanceof Array && (t = {}, t[e] = n), t || n
1495  }, i.addListener = function (e, n) {
1496    var i, r = this.getListenersAsObject(e), o = "object" == typeof n;
1497    for (i in r) r.hasOwnProperty(i) && -1 === t(r[i], n) && r[i].push(o ? n : {listener: n, once: !1});
1498    return this
1499  }, i.on = n("addListener"), i.addOnceListener = function (e, t) {
1500    return this.addListener(e, {listener: t, once: !0})
1501  }, i.once = n("addOnceListener"), i.defineEvent = function (e) {
1502    return this.getListeners(e), this
1503  }, i.defineEvents = function (e) {
1504    for (var t = 0; e.length > t; t += 1) this.defineEvent(e[t]);
1505    return this
1506  }, i.removeListener = function (e, n) {
1507    var i, r, o = this.getListenersAsObject(e);
1508    for (r in o) o.hasOwnProperty(r) && (i = t(o[r], n), -1 !== i && o[r].splice(i, 1));
1509    return this
1510  }, i.off = n("removeListener"), i.addListeners = function (e, t) {
1511    return this.manipulateListeners(!1, e, t)
1512  }, i.removeListeners = function (e, t) {
1513    return this.manipulateListeners(!0, e, t)
1514  }, i.manipulateListeners = function (e, t, n) {
1515    var i, r, o = e ? this.removeListener : this.addListener, s = e ? this.removeListeners : this.addListeners;
1516    if ("object" != typeof t || t instanceof RegExp) for (i = n.length; i--;) o.call(this, t, n[i]); else for (i in t) t.hasOwnProperty(i) && (r = t[i]) && ("function" == typeof r ? o.call(this, i, r) : s.call(this, i, r));
1517    return this
1518  }, i.removeEvent = function (e) {
1519    var t, n = typeof e, i = this._getEvents();
1520    if ("string" === n) delete i[e]; else if ("object" === n) for (t in i) i.hasOwnProperty(t) && e.test(t) && delete i[t]; else delete this._events;
1521    return this
1522  }, i.removeAllListeners = n("removeEvent"), i.emitEvent = function (e, t) {
1523    var n, i, r, o, s = this.getListenersAsObject(e);
1524    for (r in s) if (s.hasOwnProperty(r)) for (i = s[r].length; i--;) n = s[r][i], n.once === !0 && this.removeListener(e, n.listener), o = n.listener.apply(this, t || []), o === this._getOnceReturnValue() && this.removeListener(e, n.listener);
1525    return this
1526  }, i.trigger = n("emitEvent"), i.emit = function (e) {
1527    var t = Array.prototype.slice.call(arguments, 1);
1528    return this.emitEvent(e, t)
1529  }, i.setOnceReturnValue = function (e) {
1530    return this._onceReturnValue = e, this
1531  }, i._getOnceReturnValue = function () {
1532    return this.hasOwnProperty("_onceReturnValue") ? this._onceReturnValue : !0
1533  }, i._getEvents = function () {
1534    return this._events || (this._events = {})
1535  }, e.noConflict = function () {
1536    return r.EventEmitter = o, e
1537  }, "function" == typeof define && define.amd ? define("eventEmitter/EventEmitter", [], function () {
1538    return e
1539  }) : "object" == typeof module && module.exports ? module.exports = e : this.EventEmitter = e
1540}).call(this), function (e) {
1541  function t(t) {
1542    var n = e.event;
1543    return n.target = n.target || n.srcElement || t, n
1544  }
1545
1546  var n = document.documentElement, i = function () {
1547  };
1548  n.addEventListener ? i = function (e, t, n) {
1549    e.addEventListener(t, n, !1)
1550  } : n.attachEvent && (i = function (e, n, i) {
1551    e[n + i] = i.handleEvent ? function () {
1552      var n = t(e);
1553      i.handleEvent.call(i, n)
1554    } : function () {
1555      var n = t(e);
1556      i.call(e, n)
1557    }, e.attachEvent("on" + n, e[n + i])
1558  });
1559  var r = function () {
1560  };
1561  n.removeEventListener ? r = function (e, t, n) {
1562    e.removeEventListener(t, n, !1)
1563  } : n.detachEvent && (r = function (e, t, n) {
1564    e.detachEvent("on" + t, e[t + n]);
1565    try {
1566      delete e[t + n]
1567    } catch (i) {
1568      e[t + n] = void 0
1569    }
1570  });
1571  var o = {bind: i, unbind: r};
1572  "function" == typeof define && define.amd ? define("eventie/eventie", o) : e.eventie = o
1573}(this), function (e, t) {
1574  "function" == typeof define && define.amd ? define(["eventEmitter/EventEmitter", "eventie/eventie"], function (n, i) {
1575    return t(e, n, i)
1576  }) : "object" == typeof exports ? module.exports = t(e, require("wolfy87-eventemitter"), require("eventie")) : e.imagesLoaded = t(e, e.EventEmitter, e.eventie)
1577}(window, function (e, t, n) {
1578  function i(e, t) {
1579    for (var n in t) e[n] = t[n];
1580    return e
1581  }
1582
1583  function r(e) {
1584    return "[object Array]" === d.call(e)
1585  }
1586
1587  function o(e) {
1588    var t = [];
1589    if (r(e)) t = e; else if ("number" == typeof e.length) for (var n = 0, i = e.length; i > n; n++) t.push(e[n]); else t.push(e);
1590    return t
1591  }
1592
1593  function s(e, t, n) {
1594    if (!(this instanceof s)) return new s(e, t);
1595    "string" == typeof e && (e = document.querySelectorAll(e)), this.elements = o(e), this.options = i({}, this.options), "function" == typeof t ? n = t : i(this.options, t), n && this.on("always", n), this.getImages(), a && (this.jqDeferred = new a.Deferred);
1596    var r = this;
1597    setTimeout(function () {
1598      r.check()
1599    })
1600  }
1601
1602  function f(e) {
1603    this.img = e
1604  }
1605
1606  function c(e) {
1607    this.src = e, v[e] = this
1608  }
1609
1610  var a = e.jQuery, u = e.console, h = u !== void 0, d = Object.prototype.toString;
1611  s.prototype = new t, s.prototype.options = {}, s.prototype.getImages = function () {
1612    this.images = [];
1613    for (var e = 0, t = this.elements.length; t > e; e++) {
1614      var n = this.elements[e];
1615      "IMG" === n.nodeName && this.addImage(n);
1616      var i = n.nodeType;
1617      if (i && (1 === i || 9 === i || 11 === i)) for (var r = n.querySelectorAll("img"), o = 0, s = r.length; s > o; o++) {
1618        var f = r[o];
1619        this.addImage(f)
1620      }
1621    }
1622  }, s.prototype.addImage = function (e) {
1623    var t = new f(e);
1624    this.images.push(t)
1625  }, s.prototype.check = function () {
1626    function e(e, r) {
1627      return t.options.debug && h && u.log("confirm", e, r), t.progress(e), n++, n === i && t.complete(), !0
1628    }
1629
1630    var t = this, n = 0, i = this.images.length;
1631    if (this.hasAnyBroken = !1, !i) return this.complete(), void 0;
1632    for (var r = 0; i > r; r++) {
1633      var o = this.images[r];
1634      o.on("confirm", e), o.check()
1635    }
1636  }, s.prototype.progress = function (e) {
1637    this.hasAnyBroken = this.hasAnyBroken || !e.isLoaded;
1638    var t = this;
1639    setTimeout(function () {
1640      t.emit("progress", t, e), t.jqDeferred && t.jqDeferred.notify && t.jqDeferred.notify(t, e)
1641    })
1642  }, s.prototype.complete = function () {
1643    var e = this.hasAnyBroken ? "fail" : "done";
1644    this.isComplete = !0;
1645    var t = this;
1646    setTimeout(function () {
1647      if (t.emit(e, t), t.emit("always", t), t.jqDeferred) {
1648        var n = t.hasAnyBroken ? "reject" : "resolve";
1649        t.jqDeferred[n](t)
1650      }
1651    })
1652  }, a && (a.fn.imagesLoaded = function (e, t) {
1653    var n = new s(this, e, t);
1654    return n.jqDeferred.promise(a(this))
1655  }), f.prototype = new t, f.prototype.check = function () {
1656    var e = v[this.img.src] || new c(this.img.src);
1657    if (e.isConfirmed) return this.confirm(e.isLoaded, "cached was confirmed"), void 0;
1658    if (this.img.complete && void 0 !== this.img.naturalWidth) return this.confirm(0 !== this.img.naturalWidth, "naturalWidth"), void 0;
1659    var t = this;
1660    e.on("confirm", function (e, n) {
1661      return t.confirm(e.isLoaded, n), !0
1662    }), e.check()
1663  }, f.prototype.confirm = function (e, t) {
1664    this.isLoaded = e, this.emit("confirm", this, t)
1665  };
1666  var v = {};
1667  return c.prototype = new t, c.prototype.check = function () {
1668    if (!this.isChecked) {
1669      var e = new Image;
1670      n.bind(e, "load", this), n.bind(e, "error", this), e.src = this.src, this.isChecked = !0
1671    }
1672  }, c.prototype.handleEvent = function (e) {
1673    var t = "on" + e.type;
1674    this[t] && this[t](e)
1675  }, c.prototype.onload = function (e) {
1676    this.confirm(!0, "onload"), this.unbindProxyEvents(e)
1677  }, c.prototype.onerror = function (e) {
1678    this.confirm(!1, "onerror"), this.unbindProxyEvents(e)
1679  }, c.prototype.confirm = function (e, t) {
1680    this.isConfirmed = !0, this.isLoaded = e, this.emit("confirm", this, t)
1681  }, c.prototype.unbindProxyEvents = function (e) {
1682    n.unbind(e.target, "load", this), n.unbind(e.target, "error", this)
1683  }, s
1684});
1685
1686/**
1687 * jQuery Horizontal Navigation 1.0
1688 * https://github.com/sebnitu/horizontalNav
1689 *
1690 * By Sebastian Nitu - Copyright 2014 - All rights reserved
1691 * Author URL: http://sebnitu.com
1692 */
1693;(function (e) {
1694  e.fn.horizontalNav = function (t) {
1695    "use strict";
1696    var n = e.extend({}, e.fn.horizontalNav.defaults, t);
1697    return this.each(function () {
1698      function l(e) {
1699        return e.innerWidth() - (parseInt(e.css("padding-left")) + parseInt(e.css("padding-right")))
1700      }
1701
1702      function c(t, n) {
1703        n = n || 100;
1704        var r;
1705        e(window).resize(function () {
1706          clearTimeout(r);
1707          r = setTimeout(function () {
1708            t()
1709          }, n)
1710        })
1711      }
1712
1713      function h() {
1714        if (r.tableDisplay != true || e.browser.msie && parseInt(e.browser.version, 10) <= 7) {
1715          s.css({"float": "left"});
1716          o.css({"float": "left", width: "auto"});
1717          f.css({"padding-left": 0, "padding-right": 0});
1718          var n = l(s), c = s.outerWidth(true), h = c - n, p = l(i), d = p - h - n, v = Math.floor(d / a);
1719          o.each(function (t) {
1720            var n = l(e(this));
1721            e(this).css({width: n + v + "px"})
1722          });
1723          var m = l(u) + (p - h - l(s));
1724          if (e.browser.mozilla || e.browser.msie) {
1725            m = m - 1
1726          }
1727          u.css({width: m + "px"})
1728        } else {
1729          s.css({display: "table", "float": "none", width: "100%"});
1730          o.css({display: "table-cell", "float": "none"})
1731        }
1732        t.addClass("horizontalNav-processed").removeClass("horizontalNav-notprocessed")
1733      }
1734
1735      var t = e(this);
1736      var r = e.meta ? e.extend({}, n, t.data()) : n;
1737      if (t.is("ul")) {
1738        var i = t.parent()
1739      } else {
1740        var i = t
1741      }
1742      var s = t.is("ul") ? t : i.find("> ul"), o = s.find("> li"), u = o.last(), a = o.size(), f = o.find("> a");
1743      if (r.minimumItems && r.minimumItems > a) {
1744        t.addClass("horizontalNav-notprocessed");
1745        return false
1746      }
1747      if (r.responsive === true) {
1748        if (r.tableDisplay != true || e.browser.msie && parseInt(e.browser.version, 10) <= 7) {
1749          c(h, r.responsiveDelay)
1750        }
1751      }
1752      if (e(".clearHorizontalNav").length) {
1753        i.css({zoom: "1"})
1754      } else {
1755        i.css({zoom: "1"}).append('<div class="clearHorizontalNav">');
1756        e(".clearHorizontalNav").css({
1757          display: "block",
1758          overflow: "hidden",
1759          visibility: "hidden",
1760          width: 0,
1761          height: 0,
1762          clear: "both"
1763        })
1764      }
1765      h()
1766    })
1767  };
1768  e.fn.horizontalNav.defaults = {responsive: true, responsiveDelay: 100, tableDisplay: true, minimumItems: 0}
1769})(jQuery)
1770
1771/*!
1772 * Isotope PACKAGED v2.2.2
1773 *
1774 * Licensed GPLv3 for open source use
1775 * or Isotope Commercial License for commercial use
1776 *
1777 * http://isotope.metafizzy.co
1778 * Copyright 2015 Metafizzy
1779 */
1780
1781!function (a) {
1782  function b() {
1783  }
1784
1785  function c(a) {
1786    function c(b) {
1787      b.prototype.option || (b.prototype.option = function (b) {
1788        a.isPlainObject(b) && (this.options = a.extend(!0, this.options, b))
1789      })
1790    }
1791
1792    function e(b, c) {
1793      a.fn[b] = function (e) {
1794        if ("string" == typeof e) {
1795          for (var g = d.call(arguments, 1), h = 0, i = this.length; i > h; h++) {
1796            var j = this[h], k = a.data(j, b);
1797            if (k) if (a.isFunction(k[e]) && "_" !== e.charAt(0)) {
1798              var l = k[e].apply(k, g);
1799              if (void 0 !== l) return l
1800            } else f("no such method '" + e + "' for " + b + " instance"); else f("cannot call methods on " + b + " prior to initialization; attempted to call '" + e + "'")
1801          }
1802          return this
1803        }
1804        return this.each(function () {
1805          var d = a.data(this, b);
1806          d ? (d.option(e), d._init()) : (d = new c(this, e), a.data(this, b, d))
1807        })
1808      }
1809    }
1810
1811    if (a) {
1812      var f = "undefined" == typeof console ? b : function (a) {
1813        console.error(a)
1814      };
1815      return a.bridget = function (a, b) {
1816        c(b), e(a, b)
1817      }, a.bridget
1818    }
1819  }
1820
1821  var d = Array.prototype.slice;
1822  "function" == typeof define && define.amd ? define("jquery-bridget/jquery.bridget", ["jquery"], c) : c("object" == typeof exports ? require("jquery") : a.jQuery)
1823}(window), function (a) {
1824  function b(b) {
1825    var c = a.event;
1826    return c.target = c.target || c.srcElement || b, c
1827  }
1828
1829  var c = document.documentElement, d = function () {
1830  };
1831  c.addEventListener ? d = function (a, b, c) {
1832    a.addEventListener(b, c, !1)
1833  } : c.attachEvent && (d = function (a, c, d) {
1834    a[c + d] = d.handleEvent ? function () {
1835      var c = b(a);
1836      d.handleEvent.call(d, c)
1837    } : function () {
1838      var c = b(a);
1839      d.call(a, c)
1840    }, a.attachEvent("on" + c, a[c + d])
1841  });
1842  var e = function () {
1843  };
1844  c.removeEventListener ? e = function (a, b, c) {
1845    a.removeEventListener(b, c, !1)
1846  } : c.detachEvent && (e = function (a, b, c) {
1847    a.detachEvent("on" + b, a[b + c]);
1848    try {
1849      delete a[b + c]
1850    } catch (d) {
1851      a[b + c] = void 0
1852    }
1853  });
1854  var f = {bind: d, unbind: e};
1855  "function" == typeof define && define.amd ? define("eventie/eventie", f) : "object" == typeof exports ? module.exports = f : a.eventie = f
1856}(window), function () {
1857  "use strict";
1858
1859  function a() {
1860  }
1861
1862  function b(a, b) {
1863    for (var c = a.length; c--;) if (a[c].listener === b) return c;
1864    return -1
1865  }
1866
1867  function c(a) {
1868    return function () {
1869      return this[a].apply(this, arguments)
1870    }
1871  }
1872
1873  var d = a.prototype, e = this, f = e.EventEmitter;
1874  d.getListeners = function (a) {
1875    var b, c, d = this._getEvents();
1876    if (a instanceof RegExp) {
1877      b = {};
1878      for (c in d) d.hasOwnProperty(c) && a.test(c) && (b[c] = d[c])
1879    } else b = d[a] || (d[a] = []);
1880    return b
1881  }, d.flattenListeners = function (a) {
1882    var b, c = [];
1883    for (b = 0; b < a.length; b += 1) c.push(a[b].listener);
1884    return c
1885  }, d.getListenersAsObject = function (a) {
1886    var b, c = this.getListeners(a);
1887    return c instanceof Array && (b = {}, b[a] = c), b || c
1888  }, d.addListener = function (a, c) {
1889    var d, e = this.getListenersAsObject(a), f = "object" == typeof c;
1890    for (d in e) e.hasOwnProperty(d) && -1 === b(e[d], c) && e[d].push(f ? c : {listener: c, once: !1});
1891    return this
1892  }, d.on = c("addListener"), d.addOnceListener = function (a, b) {
1893    return this.addListener(a, {listener: b, once: !0})
1894  }, d.once = c("addOnceListener"), d.defineEvent = function (a) {
1895    return this.getListeners(a), this
1896  }, d.defineEvents = function (a) {
1897    for (var b = 0; b < a.length; b += 1) this.defineEvent(a[b]);
1898    return this
1899  }, d.removeListener = function (a, c) {
1900    var d, e, f = this.getListenersAsObject(a);
1901    for (e in f) f.hasOwnProperty(e) && (d = b(f[e], c), -1 !== d && f[e].splice(d, 1));
1902    return this
1903  }, d.off = c("removeListener"), d.addListeners = function (a, b) {
1904    return this.manipulateListeners(!1, a, b)
1905  }, d.removeListeners = function (a, b) {
1906    return this.manipulateListeners(!0, a, b)
1907  }, d.manipulateListeners = function (a, b, c) {
1908    var d, e, f = a ? this.removeListener : this.addListener, g = a ? this.removeListeners : this.addListeners;
1909    if ("object" != typeof b || b instanceof RegExp) for (d = c.length; d--;) f.call(this, b, c[d]); else for (d in b) b.hasOwnProperty(d) && (e = b[d]) && ("function" == typeof e ? f.call(this, d, e) : g.call(this, d, e));
1910    return this
1911  }, d.removeEvent = function (a) {
1912    var b, c = typeof a, d = this._getEvents();
1913    if ("string" === c) delete d[a]; else if (a instanceof RegExp) for (b in d) d.hasOwnProperty(b) && a.test(b) && delete d[b]; else delete this._events;
1914    return this
1915  }, d.removeAllListeners = c("removeEvent"), d.emitEvent = function (a, b) {
1916    var c, d, e, f, g = this.getListenersAsObject(a);
1917    for (e in g) if (g.hasOwnProperty(e)) for (d = g[e].length; d--;) c = g[e][d], c.once === !0 && this.removeListener(a, c.listener), f = c.listener.apply(this, b || []), f === this._getOnceReturnValue() && this.removeListener(a, c.listener);
1918    return this
1919  }, d.trigger = c("emitEvent"), d.emit = function (a) {
1920    var b = Array.prototype.slice.call(arguments, 1);
1921    return this.emitEvent(a, b)
1922  }, d.setOnceReturnValue = function (a) {
1923    return this._onceReturnValue = a, this
1924  }, d._getOnceReturnValue = function () {
1925    return this.hasOwnProperty("_onceReturnValue") ? this._onceReturnValue : !0
1926  }, d._getEvents = function () {
1927    return this._events || (this._events = {})
1928  }, a.noConflict = function () {
1929    return e.EventEmitter = f, a
1930  }, "function" == typeof define && define.amd ? define("eventEmitter/EventEmitter", [], function () {
1931    return a
1932  }) : "object" == typeof module && module.exports ? module.exports = a : e.EventEmitter = a
1933}.call(this), function (a) {
1934  function b(a) {
1935    if (a) {
1936      if ("string" == typeof d[a]) return a;
1937      a = a.charAt(0).toUpperCase() + a.slice(1);
1938      for (var b, e = 0, f = c.length; f > e; e++) if (b = c[e] + a, "string" == typeof d[b]) return b
1939    }
1940  }
1941
1942  var c = "Webkit Moz ms Ms O".split(" "), d = document.documentElement.style;
1943  "function" == typeof define && define.amd ? define("get-style-property/get-style-property", [], function () {
1944    return b
1945  }) : "object" == typeof exports ? module.exports = b : a.getStyleProperty = b
1946}(window), function (a, b) {
1947  function c(a) {
1948    var b = parseFloat(a), c = -1 === a.indexOf("%") && !isNaN(b);
1949    return c && b
1950  }
1951
1952  function d() {
1953  }
1954
1955  function e() {
1956    for (var a = {
1957      width: 0,
1958      height: 0,
1959      innerWidth: 0,
1960      innerHeight: 0,
1961      outerWidth: 0,
1962      outerHeight: 0
1963    }, b = 0, c = h.length; c > b; b++) {
1964      var d = h[b];
1965      a[d] = 0
1966    }
1967    return a
1968  }
1969
1970  function f(b) {
1971    function d() {
1972      if (!m) {
1973        m = !0;
1974        var d = a.getComputedStyle;
1975        if (j = function () {
1976          var a = d ? function (a) {
1977            return d(a, null)
1978          } : function (a) {
1979            return a.currentStyle
1980          };
1981          return function (b) {
1982            var c = a(b);
1983            return c || g("Style returned " + c + ". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"), c
1984          }
1985        }(), k = b("boxSizing")) {
1986          var e = document.createElement("div");
1987          e.style.width = "200px", e.style.padding = "1px 2px 3px 4px", e.style.borderStyle = "solid", e.style.borderWidth = "1px 2px 3px 4px", e.style[k] = "border-box";
1988          var f = document.body || document.documentElement;
1989          f.appendChild(e);
1990          var h = j(e);
1991          l = 200 === c(h.width), f.removeChild(e)
1992        }
1993      }
1994    }
1995
1996    function f(a) {
1997      if (d(), "string" == typeof a && (a = document.querySelector(a)), a && "object" == typeof a && a.nodeType) {
1998        var b = j(a);
1999        if ("none" === b.display) return e();
2000        var f = {};
2001        f.width = a.offsetWidth, f.height = a.offsetHeight;
2002        for (var g = f.isBorderBox = !(!k || !b[k] || "border-box" !== b[k]), m = 0, n = h.length; n > m; m++) {
2003          var o = h[m], p = b[o];
2004          p = i(a, p);
2005          var q = parseFloat(p);
2006          f[o] = isNaN(q) ? 0 : q
2007        }
2008        var r = f.paddingLeft + f.paddingRight, s = f.paddingTop + f.paddingBottom, t = f.marginLeft + f.marginRight,
2009            u = f.marginTop + f.marginBottom, v = f.borderLeftWidth + f.borderRightWidth,
2010            w = f.borderTopWidth + f.borderBottomWidth, x = g && l, y = c(b.width);
2011        y !== !1 && (f.width = y + (x ? 0 : r + v));
2012        var z = c(b.height);
2013        return z !== !1 && (f.height = z + (x ? 0 : s + w)), f.innerWidth = f.width - (r + v), f.innerHe
2013ight = f.height - (s + w), f.outerWidth = f.width + t, f.outerHeight = f.height + u, f
2014      }
2015    }
2016
2017    function i(b, c) {
2018      if (a.getComputedStyle || -1 === c.indexOf("%")) return c;
2019      var d = b.style, e = d.left, f = b.runtimeStyle, g = f && f.left;
2020      return g && (f.left = b.currentStyle.left), d.left = c, c = d.pixelLeft, d.left = e, g && (f.left = g), c
2021    }
2022
2023    var j, k, l, m = !1;
2024    return f
2025  }
2026
2027  var g = "undefined" == typeof console ? d : function (a) {
2028        console.error(a)
2029      },
2030      h = ["paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "marginLeft", "marginRight", "marginTop", "marginBottom", "borderLeftWidth", "borderRightWidth", "borderTopWidth", "borderBottomWidth"];
2031  "function" == typeof define && define.amd ? define("get-size/get-size", ["get-style-property/get-style-property"], f) : "object" == typeof exports ? module.exports = f(require("desandro-get-style-property")) : a.getSize = f(a.getStyleProperty)
2032}(window), function (a) {
2033  function b(a) {
2034    "function" == typeof a && (b.isReady ? a() : g.push(a))
2035  }
2036
2037  function c(a) {
2038    var c = "readystatechange" === a.type && "complete" !== f.readyState;
2039    b.isReady || c || d()
2040  }
2041
2042  function d() {
2043    b.isReady = !0;
2044    for (var a = 0, c = g.length; c > a; a++) {
2045      var d = g[a];
2046      d()
2047    }
2048  }
2049
2050  function e(e) {
2051    return "complete" === f.readyState ? d() : (e.bind(f, "DOMContentLoaded", c), e.bind(f, "readystatechange", c), e.bind(a, "load", c)), b
2052  }
2053
2054  var f = a.document, g = [];
2055  b.isReady = !1, "function" == typeof define && define.amd ? define("doc-ready/doc-ready", ["eventie/eventie"], e) : "object" == typeof exports ? module.exports = e(require("eventie")) : a.docReady = e(a.eventie)
2056}(window), function (a) {
2057  "use strict";
2058
2059  function b(a, b) {
2060    return a[g](b)
2061  }
2062
2063  function c(a) {
2064    if (!a.parentNode) {
2065      var b = document.createDocumentFragment();
2066      b.appendChild(a)
2067    }
2068  }
2069
2070  function d(a, b) {
2071    c(a);
2072    for (var d = a.parentNode.querySelectorAll(b), e = 0, f = d.length; f > e; e++) if (d[e] === a) return !0;
2073    return !1
2074  }
2075
2076  function e(a, d) {
2077    return c(a), b(a, d)
2078  }
2079
2080  var f, g = function () {
2081    if (a.matches) return "matches";
2082    if (a.matchesSelector) return "matchesSelector";
2083    for (var b = ["webkit", "moz", "ms", "o"], c = 0, d = b.length; d > c; c++) {
2084      var e = b[c], f = e + "MatchesSelector";
2085      if (a[f]) return f
2086    }
2087  }();
2088  if (g) {
2089    var h = document.createElement("div"), i = b(h, "div");
2090    f = i ? b : e
2091  } else f = d;
2092  "function" == typeof define && define.amd ? define("matches-selector/matches-selector", [], function () {
2093    return f
2094  }) : "object" == typeof exports ? module.exports = f : window.matchesSelector = f
2095}(Element.prototype), function (a, b) {
2096  "use strict";
2097  "function" == typeof define && define.amd ? define("fizzy-ui-utils/utils", ["doc-ready/doc-ready", "matches-selector/matches-selector"], function (c, d) {
2098    return b(a, c, d)
2099  }) : "object" == typeof exports ? module.exports = b(a, require("doc-ready"), require("desandro-matches-selector")) : a.fizzyUIUtils = b(a, a.docReady, a.matchesSelector)
2100}(window, function (a, b, c) {
2101  var d = {};
2102  d.extend = function (a, b) {
2103    for (var c in b) a[c] = b[c];
2104    return a
2105  }, d.modulo = function (a, b) {
2106    return (a % b + b) % b
2107  };
2108  var e = Object.prototype.toString;
2109  d.isArray = function (a) {
2110    return "[object Array]" == e.call(a)
2111  }, d.makeArray = function (a) {
2112    var b = [];
2113    if (d.isArray(a)) b = a; else if (a && "number" == typeof a.length) for (var c = 0, e = a.length; e > c; c++) b.push(a[c]); else b.push(a);
2114    return b
2115  }, d.indexOf = Array.prototype.indexOf ? function (a, b) {
2116    return a.indexOf(b)
2117  } : function (a, b) {
2118    for (var c = 0, d = a.length; d > c; c++) if (a[c] === b) return c;
2119    return -1
2120  }, d.removeFrom = function (a, b) {
2121    var c = d.indexOf(a, b);
2122    -1 != c && a.splice(c, 1)
2123  }, d.isElement = "function" == typeof HTMLElement || "object" == typeof HTMLElement ? function (a) {
2124    return a instanceof HTMLElement
2125  } : function (a) {
2126    return a && "object" == typeof a && 1 == a.nodeType && "string" == typeof a.nodeName
2127  }, d.setText = function () {
2128    function a(a, c) {
2129      b = b || (void 0 !== document.documentElement.textContent ? "textContent" : "innerText"), a[b] = c
2130    }
2131
2132    var b;
2133    return a
2134  }(), d.getParent = function (a, b) {
2135    for (; a != document.body;) if (a = a.parentNode, c(a, b)) return a
2136  }, d.getQueryElement = function (a) {
2137    return "string" == typeof a ? document.querySelector(a) : a
2138  }, d.handleEvent = function (a) {
2139    var b = "on" + a.type;
2140    this[b] && this[b](a)
2141  }, d.filterFindElements = function (a, b) {
2142    a = d.makeArray(a);
2143    for (var e = [], f = 0, g = a.length; g > f; f++) {
2144      var h = a[f];
2145      if (d.isElement(h)) if (b) {
2146        c(h, b) && e.push(h);
2147        for (var i = h.querySelectorAll(b), j = 0, k = i.length; k > j; j++) e.push(i[j])
2148      } else e.push(h)
2149    }
2150    return e
2151  }, d.debounceMethod = function (a, b, c) {
2152    var d = a.prototype[b], e = b + "Timeout";
2153    a.prototype[b] = function () {
2154      var a = this[e];
2155      a && clearTimeout(a);
2156      var b = arguments, f = this;
2157      this[e] = setTimeout(function () {
2158        d.apply(f, b), delete f[e]
2159      }, c || 100)
2160    }
2161  }, d.toDashed = function (a) {
2162    return a.replace(/(.)([A-Z])/g, function (a, b, c) {
2163      return b + "-" + c
2164    }).toLowerCase()
2165  };
2166  var f = a.console;
2167  return d.htmlInit = function (c, e) {
2168    b(function () {
2169      for (var b = d.toDashed(e), g = document.querySelectorAll(".js-" + b), h = "data-" + b + "-options", i = 0, j = g.length; j > i; i++) {
2170        var k, l = g[i], m = l.getAttribute(h);
2171        try {
2172          k = m && JSON.parse(m)
2173        } catch (n) {
2174          f && f.error("Error parsing " + h + " on " + l.nodeName.toLowerCase() + (l.id ? "#" + l.id : "") + ": " + n);
2175          continue
2176        }
2177        var o = new c(l, k), p = a.jQuery;
2178        p && p.data(l, e, o)
2179      }
2180    })
2181  }, d
2182}), function (a, b) {
2183  "use strict";
2184  "function" == typeof define && define.amd ? define("outlayer/item", ["eventEmitter/EventEmitter", "get-size/get-size", "get-style-property/get-style-property", "fizzy-ui-utils/utils"], function (c, d, e, f) {
2185    return b(a, c, d, e, f)
2186  }) : "object" == typeof exports ? module.exports = b(a, require("wolfy87-eventemitter"), require("get-size"), require("desandro-get-style-property"), require("fizzy-ui-utils")) : (a.Outlayer = {}, a.Outlayer.Item = b(a, a.EventEmitter, a.getSize, a.getStyleProperty, a.fizzyUIUtils))
2187}(window, function (a, b, c, d, e) {
2188  "use strict";
2189
2190  function f(a) {
2191    for (var b in a) return !1;
2192    return b = null, !0
2193  }
2194
2195  function g(a, b) {
2196    a && (this.element = a, this.layout = b, this.position = {x: 0, y: 0}, this._create())
2197  }
2198
2199  function h(a) {
2200    return a.replace(/([A-Z])/g, function (a) {
2201      return "-" + a.toLowerCase()
2202    })
2203  }
2204
2205  var i = a.getComputedStyle, j = i ? function (a) {
2206    return i(a, null)
2207  } : function (a) {
2208    return a.currentStyle
2209  }, k = d("transition"), l = d("transform"), m = k && l, n = !!d("perspective"), o = {
2210    WebkitTransition: "webkitTransitionEnd",
2211    MozTransition: "transitionend",
2212    OTransition: "otransitionend",
2213    transition: "transitionend"
2214  }[k], p = ["transform", "transition", "transitionDuration", "transitionProperty"], q = function () {
2215    for (var a = {}, b = 0, c = p.length; c > b; b++) {
2216      var e = p[b], f = d(e);
2217      f && f !== e && (a[e] = f)
2218    }
2219    return a
2220  }();
2221  e.extend(g.prototype, b.prototype), g.prototype._create = function () {
2222    this._transn = {ingProperties: {}, clean: {}, onEnd: {}}, this.css({position: "absolute"})
2223  }, g.prototype.handleEvent = function (a) {
2224    var b = "on" + a.type;
2225    this[b] && this[b](a)
2226  }, g.prototype.getSize = function () {
2227    this.size = c(this.element)
2228  }, g.prototype.css = function (a) {
2229    var b = this.element.style;
2230    for (var c in a) {
2231      var d = q[c] || c;
2232      b[d] = a[c]
2233    }
2234  }, g.prototype.getPosition = function () {
2235    var a = j(this.element), b = this.layout.options, c = b.isOriginLeft, d = b.isOriginTop,
2236        e = a[c ? "left" : "right"], f = a[d ? "top" : "bottom"], g = this.layout.size,
2237        h = -1 != e.indexOf("%") ? parseFloat(e) / 100 * g.width : parseInt(e, 10),
2238        i = -1 != f.indexOf("%") ? parseFloat(f) / 100 * g.height : parseInt(f, 10);
2239    h = isNaN(h) ? 0 : h, i = isNaN(i) ? 0 : i, h -= c ? g.paddingLeft : g.paddingRight, i -= d ? g.paddingTop : g.paddingBottom, this.position.x = h, this.position.y = i
2240  }, g.prototype.layoutPosition = function () {
2241    var a = this.layout.size, b = this.layout.options, c = {}, d = b.isOriginLeft ? "paddingLeft" : "paddingRight",
2242        e = b.isOriginLeft ? "left" : "right", f = b.isOriginLeft ? "right" : "left", g = this.position.x + a[d];
2243    c[e] = this.getXValue(g), c[f] = "";
2244    var h = b.isOriginTop ? "paddingTop" : "paddingBottom", i = b.isOriginTop ? "top" : "bottom",
2245        j = b.isOriginTop ? "bottom" : "top", k = this.position.y + a[h];
2246    c[i] = this.getYValue(k), c[j] = "", this.css(c), this.emitEvent("layout", [this])
2247  }, g.prototype.getXValue = function (a) {
2248    var b = this.layout.options;
2249    return b.percentPosition && !b.isHorizontal ? a / this.layout.size.width * 100 + "%" : a + "px"
2250  }, g.prototype.getYValue = function (a) {
2251    var b = this.layout.options;
2252    return b.percentPosition && b.isHorizontal ? a / this.layout.size.height * 100 + "%" : a + "px"
2253  }, g.prototype._transitionTo = function (a, b) {
2254    this.getPosition();
2255    var c = this.position.x, d = this.position.y, e = parseInt(a, 10), f = parseInt(b, 10),
2256        g = e === this.position.x && f === this.position.y;
2257    if (this.setPosition(a, b), g && !this.isTransitioning) return void this.layoutPosition();
2258    var h = a - c, i = b - d, j = {};
2259    j.transform = this.getTranslate(h, i), this.transition({
2260      to: j,
2261      onTransitionEnd: {transform: this.layoutPosition},
2262      isCleaning: !0
2263    })
2264  }, g.prototype.getTranslate = function (a, b) {
2265    var c = this.layout.options;
2266    return a = c.isOriginLeft ? a : -a, b = c.isOriginTop ? b : -b, n ? "translate3d(" + a + "px, " + b + "px, 0)" : "translate(" + a + "px, " + b + "px)"
2267  }, g.prototype.goTo = function (a, b) {
2268    this.setPosition(a, b), this.layoutPosition()
2269  }, g.prototype.moveTo = m ? g.prototype._transitionTo : g.prototype.goTo, g.prototype.setPosition = function (a, b) {
2270    this.position.x = parseInt(a, 10), this.position.y = parseInt(b, 10)
2271  }, g.prototype._nonTransition = function (a) {
2272    this.css(a.to), a.isCleaning && this._removeStyles(a.to);
2273    for (var b in a.onTransitionEnd) a.onTransitionEnd[b].call(this)
2274  }, g.prototype._transition = function (a) {
2275    if (!parseFloat(this.layout.options.transitionDuration)) return void this._nonTransition(a);
2276    var b = this._transn;
2277    for (var c in a.onTransitionEnd) b.onEnd[c] = a.onTransitionEnd[c];
2278    for (c in a.to) b.ingProperties[c] = !0, a.isCleaning && (b.clean[c] = !0);
2279    if (a.from) {
2280      this.css(a.from);
2281      var d = this.element.offsetHeight;
2282      d = null
2283    }
2284    this.enableTransition(a.to), this.css(a.to), this.isTransitioning = !0
2285  };
2286  var r = "opacity," + h(q.transform || "transform");
2287  g.prototype.enableTransition = function () {
2288    this.isTransitioning || (this.css({
2289      transitionProperty: r,
2290      transitionDuration: this.layout.options.transitionDuration
2291    }), this.element.addEventListener(o, this, !1))
2292  }, g.prototype.transition = g.prototype[k ? "_transition" : "_nonTransition"], g.prototype.onwebkitTransitionEnd = function (a) {
2293    this.ontransitionend(a)
2294  }, g.prototype.onotransitionend = function (a) {
2295    this.ontransitionend(a)
2296  };
2297  var s = {"-webkit-transform": "transform", "-moz-transform": "transform", "-o-transform": "transform"};
2298  g.prototype.ontransitionend = function (a) {
2299    if (a.target === this.element) {
2300      var b = this._transn, c = s[a.propertyName] || a.propertyName;
2301      if (delete b.ingProperties[c], f(b.ingProperties) && this.disableTransition(), c in b.clean && (this.element.style[a.propertyName] = "", delete b.clean[c]), c in b.onEnd) {
2302        var d = b.onEnd[c];
2303        d.call(this), delete b.onEnd[c]
2304      }
2305      this.emitEvent("transitionEnd", [this])
2306    }
2307  }, g.prototype.disableTransition = function () {
2308    this.removeTransitionStyles(), this.element.removeEventListener(o, this, !1), this.isTransitioning = !1
2309  }, g.prototype._removeStyles = function (a) {
2310    var b = {};
2311    for (var c in a) b[c] = "";
2312    this.css(b)
2313  };
2314  var t = {transitionProperty: "", transitionDuration: ""};
2315  return g.prototype.removeTransitionStyles = function () {
2316    this.css(t)
2317  }, g.prototype.removeElem = function () {
2318    this.element.parentNode.removeChild(this.element), this.css({display: ""}), this.emitEvent("remove", [this])
2319  }, g.prototype.remove = function () {
2320    if (!k || !parseFloat(this.layout.options.transitionDuration)) return void this.removeElem();
2321    var a = this;
2322    this.once("transitionEnd", function () {
2323      a.removeElem()
2324    }), this.hide()
2325  }, g.prototype.reveal = function () {
2326    delete this.isHidden, this.css({display: ""});
2327    var a = this.layout.options, b = {}, c = this.getHideRevealTransitionEndProperty("visibleStyle");
2328    b[c] = this.onRevealTransitionEnd, this.transition({
2329      from: a.hiddenStyle,
2330      to: a.visibleStyle,
2331      isCleaning: !0,
2332      onTransitionEnd: b
2333    })
2334  }, g.prototype.onRevealTransitionEnd = function () {
2335    this.isHidden || this.emitEvent("reveal")
2336  }, g.prototype.getHideRevealTransitionEndProperty = function (a) {
2337    var b = this.layout.options[a];
2338    if (b.opacity) return "opacity";
2339    for (var c in b) return c
2340  }, g.prototype.hide = function () {
2341    this.isHidden = !0, this.css({display: ""});
2342    var a = this.layout.options, b = {}, c = this.getHideRevealTransitionEndProperty("hiddenStyle");
2343    b[c] = this.onHideTransitionEnd, this.transition({
2344      from: a.visibleStyle,
2345      to: a.hiddenStyle,
2346      isCleaning: !0,
2347      onTransitionEnd: b
2348    })
2349  }, g.prototype.onHideTransitionEnd = function () {
2350    this.isHidden && (this.css({display: "none"}), this.emitEvent("hide"))
2351  }, g.prototype.destroy = function () {
2352    this.css({position: "", left: "", right: "", top: "", bottom: "", transition: "", transform: ""})
2353  }, g
2354}), function (a, b) {
2355  "use strict";
2356  "function" == typeof define && define.amd ? define("outlayer/outlayer", ["eventie/eventie", "eventEmitter/EventEmitter", "get-size/get-size", "fizzy-ui-utils/utils", "./item"], function (c, d, e, f, g) {
2357    return b(a, c, d, e, f, g)
2358  }) : "object" == typeof exports ? module.exports = b(a, require("eventie"), require("wolfy87-eventemitter"), require("get-size"), require("fizzy-ui-utils"), require("./item")) : a.Outlayer = b(a, a.eventie, a.EventEmitter, a.getSize, a.fizzyUIUtils, a.Outlayer.Item)
2359}(window, function (a, b, c, d, e, f) {
2360  "use strict";
2361
2362  function g(a, b) {
2363    var c = e.getQueryElement(a);
2364    if (!c) return void (h && h.error("Bad element for " + this.constructor.namespace + ": " + (c || a)));
2365    this.element = c, i && (this.$element = i(this.element)), this.options = e.extend({}, this.constructor.defaults), this.option(b);
2366    var d = ++k;
2367    this.element.outlayerGUID = d, l[d] = this, this._create(), this.options.isInitLayout && this.layout()
2368  }
2369
2370  var h = a.console, i = a.jQuery, j = function () {
2371  }, k = 0, l = {};
2372  return g.namespace = "outlayer", g.Item = f, g.defaults = {
2373    containerStyle: {position: "relative"},
2374    isInitLayout: !0,
2375    isOriginLeft: !0,
2376    isOriginTop: !0,
2377    isResizeBound: !0,
2378    isResizingContainer: !0,
2379    transitionDuration: "0.4s",
2380    hiddenStyle: {opacity: 0, transform: "scale(0.001)"},
2381    visibleStyle: {opacity: 1, transform: "scale(1)"}
2382  }, e.extend(g.prototype, c.prototype), g.prototype.option = function (a) {
2383    e.extend(this.options, a)
2384  }, g.prototype._create = function () {
2385    this.reloadItems(), this.stamps = [], this.stamp(this.options.stamp), e.extend(this.element.style, this.options.containerStyle), this.options.isResizeBound && this.bindResize()
2386  }, g.prototype.reloadItems = function () {
2387    this.items = this._itemize(this.element.children)
2388  }, g.prototype._itemize = function (a) {
2389    for (var b = this._filterFindItemElements(a), c = this.constructor.Item, d = [], e = 0, f = b.length; f > e; e++) {
2390      var g = b[e], h = new c(g, this);
2391      d.push(h)
2392    }
2393    return d
2394  }, g.prototype._filterFindItemElements = function (a) {
2395    return e.filterFindElements(a, this.options.itemSelector)
2396  }, g.prototype.getItemElements = function () {
2397    for (var a = [], b = 0, c = this.items.length; c > b; b++) a.push(this.items[b].element);
2398    return a
2399  }, g.prototype.layout = function () {
2400    this._resetLayout(), this._manageStamps();
2401    var a = void 0 !== this.options.isLayoutInstant ? this.options.isLayoutInstant : !this._isLayoutInited;
2402    this.layoutItems(this.items, a), this._isLayoutInited = !0
2403  }, g.prototype._init = g.prototype.layout, g.prototype._resetLayout = function () {
2404    this.getSize()
2405  }, g.prototype.getSize = function () {
2406    this.size = d(this.element)
2407  }, g.prototype._getMeasurement = function (a, b) {
2408    var c, f = this.options[a];
2409    f ? ("string" == typeof f ? c = this.element.querySelector(f) : e.isElement(f) && (c = f), this[a] = c ? d(c)[b] : f) : this[a] = 0
2410  }, g.prototype.layoutItems = function (a, b) {
2411    a = this._getItemsForLayout(a), this._layoutItems(a, b), this._postLayout()
2412  }, g.prototype._getItemsForLayout = function (a) {
2413    for (var b = [], c = 0, d = a.length; d > c; c++) {
2414      var e = a[c];
2415      e.isIgnored || b.push(e)
2416    }
2417    return b
2418  }, g.prototype._layoutItems = function (a, b) {
2419    if (this._emitCompleteOnItems("layout", a), a && a.length) {
2420      for (var c = [], d = 0, e = a.length; e > d; d++) {
2421        var f = a[d], g = this._getItemLayoutPosition(f);
2422        g.item = f, g.isInstant = b || f.isLayoutInstant, c.push(g)
2423      }
2424      this._processLayoutQueue(c)
2425    }
2426  }, g.prototype._getItemLayoutPosition = function () {
2427    return {x: 0, y: 0}
2428  }, g.prototype._processLayoutQueue = function (a) {
2429    for (var b = 0, c = a.length; c > b; b++) {
2430      var d = a[b];
2431      this._positionItem(d.item, d.x, d.y, d.isInstant)
2432    }
2433  }, g.prototype._positionItem = function (a, b, c, d) {
2434    d ? a.goTo(b, c) : a.moveTo(b, c)
2435  }, g.prototype._postLayout = function () {
2436    this.resizeContainer()
2437  }, g.prototype.resizeContainer = function () {
2438    if (this.options.isResizingContainer) {
2439      var a = this._getContainerSize();
2440      a && (this._setContainerMeasure(a.width, !0), this._setContainerMeasure(a.height, !1))
2441    }
2442  }, g.prototype._getContainerSize = j, g.prototype._setContainerMeasure = function (a, b) {
2443    if (void 0 !== a) {
2444      var c = this.size;
2445      c.isBorderBox && (a += b ? c.paddingLeft + c.paddingRight + c.borderLeftWidth + c.borderRightWidth : c.paddingBottom + c.paddingTop + c.borderTopWidth + c.borderBottomWidth), a = Math.max(a, 0), this.element.style[b ? "width" : "height"] = a + "px"
2446    }
2447  }, g.prototype._emitCompleteOnItems = function (a, b) {
2448    function c() {
2449      e.dispatchEvent(a + "Complete", null, [b])
2450    }
2451
2452    function d() {
2453      g++, g === f && c()
2454    }
2455
2456    var e = this, f = b.length;
2457    if (!b || !f) return void c();
2458    for (var g = 0, h = 0, i = b.length; i > h; h++) {
2459      var j = b[h];
2460      j.once(a, d)
2461    }
2462  }, g.prototype.dispatchEvent = function (a, b, c) {
2463    var d = b ? [b].concat(c) : c;
2464    if (this.emitEvent(a, d), i) if (this.$element = this.$element || i(this.element), b) {
2465      var e = i.Event(b);
2466      e.type = a, this.$element.trigger(e, c)
2467    } else this.$element.trigger(a, c)
2468  }, g.prototype.ignore = function (a) {
2469    var b = this.getItem(a);
2470    b && (b.isIgnored = !0)
2471  }, g.prototype.unignore = function (a) {
2472    var b = this.getItem(a);
2473    b && delete b.isIgnored
2474  }, g.prototype.stamp = function (a) {
2475    if (a = this._find(a)) {
2476      this.stamps = this.stamps.concat(a);
2477      for (var b = 0, c = a.length; c > b; b++) {
2478        var d = a[b];
2479        this.ignore(d)
2480      }
2481    }
2482  }, g.prototype.unstamp = function (a) {
2483    if (a = this._find(a)) for (var b = 0, c = a.length; c > b; b++) {
2484      var d = a[b];
2485      e.removeFrom(this.stamps, d), this.unignore(d)
2486    }
2487  }, g.prototype._find = function (a) {
2488    return a ? ("string" == typeof a && (a = this.element.querySelectorAll(a)), a = e.makeArray(a)) : void 0
2489  }, g.prototype._manageStamps = function () {
2490    if (this.stamps && this.stamps.length) {
2491      this._getBoundingRect();
2492      for (var a = 0, b = this.stamps.length; b > a; a++) {
2493        var c = this.stamps[a];
2494        this._manageStamp(c)
2495      }
2496    }
2497  }, g.prototype._getBoundingRect = function () {
2498    var a = this.element.getBoundingClientRect(), b = this.size;
2499    this._boundingRect = {
2500      left: a.left + b.paddingLeft + b.borderLeftWidth,
2501      top: a.top + b.paddingTop + b.borderTopWidth,
2502      right: a.right - (b.paddingRight + b.borderRightWidth),
2503      bottom: a.bottom - (b.paddingBottom + b.borderBottomWidth)
2504    }
2505  }, g.prototype._manageStamp = j, g.prototype._getElementOffset = function (a) {
2506    var b = a.getBoundingClientRect(), c = this._boundingRect, e = d(a), f = {
2507      left: b.left - c.left - e.marginLeft,
2508      top: b.top - c.top - e.marginTop,
2509      right: c.right - b.right - e.marginRight,
2510      bottom: c.bottom - b.bottom - e.marginBottom
2511    };
2512    return f
2513  }, g.prototype.handleEvent = function (a) {
2514    var b = "on" + a.type;
2515    this[b] && this[b](a)
2516  }, g.prototype.bindResize = function () {
2517    this.isResizeBound || (b.bind(a, "resize", this), this.isResizeBound = !0)
2518  }, g.prototype.unbindResize = function () {
2519    this.isResizeBound && b.unbind(a, "resize", this), this.isResizeBound = !1
2520  }, g.prototype.onresize = function () {
2521    function a() {
2522      b.resize(), delete b.resizeTimeout
2523    }
2524
2525    this.resizeTimeout && clearTimeout(this.resizeTimeout);
2526    var b = this;
2527    this.resizeTimeout = setTimeout(a, 100)
2528  }, g.prototype.resize = function () {
2529    this.isResizeBound && this.needsResizeLayout() && this.layout()
2530  }, g.prototype.needsResizeLayout = function () {
2531    var a = d(this.element), b = this.size && a;
2532    return b && a.innerWidth !== this.size.innerWidth
2533  }, g.prototype.addItems = function (a) {
2534    var b = this._itemize(a);
2535    return b.length && (this.items = this.items.concat(b)), b
2536  }, g.prototype.appended = function (a) {
2537    var b = this.addItems(a);
2538    b.length && (this.layoutItems(b, !0), this.reveal(b))
2539  }, g.prototype.prepended = function (a) {
2540    var b = this._itemize(a);
2541    if (b.length) {
2542      var c = this.items.slice(0);
2543      this.items = b.concat(c), this._resetLayout(), this._manageStamps(), this.layoutItems(b, !0), this.reveal(b), this.layoutItems(c)
2544    }
2545  }, g.prototype.reveal = function (a) {
2546    this._emitCompleteOnItems("reveal", a);
2547    for (var b = a && a.length, c = 0; b && b > c; c++) {
2548      var d = a[c];
2549      d.reveal()
2550    }
2551  }, g.prototype.hide = function (a) {
2552    this._emitCompleteOnItems("hide", a);
2553    for (var b = a && a.length, c = 0; b && b > c; c++) {
2554      var d = a[c];
2555      d.hide()
2556    }
2557  }, g.prototype.revealItemElements = function (a) {
2558    var b = this.getItems(a);
2559    this.reveal(b)
2560  }, g.prototype.hideItemElements = function (a) {
2561    var b = this.getItems(a);
2562    this.hide(b)
2563  }, g.prototype.getItem = function (a) {
2564    for (var b = 0, c = this.items.length; c > b; b++) {
2565      var d = this.items[b];
2566      if (d.element === a) return d
2567    }
2568  }, g.prototype.getItems = function (a) {
2569    a = e.makeArray(a);
2570    for (var b = [], c = 0, d = a.length; d > c; c++) {
2571      var f = a[c], g = this.getItem(f);
2572      g && b.push(g)
2573    }
2574    return b
2575  }, g.prototype.remove = function (a) {
2576    var b = this.getItems(a);
2577    if (this._emitCompleteOnItems("remove", b), b && b.length) for (var c = 0, d = b.length; d > c; c++) {
2578      var f = b[c];
2579      f.remove(), e.removeFrom(this.items, f)
2580    }
2581  }, g.prototype.destroy = function () {
2582    var a = this.element.style;
2583    a.height = "", a.position = "", a.width = "";
2584    for (var b = 0, c = this.items.length; c > b; b++) {
2585      var d = this.items[b];
2586      d.destroy()
2587    }
2588    this.unbindResize();
2589    var e = this.element.outlayerGUID;
2590    delete l[e], delete this.element.outlayerGUID, i && i.removeData(this.element, this.constructor.namespace)
2591  }, g.data = function (a) {
2592    a = e.getQueryElement(a);
2593    var b = a && a.outlayerGUID;
2594    return b && l[b]
2595  }, g.create = function (a, b) {
2596    function c() {
2597      g.apply(this, arguments)
2598    }
2599
2600    return Object.create ? c.prototype = Object.create(g.prototype) : e.extend(c.prototype, g.prototype), c.prototype.constructor = c, c.defaults = e.extend({}, g.defaults), e.extend(c.defaults, b), c.prototype.settings = {}, c.namespace = a, c.data = g.data, c.Item = function () {
2601      f.apply(this, arguments)
2602    }, c.Item.prototype = new f, e.htmlInit(c, a), i && i.bridget && i.bridget(a, c), c
2603  }, g.Item = f, g
2604}), function (a, b) {
2605  "use strict";
2606  "function" == typeof define && define.amd ? define("isotope/js/item", ["outlayer/outlayer"], b) : "object" == typeof exports ? module.exports = b(require("outlayer")) : (a.Isotope = a.Isotope || {}, a.Isotope.Item = b(a.Outlayer))
2607}(window, function (a) {
2608  "use strict";
2609
2610  function b() {
2611    a.Item.apply(this, arguments)
2612  }
2613
2614  b.prototype = new a.Item, b.prototype._create = function () {
2615    this.id = this.layout.itemGUID++, a.Item.prototype._create.call(this), this.sortData = {}
2616  }, b.prototype.updateSortData = function () {
2617    if (!this.isIgnored) {
2618      this.sortData.id = this.id, this.sortData["original-order"] = this.id, this.sortData.random = Math.random();
2619      var a = this.layout.options.getSortData, b = this.layout._sorters;
2620      for (var c in a) {
2621        var d = b[c];
2622        this.sortData[c] = d(this.element, this)
2623      }
2624    }
2625  };
2626  var c = b.prototype.destroy;
2627  return b.prototype.destroy = function () {
2628    c.apply(this, arguments), this.css({display: ""})
2629  }, b
2630}), function (a, b) {
2631  "use strict";
2632  "function" == typeof define && define.amd ? define("isotope/js/layout-mode", ["get-size/get-size", "outlayer/outlayer"], b) : "object" == typeof exports ? module.exports = b(require("get-size"), require("outlayer")) : (a.Isotope = a.Isotope || {}, a.Isotope.LayoutMode = b(a.getSize, a.Outlayer))
2633}(window, function (a, b) {
2634  "use strict";
2635
2636  function c(a) {
2637    this.isotope = a, a && (this.options = a.options[this.namespace], this.element = a.element, this.items = a.filteredItems, this.size = a.size)
2638  }
2639
2640  return function () {
2641    function a(a) {
2642      return function () {
2643        return b.prototype[a].apply(this.isotope, arguments)
2644      }
2645    }
2646
2647    for (var d = ["_resetLayout", "_getItemLayoutPosition", "_manageStamp", "_getContainerSize", "_getElementOffset", "needsResizeLayout"], e = 0, f = d.length; f > e; e++) {
2648      var g = d[e];
2649      c.prototype[g] = a(g)
2650    }
2651  }(), c.prototype.needsVerticalResizeLayout = function () {
2652    var b = a(this.isotope.element), c = this.isotope.size && b;
2653    return c && b.innerHeight != this.isotope.size.innerHeight
2654  }, c.prototype._getMeasurement = function () {
2655    this.isotope._getMeasurement.apply(this, arguments)
2656  }, c.prototype.getColumnWidth = function () {
2657    this.getSegmentSize("column", "Width")
2658  }, c.prototype.getRowHeight = function () {
2659    this.getSegmentSize("row", "Height")
2660  }, c.prototype.getSegmentSize = function (a, b) {
2661    var c = a + b, d = "outer" + b;
2662    if (this._getMeasurement(c, d), !this[c]) {
2663      var e = this.getFirstItemSize();
2664      this[c] = e && e[d] || this.isotope.size["inner" + b]
2665    }
2666  }, c.prototype.getFirstItemSize = function () {
2667    var b = this.isotope.filteredItems[0];
2668    return b && b.element && a(b.element)
2669  }, c.prototype.layout = function () {
2670    this.isotope.layout.apply(this.isotope, arguments)
2671  }, c.prototype.getSize = function () {
2672    this.isotope.getSize(), this.size = this.isotope.size
2673  }, c.modes = {}, c.create = function (a, b) {
2674    function d() {
2675      c.apply(this, arguments)
2676    }
2677
2678    return d.prototype = new c, b && (d.options = b), d.prototype.namespace = a, c.modes[a] = d, d
2679  }, c
2680}), function (a, b) {
2681  "use strict";
2682  "function" == typeof define && define.amd ? define("masonry/masonry", ["outlayer/outlayer", "get-size/get-size", "fizzy-ui-utils/utils"], b) : "object" == typeof exports ? module.exports = b(require("outlayer"), require("get-size"), require("fizzy-ui-utils")) : a.Masonry = b(a.Outlayer, a.getSize, a.fizzyUIUtils)
2683}(window, function (a, b, c) {
2684  var d = a.create("masonry");
2685  return d.prototype._resetLayout = function () {
2686    this.getSize(), this._getMeasurement("columnWidth", "outerWidth"), this._getMeasurement("gutter", "outerWidth"), this.measureColumns();
2687    var a = this.cols;
2688    for (this.colYs = []; a--;) this.colYs.push(0);
2689    this.maxY = 0
2690  }, d.prototype.measureColumns = function () {
2691    if (this.getContainerWidth(), !this.columnWidth) {
2692      var a = this.items[0], c = a && a.element;
2693      this.columnWidth = c && b(c).outerWidth || this.containerWidth
2694    }
2695    var d = this.columnWidth += this.gutter, e = this.containerWidth + this.gutter, f = e / d, g = d - e % d,
2696        h = g && 1 > g ? "round" : "floor";
2697    f = Math[h](f), this.cols = Math.max(f, 1)
2698  }, d.prototype.getContainerWidth = function () {
2699    var a = this.options.isFitWidth ? this.element.parentNode : this.element, c = b(a);
2700    this.containerWidth = c && c.innerWidth
2701  }, d.prototype._getItemLayoutPosition = function (a) {
2702    a.getSize();
2703    var b = a.size.outerWidth % this.columnWidth, d = b && 1 > b ? "round" : "ceil",
2704        e = Math[d](a.size.outerWidth / this.columnWidth);
2705    e = Math.min(e, this.cols);
2706    for (var f = this._getColGroup(e), g = Math.min.apply(Math, f), h = c.indexOf(f, g), i = {
2707      x: this.columnWidth * h,
2708      y: g
2709    }, j = g + a.size.outerHeight, k = this.cols + 1 - f.length, l = 0; k > l; l++) this.colYs[h + l] = j;
2710    return i
2711  }, d.prototype._getColGroup = function (a) {
2712    if (2 > a) return this.colYs;
2713    for (var b = [], c = this.cols + 1 - a, d = 0; c > d; d++) {
2714      var e = this.colYs.slice(d, d + a);
2715      b[d] = Math.max.apply(Math, e)
2716    }
2717    return b
2718  }, d.prototype._manageStamp = function (a) {
2719    var c = b(a), d = this._getElementOffset(a), e = this.options.isOriginLeft ? d.left : d.right, f = e + c.outerWidth,
2720        g = Math.floor(e / this.columnWidth);
2721    g = Math.max(0, g);
2722    var h = Math.floor(f / this.columnWidth);
2723    h -= f % this.columnWidth ? 0 : 1, h = Math.min(this.cols - 1, h);
2724    for (var i = (this.options.isOriginTop ? d.top : d.bottom) + c.outerHeight, j = g; h >= j; j++) this.colYs[j] = Math.max(i, this.colYs[j])
2725  }, d.prototype._getContainerSize = function () {
2726    this.maxY = Math.max.apply(Math, this.colYs);
2727    var a = {height: this.maxY};
2728    return this.options.isFitWidth && (a.width = this._getContainerFitWidth()), a
2729  }, d.prototype._getContainerFitWidth = function () {
2730    for (var a = 0, b = this.cols; --b && 0 === this.colYs[b];) a++;
2731    return (this.cols - a) * this.columnWidth - this.gutter
2732  }, d.prototype.needsResizeLayout = function () {
2733    var a = this.containerWidth;
2734    return this.getContainerWidth(), a !== this.containerWidth
2735  }, d
2736}), function (a, b) {
2737  "use strict";
2738  "function" == typeof define && define.amd ? define("isotope/js/layout-modes/masonry", ["../layout-mode", "masonry/masonry"], b) : "object" == typeof exports ? module.exports = b(require("../layout-mode"), require("masonry-layout")) : b(a.Isotope.LayoutMode, a.Masonry)
2739}(window, function (a, b) {
2740  "use strict";
2741
2742  function c(a, b) {
2743    for (var c in b) a[c] = b[c];
2744    return a
2745  }
2746
2747  var d = a.create("masonry"), e = d.prototype._getElementOffset, f = d.prototype.layout,
2748      g = d.prototype._getMeasurement;
2749  c(d.prototype, b.prototype), d.prototype._getElementOffset = e, d.prototype.layout = f, d.prototype._getMeasurement = g;
2750  var h = d.prototype.measureColumns;
2751  d.prototype.measureColumns = function () {
2752    this.items = this.isotope.filteredItems, h.call(this)
2753  };
2754  var i = d.prototype._manageStamp;
2755  return d.prototype._manageStamp = function () {
2756    this.options.isOriginLeft = this.isotope.options.isOriginLeft, this.options.isOriginTop = this.isotope.options.isOriginTop, i.apply(this, arguments)
2757  }, d
2758}), function (a, b) {
2759  "use strict";
2760  "function" == typeof define && define.amd ? define("isotope/js/layout-modes/fit-rows", ["../layout-mode"], b) : "object" == typeof exports ? module.exports = b(require("../layout-mode")) : b(a.Isotope.LayoutMode)
2761}(window, function (a) {
2762  "use strict";
2763  var b = a.create("fitRows");
2764  return b.prototype._resetLayout = function () {
2765    this.x = 0, this.y = 0, this.maxY = 0, this._getMeasurement("gutter", "outerWidth")
2766  }, b.prototype._getItemLayoutPosition = function (a) {
2767    a.getSize();
2768    var b = a.size.outerWidth + this.gutter, c = this.isotope.size.innerWidth + this.gutter;
2769    0 !== this.x && b + this.x > c && (this.x = 0, this.y = this.maxY);
2770    var d = {x: this.x, y: this.y};
2771    return this.maxY = Math.max(this.maxY, this.y + a.size.outerHeight), this.x += b, d
2772  }, b.prototype._getContainerSize = function () {
2773    return {height: this.maxY}
2774  }, b
2775}), function (a, b) {
2776  "use strict";
2777  "function" == typeof define && define.amd ? define("isotope/js/layout-modes/vertical", ["../layout-mode"], b) : "object" == typeof exports ? module.exports = b(require("../layout-mode")) : b(a.Isotope.LayoutMode)
2778}(window, function (a) {
2779  "use strict";
2780  var b = a.create("vertical", {horizontalAlignment: 0});
2781  return b.prototype._resetLayout = function () {
2782    this.y = 0
2783  }, b.prototype._getItemLayoutPosition = function (a) {
2784    a.getSize();
2785    var b = (this.isotope.size.innerWidth - a.size.outerWidth) * this.options.horizontalAlignment, c = this.y;
2786    return this.y += a.size.outerHeight, {x: b, y: c}
2787  }, b.prototype._getContainerSize = function () {
2788    return {height: this.y}
2789  }, b
2790}), function (a, b) {
2791  "use strict";
2792  "function" == typeof define && define.amd ? define(["outlayer/outlayer", "get-size/get-size", "matches-selector/matches-selector", "fizzy-ui-utils/utils", "isotope/js/item", "isotope/js/layout-mode", "isotope/js/layout-modes/masonry", "isotope/js/layout-modes/fit-rows", "isotope/js/layout-modes/vertical"], function (c, d, e, f, g, h) {
2793    return b(a, c, d, e, f, g, h)
2794  }) : "object" == typeof exports ? module.exports = b(a, require("outlayer"), require("get-size"), require("desandro-matches-selector"), require("fizzy-ui-utils"), require("./item"), require("./layout-mode"), require("./layout-modes/masonry"), require("./layout-modes/fit-rows"), require("./layout-modes/vertical")) : a.Isotope = b(a, a.Outlayer, a.getSize, a.matchesSelector, a.fizzyUIUtils, a.Isotope.Item, a.Isotope.LayoutMode)
2795}(window, function (a, b, c, d, e, f, g) {
2796  function h(a, b) {
2797    return function (c, d) {
2798      for (var e = 0, f = a.length; f > e; e++) {
2799        var g = a[e], h = c.sortData[g], i = d.sortData[g];
2800        if (h > i || i > h) {
2801          var j = void 0 !== b[g] ? b[g] : b, k = j ? 1 : -1;
2802          return (h > i ? 1 : -1) * k
2803        }
2804      }
2805      return 0
2806    }
2807  }
2808
2809  var i = a.jQuery, j = String.prototype.trim ? function (a) {
2810    return a.trim()
2811  } : function (a) {
2812    return a.replace(/^\s+|\s+$/g, "")
2813  }, k = document.documentElement, l = k.textContent ? function (a) {
2814    return a.textContent
2815  } : function (a) {
2816    return a.innerText
2817  }, m = b.create("isotope", {layoutMode: "masonry", isJQueryFiltering: !0, sortAscending: !0});
2818  m.Item = f, m.LayoutMode = g, m.prototype._create = function () {
2819    this.itemGUID = 0, this._sorters = {}, this._getSorters(), b.prototype._create.call(this), this.modes = {}, this.filteredItems = this.items, this.sortHistory = ["original-order"];
2820    for (var a in g.modes) this._initLayoutMode(a)
2821  }, m.prototype.reloadItems = function () {
2822    this.itemGUID = 0, b.prototype.reloadItems.call(this)
2823  }, m.prototype._itemize = function () {
2824    for (var a = b.prototype._itemize.apply(this, arguments), c = 0, d = a.length; d > c; c++) {
2825      var e = a[c];
2826      e.id = this.itemGUID++
2827    }
2828    return this._updateItemsSortData(a), a
2829  }, m.prototype._initLayoutMode = function (a) {
2830    var b = g.modes[a], c = this.options[a] || {};
2831    this.options[a] = b.options ? e.extend(b.options, c) : c, this.modes[a] = new b(this)
2832  }, m.prototype.layout = function () {
2833    return !this._isLayoutInited && this.options.isInitLayout ? void this.arrange() : void this._layout()
2834  }, m.prototype._layout = function () {
2835    var a = this._getIsInstant();
2836    this._resetLayout(), this._manageStamps(), this.layoutItems(this.filteredItems, a), this._isLayoutInited = !0
2837  }, m.prototype.arrange = function (a) {
2838    function b() {
2839      d.reveal(c.needReveal), d.hide(c.needHide)
2840    }
2841
2842    this.option(a), this._getIsInstant();
2843    var c = this._filter(this.items);
2844    this.filteredItems = c.matches;
2845    var d = this;
2846    this._bindArrangeComplete(), this._isInstant ? this._noTransition(b) : b(), this._sort(), this._layout()
2847  }, m.prototype._init = m.prototype.arrange, m.prototype._getIsInstant = function () {
2848    var a = void 0 !== this.options.isLayoutInstant ? this.options.isLayoutInstant : !this._isLayoutInited;
2849    return this._isInstant = a, a
2850  }, m.prototype._bindArrangeComplete = function () {
2851    function a() {
2852      b && c && d && e.dispatchEvent("arrangeComplete", null, [e.filteredItems])
2853    }
2854
2855    var b, c, d, e = this;
2856    this.once("layoutComplete", function () {
2857      b = !0, a()
2858    }), this.once("hideComplete", function () {
2859      c = !0, a()
2860    }), this.once("revealComplete", function () {
2861      d = !0, a()
2862    })
2863  }, m.prototype._filter = function (a) {
2864    var b = this.options.filter;
2865    b = b || "*";
2866    for (var c = [], d = [], e = [], f = this._getFilterTest(b), g = 0, h = a.length; h > g; g++) {
2867      var i = a[g];
2868      if (!i.isIgnored) {
2869        var j = f(i);
2870        j && c.push(i), j && i.isHidden ? d.push(i) : j || i.isHidden || e.push(i)
2871      }
2872    }
2873    return {matches: c, needReveal: d, needHide: e}
2874  }, m.prototype._getFilterTest = function (a) {
2875    return i && this.options.isJQueryFiltering ? function (b) {
2876      return i(b.element).is(a)
2877    } : "function" == typeof a ? function (b) {
2878      return a(b.element)
2879    } : function (b) {
2880      return d(b.element, a)
2881    }
2882  }, m.prototype.updateSortData = function (a) {
2883    var b;
2884    a ? (a = e.makeArray(a), b = this.getItems(a)) : b = this.items, this._getSorters(), this._updateItemsSortData(b)
2885  }, m.prototype._getSorters = function () {
2886    var a = this.options.getSortData;
2887    for (var b in a) {
2888      var c = a[b];
2889      this._sorters[b] = n(c)
2890    }
2891  }, m.prototype._updateItemsSortData = function (a) {
2892    for (var b = a && a.length, c = 0; b && b > c; c++) {
2893      var d = a[c];
2894      d.updateSortData()
2895    }
2896  };
2897  var n = function () {
2898    function a(a) {
2899      if ("string" != typeof a) return a;
2900      var c = j(a).split(" "), d = c[0], e = d.match(/^\[(.+)\]$/), f = e && e[1], g = b(f, d),
2901          h = m.sortDataParsers[c[1]];
2902      return a = h ? function (a) {
2903        return a && h(g(a))
2904      } : function (a) {
2905        return a && g(a)
2906      }
2907    }
2908
2909    function b(a, b) {
2910      var c;
2911      return c = a ? function (b) {
2912        return b.getAttribute(a)
2913      } : function (a) {
2914        var c = a.querySelector(b);
2915        return c && l(c)
2916      }
2917    }
2918
2919    return a
2920  }();
2921  m.sortDataParsers = {
2922    parseInt: function (a) {
2923      return parseInt(a, 10)
2924    }, parseFloat: function (a) {
2925      return parseFloat(a)
2926    }
2927  }, m.prototype._sort = function () {
2928    var a = this.options.sortBy;
2929    if (a) {
2930      var b = [].concat.apply(a, this.sortHistory), c = h(b, this.options.sortAscending);
2931      this.filteredItems.sort(c), a != this.sortHistory[0] && this.sortHistory.unshift(a)
2932    }
2933  }, m.prototype._mode = function () {
2934    var a = this.options.layoutMode, b = this.modes[a];
2935    if (!b) throw new Error("No layout mode: " + a);
2936    return b.options = this.options[a], b
2937  }, m.prototype._resetLayout = function () {
2938    b.prototype._resetLayout.call(this), this._mode()._resetLayout()
2939  }, m.prototype._getItemLayoutPosition = function (a) {
2940    return this._mode()._getItemLayoutPosition(a)
2941  }, m.prototype._manageStamp = function (a) {
2942    this._mode()._manageStamp(a)
2943  }, m.prototype._getContainerSize = function () {
2944    return this._mode()._getContainerSize()
2945  }, m.prototype.needsResizeLayout = function () {
2946    return this._mode().needsResizeLayout()
2947  }, m.prototype.appended = function (a) {
2948    var b = this.addItems(a);
2949    if (b.length) {
2950      var c = this._filterRevealAdded(b);
2951      this.filteredItems = this.filteredItems.concat(c)
2952    }
2953  }, m.prototype.prepended = function (a) {
2954    var b = this._itemize(a);
2955    if (b.length) {
2956      this._resetLayout(), this._manageStamps();
2957      var c = this._filterRevealAdded(b);
2958      this.layoutItems(this.filteredItems), this.filteredItems = c.c
2958oncat(this.filteredItems), this.items = b.concat(this.items)
2959    }
2960  }, m.prototype._filterRevealAdded = function (a) {
2961    var b = this._filter(a);
2962    return this.hide(b.needHide), this.reveal(b.matches), this.layoutItems(b.matches, !0), b.matches
2963  }, m.prototype.insert = function (a) {
2964    var b = this.addItems(a);
2965    if (b.length) {
2966      var c, d, e = b.length;
2967      for (c = 0; e > c; c++) d = b[c], this.element.appendChild(d.element);
2968      var f = this._filter(b).matches;
2969      for (c = 0; e > c; c++) b[c].isLayoutInstant = !0;
2970      for (this.arrange(), c = 0; e > c; c++) delete b[c].isLayoutInstant;
2971      this.reveal(f)
2972    }
2973  };
2974  var o = m.prototype.remove;
2975  return m.prototype.remove = function (a) {
2976    a = e.makeArray(a);
2977    var b = this.getItems(a);
2978    o.call(this, a);
2979    var c = b && b.length;
2980    if (c) for (var d = 0; c > d; d++) {
2981      var f = b[d];
2982      e.removeFrom(this.filteredItems, f)
2983    }
2984  }, m.prototype.shuffle = function () {
2985    for (var a = 0, b = this.items.length; b > a; a++) {
2986      var c = this.items[a];
2987      c.sortData.random = Math.random()
2988    }
2989    this.options.sortBy = "random", this._sort(), this._layout()
2990  }, m.prototype._noTransition = function (a) {
2991    var b = this.options.transitionDuration;
2992    this.options.transitionDuration = 0;
2993    var c = a.call(this);
2994    return this.options.transitionDuration = b, c
2995  }, m.prototype.getFilteredItemElements = function () {
2996    for (var a = [], b = 0, c = this.filteredItems.length; c > b; b++) a.push(this.filteredItems[b].element);
2997    return a
2998  }, m
2999});
3000
3001/*! device.js 0.2.7 /
3002 (function(){var a,b,c,d,e,f,g,h,i,j;b=window.device,a={},window.device=a,d=window.document.documentElement,j=window.navigator.userAgent.toLowerCase(),a.ios=function(){return a.iphone()||a.ipod()||a.ipad()},a.iphone=function(){return!a.windows()&&e("iphone")},a.ipod=function(){return e("ipod")},a.ipad=function(){return e("ipad")},a.android=function(){return!a.windows()&&e("android")},a.androidPhone=function(){return a.android()&&e("mobile")},a.androidTablet=function(){return a.android()&&!e("mobile")},a.blackberry=function(){return e("blackberry")||e("bb10")||e("rim")},a.blackberryPhone=function(){return a.blackberry()&&!e("tablet")},a.blackberryTablet=function(){return a.blackberry()&&e("tablet")},a.windows=function(){return e("windows")},a.windowsPhone=function(){return a.windows()&&e("phone")},a.windowsTablet=function(){return a.windows()&&e("touch")&&!a.windowsPhone()},a.fxos=function(){return(e("(mobile;")||e("(tablet;"))&&e("; rv:")},a.fxosPhone=function(){return a.fxos()&&e("mobile")},a.fxosTablet=function(){return a.fxos()&&e("tablet")},a.meego=function(){return e("meego")},a.cordova=function(){return window.cordova&&"file:"===location.protocol},a.nodeWebkit=function(){return"object"==typeof window.process},a.mobile=function(){return a.androidPhone()||a.iphone()||a.ipod()||a.windowsPhone()||a.blackberryPhone()||a.fxosPhone()||a.meego()},a.tablet=function(){return a.ipad()||a.androidTablet()||a.blackberryTablet()||a.windowsTablet()||a.fxosTablet()},a.desktop=function(){return!a.tablet()&&!a.mobile()},a.television=function(){var a;for(television=["googletv","viera","smarttv","internet.tv","netcast","nettv","appletv","boxee","kylo","roku","dlnadoc","roku","pov_tv","hbbtv","ce-html"],a=0;a<television.length;){if(e(television[a]))return!0;a++}return!1},a.portrait=function(){return window.innerHeight/window.innerWidth>1},a.landscape=function(){return window.innerHeight/window.innerWidth<1},a.noConflict=function(){return window.device=b,this},e=function(a){return-1!==j.indexOf(a)},g=function(a){var b;return b=new RegExp(a,"i"),d.className.match(b)},c=function(a){var b=null;g(a)||(b=d.className.replace(/^\s+|\s+$/g,""),d.className=b+" "+a)},i=function(a){g(a)&&(d.className=d.className.replace(" "+a,""))},a.ios()?a.ipad()?c("ios ipad tablet"):a.iphone()?c("ios iphone mobile"):a.ipod()&&c("ios ipod mobile"):a.android()?c(a.androidTablet()?"android tablet":"android mobile"):a.blackberry()?c(a.blackberryTablet()?"blackberry tablet":"blackberry mobile"):a.windows()?c(a.windowsTablet()?"windows tablet":a.windowsPhone()?"windows mobile":"desktop"):a.fxos()?c(a.fxosTablet()?"fxos tablet":"fxos mobile"):a.meego()?c("meego mobile"):a.nodeWebkit()?c("node-webkit"):a.television()?c("television"):a.desktop()&&c("desktop"),a.cordova()&&c("cordova"),f=function(){a.landscape()?(i("portrait"),c("landscape")):(i("landscape"),c("portrait"))},h=Object.prototype.hasOwnProperty.call(window,"onorientationchange")?"orientationchange":"resize",window.addEventListener?window.addEventListener(h,f,!1):window.attachEvent?window.attachEvent(h,f):window[h]=f,f(),"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return a}):"undefined"!=typeof module&&module.exports?module.exports=a:window.device=a}).call(this);
3003 */
3004
3005/*! jQuery Mobile v1.4.5 | Copyright 2010, 2014 jQuery Foundation, Inc. | jquery.org/license */
3006/*! ONLY TOUCH EVENTS */
3007(function (e, t, n) {
3008  typeof define == "function" && define.amd ? define(["jquery"], function (r) {
3009    return n(r, e, t), r.mobile
3010  }) : n(e.jQuery, e, t)
3011})(this, document, function (e, t, n, r) {
3012  (function (e, t, n, r) {
3013    function T(e) {
3014      while (e && typeof e.originalEvent != "undefined") e = e.originalEvent;
3015      return e
3016    }
3017
3018    function N(t, n) {
3019      var i = t.type, s, o, a, l, c, h, p, d, v;
3020      t = e.Event(t), t.type = n, s = t.originalEvent, o = e.event.props, i.search(/^(mouse|click)/) > -1 && (o = f);
3021      if (s) for (p = o.length, l; p;) l = o[--p], t[l] = s[l];
3022      i.search(/mouse(down|up)|click/) > -1 && !t.which && (t.which = 1);
3023      if (i.search(/^touch/) !== -1) {
3024        a = T(s), i = a.touches, c = a.changedTouches, h = i && i.length ? i[0] : c && c.length ? c[0] : r;
3025        if (h) for (d = 0, v = u.length; d < v; d++) l = u[d], t[l] = h[l]
3026      }
3027      return t
3028    }
3029
3030    function C(t) {
3031      var n = {}, r, s;
3032      while (t) {
3033        r = e.data(t, i);
3034        for (s in r) r[s] && (n[s] = n.hasVirtualBinding = !0);
3035        t = t.parentNode
3036      }
3037      return n
3038    }
3039
3040    function k(t, n) {
3041      var r;
3042      while (t) {
3043        r = e.data(t, i);
3044        if (r && (!n || r[n])) return t;
3045        t = t.parentNode
3046      }
3047      return null
3048    }
3049
3050    function L() {
3051      g = !1
3052    }
3053
3054    function A() {
3055      g = !0
3056    }
3057
3058    function O() {
3059      E = 0, v.length = 0, m = !1, A()
3060    }
3061
3062    function M() {
3063      L()
3064    }
3065
3066    function _() {
3067      D(), c = setTimeout(function () {
3068        c = 0, O()
3069      }, e.vmouse.resetTimerDuration)
3070    }
3071
3072    function D() {
3073      c && (clearTimeout(c), c = 0)
3074    }
3075
3076    function P(t, n, r) {
3077      var i;
3078      if (r && r[t] || !r && k(n.target, t)) i = N(n, t), e(n.target).trigger(i);
3079      return i
3080    }
3081
3082    function H(t) {
3083      var n = e.data(t.target, s), r;
3084      !m && (!E || E !== n) && (r = P("v" + t.type, t), r && (r.isDefaultPrevented() && t.preventDefault(), r.isPropagationStopped() && t.stopPropagation(), r.isImmediatePropagationStopped() && t.stopImmediatePropagation()))
3085    }
3086
3087    function B(t) {
3088      var n = T(t).touches, r, i, o;
3089      n && n.length === 1 && (r = t.target, i = C(r), i.hasVirtualBinding && (E = w++, e.data(r, s, E), D(), M(), d = !1, o = T(t).touches[0], h = o.pageX, p = o.pageY, P("vmouseover", t, i), P("vmousedown", t, i)))
3090    }
3091
3092    function j(e) {
3093      if (g) return;
3094      d || P("vmousecancel", e, C(e.target)), d = !0, _()
3095    }
3096
3097    function F(t) {
3098      if (g) return;
3099      var n = T(t).touches[0], r = d, i = e.vmouse.moveDistanceThreshold, s = C(t.target);
vendor: 7,388 bytes, lines 3100-3258
3100      d = d || Math.abs(n.pageX - h) > i || Math.abs(n.pageY - p) > i, d && !r && P("vmousecancel", t, s), P("vmousemove", t, s), _()
3101    }
3102
3103    function I(e) {
3104      if (g) return;
3105      A();
3106      var t = C(e.target), n, r;
3107      P("vmouseup", e, t), d || (n = P("vclick", e, t), n && n.isDefaultPrevented() && (r = T(e).changedTouches[0], v.push({
3108        touchID: E,
3109        x: r.clientX,
3110        y: r.clientY
3111      }), m = !0)), P("vmouseout", e, t), d = !1, _()
3112    }
3113
3114    function q(t) {
3115      var n = e.data(t, i), r;
3116      if (n) for (r in n) if (n[r]) return !0;
3117      return !1
3118    }
3119
3120    function R() {
3121    }
3122
3123    function U(t) {
3124      var n = t.substr(1);
3125      return {
3126        setup: function () {
3127          q(this) || e.data(this, i, {});
3128          var r = e.data(this, i);
3129          r[t] = !0, l[t] = (l[t] || 0) + 1, l[t] === 1 && b.bind(n, H), e(this).bind(n, R), y && (l.touchstart = (l.touchstart || 0) + 1, l.touchstart === 1 && b.bind("touchstart", B).bind("touchend", I).bind("touchmove", F).bind("scroll", j))
3130        }, teardown: function () {
3131          --l[t], l[t] || b.unbind(n, H), y && (--l.touchstart, l.touchstart || b.unbind("touchstart", B).unbind("touchmove", F).unbind("touchend", I).unbind("scroll", j));
3132          var r = e(this), s = e.data(this, i);
3133          s && (s[t] = !1), r.unbind(n, R), q(this) || r.removeData(i)
3134        }
3135      }
3136    }
3137
3138    var i = "virtualMouseBindings", s = "virtualTouchID",
3139        o = "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),
3140        u = "clientX clientY pageX pageY screenX screenY".split(" "),
3141        a = e.event.mouseHooks ? e.event.mouseHooks.props : [], f = e.event.props.concat(a), l = {}, c = 0, h = 0,
3142        p = 0, d = !1, v = [], m = !1, g = !1, y = "addEventListener" in n, b = e(n), w = 1, E = 0, S, x;
3143    e.vmouse = {moveDistanceThreshold: 10, clickDistanceThreshold: 10, resetTimerDuration: 1500};
3144    for (x = 0; x < o.length; x++) e.event.special[o[x]] = U(o[x]);
3145    y && n.addEventListener("click", function (t) {
3146      var n = v.length, r = t.target, i, o, u, a, f, l;
3147      if (n) {
3148        i = t.clientX, o = t.clientY, S = e.vmouse.clickDistanceThreshold, u = r;
3149        while (u) {
3150          for (a = 0; a < n; a++) {
3151            f = v[a], l = 0;
3152            if (u === r && Math.abs(f.x - i) < S && Math.abs(f.y - o) < S || e.data(u, s) === f.touchID) {
3153              t.preventDefault(), t.stopPropagation();
3154              return
3155            }
3156          }
3157          u = u.parentNode
3158        }
3159      }
3160    }, !0)
3161  })(e, t, n), function (e) {
3162    e.mobile = {}
3163  }(e), function (e, t) {
3164    var r = {touch: "ontouchend" in n};
3165    e.mobile.support = e.mobile.support || {}, e.extend(e.support, r), e.extend(e.mobile.support, r)
3166  }(e), function (e, t, r) {
3167    function l(t, n, i, s) {
3168      var o = i.type;
3169      i.type = n, s ? e.event.trigger(i, r, t) : e.event.dispatch.call(t, i), i.type = o
3170    }
3171
3172    var i = e(n), s = e.mobile.support.touch, o = "touchmove scroll", u = s ? "touchstart" : "mousedown",
3173        a = s ? "touchend" : "mouseup", f = s ? "touchmove" : "mousemove";
3174    e.each("touchstart touchmove touchend tap taphold swipe swipeleft swiperight scrollstart scrollstop".split(" "), function (t, n) {
3175      e.fn[n] = function (e) {
3176        return e ? this.bind(n, e) : this.trigger(n)
3177      }, e.attrFn && (e.attrFn[n] = !0)
3178    }), e.event.special.scrollstart = {
3179      enabled: !0, setup: function () {
3180        function s(e, n) {
3181          r = n, l(t, r ? "scrollstart" : "scrollstop", e)
3182        }
3183
3184        var t = this, n = e(t), r, i;
3185        n.bind(o, function (t) {
3186          if (!e.event.special.scrollstart.enabled) return;
3187          r || s(t, !0), clearTimeout(i), i = setTimeout(function () {
3188            s(t, !1)
3189          }, 50)
3190        })
3191      }, teardown: function () {
3192        e(this).unbind(o)
3193      }
3194    }, e.event.special.tap = {
3195      tapholdThreshold: 750, emitTapOnTaphold: !0, setup: function () {
3196        var t = this, n = e(t), r = !1;
3197        n.bind("vmousedown", function (s) {
3198          function a() {
3199            clearTimeout(u)
3200          }
3201
3202          function f() {
3203            a(), n.unbind("vclick", c).unbind("vmouseup", a), i.unbind("vmousecancel", f)
3204          }
3205
3206          function c(e) {
3207            f(), !r && o === e.target ? l(t, "tap", e) : r && e.preventDefault()
3208          }
3209
3210          r = !1;
3211          if (s.which && s.which !== 1) return !1;
3212          var o = s.target, u;
3213          n.bind("vmouseup", a).bind("vclick", c), i.bind("vmousecancel", f), u = setTimeout(function () {
3214            e.event.special.tap.emitTapOnTaphold || (r = !0), l(t, "taphold", e.Event("taphold", {target: o}))
3215          }, e.event.special.tap.tapholdThreshold)
3216        })
3217      }, teardown: function () {
3218        e(this).unbind("vmousedown").unbind("vclick").unbind("vmouseup"), i.unbind("vmousecancel")
3219      }
3220    }, e.event.special.swipe = {
3221      scrollSupressionThreshold: 30,
3222      durationThreshold: 1e3,
3223      horizontalDistanceThreshold: 30,
3224      verticalDistanceThreshold: 30,
3225      getLocation: function (e) {
3226        var n = t.pageXOffset, r = t.pageYOffset, i = e.clientX, s = e.clientY;
3227        if (e.pageY === 0 && Math.floor(s) > Math.floor(e.pageY) || e.pageX === 0 && Math.floor(i) > Math.floor(e.pageX)) i -= n, s -= r; else if (s < e.pageY - r || i < e.pageX - n) i = e.pageX - n, s = e.pageY - r;
3228        return {x: i, y: s}
3229      },
3230      start: function (t) {
3231        var n = t.originalEvent.touches ? t.originalEvent.touches[0] : t, r = e.event.special.swipe.getLocation(n);
3232        return {time: (new Date).getTime(), coords: [r.x, r.y], origin: e(t.target)}
3233      },
3234      stop: function (t) {
3235        var n = t.originalEvent.touches ? t.originalEvent.touches[0] : t, r = e.event.special.swipe.getLocation(n);
3236        return {time: (new Date).getTime(), coords: [r.x, r.y]}
3237      },
3238      handleSwipe: function (t, n, r, i) {
3239        if (n.time - t.time < e.event.special.swipe.durationThreshold && Math.abs(t.coords[0] - n.coords[0]) > e.event.special.swipe.horizontalDistanceThreshold && Math.abs(t.coords[1] - n.coords[1]) < e.event.special.swipe.verticalDistanceThreshold) {
3240          var s = t.coords[0] > n.coords[0] ? "swipeleft" : "swiperight";
3241          return l(r, "swipe", e.Event("swipe", {
3242            target: i,
3243            swipestart: t,
3244            swipestop: n
3245          }), !0), l(r, s, e.Event(s, {target: i, swipestart: t, swipestop: n}), !0), !0
3246        }
3247        return !1
3248      },
3249      eventInProgress: !1,
3250      setup: function () {
3251        var t, n = this, r = e(n), s = {};
3252        t = e.data(this, "mobile-events"), t || (t = {length: 0}, e.data(this, "mobile-events", t)), t.length++, t.swipe = s, s.start = function (t) {
3253          if (e.event.special.swipe.eventInProgress) return;
3254          e.event.special.swipe.eventInProgress = !0;
3255          var r, o = e.event.special.swipe.start(t), u = t.target, l = !1;
3256          s.move = function (t) {
3257            if (!o || t.isDefaultPrevented()) return;
3258            r = e.event.special.swipe.stop(t), l || (l = e.event.special.swipe.handleSwipe(o, r, n, u), l && (e.event.special.swipe.eventInProgress = !1)), Math.abs(o.coords[0] - r.co
3258ords[0]) > e.event.special.swipe.scrollSupressionThreshold && t.preventDefault()
3259          }, s.stop = function () {
3260            l = !0, e.event.special.swipe.eventInProgress = !1, i.off(f, s.move), s.move = null
3261          }, i.on(f, s.move).one(a, s.stop)
3262        }, r.on(u, s.start)
3263      },
3264      teardown: function () {
3265        var t, n;
3266        t = e.data(this, "mobile-events"), t && (n = t.swipe, delete t.swipe, t.length--, t.length === 0 && e.removeData(this, "mobile-events")), n && (n.start && e(this).off(u, n.start), n.move && i.off(f, n.move), n.stop && i.off(a, n.stop))
3267      }
3268    }, e.each({
3269      scrollstop: "scrollstart",
3270      taphold: "tap",
3271      swipeleft: "swipe.left",
3272      swiperight: "swipe.right"
3273    }, function (t, n) {
3274      e.event.special[t] = {
3275        setup: function () {
3276          e(this).bind(n, e.noop)
3277        }, teardown: function () {
3278          e(this).unbind(n)
3279        }
3280      }
3281    })
3282  }(e, this)
3283});
3284
3285/**************/
3286
3287if (document.getElementById('hp_video') !== undefined) {
3288  var script = document.createElement("script");
3289  script.type = "text/javascript";
3290  script.onload = function () {
3291  };
3292  document.getElementsByTagName("head")[0].appendChild(script);
3293  script.src = 'https://www.youtube.com/iframe_api';
3294
3295  var player, player_h, slideshow_orig_h;
3296
3297  function onYouTubePlayerAPIReady() {
3298    player = new YT.Player('hp_video', {
3299      videoId: jQuery('#hp_video').attr('data-videoid'),
3300      playerVars: {
3301        controls: 0,
3302        cc_load_policy: 0,
3303        enablejsapi: 1,
3304        fs: 0,
3305        modestbranding: 1,
3306        rel: 0,
3307        showinfo: 0,
3308        iv_load_policy: 3,
3309      },
3310      events: {
3311        'onReady': onPlayerReady,
3312        'onStateChange': onPlayerStateChange
3313      }
3314    });
3315  }
3316
3317  function onPlayerReady(event) {
3318    player.seekTo((typeof (_video_start) !== 'undefined' ? _video_start : 0));
3319    player.pauseVideo();
3320    if (typeof (_video_start) !== 'undefined') {
3321      player.setVolume(0);
3322    }
3323    slideshow_orig_h = $('#main_slideshow').innerHeight();
3324    player_h = $('#video-container').outerHeight(true);
3325  }
3326
3327  function stopVideo() {
3328    $('body').removeClass('playing-video');
3329    $('#booking, .mute_video, .stop_video').removeAttr('style');
3330    $('#booking, .main_slideshow').css('opacity', 1);
3331    $('#main_slideshow').height(slideshow_orig_h);
3332    $('.mute_video').removeClass('mute');
3333    player.seekTo((typeof (_video_start) !== 'undefined' ? _video_start : 0));
3334    player.pauseVideo();
3335    player.setVolume(0);
3336  }
3337
3338  function onPlayerStateChange(event) {
3339    if (event.data === 1) {
3340      if (typeof (_video_start) !== 'undefined') {
3341        var i = 0;
3342        riseVolume = setInterval(function () {
3343          i++;
3344          player.setVolume(i);
3345          if (i >= 100) {
3346            clearInterval(riseVolume);
3347          }
3348        }, 100);
3349      }
3350      if (typeof (_video_end) !== 'undefined') {
3351        var checkTime = setInterval(function () {
3352          if (player.getCurrentTime() >= (_video_end - 12)) {
3353            clearInterval(checkTime);
3354            var i = 100;
3355            if (!$('.mute_video').hasClass('muted')) {
3356              var lowVolume = setInterval(function () {
3357                i--;
3358                player.setVolume(i);
3359                if (i <= 0) {
3360                  clearInterval(lowVolume);
3361                  setTimeout(function () {
3362                    stopVideo();
3363                  }, 1800);
3364                }
3365              }, 100);
3366            } else {
3367              setTimeout(function () {
3368                stopVideo();
3369              }, 11800);
3370            }
3371          }
3372        }, 1000);
3373      }
3374    } else if (event.data === 0) {
3375      stopVideo();
3376    }
3377  }
3378
3379}
3380
3381
3382(function ($) {
3383  var onceScroll = function () {
3384    $(window).off('scroll', onceScroll);
3385    $('#localmeasure iframe').attr('src', $('#localmeasure iframe').data('src'));
3386  };
3387
3388  setTimeout(function () {
3389    $(window).scroll(onceScroll);
3390
3391  }, 500);
3392})(jQuery);
3393
3394(function ($) {
3395  $(document).ready(function () {
3396
3397    if ($('body').hasClass('page-template-template-special-offers') || $('body').hasClass('post-type-archive-offers') || $('body').hasClass('page-template-template-gallery-wp') || $('body').hasClass('single-offers')) {
3398      $('body').addClass('fixed');
3399    }
3400    // Sticky Book button for Restaurant and Special offers
3401    // Restaurant
3402    if ($(document.body).hasClass('page-template-template-restaurant')) {
3403      var bookatable_button = $('#wrapper > .w-container > .right-column a.restaurant_order');
3404      if (bookatable_button.length > 0) {
3405        // Desktop
3406        var newButton = $('<a>', {
3407          href: '#',
3408          class: 'btn meeting_order anchors_table_booking_link',
3409          text: bookatable_button.text()
3410        });
3411        newButton.prependTo('#subnav .subnav .w-container');
3412        newButton.click(function (e) {
3413          e.preventDefault();
3414          bookatable_button.trigger('click');
3415        });
3416
3417        // Mobile
3418        var mobileButton = newButton.clone();
3419        mobileButton.off('click');
3420        mobileButton.attr('class', 'btn mobile_table_booking_link');
3421        mobileButton.appendTo('#container');
3422        $('#book_button').remove();
3423        mobileButton.click(function (e) {
3424          e.preventDefault();
3425          if (bookatable_button.attr('href').match(/^https?:\/\/.+/)) {
3426            window.open(bookatable_button.attr('href'), '_blank');
3427          } else {
3428            $('html,body').stop().animate({
3429              'scrollTop': $('.popin_form').offset().top - $('#header').height()
3430            });
3431          }
3432        });
3433      }
3434    }
3435
3436    // Newsletter
3437    if ($(document.body).hasClass('page-template-template-newsletter')) {
3438      $('#form_news, #form_brand_news').on('click', function () {
3439        if ($('#form_news').is(":checked") || $('#form_brand_news').is(":checked")) {
3440          $('.submit input').attr('disabled', false);
3441        } else {
3442          $('.submit input').attr('disabled', true);
3443        }
3444      });
3445    }
3446
3447    // Offer
3448    if ($(document.body).hasClass('single-offers')) {
3449      var has_booking_form = $('.right-column #bookingform').length > 0;
3450      var custom_button = $('.offer_custom_button a');
3451      var links_to_restaurant_page = $('.offer_restaurant_button_container').length > 0;
3452      var has_custom_button_form = custom_button.length > 0 && custom_button.attr('href') == 'javascript:;';
3453      var has_custom_button_link = custom_button.length > 0 && (!!custom_button.attr('href').match(/^https?:\/\/.+/));
3454      var is_bookable = (has_booking_form || links_to_restaurant_page || has_custom_button_form || has_custom_button_link);
3455      if (is_bookable) {
3456        var book_offer_text = '';
3457        if (has_booking_form) {
3458          book_offer_text = $.trim($('#bookingform > strong:first-child').text());
3459        } else if (links_to_restaurant_page) {
3460          book_offer_text = $.trim($('.offer_restaurant_button_container').find('a').eq(0).text());
3461        } else if (has_custom_button_form || has_custom_button_link) {
3462          book_offer_text = $.trim(custom_button.text());
3463        }
3464        if (book_offer_text == '') {
3465          book_offer_text = 'Book this offer';
3466        }
3467        // Desktop + Mobile (mobile/custom.js moves this to the right place when on mobile)
3468        var newButton = $('<a>', {
3469          href: '#',
3470          id: 'book_button',
3471          text: book_offer_text
3472        });
3473        newButton.insertAfter('#header nav .w-container > ul');
3474        newButton.click(function () {
3475          if (has_booking_form) {
3476            $('html,body').stop().animate({
3477              'scrollTop': $('#bookingform').offset().top - $('#header').height()
3478            });
3479          } else if (links_to_restaurant_page) {
3480            location.href = $('.offer_restaurant_button_container').find('a').eq(0).attr('href');
3481          } else if (has_custom_button_form) {
3482            if ($('html').hasClass('mobile')) {
3483              $('html,body').stop().animate({
3484                'scrollTop': $('.pop_form').offset().top - $('#header').height()
3485              });
3486            } else {
3487              custom_button.trigger('click');
3488            }
3489          } else if (has_custom_button_link) {
3490            window.open(custom_button.attr('href'), '_blank');
3491          }
3492        });
3493      }
3494    }
3495
3496    // Flex Header menu
3497    function resizeNavUl() {
3498      if ($('html').hasClass('mobile')) {
3499        return;
3500      }
3501      var wContainerWidth = $('#header nav > .w-container').width();
3502      var ul = $('#header nav > .w-container > ul');
3503      var bookNow = $('#header nav > .w-container > #book_button');
3504      var isHome = $(document.body).hasClass('home');
3505      var bookNowWidth = 0;
3506      var buttonVisible = !isHome || bookNow.hasClass('shown');
3507      if (!buttonVisible) {
3508        bookNowWidth = 0;
3509      } else {
3510        bookNowWidth = $('#header nav > .w-container > #book_button').outerWidth(true) || 0;
3511      }
3512
3513      ul[buttonVisible ? 'addClass' : 'removeClass']('flex').css('width', wContainerWidth - bookNowWidth - 1);
3514    }
3515
3516    resizeNavUl();
3517    $(window).resize(resizeNavUl);
3518    $(document).on('book_button_alter', resizeNavUl);
3519    //meeting table
3520    if ($('body').hasClass('page-template-template-meeting') || $('body').hasClass('page-template-template-wedding-single')) {
3521      function meetingSelectTable() {
3522        var wraps = $('.section_meeting_table.table');
3523        wraps.each(function () {
3524          var wrap = $(this),
3525              select = wrap.find('.filter_table'),
3526              hiddenClass = 'hidden_on_mobile';
3527
3528          if (select.length > 0 && _is_mobile) {
3529            select.change(function () {
3530              var $this = $(this),
3531                  filter = $this.find(':selected').attr('data-filter-value'),
3532                  cell = wrap.find('.element_to_filter');
3533
3534              cell.addClass(hiddenClass);
3535              wrap.find(filter).removeClass(hiddenClass);
3536
3537            })
3538          }
3539        })
3540      }
3541
3542      meetingSelectTable();
3543    }
3544  });
3545})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.