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