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