Guest User

Untitled

a guest
Dec 16th, 2014
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 100.36 KB | None | 0 0
  1. (function($)
  2. {
  3. "use strict";
  4.  
  5. $(document).ready(function()
  6. {
  7. var aviabodyclasses = AviaBrowserDetection('html');
  8.  
  9. $.avia_utilities = $.avia_utilities || {};
  10. if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && 'ontouchstart' in document.documentElement)
  11. {
  12. $.avia_utilities.isMobile = true;
  13. }
  14. else
  15. {
  16. $.avia_utilities.isMobile = false;
  17. }
  18.  
  19.  
  20. //check if user uses IE7 - if yes don't execute the function or the menu will break
  21. if(aviabodyclasses.indexOf("avia-msie-7") == -1) avia_responsive_menu();
  22.  
  23. // decreases header size when user scrolls down
  24. avia_header_size();
  25.  
  26. // set sidebar main menu option
  27. avia_sidebar_menu();
  28.  
  29. //activates the sticky submenu
  30. avia_sticky_submenu();
  31.  
  32. //show scroll top button
  33. avia_scroll_top_fade();
  34.  
  35. //creates search tooltip
  36. new $.AviaTooltip({"class": 'avia-search-tooltip',data: 'avia-search-tooltip', event:'click', position:'bottom', scope: "body", attach:'element'});
  37.  
  38. //creates relate posts tooltip
  39. new $.AviaTooltip({"class": 'avia-related-tooltip', data: 'avia-related-tooltip', scope: ".related_posts, .av-share-box", attach:'element', delay:0});
  40.  
  41. //creates ajax search
  42. new $.AviaAjaxSearch({scope:'#header'});
  43.  
  44. // actiavte portfolio sorting
  45. if($.fn.avia_iso_sort)
  46. $('.grid-sort-container').avia_iso_sort();
  47.  
  48. //activates the mega menu javascript
  49. if($.fn.aviaMegamenu)
  50. $(".main_menu .menu").aviaMegamenu({modify_position:true});
  51.  
  52.  
  53.  
  54.  
  55. $.avia_utilities.avia_ajax_call();
  56.  
  57.  
  58. });
  59.  
  60. $.avia_utilities = $.avia_utilities || {};
  61.  
  62. $.avia_utilities.avia_ajax_call = function(container)
  63. {
  64. if(typeof container == 'undefined'){ container = 'body';};
  65.  
  66.  
  67. $('a.avianolink').on('click', function(e){ e.preventDefault(); });
  68. $('a.aviablank').attr('target', '_blank');
  69.  
  70. //activates the prettyphoto lightbox
  71. $(container).avia_activate_lightbox();
  72.  
  73. //scrollspy for main menu. must be located before smoothscrolling
  74. if($.fn.avia_scrollspy)
  75. {
  76. if(container == 'body')
  77. {
  78. $('body').avia_scrollspy({target:'.main_menu .menu li > a'});
  79. }
  80. else
  81. {
  82. $('body').avia_scrollspy('refresh');
  83. }
  84. }
  85.  
  86. //smooth scrooling
  87. if($.fn.avia_smoothscroll)
  88. $('a[href*=#]', container).avia_smoothscroll(container);
  89.  
  90. avia_small_fixes(container);
  91.  
  92. avia_hover_effect(container);
  93.  
  94. avia_iframe_fix(container);
  95.  
  96. //activate html5 video player
  97. if($.fn.avia_html5_activation && $.fn.mediaelementplayer)
  98. $(".avia_video, .avia_audio", container).avia_html5_activation({ratio:'16:9'});
  99.  
  100. }
  101.  
  102. // -------------------------------------------------------------------------------------------
  103. // Error log helper
  104. // -------------------------------------------------------------------------------------------
  105.  
  106. $.avia_utilities.log = function(text, type, extra)
  107. {
  108. if(typeof console == 'undefined'){return;} if(typeof type == 'undefined'){type = "log"} type = "AVIA-" + type.toUpperCase();
  109. console.log("["+type+"] "+text); if(typeof extra != 'undefined') console.log(extra);
  110. }
  111.  
  112.  
  113.  
  114. // -------------------------------------------------------------------------------------------
  115. // modified SCROLLSPY by bootstrap
  116. // -------------------------------------------------------------------------------------------
  117.  
  118.  
  119. function AviaScrollSpy(element, options)
  120. {
  121. var self = this;
  122.  
  123. var process = $.proxy(self.process, self)
  124. , refresh = $.proxy(self.refresh, self)
  125. , $element = $(element).is('body') ? $(window) : $(element)
  126. , href
  127. self.$body = $('body')
  128. self.$win = $(window)
  129. self.options = $.extend({}, $.fn.avia_scrollspy.defaults, options)
  130. self.selector = (self.options.target
  131. || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
  132. || '')
  133.  
  134. self.activation_true = false;
  135.  
  136. if(self.$body.find(self.selector + "[href*=#]").length)
  137. {
  138. self.$scrollElement = $element.on('scroll.scroll-spy.data-api', process);
  139. self.$win.on('av-height-change', refresh);
  140. self.$body.on('av_resize_finished', refresh);
  141. self.activation_true = true;
  142. self.checkFirst();
  143.  
  144. setTimeout(function()
  145. {
  146. self.refresh()
  147. self.process()
  148.  
  149. },100);
  150. }
  151.  
  152. }
  153.  
  154. AviaScrollSpy.prototype = {
  155.  
  156. constructor: AviaScrollSpy
  157. , checkFirst: function () {
  158.  
  159. var current = window.location.href.split('#')[0],
  160. matching_link = this.$body.find(this.selector + "[href='"+current+"']").attr('href',current+'#top');
  161. }
  162. , refresh: function () {
  163.  
  164. if(!this.activation_true) return;
  165.  
  166. var self = this
  167. , $targets
  168.  
  169. this.offsets = $([])
  170. this.targets = $([])
  171.  
  172. $targets = this.$body
  173. .find(this.selector)
  174. .map(function () {
  175. var $el = $(this)
  176. , href = $el.data('target') || $el.attr('href')
  177. , hash = this.hash
  178. , hash = hash.replace(/\//g, "")
  179. , $href = /^#\w/.test(hash) && $(hash)
  180.  
  181. return ( $href
  182. && $href.length
  183. && [[ $href.position().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]] ) || null
  184. })
  185. .sort(function (a, b) { return a[0] - b[0] })
  186. .each(function () {
  187. self.offsets.push(this[0])
  188. self.targets.push(this[1])
  189. })
  190.  
  191. }
  192.  
  193. , process: function () {
  194.  
  195. if(!this.offsets) return;
  196.  
  197. var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
  198. , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
  199. , maxScroll = scrollHeight - this.$scrollElement.height()
  200. , offsets = this.offsets
  201. , targets = this.targets
  202. , activeTarget = this.activeTarget
  203. , i
  204.  
  205. if (scrollTop >= maxScroll) {
  206. return activeTarget != (i = targets.last()[0])
  207. && this.activate ( i )
  208. }
  209.  
  210. for (i = offsets.length; i--;) {
  211. activeTarget != targets[i]
  212. && scrollTop >= offsets[i]
  213. && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
  214. && this.activate( targets[i] )
  215. }
  216. }
  217.  
  218. , activate: function (target) {
  219. var active
  220. , selector
  221.  
  222. this.activeTarget = target
  223.  
  224. $(this.selector)
  225. .parent('.' + this.options.applyClass)
  226. .removeClass(this.options.applyClass)
  227.  
  228. selector = this.selector
  229. + '[data-target="' + target + '"],'
  230. + this.selector + '[href="' + target + '"]'
  231.  
  232. active = $(selector)
  233. .parent('li')
  234. .addClass(this.options.applyClass)
  235.  
  236. if (active.parent('.sub-menu').length) {
  237. active = active.closest('li.dropdown_ul_available').addClass(this.options.applyClass)
  238. }
  239.  
  240. active.trigger('activate')
  241. }
  242.  
  243. }
  244.  
  245.  
  246. /* AviaScrollSpy PLUGIN DEFINITION
  247. * =========================== */
  248.  
  249. $.fn.avia_scrollspy = function (option) {
  250. return this.each(function () {
  251. var $this = $(this)
  252. , data = $this.data('scrollspy')
  253. , options = typeof option == 'object' && option
  254. if (!data) $this.data('scrollspy', (data = new AviaScrollSpy(this, options)))
  255. if (typeof option == 'string') data[option]()
  256. })
  257. }
  258.  
  259. $.fn.avia_scrollspy.Constructor = AviaScrollSpy
  260.  
  261. $.fn.avia_scrollspy.defaults = {
  262. offset: (parseInt($('.html_header_sticky #main').data('scroll-offset'), 10)) + ($(".html_header_sticky #header_main_alternate").outerHeight()) + ($(".html_header_sticky #header_meta").outerHeight()) + 1 + parseInt($('html').css('margin-top'),10),
  263. applyClass: 'current-menu-item'
  264. }
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271. // -------------------------------------------------------------------------------------------
  272. // detect browser and add class to body
  273. // -------------------------------------------------------------------------------------------
  274.  
  275. function AviaBrowserDetection(outputClassElement)
  276. {
  277. if(typeof($.browser) !== 'undefined')
  278. {
  279. var bodyclass = '';
  280.  
  281. if($.browser.msie){
  282. bodyclass += 'avia-msie';
  283. }else if($.browser.webkit){
  284. bodyclass += 'avia-webkit';
  285. }else if($.browser.mozilla)
  286. {
  287. bodyclass += 'avia-mozilla';
  288. }
  289.  
  290. if($.browser.version) bodyclass += ' ' + bodyclass + '-' + parseInt($.browser.version) + ' ';
  291.  
  292. if($.browser.ipad){
  293. bodyclass += ' avia-ipad ';
  294. }else if($.browser.iphone){
  295. bodyclass += ' avia-iphone ';
  296. }else if($.browser.android){
  297. bodyclass += ' avia-android ';
  298. }else if($.browser.win){
  299. bodyclass += ' avia-windows ';
  300. }else if($.browser.mac){
  301. bodyclass += ' avia-mac ';
  302. }else if($.browser.linux){
  303. bodyclass += ' avia-linux ';
  304. }
  305. }
  306.  
  307. if(outputClassElement) $(outputClassElement).addClass(bodyclass)
  308.  
  309. return bodyclass;
  310. }
  311.  
  312.  
  313.  
  314. // -------------------------------------------------------------------------------------------
  315. // responsive menu function
  316. // -------------------------------------------------------------------------------------------
  317.  
  318. function avia_responsive_menu()
  319. {
  320. var $html = $('html'), win = $(window), header = $('.responsive #header');
  321.  
  322. if(!header.length) return;
  323.  
  324. var menu = header.find('.main_menu ul:eq(0)'),
  325. first_level_items = menu.find('>li').length,
  326. bottom_menu = $('html').is('.html_bottom_nav_header'),
  327. container = $('#wrap_all'),
  328. show_menu_btn = $('#advanced_menu_toggle'),
  329. hide_menu_btn = $('#advanced_menu_hide'),
  330. mobile_advanced = menu.clone().attr({id:"mobile-advanced", "class":""}),
  331. sub_hidden = $html.is('.html_header_mobile_behavior'),
  332. insert_menu = function()
  333. {
  334. if(first_level_items == 0)
  335. {
  336. show_menu_btn.remove();
  337. }
  338. else
  339. {
  340. var after_menu = $('#header .logo');
  341. show_menu_btn.insertAfter(after_menu);
  342. mobile_advanced.find('.noMobile').remove();
  343. mobile_advanced.prependTo(container);
  344. hide_menu_btn.prependTo(container);
  345. }
  346. },
  347. set_height = function()
  348. {
  349. var height = mobile_advanced.outerHeight(true), win_h = win.height();
  350.  
  351. if(height < win_h) height = win_h;
  352. container.css({'height':height});
  353.  
  354. mobile_advanced.css({position:'absolute', 'min-height':win_h});
  355. },
  356. hide_menu = function()
  357. {
  358. container.removeClass('show_mobile_menu');
  359. setTimeout(function(){ container.css({'height':"auto", 'overflow':'hidden', 'minHeight':0}); },600);
  360. return false;
  361. },
  362. autohide = function()
  363. {
  364. if(container.is('.show_mobile_menu') && hide_menu_btn.css('display') == 'none'){ hide_menu(); }
  365. },
  366. show_menu = function()
  367. {
  368. if(container.is('.show_mobile_menu'))
  369. {
  370. hide_menu();
  371. }
  372. else
  373. {
  374. win.scrollTop(0);
  375. container.addClass('show_mobile_menu');
  376. set_height();
  377. }
  378. return false;
  379. };
  380.  
  381.  
  382. $html.on('click', '#mobile-advanced li a, #mobile-advanced .mega_menu_title', function()
  383. {
  384. var current = $(this);
  385.  
  386. //if submenu items are hidden do the toggle
  387. if(sub_hidden)
  388. {
  389. var list_item = current.siblings('ul, .avia_mega_div');
  390. if(list_item.length)
  391. {
  392. if(list_item.hasClass('visible_sublist'))
  393. {
  394. list_item.removeClass('visible_sublist');
  395. }
  396. else
  397. {
  398. list_item.addClass('visible_sublist');
  399. }
  400. set_height();
  401. return false;
  402. }
  403. }
  404.  
  405. //when clicked on anchor link remove the menu so the body can scroll to the anchor
  406. if(current.filter('[href*=#]').length)
  407. {
  408. container.removeClass('show_mobile_menu');
  409. container.css({'height':"auto"});
  410. }
  411.  
  412. });
  413.  
  414.  
  415. show_menu_btn.click(show_menu);
  416. hide_menu_btn.click(hide_menu);
  417. win.on( 'debouncedresize', autohide );
  418. insert_menu();
  419. }
  420.  
  421.  
  422. // -------------------------------------------------------------------------------------------
  423. // html 5 videos
  424. // -------------------------------------------------------------------------------------------
  425. $.fn.avia_html5_activation = function(options)
  426. {
  427. var defaults =
  428. {
  429. ratio: '16:9'
  430. };
  431.  
  432. var options = $.extend(defaults, options),
  433. isMobile = $.avia_utilities.isMobile;
  434.  
  435. // if(isMobile) return;
  436.  
  437. this.each(function()
  438. {
  439. var fv = $(this),
  440. id_to_apply = '#' + fv.attr('id'),
  441. posterImg = fv.attr('poster');
  442.  
  443.  
  444. fv.mediaelementplayer({
  445. // if the <video width> is not specified, this is the default
  446. defaultVideoWidth: 480,
  447. // if the <video height> is not specified, this is the default
  448. defaultVideoHeight: 270,
  449. // if set, overrides <video width>
  450. videoWidth: -1,
  451. // if set, overrides <video height>
  452. videoHeight: -1,
  453. // width of audio player
  454. audioWidth: 400,
  455. // height of audio player
  456. audioHeight: 30,
  457. // initial volume when the player starts
  458. startVolume: 0.8,
  459. // useful for <audio> player loops
  460. loop: false,
  461. // enables Flash and Silverlight to resize to content size
  462. enableAutosize: false,
  463. // the order of controls you want on the control bar (and other plugins below)
  464. features: ['playpause','progress','current','duration','tracks','volume'],
  465. // Hide controls when playing and mouse is not over the video
  466. alwaysShowControls: false,
  467. // force iPad's native controls
  468. iPadUseNativeControls: false,
  469. // force iPhone's native controls
  470. iPhoneUseNativeControls: false,
  471. // force Android's native controls
  472. AndroidUseNativeControls: false,
  473. // forces the hour marker (##:00:00)
  474. alwaysShowHours: false,
  475. // show framecount in timecode (##:00:00:00)
  476. showTimecodeFrameCount: false,
  477. // used when showTimecodeFrameCount is set to true
  478. framesPerSecond: 25,
  479. // turns keyboard support on and off for this instance
  480. enableKeyboard: true,
  481. // when this player starts, it will pause other players
  482. pauseOtherPlayers: false,
  483. poster: posterImg,
  484. success: function (mediaElement, domObject) {
  485.  
  486. setTimeout(function()
  487. {
  488. if (mediaElement.pluginType == 'flash')
  489. {
  490. mediaElement.addEventListener('canplay', function() { fv.trigger('av-mediajs-loaded'); }, false);
  491. }
  492. else
  493. {
  494. fv.trigger('av-mediajs-loaded').addClass('av-mediajs-loaded');
  495. }
  496.  
  497. mediaElement.addEventListener('ended', function() { fv.trigger('av-mediajs-ended'); }, false);
  498.  
  499. },10);
  500.  
  501. },
  502. // fires when a problem is detected
  503. error: function () {
  504.  
  505. },
  506.  
  507. // array of keyboard commands
  508. keyActions: []
  509. });
  510.  
  511. });
  512. }
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520. // -------------------------------------------------------------------------------------------
  521. // Smooth scrooling when clicking on anchor links
  522. // todo: maybe use https://github.com/ryanburnette/scrollToBySpeed/blob/master/src/scrolltobyspeed.jquery.js in the future
  523. // -------------------------------------------------------------------------------------------
  524.  
  525. (function($)
  526. {
  527. $.fn.avia_smoothscroll = function(apply_to_container)
  528. {
  529. if(!this.length) return;
  530.  
  531. var the_win = $(window),
  532. $header = $('#header'),
  533. $main = $('.html_header_top.html_header_sticky #main').not('.page-template-template-blank-php #main'),
  534. $meta = $('.html_header_top #header_meta'),
  535. $alt = $('.html_header_top #header_main_alternate'),
  536. shrink = $('.html_header_top.html_header_shrinking').length,
  537. fixedMainPadding = 0,
  538. isMobile = $.avia_utilities.isMobile,
  539. sticky_sub = $('.sticky_placeholder:first'),
  540. calc_main_padding= function()
  541. {
  542. if($header.css('position') == "fixed")
  543. {
  544. var tempPadding = parseInt($main.data('scroll-offset'),10) || 0,
  545. non_shrinking = parseInt($meta.outerHeight(),10) || 0,
  546. non_shrinking2 = parseInt($alt.outerHeight(),10) || 0;
  547.  
  548. if(tempPadding > 0 && shrink)
  549. {
  550. tempPadding = (tempPadding / 2 ) + non_shrinking + non_shrinking2;
  551. }
  552. else
  553. {
  554. tempPadding = tempPadding + non_shrinking + non_shrinking2;
  555. }
  556.  
  557. tempPadding += parseInt($('html').css('margin-top'),10);
  558. fixedMainPadding = tempPadding;
  559. }
  560. else
  561. {
  562. fixedMainPadding = parseInt($('html').css('margin-top'),10);
  563. }
  564.  
  565. };
  566.  
  567. if(isMobile) shrink = false;
  568.  
  569. calc_main_padding();
  570. the_win.on("debouncedresize av-height-change", calc_main_padding);
  571.  
  572. var hash = window.location.hash.replace(/\//g, "");
  573.  
  574. //if a scroll event occurs at pageload and an anchor is set and a coresponding element exists apply the offset to the event
  575. if (fixedMainPadding > 0 && hash && apply_to_container == 'body' && hash.charAt(1) != "!")
  576. {
  577. var scroll_to_el = $(hash), modifier = 0;
  578.  
  579. if(scroll_to_el.length)
  580. {
  581. the_win.on('scroll.avia_first_scroll', function()
  582. {
  583. setTimeout(function(){ //small delay so other scripts can perform necessary resizing
  584. if(sticky_sub.length && scroll_to_el.offset().top > sticky_sub.offset().top) { modifier = sticky_sub.outerHeight() - 3; }
  585. the_win.off('scroll.avia_first_scroll').scrollTop( scroll_to_el.offset().top - fixedMainPadding - modifier);
  586. },10);
  587. });
  588. }
  589. }
  590.  
  591. return this.each(function()
  592. {
  593. $(this).click(function(e) {
  594.  
  595. var newHash = this.hash.replace(/\//g, ""),
  596. clicked = $(this),
  597. data = clicked.data();
  598.  
  599. if(newHash != '' && newHash != '#' && newHash != '#prev' && newHash != '#next' && !clicked.is('.comment-reply-link, #cancel-comment-reply-link, .no-scroll'))
  600. {
  601. var container = "", originHash = "";
  602.  
  603. if("#next-section" == newHash)
  604. {
  605. originHash = newHash;
  606. container = clicked.parents('.container_wrap:eq(0)').nextAll('.container_wrap:eq(0)');
  607. newHash = '#' + container.attr('id') ;
  608. }
  609. else
  610. {
  611. container = $(this.hash.replace(/\//g, ""));
  612. }
  613.  
  614.  
  615.  
  616. if(container.length)
  617. {
  618. var cur_offset = the_win.scrollTop(),
  619. container_offset = container.offset().top,
  620. target = container_offset - fixedMainPadding,
  621. hash = window.location.hash,
  622. hash = hash.replace(/\//g, ""),
  623. oldLocation=window.location.href.replace(hash, ''),
  624. newLocation=this,
  625. duration= data.duration || 1200,
  626. easing= data.easing || 'easeInOutQuint';
  627.  
  628. if(sticky_sub.length && container_offset > sticky_sub.offset().top) { target -= sticky_sub.outerHeight() - 3;}
  629.  
  630. // make sure it's the same location
  631. if(oldLocation+newHash==newLocation || originHash)
  632. {
  633. if(cur_offset != target) // if current pos and target are the same dont scroll
  634. {
  635. if(!(cur_offset == 0 && target <= 0 )) // if we are at the top dont try to scroll to top or above
  636. {
  637. // animate to target and set the hash to the window.location after the animation
  638. $('html:not(:animated),body:not(:animated)').animate({ scrollTop: target }, duration, easing, function() {
  639.  
  640. // add new hash to the browser location
  641. //window.location.href=newLocation;
  642. if(window.history.replaceState)
  643. window.history.replaceState("", "", newHash);
  644. });
  645. }
  646. }
  647. // cancel default click action
  648. e.preventDefault();
  649. }
  650. }
  651. }
  652. });
  653. });
  654. };
  655. })(jQuery);
  656.  
  657.  
  658. // -------------------------------------------------------------------------------------------
  659. // iframe fix for firefox and ie so they get proper z index
  660. // -------------------------------------------------------------------------------------------
  661. function avia_iframe_fix(container)
  662. {
  663. var iframe = jQuery('iframe[src*="youtube.com"]:not(.av_youtube_frame)', container),
  664. youtubeEmbed = jQuery('iframe[src*="youtube.com"]:not(.av_youtube_frame) object, iframe[src*="youtube.com"]:not(.av_youtube_frame) embed', container).attr('wmode','opaque');
  665.  
  666. iframe.each(function()
  667. {
  668. var current = jQuery(this),
  669. src = current.attr('src');
  670.  
  671. if(src)
  672. {
  673. if(src.indexOf('?') !== -1)
  674. {
  675. src += "&wmode=opaque";
  676. }
  677. else
  678. {
  679. src += "?wmode=opaque";
  680. }
  681.  
  682. current.attr('src', src);
  683. }
  684. });
  685. }
  686.  
  687. // -------------------------------------------------------------------------------------------
  688. // small js fixes for pixel perfection :)
  689. // -------------------------------------------------------------------------------------------
  690. function avia_small_fixes(container)
  691. {
  692. if(!container) container = document;
  693.  
  694. //make sure that iframes do resize correctly. uses css padding bottom iframe trick
  695. var win = jQuery(window),
  696. iframes = jQuery('.avia-iframe-wrap iframe:not(.avia-slideshow iframe):not( iframe.no_resize):not(.avia-video iframe)', container),
  697. adjust_iframes = function()
  698. {
  699. iframes.each(function(){
  700.  
  701. var iframe = jQuery(this), parent = iframe.parent(), proportions = 56.25;
  702.  
  703. if(this.width && this.height)
  704. {
  705. proportions = (100/ this.width) * this.height;
  706. parent.css({"padding-bottom":proportions+"%"});
  707. }
  708. });
  709. };
  710.  
  711. adjust_iframes();
  712.  
  713. }
  714.  
  715. // -------------------------------------------------------------------------------------------
  716. // Ligthbox activation
  717. // -------------------------------------------------------------------------------------------
  718.  
  719. (function($)
  720. {
  721. $.fn.avia_activate_lightbox = function(variables)
  722. {
  723. var defaults = {
  724. groups : ['.avia-gallery', '.isotope', '.post-entry', '.sidebar', '#main'],
  725. autolinkElements: 'a[rel^="prettyPhoto"], a[rel^="lightbox"], a[href$=jpg], a[href$=png], a[href$=gif], a[href$=jpeg], a[href*=".jpg?"], a[href*=".png?"], a[href*=".gif?"], a[href*=".jpeg?"], a[href$=".mov"] , a[href$=".swf"] , a:regex(href, .vimeo\.com/[0-9]) , a[href*="youtube.com/watch"] , a[href*="screenr.com"], a[href*="iframe=true"]',
  726. videoElements : 'a[href$=".mov"] , a[href$=".swf"] , a:regex(href, .vimeo\.com/[0-9]) , a[href*="youtube.com/watch"] , a[href*="screenr.com"], a[href*="iframe=true"]',
  727. exclude : '.noLightbox, .noLightbox a, .fakeLightbox, .lightbox-added',
  728. },
  729.  
  730. options = $.extend({}, defaults, variables),
  731.  
  732. av_popup = {
  733. type: 'image',
  734. mainClass: 'avia-popup mfp-zoom-in',
  735. tLoading: '',
  736. tClose: '',
  737. removalDelay: 300, //delay removal by X to allow out-animation
  738. closeBtnInside: true,
  739. closeOnContentClick:true,
  740. midClick: true,
  741. fixedContentPos: false, // allows scrolling when lightbox is open but also removes any jumping because of scrollbar removal
  742.  
  743. image: {
  744. titleSrc: function(item){
  745. var title = item.el.attr('title');
  746. if(!title) title = item.el.find('img').attr('title');
  747. if(typeof title == "undefined") return "";
  748. return title;
  749. }
  750. },
  751.  
  752. gallery: {
  753. // delegate: options.autolinkElements,
  754. tPrev: '',
  755. tNext: '',
  756. tCounter: '%curr% / %total%',
  757. enabled: true,
  758. preload: [1,1] // Will preload 1 - before current, and 1 after the current image
  759. },
  760.  
  761. callbacks:
  762. {
  763. open: function()
  764. {
  765. //overwrite default prev + next function. Add timeout for css3 crossfade animation
  766. $.magnificPopup.instance.next = function() {
  767. var self = this;
  768. self.wrap.removeClass('mfp-image-loaded');
  769. setTimeout(function() { $.magnificPopup.proto.next.call(self); }, 120);
  770. }
  771. $.magnificPopup.instance.prev = function() {
  772. var self = this;
  773. self.wrap.removeClass('mfp-image-loaded');
  774. setTimeout(function() { $.magnificPopup.proto.prev.call(self); }, 120);
  775. }
  776. },
  777. imageLoadComplete: function()
  778. {
  779. var self = this;
  780. setTimeout(function() { self.wrap.addClass('mfp-image-loaded'); }, 16);
  781. }
  782. }
  783. },
  784.  
  785. active = !$('html').is('.av-custom-lightbox');
  786.  
  787. if(!active) return this;
  788.  
  789. return this.each(function()
  790. {
  791. var container = $(this),
  792. videos = $(options.videoElements, this).not(options.exclude).addClass('mfp-iframe'), /*necessary class for the correct lightbox markup*/
  793. ajaxed = !container.is('body') && !container.is('.ajax_slide');
  794.  
  795. for (var i = 0; i < options.groups.length; i++)
  796. {
  797. $(options.groups[i]).each(function()
  798. {
  799. var links = $(options.autolinkElements, this);
  800.  
  801. if(ajaxed) links.removeClass('lightbox-added');
  802. links.not(options.exclude).addClass('lightbox-added').magnificPopup(av_popup);
  803. });
  804. }
  805.  
  806. });
  807. }
  808. })(jQuery);
  809.  
  810.  
  811.  
  812. // -------------------------------------------------------------------------------------------
  813. // Avia Menu
  814. // -------------------------------------------------------------------------------------------
  815.  
  816. (function($)
  817. {
  818. $.fn.aviaMegamenu = function(variables)
  819. {
  820. var defaults =
  821. {
  822. modify_position:true,
  823. delay:300
  824. };
  825.  
  826. var options = $.extend(defaults, variables),
  827. win = $(window),
  828. the_main = $('#main .container:first'),
  829. css_block = $("<style type='text/css' id='av-browser-width-mm'></style>").appendTo('head:first'),
  830. calc_dimensions = function()
  831. {
  832. var css = "",
  833. w_12 = Math.round( the_main.width() );
  834.  
  835. css += " #header .three.units{width:" + ( w_12 * 0.25)+ "px;}";
  836. css += " #header .six.units{width:" + ( w_12 * 0.50)+ "px;}";
  837. css += " #header .nine.units{width:" + ( w_12 * 0.75)+ "px;}";
  838. css += " #header .twelve.units{width:" +( w_12 ) + "px;}";
  839.  
  840. //ie8 needs different insert method
  841. try{
  842. css_block.text(css);
  843. }
  844. catch(err){
  845. css_block.remove();
  846. css_block = $("<style type='text/css' id='av-browser-width-mm'>"+css+"</style>").appendTo('head:first');
  847. }
  848.  
  849. };
  850.  
  851. if($('.avia_mega_div').length > 0)
  852. {
  853. win.on( 'debouncedresize', calc_dimensions);
  854. calc_dimensions();
  855. }
  856.  
  857. return this.each(function()
  858. {
  859. var the_html = $('html:first'),
  860. main = $('#main .container:first'),
  861. left_menu = the_html.filter('.html_menu_left, .html_logo_center').length,
  862. isMobile = $.avia_utilities.isMobile,
  863. menu = $(this),
  864. menuItems = menu.find(">li"),
  865. megaItems = menuItems.find(">div").parent().css({overflow:'hidden'}),
  866. menuActive = menu.find('>.current-menu-item>a, >.current_page_item>a'),
  867. dropdownItems = menuItems.find(">ul").parent(),
  868. parentContainer = menu.parent(),
  869. mainMenuParent = menu.parents('.main_menu').eq(0),
  870. parentContainerWidth = parentContainer.width(),
  871. delayCheck = {},
  872. mega_open = [];
  873.  
  874.  
  875. if(!menuActive.length){ menu.find('.current-menu-ancestor:eq(0) a:eq(0), .current_page_ancestor:eq(0) a:eq(0)').parent().addClass('active-parent-item')}
  876. if(!the_html.is('.html_header_top')) { options.modify_position = false; }
  877.  
  878.  
  879. menuItems.on('click' ,'a', function()
  880. {
  881. if(this.href == window.location.href + "#" || this.href == window.location.href + "/#")
  882. return false;
  883. });
  884.  
  885. menuItems.each(function()
  886. {
  887. var item = $(this),
  888. pos = item.position(),
  889. megaDiv = item.find("div:first").css({opacity:0, display:"none"}),
  890. normalDropdown = "";
  891.  
  892. //check if we got a mega menu
  893. if(!megaDiv.length)
  894. {
  895. normalDropdown = item.find(">ul").css({display:"none"});
  896. }
  897.  
  898. //if we got a mega menu or dropdown menu add the arrow beside the menu item
  899. if(megaDiv.length || normalDropdown.length)
  900. {
  901. var link = item.addClass('dropdown_ul_available').find('>a');
  902. link.append('<span class="dropdown_available"></span>');
  903.  
  904. //is a mega menu main item doesnt have a link to click use the default cursor
  905. if(typeof link.attr('href') != 'string' || link.attr('href') == "#"){ link.css('cursor','default').click(function(){return false;}); }
  906. }
  907.  
  908.  
  909. //correct position of mega menus
  910. if(options.modify_position && megaDiv.length)
  911. {
  912. item.one('mouseenter', function(){ calc_offset(item, pos, megaDiv, parentContainerWidth) });
  913. }
  914.  
  915.  
  916.  
  917. });
  918.  
  919.  
  920. function calc_offset(item, pos, megaDiv, parentContainerWidth)
  921. {
  922. if(!left_menu)
  923. {
  924. if(pos.left + megaDiv.width() < parentContainerWidth)
  925. {
  926. megaDiv.css({right: -megaDiv.outerWidth() + item.outerWidth() });
  927. //item.css({position:'static'});
  928. }
  929. else if(pos.left + megaDiv.width() > parentContainerWidth)
  930. {
  931. megaDiv.css({right: -mainMenuParent.outerWidth() + (pos.left + item.outerWidth() ) });
  932. }
  933. }
  934. else
  935. {
  936. if(megaDiv.width() > pos.left + item.outerWidth())
  937. {
  938. megaDiv.css({left: (pos.left* -1)});
  939. }
  940. else if(pos.left + megaDiv.width() > parentContainerWidth)
  941. {
  942. megaDiv.css({left: (megaDiv.width() - pos.left) * -1 });
  943. }
  944. }
  945. }
  946.  
  947. function megaDivShow(i)
  948. {
  949. if(delayCheck[i] == true)
  950. {
  951. var item = megaItems.filter(':eq('+i+')').css({overflow:'visible'}).find("div:first"),
  952. link = megaItems.filter(':eq('+i+')').find("a:first");
  953. mega_open["check"+i] = true;
  954.  
  955. item.stop().css('display','block').animate({opacity:1},300);
  956.  
  957. if(item.length)
  958. {
  959. link.addClass('open-mega-a');
  960. }
  961. }
  962. }
  963.  
  964. function megaDivHide (i)
  965. {
  966. if(delayCheck[i] == false)
  967. {
  968. megaItems.filter(':eq('+i+')').find(">a").removeClass('open-mega-a');
  969.  
  970. var listItem = megaItems.filter(':eq('+i+')'),
  971. item = listItem.find("div:first");
  972.  
  973.  
  974. item.stop().css('display','block').animate({opacity:0},300, function()
  975. {
  976. $(this).css('display','none');
  977. listItem.css({overflow:'hidden'});
  978. mega_open["check"+i] = false;
  979. });
  980. }
  981. }
  982.  
  983. if(isMobile)
  984. {
  985. megaItems.each(function(i){
  986.  
  987. $(this).bind('click', function()
  988. {
  989. if(mega_open["check"+i] != true) return false;
  990. });
  991. });
  992. }
  993.  
  994.  
  995. //bind event for mega menu
  996. megaItems.each(function(i){
  997.  
  998. $(this).hover(
  999.  
  1000. function()
  1001. {
  1002. delayCheck[i] = true;
  1003. setTimeout(function(){megaDivShow(i); },options.delay);
  1004. },
  1005.  
  1006. function()
  1007. {
  1008. delayCheck[i] = false;
  1009. setTimeout(function(){megaDivHide(i); },options.delay);
  1010. }
  1011. );
  1012. });
  1013.  
  1014.  
  1015. // bind events for dropdown menu
  1016. dropdownItems.find('li').andSelf().each(function()
  1017. {
  1018. var currentItem = $(this),
  1019. sublist = currentItem.find('ul:first'),
  1020. showList = false;
  1021.  
  1022. if(sublist.length)
  1023. {
  1024. sublist.css({display:'block', opacity:0, visibility:'hidden'});
  1025. var currentLink = currentItem.find('>a');
  1026.  
  1027. currentLink.bind('mouseenter', function()
  1028. {
  1029. sublist.stop().css({visibility:'visible'}).animate({opacity:1});
  1030. });
  1031.  
  1032. currentItem.bind('mouseleave', function()
  1033. {
  1034. sublist.stop().animate({opacity:0}, function()
  1035. {
  1036. sublist.css({visibility:'hidden'});
  1037. });
  1038. });
  1039.  
  1040. }
  1041.  
  1042. });
  1043.  
  1044. });
  1045. };
  1046. })(jQuery);
  1047.  
  1048.  
  1049.  
  1050.  
  1051. // -------------------------------------------------------------------------------------------
  1052. //Portfolio sorting
  1053. // -------------------------------------------------------------------------------------------
  1054.  
  1055. $.fn.avia_iso_sort = function(options)
  1056. {
  1057. return this.each(function()
  1058. {
  1059. var the_body = $('body'),
  1060. container = $(this),
  1061. portfolio_id = container.data('portfolio-id'),
  1062. parentContainer = container.parents('.entry-content-wrapper, .avia-fullwidth-portfolio'),
  1063. filter = parentContainer.find('.sort_width_container[data-portfolio-id="' + portfolio_id + '"]').find('#js_sort_items').css({visibility:"visible", opacity:0}),
  1064. links = filter.find('a'),
  1065. imgParent = container.find('.grid-image'),
  1066. isoActive = false,
  1067. items = $('.post-entry', container);
  1068.  
  1069. function applyIso()
  1070. {
  1071. container.addClass('isotope_activated').isotope({
  1072. layoutMode : 'fitRows', itemSelector : '.flex_column'
  1073. });
  1074.  
  1075. container.isotope( 'on', 'layoutComplete', function()
  1076. {
  1077. container.css({overflow:'visible'});
  1078. the_body.trigger('av_resize_finished');
  1079. });
  1080.  
  1081. isoActive = true;
  1082. setTimeout(function(){ parentContainer.addClass('avia_sortable_active'); }, 0);
  1083. };
  1084.  
  1085. links.bind('click',function()
  1086. {
  1087. var current = $(this),
  1088. selector = current.data('filter'),
  1089. linktext = current.html(),
  1090. activeCat = parentContainer.find('.av-current-sort-title');
  1091.  
  1092. if(activeCat.length) activeCat.html(linktext);
  1093.  
  1094. links.removeClass('active_sort');
  1095. current.addClass('active_sort');
  1096. container.attr('id', 'grid_id_'+selector);
  1097.  
  1098. parentContainer.find('.open_container .ajax_controlls .avia_close').trigger('click');
  1099. //container.css({overflow:'hidden'})
  1100. container.isotope({ layoutMode : 'fitRows', itemSelector : '.flex_column' , filter: '.'+selector});
  1101.  
  1102. return false;
  1103. });
  1104.  
  1105. // update columnWidth on window resize
  1106. $(window).on( 'debouncedresize', function()
  1107. {
  1108. applyIso();
  1109. });
  1110.  
  1111. $.avia_utilities.preload({container: container, single_callback: function()
  1112. {
  1113. filter.animate({opacity:1}, 400); applyIso();
  1114.  
  1115. //call a second time to for the initial resizing
  1116. setTimeout(function(){ applyIso(); });
  1117.  
  1118. imgParent.css({height:'auto'}).each(function(i)
  1119. {
  1120. var currentLink = $(this);
  1121.  
  1122. setTimeout(function()
  1123. {
  1124. currentLink.animate({opacity:1},1500);
  1125. }, (100 * i));
  1126. });
  1127. }
  1128. });
  1129.  
  1130. });
  1131. };
  1132.  
  1133.  
  1134.  
  1135.  
  1136. function avia_sticky_submenu()
  1137. {
  1138. var win = $(window),
  1139. html = $('html:first'),
  1140. header = $('.html_header_top.html_header_sticky #header'),
  1141. html_margin = parseInt( $('html:first').css('margin-top'), 10),
  1142. setWitdth = $('.html_header_sidebar #main, .boxed #main'),
  1143. menus = $('.av-submenu-container'),
  1144. calc_margin = function()
  1145. {
  1146. html_margin = parseInt( html.css('margin-top'), 10);
  1147. if(!$('.mobile_menu_toggle:visible').length)
  1148. {
  1149. $('.av-open-submenu').removeClass('av-open-submenu');
  1150. }
  1151. },
  1152. calc_values = function()
  1153. {
  1154. var content_width = setWitdth.width();
  1155. html_margin = parseInt( html.css('margin-top'), 10);
  1156. menus.width(content_width);
  1157.  
  1158. },
  1159. check = function(placeholder, no_timeout)
  1160. {
  1161. var menu_pos = this.offset().top,
  1162. top_pos = placeholder.offset().top,
  1163. scrolled = win.scrollTop(),
  1164. modifier = html_margin, fixed = false;
  1165.  
  1166. if(header.length) modifier += header.outerHeight() + parseInt( header.css('margin-top'), 10);
  1167.  
  1168. if(scrolled + modifier > top_pos)
  1169. {
  1170. if(!fixed)
  1171. {
  1172. this.css({top: modifier - 1, position: 'fixed'}); fixed = true
  1173. }
  1174. }
  1175. else
  1176. {
  1177. this.css({top: 'auto', position: 'absolute'}); fixed = false
  1178. }
  1179.  
  1180. },
  1181. toggle = function(e)
  1182. {
  1183. e.preventDefault();
  1184.  
  1185. var clicked = $(this),
  1186. menu = clicked.siblings('.av-subnav-menu');
  1187.  
  1188. if(menu.hasClass('av-open-submenu'))
  1189. {
  1190. menu.removeClass('av-open-submenu');
  1191. }
  1192. else
  1193. {
  1194. menu.addClass('av-open-submenu');
  1195. }
  1196. };
  1197.  
  1198. win.on("debouncedresize av-height-change", calc_margin ); calc_margin();
  1199.  
  1200. if(setWitdth.length)
  1201. {
  1202. win.on("debouncedresize av-height-change", calc_values );
  1203. calc_values();
  1204. }
  1205.  
  1206. $(".av-sticky-submenu").each(function()
  1207. {
  1208. var menu = $(this), placeholder = menu.next('.sticky_placeholder'), mobile_button = menu.find('.mobile_menu_toggle');
  1209. win.on( 'scroll', function(){ window.requestAnimationFrame( $.proxy( check, menu, placeholder) )} );
  1210.  
  1211. if(mobile_button.length)
  1212. {
  1213. mobile_button.on( 'click', toggle );
  1214. }
  1215.  
  1216.  
  1217. });
  1218.  
  1219. html.on('click', '.av-submenu-hidden .av-open-submenu li a', function()
  1220. {
  1221. var current = $(this);
  1222.  
  1223. var list_item = current.siblings('ul, .avia_mega_div');
  1224. if(list_item.length)
  1225. {
  1226. if(list_item.hasClass('av-visible-sublist'))
  1227. {
  1228. list_item.removeClass('av-visible-sublist');
  1229. }
  1230. else
  1231. {
  1232. list_item.addClass('av-visible-sublist');
  1233. }
  1234. return false;
  1235. }
  1236. });
  1237.  
  1238. $('.avia_mobile').on('click', '.av-menu-mobile-disabled li a', function()
  1239. {
  1240. var current = $(this);
  1241. console.log(current);
  1242. var list_item = current.siblings('ul');
  1243. if(list_item.length)
  1244. {
  1245. if(list_item.hasClass('av-visible-mobile-sublist'))
  1246. {
  1247.  
  1248. }
  1249. else
  1250. {
  1251. $('.av-visible-mobile-sublist').removeClass('av-visible-mobile-sublist');
  1252. list_item.addClass('av-visible-mobile-sublist');
  1253. return false;
  1254. }
  1255.  
  1256. }
  1257. });
  1258.  
  1259.  
  1260.  
  1261. }
  1262.  
  1263.  
  1264.  
  1265. function avia_sidebar_menu()
  1266. {
  1267. var win = $(window),
  1268. main = $('#main'),
  1269. sb_header = $('.html_header_sidebar #header_main'),
  1270. sidebar = $('.html_header_sidebar #header.av_conditional_sticky');
  1271.  
  1272. if(!sb_header.length) return;
  1273. // main.css({"min-height":sb_header.outerHeight()});
  1274.  
  1275.  
  1276.  
  1277. if(!sidebar.length) return;
  1278.  
  1279. var innerSidebar = $('#header_main'),
  1280. wrap = $('#wrap_all'),
  1281. subtract = parseInt($('html').css('margin-top'), 10),
  1282. calc_values = function()
  1283. {
  1284. if(innerSidebar.outerHeight() < win.height())
  1285. {
  1286. sidebar.addClass('av_always_sticky');
  1287. }
  1288. else
  1289. {
  1290. sidebar.removeClass('av_always_sticky');
  1291. }
  1292.  
  1293. wrap.css({'min-height': win.height() - subtract});
  1294. };
  1295.  
  1296. calc_values();
  1297. win.on("debouncedresize av-height-change", calc_values);
  1298. }
  1299.  
  1300. function av_change_class($element, change_method, class_name)
  1301. {
  1302. if($element[0].classList)
  1303. {
  1304. if(change_method == "add")
  1305. {
  1306. $element[0].classList.add(class_name);
  1307. }
  1308. else
  1309. {
  1310. $element[0].classList.remove(class_name);
  1311. }
  1312. }
  1313. else
  1314. {
  1315. if(change_method == "add")
  1316. {
  1317. $element.addClass(class_name);
  1318. }
  1319. else
  1320. {
  1321. $element.removeClass(class_name);
  1322. }
  1323. }
  1324. }
  1325.  
  1326.  
  1327.  
  1328. //check if the browser supports element rotation
  1329. function avia_header_size()
  1330. {
  1331. var win = $(window),
  1332. header = $('.html_header_top.html_header_sticky #header');
  1333.  
  1334. if(!header.length) return;
  1335.  
  1336. var logo = $('#header_main .container .logo img, #header_main .container .logo a'),
  1337. elements = $('#header_main .container:first, #header_main .main_menu ul:first-child > li > a:not(.avia_mega_div a, #header_main_alternate a)'),
  1338. el_height = $(elements).filter(':first').height(),
  1339. isMobile = $.avia_utilities.isMobile,
  1340. scroll_top = $('#scroll-top-link'),
  1341. transparent = header.is('.av_header_transparency'),
  1342. shrinking = header.is('.av_header_shrinking'),
  1343. set_height = function()
  1344. {
  1345. var st = win.scrollTop(), newH = 0;
  1346.  
  1347. if(shrinking && !isMobile)
  1348. {
  1349. if(st < el_height/2)
  1350. {
  1351. newH = el_height - st;
  1352.  
  1353. av_change_class(header, 'remove', 'header-scrolled');
  1354. //header.removeClass('header-scrolled');
  1355. }
  1356. else
  1357. {
  1358. newH = el_height/2;
  1359. //header.addClass('header-scrolled');
  1360. av_change_class(header, 'add', 'header-scrolled');
  1361. }
  1362.  
  1363. elements.css({'height': newH + 'px', 'lineHeight': newH + 'px'});
  1364. logo.css({'maxHeight': newH + 'px'});
  1365. }
  1366.  
  1367. if(transparent)
  1368. {
  1369. if(st > 50)
  1370. {
  1371. //header.removeClass('av_header_transparency');
  1372. av_change_class(header, 'remove', 'av_header_transparency');
  1373. }
  1374. else
  1375. {
  1376. //header.addClass('av_header_transparency');
  1377. av_change_class(header, 'add', 'av_header_transparency');
  1378. }
  1379. }
  1380.  
  1381.  
  1382. }
  1383.  
  1384. if($('body').is('.avia_deactivate_menu_resize')) shrinking = false;
  1385.  
  1386. if(!transparent && !shrinking) return;
  1387.  
  1388. win.on( 'debouncedresize', function(){ el_height = $(elements).attr('style',"").filter(':first').height(); set_height(); } );
  1389. win.on( 'scroll', function(){ window.requestAnimationFrame( set_height )} );
  1390. set_height();
  1391. }
  1392.  
  1393.  
  1394. function avia_scroll_top_fade()
  1395. {
  1396. var win = $(window),
  1397. timeo = false,
  1398. scroll_top = $('#scroll-top-link'),
  1399. set_status = function()
  1400. {
  1401. var st = win.scrollTop();
  1402.  
  1403. if(st < 500)
  1404. {
  1405. scroll_top.removeClass('avia_pop_class');
  1406. }
  1407. else if(!scroll_top.is('.avia_pop_class'))
  1408. {
  1409. scroll_top.addClass('avia_pop_class');
  1410. }
  1411. };
  1412.  
  1413. win.on( 'scroll', function(){ window.requestAnimationFrame( set_status )} );
  1414. set_status();
  1415. }
  1416.  
  1417.  
  1418.  
  1419.  
  1420. $.AviaAjaxSearch = function(options)
  1421. {
  1422. var defaults = {
  1423. delay: 300, //delay in ms until the user stops typing.
  1424. minChars: 3, //dont start searching before we got at least that much characters
  1425. scope: 'body'
  1426.  
  1427. }
  1428.  
  1429. this.options = $.extend({}, defaults, options);
  1430. this.scope = $(this.options.scope);
  1431. this.timer = false;
  1432. this.lastVal = "";
  1433.  
  1434. this.bind_events();
  1435. }
  1436.  
  1437.  
  1438. $.AviaAjaxSearch.prototype =
  1439. {
  1440. bind_events: function()
  1441. {
  1442. this.scope.on('keyup', '#s:not(".av_disable_ajax_search #s")' , $.proxy( this.try_search, this));
  1443. },
  1444.  
  1445. try_search: function(e)
  1446. {
  1447. clearTimeout(this.timer);
  1448.  
  1449. //only execute search if chars are at least "minChars" and search differs from last one
  1450. if(e.currentTarget.value.length >= this.options.minChars && this.lastVal != $.trim(e.currentTarget.value))
  1451. {
  1452. //wait at least "delay" miliseconds to execute ajax. if user types again during that time dont execute
  1453. this.timer = setTimeout($.proxy( this.do_search, this, e), this.options.delay);
  1454. }
  1455. },
  1456.  
  1457. do_search: function(e)
  1458. {
  1459. var obj = this,
  1460. currentField = $(e.currentTarget).attr( "autocomplete", "off" ),
  1461. form = currentField.parents('form:eq(0)'),
  1462. results = form.find('.ajax_search_response'),
  1463. loading = $('<div class="ajax_load"><span class="ajax_load_inner"></span></div>'),
  1464. action = form.attr('action'),
  1465. values = form.serialize();
  1466. values += '&action=avia_ajax_search';
  1467.  
  1468. //check if the form got get parameters applied and also apply them
  1469. if(action.indexOf('?') != -1)
  1470. {
  1471. action = action.split('?');
  1472. values += "&" + action[1];
  1473. }
  1474.  
  1475. if(!results.length) results = $('<div class="ajax_search_response"></div>').appendTo(form);
  1476.  
  1477. //return if we already hit a no result and user is still typing
  1478. if(results.find('.ajax_not_found').length && e.currentTarget.value.indexOf(this.lastVal) != -1) return;
  1479.  
  1480. this.lastVal = e.currentTarget.value;
  1481.  
  1482. $.ajax({
  1483. url: avia_framework_globals.ajaxurl,
  1484. type: "POST",
  1485. data:values,
  1486. beforeSend: function()
  1487. {
  1488. loading.insertAfter(currentField);
  1489. },
  1490. success: function(response)
  1491. {
  1492. if(response == 0) response = "";
  1493. results.html(response);
  1494. },
  1495. complete: function()
  1496. {
  1497. loading.remove();
  1498. }
  1499. });
  1500. }
  1501. }
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512. $.AviaTooltip = function(options)
  1513. {
  1514. var defaults = {
  1515. delay: 1500, //delay in ms until the tooltip appears
  1516. delayOut: 300, //delay in ms when instant showing should stop
  1517. delayHide: 0, //delay hiding of tooltip in ms
  1518. "class": "avia-tooltip", //tooltip classname for css styling and alignment
  1519. scope: "body", //area the tooltip should be applied to
  1520. data: "avia-tooltip", //data attribute that contains the tooltip text
  1521. attach:"body", //either attach the tooltip to the "mouse" or to the "element" // todo: implement mouse, make sure that it doesnt overlap with screen borders
  1522. event: 'mouseenter', //mousenter and leave or click and leave
  1523. position:'top', //top or bottom
  1524. extraClass:'avia-tooltip-class' //extra class that is defined by a tooltip element data attribute
  1525. }
  1526.  
  1527. this.options = $.extend({}, defaults, options);
  1528. this.body = $('body');
  1529. this.scope = $(this.options.scope);
  1530. this.tooltip = $('<div class="'+this.options['class']+' avia-tt"><span class="avia-arrow-wrap"><span class="avia-arrow"></span></span></div>');
  1531. this.inner = $('<div class="inner_tooltip"></div>').prependTo(this.tooltip);
  1532. this.open = false;
  1533. this.timer = false;
  1534. this.active = false;
  1535.  
  1536. this.bind_events();
  1537. }
  1538.  
  1539. $.AviaTooltip.openTTs = [];
  1540. $.AviaTooltip.prototype =
  1541. {
  1542. bind_events: function()
  1543. {
  1544. this.scope.on(this.options.event + ' mouseleave', '[data-'+this.options.data+']', $.proxy( this.start_countdown, this) );
  1545.  
  1546. if(this.options.event != 'click')
  1547. {
  1548. this.scope.on('mouseleave', '[data-'+this.options.data+']', $.proxy( this.hide_tooltip, this) );
  1549. }
  1550. else
  1551. {
  1552. this.body.on('mousedown', $.proxy( this.hide_tooltip, this) );
  1553. }
  1554. },
  1555.  
  1556. start_countdown: function(e)
  1557. {
  1558. clearTimeout(this.timer);
  1559.  
  1560. if(e.type == this.options.event)
  1561. {
  1562. var delay = this.options.event == 'click' ? 0 : this.open ? 0 : this.options.delay;
  1563.  
  1564. this.timer = setTimeout($.proxy( this.display_tooltip, this, e), delay);
  1565. }
  1566. else if(e.type == 'mouseleave')
  1567. {
  1568. this.timer = setTimeout($.proxy( this.stop_instant_open, this, e), this.options.delayOut);
  1569. }
  1570. e.preventDefault();
  1571. },
  1572.  
  1573. reset_countdown: function(e)
  1574. {
  1575. clearTimeout(this.timer);
  1576. this.timer = false;
  1577. },
  1578.  
  1579. display_tooltip: function(e)
  1580. {
  1581. var target = this.options.event == "click" ? e.target : e.currentTarget,
  1582. element = $(target),
  1583. text = element.data(this.options.data),
  1584. newTip = element.data('avia-created-tooltip'),
  1585. extraClass = element.data('avia-tooltip-class'),
  1586. attach = this.options.attach == 'element' ? element : this.body,
  1587. offset = this.options.attach == 'element' ? element.position() : element.offset(),
  1588. position = element.data('avia-tooltip-position'),
  1589. align = element.data('avia-tooltip-alignment');
  1590.  
  1591. text = $.trim(text);
  1592.  
  1593. if(text == "") return;
  1594. if(position == "" || typeof position == 'undefined') position = this.options.position;
  1595. if(align == "" || typeof align == 'undefined') align = 'center';
  1596.  
  1597. if(typeof newTip != 'undefined')
  1598. {
  1599. newTip = $.AviaTooltip.openTTs[newTip]
  1600. }
  1601. else
  1602. {
  1603.  
  1604. this.inner.html(text);
  1605.  
  1606. newTip = this.options.attach == 'element' ? this.tooltip.clone().insertAfter(attach) : this.tooltip.clone().appendTo(attach);
  1607. if(extraClass != "") newTip.addClass(extraClass);
  1608. }
  1609.  
  1610. this.open = true;
  1611. this.active = newTip;
  1612.  
  1613. if((newTip.is(':animated:visible') && e.type == 'click') || element.is('.'+this.options['class']) || element.parents('.'+this.options['class']).length != 0) return;
  1614.  
  1615.  
  1616. var animate1 = {}, animate2 = {}, pos1 = "", pos2 = "";
  1617.  
  1618. if(position == "top" ||Β position == "bottom")
  1619. {
  1620. switch(align)
  1621. {
  1622. case "left": pos2 = offset.left; break;
  1623. case "right": pos2 = offset.left + element.outerWidth() - newTip.outerWidth(); break;
  1624. default: pos2 = (offset.left + (element.outerWidth() / 2)) - (newTip.outerWidth() / 2); break;
  1625. }
  1626. }
  1627. else
  1628. {
  1629. switch(align)
  1630. {
  1631. case "top": pos1 = offset.top; break;
  1632. case "bottom": pos1 = offset.top + element.outerHeight() - newTip.outerHeight(); break;
  1633. default: pos1 = (offset.top + (element.outerHeight() / 2)) - (newTip.outerHeight() / 2); break;
  1634. }
  1635. }
  1636.  
  1637. switch(position)
  1638. {
  1639. case "top":
  1640. pos1 = offset.top - newTip.outerHeight();
  1641. animate1 = {top: pos1 - 10, left: pos2};
  1642. animate2 = {top: pos1};
  1643. break;
  1644. case "bottom":
  1645. pos1 = offset.top + element.outerHeight();
  1646. animate1 = {top: pos1 + 10, left: pos2};
  1647. animate2 = {top: pos1};
  1648. break;
  1649. case "left":
  1650. pos2 = offset.left - newTip.outerWidth();
  1651. animate1 = {top: pos1, left: pos2 -10};
  1652. animate2 = {left: pos2};
  1653. break;
  1654. case "right":
  1655. pos2 = offset.left + element.outerWidth();
  1656. animate1 = {top: pos1, left: pos2 + 10};
  1657. animate2 = {left: pos2};
  1658. break;
  1659. }
  1660.  
  1661. animate1['display'] = "block";
  1662. animate1['opacity'] = 0;
  1663. animate2['opacity'] = 1;
  1664.  
  1665.  
  1666. newTip.css(animate1).stop().animate(animate2,200);
  1667. newTip.find('input, textarea').focus();
  1668. $.AviaTooltip.openTTs.push(newTip);
  1669. element.data('avia-created-tooltip', $.AviaTooltip.openTTs.length - 1);
  1670.  
  1671. },
  1672.  
  1673. hide_tooltip: function(e)
  1674. {
  1675. var element = $(e.currentTarget) , newTip, animateTo,
  1676. position = element.data('avia-tooltip-position'),
  1677. align = element.data('avia-tooltip-alignment');
  1678.  
  1679. if(position == "" || typeof position == 'undefined') position = this.options.position;
  1680. if(align == "" || typeof align == 'undefined') align = 'center';
  1681.  
  1682. if(this.options.event == 'click')
  1683. {
  1684. element = $(e.target);
  1685.  
  1686. if(!element.is('.'+this.options['class']) && element.parents('.'+this.options['class']).length == 0)
  1687. {
  1688. if(this.active.length) { newTip = this.active; this.active = false;}
  1689. }
  1690. }
  1691. else
  1692. {
  1693. newTip = element.data('avia-created-tooltip');
  1694. newTip = typeof newTip != 'undefined' ? $.AviaTooltip.openTTs[newTip] : false;
  1695. }
  1696.  
  1697. if(newTip)
  1698. {
  1699. var animate = {opacity:0};
  1700.  
  1701. switch(position)
  1702. {
  1703. case "top":
  1704. animate['top'] = parseInt(newTip.css('top'),10) - 10;
  1705. break;
  1706. case "bottom":
  1707. animate['top'] = parseInt(newTip.css('top'),10) + 10;
  1708. break;
  1709. case "left":
  1710. animate['left'] = parseInt(newTip.css('left'), 10) - 10;
  1711. break;
  1712. case "right":
  1713. animate['left'] = parseInt(newTip.css('left'), 10) + 10;
  1714. break;
  1715. }
  1716.  
  1717. newTip.animate(animate, 200, function()
  1718. {
  1719. newTip.css({display:'none'});
  1720. });
  1721. }
  1722. },
  1723.  
  1724. stop_instant_open: function(e)
  1725. {
  1726. this.open = false;
  1727. }
  1728. }
  1729.  
  1730.  
  1731. })( jQuery );
  1732.  
  1733.  
  1734.  
  1735.  
  1736. /*!
  1737. * Isotope PACKAGED v2.0.0
  1738. * Filter & sort magical layouts
  1739. * http://isotope.metafizzy.co
  1740. */
  1741.  
  1742. (function(t){function e(){}function i(t){function i(e){e.prototype.option||(e.prototype.option=function(e){t.isPlainObject(e)&&(this.options=t.extend(!0,this.options,e))})}function n(e,i){t.fn[e]=function(n){if("string"==typeof n){for(var s=o.call(arguments,1),a=0,u=this.length;u>a;a++){var p=this[a],h=t.data(p,e);if(h)if(t.isFunction(h[n])&&"_"!==n.charAt(0)){var f=h[n].apply(h,s);if(void 0!==f)return f}else r("no such method '"+n+"' for "+e+" instance");else r("cannot call methods on "+e+" prior to initialization; "+"attempted to call '"+n+"'")}return this}return this.each(function(){var o=t.data(this,e);o?(o.option(n),o._init()):(o=new i(this,n),t.data(this,e,o))})}}if(t){var r="undefined"==typeof console?e:function(t){console.error(t)};return t.bridget=function(t,e){i(e),n(t,e)},t.bridget}}var o=Array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],i):i(t.jQuery)})(window),function(t){function e(e){var i=t.event;return i.target=i.target||i.srcElement||e,i}var i=document.documentElement,o=function(){};i.addEventListener?o=function(t,e,i){t.addEventListener(e,i,!1)}:i.attachEvent&&(o=function(t,i,o){t[i+o]=o.handleEvent?function(){var i=e(t);o.handleEvent.call(o,i)}:function(){var i=e(t);o.call(t,i)},t.attachEvent("on"+i,t[i+o])});var n=function(){};i.removeEventListener?n=function(t,e,i){t.removeEventListener(e,i,!1)}:i.detachEvent&&(n=function(t,e,i){t.detachEvent("on"+e,t[e+i]);try{delete t[e+i]}catch(o){t[e+i]=void 0}});var r={bind:o,unbind:n};"function"==typeof define&&define.amd?define("eventie/eventie",r):"object"==typeof exports?module.exports=r:t.eventie=r}(this),function(t){function e(t){"function"==typeof t&&(e.isReady?t():r.push(t))}function i(t){var i="readystatechange"===t.type&&"complete"!==n.readyState;if(!e.isReady&&!i){e.isReady=!0;for(var o=0,s=r.length;s>o;o++){var a=r[o];a()}}}function o(o){return o.bind(n,"DOMContentLoaded",i),o.bind(n,"readystatechange",i),o.bind(t,"load",i),e}var n=t.document,r=[];e.isReady=!1,"function"==typeof define&&define.amd?(e.isReady="function"==typeof requirejs,define("doc-ready/doc-ready",["eventie/eventie"],o)):t.docReady=o(t.eventie)}(this),function(){function t(){}function e(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function i(t){return function(){return this[t].apply(this,arguments)}}var o=t.prototype,n=this,r=n.EventEmitter;o.getListeners=function(t){var e,i,o=this._getEvents();if(t instanceof RegExp){e={};for(i in o)o.hasOwnProperty(i)&&t.test(i)&&(e[i]=o[i])}else e=o[t]||(o[t]=[]);return e},o.flattenListeners=function(t){var e,i=[];for(e=0;t.length>e;e+=1)i.push(t[e].listener);return i},o.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&(e={},e[t]=i),e||i},o.addListener=function(t,i){var o,n=this.getListenersAsObject(t),r="object"==typeof i;for(o in n)n.hasOwnProperty(o)&&-1===e(n[o],i)&&n[o].push(r?i:{listener:i,once:!1});return this},o.on=i("addListener"),o.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},o.once=i("addOnceListener"),o.defineEvent=function(t){return this.getListeners(t),this},o.defineEvents=function(t){for(var e=0;t.length>e;e+=1)this.defineEvent(t[e]);return this},o.removeListener=function(t,i){var o,n,r=this.getListenersAsObject(t);for(n in r)r.hasOwnProperty(n)&&(o=e(r[n],i),-1!==o&&r[n].splice(o,1));return this},o.off=i("removeListener"),o.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},o.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},o.manipulateListeners=function(t,e,i){var o,n,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(o=i.length;o--;)r.call(this,e,i[o]);else for(o in e)e.hasOwnProperty(o)&&(n=e[o])&&("function"==typeof n?r.call(this,o,n):s.call(this,o,n));return this},o.removeEvent=function(t){var e,i=typeof t,o=this._getEvents();if("string"===i)delete o[t];else if(t instanceof RegExp)for(e in o)o.hasOwnProperty(e)&&t.test(e)&&delete o[e];else delete this._events;return this},o.removeAllListeners=i("removeEvent"),o.emitEvent=function(t,e){var i,o,n,r,s=this.getListenersAsObject(t);for(n in s)if(s.hasOwnProperty(n))for(o=s[n].length;o--;)i=s[n][o],i.once===!0&&this.removeListener(t,i.listener),r=i.listener.apply(this,e||[]),r===this._getOnceReturnValue()&&this.removeListener(t,i.listener);return this},o.trigger=i("emitEvent"),o.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},o.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},o._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},o._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return n.EventEmitter=r,t},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return t}):"object"==typeof module&&module.exports?module.exports=t:this.EventEmitter=t}.call(this),function(t){function e(t){if(t){if("string"==typeof o[t])return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e,n=0,r=i.length;r>n;n++)if(e=i[n]+t,"string"==typeof o[e])return e}}var i="Webkit Moz ms Ms O".split(" "),o=document.documentElement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return e}):"object"==typeof exports?module.exports=e:t.getStyleProperty=e}(window),function(t){function e(t){var e=parseFloat(t),i=-1===t.indexOf("%")&&!isNaN(e);return i&&e}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0,i=s.length;i>e;e++){var o=s[e];t[o]=0}return t}function o(t){function o(t){if("string"==typeof t&&(t=document.querySelector(t)),t&&"object"==typeof t&&t.nodeType){var o=r(t);if("none"===o.display)return i();var n={};n.width=t.offsetWidth,n.height=t.offsetHeight;for(var h=n.isBorderBox=!(!p||!o[p]||"border-box"!==o[p]),f=0,c=s.length;c>f;f++){var d=s[f],l=o[d];l=a(t,l);var y=parseFloat(l);n[d]=isNaN(y)?0:y}var m=n.paddingLeft+n.paddingRight,g=n.paddingTop+n.paddingBottom,v=n.marginLeft+n.marginRight,_=n.marginTop+n.marginBottom,I=n.borderLeftWidth+n.borderRightWidth,L=n.borderTopWidth+n.borderBottomWidth,z=h&&u,S=e(o.width);S!==!1&&(n.width=S+(z?0:m+I));var b=e(o.height);return b!==!1&&(n.height=b+(z?0:g+L)),n.innerWidth=n.width-(m+I),n.innerHeight=n.height-(g+L),n.outerWidth=n.width+v,n.outerHeight=n.height+_,n}}function a(t,e){if(n||-1===e.indexOf("%"))return e;var i=t.style,o=i.left,r=t.runtimeStyle,s=r&&r.left;return s&&(r.left=t.currentStyle.left),i.left=e,e=i.pixelLeft,i.left=o,s&&(r.left=s),e}var u,p=t("boxSizing");return function(){if(p){var t=document.createElement("div");t.style.width="200px",t.style.padding="1px 2px 3px 4px",t.style.borderStyle="solid",t.style.borderWidth="1px 2px 3px 4px",t.style[p]="border-box";var i=document.body||document.documentElement;i.appendChild(t);var o=r(t);u=200===e(o.width),i.removeChild(t)}}(),o}var n=t.getComputedStyle,r=n?function(t){return n(t,null)}:function(t){return t.currentStyle},s=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],o):"object"==typeof exports?module.exports=o(require("get-style-property")):t.getSize=o(t.getStyleProperty)}(window),function(t,e){function i(t,e){return t[a](e)}function o(t){if(!t.parentNode){var e=document.createDocumentFragment();e.appendChild(t)}}function n(t,e){o(t);for(var i=t.parentNode.querySelectorAll(e),n=0,r=i.length;r>n;n++)if(i[n]===t)return!0;return!1}function r(t,e){return o(t),i(t,e)}var s,a=function(){if(e.matchesSelector)return"matchesSelector";for(var t=["webkit","moz","ms","o"],i=0,o=t.length;o>i;i++){var n=t[i],r=n+"MatchesSelector";if(e[r])return r}}();if(a){var u=document.createElement("div"),p=i(u,"div");s=p?i:r}else s=n;"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return s}):window.matchesSelector=s}(this,Element.prototype),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){for(var e in t)return!1;return e=null,!0}function o(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}function n(t,n,r){function a(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}var u=r("transition"),p=r("transform"),h=u&&p,f=!!r("perspective"),c={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[u],d=["transform","transition","transitionDuration","transitionProperty"],l=function(){for(var t={},e=0,i=d.length;i>e;e++){var o=d[e],n=r(o);n&&n!==o&&(t[o]=n)}return t}();e(a.prototype,t.prototype),a.prototype._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},a.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},a.prototype.getSize=function(){this.size=n(this.element)},a.prototype.css=function(t){var e=this.element.style;for(var i in t){var o=l[i]||i;e[o]=t[i]}},a.prototype.getPosition=function(){var t=s(this.element),e=this.layout.options,i=e.isOriginLeft,o=e.isOriginTop,n=parseInt(t[i?"left":"right"],10),r=parseInt(t[o?"top":"bottom"],10);n=isNaN(n)?0:n,r=isNaN(r)?0:r;var a=this.layout.size;n-=i?a.paddingLeft:a.paddingRight,r-=o?a.paddingTop:a.paddingBottom,this.position.x=n,this.position.y=r},a.prototype.layoutPosition=function(){var t=this.layout.size,e=this.layout.options,i={};e.isOriginLeft?(i.left=this.position.x+t.paddingLeft+"px",i.right=""):(i.right=this.position.x+t.paddingRight+"px",i.left=""),e.isOriginTop?(i.top=this.position.y+t.paddingTop+"px",i.bottom=""):(i.bottom=this.position.y+t.paddingBottom+"px",i.top=""),this.css(i),this.emitEvent("layout",[this])};var y=f?function(t,e){return"translate3d("+t+"px, "+e+"px, 0)"}:function(t,e){return"translate("+t+"px, "+e+"px)"};a.prototype._transitionTo=function(t,e){this.getPosition();var i=this.position.x,o=this.position.y,n=parseInt(t,10),r=parseInt(e,10),s=n===this.position.x&&r===this.position.y;if(this.setPosition(t,e),s&&!this.isTransitioning)return this.layoutPosition(),void 0;var a=t-i,u=e-o,p={},h=this.layout.options;a=h.isOriginLeft?a:-a,u=h.isOriginTop?u:-u,p.transform=y(a,u),this.transition({to:p,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},a.prototype.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},a.prototype.moveTo=h?a.prototype._transitionTo:a.prototype.goTo,a.prototype.setPosition=function(t,e){this.position.x=parseInt(t,10),this.position.y=parseInt(e,10)},a.prototype._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},a.prototype._transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return this._nonTransition(t),void 0;var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var o=this.element.offsetHeight;o=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var m=p&&o(p)+",opacity";a.prototype.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:m,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(c,this,!1))},a.prototype.transition=a.prototype[u?"_transition":"_nonTransition"],a.prototype.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},a.prototype.onotransitionend=function(t){this.ontransitionend(t)};var g={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};a.prototype.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,o=g[t.propertyName]||t.propertyName;if(delete e.ingProperties[o],i(e.ingProperties)&&this.disableTransition(),o in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[o]),o in e.onEnd){var n=e.onEnd[o];n.call(this),delete e.onEnd[o]}this.emitEvent("transitionEnd",[this])}},a.prototype.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(c,this,!1),this.isTransitioning=!1},a.prototype._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var v={transitionProperty:"",transitionDuration:""};return a.prototype.removeTransitionStyles=function(){this.css(v)},a.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.emitEvent("remove",[this])},a.prototype.remove=function(){if(!u||!parseFloat(this.layout.options.transitionDuration))return this.removeElem(),void 0;var t=this;this.on("transitionEnd",function(){return t.removeElem(),!0}),this.hide()},a.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options;this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0})},a.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options;this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:{opacity:function(){this.isHidden&&this.css({display:"none"})}}})},a.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},a}var r=t.getComputedStyle,s=r?function(t){return r(t,null)}:function(t){return t.currentStyle};"function"==typeof define&&define.amd?define("outlayer/item",["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property"],n):(t.Outlayer={},t.Outlayer.Item=n(t.EventEmitter,t.getSize,t.getStyleProperty))}(window),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){return"[object Array]"===f.call(t)}function o(t){var e=[];if(i(t))e=t;else if(t&&"number"==typeof t.length)for(var o=0,n=t.length;n>o;o++)e.push(t[o]);else e.push(t);return e}function n(t,e){var i=d(e,t);-1!==i&&e.splice(i,1)}function r(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()}function s(i,s,f,d,l,y){function m(t,i){if("string"==typeof t&&(t=a.querySelector(t)),!t||!c(t))return u&&u.error("Bad "+this.constructor.namespace+" element: "+t),void 0;this.element=t,this.options=e({},this.constructor.defaults),this.option(i);var o=++g;this.element.outlayerGUID=o,v[o]=this,this._create(),this.options.isInitLayout&&this.layout()}var g=0,v={};return m.namespace="outlayer",m.Item=y,m.defaults={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,isResizingContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},e(m.prototype,f.prototype),m.prototype.option=function(t){e(this.options,t)},m.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),e(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},m.prototype.reloadItems=function(){this.items=this._itemize(this.element.children)},m.prototype._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,o=[],n=0,r=e.length;r>n;n++){var s=e[n],a=new i(s,this);o.push(a)}return o},m.prototype._filterFindItemElements=function(t){t=o(t);for(var e=this.options.itemSelector,i=[],n=0,r=t.length;r>n;n++){var s=t[n];if(c(s))if(e){l(s,e)&&i.push(s);for(var a=s.querySelectorAll(e),u=0,p=a.length;p>u;u++)i.push(a[u])}else i.push(s)}return i},m.prototype.getItemElements=function(){for(var t=[],e=0,i=this.items.length;i>e;e++)t.push(this.items[e].element);return t},m.prototype.layout=function(){this._resetLayout(),this._manageStamps();var t=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,t),this._isLayoutInited=!0},m.prototype._init=m.prototype.layout,m.prototype._resetLayout=function(){this.getSize()},m.prototype.getSize=function(){this.size=d(this.element)},m.prototype._getMeasurement=function(t,e){var i,o=this.options[t];o?("string"==typeof o?i=this.element.querySelector(o):c(o)&&(i=o),this[t]=i?d(i)[e]:o):this[t]=0},m.prototype.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},m.prototype._getItemsForLayout=function(t){for(var e=[],i=0,o=t.length;o>i;i++){var n=t[i];n.isIgnored||e.push(n)}return e},m.prototype._layoutItems=function(t,e){function i(){o.emitEvent("layoutComplete",[o,t])}var o=this;if(!t||!t.length)return i(),void 0;this._itemsOn(t,"layout",i);for(var n=[],r=0,s=t.length;s>r;r++){var a=t[r],u=this._getItemLayoutPosition(a);u.item=a,u.isInstant=e||a.isLayoutInstant,n.push(u)}this._processLayoutQueue(n)},m.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},m.prototype._processLayoutQueue=function(t){for(var e=0,i=t.length;i>e;e++){var o=t[e];this._positionItem(o.item,o.x,o.y,o.isInstant)}},m.prototype._positionItem=function(t,e,i,o){o?t.goTo(e,i):t.moveTo(e,i)},m.prototype._postLayout=function(){this.resizeContainer()},m.prototype.resizeContainer=function(){if(this.options.isResizingContainer){var t=this._getContainerSize();t&&(this._setContainerMeasure(t.width,!0),this._setContainerMeasure(t.height,!1))}},m.prototype._getContainerSize=h,m.prototype._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},m.prototype._itemsOn=function(t,e,i){function o(){return n++,n===r&&i.call(s),!0}for(var n=0,r=t.length,s=this,a=0,u=t.length;u>a;a++){var p=t[a];p.on(e,o)}},m.prototype.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},m.prototype.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},m.prototype.stamp=function(t){if(t=this._find(t)){this.stamps=this.stamps.concat(t);for(var e=0,i=t.length;i>e;e++){var o=t[e];this.ignore(o)}}},m.prototype.unstamp=function(t){if(t=this._find(t))for(var e=0,i=t.length;i>e;e++){var o=t[e];n(o,this.stamps),this.unignore(o)}},m.prototype._find=function(t){return t?("string"==typeof t&&(t=this.element.querySelectorAll(t)),t=o(t)):void 0},m.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var t=0,e=this.stamps.length;e>t;t++){var i=this.stamps[t];this._manageStamp(i)}}},m.prototype._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},m.prototype._manageStamp=h,m.prototype._getElementOffset=function(t){var e=t.getBoundingClientRect(),i=this._boundingRect,o=d(t),n={left:e.left-i.left-o.marginLeft,top:e.top-i.top-o.marginTop,right:i.right-e.right-o.marginRight,bottom:i.bottom-e.bottom-o.marginBottom};return n},m.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},m.prototype.bindResize=function(){this.isResizeBound||(i.bind(t,"resize",this),this.isResizeBound=!0)},m.prototype.unbindResize=function(){this.isResizeBound&&i.unbind(t,"resize",this),this.isResizeBound=!1},m.prototype.onresize=function(){function t(){e.resize(),delete e.resizeTimeout}this.resizeTimeout&&clearTimeout(this.resizeTimeout);var e=this;this.resizeTimeout=setTimeout(t,100)},m.prototype.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},m.prototype.needsResizeLayout=function(){var t=d(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},m.prototype.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},m.prototype.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},m.prototype.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},m.prototype.reveal=function(t){var e=t&&t.length;if(e)for(var i=0;e>i;i++){var o=t[i];o.reveal()}},m.prototype.hide=function(t){var e=t&&t.length;if(e)for(var i=0;e>i;i++){var o=t[i];o.hide()}},m.prototype.getItem=function(t){for(var e=0,i=this.items.length;i>e;e++){var o=this.items[e];if(o.element===t)return o}},m.prototype.getItems=function(t){if(t&&t.length){for(var e=[],i=0,o=t.length;o>i;i++){var n=t[i],r=this.getItem(n);r&&e.push(r)}return e}},m.prototype.remove=function(t){t=o(t);var e=this.getItems(t);if(e&&e.length){this._itemsOn(e,"remove",function(){this.emitEvent("removeComplete",[this,e])});for(var i=0,r=e.length;r>i;i++){var s=e[i];s.remove(),n(s,this.items)}}},m.prototype.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="";for(var e=0,i=this.items.length;i>e;e++){var o=this.items[e];o.destroy()}this.unbindResize(),delete this.element.outlayerGUID,p&&p.removeData(this.element,this.constructor.namespace)},m.data=function(t){var e=t&&t.outlayerGUID;return e&&v[e]},m.create=function(t,i){function o(){m.apply(this,arguments)}return Object.create?o.prototype=Object.create(m.prototype):e(o.prototype,m.prototype),o.prototype.constructor=o,o.defaults=e({},m.defaults),e(o.defaults,i),o.prototype.settings={},o.namespace=t,o.data=m.data,o.Item=function(){y.apply(this,arguments)},o.Item.prototype=new y,s(function(){for(var e=r(t),i=a.querySelectorAll(".js-"+e),n="data-"+e+"-options",s=0,h=i.length;h>s;s++){var f,c=i[s],d=c.getAttribute(n);try{f=d&&JSON.parse(d)}catch(l){u&&u.error("Error parsing "+n+" on "+c.nodeName.toLowerCase()+(c.id?"#"+c.id:"")+": "+l);continue}var y=new o(c,f);p&&p.data(c,t,y)}}),p&&p.bridget&&p.bridget(t,o),o},m.Item=y,m}var a=t.document,u=t.console,p=t.jQuery,h=function(){},f=Object.prototype.toString,c="object"==typeof HTMLElement?function(t){return t instanceof HTMLElement}:function(t){return t&&"object"==typeof t&&1===t.nodeType&&"string"==typeof t.nodeName},d=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,o=t.length;o>i;i++)if(t[i]===e)return i;return-1};"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","doc-ready/doc-ready","eventEmitter/EventEmitter","get-size/get-size","matches-selector/matches-selector","./item"],s):t.Outlayer=s(t.eventie,t.docReady,t.EventEmitter,t.getSize,t.matchesSelector,t.Outlayer.Item)}(window),function(t){function e(t){function e(){t.Item.apply(this,arguments)}return e.prototype=new t.Item,e.prototype._create=function(){this.id=this.layout.itemGUID++,t.Item.prototype._create.call(this),this.sortData={}},e.prototype.updateSortData=function(){if(!this.isIgnored){this.sortData.id=this.id,this.sortData["original-order"]=this.id,this.sortData.random=Math.random();var t=this.layout.options.getSortData,e=this.layout._sorters;for(var i in t){var o=e[i];this.sortData[i]=o(this.element,this)}}},e}"function"==typeof define&&define.amd?define("isotope/js/item",["outlayer/outlayer"],e):(t.Isotope=t.Isotope||{},t.Isotope.Item=e(t.Outlayer))}(window),function(t){function e(t,e){function i(t){this.isotope=t,t&&(this.options=t.options[this.namespace],this.element=t.element,this.items=t.filteredItems,this.size=t.size)}return function(){function t(t){return function(){return e.prototype[t].apply(this.isotope,arguments)}}for(var o=["_resetLayout","_getItemLayoutPosition","_manageStamp","_getContainerSize","_getElementOffset","needsResizeLayout"],n=0,r=o.length;r>n;n++){var s=o[n];i.prototype[s]=t(s)}}(),i.prototype.needsVerticalResizeLayout=function(){var e=t(this.isotope.element),i=this.isotope.size&&e;return i&&e.innerHeight!==this.isotope.size.innerHeight},i.prototype._getMeasurement=function(){this.isotope._getMeasurement.apply(this,arguments)},i.prototype.getColumnWidth=function(){this.getSegmentSize("column","Width")},i.prototype.getRowHeight=function(){this.getSegmentSize("row","Height")},i.prototype.getSegmentSize=function(t,e){var i=t+e,o="outer"+e;if(this._getMeasurement(i,o),!this[i]){var n=this.getFirstItemSize();this[i]=n&&n[o]||this.isotope.size["inner"+e]}},i.prototype.getFirstItemSize=function(){var e=this.isotope.filteredItems[0];return e&&e.element&&t(e.element)},i.prototype.layout=function(){this.isotope.layout.apply(this.isotope,arguments)},i.prototype.getSize=function(){this.isotope.getSize(),this.size=this.isotope.size},i.modes={},i.create=function(t,e){function o(){i.apply(this,arguments)}return o.prototype=new i,e&&(o.options=e),o.prototype.namespace=t,i.modes[t]=o,o},i}"function"==typeof define&&define.amd?define("isotope/js/layout-mode",["get-size/get-size","outlayer/outlayer"],e):(t.Isotope=t.Isotope||{},t.Isotope.LayoutMode=e(t.getSize,t.Outlayer))}(window),function(t){function e(t,e){var o=t.create("masonry");return o.prototype._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns();var t=this.cols;for(this.colYs=[];t--;)this.colYs.push(0);this.maxY=0},o.prototype.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}this.columnWidth+=this.gutter,this.cols=Math.floor((this.containerWidth+this.gutter)/this.columnWidth),this.cols=Math.max(this.cols,1)},o.prototype.getContainerWidth=function(){var t=this.options.isFitWidth?this.element.parentNode:this.element,i=e(t);this.containerWidth=i&&i.innerWidth},o.prototype._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,o=e&&1>e?"round":"ceil",n=Math[o](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var r=this._getColGroup(n),s=Math.min.apply(Math,r),a=i(r,s),u={x:this.columnWidth*a,y:s},p=s+t.size.outerHeight,h=this.cols+1-r.length,f=0;h>f;f++)this.colYs[a+f]=p;return u},o.prototype._getColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,o=0;i>o;o++){var n=this.colYs.slice(o,o+t);e[o]=Math.max.apply(Math,n)}return e},o.prototype._manageStamp=function(t){var i=e(t),o=this._getElementOffset(t),n=this.options.isOriginLeft?o.left:o.right,r=n+i.outerWidth,s=Math.floor(n/this.columnWidth);s=Math.max(0,s);var a=Math.floor(r/this.columnWidth);a-=r%this.columnWidth?0:1,a=Math.min(this.cols-1,a);for(var u=(this.options.isOriginTop?o.top:o.bottom)+i.outerHeight,p=s;a>=p;p++)this.colYs[p]=Math.max(u,this.colYs[p])},o.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this.options.isFitWidth&&(t.width=this._getContainerFitWidth()),t},o.prototype._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},o.prototype.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!==this.containerWidth},o}var i=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,o=t.length;o>i;i++){var n=t[i];if(n===e)return i}return-1};"function"==typeof define&&define.amd?define("masonry/masonry",["outlayer/outlayer","get-size/get-size"],e):t.Masonry=e(t.Outlayer,t.getSize)}(window),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t,i){var o=t.create("masonry"),n=o.prototype._getElementOffset,r=o.prototype.layout,s=o.prototype._getMeasurement;e(o.prototype,i.prototype),o.prototype._getElementOffset=n,o.prototype.layout=r,o.prototype._getMeasurement=s;var a=o.prototype.measureColumns;o.prototype.measureColumns=function(){this.items=this.isotope.filteredItems,a.call(this)};var u=o.prototype._manageStamp;return o.prototype._manageStamp=function(){this.options.isOriginLeft=this.isotope.options.isOriginLeft,this.options.isOriginTop=this.isotope.options.isOriginTop,u.apply(this,arguments)},o}"function"==typeof define&&define.amd?define("isotope/js/layout-modes/masonry",["../layout-mode","masonry/masonry"],i):i(t.Isotope.LayoutMode,t.Masonry)}(window),function(t){function e(t){var e=t.create("fitRows");return e.prototype._resetLayout=function(){this.x=0,this.y=0,this.maxY=0},e.prototype._getItemLayoutPosition=function(t){t.getSize(),0!==this.x&&t.size.outerWidth+this.x>this.isotope.size.innerWidth&&(this.x=0,this.y=this.maxY);var e={x:this.x,y:this.y};return this.maxY=Math.max(this.maxY,this.y+t.size.outerHeight),this.x+=t.size.outerWidth,e},e.prototype._getContainerSize=function(){return{height:this.maxY}},e}"function"==typeof define&&define.amd?define("isotope/js/layout-modes/fit-rows",["../layout-mode"],e):e(t.Isotope.LayoutMode)}(window),function(t){function e(t){var e=t.create("vertical",{horizontalAlignment:0});return e.prototype._resetLayout=function(){this.y=0},e.prototype._getItemLayoutPosition=function(t){t.getSize();var e=(this.isotope.size.innerWidth-t.size.outerWidth)*this.options.horizontalAlignment,i=this.y;return this.y+=t.size.outerHeight,{x:e,y:i}},e.prototype._getContainerSize=function(){return{height:this.y}},e}"function"==typeof define&&define.amd?define("isotope/js/layout-modes/vertical",["../layout-mode"],e):e(t.Isotope.LayoutMode)}(window),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){return"[object Array]"===h.call(t)}function o(t){var e=[];if(i(t))e=t;else if(t&&"number"==typeof t.length)for(var o=0,n=t.length;n>o;o++)e.push(t[o]);else e.push(t);return e}function n(t,e){var i=f(e,t);-1!==i&&e.splice(i,1)}function r(t,i,r,u,h){function f(t,e){return function(i,o){for(var n=0,r=t.length;r>n;n++){var s=t[n],a=i.sortData[s],u=o.sortData[s];if(a>u||u>a){var p=void 0!==e[s]?e[s]:e,h=p?1:-1;return(a>u?1:-1)*h}}return 0}}var c=t.create("isotope",{layoutMode:"masonry",isJQueryFiltering:!0,sortAscending:!0});c.Item=u,c.LayoutMode=h,c.prototype._create=function(){this.itemGUID=0,this._sorters={},this._getSorters(),t.prototype._create.call(this),this.modes={},this.filteredItems=this.items,this.sortHistory=["original-order"];for(var e in h.modes)this._initLayoutMode(e)},c.prototype.reloadItems=function(){this.itemGUID=0,t.prototype.reloadItems.call(this)},c.prototype._itemize=function(){for(var e=t.prototype._itemize.apply(this,arguments),i=0,o=e.length;o>i;i++){var n=e[i];n.id=this.itemGUID++}return this._updateItemsSortData(e),e},c.prototype._initLayoutMode=function(t){var i=h.modes[t],o=this.options[t]||{};this.options[t]=i.options?e(i.options,o):o,this.modes[t]=new i(this)},c.prototype.layout=function(){return!this._isLayoutInited&&this.options.isInitLayout?(this.arrange(),void 0):(this._layout(),void 0)},c.prototype._layout=function(){var t=this._getIsInstant();this._resetLayout(),this._manageStamps(),this.layoutItems(this.filteredItems,t),this._isLayoutInited=!0},c.prototype.arrange=function(t){this.option(t),this._getIsInstant(),this.filteredItems=this._filter(this.items),this._sort(),this._layout()},c.prototype._init=c.prototype.arrange,c.prototype._getIsInstant=function(){var t=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;return this._isInstant=t,t},c.prototype._filter=function(t){function e(){f.reveal(n),f.hide(r)}var i=this.options.filter;i=i||"*";for(var o=[],n=[],r=[],s=this._getFilterTest(i),a=0,u=t.length;u>a;a++){var p=t[a];if(!p.isIgnored){var h=s(p);h&&o.push(p),h&&p.isHidden?n.push(p):h||p.isHidden||r.push(p)}}var f=this;return this._isInstant?this._noTransition(e):e(),o},c.prototype._getFilterTest=function(t){return s&&this.options.isJQueryFiltering?function(e){return s(e.element).is(t)}:"function"==typeof t?function(e){return t(e.element)}:function(e){return r(e.element,t)}},c.prototype.updateSortData=function(t){this._getSorters(),t=o(t);var e=this.getItems(t);e=e.length?e:this.items,this._updateItemsSortData(e)
  1743. },c.prototype._getSorters=function(){var t=this.options.getSortData;for(var e in t){var i=t[e];this._sorters[e]=d(i)}},c.prototype._updateItemsSortData=function(t){for(var e=0,i=t.length;i>e;e++){var o=t[e];o.updateSortData()}};var d=function(){function t(t){if("string"!=typeof t)return t;var i=a(t).split(" "),o=i[0],n=o.match(/^\[(.+)\]$/),r=n&&n[1],s=e(r,o),u=c.sortDataParsers[i[1]];return t=u?function(t){return t&&u(s(t))}:function(t){return t&&s(t)}}function e(t,e){var i;return i=t?function(e){return e.getAttribute(t)}:function(t){var i=t.querySelector(e);return i&&p(i)}}return t}();c.sortDataParsers={parseInt:function(t){return parseInt(t,10)},parseFloat:function(t){return parseFloat(t)}},c.prototype._sort=function(){var t=this.options.sortBy;if(t){var e=[].concat.apply(t,this.sortHistory),i=f(e,this.options.sortAscending);this.filteredItems.sort(i),t!==this.sortHistory[0]&&this.sortHistory.unshift(t)}},c.prototype._mode=function(){var t=this.options.layoutMode,e=this.modes[t];if(!e)throw Error("No layout mode: "+t);return e.options=this.options[t],e},c.prototype._resetLayout=function(){t.prototype._resetLayout.call(this),this._mode()._resetLayout()},c.prototype._getItemLayoutPosition=function(t){return this._mode()._getItemLayoutPosition(t)},c.prototype._manageStamp=function(t){this._mode()._manageStamp(t)},c.prototype._getContainerSize=function(){return this._mode()._getContainerSize()},c.prototype.needsResizeLayout=function(){return this._mode().needsResizeLayout()},c.prototype.appended=function(t){var e=this.addItems(t);if(e.length){var i=this._filterRevealAdded(e);this.filteredItems=this.filteredItems.concat(i)}},c.prototype.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps();var o=this._filterRevealAdded(e);this.layoutItems(i),this.filteredItems=o.concat(this.filteredItems)}},c.prototype._filterRevealAdded=function(t){var e=this._noTransition(function(){return this._filter(t)});return this.layoutItems(e,!0),this.reveal(e),t},c.prototype.insert=function(t){var e=this.addItems(t);if(e.length){var i,o,n=e.length;for(i=0;n>i;i++)o=e[i],this.element.appendChild(o.element);var r=this._filter(e);for(this._noTransition(function(){this.hide(r)}),i=0;n>i;i++)e[i].isLayoutInstant=!0;for(this.arrange(),i=0;n>i;i++)delete e[i].isLayoutInstant;this.reveal(r)}};var l=c.prototype.remove;return c.prototype.remove=function(t){t=o(t);var e=this.getItems(t);if(l.call(this,t),e&&e.length)for(var i=0,r=e.length;r>i;i++){var s=e[i];n(s,this.filteredItems)}},c.prototype._noTransition=function(t){var e=this.options.transitionDuration;this.options.transitionDuration=0;var i=t.call(this);return this.options.transitionDuration=e,i},c}var s=t.jQuery,a=String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^\s+|\s+$/g,"")},u=document.documentElement,p=u.textContent?function(t){return t.textContent}:function(t){return t.innerText},h=Object.prototype.toString,f=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,o=t.length;o>i;i++)if(t[i]===e)return i;return-1};"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","matches-selector/matches-selector","isotope/js/item","isotope/js/layout-mode","isotope/js/layout-modes/masonry","isotope/js/layout-modes/fit-rows","isotope/js/layout-modes/vertical"],r):t.Isotope=r(t.Outlayer,t.getSize,t.matchesSelector,t.Isotope.Item,t.Isotope.LayoutMode)}(window);
  1744.  
  1745.  
  1746. /*
  1747. jQuery Waypoints - v2.0.3
  1748. Copyright (c) 2011-2013 Caleb Troughton
  1749. Dual licensed under the MIT license and GPL license.
  1750. https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt
  1751. */
  1752. (function(){var t=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++){if(e in this&&this[e]===t)return e}return-1},e=[].slice;(function(t,e){if(typeof define==="function"&&define.amd){return define("waypoints",["jquery"],function(n){return e(n,t)})}else{return e(t.jQuery,t)}})(this,function(n,r){var i,o,l,s,f,u,a,c,h,d,p,y,v,w,g,m;i=n(r);c=t.call(r,"ontouchstart")>=0;s={horizontal:{},vertical:{}};f=1;a={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didResize=false;this.didScroll=false;this.id="context"+f++;this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()};this.waypoints={horizontal:{},vertical:{}};t.data(u,this.id);a[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||c)){e.didScroll=true;t=function(){e.doScroll();return e.didScroll=false};return r.setTimeout(t,n[m].settings.scrollThrottle)}});t.bind(p,function(){var t;if(!e.didResize){e.didResize=true;t=function(){n[m]("refresh");return e.didResize=false};return r.setTimeout(t,n[m].settings.resizeThrottle)}})}t.prototype.doScroll=function(){var t,e=this;t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};if(c&&(!t.vertical.oldScroll||!t.vertical.newScroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newScroll>r.oldScroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldScroll<(n=e.offset)&&n<=r.newScroll){return l.push(e)}else if(r.newScroll<(i=e.offset)&&i<=r.oldScroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.isWindow(this.element);e=this.$element.offset();this.doScroll();t={horizontal:{contextOffset:r?0:e.left,contextScroll:r?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:r?0:e.top,contextScroll:r?0:this.oldScroll.y,contextDimension:r?n[m]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.isWindow(r.element)?0:r.$element.offset()[e.offsetProp];if(n.isFunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parseFloat(i);if(r.options.offset.indexOf("%")>-1){i=Math.ceil(e.contextDimension*i/100)}}r.offset=o-e.contextOffset+e.contextScroll-i;if(r.options.onlyOnScroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldScroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldScroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldScroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkEmpty=function(){if(n.isEmptyObject(this.waypoints.horizontal)&&n.isEmptyObject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete a[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;r=n.extend({},n.fn[g].defaults,r);if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportHeight");if(!n.isWindow(e.element)){t=e.$element.height()}return t-n(this).outerHeight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=t.data(w))!=null?o:[];i.push(this.id);t.data(w,i)}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggerOnce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkEmpty()};t.getWaypointsByElement=function(t){var e,r;r=n(t).data(w);if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;if(e==null){e={}}if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.isWindow(i)){i=t.closest(i)}i=n(i);r=a[i.data(u)];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke(this,"disable")},enable:function(){return d._invoke(this,"enable")},destroy:function(){return d._invoke(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e<n.length-1){return t.push(n[e+1])}})},_traverse:function(t,e,i){var o,l;if(t==null){t="vertical"}if(e==null){e=r}l=h.aggregate(e);o=[];this.each(function(){var e;e=n.inArray(this,l[t]);return i(o,e,l[t])});return this.pushStack(o)},_invoke:function(t,e){t.each(function(){var t;t=l.getWaypointsByElement(this);return n.each(t,function(t,n){n[e]();return true})});return this}};n.fn[g]=function(){var t,r;r=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(d[r]){return d[r].apply(this,t)}else if(n.isFunction(r)){return d.init.apply(this,arguments)}else if(n.isPlainObject(r)){return d.init.apply(this,[null,r])}else if(!r){return n.error("jQuery Waypoints needs a callback function or handler option.")}else{return n.error("The "+r+" method does not exist in jQuery Waypoints.")}};n.fn[g].defaults={context:r,continuous:true,enabled:true,horizontal:false,offset:0,triggerOnce:false};h={refresh:function(){return n.each(a,function(t,e){return e.refresh()})},viewportHeight:function(){var t;return(t=r.innerHeight)!=null?t:i.height()},aggregate:function(t){var e,r,i;e=s;if(t){e=(i=a[n(t).data(u)])!=null?i.waypoints:void 0}if(!e){return[]}r={horizontal:[],vertical:[]};n.each(r,function(t,i){n.each(e[t],function(t,e){return i.push(e)});i.sort(function(t,e){return t.offset-e.offset});r[t]=n.map(i,function(t){return t.element});return r[t]=n.unique(r[t])});return r},above:function(t){if(t==null){t=r}return h._filter(t,"vertical",function(t,e){return e.offset<=t.oldScroll.y})},below:function(t){if(t==null){t=r}return h._filter(t,"vertical",function(t,e){return e.offset>t.oldScroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldScroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset>t.oldScroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendFn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=a[n(t).data(u)];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizeThrottle:100,scrollThrottle:30};return i.load(function(){return n[m]("refresh")})})}).call(this);
  1753.  
  1754.  
  1755.  
  1756. /*
  1757. * jQuery Browser Plugin 0.0.6
  1758. * https://github.com/gabceb/jquery-browser-plugin
  1759. *
  1760. * Original jquery-browser code Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors
  1761. * http://jquery.org/license
  1762. *
  1763. * Modifications Copyright 2014 Gabriel Cebrian
  1764. * https://github.com/gabceb
  1765. *
  1766. * Released under the MIT license
  1767. */!function(a,b){"use strict";var c,d;if(a.uaMatch=function(a){a=a.toLowerCase();var b=/(opr)[\/]([\w.]+)/.exec(a)||/(chrome)[ \/]([\w.]+)/.exec(a)||/(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[],c=/(ipad)/.exec(a)||/(iphone)/.exec(a)||/(android)/.exec(a)||/(windows phone)/.exec(a)||/(win)/.exec(a)||/(mac)/.exec(a)||/(linux)/.exec(a)||/(cros)/i.exec(a)||[];return{browser:b[3]||b[1]||"",version:b[2]||"0",platform:c[0]||""}},c=a.uaMatch(b.navigator.userAgent),d={},c.browser&&(d[c.browser]=!0,d.version=c.version,d.versionNumber=parseInt(c.version)),c.platform&&(d[c.platform]=!0),(d.android||d.ipad||d.iphone||d["windows phone"])&&(d.mobile=!0),(d.cros||d.mac||d.linux||d.win)&&(d.desktop=!0),(d.chrome||d.opr||d.safari)&&(d.webkit=!0),d.rv){var e="msie";c.browser=e,d[e]=!0}if(d.opr){var f="opera";c.browser=f,d[f]=!0}if(d.safari&&d.android){var g="android";c.browser=g,d[g]=!0}d.name=c.browser,d.platform=c.platform,a.browser=d}(jQuery,window);
  1768.  
  1769. /*Vimeo Frogaloop API for videos*/
  1770. var Froogaloop=function(){function e(a){return new e.fn.init(a)}function h(a,c,b){if(!b.contentWindow.postMessage)return!1;var f=b.getAttribute("src").split("?")[0],a=JSON.stringify({method:a,value:c});"//"===f.substr(0,2)&&(f=window.location.protocol+f);b.contentWindow.postMessage(a,f)}function j(a){var c,b;try{c=JSON.parse(a.data),b=c.event||c.method}catch(f){}"ready"==b&&!i&&(i=!0);if(a.origin!=k)return!1;var a=c.value,e=c.data,g=""===g?null:c.player_id;c=g?d[g][b]:d[b];b=[];if(!c)return!1;void 0!==
  1771. a&&b.push(a);e&&b.push(e);g&&b.push(g);return 0<b.length?c.apply(null,b):c.call()}function l(a,c,b){b?(d[b]||(d[b]={}),d[b][a]=c):d[a]=c}var d={},i=!1,k="";e.fn=e.prototype={element:null,init:function(a){"string"===typeof a&&(a=document.getElementById(a));this.element=a;a=this.element.getAttribute("src");"//"===a.substr(0,2)&&(a=window.location.protocol+a);for(var a=a.split("/"),c="",b=0,f=a.length;b<f;b++){if(3>b)c+=a[b];else break;2>b&&(c+="/")}k=c;return this},api:function(a,c){if(!this.element||
  1772. !a)return!1;var b=this.element,f=""!==b.id?b.id:null,d=!c||!c.constructor||!c.call||!c.apply?c:null,e=c&&c.constructor&&c.call&&c.apply?c:null;e&&l(a,e,f);h(a,d,b);return this},addEvent:function(a,c){if(!this.element)return!1;var b=this.element,d=""!==b.id?b.id:null;l(a,c,d);"ready"!=a?h("addEventListener",a,b):"ready"==a&&i&&c.call(null,d);return this},removeEvent:function(a){if(!this.element)return!1;var c=this.element,b;a:{if((b=""!==c.id?c.id:null)&&d[b]){if(!d[b][a]){b=!1;break a}d[b][a]=null}else{if(!d[a]){b=
  1773. !1;break a}d[a]=null}b=!0}"ready"!=a&&b&&h("removeEventListener",a,c)}};e.fn.init.prototype=e.fn;window.addEventListener?window.addEventListener("message",j,!1):window.attachEvent("onmessage",j);return window.Froogaloop=window.$f=e}();
  1774.  
  1775.  
  1776. // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ + http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
  1777. // requestAnimationFrame polyfill by Erik MΓΆller. fixes from Paul Irish and Tino Zijdel. can be removed if IE9 is no longer supported or all parallax scripts are gone MIT license
  1778. (function(){var lastTime=0;var vendors=['ms','moz','webkit','o'];for(var x=0;x<vendors.length&&!window.requestAnimationFrame;++x){window.requestAnimationFrame=window[vendors[x]+'RequestAnimationFrame'];window.cancelAnimationFrame=window[vendors[x]+'CancelAnimationFrame']||window[vendors[x]+'CancelRequestAnimationFrame']}if(!window.requestAnimationFrame)window.requestAnimationFrame=function(callback,element){var currTime=new Date().getTime();var timeToCall=Math.max(0,16-(currTime-lastTime));var id=window.setTimeout(function(){callback(currTime+timeToCall)},timeToCall);lastTime=currTime+timeToCall;return id};if(!window.cancelAnimationFrame)window.cancelAnimationFrame=function(id){clearTimeout(id)}}());
  1779.  
  1780. jQuery.expr[':'].regex = function(elem, index, match) {
  1781. var matchParams = match[3].split(','),
  1782. validLabels = /^(data|css):/,
  1783. attr = {
  1784. method: matchParams[0].match(validLabels) ?
  1785. matchParams[0].split(':')[0] : 'attr',
  1786. property: matchParams.shift().replace(validLabels,'')
  1787. },
  1788. regexFlags = 'ig',
  1789. regex = new RegExp(matchParams.join('').replace(/^\s+|\s+$/g,''), regexFlags);
  1790. return regex.test(jQuery(elem)[attr.method](attr.property));
  1791. }
Advertisement
Add Comment
Please, Sign In to add comment