1(function (jQuery, $) { 2/* global define */ 3/* exported productsGridEqualHeight, initSlider */ 4 5(function ($) { 6 'use strict'; 7 8 $.fn.equalImageHeight = function () { 9 return this.each(function() { 10 var maxHeight = 0; 11 12 $(this).children('a').children('img').each(function(index, child) { 13 var h = $(child).height(); 14 maxHeight = h > maxHeight ? h : maxHeight; 15 $(child).css('height', ''); // clears previous value 16 }); 17 18 $(this).children('a').each(function(index, child) { 19 $(child).height(maxHeight); 20 }); 21 22 }); 23 }; 24 25 $.fn.equalColumnsHeight = function () { 26 function off() { 27 /* jshint validthis: true */ 28 this.onload = null; 29 this.onerror = null; 30 this.onabort = null; 31 } 32 33 function on(dfd) { 34 /* jshint validthis: true */ 35 off.bind(this)(); 36 dfd.resolve(); 37 } 38 39 return this.each(function() { 40 var loadPromises = []; 41 42 $(this).find('img').each(function () { 43 if (this.complete) return; 44 var deferred = $.Deferred(); 45 this.onload = on.bind(this, deferred); 46 this.onerror = on.bind(this, deferred); 47 this.onabort = on.bind(this, deferred); 48 loadPromises.push(deferred.promise()); 49 }); 50 51 $.when.apply($, loadPromises).done((function () { 52 var cols = $(this).children('[class*="col-"]').children('[class*="bd-layoutcolumn-"]').css('height', ''); 53 var indexesForEqual = []; 54 var colsWidth = 0; 55 var containerWidth = parseInt($(this).css('width'), 10); 56 $(cols).each((function (key, column) { 57 colsWidth += parseInt($(column).parent().css('width'), 10); 58 if ((containerWidth + cols.length) >= colsWidth) { // col.length fixes width round in FF 59 indexesForEqual.push(key); 60 } 61 }).bind(this)); 62 63 var maxHeight = 0; 64 indexesForEqual.forEach(function (index) { 65 if (maxHeight < parseInt($(cols[index]).parent().css('height'), 10)) { 66 maxHeight = parseInt($(cols[index]).parent().css('height'), 10); 67 } 68 }); 69 70 indexesForEqual.forEach(function (index) { 71 $(cols[index]).css('height', maxHeight); 72 }); 73 }).bind(this)); 74 }); 75 }; 76 77 $(function(){ 78 $('.bd-row-auto-height').equalColumnsHeight(); 79 var timeout; 80 $(window).resize(function(e, param) { 81 clearTimeout(timeout); 82 if (param && param.force) { 83 $('.bd-row-auto-height').equalColumnsHeight(); 84 } else { 85 timeout = setTimeout(function () { $('.bd-row-auto-height').equalColumnsHeight(); }, 100); 86 } 87 }); 88 }); 89})(jQuery); 90 91// IE10+ flex fix 92if (1-'\0') { 93 94 var fixHeight = function fixHeight() { 95 jQuery('.bd-row-flex > [class*="col-"] > [class*="bd-layoutcolumn-"] > .bd-vertical-align-wrapper, ' + 96 '[class*="bd-layoutitemsbox-"].bd-flex-wide').each(function () { 97 98 var content = jQuery(this); 99 var wrapper = content.children('.bd-fix-flex-height'); 100 if (!wrapper.length) { 101 content.wrapInner('<div class="bd-fix-flex-height clearfix"></div>'); 102 } 103 var height = wrapper.outerHeight(true); 104 content.removeAttr('style'); 105 content.css({ 106 '-ms-flex-preferred-size': height + 'px', 107 'flex-basis': height + 'px' 108 }); 109 }); 110 111 setTimeout(fixHeight, 500); 112 }; 113 114 var fixMinHeight = function () { 115 jQuery('.bd-stretch-inner').wrap('<div class="bd-flex-vertical"></div>'); 116 }; 117 118 jQuery(fixHeight); 119 jQuery(fixMinHeight); 120} 121 122/*! 123 * jQuery Cookie Plugin v1.4.0 124 * https://github.com/carhartl/jquery-cookie 125 * 126 * Copyright 2013 Klaus Hartl 127 * Released under the MIT license 128 */ 129(function (factory) { 130 'use strict'; 131 if (typeof define === 'function' && define.amd) { 132 define(['jquery'], factory); 133 } else { 134 factory(jQuery); 135 } 136}(function ($) { 137 'use strict'; 138 var pluses = /\+/g; 139 140 function encode(s) { 141 return config.raw ? s : encodeURIComponent(s); 142 } 143 144 function decode(s) { 145 return config.raw ? s : decodeURIComponent(s); 146 } 147 148 function stringifyCookieValue(value) { 149 return encode(config.json ? JSON.stringify(value) : String(value)); 150 } 151 152 function parseCookieValue(s) { 153 if (s.indexOf('"') === 0) { 154 s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); 155 } 156 157 try { 158 s = decodeURIComponent(s.replace(pluses, ' ')); 159 } catch(e) { 160 return; 161 } 162 163 try { 164 return config.json ? JSON.parse(s) : s; 165 } catch(e) {} 166 } 167 168 function read(s, converter) { 169 var value = config.raw ? s : parseCookieValue(s); 170 return $.isFunction(converter) ? converter(value) : value; 171 } 172 173 var config = $.cookie = function (key, value, options) { 174 175 // Write 176 if (value !== undefined && !$.isFunction(value)) { 177 options = $.extend({}, config.defaults, options); 178 179 if (typeof options.expires === 'number') { 180 var days = options.expires, t = options.expires = new Date(); 181 t.setDate(t.getDate() + days); 182 } 183 184 return (document.cookie = [ 185 encode(key), '=', stringifyCookieValue(value), 186 options.expires ? '; expires=' + options.expires.toUTCString() : '', 187 options.path ? '; path=' + options.path : '', 188 options.domain ? '; domain=' + options.domain : '', 189 options.secure ? '; secure' : '' 190 ].join('')); 191 } 192 193 var result = key ? undefined : {}; 194 var cookies = document.cookie ? document.cookie.split('; ') : []; 195 196 for (var i = 0, l = cookies.length; i < l; i++) { 197 var parts = cookies[i].split('='); 198 var name = decode(parts.shift()); 199 var cookie = parts.join('='); 200 201 if (key && key === name) { 202 result = read(cookie, value); 203 break; 204 } 205 206 if (!key && (cookie = read(cookie)) !== undefined) { 207 result[name] = cookie; 208 } 209 } 210 211 return result; 212 }; 213 214 config.defaults = {}; 215 216 $.removeCookie = function (key, options) { 217 if ($.cookie(key) !== undefined) { 218 $.cookie(key, '', $.extend({}, options, { expires: -1 })); 219 return true; 220 } 221 return false;
222 }; 223 224})); 225 226window.initSlider = function initSlider(selector, opt) { 227 'use strict'; 228 229 opt = opt || {}; 230 231 /* 232 leftButtonSelector: 233 rightButtonSelector: 234 navigatorSelector: 235 indicatorsSelector: 236 carouselInterval: 237 carouselPause: 238 carouselWrap: 239 carouselRideOnStart: 240 */ 241 242 jQuery(selector + '.carousel.slide .carousel-inner > .item:first-child').addClass('active'); 243 244 function setSliderInterval() { 245 jQuery(selector + '.carousel.slide').carousel({ 246 interval: opt.carouselInterval, 247 pause: opt.carouselPause, 248 wrap: opt.carouselWrap 249 }); 250 251 if (!opt.carouselRideOnStart) { 252 jQuery(selector + '.carousel.slide').carousel('pause'); 253 } 254 } 255 256 /* 'active' must be always specified, otherwise slider would not be visible */ 257 var leftNav = selector + '.carousel.slide .' + opt.leftButtonSelector + ' a' + opt.navigatorSelector, 258 rightNav = selector + '.carousel.slide .' + opt.rightButtonSelector + ' a' + opt.navigatorSelector; 259 260 jQuery(leftNav).attr('href', '#'); 261 jQuery(leftNav).click(function() { 262 setSliderInterval(); 263 jQuery(selector + '.carousel.slide').carousel('prev'); 264 return false; 265 }); 266 267 jQuery(rightNav).attr('href', '#'); 268 jQuery(rightNav).click(function() { 269 setSliderInterval(); 270 jQuery(selector + '.carousel.slide').carousel('next'); 271 return false; 272 }); 273 274 jQuery(selector + '.carousel.slide').on('slid.bs.carousel', function () { 275 var indicators = jQuery(opt.indicatorsSelector, this); 276 indicators.find('.active').removeClass('active'); 277 278 var activeSlide = jQuery(this).find('.item.active'), 279 activeIndex = activeSlide.parent().children().index(activeSlide), 280 activeItem = indicators.children()[activeIndex]; 281 282 jQuery(activeItem).children('a').addClass('active'); 283 }); 284 285 setSliderInterval(); 286}; 287 288jQuery(function ($) { 289 'use strict'; 290 291 $('.collapse-button').each(function () { 292 var button = $(this); 293 var collapse = button.siblings('.collapse'); 294 295 collapse.on('show.bs.collapse', function () { 296 if (button.parent().css('position') === 'absolute') { 297 var right = collapse.width() - button.width(); 298 if (button.hasClass('bd-collapse-right')) { 299 $(this).css({ 300 'position': 'relative', 301 'right': right 302 }); 303 } else { 304 $(this).css({ 305 'position': '', 306 'right': '' 307 }); 308 } 309 } 310 }); 311 }); 312}); 313 314(function SeparatedGrid($) { 315 'use strict'; 316 var row = [], 317 getOffset = function getOffset(el) { 318 var isInline = false; 319 el.css('position', 'relative'); 320 if (el.css('display') === 'inline') { 321 el.css('display', 'inline-block'); 322 isInline = true; 323 } 324 var offset = el.position().top; 325 if (isInline) { 326 el.css('display', 'inline'); 327 } 328 return offset; 329 }, 330 getCollapsedMargin = function getCollapsedMargin(el) { 331 if (el.css('display') === 'block') { 332 var m0 = parseFloat(el.css('margin-top')); 333 if (m0 > 0) { 334 var p = el.prev(); 335 var prop = 'margin-bottom'; 336 if (p.length < 1) { 337 p = el.parent(); 338 prop = 'margin-top'; 339 } 340 if (p.length > 0 && p.css('display') === 'block') { 341 var m = parseFloat(p.css(prop)); 342 if (m > 0) { 343 return Math.min(m0, m); 344 } 345 } 346 } 347 } 348 return 0; 349 }, 350 classRE = new RegExp('.*(bd-\\S+[-\\d]*).*'), 351 childFilter = function childFilter() { 352 return classRE.test(this.className); 353 }, 354 calcOrder = function calcOrder(items) { 355 var roots = items; 356 while (roots.eq(0).children().length === 1) { 357 roots = roots.children(); 358 } 359 var childrenClasses = []; 360 var childrenWeights = {}; 361 var getNextWeight = function getNextWeight(children, i, l) { 362 for (var j = i + 1; j < l; j++) { 363 var cls = children[j].className.replace(classRE, '$1'); 364 if (childrenClasses.indexOf(cls) !== -1) { 365 return childrenWeights[cls]; 366 } 367 } 368 return 100; //% 369 }; 370 roots.each(function calcWeight(i, root) { 371 var children = $(root).children(childFilter); 372 var previousWeight = 0; 373 for (var c = 0, l = children.length; c < l; c++) { 374 var cls = children[c].className.replace(classRE, '$1'); 375 if (!cls || cls.length < 1) 376 { 377 continue; 378 } 379 if (childrenClasses.indexOf(cls) === -1) { 380 var nextWeight = getNextWeight(children, c, l); 381 childrenWeights[cls] = previousWeight + (nextWeight - previousWeight) / 10; //~max unique child 382 childrenClasses.push(cls); 383 } 384 previousWeight = childrenWeights[cls]; 385 } 386 }); 387 childrenClasses.sort(function sortWeight(a, b) { 388 return childrenWeights[a] > childrenWeights[b]; 389 }); 390 return childrenClasses; 391 }; 392 var calcRow = function calcRow(helpNodes, last, order) { 393 394 $(row).css({'overflow': 'visible', 'height': 'auto'}).toggleClass('last-row', last); 395 396 if (row.length > 0) { 397 var roots = $(row); 398 roots.removeClass('last-col').last().addClass('last-col'); 399 while (roots.eq(0).children().length === 1) { 400 roots = roots.children(); 401 } 402 403 var createHelpNode = function createHelpNode(fix){ 404 var helpNode = document.createElement('div');
405 helpNode.setAttribute('style', 'height:' + fix + 'px'); 406 helpNode.className = 'bd-empty-grid-item'; 407 helpNodes.push(helpNode); 408 return helpNode; 409 }; 410 var cls = ''; 411 var maxOffset = 0; 412 var calcMaxOffsets = function calcMaxOffsets(i, root) { 413 var el = $(root).children('.' + cls + ':visible:first'); 414 if (el.length < 1 || el.css('position') === 'absolute') { 415 return; 416 } 417 var offset = getOffset(el); 418 if (offset > maxOffset) { 419 maxOffset = offset; 420 } 421 }; 422 var setMaxOffsets = function setMaxOffsets(i, root) { 423 var el = $(root).children('.' + cls + ':visible:first'); 424 if (el.length < 1 || el.css('position') === 'absolute') { 425 return; 426 } 427 var offset = getOffset(el); 428 var fix = maxOffset - offset - getCollapsedMargin(el); 429 if (fix > 0) { 430 el.before(createHelpNode(fix)); 431 } 432 }; 433 for (var c = 0; c < order.length; c++) { 434 maxOffset = 0; 435 cls = order[c]; 436 roots.each(calcMaxOffsets); 437 maxOffset = Math.ceil(maxOffset); 438 roots.each(setMaxOffsets); 439 } 440 var hMax = 0; 441 $.each(roots, function calcMaxHeight(i, e) { 442 var h = $(e).outerHeight(); 443 if (hMax < h) { 444 hMax = h; 445 } 446 }); 447 hMax = Math.ceil(hMax); 448 $.each(roots, function setMaxHeight(i, e) { 449 var el = $(e); 450 var fix = hMax - el.outerHeight(); 451 if (fix > 0) { 452 el.append(createHelpNode(fix)); 453 } 454 }); 455 } 456 row = []; 457 }; 458 var itemsRE = new RegExp('.*(separated-item[^\\s]+).*'), 459 resize = function resize() { 460 var grid = $('.separated-grid'); 461 grid.each(function eachGrid(i, gridElement) { 462 var g = $(gridElement); 463 if (!g.is(':visible')) { 464 return; 465 } 466 if (!gridElement._item || !gridElement._item.length || !gridElement._item.is(':visible')){ 467 gridElement._item = g.find('div[class*=separated-item]:visible:first'); 468 if (!gridElement._item.length){ 469 return; 470 } 471 gridElement._items = g.find( 472 'div.' + gridElement._item.attr('class').replace(itemsRE, '$1') 473 ).filter(function () { 474 return $(this).parents('.separated-grid')[0] === gridElement; 475 }); 476 } 477 var items = gridElement._items; 478 if (!items.length){ 479 return; 480 } 481 var h = 0; 482 for (var k = 0; k < items.length; k++) { 483 var el = $(items[k]); 484 var _h = el.height(); 485 if (el.is('.first-col')) { 486 h = _h; 487 } 488 if (h !== _h) { 489 gridElement._height = 0; 490 } 491 } 492 493 494 if (g.innerHeight() === gridElement._height && g.innerWidth() === gridElement._width) { 495 return; 496 } 497 498 var windowScrollTop = $(window).scrollTop(); 499 items.css({'overflow': 'hidden', 'height': '10px'}).removeClass('last-row'); 500 if (gridElement._helpNodes) { 501 $(gridElement._helpNodes).remove(); 502 } 503 gridElement._helpNodes = []; 504 var firstLeft = items.position().left; 505 var order = calcOrder(items); 506 var notDisplayed = []; 507 var lastItem = null; 508 items.each(function eachItems(i, gridItem) { 509 var item = $(gridItem); 510 var p = item; 511 do { 512 if (p.css('display') === 'none') { 513 p.data('style', p.attr('style')).css('display', 'block'); 514 notDisplayed.push(p[0]); 515 } 516 p = p.parent(); 517 518 } while (p.length > 0 && p[0] !== gridElement && !item.is(':visible')); 519 var first = firstLeft >= item.position().left; 520 if (first && row.length > 0) { 521 calcRow(gridElement._helpNodes, lastItem && lastItem.parentNode !== gridItem.parentNode, order); 522 } 523 row.push(gridItem); 524 item.toggleClass('first-col', first); 525 if (i === items.length - 1) { 526 calcRow(gridElement._helpNodes, true, order); 527 } 528 lastItem = gridItem; 529 }); 530 $(notDisplayed).each(function eachHidden(i, e) { 531 var el = $(e); 532 var css = el.data('style'); 533 el.removeData('style'); 534 if ('undefined' !== typeof css) { 535 el.attr('style', css); 536 } else { 537 el.removeAttr('style'); 538 } 539 }); 540 gridElement._width = g.innerWidth();
541 gridElement._height = g.innerHeight(); 542 $(window).scrollTop(windowScrollTop); 543 $(window).off('resize', lazy); 544 $(window).resize(); 545 $(window).on('resize', lazy); 546 }); 547 }, 548 timeoutLazy, 549 lazy = function lazy(e, param){ 550 clearTimeout(timeoutLazy); 551 if (param && param.force) { 552 resize(); 553 } else { 554 timeoutLazy = setTimeout(resize, 100); 555 } 556 }, 557 interval =function interval(){ 558 lazy(); 559 setTimeout(interval, 1000); 560 }; 561 $(window).resize(lazy); 562 $(interval); 563})(jQuery); 564 565(function ($) { 566 'use strict'; 567 $(document).ready(function () { 568 try { 569 if ("undefined" !== typeof parent.AppController) return; 570 var controls = $('[data-autoplay=true]'); 571 $(controls).each(function (index, item) { 572 item.src = item.src + "&autoplay=1"; 573 }); 574 } catch (e) {} 575 }); 576})(jQuery); 577 578jQuery(function ($) { 579 'use strict'; 580 581 $(document).on('touchend click', '[data-responsive-menu] li > a:not([data-toggle="collapse"])', function responsiveClick(e) { 582 var itemLink = $(this); 583 var menu = itemLink.closest('[data-responsive-menu]'); 584 var responsiveBtn = menu.find('.collapse-button'); 585 var responsiveLevels = menu.data('responsiveLevels'); 586 587 if (responsiveBtn.length && !responsiveBtn.is(':visible') || 588 responsiveLevels !== 'expand on click' && responsiveLevels !== '' || 589 !menu.data('responsiveMenu') || 590 menu.is('[class*="bd-vmenu-"]') && $('body').width() > 767) { 591 return true; 592 } 593 594 var submenu = itemLink.siblings(); 595 if (!submenu.length) return true; 596 if (submenu.css('visibility') === 'visible') { 597 submenu.removeClass('show'); 598 submenu.find('.show').removeClass('show'); 599 itemLink.removeClass('active'); 600 } else { 601 itemLink 602 .closest('li') 603 .siblings('li') 604 .find('ul').parent() 605 .removeClass('show'); 606 itemLink 607 .closest('li') 608 .siblings('li') 609 .children('a') 610 .removeClass('active'); 611 submenu.addClass('show'); 612 itemLink.addClass('active'); 613 } 614 e.preventDefault(); 615 return false; 616 }); 617}); 618 619jQuery(function ($) { 620 'use strict'; 621 622 $('body') 623 .on('click.themler', '.bd-overSlide[data-url] a, .bd-slide[data-url] a', function (e) { 624 e.stopPropagation(); 625 }) 626 .on('click.themler', '.bd-overSlide[data-url], .bd-slide[data-url]', function () { 627 var elem = $(this), 628 url = elem.data('url'), 629 target = elem.data('target'); 630 window.open(url, target); 631 }); 632}); 633 634jQuery(function ($) { 635 'use strict'; 636 var leftClass = 'bd-popup-left'; 637 var rightClass = 'bd-popup-right'; 638 639 $(document).on('mouseenter touchstart', 'ul.nav > li, .nav ul > li', function calcSubmenuDirection() { 640 var popup = $(this).children('[class$="-popup"], [class*="-popup "]'); 641 if (popup.length) { 642 popup.removeClass(leftClass + ' ' + rightClass); 643 var dir = ''; 644 if (popup.parents('.' + leftClass).length) { 645 dir = leftClass; 646 } else if (popup.parents('.' + rightClass).length) { 647 dir = rightClass; 648 } 649 if (dir) { 650 popup.addClass(dir); 651 } else { 652 var left = popup.offset().left; 653 var width = popup.outerWidth(); 654 if (left < 0) { 655 popup.addClass(rightClass); 656 } else if (left + width > $(window).width()) { 657 popup.addClass(leftClass); 658 } 659 } 660 } 661 }); 662}); 663 664jQuery(function ($) { 665 'use strict'; 666 667 window.tabCollapseResize = function () { 668 $('.tabbable').each(function () { 669 var tabbable = $(this); 670 var tabMenu = tabbable.children('.nav-tabs'); 671 var tabs = tabMenu.children('li'); 672 var tabContent = tabbable.children('.tab-content'); 673 var panels = tabContent.find('.tab-pane'); 674 675 if (!tabs.filter('.active').length) { 676 tabs.first().addClass('active'); 677 panels.removeClass('active').first().addClass('active'); 678 } 679 680 if (!tabbable.data('responsive')) { 681 if (tabContent.children('.accordion').length) { 682 tabContent.children('.accordion').children().first().unwrap(); 683 } 684 tabContent.find('.accordion-item').remove(); 685 panels.each(function () { 686 var wrapper = $(this).children('.accordion-wrap'); 687 if (wrapper.children().length) { 688 wrapper.children().first().unwrap(); 689 } else { 690 wrapper.remove(); 691 } 692 }); 693 return; 694 } 695 696 var cls = tabMenu.siblings('.accordion').children('.accordion-content').attr('class'); 697 var wrapper = tabContent.find('.accordion-wrap'); 698 if (wrapper.length) { 699 tabContent.find('.accordion-wrap').toggleClass(cls, tabContent.find('.accordion-item:visible').length > 0); 700 return; 701 } 702 703 var accordion = tabbable.children('.accordion'); 704 705 accordion.show(); 706 var accordionTpl = accordion.clone(); 707 accordion.hide(); 708 709 var itemTpl = accordion.find('.accordion-item').clone(); 710 var contentTpl = accordion.find('.accordion-content').clone(); 711 accordionTpl.empty(); 712 713 tabs.each(function () { 714 var tab = $(this); 715 var tablink = tab.find('[data-toggle="tab"]'); 716 var currentId = tablink.attr('href'); 717 var panel = panels.filter(currentId); 718 719 var collapseLink = $('<a></a>'); 720 collapseLink.html(tablink.html()); 721 collapseLink.attr('data-toggle', 'collapse'); 722 collapseLink.attr('data-target', currentId); 723 724 panel.before(itemTpl.clone().append(collapseLink)); 725 panel.wrapInner(contentTpl.clone().addClass('accordion-wrap').toggleClass(cls, collapseLink.is(':visible'))); 726 727 panel.addClass('collapse'); 728 if (panel.is('.active')) { 729 panel.addClass('in'); 730 collapseLink.addClass('active'); 731 } 732 733 /* Collapse */ 734 735 panel.on('show.bs.collapse', function () { 736 var actives = panels.filter('.in'); 737 panels.filter('.collapsing:not(.active)').addClass('bd-collapsing'); 738 if (actives && actives.length) { 739 var activesData = actives.data('bs.collapse'); 740 if (!activesData || !activesData.transitioning) { 741 actives.collapse('hide'); 742 if (!activesData) actives.data('bs.collapse', null); 743 } 744 } 745 panel.css('display', 'block'); 746 747 collapseLink.addClass('active'); 748 }); 749 750 panel.on('shown.bs.collapse', function () { 751 tab.addClass('active'); 752 panel.addClass('active'); 753 754 panel.css('display', ''); 755 panel.filter('.bd-collapsing').removeClass('bd-collapsing').collapse('hide'); 756 }); 757 758 panel.on('hide.bs.collapse', function () { 759 collapseLink.removeClass('active'); 760 }); 761 762 panel.on('hidden.bs.collapse', function () { 763 tab.removeClass('active'); 764 panel.removeClass('active'); 765 panel.css('height', ''); 766 }); 767 768 /* Tabs */ 769 770 tablink.on('show.bs.tab', function () { 771 panels.removeClass('in'); 772 tabContent.find('.accordion > .accordion-item > a').removeClass('active'); 773 774 panel.css('height', ''); 775 panel.addClass('in'); 776 collapseLink.addClass('active'); 777 }); 778 }); 779 780 tabContent.wrapInner(accordionTpl); 781 }); 782 }; 783 784 var resizeTimeout; 785 $(window).on('resize', function (e, param) { 786 clearTimeout(resizeTimeout); 787 if (param && param.force) { 788 window.tabCollapseResize(); 789 } else { 790 resizeTimeout = setTimeout(window.tabCollapseResize, 25); 791 } 792 }); 793 794 window.tabCollapseResize(); 795}); 796 797jQuery(function ($) { 798 'use strict'; 799 800 var resizeHandler = function () { 801 $('.carousel.adjust-slides').each(function () { 802 var inner = $(this).find('.carousel-inner'), 803 items = inner.children('.item').addClass('clearfix').css('width', '100%'); 804 var maxH = 0; 805 if (items.length > 1) { 806 var windowScrollTop = $(window).scrollTop(); 807 items.css('min-height', '0').each(function(){ 808 maxH = Math.max(maxH, parseFloat(getComputedStyle(this).height)); 809 }).css('min-height', maxH); 810 inner.css('height', maxH); 811 if ($(window).scrollTop() !== windowScrollTop){ 812 $(window).scrollTop(windowScrollTop); 813 } 814 } 815 }); 816 setTimeout(resizeHandler, 100); 817 }; 818 resizeHandler(); 819}); 820 821})(window._$, window._$); 822(function (jQuery, $) { 823(function ($) { 824 'use strict'; 825 826 window.initAffix = function initAffix(selector) { 827 $('.bd-affix-fake').prev(':not([data-fix-at-screen])').next().remove(); 828 829 $(selector).each(function () { 830 var element = $(this), 831 offset = {}, 832 cachedOffset = null; 833 834 element.off('.affix'); 835 element.removeAttr('style'); 836 element.removeClass($.fn.affix.Constructor.RESET); 837 element.removeData('bs.affix'); 838 839 offset.top = function () { 840 var hasAffix = element.hasClass('affix'); 841 842 if (cachedOffset === null && hasAffix) { 843 element.removeClass('affix'); 844 } 845 846 if (!hasAffix) { 847 var elTop = element.offset().top, 848 offset = parseInt(element.data('offset'), 10) || 0, 849 clipAtControl = element.data('clipAtControl'), 850 fixAtScreen = element.data('fixAtScreen'), 851 elHeight = element.outerHeight(); 852 853 var ev = $.Event('affix-calc.theme.affix'); 854 element.trigger(ev); 855 ev.offset = ev.offset || 0; 856 offset += ev.offset; 857 858 if (clipAtControl === 'bottom') { 859 elTop += elHeight; 860 } 861 862 if (fixAtScreen === 'bottom') { 863 elTop += offset; 864 elTop -= $(window).height(); 865 } 866 867 if (fixAtScreen === 'top') { 868 elTop -= offset; 869 } 870 871 cachedOffset = elTop; 872 } 873 874 if (cachedOffset === null && hasAffix) { 875 element.addClass('affix'); 876 } 877 878 return cachedOffset; 879 }; 880 881 element.on('affix.bs.affix', function (e) { 882 var el = $(this), 883 fake = el.next('.bd-affix-fake'); 884 885 if (!fake.is(':visible')) { 886 e.preventDefault(); 887 return; 888 } 889 890 if (['absolute', 'fixed'].indexOf(el.css('position')) === -1) { 891 fake.css('height', el.outerHeight(true)); 892 } 893 894 // fix affix position 895 var body = $('body'); 896 var bodyWidth = body.outerWidth() || 1; 897 var elWidth = el.outerWidth(); 898 var elLeft = el.offset().left; 899 el.css('width', (el.outerWidth() / bodyWidth * 100) + '%'); 900 901 if (bodyWidth / 2 > (elLeft + elWidth / 2)) { 902 el.css('left', (elLeft / bodyWidth * 100) + '%'); 903 el.css('right', 'auto'); 904 } else { 905 el.css('right', ((bodyWidth - elLeft - elWidth) / bodyWidth * 100) + '%'); 906 el.css('left', 'auto'); 907 } 908 909 var offset = parseInt(element.data('offset'), 10) || 0; 910 var ev = $.Event('affix-calc.theme.affix'); 911 el.trigger(ev); 912 ev.offset = ev.offset || 0; 913 offset += ev.offset; 914 915 if (element.data('fixAtScreen') === 'bottom') { 916 el.css('top', 'auto'); 917 el.css('bottom', offset + 'px'); 918 } else { 919 el.css('top', offset + 'px'); 920 el.css('bottom', 'auto'); 921 } 922 }); 923 924 element.on('affixed-top.bs.affix', function () { 925 $(this).next('.bd-affix-fake').removeAttr('style'); 926 $(this).removeAttr('style'); 927 }); 928 929 if (!element.next('.bd-affix-fake').length) { 930 element.after('<div class="bd-affix-fake"></div>'); 931 } 932 933 $('body').trigger($.Event('affix-init.theme.affix'), [element]); 934 935 element.affix({ 936 'offset': offset 937 }); 938 939 element.affix('checkPosition'); 940 }); 941 }; 942 943 $(function ($) { 944 var affixTimeout; 945 946 $(window).on('resize', function (e, param) { 947 clearTimeout(affixTimeout); 948 if (param && param.force) { 949 window.initAffix('[data-affix]'); 950 } else { 951 affixTimeout = setTimeout(function () { 952 window.initAffix('[data-affix]'); 953 }, 100); 954 } 955 }); 956 957 window.initAffix('[data-affix]'); 958 }); 959})(jQuery); 960})(window._$, window._$); 961(function (jQuery, $) { 962(function($){ 963 'use strict'; 964 /*jshint -W004 */ 965 /** 966 * Copyright 2012, Digital Fusion 967 * Licensed under the MIT license. 968 * http://teamdf.com/jquery-plugins/license/ 969 * 970 * @author Sam Sehnert
971 * @desc A small plugin that checks whether elements are within 972 * the user visible viewport of a web browser. 973 * only accounts for vertical position, not horizontal. 974 */ 975 var $w = $(window); 976 $.fn.visible = function(partial,hidden,direction){ 977 978 if (this.length < 1) 979 return; 980 981 var $t = this.length > 1 ? this.eq(0) : this, 982 t = $t.get(0), 983 vpWidth = $w.width(), 984 vpHeight = $w.height(), 985 direction = (direction) ? direction : 'both', 986 clientSize = hidden === true ? t.offsetWidth * t.offsetHeight : true; 987 988 if (typeof t.getBoundingClientRect === 'function'){ 989 990 // Use this native browser method, if available. 991 var rec = t.getBoundingClientRect(), 992 tViz = rec.top >= 0 && rec.top < vpHeight, 993 bViz = rec.bottom > 0 && rec.bottom <= vpHeight, 994 lViz = rec.left >= 0 && rec.left < vpWidth, 995 rViz = rec.right > 0 && rec.right <= vpWidth, 996 vVisible = partial ? tViz || bViz : tViz && bViz, 997 hVisible = partial ? lViz || rViz : lViz && rViz; 998 999 if(direction === 'both') 1000 return clientSize && vVisible && hVisible; 1001 else if(direction === 'vertical') 1002 return clientSize && vVisible; 1003 else if(direction === 'horizontal') 1004 return clientSize && hVisible; 1005 } else { 1006 1007 var viewTop = $w.scrollTop(),
1008 viewBottom = viewTop + vpHeight, 1009 viewLeft = $w.scrollLeft(), 1010 viewRight = viewLeft + vpWidth, 1011 offset = $t.offset(), 1012 _top = offset.top, 1013 _bottom = _top + $t.height(), 1014 _left = offset.left, 1015 _right = _left + $t.width(), 1016 compareTop = partial === true ? _bottom : _top, 1017 compareBottom = partial === true ? _top : _bottom, 1018 compareLeft = partial === true ? _right : _left, 1019 compareRight = partial === true ? _left : _right; 1020 1021 if(direction === 'both') 1022 return !!clientSize && ((compareBottom <= viewBottom) && (compareTop >= viewTop)) && ((compareRight <= viewRight) && (compareLeft >= viewLeft)); 1023 else if(direction === 'vertical') 1024 return !!clientSize && ((compareBottom <= viewBottom) && (compareTop >= viewTop)); 1025 else if(direction === 'horizontal') 1026 return !!clientSize && ((compareRight <= viewRight) && (compareLeft >= viewLeft)); 1027 } 1028 }; 1029 1030 $(onLoad); 1031 $(window).on('scroll', animateOnScroll); 1032 1033 function onLoad() { 1034 var hoverEffects = $('.animated[data-animation-event="hover"]'); 1035 if (hoverEffects.length) { 1036 hoverEffects.each(function () { 1037 var effect = $(this);
1038 effect.on('mouseover', animateOnHover(effect)); 1039 }); 1040 } 1041 1042 var scrollEffects = $('.animated[data-animation-event="scroll"]'); 1043 scrollEffects.each(function () { 1044 var effect = $(this); 1045 if (needToHide(effect)) { 1046 effect.css('visibility', 'hidden'); 1047 } 1048 }); 1049 1050 subscribeOnSlideEvents('slideout'); 1051 subscribeOnSlideEvents('slidein'); 1052 1053 var slideInEffects = $('.animated[data-animation-event="slidein"]'); 1054 if (slideInEffects.length) { 1055 var carousels = getCarousels(slideInEffects); 1056 1057 if (carousels.length) { 1058 carousels.forEach(function (_class) { 1059 var _carousel = $('.' + _class.trim().replace(/\s{2,}/g, ' ').replace(/\s/g, '.')); 1060 _carousel.trigger('slid.bs.carousel'); 1061 }); 1062 } 1063 } 1064 1065 var onLoadEffects = $('.animated[data-animation-event="onload"]'); 1066 if (onLoadEffects.length) { 1067 onLoadEffects.each(function () { 1068 applyAnimation($(this)); 1069 }); 1070 } 1071 var onLoadIntervalEffects = $('.animated[data-animation-event="onloadinterval"]'); 1072 if (onLoadIntervalEffects.length) { 1073 onLoadIntervalEffects.each(function () { 1074 var effect = $(this); 1075 if (effect.visible(true)) { 1076 var animationClass = effect.data('animation-name'); 1077 if (animationClass) { 1078 effect.addClass(animationClass); 1079 } 1080 } 1081 1082 var duration = isNaN(parseFloat(effect.attr('data-animation-duration'))) ? 0 : parseFloat(effect.attr('data-animation-duration')); 1083 var delay = isNaN(parseFloat(effect.attr('data-animation-delay'))) ? 0 : parseFloat(effect.attr('data-animation-delay')); 1084 setInterval(function () { 1085 effect.removeClass(animationClass); 1086 setTimeout(function (){ 1087 effect.addClass(animationClass); 1088 }, 50); 1089 }, duration + delay); 1090 }); 1091 } 1092 1093 } 1094 function applyAnimation(effect) { 1095 if (effect.visible(true)) { 1096 var animationClass = effect.data('animation-name'); 1097 if (animationClass) { 1098 effect.addClass(animationClass); 1099 } 1100 1101 if (effect.attr('data-animation-infinited') === 'true') { 1102 effect.addClass('infinite'); 1103 } 1104 } 1105 } 1106 1107 function animateOnScroll() { 1108 var scrollEffects = $('.animated[data-animation-event="scroll"]'); 1109 1110 if (scrollEffects) { 1111 scrollEffects.each(function () { 1112 var effect = $(this); 1113 if (needToHide(effect)) { 1114 effect.css('visibility', ''); 1115 } 1116 applyAnimation(effect); 1117 }); 1118 } 1119 var scrollLoopEffects = $('.animated[data-animation-event="scrollloop"]'); 1120 if (scrollLoopEffects) { 1121 scrollLoopEffects.each(function () { 1122 var effect = $(this); 1123 if (effect.visible(false)) { 1124 effect.removeClass(effect.data('animation-name')); 1125 } 1126 applyAnimation(effect); 1127 }); 1128 } 1129 } 1130 1131 function animateOnHover(dom) { 1132 return (function() { 1133 var animationClass = dom.attr('data-animation-name'); 1134 if (animationClass && !dom.is('.' + animationClass)) { 1135 if (dom.attr('data-animation-infinited') === 'false') { 1136 var duration = dom.attr('data-animation-duration'); 1137 setTimeout(function () { 1138 dom.removeClass(animationClass); 1139 }, isNaN(parseFloat(duration)) ? 1000 : parseFloat(duration)); 1140 } else { 1141 dom.addClass('infinite'); 1142 } 1143 dom.addClass(animationClass); 1144 } 1145 }); 1146 } 1147 1148 function subscribeOnSlideEvents(eventName) { 1149 var slideEffects = $('.animated[data-animation-event="' + eventName + '"]'); 1150 var carouselEvent = eventName === 'slideout' ? 'slide' : 'slid'; 1151 if (slideEffects.length) { 1152 var carousels = getCarousels(slideEffects); 1153 1154 if (carousels.length) {
1155 carousels.forEach(function (_class) { 1156 var _carousel = $('.' + _class.trim().replace(/\s{2,}/g, ' ').replace(/\s/g, '.')); 1157 _carousel.on(carouselEvent + '.bs.carousel', eventName === 'slidein' ? animateOnSlideIn(_carousel) : animateOnSlideOut(_carousel)); 1158 var slidinTargets = _carousel.find('.animated[data-animation-event="' + eventName + '"]'); 1159 slidinTargets.each(function() { 1160 var target = $(this); 1161 if (target.attr('data-animation-display') && target.attr('data-animation-display') === 'none') { 1162 target.css('display', 'none'); 1163 } 1164 }); 1165 _carousel.on('slide.bs.carousel', function (event) { 1166 var target = $(event.relatedTarget); 1167 var effectsInSlider = target.find('.animated[data-animation-event="' + eventName + '"]'); 1168 if (effectsInSlider.length) { 1169 var maxDuration = eventName === 'slideout' ? getMaxDuration(effectsInSlider) : 0; 1170 effectsInSlider.each(function () { 1171 var effect = $(this); 1172 if (needToHide(effect)) { 1173 if (eventName === 'slideout') { 1174 setTimeout(function () { 1175 effect.css('display', ''); 1176 }, maxDuration); 1177 } 1178 if (eventName === 'slidein') { 1179 effect.css('display', 'none'); 1180 } 1181 } 1182 }); 1183 } 1184 }); 1185 }); 1186 } 1187 } 1188 } 1189 1190 1191 1192 function animateOnSlideOut(carousel) { 1193 return (function() { 1194 var moveSlide = false; 1195 return function (event) { 1196 var effects = getActiveSlideEffects(carousel, 'slideout'); 1197 if (effects.length) { 1198 if (!moveSlide) { 1199 event.isDefaultPrevented = function () { 1200 return true; 1201 }; 1202 1203 animateFunc(carousel, 'slideout'); 1204 1205 var eventDirection = event.direction === 'left' ? 'next' : 'prev'; 1206 var maxDuration = getMaxDuration(effects); 1207 setTimeout(function () { 1208 moveSlide = true; 1209 carousel.carousel(eventDirection); 1210 }, maxDuration); 1211 } else { 1212 moveSlide = false; 1213 } 1214 } 1215 }; 1216 })(); 1217 } 1218 1219 function animateOnSlideIn(carousel) { 1220 return (function () { 1221 animateFunc(carousel, 'slidein'); 1222 }); 1223 } 1224 1225 function animateFunc(carousel, eventName){ 1226 var effects = getActiveSlideEffects(carousel, eventName); 1227 var maxDuration = getMaxDuration(effects); 1228 effects.each(function () { 1229 var effect = $(this); 1230 var animationClass = effect.attr('data-animation-name'); 1231 if (animationClass) { 1232 if (effect.attr('data-animation-infinited') === 'false') { 1233 if (!effect.is('.' + animationClass)) { 1234 setTimeout(function () { 1235 effect.removeClass(animationClass); 1236 }, maxDuration + 100); 1237 } 1238 } else { 1239 effect.addClass('infinite'); 1240 } 1241 if (needToHide(effect)) { 1242 if (eventName === 'slideout') { 1243 setTimeout(function () { 1244 effect.css('display', 'none'); 1245 }, maxDuration); 1246 } 1247 if (eventName === 'slidein') { 1248 effect.css('display', '').find('.animated[data-animation-event="slideout"]').css('display',''); 1249 } 1250 } 1251 effect.addClass(animationClass); 1252 } 1253 }); 1254 } 1255 1256 function needToHide(effect) { 1257 var hide = true; 1258 var animationName = effect.attr('data-animation-name'); 1259 var visibleAnimations = ['bounce', 'flash', 'pulse', 'rubber', 'band','snake','swing','tada','wobble', 'slideindown' , 'slideinleft' , 'slideinright', 'slideinup', 1260 'slideoutdown', 'slideoutleft', 'slideoutright', 'slideoutup']; 1261 hide = visibleAnimations.indexOf(animationName.toLowerCase()) === -1; 1262 return hide; 1263 } 1264 1265 function getCarousels(effects) { 1266 var carousels = []; 1267 effects.each(function () { 1268 var effect = $(this); 1269 var carousel = $('.carousel').has(effect); 1270 if (carousel.length && carousels.indexOf(carousel.attr('class')) === -1) { 1271 carousels.push(carousel.attr('class')); 1272 } 1273 }); 1274 return carousels; 1275 } 1276 1277 function getMaxDuration(effects) { 1278 var maxDuration = 0; 1279 effects.each(function () { 1280 var effect = $(this); 1281 var duration = isNaN(parseFloat(effect.attr('data-animation-duration'))) ? 0 : parseFloat(effect.attr('data-animation-duration')),
1282 delay = isNaN(parseFloat(effect.attr('data-animation-delay'))) ? 0 : parseFloat(effect.attr('data-animation-delay')); 1283 var animationTime = duration + delay; 1284 1285 maxDuration = maxDuration < animationTime ? animationTime : maxDuration; 1286 }); 1287 return maxDuration; 1288 } 1289 1290 function getActiveSlideEffects(carousel, event) { 1291 var activeSlide = carousel.find('.carousel-inner > .active'); 1292 var effects = activeSlide.find('.animated[data-animation-event="' + event + '"]'); 1293 return effects; 1294 } 1295 1296})(jQuery); 1297})(window._$, window._$); 1298(function (jQuery, $) { 1299(function ($) { 1300 'use strict'; 1301 $(onLoad); 1302 1303 var timeout; 1304 $(window).on('resize', function (event, param) { 1305 clearTimeout(timeout); 1306 if (param && param.force) { 1307 applyImageScalling(); 1308 } else { 1309 timeout = setTimeout(function () { 1310 applyImageScalling(); 1311 }, 100); 1312 } 1313 }); 1314 1315 function onLoad() { 1316 $(".bd-imagescaling-animated").each(function () { 1317 var c = $(this); 1318 var img = c.find('img'); 1319 if (img.length) { 1320 scaling(c, img); 1321 img.bind('load', function () { 1322 scaling(c, img); 1323 }); 1324 } 1325 }); 1326 } 1327 1328 function applyImageScalling() { 1329 $(".bd-imagescaling-animated").each(function () { 1330 var c = $(this); 1331 var img = c.find('img'); 1332 if (img.length) { 1333 scaling(c, img); 1334 } 1335 }); 1336 } 1337 1338 function scaling(c, img) { 1339 if (!c.length) return; 1340 1341 var imgSrc = img.attr('src') || '', 1342 imgClass = img.attr('class') || ''; 1343 1344 var imgWrapper = img.parent('.bd-imagescaling-img'); 1345 1346 if (!imgWrapper.length || imgClass) { 1347 if (img.parent().is('.bd-imagescaling-img')) { 1348 img.unwrap(); 1349 } 1350 imgWrapper = img.wrap('<div class="' + imgClass + ' bd-imagescaling-img"></div>').parent(); 1351 img.removeClass(); 1352 } 1353 1354 if (imgSrc.indexOf('.') === 0) { 1355 imgSrc = combineUrl(window.location.href, imgSrc); 1356 } 1357 1358 if (imgWrapper.siblings('.bd-parallax-image-wrapper').length === 0) { 1359 imgWrapper.css('background-image', 'url(' + imgSrc + ')'); 1360 } 1361 } 1362 1363 function combineUrl(base, relative) { 1364 if (!relative){ 1365 return base; 1366 } 1367 var stack = base.split("/"), 1368 parts = relative.split("/"); 1369 stack.pop(); 1370 1371 for (var i = 0; i < parts.length; i++) { 1372 if (parts[i] === ".") 1373 continue; 1374 if (parts[i] === "..") 1375 stack.pop(); 1376 else 1377 stack.push(parts[i]); 1378 } 1379 return stack.join("/"); 1380 } 1381})(jQuery); 1382 1383})(window._$, window._$); 1384(function (jQuery, $) { 1385 1386window.ThemeLightbox = (function ($) { 1387 'use strict'; 1388 return (function ThemeLightbox(selectors) { 1389 var selector = selectors; 1390 var images = $(selector); 1391 var current; 1392 var close = function () { 1393 $(".bd-lightbox").remove(); 1394 }; 1395 this.init = function () { 1396 1397 $(selector).mouseup(function (e) { 1398 if (e.which && e.which !== 1) { 1399 return; 1400 } 1401 current = images.index(this); 1402 var imgContainer = $('.bd-lightbox'); 1403 if (imgContainer.length === 0) {
1404 imgContainer = $('<div class="bd-lightbox">').css('line-height', $(window).height() + "px") 1405 .appendTo($("body")); 1406 var closeBtn = $('<div class="close"><div class="cw"> </div><div class="ccw"> </div><div class="close-alt">✗</div></div>'); 1407 closeBtn.appendTo(imgContainer); 1408 closeBtn.click(close); 1409 showArrows(); 1410 var scrollDelay = 100; 1411 var lastScroll = 0; 1412 imgContainer.bind('mousewheel DOMMouseScroll', function (e) { 1413 var date = new Date(); 1414 if (date.getTime() > lastScroll + scrollDelay) { 1415 lastScroll = date.getTime(); 1416 var orgEvent = window.event || e.originalEvent; 1417 var delta = (orgEvent.wheelDelta ? orgEvent.wheelDelta : orgEvent.detail * -1) > 0 ? 1 : -1; 1418 move(current + delta); 1419 } 1420 e.preventDefault(); 1421 }).mousedown(function (e) { 1422 // close on middle button click 1423 if (e.which === 2) { 1424 close(); 1425 } 1426 e.preventDefault(); 1427 }); 1428 } 1429 move(current); 1430 }); 1431 }; 1432 1433 function move(index) { 1434 1435 if (index < 0 || index >= images.length) { 1436 return; 1437 } 1438 1439 showError(false); 1440 1441 current = index; 1442 1443 $(".bd-lightbox .lightbox-image:not(.active)").remove(); 1444 1445 var active = $(".bd-lightbox .active"); 1446 var target = $('<img class="lightbox-image" alt="" src="' + getFullImgSrc($(images[current])) + '" />').click(function () { 1447 if ($(this).hasClass("active")) { 1448 move(current + 1); 1449 } 1450 }); 1451 1452 if (active.length > 0) { 1453 active.after(target); 1454 } else { 1455 $(".bd-lightbox").append(target); 1456 } 1457 1458 showArrows(); 1459 showLoader(true); 1460 1461 $(".bd-lightbox").add(target); 1462 1463 target.load(function () { 1464 showLoader(false); 1465 active.removeClass("active"); 1466 target.addClass("active"); 1467 }); 1468 1469 target.error(function () { 1470 showLoader(false); 1471 active.removeClass("active"); 1472 target.addClass("active"); 1473 target.attr("src", $(images[current]).attr("src")); 1474 target.unbind('error'); 1475 }); 1476 } 1477 1478 function showArrows() { 1479 if ($(".bd-lightbox .arrow").length === 0) { 1480 var topOffset = $(window).height() / 2 - 40; 1481 $(".bd-lightbox") 1482 .append( 1483 $('<div class="arrow left"><div class="arrow-t ccw"> </div><div class="arrow-b cw"> </div><div class="arrow-left-alt">←</div></div>') 1484 .css("top", topOffset) 1485 .click(function () { 1486 move(current - 1); 1487 }) 1488 ) 1489 .append( 1490 $('<div class="arrow right"><div class="arrow-t cw"> </div><div class="arrow-b ccw"> </div><div class="arrow-right-alt">→</div></div>') 1491 .css("top", topOffset) 1492 .click(function () { 1493 move(current + 1); 1494 }) 1495 ); 1496 } 1497 1498 if (current === 0) { 1499 $(".bd-lightbox .arrow.left").addClass("disabled"); 1500 } else { 1501 $(".bd-lightbox .arrow.left").removeClass("disabled"); 1502 } 1503 1504 if (current === images.length - 1) { 1505 $(".bd-lightbox .arrow.right").addClass("disabled"); 1506 } else { 1507 $(".bd-lightbox .arrow.right").removeClass("disabled"); 1508 } 1509 } 1510 1511 function showError(enable) { 1512 if (enable) { 1513 $(".bd-lightbox").append($('<div class="lightbox-error">The requested content cannot be loaded.<br/>Please try again later.</div>') 1514 .css({ "top": $(window).height() / 2 - 60, "left": $(window).width() / 2 - 170 })); 1515 } else { 1516 $(".bd-lightbox .lightbox-error").remove(); 1517 } 1518 } 1519 1520 function showLoader(enable) { 1521 if (!enable) { 1522 $(".bd-lightbox .loading").remove(); 1523 } 1524 else { 1525 $('<div class="loading"> </div>').css({ "top": $(window).height() / 2 - 16, "left": $(window).width() / 2 - 16 }).appendTo($(".bd-lightbox")); 1526 } 1527 } 1528 1529 function getFullImgSrc(image) { 1530 var largeImage = ''; 1531 var parentLink = image.parent('a'); 1532 if (parentLink.length) { 1533 parentLink.click(function (e) { 1534 e.preventDefault(); 1535 }); 1536 largeImage = parentLink.attr('href'); 1537 } else { 1538 var src = image.attr("src"); 1539 var fileName = src.substring(0, src.lastIndexOf('.')); 1540 var ext = src.substring(src.lastIndexOf('.')); 1541 largeImage = fileName + "-large" + ext; 1542 } 1543 return largeImage; 1544 } 1545 }); 1546})(jQuery); 1547 1548 1549jQuery(function () { 1550 'use strict'; 1551 new window.ThemeLightbox('.bd-lightbox, .lightbox').init(); 1552}); 1553})(window._$, window._$); 1554(function (jQuery, $) { 1555(function ($) { 1556 'use strict'; 1557 1558 // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ 1559 // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating 1560 // requestAnimationFrame polyfill by Erik M?ller. fixes from Paul Irish and Tino Zijdel 1561 // MIT license 1562 1563 if (!/Android|BlackBerry|iPad|iPhone|iPod|Windows Phone/i.test(navigator.userAgent || navigator.vendor || window.opera)) { 1564 1565 (function () { 1566 var lastTime = 0; 1567 var vendors = ['ms', 'moz', 'webkit', 'o']; 1568 for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { 1569 window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']; 1570 window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || 1571 window[vendors[x] + 'CancelRequestAnimationFrame']; 1572 } 1573 1574 if (!window.requestAnimationFrame) 1575 window.requestAnimationFrame = function (callback) { 1576 var currTime = new Date().getTime(); 1577 var timeToCall = Math.max(0, 16 - (currTime - lastTime)); 1578 var id = window.setTimeout(function () { 1579 callback(currTime + timeToCall); 1580 }, 1581 timeToCall); 1582 lastTime = currTime + timeToCall; 1583 return id; 1584 }; 1585 1586 if (!window.cancelAnimationFrame) 1587 window.cancelAnimationFrame = function (id) { 1588 clearTimeout(id); 1589 }; 1590 }()); 1591 1592 var transform = ['transform', 'msTransform', 'webkitTransform', 'mozTransform', 'oTransform']; 1593 1594 $(function () { 1595 onLoad(); 1596 }); 1597 1598 var timeout; 1599 $(window).on('resize', function (e, param) { 1600 clearTimeout(timeout); 1601 if (param && param.force) { 1602 onResize(); 1603 } else { 1604 timeout = setTimeout(onResize, 100); 1605 } 1606 }); 1607 1608 $(window).on('scroll', function () { 1609 window.requestAnimationFrame(function () { 1610 onScroll(); 1611 }); 1612 }); 1613 } 1614 1615 function onLoad() { 1616 var elements = document.getElementsByClassName('bd-parallax-bg-effect'); 1617 if (elements.length && window._smoothWheelInstance) { 1618 window._smoothWheelInstance(); 1619 } 1620 1621 [].forEach.call(elements, function (element) { 1622 var that = element, 1623 controlClass = that.getAttribute('data-control-selector').replace(/\./g, ''), 1624 controls = document.getElementsByClassName(controlClass),
1625 isSlider = /bd-slider-\d+($|\s)/g.test(controlClass) || getClassName(controls[0]).indexOf('bd-slider') !== -1, 1626 isColumn = /bd-layoutcolumn-\d+($|\s)/g.test(controlClass); 1627 1628 var activeDoms = [], wrapperDiv; 1629 1630 if (isSlider) { 1631 controls = findByClass(controls[0], 'bd-slide'); 1632 if (controls.length) { 1633 [].forEach.call(controls, function (slide) { 1634 activeDoms = findTopLevelDoms(slide, 'bd-parallax-image-wrapper', controlClass); 1635 if (!activeDoms.length) { 1636 slide.style.backgroundImage = 'none'; 1637 slide.style.backgroundColor = 'transparent'; 1638 wrapperDiv = document.createElement('div'); 1639 wrapperDiv.className = 'bd-parallax-image-wrapper'; 1640 wrapperDiv.innerHTML = '<div class="bd-parallax-image"></div>'; 1641 slide.insertBefore(wrapperDiv, slide.firstChild); 1642 } 1643 }); 1644 } 1645 } 1646 else if (isColumn) { 1647 if (controls.length) { 1648 activeDoms = findTopLevelDoms(that, 'bd-parallax-image-wrapper', controlClass); 1649 if (!activeDoms.length) { 1650 var effectClone = that.cloneNode(true); 1651 effectClone.innerHTML = ''; 1652 1653 var columnNode = controls[0].parentNode; 1654 $(columnNode).unwrap(); 1655 columnNode.insertBefore(effectClone, columnNode.firstChild); 1656 1657 wrapperDiv = document.createElement('div'); 1658 wrapperDiv.className = 'bd-parallax-image-wrapper'; 1659 wrapperDiv.innerHTML = '<div class="bd-parallax-image"></div>'; 1660 1661 effectClone.insertBefore(wrapperDiv, effectClone.firstChild); 1662 } 1663 } 1664 } 1665 else { 1666 if (controls.length) { 1667 activeDoms = findTopLevelDoms(that, 'bd-parallax-image-wrapper', controlClass); 1668 if (!activeDoms.length) { 1669 wrapperDiv = document.createElement('div'); 1670 wrapperDiv.className = 'bd-parallax-image-wrapper'; 1671 wrapperDiv.innerHTML = '<div class="bd-parallax-image"></div>'; 1672 that.insertBefore(wrapperDiv, that.firstChild); 1673 } 1674 } 1675 } 1676 1677 if (controls.length) { 1678 [].forEach.call(controls, function (control) { 1679 var parallaxWrapper = isColumn ? findByClass(control.parentElement, 'bd-parallax-image-wrapper')[0] : findTopLevelDoms(control, 'bd-parallax-image-wrapper', controlClass)[0], 1680 parallaxImg = parallaxWrapper.getElementsByClassName('bd-parallax-image')[0], 1681 controlOffset = $(that).offset().top, 1682 controlHeight = that.clientHeight, 1683 viewPortHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); 1684 1685 if (control.style.backgroundImage === 'none') { 1686 control.style.backgroundImage = ''; 1687 } 1688 1689 if (control.style.backgroundColor === 'transparent') { 1690 control.style.backgroundColor = ''; 1691 } 1692 1693 var backgroundStyles = getComputedStyle(control); 1694 1695 if (backgroundStyles.position === 'static') { 1696 control.style.position = 'relative'; 1697 } 1698 1699 if (backgroundStyles.backgroundImage !== 'none' && parallaxImg.style.backgroundImage !== backgroundStyles.backgroundImage) { 1700 parallaxImg.style.backgroundImage = backgroundStyles.backgroundImage; 1701 } 1702 1703 if (backgroundStyles.backgroundColor !== 'transparent' && parallaxImg.style.backgroundColor !== backgroundStyles.backgroundColor) { 1704 parallaxImg.style.backgroundColor = backgroundStyles.backgroundColor; 1705 } 1706 1707 control.style.backgroundImage = 'none'; 1708 control.style.backgroundColor = 'transparent'; 1709 parallaxImg.style.backgroundRepeat = backgroundStyles.backgroundRepeat; 1710 parallaxImg.style.backgroundPosition = backgroundStyles.backgroundPosition; 1711 1712 if (isSlider) { 1713 parallaxWrapper.style.setProperty('z-index', '-2', 'important'); 1714 } 1715 1716 if (isColumn) { 1717 var containerStyles = getComputedStyle(parallaxWrapper); 1718 parallaxImg.style.setProperty('min-width', containerStyles.width, 'important'); 1719 //parallaxImg.style.setProperty('min-height', Math.min(viewPortHeight, 3 * parseInt(containerStyles.height)) + 'px', 'important'); 1720 } 1721 1722 var positionDifference, 1723 controlBottom = controlOffset + controlHeight; 1724 1725 if (controlOffset >= viewPortHeight / 2) { 1726 //var additionalSpace = controlOffset < viewPortHeight ? (viewPortHeight - controlOffset) / 2 : 0; 1727 positionDifference = -viewPortHeight / 2 /*+ additionalSpace*/ + (getCompatibleScrollTop() + viewPortHeight - controlOffset) / 2; 1728 } 1729 else { 1730 positionDifference = /*-controlOffset / 2*/ +(getCompatibleScrollTop() - controlOffset) / 2; 1731 } 1732 if (getCompatibleScrollTop() + viewPortHeight > controlOffset && getCompatibleScrollTop() < controlBottom) {
1733 var transformProperty = getSupportedPropertyName(transform); 1734 if (transformProperty) { 1735 parallaxImg.style[transformProperty] = 'translate3d(0, ' + positionDifference + 'px, 0)'; 1736 } 1737 } 1738 }); 1739 } 1740 }); 1741 } 1742 1743 function onResize() { 1744 var elements = document.getElementsByClassName('bd-parallax-bg-effect'); 1745 if (elements.length && window._smoothWheelInstance) { 1746 window._smoothWheelInstance(); 1747 } 1748 1749 [].forEach.call(elements, function (element) { 1750 var that = element, 1751 controlClass = that.getAttribute('data-control-selector').replace(/\./g, ''), 1752 controls = document.getElementsByClassName(controlClass), 1753 isSlider = /bd-slider-\d+($|\s)/g.test(controlClass) || getClassName(controls[0]).indexOf('bd-slider') !== -1, 1754 isColumn = /bd-layoutcolumn-\d+($|\s)/g.test(controlClass); 1755 1756 var activeDoms = [], wrapperDiv; 1757 1758 if (isSlider) { 1759 controls = findByClass(controls[0], 'bd-slide'); 1760 if (controls.length) { 1761 [].forEach.call(controls, function (slide) { 1762 activeDoms = findTopLevelDoms(slide, 'bd-parallax-image-wrapper', controlClass); 1763 if (!activeDoms.length) { 1764 slide.style.backgroundImage = 'none'; 1765 slide.style.backgroundColor = 'transparent'; 1766 wrapperDiv = document.createElement('div'); 1767 wrapperDiv.className = 'bd-parallax-image-wrapper'; 1768 wrapperDiv.innerHTML = '<div class="bd-parallax-image"></div>'; 1769 slide.insertBefore(wrapperDiv, slide.firstChild); 1770 } 1771 }); 1772 } 1773 } 1774 else if (isColumn) { 1775 if (controls.length) { 1776 activeDoms = findTopLevelDoms(that, 'bd-parallax-image-wrapper', controlClass); 1777 if (!activeDoms.length) { 1778 var effectClone = that.cloneNode(true); 1779 effectClone.innerHTML = ''; 1780 1781 var columnNode = controls[0].parentNode; 1782 $(columnNode).unwrap(); 1783 columnNode.insertBefore(effectClone, columnNode.firstChild); 1784 1785 wrapperDiv = document.createElement('div'); 1786 wrapperDiv.className = 'bd-parallax-image-wrapper'; 1787 wrapperDiv.innerHTML = '<div class="bd-parallax-image"></div>'; 1788 1789 effectClone.insertBefore(wrapperDiv, effectClone.firstChild); 1790 } 1791 } 1792 } 1793 else { 1794 if (controls.length) { 1795 activeDoms = findTopLevelDoms(that, 'bd-parallax-image-wrapper', controlClass); 1796 if (!activeDoms.length) { 1797 wrapperDiv = document.createElement('div'); 1798 wrapperDiv.className = 'bd-parallax-image-wrapper'; 1799 wrapperDiv.innerHTML = '<div class="bd-parallax-image"></div>'; 1800 that.insertBefore(wrapperDiv, that.firstChild); 1801 } 1802 } 1803 } 1804 1805 if (controls.length) { 1806 [].forEach.call(controls, function (control) { 1807 var parallaxWrapper = isColumn ? findByClass(control.parentElement, 'bd-parallax-image-wrapper')[0] : findTopLevelDoms(control, 'bd-parallax-image-wrapper', controlClass)[0], 1808 parallaxImg = parallaxWrapper.getElementsByClassName('bd-parallax-image')[0], 1809 controlOffset = $(that).offset().top, 1810 controlHeight = that.clientHeight, 1811 viewPortHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); 1812 1813 if (control.style.backgroundImage === 'none') { 1814 control.style.backgroundImage = ''; 1815 } 1816 1817 if (control.style.backgroundColor === 'transparent') { 1818 control.style.backgroundColor = ''; 1819 } 1820 1821 var backgroundStyles = getComputedStyle(control); 1822 1823 if (backgroundStyles.position === 'static') { 1824 control.style.position = 'relative'; 1825 } 1826 1827 if (backgroundStyles.backgroundImage !== 'none' && parallaxImg.style.backgroundImage !== backgroundStyles.backgroundImage) { 1828 parallaxImg.style.backgroundImage = backgroundStyles.backgroundImage; 1829 } 1830 1831 if (backgroundStyles.backgroundColor !== 'transparent' && parallaxImg.style.backgroundColor !== backgroundStyles.backgroundColor) { 1832 parallaxImg.style.backgroundColor = backgroundStyles.backgroundColor; 1833 } 1834 1835 control.style.backgroundImage = 'none'; 1836 control.style.backgroundColor = 'transparent'; 1837 parallaxImg.style.backgroundRepeat = backgroundStyles.backgroundRepeat; 1838 parallaxImg.style.backgroundPosition = backgroundStyles.backgroundPosition; 1839 1840 if (isSlider) { 1841 parallaxWrapper.style.setProperty('z-index', '-2', 'important'); 1842 } 1843 1844 if (isColumn) { 1845 var containerStyles = getComputedStyle(parallaxWrapper); 1846 parallaxImg.style.setProperty('min-width', containerStyles.width, 'important'); 1847 //parallaxImg.style.setProperty('min-height', Math.min(viewPortHeight, 3 * parseInt(containerStyles.height)) + 'px', 'important'); 1848 } 1849 1850 if (isSlider && control.className.indexOf('active') !== -1) {
1851 that.setAttribute('data-sliderTop', $(parallaxImg).offset().top); 1852 that.setAttribute('data-imageHeight', parallaxImg.clientHeight); 1853 } 1854 1855 var positionDifference, 1856 imageOffset = isSlider ? parseFloat(that.getAttribute('data-sliderTop')) : $(parallaxImg).offset().top, 1857 controlBottom = controlOffset + controlHeight, 1858 imageBottom = imageOffset + viewPortHeight, 1859 visibleBottom = imageBottom > controlBottom ? controlBottom : imageBottom, 1860 spaceArea = controlBottom - visibleBottom; 1861 1862 if (spaceArea > 0) { 1863 var scaledSize = ((viewPortHeight + spaceArea) / viewPortHeight) * 100; 1864 parallaxImg.style.height = scaledSize + 'vh'; 1865 } 1866 1867 var imageHeight = isSlider ? parseFloat(that.getAttribute('data-imageHeight')) : parallaxImg.clientHeight; 1868 if (controlOffset >= imageHeight / 2) { 1869 //var additionalSpace = controlOffset < viewPortHeight ? (viewPortHeight - controlOffset) / 2 : 0; 1870 positionDifference = -imageHeight / 2 /*+ additionalSpace*/ + (getCompatibleScrollTop() + viewPortHeight - controlOffset) / 2; 1871 } 1872 else { 1873 positionDifference = /*-controlOffset / 2*/ +(getCompatibleScrollTop() - controlOffset) / 2; 1874 } 1875 if (getCompatibleScrollTop() + viewPortHeight > controlOffset && getCompatibleScrollTop() < controlBottom) { 1876 var transformProperty = getSupportedPropertyName(transform); 1877 if (transformProperty) { 1878 parallaxImg.style[transformProperty] = 'translate3d(0, ' + positionDifference + 'px, 0)'; 1879 } 1880 } 1881 }); 1882 } 1883 }); 1884 } 1885 1886 function onScroll() { 1887 [].forEach.call(document.getElementsByClassName('bd-parallax-bg-effect'), function (element) { 1888 var that = element, 1889 controlClass = that.getAttribute('data-control-selector').replace(/\./g, ''), 1890 controls = document.getElementsByClassName(controlClass), 1891 isSlider = /bd-slider-\d+($|\s)/g.test(controlClass) || getClassName(controls[0]).indexOf('bd-slider') !== -1, 1892 isColumn = /bd-layoutcolumn-\d+($|\s)/g.test(controlClass); 1893 1894 if (isSlider) { 1895 controls = findByClass(controls[0], 'bd-slide'); 1896 } 1897 1898 if (controls.length) { 1899 [].forEach.call(controls, function (control) { 1900 var viewPortHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0), 1901 controlOffset = $(that).offset().top, 1902 controlHeight = that.clientHeight, 1903 controlBottom = controlOffset + controlHeight; 1904 1905 if (getCompatibleScrollTop() + viewPortHeight > controlOffset && getCompatibleScrollTop() < controlBottom) { 1906 var parallaxWrapper = isColumn ? findByClass(control.parentElement, 'bd-parallax-image-wrapper')[0] : findTopLevelDoms(control, 'bd-parallax-image-wrapper', controlClass)[0], 1907 parallaxImg = parallaxWrapper.getElementsByClassName('bd-parallax-image')[0], 1908 positionDifference; 1909 1910 if (isSlider && control.className.indexOf('active') !== -1) { 1911 that.setAttribute('data-imageHeight', parallaxImg.clientHeight); 1912 } 1913 1914 var imageHeight = isSlider ? parseFloat(that.getAttribute('data-imageHeight')) : parallaxImg.clientHeight; 1915 if (controlOffset >= imageHeight / 2) { 1916 //var additionalSpace = controlOffset < viewPortHeight ? (viewPortHeight - controlOffset) / 2 : 0; 1917 positionDifference = -imageHeight / 2 /*+ additionalSpace*/ + (getCompatibleScrollTop() + viewPortHeight - controlOffset) / 2; 1918 } 1919 else { 1920 positionDifference = /*-controlOffset / 2*/ +(getCompatibleScrollTop() - controlOffset) / 2; 1921 } 1922
1923 var transformProperty = getSupportedPropertyName(transform); 1924 if (transformProperty) { 1925 parallaxImg.style[transformProperty] = 'translate3d(0, ' + positionDifference + 'px, 0)'; 1926 } 1927 } 1928 }); 1929 } 1930 }); 1931 } 1932 1933 function getClassName(element) { 1934 var className = element ? element.className : null; 1935 if (className) { 1936 if (typeof className === 'string') { 1937 return className; 1938 } else if (typeof className === 'object' && 'baseVal' in className) { // for SVG elements 1939 return className.baseVal; 1940 } 1941 } 1942 return ''; 1943 } 1944 1945 function getSupportedPropertyName(properties) { 1946 for (var i = 0; i < properties.length; i++) { 1947 if (typeof document.body.style[properties[i]] !== 'undefined') { 1948 return properties[i]; 1949 } 1950 } 1951 return null; 1952 } 1953 1954 function getCompatibleScrollTop() { 1955 if ("undefined" !== typeof window.scrollY) { 1956 return window.scrollY; 1957 } 1958 else { 1959 return document.documentElement.scrollTop; 1960 } 1961 } 1962 1963 function findByClass(parentElement, searchClassName) { 1964 return [].slice.call(parentElement.getElementsByTagName('*')).filter(function (value) { 1965 var className = getClassName(value); 1966 return (' ' + className + ' ').indexOf(' ' + searchClassName + ' ') !== -1; 1967 }); 1968 } 1969 1970 function findTopLevelDoms(element, searchClassName, controlClassName) { 1971 var isEffectDom = function (domElement) { 1972 return getClassName(domElement).indexOf('bd-parallax-bg-effect') !== -1 && domElement.getAttribute('data-control-selector') === '.' + controlClassName; 1973 }, 1974 findDom = function (domElement) { 1975 return [].slice.call(domElement.getElementsByClassName(searchClassName)).filter(function (value) { 1976 return value.parentNode === domElement; 1977 }); 1978 }; 1979 1980 var foundDom = findDom(element); 1981 if (foundDom.length === 0) { 1982 while (!isEffectDom(element) && element) { 1983 element = element.parentElement; 1984 } 1985 } 1986 1987 return foundDom.length ? foundDom : findDom(element); 1988 } 1989})(jQuery); 1990})(window._$, window._$); 1991window.ProductOverview_Class = "bd-productoverview"; 1992(function (jQuery, $) { 1993jQuery(function($) { 1994 'use strict'; 1995 function makeCloudZoom1() { 1996 if ($('.bd-productimage-6 a').length > 0) { 1997 $('.bd-productimage-6 a').attr('id', 'cloud-zoom-effect-1').addClass('cloud-zoom'); 1998 $('.bd-productimage-6 a').attr('rel', "position:'right', adjustX:0, adjustY:0, tint:'#ffffff', softFocus:1, smoothMove:1, tintOpacity:0.5"); 1999 2000 if ('undefined' !== typeof window.ProductOverview_Class && 'undefined' !== typeof window.ImageThumbnails_Class) { 2001 var parent = $('.bd-productimage-6') 2002 .closest('[class*=" ' + window.ProductOverview_Class + '"], [class^="' + window.ProductOverview_Class + '"]'), 2003 thumbnails = $('[class*=" ' + window.ImageThumbnails_Class + '"], [class^="' + window.ImageThumbnails_Class + '"]', parent); 2004 2005 if (thumbnails.length > 0) { 2006 $('a', thumbnails).each(function () { 2007 var thumbnail = $(this), 2008 rel = thumbnail.attr('rel'), 2009 relAttr = (rel === '' ? '' : rel + ',') + "useZoom: 'cloud-zoom-effect-1'"; 2010 thumbnail.attr('rel', relAttr).addClass('cloud-zoom-gallery'); 2011 }); 2012 } 2013 } 2014 2015 var parent = $(".bd-productimage-6").parents().filter(function (key, value) { 2016 return parseInt($(value).css('z-index'), 10).toString() !== 'NaN'; 2017 }); 2018 2019 var minZIndex = 100; 2020 var zIndex = parent.length > 0 ? parseInt($(parent[0]).css('z-index'), 10) + 1 : 1; 2021 zIndex = zIndex < minZIndex ? minZIndex : zIndex; 2022 2023 $('<style type="text/css"> .bd-productimage-6 .mousetrap { z-index: ' + zIndex + '!important;} </style>').appendTo("head"); 2024 2025 $('#cloud-zoom-effect-1, .cloud-zoom-gallery').CloudZoom(); 2026 } 2027 } 2028 makeCloudZoom1(); 2029 var resizeTimeout; 2030 $(window).resize(function(){ 2031 clearTimeout(resizeTimeout); 2032 resizeTimeout = setTimeout(makeCloudZoom1, 25); 2033 }); 2034}); 2035})(window._$, window._$); 2036(function (jQuery, $) { 2037window.ImageThumbnails_Class = 'bd-imagethumbnails'; 2038jQuery(function () { 2039 'use strict'; 2040 /* 'active' must be always specified, otherwise slider would not be visible */ 2041 jQuery('.bd-imagethumbnails-1.carousel.slide').each(function () { 2042 var slider = jQuery(this); 2043 if (!slider || !slider.length){ 2044 return; 2045 } 2046 2047 slider.data('resize', function () { 2048 jQuery('.carousel-inner', slider).equalImageHeight(); 2049 }); 2050 2051 slider.data('resize')(); 2052 2053 jQuery('.bd-left-button .bd-carousel', slider) 2054 .attr('href', '#') 2055 .click(function() { 2056 slider.carousel('prev'); 2057 return false;
2058 }); 2059 2060 jQuery('.bd-right-button .bd-carousel', slider) 2061 .attr('href', '#') 2062 .click(function() { 2063 slider.carousel('next'); 2064 return false; 2065 }); 2066 }); 2067}); 2068})(window._$, window._$); 2069(function (jQuery, $) { 2070jQuery(function($) { 2071 'use strict'; 2072 2073 var activeLayoutType = $.cookie('layoutType') || 'grid', 2074 activeLayoutTypeSelector = $.cookie('layoutSelector') || '.separated-item-4.grid'; 2075 2076 var layoutTypes = []; 2077 2078 layoutTypes.push({ 2079 name:'bd-griditemgrid', 2080 iconUrl: '', 2081 iconDataId: '2470', 2082 iconClassNames: 'bd-icon-65' 2083 }); 2084 layoutTypes.push({ 2085 name:'bd-griditemlist', 2086 iconUrl: '', 2087 iconDataId: '2485', 2088 iconClassNames: 'bd-icon-66' 2089 }); 2090 if (typeof window.buildTypeSelector === 'function') { 2091 window.buildTypeSelector(layoutTypes, $('.bd-productsgridbar-35')); 2092 } 2093 2094 2095 $(document).on('click', '.bd-products i[data-layout-name="bd-griditemgrid"]', function (e) { 2096 if (activeLayoutType !== 'grid') { 2097 var grid = $('.bd-grid-45'); 2098 grid.find('.separated-item-4.grid').css('display', 'block'); 2099 grid.find(activeLayoutTypeSelector).css('display', 'none'); 2100 activeLayoutType = 'grid'; 2101 activeLayoutTypeSelector = '.separated-item-4.grid'; 2102 2103 $.cookie('layoutType', activeLayoutType, { path: '/' }); 2104 $.cookie('layoutSelector', activeLayoutTypeSelector, { path: '/' }); 2105 } 2106 e.preventDefault(); 2107 e.stopPropagation(); 2108 return false; 2109 }); 2110 $(document).on('click', '.bd-products i[data-layout-name="bd-griditemlist"]', function (e) { 2111 if (activeLayoutType !== 'list') { 2112 var grid = $('.bd-grid-45'); 2113 grid.find('.separated-item-5.list').css('display', 'block'); 2114 grid.find(activeLayoutTypeSelector).css('display', 'none'); 2115 activeLayoutType = 'list'; 2116 activeLayoutTypeSelector = '.separated-item-5.list'; 2117 2118 $.cookie('layoutType', activeLayoutType, { path: '/' }); 2119 $.cookie('layoutSelector', activeLayoutTypeSelector, { path: '/' }); 2120 } 2121 e.preventDefault(); 2122 e.stopPropagation(); 2123 return false; 2124 }); 2125 2126}); 2127})(window._$, window._$); 2128(function (jQuery, $) { 2129window.buildTypeSelector = function(layouts) { 2130 layouts.map(function(layout){ 2131 var a = document.createElement('a'), 2132 i = document.createElement('i'); 2133 jQuery(i).addClass(layout.iconClassNames).addClass('data-control-id-'
2133+ layout.iconDataId); 2134 jQuery(i).attr('data-layout-name', layout.name); 2135 jQuery(a).attr('href', '##').append(i); 2136 jQuery(a).each(function() { this.style.textDecoration = 'none'; }); 2137 jQuery('.bd-typeselector-1').append(a); 2138 }); 2139} 2140})(window._$, window._$); 2141(function (jQuery, $) { 2142jQuery(function ($) { 2143 'use strict'; 2144 2145 function getFloat(value){ 2146 return parseFloat(value.replace('px', '')) ; 2147 } 2148 2149 $('.bd-productsslider-1').each(function () { 2150 var slider = $(this).find('.carousel.slide'); 2151 slider.carousel({ 2152 interval: 3000, 2153 pause: "", 2154 wrap: false 2155 }); 2156 2157 var leftButton = $('.bd-left-button', slider); 2158 var rightButton = $('.bd-right-button', slider); 2159 2160 2161 var blockSelector = '.bd-block', 2162 blockHeaderSelector = '.bd-block .bd-blockheader'; 2163 if ($(blockSelector, this).length > 0 && $(blockHeaderSelector, this).length > 0) 2164 { 2165 var block = $(blockSelector, this), 2166 blockHeader = block.find('*').filter(blockHeaderSelector), 2167 blockHeaderTitle = blockHeader.children('h4'); 2168 2169 blockHeader.css('min-height', '35px'); 2170 blockHeader.css('position', 'relative'); 2171 2172 var navigationWrapper = $('<div class="bd-top-navigation-wrapper"></div>'); 2173 blockHeaderTitle.addClass('bd-top-navigation'); 2174 blockHeaderTitle.append(navigationWrapper); 2175 2176 leftButton.appendTo(navigationWrapper); 2177 rightButton.appendTo(navigationWrapper); 2178 } 2179 2180 leftButton.find('.bd-carousel-2').click(function() { 2181 slider.carousel('prev'); 2182 return false; 2183 }).attr('href', '#'); 2184 2185 rightButton.find('.bd-carousel-2').click(function() { 2186 slider.carousel('next'); 2187 return false; 2188 }).attr('href', '#'); 2189 2190 2191 slider.carousel('pause'); 2192 }); 2193}); 2194})(window._$, window._$); 2195(function (jQuery, $) { 2196jQuery(function ($) { 2197 'use strict'; 2198 2199 $('[data-smooth-scroll]').on('click', 'a[href^="#"]:not([data-toggle="collapse"])', function (e) { 2200 var animationTime = parseInt($(e.delegateTarget).data('animationTime'), 10) || 0; 2201 var target = this.hash; 2202 var link = $(this); 2203 e.preventDefault(); 2204 2205 $('body').data('scroll-animating', true); 2206 var targetElement = $(target || 'body'); 2207 2208 link.trigger($.Event('theme.smooth-scroll.before')); 2209 2210 if (!targetElement || !targetElement.length) 2211 return; 2212 2213 $('html, body').animate({ 2214 scrollTop: targetElement.offset().top 2215 }, animationTime, function() { 2216 $('body').data('scroll-animating', false); 2217 window.location.hash = target; 2218 if (targetElement.is(':not(body)') && $('body').data('bs.scrollspy')) { 2219 link.parent('li').siblings('li').children('a').removeClass('active'); 2220 link.addClass('active'); 2221 } 2222 link.trigger($.Event('theme.smooth-scroll.after')); 2223 }); 2224 }); 2225}); 2226})(window._$, window._$); 2227(function (jQuery, $) { 2228function SmoothWheel() { 2229 'use strict'; 2230 2231 this.options = { 2232 animtime: 500, 2233 stepsize: 150, 2234 pulseAlgorithm: false, 2235 pulseScale: 6, 2236 keyboardsupport: true, 2237 arrowscroll: 50, 2238 useOnWebKit: true, 2239 useOnMozilla: true, 2240 useOnIE: true 2241 }; 2242 2243 var that = this; 2244 2245 /*global Date */ 2246 function ssc_init() { 2247 2248 if (!document.body) return; 2249 var e = document.body; 2250 var t = document.documentElement; 2251 var n = window.innerHeight; 2252 var r = e.scrollHeight; 2253 ssc_root = document.compatMode.indexOf("CSS") >= 0 ? t : e; 2254 ssc_activeElement = e; 2255 ssc_initdone = true; 2256 if (top !== self) { 2257 ssc_frame = true; 2258 } else if (r >
2258 n && (e.offsetHeight <= n || t.offsetHeight <= n)) { 2259 ssc_root.style.height = "auto"; 2260 if (ssc_root.offsetHeight <= n) { 2261 var i = document.createElement("div"); 2262 i.style.clear = "both"; 2263 e.appendChild(i); 2264 } 2265 } 2266 if (!ssc_fixedback) { 2267 e.style.backgroundAttachment = "scroll"; 2268 t.style.backgroundAttachment = "scroll"; 2269 } 2270 if (that.options.keyboardsupport) { 2271 ssc_addEvent("keydown", ssc_keydown); 2272 } 2273 } 2274 2275 function ssc_scrollArray(e, t, n, r) { 2276 r || (r = 1e3); 2277 ssc_directionCheck(t, n); 2278 ssc_que.push({ 2279 x: t, 2280 y: n, 2281 lastX: t < 0 ? 0.99 : -0.99, 2282 lastY: n < 0 ? 0.99 : -0.99, 2283 start: +(new Date()) 2284 }); 2285 if (ssc_pending) { 2286 return; 2287 } 2288 var i = function() { 2289 var s = +(new Date()); 2290 var o = 0; 2291 var u = 0; 2292 for (var a = 0; a < ssc_que.length; a++) { 2293 var f = ssc_que[a]; 2294 var l = s - f.start; 2295 var c = l >= that.options.animtime; 2296 var h = c ? 1 : l / that.options.animtime; 2297 if (that.options.pulseAlgorithm) { 2298 h = ssc_pulse(h); 2299 } 2300 var p = f.x * h - f.lastX >> 0; 2301 var d = f.y * h - f.lastY >> 0; 2302 o += p; 2303 u += d; 2304 f.lastX += p; 2305 f.lastY += d; 2306 if (c) { 2307 ssc_que.splice(a, 1); 2308 a--; 2309 } 2310 } 2311 if (t) { 2312 var v = e.scrollLeft; 2313 e.scrollLeft += o; 2314 if (o && e.scrollLeft === v) { 2315 t = 0; 2316 } 2317 } 2318 if (n) { 2319 var m = e.scrollTop; 2320 e.scrollTop += u; 2321 if (u && e.scrollTop === m) { 2322 n = 0; 2323 } 2324 } 2325 if (!t && !n) { 2326 ssc_que = []; 2327 } 2328 if (ssc_que.length) { 2329 setTimeout(i, r / ssc_framerate + 1); 2330 } else { 2331 ssc_pending = false; 2332 } 2333 }; 2334 setTimeout(i, 0); 2335 ssc_pending = true; 2336 } 2337 2338 function ssc_wheel(e) { 2339 if (!ssc_initdone) { 2340 ssc_init(); 2341 } 2342 var t = e.target; 2343 var n = ssc_overflowingAncestor(t); 2344 if (!n || e.defaultPrevented || ssc_isNodeName(ssc_activeElement, "embed") || ssc_isNodeName(t, "embed") && /\.pdf/i.test(t.src)) { 2345 return true; 2346 } 2347 var r = e.wheelDeltaX || e.deltaX || 0; 2348 var i = e.wheelDeltaY || e.deltaY || 0; 2349 if (n.nodeName === 'BODY' && (currentBrowser === 'firefox' || currentBrowser === "msie" || currentBrowser === "netscape")) { 2350 n = document.documentElement; 2351 r = -r; 2352 i = -i; 2353 if (currentBrowser === 'firefox') { 2354 r *= 40; 2355 i *= 40; 2356 } 2357 } 2358 2359 if (!r && !i) { 2360 i = e.wheelDelta || 0; 2361 } 2362 if (Math.abs(r) > 1.2) { 2363 r *= that.options.stepsize / 120; 2364 } 2365 if (Math.abs(i) > 1.2) { 2366 i *= that.options.stepsize / 120; 2367 } 2368 ssc_scrollArray(n, -r, -i); 2369 e.preventDefault(); 2370 } 2371 2372 function ssc_keydown(e) { 2373 var t = e.target; 2374 var n = e.ctrlKey || e.altKey || e.metaKey; 2375 if (/input|textarea|embed/i.test(t.nodeName) || t.isContentEditable || e.defaultPrevented || n) { 2376 return true; 2377 } 2378 if (ssc_isNodeName(t, "button") && e.keyCode === ssc_key.spacebar) { 2379 return true; 2380 } 2381 var r, i = 0, 2382 s = 0; 2383 var o = ssc_overflowingAncestor(ssc_activeElement); 2384 var u = o.clientHeight; 2385 if (o === document.body) { 2386 u = window.innerHeight; 2387 } 2388 switch (e.keyCode) { 2389 case ssc_key.up: 2390 s = -that.options.arrowscroll; 2391 break; 2392 case ssc_key.down: 2393 s = that.options.arrowscroll; 2394 break; 2395 case ssc_key.spacebar: 2396 r = e.shiftKey ? 1 : -1; 2397 s = -r * u * 0.9; 2398 break; 2399 case ssc_key.pageup: 2400 s = -u * 0.9; 2401 break; 2402 case ssc_key.pagedown: 2403 s = u * 0.9; 2404 break; 2405 case ssc_key.home: 2406 s = -o.scrollTop; 2407 break; 2408 case ssc_key.end: 2409 var a = o.scrollHeight - o.scrollTop - u; 2410 s = a > 0 ? a + 10 : 0; 2411 break; 2412 case ssc_key.left: 2413 i = -that.options.arrowscroll; 2414 break; 2415 case ssc_key.right: 2416 i = that.options.arrowscroll; 2417 break; 2418 default: 2419 return true; 2420 } 2421 ssc_scrollArray(o, i, s); 2422 e.preventDefault(); 2423 } 2424 2425 function ssc_mousedown(e) { 2426 ssc_activeElement = e.target; 2427 } 2428
2429 function ssc_setCache(e, t) { 2430 for (var n = e.length; n--;) ssc_cache[ssc_uniqueID(e[n])] = t; 2431 return t; 2432 } 2433 2434 function ssc_overflowingAncestor(e) { 2435 var t = []; 2436 var n = ssc_root.scrollHeight; 2437 do { 2438 var r = ssc_cache[ssc_uniqueID(e)]; 2439 if (r) { 2440 return ssc_setCache(t, r); 2441 } 2442 t.push(e); 2443 if (n === e.scrollHeight) { 2444 if (!ssc_frame || ssc_root.clientHeight + 10 < n) { 2445 return ssc_setCache(t, document.body); 2446 } 2447 } else if (e.clientHeight + 10 < e.scrollHeight) { 2448 overflow = getComputedStyle(e, "").getPropertyValue("overflow"); 2449 if (overflow === "scroll" || overflow === "auto") { 2450 return ssc_setCache(t, e); 2451 } 2452 } 2453 } while ((e = e.parentNode)); 2454 } 2455 2456 function ssc_addEvent(e, t, n) { 2457 window.addEventListener(e, t, n || false); 2458 } 2459 2460 function ssc_removeEvent(e, t, n) { 2461 window.removeEventListener(e, t, n || false); 2462 } 2463 2464 function ssc_isNodeName(e, t) { 2465 return e.nodeName.toLowerCase() === t.toLowerCase(); 2466 } 2467 2468 function ssc_directionCheck(e, t) { 2469 e = e > 0 ? 1 : -1; 2470 t = t > 0 ? 1 : -1; 2471 if (ssc_direction.x !== e || ssc_direction.y !== t) { 2472 ssc_direction.x = e; 2473 ssc_direction.y = t; 2474 ssc_que = []; 2475 } 2476 } 2477 2478 function ssc_pulse_(e) { 2479 var t, n, r; 2480 e = e * that.options.pulseScale; 2481 if (e < 1) { 2482 t = e - (1 - Math.exp(-e)); 2483 } else { 2484 n = Math.exp(-1); 2485 e -= 1; 2486 r = 1 - Math.exp(-e); 2487 t = n + r * (1 - n); 2488 } 2489 return t * ssc_pulseNormalize; 2490 } 2491 2492 function ssc_pulse(e) { 2493 if (e >= 1) return 1; 2494 if (e <= 0) return 0; 2495 if (ssc_pulseNormalize === 1) { 2496 ssc_pulseNormalize /= ssc_pulse_(1); 2497 } 2498 return ssc_pulse_(e); 2499 } 2500 var overflow = ''; 2501 var ssc_framerate = 150; 2502 var ssc_pulseNormalize = 1; 2503 var ssc_frame = false; 2504 var ssc_direction = { 2505 x: 0, 2506 y: 0 2507 }; 2508 var ssc_initdone = false; 2509 var ssc_fixedback = true; 2510 var ssc_root = document.documentElement; 2511 var ssc_activeElement; 2512 var ssc_key = { 2513 left: 37, 2514 up: 38, 2515 right: 39, 2516 down: 40, 2517 spacebar: 32, 2518 pageup: 33, 2519 pagedown: 34, 2520 end: 35, 2521 home: 36 2522 }; 2523 var ssc_que = []; 2524 var ssc_pending = false; 2525 var ssc_cache = {}; 2526 var currentBrowser = ''; 2527 2528 setInterval(function() { 2529 ssc_cache = {}; 2530 }, 10 * 1e3); 2531 2532 var ssc_uniqueID = function() { 2533 var e = 0; 2534 return function(t) { 2535 return t.ssc_uniqueID || (t.ssc_uniqueID = e++); 2536 }; 2537 }(); 2538 2539 jQuery(document).ready(function() { 2540 function t() { 2541 var e = navigator.appName, 2542 tReg = navigator.userAgent, 2543 n; 2544 var r = tReg.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i); 2545 if (r && (n = tReg.match(/version\/([\.\d]+)/i)) !== null) r[2] = n[1]; 2546 r = r ? [r[1], r[2]] : [e, navigator.appVersion, "-?"]; 2547 return r[0]; 2548 } 2549 currentBrowser = t().toLowerCase(); 2550 2551 var webKit = 'safari;chrome'; 2552 var IE = 'netscape;msie'; 2553 var mozilla = 'firefox'; 2554 2555 var browserName = [ 2556 (that.options.useOnMozilla ? mozilla : ''), 2557 (that.options.useOnWebKit ? webKit : ''), 2558 (that.options.useOnIE ? IE : '') 2559 ].join(';'); 2560 2561 var neededBrowser = browserName.indexOf(currentBrowser) !== -1; 2562 2563 if (neededBrowser) { 2564 ssc_addEvent("mousedown", ssc_mousedown); 2565 if (currentBrowser === 'firefox' || currentBrowser === "msie" || currentBrowser === "netscape") { 2566 ssc_addEvent("wheel", ssc_wheel); 2567 } else { 2568 ssc_addEvent("mousewheel", ssc_wheel); 2569 } 2570 ssc_addEvent("load", ssc_init); 2571 } 2572 }); 2573 2574 this.update = function update(newOptions) { 2575 if (!that.options.keyboardsupport) { 2576 ssc_removeEvent("keydown", ssc_keydown); 2577 } 2578 $.extend(this.options, newOptions); 2579 }; 2580 2581} 2582 2583(function () { 2584 'use strict'; 2585 2586 var _instance; 2587 2588 window._smoothWheelInstance = function () { 2589 if (!_instance) { 2590 _instance = new SmoothWheel(); 2591 } 2592 2593 return _instance; 2594 }; 2595})(); 2596})(window._$, window._$); 2597(function (jQuery, $) { 2598(function ($) { 2599 'use strict'; 2600 2601 var timeout; 2602 $(window).on('resize', function (e, param) { 2603 clearTimeout(timeout); 2604 if (param && param.force) { 2605 stretchToBottom(); 2606 } else { 2607 timeout = setTimeout(stretchToBottom, 25); 2608 } 2609 }); 2610 2611 $(stretchToBottom); 2612 2613 function stretchToBottom() { 2614 var bh, mh = 0; 2615 var parent, 2616 html = document.documentElement, 2617 prevHeight = html.style.height; 2618 2619 html.style.height = '100%'; 2620 2621 var c = $('.bd-stretch-to-bottom'); 2622 var target = c.find(c.data('controlSelector')) 2623 .add(c.find(c.data('controlSelector') + ' .bd-stretch-inner').first()); 2624 2625 if (target.length === 0) { 2626 return; 2627 } 2628 2629 target.removeAttr('style'); 2630 bh = $('body').height(); 2631 2632 var prevMargin = 0; 2633 $('body').children().each(function() { 2634 var $node = $(this); 2635 if ($node.css('float') !== 'left' && $node.css('float') !== 'right' && 2636 $node.css('position') !== 'absolute' && $node.css('position') !== 'fixed') { 2637 2638 if (!prevMargin) { 2639 mh += parseFloat($node.css('margin-top')); 2640 } else { 2641 mh += Math.max(parseFloat($node.css('margin-bottom')), prevMargin); 2642 } 2643 2644 mh += $node.outerHeight(); 2645 2646 prevMargin = parseFloat($node.css('margin-bottom')); 2647 2648 if ($.contains(this, target[0]) || this === target[0]) { 2649 parent = $node; 2650 } 2651 } 2652 }); 2653 2654 if (mh < bh && parent) { 2655 var r = bh - mh; 2656 target.css('min-height', (target.outerHeight(true) + r) + 'px'); 2657 } 2658 2659 html.style.height = prevHeight; 2660 } 2661 2662})(jQuery); 2663})(window._$, window._$); 2664(function (jQuery, $) { 2665 2666jQuery(function ($) { 2667 'use strict'; 2668 // hide #back-top first 2669 $(".bd-backtotop-1").hide(); 2670 // fade in #back-top 2671 $(function () { 2672 $(window).scroll(function () { 2673 if ($(this).scrollTop() > 100) { 2674 $('.bd-backtotop-1').fadeIn().css('display', 'block'); 2675 } else { 2676 $('.bd-backtotop-1').fadeOut(); 2677 } 2678 }); 2679 }); 2680}); 2681 2682})(window._$, window._$); 2683(function (jQuery, $) { 2684 2685 2686 2687jQuery(function () { 2688 'use strict'; 2689 new window.ThemeLightbox('.bd-postcontent-1 img:not(.no-lightbox)').init(); 2690}); 2691})(window._$, window._$);
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.