1// /* ====== SHARED VARS ====== */ 2 3var phone, touch, ltie9, lteie9, wh, ww, dh, ar, fonts; 4 5var ua = navigator.userAgent; 6var winLoc = window.location.toString(); 7 8var is_webkit = ua.match(/webkit/i); 9var is_firefox = ua.match(/gecko/i); 10var is_newer_ie = typeof (is_ie) !== "undefined" || (!(window.ActiveXObject) && "ActiveXObject" in window); 11var is_older_ie = ua.match(/msie/i) && !is_newer_ie; 12var is_ancient_ie = ua.match(/msie 6/i); 13var is_mobile = ua.match(/mobile/i); 14var is_OSX = (ua.match(/(iPad|iPhone|iPod|Macintosh)/g) ? true : false); 15 16var nua = navigator.userAgent; 17var is_android = ((nua.indexOf('Mozilla/5.0') > -1 && nua.indexOf('Android ') > -1 && nua.indexOf('AppleWebKit') > -1) && !(nua.indexOf('Chrome') > -1)); 18 19var useTransform = true; 20var use2DTransform = (ua.match(/msie 9/i) || winLoc.match(/transform\=2d/i)); 21var transform; 22 23// setting up transform prefixes 24var prefixes = { 25 webkit: 'webkitTransform', 26 firefox: 'MozTransform', 27 ie: 'msTransform', 28 w3c: 'transform' 29}; 30 31if (useTransform) { 32 if (is_webkit) { 33 transform = prefixes.webkit; 34 } else if (is_firefox) { 35 transform = prefixes.firefox; 36 } else if (is_newer_ie) { 37 transform = prefixes.ie; 38 } 39} 40 41if ( is_newer_ie ) jQuery('html').addClass('is--ie'); 42(function ($, window, undefined) { 43 44 /* --- DETECT VIEWPORT SIZE --- */ 45 46 function browserSize() { 47 wh = $(window).height(); 48 ww = $(window).width(); 49 dh = $(document).height(); 50 ar = ww / wh; 51 } 52 53 54 /* --- DETECT PLATFORM --- */ 55 56 function platformDetect(){ 57 $.support.touch = 'ontouchend' in document; 58 var navUA = navigator.userAgent.toLowerCase(), 59 navPlat = navigator.platform.toLowerCase(); 60 61 var isiPhone = navPlat.indexOf("iphone"), 62 isiPod = navPlat.indexOf("ipod"), 63 isAndroidPhone = navPlat.indexOf("android"), 64 safari = (navUA.indexOf('safari') != -1 && navUA.indexOf('chrome') == -1) ? true : false, 65 svgSupport = (window.SVGAngle) ? true : false, 66 svgSupportAlt = (document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")) ? true : false, 67 ff3x = (/gecko/i.test(navUA) && /rv:1.9/i.test(navUA)) ? true : false; 68 69 phone = (isiPhone > -1 || isiPod > -1 || isAndroidPhone > -1) ? true : false; 70 touch = $.support.touch ? true : false; 71 ltie9 = $.support.leadingWhitespace ? false : true; 72 lteie9 = typeof window.atob === 'undefined' ? true : false; 73 74 var $bod = $('body'); 75 76 if (touch) {$bod.addClass('touch');} 77 if (safari) $bod.addClass('safari'); 78 if (phone) $bod.addClass('phone'); 79 }; 80/* --- Magnific Popup Initialization --- */ 81 82function magnificPopupInit(){ 83 84 $('.js-post-gallery').each(function() { // the containers for all your galleries should have the class gallery 85 $(this).magnificPopup({ 86 delegate: 'a[href$=".jpg"], a[href$=".jpeg"], a[href$=".png"], a[href$=".gif"]', // the container for each your gallery items 87 type: 'image', 88 removalDelay: 500, 89 mainClass: 'mfp-fade', 90 image: { 91 titleSrc: function (item){ 92 var output = ''; 93 if ( typeof item.el.attr('data-title') !== "undefined" && item.el.attr('data-title') !== "") { 94 output = item.el.attr('data-title'); 95 } 96 if ( typeof item.el.attr('data-alt') !== "undefined" && item.el.attr('data-alt') !== "") { 97 output += '<small>'+item.el.attr('data-alt')+'</small>'; 98 } 99 return output; 100 } 101 }, 102 gallery:{ 103 enabled:true, 104 navigateByImgClick: true 105 } 106 }); 107 }); 108} 109/* RILOADR INIT */ 110 111var Riload = (function() { 112 113 var initialized = false, 114 riloadrImages, 115 riloadrSingle; 116 117 function init() { 118 119 // Lazy loading for images with '.lazy' class 120 riloadrImages = new Riloadr({ 121 name : 'lazy', 122 breakpoints: [{ 123 name: 'whatever', 124 minWidth: 1 125 }], 126 defer: { 127 mode: 'load' 128 } 129 }); 130 131 // Responsive Featured Image for single post page 132 riloadrSingle = new Riloadr({ 133 name : 'riloadr-single', 134 breakpoints: [{ 135 name: 'small', 136 maxWidth: 400 137 }, { 138 name: 'big', 139 minWidth: 401 140 }], 141 watchViewportWidth: "*" 142 }); 143 144 initialized = true; 145 } 146 147 function refresh() { 148 if ( ! initialized ) { 149 return; 150 } 151 riloadrImages.riload(); 152 riloadrSingle.riload(); 153 } 154 155 return { 156 init: init, 157 refresh: refresh 158 } 159 160})(); 161 162/* --- Royal Slider Init --- */ 163 164var $original_billboard_slider; 165 166/* 167 * Slider Initialization 168 */ 169function sliderInit($slider){ 170 171 $slider.find('img').removeClass('invisible'); 172 173 var $children = $(this).children(), 174 rs_arrows = typeof $slider.data('arrows') !== "undefined", 175 rs_bullets = typeof $slider.data('bullets') !== "undefined" ? "bullets" : "none", 176 rs_autoheight = typeof $slider.data('autoheight') !== "undefined", 177 rs_autoScaleSlider = false, 178 rs_autoScaleSliderWidth = $slider.data('autoscalesliderwidth'), 179 rs_autoScaleSliderHeight = $slider.data('autoscalesliderheight'), 180 rs_customArrows = typeof $slider.data('customarrows') !== "undefined", 181 rs_slidesSpacing = typeof $slider.data('slidesspacing') !== "undefined" ? parseInt($slider.data('slidesspacing')) : 0, 182 rs_keyboardNav = typeof $slider.data('fullscreen') !== "undefined", 183 rs_imageScale = $slider.data('imagescale'), 184 rs_visibleNearby = typeof $slider.data('visiblenearby') !== "undefined" ? true : false, 185 rs_imageAlignCenter = typeof $slider.data('imagealigncenter') !== "undefined", 186 rs_transition = typeof $slider.data('slidertransition') !== "undefined" && $slider.data('slidertransition') != '' ? $slider.data('slidertransition') : 'move', 187 rs_autoPlay = typeof $slider.data('sliderautoplay') !== "undefined" ? true : false, 188 rs_delay = typeof $slider.data('sliderdelay') !== "undefined" && $slider.data('sliderdelay') != '' ? $slider.data('sliderdelay') : '1000', 189 rs_drag = true, 190 rs_globalCaption = typeof $slider.data('showcaptions') !== "undefined" ? true : false;
191 192 if(rs_autoheight) { rs_autoScaleSlider = false } else { rs_autoScaleSlider = true } 193 194 // Single slide case 195 if ($children.length == 1){ 196 rs_arrows = false; 197 rs_bullets = 'none'; 198 rs_customArrows = false; 199 rs_keyboardNav = false; 200 rs_drag = false; 201 rs_transition = 'fade'; 202 } 203 204 // make sure default arrows won't appear if customArrows is set 205 if (rs_customArrows) arrows = false; 206 207 //the main params for Royal Slider 208 var royalSliderParams = { 209 autoHeight: rs_autoheight, 210 autoScaleSlider: rs_autoScaleSlider, 211 loop: true, 212 autoScaleSliderWidth: rs_autoScaleSliderWidth, 213 autoScaleSliderHeight: rs_autoScaleSliderHeight, 214 imageScaleMode: rs_imageScale, 215 imageAlignCenter: rs_imageAlignCenter, 216 slidesSpacing: rs_slidesSpacing, 217 arrowsNav: rs_arrows, 218 controlNavigation: rs_bullets, 219 keyboardNavEnabled: rs_keyboardNav, 220 arrowsNavAutoHide: false, 221 sliderDrag: rs_drag, 222 transitionType: rs_transition, 223 autoPlay: { 224 enabled: rs_autoPlay, 225 stopAtAction: true, 226 pauseOnHover: true, 227 delay: rs_delay 228 }, 229 numImagesToPreload: 10, 230 globalCaption:rs_globalCaption 231 }; 232 233 if (rs_visibleNearby) { 234 royalSliderParams['visibleNearby'] = { 235 enabled: true, 236 //centerArea: 0.8, 237 center: true, 238 breakpoint: 0, 239 //breakpointCenterArea: 0.64, 240 navigateByCenterClick: false 241 } 242 } 243 244 //lets fire it up 245 $slider.royalSlider(royalSliderParams); 246 $slider.addClass('slider--loaded'); 247 248 var royalSlider = $slider.data('royalSlider'); 249 var slidesNumber = royalSlider.numSlides; 250 251 // move arrows outside rsOverflow 252 $slider.find('.rsArrow').appendTo($slider); 253 254 royalSlider.ev.on('rsVideoPlay', function() { 255 if(rs_imageScale == 'fill'){ 256 var $frameHolder = $('.rsVideoFrameHolder'); 257 var top = Math.abs(royalSlider.height - $frameHolder.closest('.rsVideoContainer').height())/2; 258 259 $frameHolder.height(royalSlider.height); 260 $frameHolder.css('margin-top', top+'px'); 261 262 } else { 263 var $frameHolder = $('.rsVideoFrameHolder'); 264 var $videoContainer = $('.rsVideoFrameHolder').closest('.rsVideoContainer'); 265 var top = parseInt($frameHolder.closest('.rsVideoContainer').css('margin-top'), 10); 266 267 if(top < 0){ 268 top = Math.abs(top); 269 $frameHolder 270 .height(royalSlider.height) 271 .css('top', top + 'px'); 272 } 273 } 274 }); 275 276 royalSlider.ev.on('rsAfterSlideChange', function() { 277 Riload.refresh(); 278 }); 279 280 $slider.addClass('slider--loaded'); 281} 282 283 284 285/* 286 * Wordpress Galleries to Sliders 287 * Create the markup for the slider from the gallery shortcode 288 * take all the images and insert them in the .gallery <div> 289 */ 290function sliderMarkupGallery($gallery){ 291 var $old_gallery = $gallery, 292 gallery_data = $gallery.data(), 293 $images = $old_gallery.find('img'), 294 $new_gallery = $('<div class="pixslider js-pixslider">'); 295 296 $images.prependTo($new_gallery).addClass('rsImg'); 297 $old_gallery.replaceWith($new_gallery); 298 299 $new_gallery.data(gallery_data); 300} 301 302function sliderUpdateSize($slider) { 303 var $sliderObj = $slider.data('royalSlider'); 304 305 $sliderObj.updateSliderSize(true); 306} 307 308 309/* 310 * Change the Slider markup from (1 big / 2 small) to (3 big) 311 * ORIGINAL to MOBILE 312 */ 313function sliderMarkupMobile($slider){ 314 var $parent = $slider; 315 316 // Change markup to default 317 $slider.replaceWith($original_billboard_slider); 318 $slider = $('.billboard.js-pixslider'); 319 320 // Change parameters 321 $slider.attr('data-autoheight', true); 322 $slider.attr('data-imagescale', 'none'); 323 324 $slider.find('.billboard--article-group').each(function(){ 325 // var $slide = $(this), 326 // $slide_thumb = $slide.find('.article--billboard-small img'); 327 328 // // For each slide thumb(because there are two) 329 // // we set the new image source 330 // $slide_thumb.each(function(){ 331 // slide_thumb_big_src = $(this).attr('data-src-big'); 332 // $(this).attr('src', slide_thumb_big_src); 333 // }); 334 335 // Change thumbnail for small articles 336 $(this).children('.article').removeClass('rsABlock'); 337 338 $(this).before($(this).html()) 339 .remove(); 340 }); 341 342 // Mark as mobile 343 $slider.addClass('js-pixslider-mobile'); 344 345 $slider.addClass('rsAutoHeight'); 346 347 sliderInit($slider); 348} 349 350 351 352/* 353 * Change the Slider Markup from (3 big) to (1 big / 2 small) 354 * MOBILE to ORIGINAL 355 */ 356function sliderMarkupOriginal($slider){ 357 358 // Change markup 359 $slider.replaceWith($original_billboard_slider); 360 $slider = $('.billboard.js-pixslider'); 361 362 // Change parameters 363 $slider.removeAttr('data-autoheight'); 364 $slider.removeAttr('imagescale'); 365 366 $slider.removeClass('js-pixslider-mobile'); 367 $slider.removeClass('rsAutoHeight'); 368 369 sliderInit($slider); 370} 371 372 373 374/* 375 * Billboard Slider markup changes (on resize) 376 */ 377function slider_billboard() { 378 var window_size = $(window).width(); 379 380 $('.js-pixslider.billboard').each(function(){ 381 $slider = $(this); 382 var slider_rs = $slider.data('royalSlider'); 383 384 if((window_size < 900) && (!$slider.hasClass('js-pixslider-mobile'))) { 385 if(slider_rs) slider_rs.destroy(); 386 sliderMarkupMobile($slider); 387 } else if((window_size > 900) && ($slider.hasClass('js-pixslider-mobile'))) { 388 if(slider_rs) slider_rs.destroy(); 389 sliderMarkupOriginal($slider); 390 } 391 }); 392 393 // riloadrSlider.riload(); 394} 395 396 397 398/* 399 * First Slider Initialization 400 */ 401 402function royalSliderInit() { 403 // Transform Wordpress Galleries to Sliders 404 $('.wp-gallery').each(function() { sliderMarkupGallery($(this)); }); 405 406 // Find and initialize each slider 407 $('.js-pixslider').each(function(){ 408 if(!$(this).hasClass('billboard')) 409 sliderInit($(this)); 410 }); 411}; 412 413var royalSliderBillboardInitiated = false;
414function royalSliderBillboardInit(){ 415 royalSliderBillboardInitiated = true; 416 417 $('.js-pixslider.billboard').each(function(){ 418 // Cache The Original Billboard Slider HTML Markup 419 $original_billboard_slider = $(this).outerHTML(); 420 slider_billboard($(this)); 421 422 var height = $(this).find('img').first().height(); 423 424 sliderInit($(this)); 425 426 427 }); 428} 429/* ====== INTERNAL FUNCTIONS ====== */ 430 431/* --- Set Query Parameter--- */ 432function setQueryParameter(uri, key, value) { 433 var re = new RegExp("([?|&])" + key + "=.*?(&|$)", "i"); 434 separator = uri.indexOf('?') !== -1 ? "&" : "?"; 435 if (uri.match(re)) { 436 return uri.replace(re, '$1' + key + "=" + value + '$2'); 437 } 438 else { 439 return uri + separator + key + "=" + value; 440 } 441} 442 443 444/* --- $VIDEOS --- */ 445 446function initVideos() { 447 448 var videos = $('iframe[src*="youtube.com"], iframe[src*="vimeo.com"], video'); 449 450 // Figure out and save aspect ratio for each video 451 videos.each(function() { 452 if( this.width != 0 && this.height != 0 ){ 453 $(this).data('aspectRatio', this.width / this.height) 454 // and remove the hard coded width/height 455 .removeAttr('height') 456 .removeAttr('width'); 457 } else { // for the conflict with jetpack set an default aspect ration of 16/9 458 $(this).data('aspectRatio', 16/9 ) 459 .removeAttr('height') 460 .removeAttr('width'); 461 } 462 }); 463 464 resizeVideos(); 465 466 // Firefox Opacity Video Hack 467 $('iframe[src*="youtube.com"], iframe[src*="vimeo.com"]').each(function(){ 468 var url = $(this).attr("src"); 469 470 $(this).attr("src", setQueryParameter(url, "wmode", "transparent")); 471 }); 472} 473 474 475function stickyHeader(){ 476 if($('body').hasClass('sticky-nav')){ 477 var sticky = $('.js-sticky'); 478 var offset = sticky.offset(); 479 var stickyHeight = sticky.height(); 480 481 sticky.parent().height(stickyHeight); 482 sticky.parent().css('margin-bottom', '24px'); 483 484 $(window).scroll(function() { 485 486 if ( $(window).scrollTop() > offset.top){ 487 sticky.addClass('sticky'); 488 } else { 489 sticky.removeClass('sticky'); 490 } 491 492 }); 493 } 494} 495 496function footerWidgetsTitles() { 497 $('.widget--footer__title .hN, .panel__title .hN').each(function() { 498 var $title = $(this), 499 text = $title.text(), 500 index = text.indexOf(" "); 501 if (index != -1) { 502 text = '<em>' + text.slice(0, index) + '</em>' + text.slice(text.indexOf(" "), text.length); 503 } else { 504 text = '<em>' + text + '</em>'; 505 } 506 $title.html(text); 507 }); 508} 509 510 511 512function popularPostsWidget() { 513 $('.wpgrade_popular_posts, .pixcode--tabs').organicTabs(); 514} 515 516//scan through the post meta tags and try to find the post image 517function getArticleImage() { 518 var metas = document.getElementsByTagName('meta'); 519 520 for (i=0; i<metas.length; i++) { 521 if (metas[i].getAttribute("property") == "og:image") { 522 return metas[i].getAttribute("content"); 523 } else if (metas[i].getAttribute("property") == "image") { 524 return metas[i].getAttribute("content"); 525 } else if (metas[i].getAttribute("property") == "twitter:image:src") { 526 return metas[i].getAttribute("content"); 527 } 528 } 529 530 return ""; 531} 532 533/* --- Load AddThis Async --- */ 534function loadAddThisScript() { 535 if (window.addthis) { 536 // Listen for the ready event 537 addthis.addEventListener('addthis.ready', addthisReady); 538 addthis.init(); 539 } 540} 541 542/* --- AddThis On Ready - The API is fully loaded --- */ 543//only fire this the first time we load the AddThis API - even when using ajax 544function addthisReady( obj ) { 545 addThisInit(obj); 546} 547 548/* --- AddThis Init --- */ 549function addThisInit(obj) { 550 if (window.addthis) { 551 addthis.toolbox('.addthis_toolbox'); 552 } 553} 554 555// Mega-Menu Hover with delay 556function megaMenusHover() { 557 $('.nav--main > li').hoverIntent({ 558 interval: 100, 559 timeout: 300, 560 over: showMegaMenu, 561 out: hideMegaMenu, 562 }) 563 564 function showMegaMenu() { 565 var self = $(this); 566 self.removeClass('hidden'); 567 setTimeout(function(){ 568 self.addClass('open'); 569 }, 50); 570 } 571 function hideMegaMenu() { 572 var self = $(this); 573 self.removeClass('open'); 574 setTimeout(function(){ 575 self.addClass('hidden'); 576 }, 150); 577 } 578} 579 580 581/* ====== INITIALIZE ====== */ 582
583function init() { 584 585 /* GLOBAL VARS */ 586 touch = false; 587 588 /* GET BROWSER DIMENSIONS */ 589 browserSize(); 590 591 /* DETECT PLATFORM */ 592 platformDetect(); 593 594 /* Overthrow Polyfill */ 595 overthrow.set(); 596 597 loadAddThisScript(); 598 599 FastClick.attach(document.body); 600 601 if (is_android) { 602 $('html').addClass('android-browser'); 603 } else { 604 $('html').addClass('no-android-browser'); 605 } 606 607 /* Retina Logo */ 608 var is_retina = (window.retina || window.devicePixelRatio > 1); 609 610 if (is_retina && $('.site-logo--image-2x').length) { 611 var image = $('.site-logo--image-2x').find('img'); 612 613 if (image.data('logo2x') !== undefined && image.data('logo2x').length) { 614 image.attr('src', image.data('logo2x')); 615 image.addClass('has--2x-image'); 616 } 617 } 618 619 /* Mega Menu */ 620 megaMenusHover(); 621 622 /* ONE TIME EVENT HANDLERS */ 623 eventHandlersOnce(); 624 625 /* INSTANTIATE EVENT HANDLERS */ 626 eventHandlers(); 627 628 /* INSTANTIATE RILOADR (lazy loading and responsive images) */ 629 Riload.init(); 630 631 if($('body').hasClass('custom-background')){ 632 if($('body').css('background-repeat') == 'no-repeat') { 633 $('body').addClass('background-cover'); 634 } 635 } 636 637}; 638 639 640 641 642 643/* ====== CONDITIONAL LOADING ====== */ 644 645function loadUp(){ 646 647 initVideos(); 648 footerWidgetsTitles(); 649 650 //Set textareas to autosize 651 if($("textarea").length) { $("textarea").autosize(); } 652 653 // if blog archive 654 if ($('.masonry').length && !lteie9 && !is_android) 655 salvattore(); 656 657 //lets test first if we have some riloadr images to work on 658 if ($('.riloadr-slider').length > 0) { 659 var riloadrSlider = new Riloadr({ 660 name : 'riloadr-slider', 661 breakpoints: [ 662 {name: 'small' /*post-medium */ , minWidth: 901}, 663 {name: 'big' /*post-medium */ , maxWidth: 900} 664 ], 665 watchViewportWidth: "*", 666 oncomplete: function(){ 667 if(royalSliderBillboardInitiated == false) 668 royalSliderBillboardInit(); 669 } 670 }); 671 } else { 672 //we may as well initiate the billboard slider 673 if(royalSliderBillboardInitiated == false) 674 royalSliderBillboardInit(); 675 }; 676 677 royalSliderInit(); 678 magnificPopupInit(); 679 680 stickyHeader(); 681} 682 683 684 685 686/* ====== EVENT HANDLERS ====== */ 687 688function eventHandlersOnce() { 689 690 /* NAVIGATION MOBILE */ 691 // if (touch || ($(window).width() < 900)) { 692 var windowHeigth = $(window).height(); 693 694 $('.js-nav-trigger').bind('click', function(e) { 695 e.preventDefault(); 696 e.stopPropagation(); 697 698 if($('html').hasClass('navigation--is-visible')){ 699 $('#page').css('height', ''); 700 $('html').removeClass('navigation--is-visible'); 701 702 } else { 703 $('#page').height(windowHeigth); 704 $('html').addClass('navigation--is-visible'); 705 } 706 }); 707 708 $('.wrapper').bind('click', function(e) { 709 if ($('html').hasClass('navigation--is-visible')) { 710 711 e.preventDefault(); 712 e.stopPropagation(); 713 714 $('#page').css('height', ''); 715 $('html').removeClass('navigation--is-visible'); 716 } 717 }); 718 // } 719 720 721 // Mega Menu Slider Size 722 $('.nav--main .nav__item').on('hover', function() { 723 $(this).parent().find('.js-pixslider').each(function() { 724 var slider = $(this).data('royalSlider'); 725 slider.updateSliderSize(); 726 }); 727 }); 728 729}; 730 731function eventHandlers(){}; 732 733 734 735 736/* ====== ON DOCUMENT READY ====== */ 737 738$(function(){ 739 740 /* --- INITIALIZE --- */ 741 init(); 742 743 /* --- CONDITIONAL LOADING --- */ 744 loadUp(); 745 746 setTimeout(function(){ 747 $('html').addClass('document-ready'); 748 }, 300); 749}); 750 751 752 753/* ====== ON WINDOW LOAD ====== */ 754 755$(window).load(function(){ 756 popularPostsWidget(); 757}); 758 759 760 761 762/* ====== ON RESIZE ====== */ 763 764$(window).on("debouncedresize", function(e){ 765 resizeVideos(); 766 slider_billboard(); 767}); 768 769 770 771/* ====== ON SCROLL ====== */ 772 773//$(window).scroll(function(e){}); 774 775// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ 776// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating 777 778// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel 779 780// MIT license 781 782(function() { 783 var lastTime = 0; 784 var vendors = ['ms', 'moz', 'webkit', 'o']; 785 for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { 786 window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; 787 window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] 788 || window[vendors[x]+'CancelRequestAnimationFrame']; 789 } 790 791 if (!window.requestAnimationFrame) 792 window.requestAnimationFrame = function(callback, element) { 793 var currTime = new Date().getTime(); 794 var timeToCall = Math.max(0, 16 - (currTime - lastTime)); 795 var id = window.setTimeout(function() { callback(currTime + timeToCall); }, 796 timeToCall); 797 lastTime = currTime + timeToCall; 798 return id; 799 }; 800 801 if (!window.cancelAnimationFrame) 802 window.cancelAnimationFrame = function(id) { 803 clearTimeout(id); 804 }; 805}()); 806 807// returns the depth of the element "e" relative to element with id=id 808// for this calculation only parents with classname = waypoint are considered 809function getLevelDepth(e, id, waypoint, cnt) { 810 cnt = cnt || 0; 811 if (e.id.indexOf(id) >= 0) return cnt; 812 if ($(e).hasClass(waypoint)) { 813 ++cnt; 814 } 815 return e.parentNode && getLevelDepth(e.parentNode, id, waypoint, cnt); 816} 817 818// returns the closest element to 'e' that has class "classname" 819function closest(e, classname) { 820 if ($(e).hasClass(classname)) { 821 return e; 822 } 823 return e.parentNode && closest(e.parentNode, classname); 824} 825 826})(jQuery, window); 827// /* ====== HELPER FUNCTIONS ====== */ 828 829//similar to PHP's empty function 830function empty(data) { 831 if (typeof(data) == 'number' || typeof(data) == 'boolean') { 832 return false;
833 } 834 if (typeof(data) == 'undefined' || data === null) { 835 return true; 836 } 837 if (typeof(data.length) != 'undefined') { 838 return data.length === 0; 839 } 840 var count = 0; 841 for (var i in data) { 842 // if(data.hasOwnProperty(i)) 843 // 844 // This doesn't work in ie8/ie9 due the fact that hasOwnProperty works only on native objects. 845 // http://stackoverflow.com/questions/8157700/object-has-no-hasownproperty-method-i-e-its-undefined-ie8 846 // 847 // for hosts objects we do this 848 if (Object.prototype.hasOwnProperty.call(data, i)) { 849 count++; 850 } 851 } 852 return count === 0; 853} 854 855function extend(a, b) { 856 for (var key in b) { 857 if (b.hasOwnProperty(key)) { 858 a[key] = b[key]; 859 } 860 } 861 return a; 862} 863 864// taken from https://github.com/inuyaksa/jquery.nicescroll/blob/master/jquery.nicescroll.js 865function hasParent(e, id) { 866 if (!e) return false; 867 var el = e.target || e.srcElement || e || false; 868 while (el && el.id != id) { 869 el = el.parentNode || false; 870 } 871 return (el !== false); 872} 873 874function mobilecheck() { 875 var check = false; 876 (function (a) { 877 if (/(android|ipad|playbook|silk|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4)))check = true; 878 })(navigator.userAgent || navigator.vendor || window.opera); 879 return check; 880} 881 882/* --- Set Query Parameter--- */ 883function setQueryParameter(uri, key, value) { 884 var re = new RegExp("([?|&])" + key + "=.*?(&|$)", "i"); 885 separator = uri.indexOf('?') !== -1 ? "&" : "?"; 886 if (uri.match(re)) { 887 return uri.replace(re, '$1' + key + "=" + value + '$2'); 888 } 889 else { 890 return uri + separator + key + "=" + value; 891 } 892} 893 894function resizeVideos() { 895 896 var videos = jQuery('iframe[src*="youtube.com"], iframe[src*="youtube-nocookie.com"], iframe[src*="vimeo.com"], video'); 897 898 videos.each(function() { 899 var video = jQuery(this), 900 ratio = video.data('aspectRatio'), 901 w = video.css('width', '100%').width(), 902 h = w/ratio; 903 video.height(h); 904 }); 905} 906/* Polyfill to remove click delays on browsers with touch UIs. 907 @version 0.6.7 908 @codingstandard ftlabs-jsv2 909 @copyright The Financial Times Limited [All Rights Reserved] 910 @license MIT License (see LICENSE.txt) 911 */ 912function FastClick(a){var b,c=this;this.trackingClick=!1;this.trackingClickStart=0;this.targetElement=null;this.lastTouchIdentifier=this.touchStartY=this.touchStartX=0;this.layer=a;if(!a||!a.nodeType)throw new TypeError("Layer must be a document node");this.onClick=function(){return FastClick.prototype.onClick.apply(c,arguments)};this.onMouse=function(){return FastClick.prototype.onMouse.apply(c,arguments)};this.onTouchStart=function(){return FastClick.prototype.onTouchStart.apply(c,arguments)};this.onTouchEnd= 913 function(){return FastClick.prototype.onTouchEnd.apply(c,arguments)};this.onTouchCancel=function(){return FastClick.prototype.onTouchCancel.apply(c,arguments)};FastClick.notNeeded(a)||(this.deviceIsAndroid&&(a.addEventListener("mouseover",this.onMouse,!0),a.addEventListener("mousedown",this.onMouse,!0),a.addEventListener("mouseup",this.onMouse,!0)),a.addEventListener("click",this.onClick,!0),a.addEventListener("touchstart",this.onTouchStart,!1),a.addEventListener("touchend",this.onTouchEnd,!1),a.addEventListener("touchcancel", 914 this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(a.removeEventListener=function(d,b,c){var e=Node.prototype.removeEventListener;"click"===d?e.call(a,d,b.hijacked||b,c):e.call(a,d,b,c)},a.addEventListener=function(b,c,f){var e=Node.prototype.addEventListener;"click"===b?e.call(a,b,c.hijacked||(c.hijacked=function(a){a.prop
914agationStopped||c(a)}),f):e.call(a,b,c,f)}),"function"===typeof a.onclick&&(b=a.onclick,a.addEventListener("click",function(a){b(a)},!1),a.onclick=null))} 915FastClick.prototype.deviceIsAndroid=0<navigator.userAgent.indexOf("Android");FastClick.prototype.deviceIsIOS=/iP(ad|hone|od)/.test(navigator.userAgent);FastClick.prototype.deviceIsIOS4=FastClick.prototype.deviceIsIOS&&/OS 4_\d(_\d)?/.test(navigator.userAgent);FastClick.prototype.deviceIsIOSWithBadTarget=FastClick.prototype.deviceIsIOS&&/OS ([6-9]|\d{2})_\d/.test(navigator.userAgent); 916FastClick.prototype.needsClick=function(a){switch(a.nodeName.toLowerCase()){case "button":case "select":case "textarea":if(a.disabled)return!0;break;case "input":if(this.deviceIsIOS&&"file"===a.type||a.disabled)return!0;break;case "label":case "video":return!0}return/\bneedsclick\b/.test(a.className)}; 917FastClick.prototype.needsFocus=function(a){switch(a.nodeName.toLowerCase()){case "textarea":case "select":return!0;case "input":switch(a.type){case "button":case "checkbox":case "file":case "image":case "radio":case "submit":return!1}return!a.disabled&&!a.readOnly;default:return/\bneedsfocus\b/.test(a.className)}}; 918FastClick.prototype.sendClick=function(a,b){var c,d;document.activeElement&&document.activeElement!==a&&document.activeElement.blur();d=b.changedTouches[0];c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,1,d.screenX,d.screenY,d.clientX,d.clientY,!1,!1,!1,!1,0,null);c.forwardedTouchEvent=!0;a.dispatchEvent(c)};FastClick.prototype.focus=function(a){var b;this.deviceIsIOS&&a.setSelectionRange?(b=a.value.length,a.setSelectionRange(b,b)):a.focus()}; 919FastClick.prototype.updateScrollParent=function(a){var b,c;b=a.fastClickScrollParent;if(!b||!b.contains(a)){c=a;do{if(c.scrollHeight>c.offsetHeight){b=c;a.fastClickScrollParent=c;break}c=c.parentElement}while(c)}b&&(b.fastClickLastScrollTop=b.scrollTop)};FastClick.prototype.getTargetElementFromEventTarget=function(a){return a.nodeType===Node.TEXT_NODE?a.parentNode:a}; 920FastClick.prototype.onTouchStart=function(a){var b,c,d;if(1<a.targetTouches.length)return!0;b=this.getTargetElementFromEventTarget(a.target);c=a.targetTouches[0];if(this.deviceIsIOS){d=window.getSelection();if(d.rangeCount&&!d.isCollapsed)return!0;if(!this.deviceIsIOS4){if(c.identifier===this.lastTouchIdentifier)return a.preventDefault(),!1;this.lastTouchIdentifier=c.identifier;this.updateScrollParent(b)}}this.trackingClick=!0;this.trackingClickStart=a.timeStamp;this.targetElement=b;this.touchStartX= 921 c.pageX;this.touchStartY=c.pageY;200>a.timeStamp-this.lastClickTime&&a.preventDefault();return!0};FastClick.prototype.touchHasMoved=function(a){a=a.changedTouches[0];return 10<Math.abs(a.pageX-this.touchStartX)||10<Math.abs(a.pageY-this.touchStartY)?!0:!1};FastClick.prototype.findControl=function(a){return void 0!==a.control?a.control:a.htmlFor?document.getElementById(a.htmlFor):a.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")}; 922FastClick.prototype.onTouchEnd=function(a){var b,c,d;d=this.targetElement;this.touchHasMoved(a)&&(this.trackingClick=!1,this.targetElement=null);if(!this.trackingClick)return!0;if(200>a.timeStamp-this.lastClickTime)return this.cancelNextClick=!0;this.lastClickTime=a.timeStamp;b=this.trackingClickStart;this.trackingClick=!1;this.trackingClickStart=0;this.deviceIsIOSWithBadTarget&&(d=a.changedTouches[0],d=document.elementFromPoint(d.pageX-window.pageXOffset,d.pageY-window.pageYOffset));c=d.tagName.toLowerCase(); 923 if("label"===c){if(b=this.findControl(d)){this.focus(d);if(this.deviceIsAndroid)return!1;d=b}}else if(this.needsFocus(d)){if(100<a.timeStamp-b||this.deviceIsIOS&&window.top!==window&&"input"===c)return this.targetElement=null,!1;this.focus(d);if(!this.deviceIsIOS4||"select"!==c)this.targetElement=null,a.preventDefault();return!1}if(this.deviceIsIOS&&!this.deviceIsIOS4&&(b=d.fastClickScrollParent)&&b.fastClickLastScrollTop!==b.scrollTop)return!0;this.needsClick(d)||(a.preventDefault(),this.sendClick(d, 924 a));return!1};FastClick.prototype.onTouchCancel=function(){this.trackingClick=!1;this.targetElement=null};FastClick.prototype.onMouse=function(a){return!this.targetElement||a.forwardedTouchEvent||!a.cancelable?!0:!this.needsClick(this.targetElement)||this.cancelNextClick?(a.stopImmediatePropagation?a.stopImmediatePropagation():a.propagationStopped=!0,a.stopPropagation(),a.preventDefault(),!1):!0};
925FastClick.prototype.onClick=function(a){if(this.trackingClick)return this.targetElement=null,this.trackingClick=!1,!0;if("submit"===a.target.type&&0===a.detail)return!0;a=this.onMouse(a);a||(this.targetElement=null);return a}; 926FastClick.prototype.destroy=function(){var a=this.layer;this.deviceIsAndroid&&(a.removeEventListener("mouseover",this.onMouse,!0),a.removeEventListener("mousedown",this.onMouse,!0),a.removeEventListener("mouseup",this.onMouse,!0));a.removeEventListener("click",this.onClick,!0);a.removeEventListener("touchstart",this.onTouchStart,!1);a.removeEventListener("touchend",this.onTouchEnd,!1);a.removeEventListener("touchcancel",this.onTouchCancel,!1)}; 927FastClick.notNeeded=function(a){var b;if("undefined"===typeof window.ontouchstart)return!0;if(/Chrome\/[0-9]+/.test(navigator.userAgent))if(FastClick.prototype.deviceIsAndroid){if((b=document.querySelector("meta[name=viewport]"))&&-1!==b.content.indexOf("user-scalable=no"))return!0}else return!0;return"none"===a.style.msTouchAction?!0:!1};FastClick.attach=function(a){return new FastClick(a)}; 928"undefined"!==typeof define&&define.amd?define(function(){return FastClick}):"undefined"!==typeof module&&module.exports?(module.exports=FastClick.attach,module.exports.FastClick=FastClick):window.FastClick=FastClick; 929/* hoverIntent r7 // 2013.03.11 // jQuery 1.9.1+ 930 * http://cherne.net/brian/resources/jquery.hoverIntent.html 931 * 932 * You may use hoverIntent under the terms of the MIT license. 933 * Copyright 2007, 2013 Brian Cherne 934 */ 935(function(e){e.fn.hoverIntent=function(t,n,r){var i={interval:100,sensitivity:7,timeout:0};if(typeof t==="object"){i=e.extend(i,t)}else if(e.isFunction(n)){i=e.extend(i,{over:t,out:n,selector:r})}else{i=e.extend(i,{over:t,out:t,selector:n})}var s,o,u,a;var f=function(e){s=e.pageX;o=e.pageY};var l=function(t,n){n.hoverIntent_t=clearTimeout(n.hoverIntent_t);if(Math.abs(u-s)+Math.abs(a-o)<i.sensitivity){e(n).off("mousemove.hoverIntent",f);n.hoverIntent_s=1;return i.over.apply(n,[t])}else{u=s;a=o;n.hoverIntent_t=setTimeout(function(){l(t,n)},i.interval)}};var c=function(e,t){t.hoverIntent_t=clearTimeout(t.hoverIntent_t);t.hoverIntent_s=0;return i.out.apply(t,[e])};var h=function(t){var n=jQuery.extend({},t);var r=this;if(r.hoverIntent_t){r.hoverIntent_t=clearTimeout(r.hoverIntent_t)}if(t.type=="mouseenter"){u=n.pageX;a=n.pageY;e(r).on("mousemove.hoverIntent",f);if(r.hoverIntent_s!=1){r.hoverIntent_t=setTimeout(function(){l(n,r)},i.interval)}}else{e(r).off("mousemove.hoverIntent",f);if(r.hoverIntent_s==1){r.hoverIntent_t=setTimeout(function(){c(n,r)},i.timeout)}}};return this.on({"mouseenter.hoverIntent":h,"mouseleave.hoverIntent":h},i.selector)}})(jQuery); 936/* 937 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ 938 * 939 * Uses the built in easing capabilities added In jQuery 1.1 940 * to offer multiple easing options 941 * 942 * TERMS OF USE - jQuery Easing 943 * 944 * Open source under the BSD License. 945 * 946 * Copyright é 2008 George McGinley Smith 947 * All rights reserved. 948 * 949 * Redistribution and use in source and binary forms, with or without modification, 950 * are permitted provided that the following conditions are met: 951 * 952 * Redistributions of source code must retain the above copyright notice, this list of 953 * conditions and the following disclaimer. 954 * Redistributions in binary form must reproduce the above copyright notice, this list 955 * of conditions and the following disclaimer in the documentation and/or other materials 956 * provided with the distribution. 957 * 958 * Neither the name of the author nor the names of contributors may be used to endorse 959 * or promote products derived from this software without specific prior written permission. 960 * 961 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 962 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 963 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 964 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 965 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 966 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 967 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 968 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 969 * OF THE POSSIBILITY OF SUCH DAMAGE. 970 * 971 */ 972 973// t: current time, b: begInnIng value, c: change In value, d: duration 974jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d);},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b;},easeOutQuad:function(x,t,b,c,d){return -c*(t/=d)*(t-2)+b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t+b;}return -c/2*((--t)*(t-2)-1)+b;},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b;},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t+b;}return c/2*((t-=2)*t*t+2)+b;},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutQuart:function(x,t,b,c,d){return -c*((t=t/d-1)*t*t*t-1)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t+b;}return -c/2*((t-=2)*t*t*t-2)+b;},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b;},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t*t+b;}return c/2*((t-=2)*t*t*t*t+2)+b;},easeInSine:function(x,t,b,c,d){return -c*Math.cos(t/d*(Math.PI/2))+c+b;},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b;},easeInOutSine:function(x,t,b,c,d){return -c/2*(Math.cos(Math.PI*t/d)-1)+b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0){return b;}if(t==d){return b+c;}if((t/=d/2)<1){return c/2*Math.pow(2,10*(t-1))+b;}return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeInCirc:function(x,t,b,c,d){return -c*(Math.sqrt(1-(t/=d)*t)-1)+b;},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1){return -c/2*(Math.sqrt(1-t*t)-1)+b;}return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0){return b;}if((t/=d)==1){return b+c;}if(!p){p=d*0.3;}if(a<Math.abs(c)){a=c;var s=p/4;}else{var s=p/(2*Math.PI)*Math.asin(c/a);}return -(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0){return b;}if((t/=d)==1){return b+c;}if(!p){p=d*0.3;}if(a<Math.abs(c)){a=c;var s=p/4;}else{var s=p/(2*Math.PI)*Math.asin(c/a);}return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0){return b;}if((t/=d/2)==2){return b+c;}if(!p){p=d*(0.3*1.5);}if(a<Math.abs(c)){a=c;var s=p/4;}else{var s=p/(2*Math.PI)*Math.asin(c/a);}if(t<1){return -0.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;}return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*0.5+c+b;}
974,easeInBack:function(x,t,b,c,d,s){if(s==undefined){s=1.70158;}return c*(t/=d)*t*((s+1)*t-s)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined){s=1.70158;}return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined){s=1.70158;}if((t/=d/2)<1){return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;}return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b;},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else{if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+0.75)+b;}else{if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+0.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+0.984375)+b;}}}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2){return jQuery.easing.easeInBounce(x,t*2,0,c,d)*0.5+b;}return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*0.5+c*0.5+b;}}); 975// Magnific Popup v0.9.9 by Dmitry Semenov 976// http://bit.ly/magnific-popup#build=image+ajax+iframe+gallery+retina+fastclick 977// MIT License 978(function(a){var b="Close",c="BeforeClose",d="AfterClose",e="BeforeAppend",f="MarkupParse",g="Open",h="Change",i="mfp",j="."+i,k="mfp-ready",l="mfp-removing",m="mfp-prevent-close",n,o=function(){},p=!!window.jQuery,q,r=a(window),s,t,u,v,w,x=function(a,b){n.ev.on(i+a+j,b)},y=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},z=function(b,c){n.ev.triggerHandler(i+b,c),n.st.callbacks&&(b=b.charAt(0).toLowerCase()+b.slice(1),n.st.callbacks[b]&&n.st.callbacks[b].apply(n,a.isArray(c)?c:[c]))},A=function(b){if(b!==w||!n.currTemplate.closeBtn)n.currTemplate.closeBtn=a(n.st.closeMarkup.replace("%title%",n.st.tClose)),w=b;return n.currTemplate.closeBtn},B=function(){a.magnificPopup.instance||(n=new o,n.init(),a.magnificPopup.instance=n)},C=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(a.transition!==undefined)return!0;while(b.length)if(b.pop()+"Transition"in a)return!0;return!1};o.prototype={constructor:o,init:function(){var b=navigator.appVersion;n.isIE7=b.indexOf("MSIE 7.")!==-1,n.isIE8=b.indexOf("MSIE 8.")!==-1,n.isLowIE=n.isIE7||n.isIE8,n.isAndroid=/android/gi.test(b),n.isIOS=/iphone|ipad|ipod/gi.test(b),n.supportsTransition=C(),n.probablyMobile=n.isAndroid||n.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),t=a(document),n.popupsCache={}},open:function(b){s||(s=a(document.body));var c;if(b.isObj===!1){n.items=b.items.toArray(),n.index=0;var d=b.items,e;for(c=0;c<d.length;c++){e=d[c],e.parsed&&(e=e.el[0]);if(e===b.el[0]){n.index=c;break}}}else n.items=a.isArray(b.items)?b.items:[b.items],n.index=b.index||0;if(n.isOpen){n.updateItemHTML();return}n.types=[],v="",b.mainEl&&b.mainEl.length?n.ev=b.mainEl.eq(0):n.ev=t,b.key?(n.popupsCache[b.key]||(n.popupsCache[b.key]={}),n.currTemplate=n.popupsCache[b.key]):n.currTemplate={},n.st=a.extend(!0,{},a.magnificPopup.defaults,b),n.fixedContentPos=n.st.fixedContentPos==="auto"?!n.probablyMobile:n.st.fixedContentPos,n.st.modal&&(n.st.closeOnContentClick=!1,n.st.closeOnBgClick=!1,n.st.showCloseBtn=!1,n.st.enableEscapeKey=!1),n.bgOverlay||(n.bgOverlay=y("bg").on("click"+j,function(){n.close()}),n.wrap=y("wrap").attr("tabindex",-1).on("click"+j,function(a){n._checkIfClose(a.target)&&n.close()}),n.container=y("container",n.wrap)),n.contentContainer=y("content"),n.st.preloader&&(n.preloader=y("preloader",n.container,n.st.tLoading));var h=a.magnificPopup.modules;for(c=0;c<h.length;c++){var i=h[c];i=i.charAt(0).toUpperCase()+i.slice(1),n["init"+i].call(n)}z("BeforeOpen"),n.st.showCloseBtn&&(n.st.closeBtnInside?(x(f,function(a,b,c,d){c.close_replaceWith=A(d.type)}),v+=" mfp-close-btn-in"):n.wrap.append(A())),n.st.alignTop&&(v+=" mfp-align-top"),n.fixedContentPos?n.wrap.css({overflow:n.st.overflowY,overflowX:"hidden",overflowY:n.st.overflowY}):n.wrap.css({top:r.scrollTop(),position:"absolute"}),(n.st.fixedBgPos===!1||n.st.fixedBgPos==="auto"&&!n.fixedContentPos)&&n.bgOverlay.css({height:t.height(),position:"absolute"}),n.st.enableEscapeKey&&t.on("keyup"+j,function(a){a.keyCode===27&&n.close()}),r.on("resize"+j,function(){n.updateSize()}),n.st.closeOnContentClick||(v+=" mfp-auto-cursor"),v&&n.wrap.addClass(v);var l=n.wH=r.height(),m={};if(n.fixedContentPos&&n._hasScrollBar(l)){var o=n._getScrollbarSize();o&&(m.marginRight=o)}n.fixedContentPos&&(n.isIE7?a("body, html").css("overflow","hidden"):m.overflow="hidden");var p=n.st.mainClass;return n.isIE7&&(p+=" mfp-ie7"),p&&n._addClassToMFP(p),n.updateItemHTML(),z("BuildControls"),a("html").css(m),n.bgOverlay.add(n.wrap).prependTo(n.st.prepe
978ndTo||s),n._lastFocusedEl=document.activeElement,setTimeout(function(){n.content?(n._addClassToMFP(k),n._setFocus()):n.bgOverlay.addClass(k),t.on("focusin"+j,n._onFocusIn)},16),n.isOpen=!0,n.updateSize(l),z(g),b},close:function(){if(!n.isOpen)return;z(c),n.isOpen=!1,n.st.removalDelay&&!n.isLowIE&&n.supportsTransition?(n._addClassToMFP(l),setTimeout(function(){n._close()},n.st.removalDelay)):n._close()},_close:function(){z(b);var c=l+" "+k+" ";n.bgOverlay.detach(),n.wrap.detach(),n.container.empty(),n.st.mainClass&&(c+=n.st.mainClass+" "),n._removeClassFromMFP(c);if(n.fixedContentPos){var e={marginRight:""};n.isIE7?a("body, html").css("overflow",""):e.overflow="",a("html").css(e)}t.off("keyup"+j+" focusin"+j),n.ev.off(j),n.wrap.attr("class","mfp-wrap").removeAttr("style"),n.bgOverlay.attr("class","mfp-bg"),n.container.attr("class","mfp-container"),n.st.showCloseBtn&&(!n.st.closeBtnInside||n.currTemplate[n.currItem.type]===!0)&&n.currTemplate.closeBtn&&n.currTemplate.closeBtn.detach(),n._lastFocusedEl&&a(n._lastFocusedEl).focus(),n.currItem=null,n.content=null,n.currTemplate=null,n.prevHeight=0,z(d)},updateSize:function(a){if(n.isIOS){var b=document.documentElement.clientWidth/window.innerWidth,c=window.innerHeight*b;n.wrap.css("height",c),n.wH=c}else n.wH=a||r.height();n.fixedContentPos||n.wrap.css("height",n.wH),z("Resize")},updateItemHTML:function(){var b=n.items[n.index];n.contentContainer.detach(),n.content&&n.content.detach(),b.parsed||(b=n.parseEl(n.index));var c=b.type;z("BeforeChange",[n.currItem?n.currItem.type:"",c]),n.currItem=b;if(!n.currTemplate[c]){var d=n.st[c]?n.st[c].markup:!1;z("FirstMarkupParse",d),d?n.currTemplate[c]=a(d):n.currTemplate[c]=!0}u&&u!==b.type&&n.container.removeClass("mfp-"+u+"-holder");var e=n["get"+c.charAt(0).toUpperCase()+c.slice(1)](b,n.currTemplate[c]);n.appendContent(e,c),b.preloaded=!0,z(h,b),u=b.type,n.container.prepend(n.contentContainer),z("AfterChange")},appendContent:function(a,b){n.content=a,a?n.st.showCloseBtn&&n.st.closeBtnInside&&n.currTemplate[b]===!0?n.content.find(".mfp-close").length||n.content.append(A()):n.content=a:n.content="",z(e),n.container.addClass("mfp-"+b+"-holder"),n.contentContainer.append(n.content)},parseEl:function(b){var c=n.items[b],d;c.tagName?c={el:a(c)}:(d=c.type,c={data:c,src:c.src});if(c.el){var e=n.types;for(var f=0;f<e.length;f++)if(c.el.hasClass("mfp-"+e[f])){d=e[f];break}c.src=c.el.attr("data-mfp-src"),c.src||(c.src=c.el.attr("href"))}return c.type=d||n.st.type||"inline",c.index=b,c.parsed=!0,n.items[b]=c,z("ElementParse",c),n.items[b]},addGroup:function(a,b){var c=function(c){c.mfpEl=this,n._openClick(c,a,b)};b||(b={});var d="click.magnificPopup";b.mainEl=a,b.items?(b.isObj=!0,a.off(d).on(d,c)):(b.isObj=!1,b.delegate?a.off(d).on(d,b.delegate,c):(b.items=a,a.off(d).on(d,c)))},_openClick:function(b,c,d){var e=d.midClick!==undefined?d.midClick:a.magnificPopup.defaults.midClick;if(!e&&(b.which===2||b.ctrlKey||b.metaKey))return;var f=d.disableOn!==undefined?d.disableOn:a.magnificPopup.defaults.disableOn;if(f)if(a.isFunction(f)){if(!f.call(n))return!0}else if(r.width()<f)return!0;b.type&&(b.preventDefault(),n.isOpen&&b.stopPropagation()),d.el=a(b.mfpEl),d.delegate&&(d.items=c.find(d.delegate)),n.open(d)},updateStatus:function(a,b){if(n.preloader){q!==a&&n.container.removeClass("mfp-s-"+q),!b&&a==="loading"&&(b=n.st.tLoading);var c={status:a,text:b};z("UpdateStatus",c),a=c.status,b=c.text,n.preloader.html(b),n.preloader.find("a").on("click",function(a){a.stopImmediatePropagation()}),n.container.addClass("mfp-s-"+a),q=a}},_checkIfClose:function(b){if(a(b).hasClass(m))return;var c=n.st.closeOnContentClick,d=n.st.closeOnBgClick;if(c&&d)return!0;if(!n.content||a(b).hasClass("mfp-close")||n.preloader&&b===n.preloader[0])return!0;if(b!==n.content[0]&&!a.contains(n.content[0],b)){if(d&&a.contains(document,b))return!0}else if(c)return!0;return!1},_addClassToMFP:function(a){n.bgOverlay.addClass(a),n.wrap.addClass(a)},_removeClassFromMFP:function(a){this.bgOverlay.removeClass(a),n.wrap.removeClass(a)},_hasScrollBar:function(a){return(n.isIE7?t.height():document.body.scrollHeight)>
978(a||r.height())},_setFocus:function(){(n.st.focus?n.content.find(n.st.focus).eq(0):n.wrap).focus()},_onFocusIn:function(b){if(b.target!==n.wrap[0]&&!a.contains(n.wrap[0],b.target))return n._setFocus(),!1},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),z(f,[b,c,d]),a.each(c,function(a,c){if(c===undefined||c===!1)return!0;e=a.split("_");if(e.length>1){var d=b.find(j+"-"+e[0]);if(d.length>0){var f=e[1];f==="replaceWith"?d[0]!==c[0]&&d.replaceWith(c):f==="img"?d.is("img")?d.attr("src",c):d.replaceWith('<img src="'+c+'" class="'+d.attr("class")+'" />'):d.attr(e[1],c)}}else b.find(j+"-"+a).html(c)})},_getScrollbarSize:function(){if(n.scrollbarSize===undefined){var a=document.createElement("div");a.id="mfp-sbm",a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),n.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return n.scrollbarSize}},a.magnificPopup={instance:null,proto:o.prototype,modules:[],open:function(b,c){return B(),b?b=a.extend(!0,{},b):b={},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">×</button>',tClose:"Close (Esc)",tLoading:"Loading..."}},a.fn.magnificPopup=function(b){B();var c=a(this);if(typeof b=="string")if(b==="open"){var d,e=p?c.data("magnificPopup"):c[0].magnificPopup,f=parseInt(arguments[1],10)||0;e.items?d=e.items[f]:(d=c,e.delegate&&(d=d.find(e.delegate)),d=d.eq(f)),n._openClick({mfpEl:d},c,e)}else n.isOpen&&n[b].apply(n,Array.prototype.slice.call(arguments,1));else b=a.extend(!0,{},b),p?c.data("magnificPopup",b):c[0].magnificPopup=b,n.addGroup(c,b);return c};var D="ajax",E,F=function(){E&&s.removeClass(E)},G=function(){F(),n.req&&n.req.abort()};a.magnificPopup.registerModule(D,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){n.types.push(D),E=n.st.ajax.cursor,x(b+"."+D,G),x("BeforeChange."+D,G)},getAjax:function(b){E&&s.addClass(E),n.updateStatus("loading");var c=a.extend({url:b.src,success:function(c,d,e){var f={data:c,xhr:e};z("ParseAjax",f),n.appendContent(a(f.data),D),b.finished=!0,F(),n._setFocus(),setTimeout(function(){n.wrap.addClass(k)},16),n.updateStatus("ready"),z("AjaxContentAdded")},error:function(){F(),b.finished=b.loadError=!0,n.updateStatus("error",n.st.ajax.tError.replace("%url%",b.src))}},n.st.ajax.settings);return n.req=a.ajax(c),""}}});var H,I=function(b){if(b.data&&b.data.title!==undefined)return b.data.title;var c=n.st.image.titleSrc;if(c){if(a.isFunction(c))return c.call(n,b);if(b.el)return b.el.attr(c)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var a=n.st.image,c=".image";n.types.push("image"),x(g+c,function(){n.currItem.type==="image"&&a.cursor&&s.addClass(a.cursor)}),x(b+c,function(){a.cursor&&s.removeClass(a.cursor),r.off("resize"+j)}),x("Resize"+c,n.resizeImage),n.isLowIE&&x("AfterChange",n.resizeImage)},resizeImage:function(){var a=n.currItem;if(!a||!a.img)return;if(n.st.image.verticalFit){var b=0;n.isLowIE&&(b=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",n.wH-b)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,H&&clearInterval(H),a.isCheckingImgSize=!1,z("ImageHasSize",a),a.imgHidden&&(n.content&&n.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var b=0,c=a.img[0],d=function(e){H&&clearInterval(H),H=setInterval(function(){if(c.naturalWi
978dth>0){n._onImageHasSize(a);return}b>200&&clearInterval(H),b++,b===3?d(10):b===40?d(50):b===100&&d(500)},e)};d(1)},getImage:function(b,c){var d=0,e=function(){b&&(b.img[0].complete?(b.img.off(".mfploader"),b===n.currItem&&(n._onImageHasSize(b),n.updateStatus("ready")),b.hasSize=!0,b.loaded=!0,z("ImageLoadComplete")):(d++,d<200?setTimeout(e,100):f()))},f=function(){b&&(b.img.off(".mfploader"),b===n.currItem&&(n._onImageHasSize(b),n.updateStatus("error",g.tError.replace("%url%",b.src))),b.hasSize=!0,b.loaded=!0,b.loadError=!0)},g=n.st.image,h=c.find(".mfp-img");if(h.length){var i=document.createElement("img");i.className="mfp-img",b.img=a(i).on("load.mfploader",e).on("error.mfploader",f),i.src=b.src,h.is("img")&&(b.img=b.img.clone()),i=b.img[0],i.naturalWidth>0?b.hasSize=!0:i.width||(b.hasSize=!1)}return n._parseMarkup(c,{title:I(b),img_replaceWith:b.img},b),n.resizeImage(),b.hasSize?(H&&clearInterval(H),b.loadError?(c.addClass("mfp-loading"),n.updateStatus("error",g.tError.replace("%url%",b.src))):(c.removeClass("mfp-loading"),n.updateStatus("ready")),c):(n.updateStatus("loading"),b.loading=!0,b.hasSize||(b.imgHidden=!0,c.addClass("mfp-loading"),n.findImageSize(b)),c)}}});var J,K=function(){return J===undefined&&(J=document.createElement("p").style.MozTransform!==undefined),J};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a=n.st.zoom,d=".zoom",e;if(!a.enabled||!n.supportsTransition)return;var f=a.duration,g=function(b){var c=b.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+a.duration/1e3+"s "+a.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,c.css(e),c},h=function(){n.content.css("visibility","visible")},i,j;x("BuildControls"+d,function(){if(n._allowZoom()){clearTimeout(i),n.content.css("visibility","hidden"),e=n._getItemToZoom();if(!e){h();return}j=g(e),j.css(n._getOffset()),n.wrap.append(j),i=setTimeout(function(){j.css(n._getOffset(!0)),i=setTimeout(function(){h(),setTimeout(function(){j.remove(),e=j=null,z("ZoomAnimationEnded")},16)},f)},16)}}),x(c+d,function(){if(n._allowZoom()){clearTimeout(i),n.st.removalDelay=f;if(!e){e=n._getItemToZoom();if(!e)return;j=g(e)}j.css(n._getOffset(!0)),n.wrap.append(j),n.content.css("visibility","hidden"),setTimeout(function(){j.css(n._getOffset())},16)}}),x(b+d,function(){n._allowZoom()&&(h(),j&&j.remove(),e=null)})},_allowZoom:function(){return n.currItem.type==="image"},_getItemToZoom:function(){return n.currItem.hasSize?n.currItem.img:!1},_getOffset:function(b){var c;b?c=n.currItem.img:c=n.st.zoom.opener(n.currItem.el||n.currItem);var d=c.offset(),e=parseInt(c.css("padding-top"),10),f=parseInt(c.css("padding-bottom"),10);d.top-=a(window).scrollTop()-e;var g={width:c.width(),height:(p?c.innerHeight():c[0].offsetHeight)-f-e};return K()?g["-moz-transform"]=g.transform="translate("+d.left+"px,"+d.top+"px)":(g.left=d.left,g.top=d.top),g}}});var L="iframe",M="//about:blank",N=function(a){if(n.currTemplate[L]){var b=n.currTemplate[L].find("iframe");b.length&&(a||(b[0].src=M),n.isIE8&&b.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(L,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){n.types.push(L),x("BeforeChange",function(a,b,c){b!==c&&(b===L?N():c===L&&N(!0))}),x(b+"."+L,function(){N()})},getIframe:function(b,c){var d=b.src,e=n.st.iframe;a.each(e.patterns,function(){if(d.indexOf(this.index)>-1)return this.id&&(typeof this.id=="string"?d=d.substr(d.lastIndexOf(this.id)+this.id.length,d.length):d=this.id.call(this,d)),d=this.src.replace("%id%",d),!1});var f={};return e.srcAction&&(f[e.srcAction]=d),n._parseMarkup(c,f,b),n.updateStatus("ready"),c}}});var O=function(a){var b=n.items.length;return a>b-1?a-b:a<0?b+a:a},P=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=n.st.gallery,d=".mfp-gallery",e=Boolean(a.fn.mfpFastClick);n.direction=!0;if(!c||!c.enabled)return!1;v+=" mfp-gallery",x(g+d,function(){c.navigateByImgClick&&n.wrap.on("click"+
978d,".mfp-img",function(){if(n.items.length>1)return n.next(),!1}),t.on("keydown"+d,function(a){a.keyCode===37?n.prev():a.keyCode===39&&n.next()})}),x("UpdateStatus"+d,function(a,b){b.text&&(b.text=P(b.text,n.currItem.index,n.items.length))}),x(f+d,function(a,b,d,e){var f=n.items.length;d.counter=f>1?P(c.tCounter,e.index,f):""}),x("BuildControls"+d,function(){if(n.items.length>1&&c.arrows&&!n.arrowLeft){var b=c.arrowMarkup,d=n.arrowLeft=a(b.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(m),f=n.arrowRight=a(b.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(m),g=e?"mfpFastClick":"click";d[g](function(){n.prev()}),f[g](function(){n.next()}),n.isIE7&&(y("b",d[0],!1,!0),y("a",d[0],!1,!0),y("b",f[0],!1,!0),y("a",f[0],!1,!0)),n.container.append(d.add(f))}}),x(h+d,function(){n._preloadTimeout&&clearTimeout(n._preloadTimeout),n._preloadTimeout=setTimeout(function(){n.preloadNearbyImages(),n._preloadTimeout=null},16)}),x(b+d,function(){t.off(d),n.wrap.off("click"+d),n.arrowLeft&&e&&n.arrowLeft.add(n.arrowRight).destroyMfpFastClick(),n.arrowRight=n.arrowLeft=null})},next:function(){n.direction=!0,n.index=O(n.index+1),n.updateItemHTML()},prev:function(){n.direction=!1,n.index=O(n.index-1),n.updateItemHTML()},goTo:function(a){n.direction=a>=n.index,n.index=a,n.updateItemHTML()},preloadNearbyImages:function(){var a=n.st.gallery.preload,b=Math.min(a[0],n.items.length),c=Math.min(a[1],n.items.length),d;for(d=1;d<=(n.direction?c:b);d++)n._preloadItem(n.index+d);for(d=1;d<=(n.direction?b:c);d++)n._preloadItem(n.index-d)},_preloadItem:function(b){b=O(b);if(n.items[b].preloaded)return;var c=n.items[b];c.parsed||(c=n.parseEl(b)),z("LazyLoad",c),c.type==="image"&&(c.img=a('<img class="mfp-img" />').on("load.mfploader",function(){c.hasSize=!0}).on("error.mfploader",function(){c.hasSize=!0,c.loadError=!0,z("LazyLoadError",c)}).attr("src",c.src)),c.preloaded=!0}}});var Q="retina";a.magnificPopup.registerModule(Q,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=n.st.retina,b=a.ratio;b=isNaN(b)?b():b,b>1&&(x("ImageHasSize."+Q,function(a,c){c.img.css({"max-width":c.img[0].naturalWidth/b,width:"100%"})}),x("ElementParse."+Q,function(c,d){d.src=a.replaceSrc(d,b)}))}}}}),function(){var b=1e3,c="ontouchstart"in window,d=function(){r.off("touchmove"+f+" touchend"+f)},e="mfpFastClick",f="."+e;a.fn.mfpFastClick=function(e){return a(this).each(function(){var g=a(this),h;if(c){var i,j,k,l,m,n;g.on("touchstart"+f,function(a){l=!1,n=1,m=a.originalEvent?a.originalEvent.touches[0]:a.touches[0],j=m.clientX,k=m.clientY,r.on("touchmove"+f,function(a){m=a.originalEvent?a.originalEvent.touches:a.touches,n=m.length,m=m[0];if(Math.abs(m.clientX-j)>10||Math.abs(m.clientY-k)>10)l=!0,d()}).on("touchend"+f,function(a){d();if(l||n>1)return;h=!0,a.preventDefault(),clearTimeout(i),i=setTimeout(function(){h=!1},b),e()})})}g.on("click"+f,function(){h||e()})})},a.fn.destroyMfpFastClick=function(){a(this).off("touchstart"+f+" click"+f),c&&r.off("touchmove"+f+" touchend"+f)}}(),B()})(window.jQuery||window.Zepto); 979// --- MODIFIED 980// https://github.com/CSS-Tricks/jQuery-Organic-Tabs 981(function ($) { 982$.organicTabs = function (el, options) { 983 var base = this; 984 base.$el = $(el); 985 base.$nav = base.$el.find(".tabs__nav"); 986 base.init = function () { 987 base.options = $.extend({}, $.organicTabs.defaultOptions, options); 988 var $allListWrap = base.$el.find(".tabs__content"), 989 curList = base.$el.find("a.current").attr("href").substring(1); 990 $allListWrap.height(base.$el.find("#" + curList).height()); 991 992 base.$nav.find("li > a").click(function(event) { 993 994 995 var curList = base.$el.find("a.current").attr("href").substring(1), 996 $newList = $(this), 997 listID = $newList.attr("href").substring(1); 998 999 1000 if ((listID != curList) && (base.$el.find(":animated").length == 0)) { 1001 base.$el.find("#" + curList).css({ 1002 opacity: 0, 1003 "z-index": 10, 1004 display: "none", 1005 "pointer-events": "none" 1006 }); 1007 1008 setTimeout(function () { 1009 base.$el.find("#" + curList); 1010 base.$el.find("#" + listID).css({ 1011 opacity: 1, 1012 "z-index": 100, 1013 display: "block", 1014 "pointer-events": "auto" 1015 }); 1016 base.$el.find(".tabs__nav li a").removeClass("current"); 1017 $newList.addClass("current"); 1018 1019 var $tabSlider = base.$el.find("#" + listID).find('.js-pixslider'); 1020 if($tabSlider.length) {
1021 sliderUpdateSize($tabSlider); 1022 1023 setTimeout(function() { 1024 var newHeight = base.$el.find("#" + listID).height(); 1025 $allListWrap.css({ 1026 height: newHeight 1027 }); 1028 }, 200); 1029 } else { 1030 var newHeight = base.$el.find("#" + listID).height(); 1031 $allListWrap.css({ 1032 height: newHeight 1033 }); 1034 } 1035 1036 resizeVideos(); 1037 1038 1039 }, 250); 1040 } 1041 event.preventDefault(); 1042 }); 1043 }; 1044 base.init(); 1045}; 1046$.organicTabs.defaultOptions = { 1047 speed: 300 1048}; 1049$.fn.organicTabs = function (options) { 1050 return this.each(function () { 1051 (new $.organicTabs(this, options)); 1052 }); 1053}; 1054 1055})(jQuery); 1056/* --- $OVERTHROW --- */ 1057/* Overthrow. An overflow:auto polyfill for responsive design. 1058 * (c) 2012: Scott Jehl, Filament Group, Inc. 1059 */ 1060/* Detect */ 1061(function(w,undefined){var doc=w.document,docElem=doc.documentElement,enabledClassName="overthrow-enabled",canBeFilledWithPoly="ontouchmove"in doc,nativeOverflow="WebkitOverflowScrolling"in docElem.style||("msOverflowStyle"in docElem.style||(!canBeFilledWithPoly&&w.screen.width>800||function(){var ua=w.navigator.userAgent,webkit=ua.match(/AppleWebKit\/([0-9]+)/),wkversion=webkit&&webkit[1],wkLte534=webkit&&wkversion>=534;return ua.match(/Android ([0-9]+)/)&&(RegExp.$1>=3&&wkLte534)||(ua.match(/ Version\/([0-9]+)/)&& 1062 (RegExp.$1>=0&&(w.blackberry&&wkLte534))||(ua.indexOf("PlayBook")>-1&&(wkLte534&&!ua.indexOf("Android 2")===-1)||(ua.match(/Firefox\/([0-9]+)/)&&RegExp.$1>=4||(ua.match(/wOSBrowser\/([0-9]+)/)&&(RegExp.$1>=233&&wkLte534)||ua.match(/NokiaBrowser\/([0-9\.]+)/)&&(parseFloat(RegExp.$1)===7.3&&(webkit&&wkversion>=533))))))}()));w.overthrow={};w.overthrow.enabledClassName=enabledClassName;w.overthrow.addClass=function(){if(docElem.className.indexOf(w.overthrow.enabledClassName)===-1)docElem.className+= 1063 " "+w.overthrow.enabledClassName};w.overthrow.removeClass=function(){docElem.className=docElem.className.replace(w.overthrow.enabledClassName,"")};w.overthrow.set=function(){if(nativeOverflow)w.overthrow.addClass()};w.overthrow.canBeFilledWithPoly=canBeFilledWithPoly;w.overthrow.forget=function(){w.overthrow.removeClass()};w.overthrow.support=nativeOverflow?"native":"none"})(this); 1064 1065/* Polifyll */
1066(function(w,o,undefined){if(o===undefined)return;o.scrollIndicatorClassName="overthrow";var doc=w.document,docElem=doc.documentElement,nativeOverflow=o.support==="native",canBeFilledWithPoly=o.canBeFilledWithPoly,configure=o.configure,set=o.set,forget=o.forget,scrollIndicatorClassName=o.scrollIndicatorClassName;o.closest=function(target,ascend){return!ascend&&(target.className&&(target.className.indexOf(scrollIndicatorClassName)>-1&&target))||o.closest(target.parentNode)};var enabled=false;o.set= 1067 function(){set();if(enabled||(nativeOverflow||!canBeFilledWithPoly))return;w.overthrow.addClass();enabled=true;o.support="polyfilled";o.forget=function(){forget();enabled=false;if(doc.removeEventListener)doc.removeEventListener("touchstart",start,false)};var elem,lastTops=[],lastLefts=[],lastDown,lastRight,resetVertTracking=function(){lastTops=[];lastDown=null},resetHorTracking=function(){lastLefts=[];lastRight=null},inputs,setPointers=function(val){inputs=elem.querySelectorAll("textarea, input"); 1068 for(var i=0,il=inputs.length;i<il;i++)inputs[i].style.pointerEvents=val},changeScrollTarget=function(startEvent,ascend){if(doc.createEvent){var newTarget=(!ascend||ascend===undefined)&&elem.parentNode||(elem.touchchild||elem),tEnd;if(newTarget!==elem){tEnd=doc.createEvent("HTMLEvents");tEnd.initEvent("touchend",true,true);elem.dispatchEvent(tEnd);newTarget.touchchild=elem;elem=newTarget;newTarget.dispatchEvent(startEvent)}}},start=function(e){if(o.intercept)o.intercept();resetVertTracking();resetHorTracking(); 1069 elem=o.closest(e.target);if(!elem||(elem===docElem||e.touches.length>1))return;setPointers("none");var touchStartE=e,scrollT=elem.scrollTop,scrollL=elem.scrollLeft,height=elem.offsetHeight,width=elem.offsetWidth,startY=e.touches[0].pageY,startX=e.touches[0].pageX,scrollHeight=elem.scrollHeight,scrollWidth=elem.scrollWidth,move=function(e){var ty=scrollT+startY-e.touches[0].pageY,tx=scrollL+startX-e.touches[0].pageX,down=ty>=(lastTops.length?lastTops[0]:0),right=tx>=(lastLefts.length?lastLefts[0]: 1070 0);if(ty>0&&ty<scrollHeight-height||tx>0&&tx<scrollWidth-width)e.preventDefault();else changeScrollTarget(touchStartE);if(lastDown&&down!==lastDown)resetVertTracking();if(lastRight&&right!==lastRight)resetHorTracking();lastDown=down;lastRight=right;elem.scrollTop=ty;elem.scrollLeft=tx;lastTops.unshift(ty);lastLefts.unshift(tx);if(lastTops.length>3)lastTops.pop();if(lastLefts.length>3)lastLefts.pop()},end=function(e){setPointers("auto");setTimeout(function(){setPointers("none")},450);elem.removeEventListener("touchmove", 1071 move,false);elem.removeEventListener("touchend",end,false)};elem.addEventListener("touchmove",move,false);elem.addEventListener("touchend",end,false)};doc.addEventListener("touchstart",start,false)}})(this,this.overthrow); 1072 1073/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */ 1074/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */ 1075window.matchMedia=window.matchMedia||function(a){"use strict";var c,d=a.documentElement,e=d.firstElementChild||d.firstChild,f=a.createElement("body"),g=a.createElement("div");return g.id="mq-test-1",g.style.cssText="position:absolute;top:-100em",f.style.background="none",f.appendChild(g),function(a){return g.innerHTML='­<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',d.insertBefore(f,e),c=42===g.offsetWidth,d.removeChild(f),{matches:c,media:a}}}(document); 1076 1077/*! Respond.js v1.3.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */ 1078(function(a){"use strict";function x(){u(!0)}var b={};if(a.respond=b,b.update=function(){},b.mediaQueriesSupported=a.matchMedia&&a.matchMedia("only all").matches,!b.mediaQueriesSupported){var q,r,t,c=a.document,d=c.documentElement,e=[],f=[],g=[],h={},i=30,j=c.getElementsByTagName("head")[0]||d,k=c.getElementsByTagName("base")[0],l=j.getElementsByTagName("link"),m=[],n=function(){for(var b=0;l.length>b;b++){var c=l[b],d=c.href,e=c.media,f=c.rel&&"stylesheet"===c.rel.toLowerCase();d&&f&&!h[d]&&(c.styleSheet&&c.styleSheet.rawCssText?(p(c.styleSheet.rawCssText,d,e),h[d]=!0):(!/^([a-zA-Z:]*\/\/)/.test(d)&&!k||d.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&m.push({href:d,media:e}))}o()},o=function(){if(m.length){var b=m.shift();v(b.href,function(c){p(c,b.href,b.media),h[b.href]=!0,a.setTimeout(function(){o()},0)})}},p=function(a,b,c){var d=a.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),g=d&&d.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+b+"$2$3")},i=!g&&c;b.length&&(b+="/"),i&&(g=1);for(var j=0;g>j;j++){var k,l,m,n;i?(k=c,f.push(h(a))):(k=d[j].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,f.push(RegExp.$2&&h(RegExp.$2))),m=k.split(","),n=m.length;for(var o=0;n>o;o++)l=m[o],e.push({media:l.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:f.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},s=function(){var a,b=c.createElement("div"),e=c.body,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",e||(e=f=c.createElement("body"),e.style.background="none"),e.appendChild(b),d.insertBefore(e,d.firstChild),a=b.offsetWidth,f?d.removeChild(e):e.removeChild(b),a=t=parseFloat(a)},u=function(b){var h="clientWidth",k=d[h],m="CSS1Compat"===c.compatMode&&k||c.body[h]||k,n={},o=l[l.length-1],p=(new Date).getTime();if(b&&q&&i>p-q)return a.clearTimeout(r),r=a.setTimeout(u,i),void 0;q=p;for(var v in e)if(e.hasOwnProperty(v)){var w=e[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?t||s():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?t||s():1)),w.hasquery&&(z&&A||!(z||m>=x)||!(A||y>=m))||(n[w.media]||(n[w.media]=[]),n[w.media].push(f[w.rules]))}for(var C in g)g.hasOwnProperty(C)&&g[C]&&g[C].parentNode===j&&j.removeChild(g[C]);for(var D in n)if(n.hasOwnProperty(D)){var E=c.createElement("style"),F=n[D].join("\n");E.type="text/css",E.media=D,j.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(c.createTextNode(F)),g.push(E)}},v=function(a,b){var c=w();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))},w=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}();n(),b.update=n,a.addEventListener?a.addEventListener("resize",x,!1):a.attachEvent&&a.attachEvent("onresize",x)}})(this); 1079/*! Riloadr.js 1.5.0 (c) 2013 Tubal Martin - MIT license */ 1080!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):window.Riloadr=a(jQuery)}(function(a){"use strict";function ib(b){function ib(){cb=ob(),_=jb(k,cb,K),db=_[D]&&lb(k,_[D]),eb=eb||G&&kb(k),fb=H&&mb(_,eb)}function rb(){var b,a=0;if((R||G)&&Ab(U,u,X),R&&(Ab(U,s,W),bb&&(hb=U[M],Ab(U,Q,Y)),B))for(;b=B[a];)Ab(V[O](b),s,W),a++}
1080function sb(){var b,a=0;if(!G&&(Bb(U,u,X),R)){if(Bb(U,s,W),B)for(;b=B[a];)Bb(V[O](b),s,W),a++;bb&&Bb(U,Q,Y)}}function tb(a,b){a[y]=0,a[D]=h,a[v]=ub,a[w]=a[x]=xb,a[d]=pb(a,g,_),Z.splice(b,1)}function ub(){var c,e,a=this;"naturalWidth"in a?e=a.naturalWidth+a.naturalHeight:(c=new Image,c[d]=a[d],e=c[o]+c[q],c=j),+e>0&&(a[v]=a[w]=a[x]=j,a[C]&&(a[E]=a[E].replace(n,"$1$2")),R&&(a.style.visibility="visible"),v in b&&b[v][l](a),Eb())}function xb(){var f,a=this,c=function(b){var c=new Image;c[v]=function(){a[d]=c[d],ub[l](a)},c[w]=a[x]=function(){xb[l](a)},c[d]=b};a[v]=a[w]=a[x]=j,w in b&&b[w][l](a),a[y]<N?(a[y]++,f=pb(a,g,a[D]?db:_,e),c(f)):D in _&&!a[D]?(a[y]=0,a[D]=e,f=pb(a,g,db),c(f)):Eb()}function Eb(){$--,0===$&&(sb(),J in b&&b[J]())}var _,ab,eb,fb,c=this,g=b.base||p,k=b.breakpoints||zb('"breakpoints" not defined.'),m=b.name||"responsive",n=new RegExp("(^|\\s)"+m+"(\\s|$)"),t=b.defer&&("string"==typeof b.defer?{mode:b.defer,threshold:b.foldDistance,overflownElemsIds:[]}:b.defer),z=t&&t.mode.toLowerCase(),A=t&&t.threshold||100,B=t&&t.overflownElemsIds,F=b.watchViewportWidth,G=!!F,H="wider"==F,I="*"==F,K=b.ignoreLowBandwidth||h,N=b[y]||0,P=b.root||j,R=("invisible"==z||"belowfold"==z)&&!gb,W=vb(function(){c[L]()},i),X=wb(function(){G&&ib(),c[L](G)},i),Y=wb(function(){U[M]!==hb&&(hb=U[M],c[L]())},i),Z=[],$=0,db={};c[L]=function(b){yb(function(c,d){if(Z[r]&&b!==e||(b&&rb(),a("img."+m,P).each(function(a,b){b&&!b[C]&&((!G||G&&(!ab||H&&nb(_,ab)||I&&!mb(_,ab)))&&(Z.push(b),$++),(!G||fb)&&(b[C]=e))}),G&&(fb&&(G=h),ab=_)),Z[r])for(d=0;c=Z[d];)c&&(!R||R&&qb(c,A))&&(tb(c,d),d--),d++;c=j})},Cb(function(){S=a(U),T=V[f],P=P&&a("#"+P)||T,ib(),rb(),!z||R?c[L]():Db(c[L])})}function jb(a,b,c){for(var g,h,i,j,d=b,e=0,f={};g=a[e];)h=g[z],i=g[A],j=g[R],b>0?(h&&i&&b>=h&&i>=b||h&&!i&&b>=h||i&&!h&&i>=b)&&(!j||j&&eb>=j&&(c||!c&&!fb))&&(f=g):(0>=d||d>h||d>i)&&(d=h||i||d,f=g),e++;return f}function kb(a){for(var d,b=0,c={};d=a[b];)nb(d,c)&&(c=d),b++;return c}function lb(a,b){for(var d,c=0;d=a[c];){if(d.name==b)return d;c++}}function mb(a,b){return a.name===b.name&&a[z]===b[z]&&a[A]===b[A]&&a[R]===b[R]&&a[F]===b[F]}function nb(a,b){var c=+a[R]||1,d=+b[R]||1;return a=Math.max(+a[z]||0,+a[A]||0)*(eb>=c?c:1),b=Math.max(+b[z]||0,+b[A]||0)*(eb>=d?d:1),a>b}function ob(){for(var f,a=Math,b=[W.clientWidth,W.offsetWidth,T.clientWidth],c=a.ceil(db/eb),d=b[r],e=0;d>e;e++)isNaN(b[e])&&(b.splice(e,1),e--);return b[r]&&(f=a.max[m](a,b),isNaN(c)),f||c||0}function pb(a,b,c,d){var e=(a.getAttribute("data-base")||b)+(a.getAttribute("data-src")||a.getAttribute("data-src-"+c.name)||p);return c[F]&&(e=e.split("."),e.pop(),e=e.join(".")+"."+c[F]),d&&(e+=(_.test(e)?"&":"?")+"riloadrts="+(new Date).getTime()),e.replace(ab,c.name)}function fb(){var a=U.navigator,b=a.connection||a.mozConnection||a.webkitConnection||a.oConnection||a.msConnection||{},c=b.type||"unknown",d=+b.bandwidth||1/0;return d>0&&.1>d||/^[23]g|3|4$/.test(c+p)}function qb(b,c){var d=a(b);return!(rb(d,c)||sb(d,c)||tb(d,c)||ub(d,c))}function rb(a,b){return S[q]()+S[I]()<=a[t]()[c]-b}function sb(a,b){return S[I]()>=a[t]()[c]+b+a[q]()}function tb(a,b){return S[o]()+S[K]()<=a[t]()[g]-b}function ub(a,b){return S[K]()>=a[t]()[g]+b+a[o]()}function vb(a,b){function h(){g=new Date,f=j,a[m](e,c)}var c,d,e,f,g=0;return function(){var i=new Date,j=b-(i-g);return c=arguments,e=this,0>=j?(g=i,d=a[m](e,c)):f||(f=xb(h,j)),d}}function wb(a,b,c){function h(){g=j,c||a[m](f,d)}var d,e,f,g;return function(){var i=c&&!g;return d=arguments,f=this,clearTimeout(g),g=xb(h,b),i&&(e=a[m](f,d)),e}}function xb(a,b){var c=Array[G].slice[l](arguments,2);return U.setTimeout(function(){return a[m](j,c)},b)}function yb(a){return xb[m](j,[a,1].concat(Array[G].slice[l](arguments,1)))}function zb(a){throw new Error("Riloadr: "+a)}function Ab(a,b,c){a[Z](Y+b,c,h)}function Bb(a,b,c){a[$](Y+b,c,h)}function Cb(b){a(b)}function Db(a){if(V.readyState===B)a();else{var b=function(){Bb(U,k,b),a()};Ab(U,k,b)}}var S,T,cb,hb,b="on",c="top",d="src",e=!0,f="body",g="left",h=!1,i=250,j=null,k="load",l="call",m="apply",n="error",o="width",p="",q="height",r="length",s="scroll",t="offset",u="resize",v=b+k,w=b+n,x=b+"abort",y="retries",z="minWidth",A="maxWidth",B="complete",C="riloaded",D="fallback",E="className",F="imgFormat",G="prototype",I=s+"Top",J=b+B,K=s+"Left",L=k+"Images",M="orientation",N="EventListener",O="getElementById",P="add"+N,Q=M+"change",R="minDevicePixelRatio",U=window,V=U.document,W=V.documentElement,X=P in V,Y=X?p:b,Z=X?P:"attachEvent",$=X?"remove"+N:"detachEvent",_=/\?/,ab=/{breakpoint-name}/gi,bb=M in U&&b+Q in U,db=U.screen[o],eb=U.devicePixelRatio||1,fb=fb(),gb="[object OperaMini]"===Object[G].toString[l](U.operamini);return W[E]=W[E].replace(/(^|\s)no-js(\s|$)/,"$1$2"),ib.version="1.5.0",ib[G].riload=function(){this[L](e)},ib}); 1081/* 1082 * Salvattore 1.0.5 by @rnmp and @ppold 1083 * https://github.com/rnmp/salvattore 1084 * Copyright (c) 2013-2014 Rolando Murillo and Giorgio Leveroni 1085 1086 Permission is hereby granted, free of charge, to any person obtaining a copy of
1087 this software and associated documentation files (the "Software"), to deal in 1088 the Software without restriction, including without limitation the rights to 1089 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 1090 the Software, and to permit persons to whom the Software is furnished to do so, 1091 subject to the following conditions: 1092 1093 The above copyright notice and this permission notice shall be included in all 1094 copies or substantial portions of the Software. 1095 1096 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1097 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 1098 FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 1099 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 1100 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 1101 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 1102 1103 */ 1104function salvattore(){(function(root, factory) { 1105 if(typeof exports === 'object') { 1106 module.exports = factory(); 1107 } 1108 else if(typeof define === 'function' && define.amd) { 1109 define('salvattore', [], factory); 1110 } 1111 else { 1112 root.salvattore = factory(); 1113 } 1114}(this, function() { 1115 /*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */ 1116 1117 window.matchMedia || (window.matchMedia = function() { 1118 "use strict"; 1119 1120 // For browsers that support matchMedium api such as IE 9 and webkit 1121 var styleMedia = (window.styleMedia || window.media); 1122 1123 // For those that don't support matchMedium 1124 if (!styleMedia) { 1125 var style = document.createElement('style'), 1126 script = document.getElementsByTagName('script')[0], 1127 info = null; 1128 1129 style.type = 'text/css'; 1130 style.id = 'matchmediajs-test'; 1131 1132 script.parentNode.insertBefore(style, script); 1133 1134 // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers 1135 info = ('getComputedStyle' in window) && window.getComputedStyle(style, null) || style.currentStyle; 1136 1137 styleMedia = { 1138 matchMedium: function(media) { 1139 var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }'; 1140 1141 // 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers 1142 if (style.styleSheet) { 1143 style.styleSheet.cssText = text; 1144 } else { 1145 style.textContent = text; 1146 } 1147 1148 // Test if media query is true or false 1149 return info.width === '1px'; 1150 } 1151 }; 1152 } 1153 1154 return function(media) { 1155 return { 1156 matches: styleMedia.matchMedium(media || 'all'), 1157 media: media || 'all' 1158 }; 1159 }; 1160 }()); 1161 ;/*! matchMedia() polyfill addListener/removeListener extension. Author & copyright (c) 2012: Scott Jehl. Dual MIT/BSD license */ 1162 (function(){ 1163 // Bail out for browsers that have addListener support 1164 if (window.matchMedia && window.matchMedia('all').addListener) { 1165 return false; 1166 } 1167 1168 var localMatchMedia = window.matchMedia, 1169 hasMediaQueries = localMatchMedia('only all').matches, 1170 isListening = false, 1171 timeoutID = 0, // setTimeout for debouncing 'handleChange' 1172 queries = [], // Contains each 'mql' and associated 'listeners' if 'addListener' is used 1173 handleChange = function(evt) { 1174 // Debounce 1175 clearTimeout(timeoutID); 1176 1177 timeoutID = setTimeout(function() { 1178 for (var i = 0, il = queries.length; i < il; i++) { 1179 var mql = queries[i].mql, 1180 listeners = queries[i].listeners || [], 1181 matches = localMatchMedia(mql.media).matches; 1182 1183 // Update mql.matches value and call listeners 1184 // Fire listeners only if transitioning to or from matched state 1185 if (matches !== mql.matches) { 1186 mql.matches = matches; 1187 1188 for (var j = 0, jl = listeners.length; j < jl; j++) { 1189 listeners[j].call(window, mql); 1190 } 1191 } 1192 } 1193 }, 30); 1194 }; 1195 1196 window.matchMedia = function(media) { 1197 var mql = localMatchMedia(media), 1198 listeners = [], 1199 index = 0; 1200 1201 mql.addListener = function(listener) { 1202 // Changes would not occur to css media type so return now (Affects IE <= 8) 1203 if (!hasMediaQueries) { 1204 return; 1205 } 1206 1207 // Set up 'resize' listener for browsers that support CSS3 media queries (Not for IE <= 8) 1208 // There should only ever be 1 resize listener running for performance 1209 if (!isListening) { 1210 isListening = true; 1211 window.addEventListener('resize', handleChange, true); 1212 } 1213 1214 // Push object only if it has not been pushed already 1215 if (index === 0) { 1216 index = queries.push({ 1217 mql : mql, 1218 listeners : listeners 1219 }); 1220 } 1221 1222 listeners.push(listener); 1223 }; 1224 1225 mql.removeListener = function(listener) { 1226 for (var i = 0, il = listeners.length; i < il; i++){ 1227 if (listeners[i] === listener){ 1228 listeners.splice(i, 1); 1229 } 1230 } 1231 }; 1232 1233 return mql; 1234 }; 1235 }()); 1236 ;// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ 1237// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating 1238 1239// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel 1240 1241// MIT license 1242 1243 (function() { 1244 var lastTime = 0; 1245 var vendors = ['ms', 'moz', 'webkit', 'o']; 1246 for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { 1247 window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; 1248 window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] 1249 || window[vendors[x]+'CancelRequestAnimationFrame']; 1250 } 1251 1252 if (!window.requestAnimationFrame) 1253 window.requestAnimationFrame = function(callback, element) { 1254 var currTime = new Date().getTime(); 1255 var timeToCall = Math.max(0, 16 - (currTime - lastTime)); 1256 var id = window.setTimeout(function() { callback(currTime + timeToCall); }, 1257 timeToCall); 1258 lastTime = currTime + timeToCall; 1259 return id; 1260 }; 1261 1262 if (!window.cancelAnimationFrame) 1263 window.cancelAnimationFrame = function(id) { 1264 clearTimeout(id); 1265 }; 1266 }()); 1267 ;var salvattore = (function (global, document, undefined) { 1268 "use strict"; 1269 1270 var self = {}, 1271 grids = [], 1272 add_to_dataset = function(element, key, value) { 1273 // uses dataset function or a fallback for <ie10 1274 if (element.dataset) { 1275 element.dataset[key] = value; 1276 } else { 1277 element.setAttribute("data-" + key, value); 1278 } 1279 return; 1280 }; 1281 1282 self.obtain_grid_settings = function obtain_grid_settings(element) { 1283 // returns the number of columns and the classes a column should have, 1284 // from computing the style of the ::before pseudo-element of the grid. 1285 1286 var computedStyle = global.getComputedStyle(element, ":before") 1287 , content = computedStyle.getPropertyValue("content").slice(1, -1) 1288 , matchResult = content.match(/^\s*(\d+)(?:\s?\.(.+))?\s*$/) 1289 , numberOfColumns 1290 , columnClasses 1291 ; 1292 1293 if (matchResult) { 1294 numberOfColumns = matchResult[1]; 1295 columnClasses = matchResult[2]; 1296 columnClasses = columnClasses? columnClasses.split(".") : ["column"]; 1297 } else { 1298 matchResult = content.match(/^\s*\.(.+)\s+(\d+)\s*$/); 1299 columnClasses = matchResult[1]; 1300 numberOfColumns = matchResult[2]; 1301 if (numberOfColumns) { 1302 numberOfColumns = numberOfColumns.split("."); 1303 } 1304 } 1305 1306 return { 1307 numberOfColumns: numberOfColumns, 1308 columnClasses: columnClasses 1309 }; 1310 }; 1311 1312 1313 self.add_columns = function add_columns(grid, items) { 1314 // from the settings obtained, it creates columns with 1315 // the configured classes and adds to them a list of items. 1316 1317 var settings = self.obtain_grid_settings(grid) 1318 , numberOfColumns = settings.numberOfColumns 1319 , columnClasses = settings.columnClasses 1320 , columnsItems = new Array(+numberOfColumns) 1321 , columnsFragment = document.createDocumentFragment() 1322 , i = numberOfColumns 1323 , selector 1324 ; 1325 1326 while (i-- !== 0) { 1327 selector = "[data-columns] > *:nth-child(" + numberOfColumns + "n-" + i + ")"; 1328 columnsItems.push(items.querySelectorAll(selector)); 1329 } 1330
vendor: 1,937 bytes, lines 1331-1377
1331 columnsItems.forEach(function append_to_grid_fragment(rows) { 1332 var column = document.createElement("div") 1333 , rowsFragment = document.createDocumentFragment() 1334 ; 1335 1336 column.className = columnClasses.join(" "); 1337 1338 Array.prototype.forEach.call(rows, function append_to_column(row) { 1339 rowsFragment.appendChild(row); 1340 }); 1341 column.appendChild(rowsFragment); 1342 columnsFragment.appendChild(column); 1343 }); 1344 1345 grid.appendChild(columnsFragment); 1346 add_to_dataset(grid, 'columns', numberOfColumns); 1347 }; 1348 1349 1350 self.remove_columns = function remove_columns(grid) { 1351 // removes all the columns from a grid, and returns a list 1352 // of items sorted by the ordering of columns. 1353 1354 var range = document.createRange(); 1355 range.selectNodeContents(grid); 1356 1357 var columns = Array.prototype.filter.call(range.extractContents().childNodes, function filter_elements(node) { 1358 return node instanceof global.HTMLElement; 1359 }); 1360 1361 var numberOfColumns = columns.length 1362 , numberOfRowsInFirstColumn = columns[0].childNodes.length 1363 , sortedRows = new Array(numberOfRowsInFirstColumn * numberOfColumns) 1364 ; 1365 1366 Array.prototype.forEach.call(columns, function iterate_columns(column, columnIndex) { 1367 Array.prototype.forEach.call(column.children, function iterate_rows(row, rowIndex) { 1368 sortedRows[rowIndex * numberOfColumns + columnIndex] = row; 1369 }); 1370 }); 1371 1372 var container = document.createElement("div"); 1373 add_to_dataset(container, 'columns', 0); 1374 1375 sortedRows.filter(function filter_non_null(child) { 1376 return !!child; 1377 }
1377).forEach(function append_row(child) { 1378 container.appendChild(child); 1379 }); 1380 1381 return container; 1382 }; 1383 1384 1385 self.recreate_columns = function recreate_columns(grid) { 1386 // removes all the columns from the grid, and adds them again, 1387 // it is used when the number of columns change. 1388 1389 global.requestAnimationFrame(function render_after_css_media_query_change() { 1390 self.add_columns(grid, self.remove_columns(grid)); 1391 }); 1392 }; 1393 1394 1395 self.media_query_change = function media_query_change(mql) { 1396 // recreates the columns when a media query matches the current state 1397 // of the browser. 1398 1399 if (mql.matches) { 1400 Array.prototype.forEach.call(grids, self.recreate_columns); 1401 } 1402 }; 1403 1404 1405 self.get_css_rules = function get_css_rules(stylesheet) { 1406 // returns a list of css rules from a stylesheet 1407 1408 var cssRules; 1409 try { 1410 cssRules = stylesheet.sheet.cssRules || stylesheet.sheet.rules; 1411 } catch (e) { 1412 return []; 1413 } 1414 1415 return cssRules || []; 1416 }; 1417 1418 1419 self.get_stylesheets = function get_stylesheets() { 1420 // returns a list of all the styles in the document (that are accessible). 1421 1422 return Array.prototype.concat.call( 1423 Array.prototype.slice.call(document.querySelectorAll("style[type='text/css']")), 1424 Array.prototype.slice.call(document.querySelectorAll("link[rel='stylesheet']")) 1425 ); 1426 }; 1427 1428 1429 self.media_rule_has_columns_selector = function media_rule_has_columns_selector(rules) { 1430 // checks if a media query css rule has in its contents a selector that 1431 // styles the grid. 1432 1433 var i = rules.length 1434 , rule 1435 ; 1436 1437 while (i--) { 1438 rule = rules[i]; 1439 if (rule.selectorText && rule.selectorText.match(/\[data-columns\](.*)::?before$/)) { 1440 return true; 1441 } 1442 } 1443 1444 return false; 1445 }; 1446 1447 1448 self.scan_media_queries = function scan_media_queries() { 1449 // scans all the stylesheets for selectors that style grids, 1450 // if the matchMedia API is supported. 1451 1452 var mediaQueries = []; 1453 1454 if (!global.matchMedia) { 1455 return; 1456 } 1457 1458 self.get_stylesheets().forEach(function extract_rules(stylesheet) { 1459 Array.prototype.forEach.call(self.get_css_rules(stylesheet), function filter_by_column_selector(rule) { 1460 if (rule.media && self.media_rule_has_columns_selector(rule.cssRules)) { 1461 mediaQueries.push(global.matchMedia(rule.media.mediaText)); 1462 } 1463 }); 1464 }); 1465 1466 mediaQueries.forEach(function listen_to_changes(mql) { 1467 mql.addListener(self.media_query_change); 1468 }); 1469 }; 1470 1471
1472 self.next_element_column_index = function next_element_column_index(grid) { 1473 // returns the index of the column where the given element must be added. 1474 1475 var children = grid.children 1476 , m = children.length 1477 , lowestRowCount = 0 1478 , child 1479 , currentRowCount 1480 , i 1481 , index = 0 1482 ; 1483 1484 for (i = 0; i < m; i++) { 1485 child = children[i]; 1486 currentRowCount = child.children.length; 1487 if(lowestRowCount == 0) { 1488 lowestRowCount = currentRowCount; 1489 } 1490 if(currentRowCount < lowestRowCount) { 1491 index = i; 1492 lowestRowCount = currentRowCount; 1493 } 1494 } 1495 1496 return index; 1497 }; 1498 1499 1500 self.create_list_of_fragments = function create_list_of_fragments(quantity) { 1501 // returns a list of fragments 1502 1503 var fragments = new Array(quantity) 1504 , i = 0 1505 ; 1506 1507 while (i !== quantity) { 1508 fragments[i] = document.createDocumentFragment(); 1509 i++; 1510 } 1511 1512 return fragments; 1513 }; 1514 1515 1516 self.append_elements = function append_elements(grid, elements) { 1517 // adds a list of elements to the end of a grid 1518 1519 var columns = grid.children 1520 , numberOfColumns = columns.length 1521 , fragments = self.create_list_of_fragments(numberOfColumns) 1522 ; 1523 1524 elements.forEach(function append_to_next_fragment(element) {
1525 var columnIndex = self.next_element_column_index(grid); 1526 fragments[columnIndex].appendChild(element); 1527 }); 1528 1529 Array.prototype.forEach.call(columns, function insert_column(column, index) { 1530 column.appendChild(fragments[index]); 1531 }); 1532 }; 1533 1534 1535 self.prepend_elements = function prepend_elements(grid, elements) { 1536 // adds a list of elements to the start of a grid 1537 1538 var columns = grid.children 1539 , numberOfColumns = columns.length 1540 , fragments = self.create_list_of_fragments(numberOfColumns) 1541 , columnIndex = numberOfColumns - 1 1542 ; 1543 1544 elements.forEach(function append_to_next_fragment(element) { 1545 var fragment = fragments[columnIndex]; 1546 fragment.insertBefore(element, fragment.firstChild); 1547 if (columnIndex === 0) { 1548 columnIndex = numberOfColumns - 1; 1549 } else { 1550 columnIndex--; 1551 } 1552 }); 1553 1554 Array.prototype.forEach.call(columns, function insert_column(column, index) { 1555 column.insertBefore(fragments[index], column.firstChild); 1556 }); 1557 1558 // populates a fragment with n columns till the right 1559 var fragment = document.createDocumentFragment() 1560 , numberOfColumnsToExtract = elements.length % numberOfColumns 1561 ; 1562 1563 while (numberOfColumnsToExtract-- !== 0) { 1564 fragment.appendChild(grid.lastChild); 1565 } 1566 1567 // adds the fragment to the left 1568 grid.insertBefore(fragment, grid.firstChild); 1569 }; 1570 1571 1572 self.register_grid = function register_grid (grid) { 1573 if (global.getComputedStyle(grid).display === "none") { 1574 return; 1575 } 1576 1577 // retrieve the list of items from the grid itself 1578 var range = document.createRange(); 1579 range.selectNodeContents(grid); 1580 1581 var items = document.createElement("div"); 1582 items.appendChild(range.extractContents()); 1583 1584 1585 add_to_dataset(items, 'columns', 0); 1586 self.add_columns(grid, items); 1587 grids.push(grid); 1588 }; 1589 1590 1591 self.init = function init() { 1592 // adds required CSS rule to hide 'content' based 1593 // configuration. 1594 1595 var css = document.createElement("style"); 1596 css.innerHTML = "[data-columns]::before{visibility:hidden;position:absolute;font-size:1px;}"; 1597 document.head.appendChild(css); 1598 1599 // scans all the grids in the document and generates 1600 // columns from their configuration. 1601 1602 var gridElements = document.querySelectorAll("[data-columns]"); 1603 Array.prototype.forEach.call(gridElements, self.register_grid); 1604 self.scan_media_queries(); 1605 }; 1606 1607 1608 self.init(); 1609 1610 return { 1611 append_elements: self.append_elements, 1612 prepend_elements: self.prepend_elements, 1613 register_grid: self.register_grid 1614 }; 1615 1616 })(window, window.document); 1617 1618 return salvattore; 1619}));} 1620// Avoid `console` errors in browsers that lack a console. 1621(function () { 1622 var method; 1623 var noop = function () { 1624 }; 1625 var methods = [ 1626 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', 1627 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', 1628 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', 1629 'timeStamp', 'trace', 'warn' 1630 ]; 1631 var length = methods.length; 1632 var console = (window.console = window.console || {}); 1633 1634 while (length--) { 1635 method = methods[length]; 1636 1637 // Only stub undefined methods. 1638 if (!console[method]) { 1639 console[method] = noop; 1640 } 1641 } 1642}()); 1643 1644// Place any jQuery/helper plugins in here. 1645 1646/* --- $outerHTML Plugin --- */ 1647( function($) { 1648 $.fn.outerHTML = function () { 1649 1650 // IE, Chrome & Safari will comply with the non-standard outerHTML, all others (FF) will have a fall-back for cloning
1651 return (!this.length) ? this : (this[0].outerHTML || (function (el) { 1652 var div = document.createElement('div'); 1653 div.appendChild(el.cloneNode(true)); 1654 var contents = div.innerHTML; 1655 div = null; 1656 return contents; 1657 })(this[0])); 1658 }; 1659})(jQuery); 1660 1661/* --- $DEBOUNCES RESIZE --- */ 1662 1663/* debouncedresize: special jQuery event that happens once after a window resize 1664 * https://github.com/louisremi/jquery-smartresize 1665 * Copyright 2012 @louis_remi 1666 */ 1667(function($){var $event=$.event,$special,resizeTimeout;$special=$event.special.debouncedresize={setup:function(){$(this).on("resize",$special.handler);},teardown:function(){$(this).off("resize",$special.handler);},handler:function(event,execAsap){var context=this,args=arguments,dispatch=function(){event.type="debouncedresize";$event.dispatch.apply(context,args);};if(resizeTimeout){clearTimeout(resizeTimeout);}execAsap?dispatch():resizeTimeout=setTimeout(dispatch,$special.threshold);},threshold:150};})(jQuery); 1668 1669 1670 1671/* --- $AUTORESIZE TEXTAREA --- */ 1672 1673/* Autosize v1.18.1 - 2013-11-05 1674 * Automatically adjust textarea height based on user input. 1675 * (c) 2013 Jack Moore - http://www.jacklmoore.com/autosize 1676 * license: http://www.opensource.org/licenses/mit-license.php 1677 */ 1678(function(e){var t,o={className:"autosizejs",append:"",callback:!1,resizeDelay:10},i='<textarea tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; padding: 0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden; transition:none; -webkit-transition:none; -moz-transition:none;"/>',n=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],s=e(i).data("autosize",!0)[0];s.style.lineHeight="99px","99px"===e(s).css("lineHeight")&&n.push("lineHeight"),s.style.lineHeight="",e.fn.autosize=function(i){return this.length?(i=e.extend({},o,i||{}),s.parentNode!==document.body&&e(document.body).append(s),this.each(function(){function o(){var t,o;"getComputedStyle"in window?(t=window.getComputedStyle(u,null),o=u.getBoundingClientRect().width,e.each(["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],function(e,i){o-=parseInt(t[i],10)}),s.style.width=o+"px"):s.style.width=Math.max(p.width(),0)+"px"}function a(){var a={};if(t=u,s.className=i.className,d=parseInt(p.css("maxHeight"),10),e.each(n,function(e,t){a[t]=p.css(t)}),e(s).css(a),o(),window.chrome){var r=u.style.width;u.style.width="0px",u.offsetWidth,u.style.width=r}}function r(){var e,n;t!==u?a():o(),s.value=u.value+i.append,s.style.overflowY=u.style.overflowY,n=parseInt(u.style.height,10),s.scrollTop=0,s.scrollTop=9e4,e=s.scrollTop,d&&e>d?(u.style.overflowY="scroll",e=d):(u.style.overflowY="hidden",c>e&&(e=c)),e+=w,n!==e&&(u.style.height=e+"px",f&&i.callback.call(u,u))}function l(){clearTimeout(h),h=setTimeout(function(){var e=p.width();e!==g&&(g=e,r())},parseInt(i.resizeDelay,10))}var d,c,h,u=this,p=e(u),w=0,f=e.isFunction(i.callback),z={height:u.style.height,overflow:u.style.overflow,overflowY:u.style.overflowY,wordWrap:u.style.wordWrap,resize:u.style.resize},g=p.width();p.data("autosize")||(p.data("autosize",!0),("border-box"===p.css("box-sizing")||"border-box"===p.css("-moz-box-sizing")||"border-box"===p.css("-webkit-box-sizing"))&&(w=p.outerHeight()-p.height()),c=Math.max(parseInt(p.css("minHeight"),10)-w||0,p.height()),p.css({overflow:"hidden",overflowY:"hidden",wordWrap:"break-word",resize:"none"===p.css("resize")||"vertical"===p.css("resize")?"none":"horizontal"}),"onpropertychange"in u?"oninput"in u?p.on("input.autosize keyup.autosize",r):p.on("propertychange.autosize",function(){"value"===event.propertyName&&r()}):p.on("input.autosize",r),i.resizeDelay!==!1&&e(window).on("resize.autosize",l),p.on("autosize.resize",r),p.on("autosize.resizeIncludeStyle",function(){t=null,r()}),p.on("autosize.destroy",function(){t=null,clearTimeout(h),e(window).off("resize",l),p.off("autosize").off(".autosize").css(z).removeData("autosize")}),r())})):this}})(window.jQuery||window.$); 1679 1680/* --- $SMOOTH PAGE SCROLL --- */ 1681/* 1682 * Performs a smooth page scroll to an anchor on the same page.
1683 * http://css-tricks.com/snippets/jquery/smooth-scrolling/ 1684 */ 1685( function($) { 1686 $('a[href*="#"]:not([href="#"])').click(function(event) { 1687 //exclude some links from smooth scrolling like tabs 1688 if ($(this).parents('.tabs__nav').length) { 1689 //do nothing 1690 } else if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { 1691 var target = $(this.hash); 1692 target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); 1693 if (target.length) { 1694 $('html,body').animate({ 1695 scrollTop: target.offset().top 1696 }, 700); 1697 event.preventDefault(); 1698 } 1699 } 1700 }); 1701})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.