1/* Login ajax */ 2function ajaxLogin(ajaxUrl, clear){ 3 if(clear == true){ 4 clearHolder(); 5 jQuery(".ajax-box-overlay").removeClass('loaded'); 6 } 7 jQuery("body").append("<div id='login-holder' />"); 8 if(!jQuery(".ajax-box-overlay").length){ 9 jQuery("#login-holder").after('<div class="ajax-box-overlay"><i class="load" /></div>'); 10 jQuery(".ajax-box-overlay").fadeIn('medium'); 11 } 12 function overlayResizer(){ 13 jQuery(".ajax-box-overlay").css('height', jQuery(window).height()); 14 } 15 overlayResizer(); 16 jQuery(window).resize(function(){overlayResizer()}); 17 18 jQuery.ajax({ 19 url: ajaxUrl, 20 cache: false 21 }).done(function(html){ 22 setTimeout(function(){ 23 jQuery("#login-holder").html(html).animate({ 24 opacity: 1, 25 top: '100px' 26 }, 500 ); 27 jQuery(".ajax-box-overlay").addClass('loaded'); 28 clearAll(); 29 }, 500); 30 }); 31 32 var clearAll = function(){ 33 jQuery("#login-holder .close-button").on('click', function(){ 34 jQuery(".ajax-box-overlay").fadeOut('medium', function(){ 35 jQuery(this).remove(); 36 }); 37 clearHolder(); 38 }); 39 } 40 function clearHolder(){ 41 jQuery("#login-holder").animate({ 42 opacity: 0, 43 top: 0 44 }, 500, function() { 45 jQuery(this).remove(); 46 }); 47 } 48} 49 50function loginLabel(){ 51 jQuery('#login-holder').each(function(){ 52 linkBox = jQuery(this).find('.link-box'); 53 if(!jQuery('body').hasClass('rtl')){ 54 linkBox.css({ 55 'top': linkBox.outerWidth()/2 - linkBox.outerHeight()/2 + 25, 56 'right': -(linkBox.outerWidth()/2 + linkBox.outerHeight()/2) 57 }); 58 }else{ 59 linkBox.css({ 60 'top': linkBox.outerWidth()/2 - linkBox.outerHeight()/2 + 25, 61 'left': -(linkBox.outerWidth()/2 + linkBox.outerHeight()/2) 62 }); 63 } 64 }); 65} 66 67/* isotop */ 68function isotopInit(){ 69 jQuery('.products-grid').each(function(){ 70 if(!jQuery(this).parents('#header').length){ 71 if(!jQuery('body').hasClass('rtl')){ 72 jQuery(this).isotope({ 73 itemSelector: '.item', 74 resizable: true, 75 layoutMode : 'fitRows' 76 }); 77 }else{ 78 jQuery(this).isotope({ 79 itemSelector: '.item', 80 resizable: true, 81 layoutMode : 'fitRows', 82 transformsEnabled: false 83 }); 84 } 85 } 86 }); 87} 88function isotopDestroy(){ 89 jQuery('.products-grid').each(function(){ 90 if((!jQuery(this).parents('#header').length) && jQuery(this).hasClass('isotope')){ 91 jQuery(this).isotope('destroy'); 92 if(jQuery('body').hasClass('rtl')){ 93 jQuery(this).find('li.item').attr('style', ''); 94 } 95 } 96 }); 97} 98function isotopLoader(imgCount, callback){ 99 if(navigator.userAgent.indexOf('Safari/534.57.2') == -1){ 100 images = jQuery('.products-grid .product-image img'); 101 if(!imgCount){ 102 imgCount = images.size(); 103 } 104 currentIndex = 0; 105 images.load(function(){ 106 currentIndex++; 107 if(currentIndex == imgCount){ 108 try{ 109 callback(); 110 }catch(err){} 111 gridLabels(); 112 setTimeout(function(){ 113 isotopInit(); 114 }, 100); 115 } 116 }); 117 } 118} 119 120/* Top Cart */ 121function topCartListener(e){ 122 var touch = e.touches[0]; 123 if(jQuery(touch.target).parents('#topCartContent').length == 0 && jQuery(touch.target).parents('.cart-button').length == 0 && !jQuery(touch.target).hasClass('cart-button')){ 124 jQuery('.top-cart .block-title').removeClass('active'); 125 jQuery('#topCartContent').slideUp(500).removeClass('active'); 126 document.removeEventListener('touchstart', topCartListener, false); 127 } 128} 129function topCart(isOnHover){ 130 function standardMode(){ 131 jQuery('.top-cart .block-title').on('click', function(event){ 132 event.stopPropagation(); 133 jQuery(this).toggleClass('active'); 134 jQuery('#topCartContent').slideToggle(500).toggleClass('active'); 135 document.addEventListener('touchstart', topCartListener, false); 136 137 jQuery(document).on('click.cartEvent', function(e) { 138 if (jQuery(e.target).parents('#topCartContent').length == 0) { 139 jQuery('.top-cart .block-title').removeClass('active'); 140 jQuery('#topCartContent').slideUp(500).removeClass('active'); 141 jQuery(document).off('click.cartEvent'); 142 } 143 }); 144 }); 145 } 146 147 if(isOnHover){
148 if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i)) || (navigator.userAgent.match(/Android/i))){ 149 standardMode(); 150 }else{ 151 jQuery('.top-cart').on('mouseenter mouseleave', function(event){ 152 event.stopPropagation(); 153 jQuery(this).find('.block-title').toggleClass('active'); 154 jQuery('#topCartContent').stop().slideToggle(500).toggleClass('active'); 155 }); 156 } 157 }else{ 158 standardMode(); 159 } 160} 161/* Top Cart */ 162 163function simpleList(status){ 164 if(jQuery('header#header .quick-access.simple-list').length){ 165 button = jQuery('header#header .quick-access.simple-list .mobile-links'); 166 list = jQuery('header#header .quick-access.simple-list .links'); 167 168 if(status == 'set'){ 169 list.hide(); 170 button.off('click.simple').on('click.simple', function(){ 171 list.slideToggle(); 172 }); 173 }else{ 174 button.off('click.simple'); 175 list.css('display', 'inline-block'); 176 } 177 } 178} 179 180/* Top Link Wishlist Quantity */ 181function getWishlistCount(){ 182 if(jQuery('body').hasClass('ajax-index-options')){ 183 toopLink = window.parent.document.getElementsByTagName('body')[0]; 184 toopLink = jQuery(toopLink).find('header#header .top-link-wishlist'); 185 }else{ 186 toopLink = jQuery('header#header .top-link-wishlist'); 187 } 188 189 url = toopLink.attr('href').replace("wishlist/","meigeeactions/wishlist/count"); 190 jQuery.ajax({ 191 url : url, 192 success : function(data) { 193 toopLink.find('.wishlist-items').html(data); 194 } 195 }); 196} 197 198/* Wishlist Block Slider */ 199function wishlist_slider(){ 200 if(!jQuery('body').hasClass('rtl')){ 201 next = '#wishlist-slider .next'; 202 prev = '#wishlist-slider .prev'; 203 }else{ 204 next = '#wishlist-slider .prev'; 205 prev = '#wishlist-slider .next'; 206 } 207 jQuery('#wishlist-slider .es-carousel').iosSlider({ 208 responsiveSlideWidth: true, 209 snapToChildren: true, 210 desktopClickDrag: true, 211 infiniteSlider: false, 212 navNextSelector: next, 213 navPrevSelector: prev 214 }); 215} 216 217function wishlist_set_height(){ 218 var wishlist_height = 0; 219 jQuery('#wishlist-slider .es-carousel li').each(function(){ 220 if(jQuery(this).height() > wishlist_height){ 221 wishlist_height = jQuery(this).height(); 222 } 223 }) 224 jQuery('#wishlist-slider .es-carousel').css('min-height', wishlist_height+2); 225} 226if(jQuery('#wishlist-slider').length){ 227 whs_first_set = true; 228 wishlist_slider(); 229} 230/* Wishlist Block Slider */ 231 232 /* page title */ 233function titleDivider(){ 234 setTimeout(function(){ 235 jQuery('.widget-title, #footer .footer-block-title, .block-layered-nav .filter-label, .block-layered-nav dl#narrow-by-list2 dt, aside.sidebar .block-title, header.rating-title, .box-reviews .rating-subtitle, .block-related .block-title, .product-options-title, .cart-blocks-title, #login-holder .page-title, .opc-block-title, .quick-view-title').each(function(){ 236 title_container_width = jQuery(this).width(); 237 title_width = jQuery(this).find('h1, h2, h3, strong').innerWidth(); 238 divider_width = ((title_container_width - title_width-2)/2); 239 full_divider_width = (title_container_width - title_width-2); 240 if ((jQuery(this).hasClass('widget-title')) || (jQuery(this).hasClass('filter-label')) || (jQuery(this).parent().attr('id') == 'narrow-by-list2') || (jQuery(this).hasClass('block-title')) || (jQuery(this).hasClass('rating-title')) || (jQuery(this).hasClass('rating-subtitle')) || (jQuery(this).hasClass('cart-blocks-title')) || (jQuery(this).hasClass('page-title')) || (jQuery(this).hasClass('opc-block-title')) || (jQuery(this).hasClass('quick-view-title'))) { 241 if (divider_width > 15) { 242 if(!jQuery(this).find('.right-divider').length){ 243 jQuery(this).append('<div class="right-divider" />'); 244 } 245 jQuery(this).find('.right-divider').css('width', divider_width); 246 } else { 247 jQuery(this).find('.right-divider').remove(); 248 } 249 if (divider_width > 15) { 250 if(!jQuery(this).find('.left-divider').length) { 251 jQuery(this).prepend('<div class="left-divider" />'); 252 } 253 jQuery(this).find('.left-divider').css('width', divider_width); 254 } else { 255 jQuery(this).find('.left-divider').remove(); 256 } 257 } else { 258 if(!jQuery(this).find('.right-divider').length) { 259 jQuery(this).append('<div class="right-divider" />'); 260 } 261 jQuery(this).find('.right-divider').css('width', full_divider_width); 262 } 263 }); 264 }, 250); 265} 266 267/* Labels height */ 268function gridLabels(){ 269 isTopmenuGrid = false; 270 isEventStarted = false; 271 if(jQuery('header#header .products-grid').length){ 272 isTopmenuGrid = true; 273 } 274
275 function init(){ 276 jQuery('.label-type-1 .label-new, .label-type-3 .label-new, .label-type-1 .label-sale, .label-type-3 .label-sale').each(function(){ 277 if(isTopmenuGrid == true && isEventStarted == false){ 278 if(jQuery(this).parents('header#header').length){ 279 starter(); 280 } 281 } 282 283 labelNewWidth = jQuery(this).outerWidth(); 284 if(jQuery(this).parents('.label-type-1').length){ 285 if(jQuery(this).hasClass('percentage')){ 286 lineHeight = labelNewWidth - labelNewWidth*0.2; 287 }else{ 288 lineHeight = labelNewWidth; 289 } 290 }else if(jQuery(this).parents('.label-type-3').length){ 291 if(jQuery(this).hasClass('percentage')){ 292 lineHeight = labelNewWidth - labelNewWidth*0.2; 293 }else{ 294 lineHeight = labelNewWidth - labelNewWidth*0.1; 295 } 296 }else{ 297 lineHeight = labelNewWidth; 298 } 299 jQuery(this).css({ 300 'height' : labelNewWidth, 301 'line-height' : lineHeight + 'px' 302 }); 303 }); 304 } 305 init(); 306 307 function starter(){ 308 isEventStarted = true; 309 jQuery('#nav-wide li.level0.parent').on('mouseenter', function(){ 310 setTimeout(function(){ 311 init(); 312 }, 100); 313 }); 314 } 315} 316/*** ***/ 317 318/* Product Hover Images */ 319function productHoverImages() { 320 if(jQuery('span.hover-image').length){ 321 jQuery('span.hover-image').parent().addClass('hover-exists'); 322 } 323} 324 325/* Wide Menu Top */ 326function WideMenuTop() { 327 if (jQuery(document.body).width() > 767) { 328 setTimeout(function(){ 329 jQuery('.nav-wide li .menu-wrapper').each(function() { 330 WideMenuItemHeight = jQuery(this).parent().height(); 331 WideMenuItemPos = jQuery(this).parent().position().top; 332 jQuery(this).css('top', (WideMenuItemHeight + WideMenuItemPos)); 333 }); 334 }, 100) 335 } else { 336 jQuery('.nav-wide li .menu-wrapper').css('top', 'auto'); 337 } 338} 339 340/* Product Fancy */ 341function productFancy(){ 342 jQuery(function(){ 343 jQuery('.more-views a.cloud-zoom-gallery').on('click.productFancy', function(){ 344 thisHref = jQuery(this).attr('href'); 345 jQuery('.product-view .product-img-box a.fancybox-product').removeClass('active').each(function(){ 346 if(jQuery(this).attr('href') == thisHref){ 347 jQuery(this).addClass('active'); 348 } 349 }); 350 }); 351 jQuery('.fancybox-product').fancybox(); 352 }); 353} 354 355/* sticky header object */ 356sticky = { 357 show: function(headerHeight){ 358 if(!jQuery('#header').hasClass('floating')){ 359 jQuery('body').css('padding-top', headerHeight); 360 jQuery('#header').addClass('floating'); 361 jQuery('#header').slideDown('fast'); 362 WideMenuTop(); 363 } 364 }, 365 hide: function(){ 366 if(jQuery('#header').hasClass('floating')){ 367 jQuery('body').attr('style', ''); 368 jQuery('#header').removeClass('floating'); 369 jQuery('#header').attr('style', ''); 370 WideMenuTop(); 371 } 372 } 373} 374 375/* Retina logo resizer */ 376function logoResize(){ 377 if (pixelRatio > 1) { 378 jQuery('header#header h2.logo, header#header h2.small_logo, footer#footer .footer-logo').each(function(){ 379 var thisLogo = jQuery(this); 380 setTimeout(function(){ 381 thisLogo.attr('style', ''); 382 thisLogo.find('img').attr('style', ''); 383 if(thisLogo.hasClass('logo')){ 384 thisLogo.css({ 385 'position': 'absolute', 386 'opacity': '0' 387 }); 388 } 389 defaultStart = true; 390 if(thisLogo.hasClass('footer-logo')){ 391 thisLogo.css('position', 'absolute'); 392 if(thisLogo.parent().width() < thisLogo.width()){ 393 thisLogo.find('img').css('width', thisLogo.parent().width() - (thisLogo.parent().width()*0.15)); 394 defaultStart = false; 395 } 396 } 397 if(defaultStart){ 398 thisLogo.find('img').css('width', (thisLogo.find('img').width()/2)); 399 } 400 if(!thisLogo.hasClass('small_logo')){ 401 thisLogo.css({ 402 'position': 'static', 403 'opacity': '1' 404 }); 405 } 406 }, 100); 407 }); 408 } 409} 410 411/* ajax more views */ 412function ajaxMoreViews(){ 413 if((!!window.devicePixelRatio ? window.devicePixelRatio : 1) > 1){ //check is retina 414 var isRetina = true; 415 }else{ 416 var isRetina = false; 417 } 418 419 var ajaxProgress = false; 420 421 jQuery('.ajax-media').off().on('click', function(event){ //add event handler to links 422 event.preventDefault(); 423 target = jQuery(this); 424 parentElement = target.parent().parent('.product-img-box'); 425 ajaxUrl = target.attr('href'); 426 if(window.location.protocol == "https:"){ 427 ajaxUrl = ajaxUrl.replace(/http:/ig, 'https:'); 428 } 429 430 //ajax block 431 if(!target.hasClass('ajax-active') && !target.hasClass('ajax-complete') && ajaxProgress == false){ 432 ajaxProgress = true; 433 thisTarget = target; 434 thisParentElement = parentElement; 435 target.addClass('ajax-active'); 436 thisParentElement.addClass('loading'); 437 jQuery.ajax({ 438 url: ajaxUrl, 439 cache: false 440 }).done(function(html){ 441 thisParentElement.removeClass('loading').prepend(html); 442 setTimeout(function(){ 443 thisParentElement.find('.ajax-media-holder .more-views').addClass('show'); 444 }, 100); 445 thisTarget.removeClass('ajax-active').addClass('ajax-complete ajax-open'); 446 galleryChanger(thisParentElement); 447 ajaxProgress = false; 448 }); 449 } 450 451 /* show or hide block */ 452 if(target.hasClass('ajax-open')){ 453 parentElement.find('.ajax-media-holder .more-views').removeClass('show').end().end().end().removeClass('ajax-open'); 454 }else if(target.hasClass('ajax-complete')){ 455 parentElement.find('.ajax-media-holder .more-views').addClass('show').end().end().end().addClass('ajax-open'); 456 } 457 458 /* block gallery images changer */ 459 function galleryChanger(thisParentElement){ 460 thisParentElement.find('.ajax-media-holder .more-views a').on('click', function(){ 461 targetToChange = thisParentElement.find('.product-image > img:first-child'); 462 if(isRetina){ 463 sourceAttr = jQuery(this).attr('data-srcx2'); 464 }else{ 465 sourceAttr = jQuery(this).attr('data-src'); 466 } 467 thisParentElement.find('.product-image > img:not(:first-child)').css('display', 'none'); 468 targetToChange.attr('src', sourceAttr).removeClass('hidden'); 469 thisParentElement.addClass('hover-overlay'); 470 thisParentElement.off().on('mouseleave', function(){ 471 jQuery(this).removeClass('hover-overlay'); 472 }); 473 }); 474 } 475 476 }); 477} 478 479/* Header Customer Block */ 480function headerCustomer(reset){ 481 if(jQuery('.quick-access.simple-list').length){ 482 custName = jQuery('#header .customer-name'); 483 links = custName.parent().next('.links'); 484 links.hide(); 485 if(reset){ 486 custName.off('click.moblinks'); 487 links.css('display', 'inline-block'); 488 }else{ 489 custName.off('click.moblinks').on('click.moblinks', function(){ 490 links.slideToggle(); 491 }); 492 } 493 } 494} 495 496function more_view2_set_height(){
497 if(jQuery('#more-views-slider-2.slider-on').length){ 498 more_view_height2 = 0; 499 jQuery('#more-views-slider-2 li a').each(function(){ 500 if(jQuery(this).height() > more_view_height2){ 501 more_view_height2 = jQuery(this).height(); 502 } 503 }); 504 jQuery('#more-views-slider-2.slider-on').css({ 505 'height': more_view_height2, 506 'min-height': more_view_height2 507 }); 508 } 509 } 510 511/* More Views Slider 2 */ 512function indexManager(className){ 513 startIndex = className.indexOf('-')+1; 514 index = className.slice(startIndex); 515 index = parseFloat(index); 516 jQuery('#more-views-slider-2').iosSlider('goToSlide', index); 517} 518 519jQuery(window).load(function() { 520 521 /* Fix for IE */ 522 if(navigator.userAgent.indexOf('IE')!=-1 && jQuery.support.noCloneEvent){ 523 jQuery.support.noCloneEvent = true; 524 } 525 /* End fix for IE */ 526 527 /* More Views Slider */ 528 if(jQuery('#more-views-slider').length){ 529 530 if(!jQuery('body').hasClass('rtl')){ 531 next = '.more-views .next'; 532 prev = '.more-views .prev'; 533 }else{ 534 next = '.more-views .prev'; 535 prev = '.more-views .next'; 536 } 537 538 jQuery('#more-views-slider').iosSlider({ 539 responsiveSlideWidth: true, 540 snapToChildren: true, 541 desktopClickDrag: true, 542 infiniteSlider: false, 543 navSlideSelector: '.sliderNavi .naviItem', 544 navNextSelector: next, 545 navPrevSelector: prev 546 }); 547 } 548 function more_view_set_height(){ 549 if(jQuery('#more-views-slider').length){ 550 var more_view_height = 0; 551 jQuery('#more-views-slider li a').each(function(){ 552 if(jQuery(this).height() > more_view_height){ 553 more_view_height = jQuery(this).height(); 554 } 555 }) 556 jQuery('#more-views-slider').css('min-height', more_view_height+2); 557 } 558 } 559 /* More Views Slider */ 560 561 /* More Views Slider 2 */ 562 if(jQuery('#more-views-slider-2').length){ 563 /* start height */ 564 slider = jQuery('#more-views-slider-2'); 565 slider.attr('style', ''); 566 567 /* run slider */ 568 if(!jQuery('body').hasClass('rtl')){ 569 next = '#more-views-slider-2 .next'; 570 prev = '#more-views-slider-2 .prev'; 571 }else{ 572 next = '#more-views-slider-2 .prev'; 573 prev = '#more-views-slider-2 .next'; 574 } 575 576 slider.iosSlider({ 577 responsiveSlideWidth: true, 578 snapToChildren: true, 579 desktopClickDrag: true, 580 infiniteSlider: false, 581 navNextSelector: next, 582 navPrevSelector: prev 583 }); 584 } 585 if(jQuery('#more-views-slider-2.slider-on')){ 586 if(jQuery('#more-views-slider-2 li.first').length == 0){ 587 jQuery('.more-views-container ul li').each(function(index){ 588 jQuery(this).addClass('item-'+(index+1)); 589 }); 590 591 jQuery('.more-views-container ul li a').on('click', function(){ 592 indexManager(jQuery(this).parent().attr('class')); 593 }); 594 } 595 } 596 /* More Views Slider 2 */ 597 598 /* Related Block Slider */ 599 if(jQuery('#block-related-slider').length) { 600 if(!jQuery('body').hasClass('rtl')){ 601 next = '.block-related .next'; 602 prev = '.block-related .prev'; 603 }else{ 604 next = '.block-related .prev'; 605 prev = '.block-related .next'; 606 } 607 jQuery('#block-related-slider').iosSlider({ 608 responsiveSlideWidth: true, 609 snapToChildren: true, 610 desktopClickDrag: true, 611 infiniteSlider: false, 612 navSlideSelector: '.sliderNavi .naviItem', 613 navNextSelector: next, 614 navPrevSelector: prev 615 }); 616 } 617 618 function related_set_height(){ 619 var related_height = 0; 620 jQuery('#block-related-slider li.item').each(function(){ 621 if(jQuery(this).height() > related_height){ 622 related_height = jQuery(this).height(); 623 } 624 }) 625 jQuery('#block-related-slider').css('min-height', related_height+2); 626 } 627 /* Related Block Slider */ 628 629 /* Layered Navigation Accorion */ 630 if (jQuery('#layered_navigation_accordion').length) { 631 jQuery('.filter-label').each(function(){ 632 jQuery(this).toggle(function(){ 633 jQuery(this).addClass('closed').next().slideToggle(200); 634 },function(){ 635 jQuery(this).removeClass('closed').next().slideToggle(200); 636 }) 637 }); 638 } 639 /* Layered Navigation Accorion */ 640 641 642 /* Product Collateral Accordion */ 643 if (jQuery('#collateral-accordion').length) { 644 jQuery('#collateral-accordion > div.box-collateral').not(':first').hide(); 645 jQuery('#collateral-accordion > h2').click(function() { 646 jQuery(this).parent().find('h2').removeClass('active'); 647 jQuery(this).addClass('active'); 648 649 var nextDiv = jQuery(this).next(); 650 var visibleSiblings = nextDiv.siblings('div:visible'); 651 652 if (visibleSiblings.length ) { 653 visibleSiblings.slideUp(300, function() { 654 nextDiv.slideToggle(500); 655 }); 656 } else { 657 nextDiv.slideToggle(300, function(){ 658 if(!nextDiv.is(":visible")){ 659 jQuery(this).prev().removeClass('active'); 660 } 661 }); 662 } 663 }); 664 665 //another accordion mode: content open by default 666 /* jQuery('#collateral-accordion > h2').addClass('active').click(function() { 667 jQuery(this).toggleClass('active'); 668 var nextDiv = jQuery(this).next(); 669 nextDiv.slideToggle(500); 670 }); */ 671 } 672 /* Product Collateral Accordion */ 673 674 /* My Cart Accordion */ 675 if (jQuery('#cart-accordion').length) { 676 jQuery('#cart-accordion > div.accordion-content').hide(); 677 678 jQuery('#cart-accordion > h3.accordion-title').wrapInner('<span/>').click(function(){ 679 680 var accordion_title_check_flag = false; 681 if(jQuery(this).hasClass('active')){accordion_title_check_flag = true;} 682 jQuery('#cart-accordion > h3.accordion-title').removeClass('active'); 683 if(accordion_title_check_flag == false){ 684 jQuery(this).toggleClass('active'); 685 } 686 687 var nextDiv = jQuery(this).next(); 688 var visibleSiblings = nextDiv.siblings('div:visible'); 689 690 if (visibleSiblings.length ) { 691 visibleSiblings.slideUp(300, function() { 692 nextDiv.slideToggle(500); 693 }); 694 } else { 695 nextDiv.slideToggle(300); 696 } 697 698 }); 699 700 701 } 702 /* My Cart Accordion */ 703 704 /* Coin Slider */ 705 706 /* Fancybox */
707 if (jQuery.fn.fancybox) { 708 jQuery('.fancybox').fancybox(); 709 } 710 /* Fancybox */ 711 712 /* Zoom */ 713 if (jQuery('#zoom').length) { 714 jQuery('.cloud-zoom, .cloud-zoom-gallery').CloudZoom(); 715 } 716 /* Zoom */ 717 718 /* Responsive */ 719 var responsiveflag = false; 720 var topSelectFlag = false; 721 var menu_type = jQuery('#nav').attr('class'); 722 723 function mobile_menu(mode){ 724 switch(mode) 725 { 726 case 'animate': 727 if(!jQuery('.nav-container').hasClass('mobile')){ 728 jQuery(".nav-container").addClass('mobile'); 729 jQuery('.nav-container > ul').slideUp('fast'); 730 jQuery('.menu-button').removeClass('active'); 731 jQuery('.menu-button').on('click', function(){ 732 jQuery(this).toggleClass('active'); 733 jQuery('.nav-container > ul').slideToggle('medium'); 734 }); 735 jQuery('.nav-container > ul a').each(function(){ 736 if(jQuery(this).next('ul').length || jQuery(this).next('div.menu-wrapper').length){ 737 jQuery(this).before('<span class="menu-item-button"><i class="fa fa-plus"></i><i class="fa fa-minus"></i></span>') 738 jQuery(this).next('ul').slideUp('fast'); 739 jQuery(this).prev('.menu-item-button').on('click', function(){ 740 jQuery(this).toggleClass('active'); 741 jQuery(this).nextAll('ul, div.menu-wrapper').slideToggle('medium'); 742 }); 743 } 744 }); 745 } 746 break; 747 default: 748 jQuery(".nav-container").removeClass('mobile'); 749 jQuery('.menu-button').off(); 750 jQuery('.nav-container > ul').slideDown('fast'); 751 jQuery('.nav-container .menu-item-button').each(function(){ 752 jQuery(this).nextAll('ul').slideDown('fast'); 753 jQuery(this).remove(); 754 }); 755 jQuery('.nav-container .menu-wrapper').slideUp('fast'); 756 } 757 } 758 759 if(jQuery('.parallax-page').length == 0){ 760 var WishlistLink = jQuery('.top-link-wishlist'); 761 jQuery('.top-cart').after(WishlistLink.clone()); 762 jQuery('.wishlist-items').appendTo('header#header .topline .top-link-wishlist'); 763 } 764 765 /* Mobile Top Links */ 766 function mobileTopLinks() { 767 var topLinks = jQuery('header#header .quick-access'); 768 if(jQuery(document.body).width() < 767) { 769 jQuery('.top-cart').before(topLinks); 770 } else { 771 jQuery(topLinks).prependTo('.header-top-right'); 772 } 773 } 774 775 /* Mobile Cart Remove Link */ 776 function MCRemoveLink() { 777 if(jQuery(document.body).width() < 767) {
778 jQuery('.cart-table .product-name').each(function(){ 779 var titleHeight = jQuery(this).position().top; 780 var removeLink = jQuery(this).parent().parent().parent().find('.remove .btn-remove2'); 781 jQuery(removeLink).css('top', titleHeight - 35); 782 }); 783 } 784 } 785 786 function pageNotFound() { 787 if(jQuery('.not-found-bg').data('bgimg')){ 788 var bgImg = jQuery('.not-found-bg').data('bgimg'); 789 jQuery('.not-found-bg').attr('style', bgImg); 790 } 791 } 792 793 function toDo(){ 794 if (jQuery(document.body).width() < 767 && responsiveflag == false){ 795 /* Top Menu Select */ 796 if(topSelectFlag == false){ 797 jQuery('.nav-container .sbSelector').wrapInner('<span />').prepend('<span />'); 798 topSelectFlag = true; 799 } 800 jQuery('.nav-container .sbOptions li a').on('click', function(){ 801 if(!jQuery('.nav-container .sbSelector span').length){ 802 jQuery('.nav-container .sbSelector').wrapInner('<span />').prepend('<span />'); 803 } 804 }); 805 /* //Top Menu Select */ 806 responsiveflag = true; 807 } 808 else if (jQuery(document.body).width() > 767){ 809 responsiveflag = false; 810 } 811 } 812 813 /* Product tabs */ 814 if(jQuery('.product-tabs-widget').length){ 815 function productTabs(){ 816 jQuery('ul.product-tabs').on('click', 'li:not(.current)', function() { 817 jQuery(this).addClass('current').siblings().removeClass('current') 818 .parents('div.product-tabs-wrapper').find('div.product-tabs-box').eq(jQuery(this).index()).fadeIn(300).addClass('visible').siblings('div.product-tabs-box').hide().removeClass('visible'); 819 gridLabels(); 820 }); 821 } 822 function productTabsBg(){ 823 if(jQuery('.product-tabs-wrapper').length){ 824 setTimeout(function(){ 825 jQuery('.product-tabs-wrapper').each(function(){ 826 if(jQuery(this).find('.product-tabs-box').length){ 827 maxHeight = 0; 828 jQuery(this).find('.product-tabs-box').each(function(){ 829 tabContent = jQuery(this).outerHeight(true); 830 if(tabContent > maxHeight) { 831 maxHeight = tabContent; 832 } 833 });
834 blockIndents = parseFloat(jQuery(this).css('padding-top')) + parseFloat(jQuery(this).css('padding-bottom')); 835 if(jQuery(this).find('.widget-title').length){ 836 listHeight = jQuery(this).find('.product-tabs').outerHeight(true) + jQuery(this).find('.widget-title').outerHeight(true); 837 } else { 838 listHeight = jQuery(this).find('.product-tabs').outerHeight(true); 839 } 840 blockHeight = maxHeight + listHeight + blockIndents; 841 jQuery(this).children('.product-tabs-box:not(".visible")').css({ 842 'position' : 'static', 843 'opacity' : 1, 844 'display' : 'none' 845 }); 846 if(jQuery('body').hasClass('boxed-layout')) { 847 blockWidth = jQuery(this).parents('.container_12').outerWidth(); 848 } else { 849 blockWidth = jQuery(this).width()+30; 850 } 851 siteWidth = jQuery(window).width(); 852 bg = jQuery(this).find('.product-tabs-bg'); 853 bg.attr('style', ''); 854 bgIndent = bg.offset().left; 855 if(jQuery('body').hasClass('boxed-layout')){ 856 if(jQuery(document.body).width() < 479){ 857 bg.css({ 858 'left': '-'+25+'px', 859 'width': siteWidth+'px', 860 'height': blockHeight 861 }).parent().css('height', blockHeight - blockIndents); 862 } else if(jQuery(document.body).width() > 479 && jQuery(document.body).width() < 767){ 863 bg.css({ 864 'left': '-'+bgIndent+'px', 865 'width': siteWidth+'px', 866 'height': blockHeight 867 }).parent().css('height', blockHeight - blockIndents);; 868 } else if(jQuery(document.body).width() > 767 && jQuery(document.body).width() < 978){ 869 bg.css({ 870 'width': blockWidth - 20, 871 'left': '-10px', 872 'height': blockHeight 873 }).parent().css('height', blockHeight - blockIndents); 874 } else if(jQuery(document.body).width() > 978 && jQuery(document.body).width() < 1300){ 875 bg.css({ 876 'width': blockWidth, 877 'left': '-15px', 878 'height': blockHeight 879 }).parent().css('height', blockHeight - blockIndents); 880 } else { 881 bg.css({ 882 'width': blockWidth, 883 'left': '-60px', 884 'height': blockHeight 885 }).parent().css('height', blockHeight - blockIndents); 886 } 887 }else{ 888 bg.css({ 889 'left': '-'+bgIndent+'px', 890 'width': siteWidth+'px', 891 'height': blockHeight 892 }).parent().css('height', blockHeight - blockIndents);; 893 } 894 listHeight = jQuery(this).find('.product-tabs').outerHeight(true); 895 if(jQuery(this).find('.top-buttons').length){ 896 if(jQuery(this).find('.widget-title').length){ 897 if(jQuery(document.body).width() < 767){ 898 titleHeight = jQuery(this).find('.widget-title').innerHeight(); 899 blockTopIndent = parseFloat(jQuery(this).css('padding-top')); 900 jQuery(this).find('.product-tabs').css('top', titleHeight + blockTopIndent + listHeight/2 + 5) 901 } else { 902 jQuery(this).find('.product-tabs').attr('style', ''); 903 } 904 } 905 jQuery(this).find('.product-tabs-widget').css('padding-top', listHeight); 906 } else { 907 jQuery(this).find('.product-tabs-widget').css('padding-bottom', listHeight); 908 } 909 910 } 911 }); 912 }, 100); 913 } 914 } 915 productTabs(); 916 productTabsBg(); 917 jQuery(window).resize(function(){productTabsBg()}); 918 } 919 920 function backgroundWrapper(){ 921 if(jQuery('.background-wrapper').length){ 922 jQuery('.background-wrapper').each(function(){ 923 if(jQuery('body').hasClass('boxed-layout')) { 924 blockWidth = jQuery(this).parents('.container_12').outerWidth(); 925 blockIndent = parseFloat(jQuery('.container_12').css('padding-left')) + parseFloat(jQuery('.grid_12').css('margin-left')); 926 } else { 927 blockWidth = jQuery(this).parent().width()+30; 928 } 929 siteWidth = jQuery(window).width(); 930 bg = jQuery(this); 931 bg.parent().css('position', 'relative'); 932 bgIndent = jQuery(this).parent().offset().left; 933 if(jQuery('body').hasClass('boxed-layout')){ 934 if(jQuery(document.body).width() < 767){ 935 bg.css({ 936 'left': '-'+bgIndent+'px', 937 'width': siteWidth+'px' 938 });
939 } else if(jQuery(document.body).width() > 767 && jQuery(document.body).width() < 977){ 940 bg.css({ 941 'width': blockWidth, 942 'left': -blockIndent 943 }); 944 } else { 945 bg.css({ 946 'width': blockWidth, 947 'left': -blockIndent 948 }); 949 } 950 }else{ 951 if(jQuery(document.body).width() > 767 && jQuery(document.body).width() < 977){ 952 bg.css({ 953 'width': blockWidth - 10, 954 'left': '-'+bgIndent+'px' 955 }); 956 } else { 957 bg.css({ 958 'left': '-'+bgIndent+'px', 959 'width': siteWidth+'px' 960 }); 961 } 962 } 963 if(bg.children('.text-banner').length){ 964 if(bg.parent().hasClass('parallax-banners-wrapper')) { 965 jQuery('.parallax-banners-wrapper').each(function(){ 966 var wrapper = jQuery(this); 967 headerHeight = jQuery('header#header').outerHeight(); 968 jQuery('.parallax-content').css({ 969 'top' : -headerHeight, 970 'margin-bottom' : -headerHeight 971 }); 972 block = jQuery(this).find('.text-banner'); 973 var fullHeight = 0; 974 var imgCount = block.size(); 975 var currentIndex = 0; 976 block.each(function(){ 977 if(jQuery(this).children('.banner-content').data('colors')){ 978 jQuery(this).children('.banner-content').addClass(jQuery(this).children('.banner-content').data('colors')); 979 } 980 imgUrl = jQuery(this).find('.background').css('background-image').replace(/url\(|\)|\"/ig, ''); 981 if(imgUrl.indexOf('none')==-1){ 982 img = new Image; 983 img.src = imgUrl; 984 img.setAttribute("name", jQuery(this).attr('id')); 985 img.onload = function(){ 986 imgName = '#' + jQuery(this).attr('name'); 987 if(jQuery('.parallax-banners-wrapper').data('fullscreen')){ 988 windowHeight = document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight; 989 jQuery(imgName).find('.background').css({ 990 'height' : windowHeight+'px', 991 'background-size' : '100% 100%' 992 }); 993 jQuery(imgName).css('height', (windowHeight)+'px'); 994 fullHeight += windowHeight; 995 } else { 996 jQuery(imgName).find('.background').css('height', this.height+'px'); 997 jQuery(imgName).css('height', (this.height - 100)+'px'); 998 fullHeight += this.height - 100; 999 if (pixelRatio > 1) { 1000 jQuery(imgName).find('.background').css('background-size', this.width+'px' + ' ' + this.height+'px'); 1001 } 1002 } 1003 wrapper.css('height', fullHeight); 1004 currentIndex++; 1005 if(!jQuery('body').hasClass('mobile-device')){ 1006 if(currentIndex == imgCount){ 1007 if(jQuery(document.body).width() > 1278) { 1008 jQuery('#parallax-banner-1').parallax("60%", 0.7, false); 1009 jQuery('#parallax-banner-1').parallax("60%", 0.7, false); 1010 jQuery('#parallax-banner-2').parallax("60%", 0.8, false); 1011 jQuery('#parallax-banner-3').parallax("60%", 0.7, false); 1012 jQuery('#parallax-banner-4').parallax("60%", 0.7, false); 1013 jQuery('#parallax-banner-5').parallax("60%", 0.7, false); 1014 jQuery('#parallax-banner-6').parallax("60%", 0.4, false); 1015 jQuery('#parallax-banner-7').parallax("60%", 0.7, false); 1016 jQuery('#parallax-banner-8').parallax("60%", 0.7, false); 1017 jQuery('#parallax-banner-9').parallax("60%", 0.7, false); 1018 jQuery('#parallax-banner-10').parallax("60%", 0.7, false); 1019 jQuery('#parallax-banner-11').parallax("60%", 0.7, false); 1020 jQuery('#parallax-banner-12').parallax("60%", 0.7, false); 1021 jQuery('#parallax-banner-13').parallax("60%", 0.7, false); 1022 jQuery('#parallax-banner-14').parallax("60%", 0.7, false); 1023 jQuery('#parallax-banner-15').parallax("60%", 0.7, false); 1024 jQuery('#parallax-banner-16').parallax("60%", 0.7, false); 1025 jQuery('#parallax-banner-17').parallax("60%", 0.7, false); 1026 jQuery('#parallax-banner-18').parallax("60%", 0.7, false); 1027 jQuery('#parallax-banner-19').parallax("60%", 0.7, false); 1028 jQuery('#parallax-banner-20').parallax("60%", 0.7, false); 1029 } else if(jQuery(document.body).width() > 977) { 1030 jQuery('#parallax-banner-1').parallax("60%", 0.2, false); 1031 jQuery('#parallax-banner-2').parallax("60%", 0.8, false); 1032 jQuery('#parallax-banner-3').parallax("60%", 0.9, false); 1033 jQuery('#parallax-banner-4').parallax("60%", 0.85, false); 1034 jQuery('#parallax-banner-5').parallax("60%", 0.8, false); 1035 jQuery('#parallax-banner-6').parallax("60%", 0.4, false); 1036 jQuery('#parallax-banner-7').parallax("60%", 0.8, false); 1037 jQuery('#parallax-banner-8').parallax("60%", 0.9, false); 1038 jQuery('#parallax-banner-9').parallax("60%", 0.85, false); 1039 jQuery('#parallax-banner-10').parallax("60%", 0.8, false); 1040 jQuery('#parallax-banner-11').parallax("60%", 0.8, false); 1041 jQuery('#parallax-banner-12').parallax("60%", 0.9, false); 1042 jQuery('#parallax-banner-13').parallax("60%", 0.85, false); 1043 jQuery('#parallax-banner-14').parallax("60%", 0.8, false); 1044 jQuery('#parallax-banner-15').parallax("60%", 0.8, false); 1045 jQuery('#parallax-banner-16').parallax("60%", 0.9, false); 1046 jQuery('#parallax-banner-17').parallax("60%", 0.85, false); 1047 jQuery('#parallax-banner-18').parallax("60%", 0.8, false); 1048 jQuery('#parallax-banner-19').parallax("60%", 0.8, false); 1049 jQuery('#parallax-banner-20').parallax("60%", 0.9, false); 1050 } else if(jQuery(document.body).width() > 767) { 1051 jQuery('#parallax-banner-1').parallax("60%", 0.3, false); 1052 jQuery('#parallax-banner-2').parallax("60%", 0.3, false); 1053 jQuery('#parallax-banner-3').parallax("60%", 0.3, false); 1054 jQuery('#parallax-banner-4').parallax("60%", 0.3, false); 1055 jQuery('#parallax-banner-5').parallax("60%", 0.3, false); 1056 jQuery('#parallax-banner-6').parallax("60%", 0.3, false); 1057 jQuery('#parallax-banner-7').parallax("60%", 0.3, false); 1058 jQuery('#parallax-banner-8').parallax("60%", 0.1, false); 1059 jQuery('#parallax-banner-9').parallax("60%", 0.1, false); 1060 jQuery('#parallax-banner-10').parallax("60%", 0.1, false); 1061 jQuery('#parallax-banner-11').parallax("60%", 0.1, false); 1062 jQuery('#parallax-banner-12').parallax("60%", 0.1, false); 1063 jQuery('#parallax-banner-13').parallax("60%", 0.1, false); 1064 jQuery('#parallax-banner-14').parallax("60%", 0.1, false); 1065 jQuery('#parallax-banner-15').parallax("60%", 0.1, false); 1066 jQuery('#parallax-banner-16').parallax("60%", 0.1, false); 1067 jQuery('#parallax-banner-17').parallax("60%", 0.1, false); 1068 jQuery('#parallax-banner-18').parallax("60%", 0.1, false); 1069 jQuery('#parallax-banner-19').parallax("60%", 0.1, false); 1070 jQuery('#parallax-banner-20').parallax("60%", 0.1, false); 1071 } else { 1072 jQuery('#parallax-banner-1').parallax("30%", 0.5, true); 1073 jQuery('#parallax-banner-2').parallax("60%", 0.1, false); 1074 jQuery('#parallax-banner-3').parallax("60%", 0.1, false); 1075 jQuery('#parallax-banner-4').parallax("60%", 0.1, false); 1076 jQuery('#parallax-banner-5').parallax("60%", 0.1, false); 1077 jQuery('#parallax-banner-6').parallax("60%", 0.1, false); 1078 jQuery('#parallax-banner-7').parallax("60%", 0.1, false); 1079 jQuery('#parallax-banner-8').parallax("60%", 0.1, false); 1080 jQuery('#parallax-banner-9').parallax("60%", 0.1, false); 1081 jQuery('#parallax-banner-10').parallax("60%", 0.1, false); 1082 jQuery('#parallax-banner-11').parallax("60%", 0.1, false); 1083 jQuery('#parallax-banner-12').parallax("60%", 0.1, false); 1084 jQuery('#parallax-banner-13').parallax("60%", 0.1, false); 1085 jQuery('#parallax-banner-14').parallax("60%", 0.1, false); 1086 jQuery('#parallax-banner-15').parallax("60%", 0.1, false); 1087 jQuery('#parallax-banner-16').parallax("60%", 0.1, false); 1088 jQuery('#parallax-banner-17').parallax("60%", 0.1, false); 1089 jQuery('#parallax-banner-18').parallax("60%", 0.1, false); 1090 jQuery('#parallax-banner-19').parallax("60%", 0.1, false); 1091 jQuery('#parallax-banner-20').parallax("60%", 0.1, false); 1092 } 1093 } 1094 } 1095 } 1096 } 1097 bannerText = jQuery(this).find('.banner-content'); 1098 if(bannerText.data('top')){ 1099 bannerText.css('top', bannerText.data('top')); 1100 } 1101 if(bannerText.data('left')){ 1102 if(!bannerText.data('right')){ 1103 bannerText.css({ 1104 'left': bannerText.data('left'), 1105 'right' : 'auto' 1106 });
1107 } else { 1108 bannerText.css('left', bannerText.data('left')); 1109 } 1110 } 1111 if(bannerText.data('right')){ 1112 if(!bannerText.data('left')){ 1113 bannerText.css({ 1114 'right': bannerText.data('right'), 1115 'left' : 'auto' 1116 }); 1117 } else { 1118 bannerText.css('right', bannerText.data('right')); 1119 } 1120 } 1121 }); 1122 }); 1123 jQuery(window).scroll(function() { 1124 jQuery('.parallax-banners-wrapper').each(function(){ 1125 block = jQuery(this).find('.text-banner'); 1126 block.each(function(){ 1127 var imagePos = jQuery(this).offset().top; 1128 var topOfWindow = jQuery(window).scrollTop(); 1129 if (imagePos < topOfWindow+400) { 1130 jQuery(this).addClass("slideup"); 1131 } else { 1132 jQuery(this).removeClass("slideup"); 1133 } 1134 }); 1135 }); 1136 }); 1137 setTimeout(function(){ 1138 jQuery('.product-tabs-wrapper, .widget-list').animate({'opacity': 1}, 100); 1139 jQuery('.parallax-page #parallax-loading').fadeOut(200); 1140 }, 500); 1141 } else { 1142 blockHeight = bg.children('img').outerHeight(); 1143 block.css('height', blockHeight); 1144 bg.css('height', blockHeight); 1145 } 1146 } else { 1147 blockHeight = bg.parent().outerHeight(); 1148 if(bg.children('img').height() < blockHeight) { 1149 bg.children('img').css({ 1150 'height' : blockHeight, 1151 'width' : '100%' 1152 }); 1153 } else { 1154 bg.children('img').attr('style', ''); 1155 } 1156 } 1157 }); 1158 } 1159 } 1160 1161 function replacingClass () { 1162 if (jQuery(document.body).width() < 480) { //Mobile 1163 mobile_menu('animate'); 1164 headerCustomer(); 1165 simpleList('set'); 1166 } 1167 if (jQuery(document.body).width() > 479 && jQuery(document.body).width() < 768) { //iPhone 1168 mobile_menu('animate'); 1169 headerCustomer(); 1170 simpleList('set'); 1171 } 1172 if (jQuery(document.body).width() > 767 && jQuery(document.body).width() <= 1007){ //Tablet 1173 mobile_menu('reset'); 1174 headerCustomer(true); 1175 simpleList('reset'); 1176 } 1177 if (jQuery(document.body).width() > 1007 && jQuery(document.body).width() <= 1374){ //Desktop 1178 mobile_menu('reset'); 1179 headerCustomer(true); 1180 simpleList('reset'); 1181 } 1182 if (jQuery(document.body).width() > 1374){ //Extra Large 1183 mobile_menu('reset'); 1184 headerCustomer(true); 1185 simpleList('reset'); 1186 } 1187 } 1188 replacingClass(); 1189 toDo(); 1190 more_view_set_height(); 1191 more_view2_set_height(); 1192 wishlist_set_height(); 1193 related_set_height(); 1194 titleDivider(); 1195 WideMenuTop(); 1196 mobileTopLinks(); 1197 MCRemoveLink(); 1198 pageNotFound(); 1199 backgroundWrapper(); 1200 jQuery(window).resize(function(){toDo(); replacingClass(); more_view_set_height(); more_view2_set_height(); wishlist_set_height(); related_set_height(); titleDivider(); WideMenuTop(); mobileTopLinks(); MCRemoveLink(); pageNotFound(); backgroundWrapper()}); 1201 /* Responsive */ 1202 1203 /* Top Menu */ 1204 function menuHeight2 () { 1205 var menu_min_height = 0; 1206 jQuery('#nav li.tech').css('height', 'auto'); 1207 jQuery('#nav li.tech').each(function(){ 1208 if(jQuery(this).height() > menu_min_height){ 1209 menu_min_height = jQuery(this).height(); 1210 } 1211 }); 1212 jQuery('#nav li.tech').each(function(){ 1213 jQuery(this).css('height', menu_min_height + 'px'); 1214 }); 1215 } 1216 1217 /* Top Selects */ 1218 function option_class_add(items, is_selector){ 1219 jQuery(items).each(function(){ 1220 if(is_selector){ 1221 jQuery(this).removeAttr('class'); 1222 jQuery(this).addClass('sbSelector'); 1223 } 1224 stripped_string = jQuery(this).html().replace(/(<([^>]+)>)/ig,""); 1225 RegEx=/\s/g; 1226 stripped_string=stripped_string.replace(RegEx,""); 1227 jQuery(this).addClass(stripped_string.toLowerCase()); 1228 if(is_selector){ 1229 tags_add(); 1230 } 1231 }); 1232 } 1233 option_class_add('.sbOptions li a, .sbSelector', false); 1234 jQuery('.sbOptions li a, .sbSelector').on('click', function(){ 1235 option_class_add('.sbSelector', true); 1236 }); 1237 function tags_add(){ 1238 jQuery('.sbSelector').each(function(){ 1239 if(!jQuery(this).find('span.text').length){ 1240 jQuery(this).wrapInner('<span class="text" />').append('<span />').find('span:last').wrapInner('<span />'); 1241 } 1242 }); 1243 } 1244 tags_add(); 1245 /* //Top Selects */ 1246
1247 1248 /* Mobile Devices */ 1249 if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i)) || (navigator.userAgent.match(/Android/i))){ 1250 /* Mobile Devices Class */ 1251 jQuery('body').addClass('mobile-device'); 1252 1253 /* Menu */ 1254 jQuery(".nav-container:not('.mobile') #nav li").on({ 1255 click: function (){ 1256 if ( !jQuery(this).hasClass('touched') && jQuery(this).children('ul').length ){ 1257 jQuery(this).addClass('touched'); 1258 clearTouch(jQuery(this)); 1259 return false; 1260 } 1261 } 1262 }); 1263 1264 /* Clear Touch Function */ 1265 function clearTouch(handlerObject){ 1266 jQuery('body').on('click', function(){ 1267 handlerObject.removeClass('touched closed'); 1268 catAccordion(); 1269 jQuery('body').off(); 1270 }); 1271 handlerObject.click(function(event){ 1272 event.stopPropagation(); 1273 }); 1274 handlerObject.parent().click(function(){ 1275 handlerObject.removeClass('touched'); 1276 catAccordion(); 1277 }); 1278 handlerObject.siblings().click(function(){ 1279 handlerObject.removeClass('touched'); 1280 }); 1281 1282 function catAccordion(){ 1283 if(handlerObject.parent().attr('id') == 'categories-accordion'){ 1284 jQuery('#categories-accordion li.parent').each(function(){ 1285 if(!jQuery(this).hasClass('active')){ 1286 jQuery(this).find('.btn-cat').removeClass('closed'); 1287 jQuery(this).find('ul').slideUp(200); 1288 } 1289 }); 1290 } 1291 } 1292 } 1293 1294 var mobileDevice = true; 1295 }else{ 1296 var mobileDevice = false; 1297 } 1298 1299 if (jQuery('body').hasClass('retina-ready')) { 1300 //images with custom attributes 1301 if (pixelRatio > 1) { 1302 function brandsWidget(){ 1303 brands = jQuery('ul.brands li a img'); 1304 brands.each(function(){ 1305 jQuery(this).css('width', jQuery(this).width()/2); 1306 }); 1307 } 1308 if(jQuery('.about-us-wrapper img').length){ 1309 aboutImg = jQuery('.about-us-wrapper img'); 1310 aboutImg.css('width', aboutImg.width()/2); 1311 } 1312 logoResize(); 1313 brandsWidget(); 1314 jQuery(window).resize(function(){ 1315 logoResize(); 1316 }); 1317 1318 /* product brand banner */ 1319 if(jQuery('.product-brand .brand-img img').length){ 1320 imgUrl = jQuery('.product-brand .brand-img img').attr('src'); 1321 img = new Image; 1322 img.src = imgUrl; 1323 img.onload = function(){ 1324 jQuery('.product-brand .brand-img img').css('width', img.width/2); 1325 } 1326 } 1327 1328 /* Top menu Bg */ 1329 jQuery('#nav-wide.nav-wide .menu-wrapper').each(function(){ 1330 stretchMode = false; 1331 1332 if(jQuery(this).attr('style') != undefined && jQuery(this).attr('style').indexOf('background-size') !=-1){ 1333 stretchMode = true; 1334 } 1335 1336 jQuery(this).attr('style', jQuery(this).attr('dataX2')); 1337 if(stretchMode == false){ 1338 imgUrl = jQuery(this).css('background-image').replace(/url\(|\)|\"/ig, ''); 1339 if(imgUrl.indexOf('none')==-1){ 1340 img = new Image; 1341 img.src = imgUrl; 1342 thisElement = jQuery(this); 1343 img.onload = function(){ 1344 thisElement.css('background-size', img.width/2+'px'); 1345 } 1346 } 1347 } 1348 }); 1349 } 1350 } 1351 1352 1353 /* Categories Accorion */ 1354 if (jQuery('#categories-accordion').length){ 1355 jQuery('#categories-accordion li.parent ul').before('<div class="btn-cat"><i class="fa fa-plus-square-o"></i><i class="fa fa-minus-square-o"></i></div>'); 1356 jQuery('#categories-accordion li.level-top:not(.parent) > a').before('<i class="fa fa-square-o"></i>'); 1357 if(mobileDevice == true){ 1358 jQuery('#categories-accordion li.parent:not(.active)').each(function(){ 1359 jQuery(this).on({ 1360 click: function (){ 1361 if(!jQuery(this).hasClass('touched')){ 1362 jQuery(this).addClass('touched closed').children('ul').slideDown(200); 1363 jQuery(this).children('.btn-cat').addClass('closed'); 1364 clearTouch(jQuery(this)); 1365 return false; 1366 } 1367 } 1368 }); 1369 }); 1370 }else{ 1371 jQuery('#categories-accordion li.parent .btn-cat').each(function(){ 1372 jQuery(this).toggle(function(){ 1373 jQuery(this).addClass('closed').next().slideToggle(200); 1374 jQuery(this).prev().addClass('closed'); 1375 },function(){ 1376 jQuery(this).removeClass('closed').next().slideToggle(200); 1377 jQuery(this).prev().removeClass('closed'); 1378 }) 1379 }); 1380 } 1381 } 1382 /* Categories Accorion */ 1383 1384 /* Menu Wide */ 1385 if(jQuery('#nav-wide').length){ 1386 jQuery('#nav-wide li.level-top').mouseenter(function(){ 1387 jQuery(this).addClass('over'); 1388 }); 1389 jQuery('#nav-wide li.level-top').mouseleave(function(){ 1390 jQuery(this).removeClass('over'); 1391 }); 1392 jQuery('.nav-wide#nav-wide .menu-wrapper').each(function(){ 1393 jQuery(this).children('div.alpha.omega:first').addClass('first'); 1394 }); 1395 1396 columnsWidth = function(columnsCount, currentGroupe){ 1397 if(currentGroupe.size() > 1){ 1398 currentGroupe.each(function(){ 1399 jQuery(this).css('width', (100/currentGroupe.size())+'%'); 1400 }); 1401 }else{ 1402 currentGroupe.css('width', (100/columnsCount)+'%'); 1403 } 1404 } 1405 jQuery('.nav-wide#nav-wide .menu-wrapper').each(function(){
1406 columnsCount = jQuery(this).attr('columns'); 1407 items = jQuery(this).find('ul.level0 > li'); 1408 groupsCount = items.size()/columnsCount; 1409 ratio = 1; 1410 for(i=0; i<groupsCount; i++){ 1411 currentGroupe = items.slice((i*columnsCount), (columnsCount*ratio)); 1412 /* set columns width */ 1413 columnsWidth(columnsCount, currentGroupe); 1414 /* ==== */ 1415 ratio++; 1416 } 1417 }); 1418 1419 /* Default Sub Menu in Wide Mode */ 1420 elements = jQuery('#nav-wide .menu-wrapper.default-menu ul.level0 li'); 1421 if(elements.length){ 1422 elements.on('mouseenter mouseleave', function(){ 1423 if(!jQuery('.nav-container').hasClass('mobile')){ 1424 jQuery(this).children('ul').toggle(); 1425 } 1426 }); 1427 jQuery(window).resize(function(){ 1428 if(!jQuery('.nav-container').hasClass('mobile')){ 1429 elements.find('ul').hide(); 1430 } 1431 }); 1432 elements.each(function(){ 1433 if(jQuery(this).children('ul').length){ 1434 jQuery(this).addClass('parent'); 1435 } 1436 }); 1437 1438 1439 /* Default dropdown menu */ 1440 items = []; 1441 jQuery('#nav-wide li.level0').each(function(){ 1442 if(jQuery(this).children('.default-menu').length){ 1443 items.push(jQuery(this)); 1444 } 1445 }); 1446 jQuery(items).each(function(){ 1447 jQuery(this).on('mouseenter mouseleave', function(){ 1448 if(jQuery(this).hasClass('over')){ 1449 if(!jQuery('body').hasClass('rtl')){ 1450 jQuery(this).children('.default-menu').css({ 1451 'top': jQuery(this).position().top + jQuery(this).height(), 1452 'left': jQuery(this).position().left 1453 }); 1454 }else{ 1455 jQuery(this).children('.default-menu').css({ 1456 'top': jQuery(this).position().top + jQuery(this).height(), 1457 'left': jQuery(this).position().left - (jQuery(this).children('.default-menu').width() - jQuery(this).width()) 1458 }); 1459 } 1460 }else{ 1461 jQuery(this).children('.default-menu').css('left', '-10000px'); 1462 } 1463 }); 1464 }); 1465 } 1466 } 1467 1468}); 1469var pixelRatio = !!window.devicePixelRatio ? window.devicePixelRatio : 1; 1470jQuery(document).ready(function(){ 1471 /* More Views Slider 2 */ 1472 if(jQuery('#more-views-slider-2').length){ 1473 /* start height */ 1474 slider = jQuery('#more-views-slider-2'); 1475 sliderWidth = slider.width(); 1476 if(slider.parents('.productpage_extralarge').length){ 1477 sliderWidth = sliderWidth - (sliderWidth * 0.3); 1478 } 1479 slider.css({ 1480 'height': sliderWidth, 1481 'overflow': 'hidden' 1482 }); 1483 } 1484 1485 1486 var isApple = false; 1487 /* apple position fixed fix */ 1488 if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))){ 1489 isApple = true; 1490 1491 function stickyPosition(clear){ 1492 items = jQuery('header#header, .backstretch'); 1493 if(clear == false){ 1494 topIndent = jQuery(window).scrollTop(); 1495 items.css({ 1496 'position': 'absolute', 1497 'top': topIndent 1498 }); 1499 }else{ 1500 items.css({ 1501 'position': 'fixed', 1502 'top': '0' 1503 }); 1504 } 1505 } 1506 1507 jQuery('.sticky-search header#header .form-search input').on('focusin focusout', function(){ 1508 jQuery(this).toggleClass('focus'); 1509 if(jQuery('header#header').hasClass('floating')){ 1510 if(jQuery(this).hasClass('focus')){ 1511 setTimeout(function(){ 1512 stickyPosition(false); 1513 }, 500); 1514 }else{ 1515 stickyPosition(true); 1516 } 1517 } 1518 }); 1519 } 1520 1521 if (jQuery('body').hasClass('retina-ready')) { 1522 if (pixelRatio > 1) { 1523 jQuery('img[data-srcX2]').each(function(){ 1524 jQuery(this).attr('src',jQuery(this).attr('data-srcX2')); 1525 }); 1526 } 1527 } 1528 1529 /* Selects */ 1530 jQuery(".form-currency select, .form-language select, .store-switcher select").selectbox(); 1531 1532 1533/* Messages button */ 1534 if(jQuery('ul.messages').length){ 1535 jQuery('ul.messages > li').each(function(){ 1536 switch (jQuery(this).attr('class')){ 1537 case 'success-msg': 1538 messageIcon = '<i class="fa fa-check" />'; 1539 break; 1540 case 'error-msg': 1541 messageIcon = '<i class="fa fa-times" />'; 1542 break; 1543 case 'note-msg': 1544 messageIcon = '<i class="fa fa-exclamation" />'; 1545 break; 1546 case 'notice-msg': 1547 messageIcon = '<i class="fa fa-exclamation" />'; 1548 break; 1549 default: 1550 messageIcon = ''; 1551 } 1552 jQuery(this).prepend('<div class="messages-close-btn" />', messageIcon); 1553 jQuery('ul.messages .messages-close-btn').on('click', function(){ 1554 jQuery('ul.messages').remove(); 1555 }); 1556 }); 1557 } 1558 if(jQuery('.content_bottom').length){ 1559 jQuery('.content_bottom button#find-us').click(function() { 1560 jQuery('.content_bottom').toggleClass('active'); 1561 if(jQuery('.content_bottom').hasClass('hide')){ 1562 jQuery('.content_bottom').removeClass('hide'); 1563 }else{ 1564 setTimeout(function(){ 1565 jQuery('.content_bottom').addClass('hide'); 1566 }, 500); 1567 } 1568 }); 1569 } 1570 1571 1572 /* sticky header */ 1573 if(jQuery('body').hasClass('floating-header') && jQuery('.parallax-page').length == 0){ 1574 var headerHeight = jQuery('#header').height();
1575 jQuery(window).on('scroll.sticky', function(){ 1576 if(!isApple){ 1577 heightParam = headerHeight; 1578 }else{ 1579 heightParam = headerHeight*2; 1580 } 1581 if(jQuery(this).scrollTop() >= heightParam){ 1582 if(!jQuery('#header').hasClass('floating')){ 1583 if(!((!jQuery('body').hasClass('sticky-mobile') && jQuery(document.body).width() < 481) || (!jQuery('body').hasClass('sticky-tablet') && (jQuery(document.body).width() > 767 && jQuery(document.body).width() < 1279)))){ 1584 sticky.show(headerHeight); 1585 } 1586 logoResize(); 1587 } 1588 } 1589 if(jQuery(this).scrollTop() < headerHeight ){ 1590 if(jQuery('#header').hasClass('floating')){ 1591 sticky.hide(); 1592 logoResize(); 1593 } 1594 } 1595 }); 1596 } 1597 1598 productHoverImages(); 1599 1600 if(jQuery('header#header .form-language .sbHolder').length) { 1601 jQuery('header#header .form-language').addClass('select'); 1602 } 1603 1604 gridLabels(); 1605 1606 jQuery('.contacts-footer-content input, .contacts-footer-content textarea, #header .form-search input').each(function(){ 1607 jQuery(this).focusin(function(){ 1608 jQuery(this).parent().addClass('focus'); 1609 }); 1610 }); 1611 jQuery('.contacts-footer-content input, .contacts-footer-content textarea, #header .form-search input').each(function(){ 1612 jQuery(this).focusout(function(){ 1613 jQuery(this).parent().removeClass('focus'); 1614 }); 1615 }); 1616 1617 /* Header Customer Block */ 1618 if(jQuery('#header .customer-name').length && !jQuery('#header .quick-access.simple-list').length){ 1619 var CustName = jQuery('#header .customer-name'); 1620 CustName.next().hide(); 1621 CustName.click(function(){ 1622 CustName.next().slideToggle(); 1623 }); 1624 } 1625 1626 if(jQuery('.toolbar-bottom .pager .pages').length == 0){ 1627 jQuery('.toolbar-bottom').addClass('no-border'); 1628 } 1629 1630 if(jQuery('.parallax-page').length){ 1631 getWishlistCount(); 1632 } 1633});
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.