/* DEFAULT Start */
document.documentElement.className+=window.location==window.parent.location?" noiframe":" iframe",document.documentElement.setAttribute("data-host",location.hostname),function(){function a(){let a=document.documentElement.classList,b=JSON.parse(sessionStorage.getItem("debugClasses")||"[]"),c=(location.href.match(/[?#!&]class=([^&]+)/)||[])[1];"-"==c?(a.remove.apply(a,b),b=[]):c&&(b=c.split(/[\s,]+/).concat(b),b=Array.from(new Set(b))),sessionStorage.setItem("debugClasses",JSON.stringify(b)),a.add.apply(a,b),console.log("Debug HTML Classes",b)}a(),window.hashbangObserve&&window.hashbangObserve("class",a)}();
/* DEFAULT End */
/* GLOBAL FILE ================================*/
$(document).ready(function() {
// ====== dynamic placeholder START ======
function checkVal() {
$('.dynamic-placeholders input, .dynamic-placeholders textarea').each(function() {
if ( $(this).val() == '' ) {
$(this).removeClass('filled');
}
else {
$(this).addClass('filled');
}
});
}
checkVal();
$('.dynamic-placeholders input, .dynamic-placeholders textarea').on('keyup blur', function() {
if ( $(this).val() == '' ) {
$(this).removeClass('filled');
}
else {
$(this).addClass('filled');
}
$(this).addClass('clicked');
});
$('button[type="reset"]').on('click', function() {
$(this).closest('form').get(0).reset();
checkVal();
});
$('.dynamic-placeholders label span.formRequired').each(function() {
$(this).closest('label').prev().attr('required','required');
});
$('.dynamic-placeholders .form-error .xFormError').each(function() {
$(this).closest('.form-error').prevAll('input').addClass('not-valid');
$(this).closest('.form-error').prevAll('.selectWrapper').addClass('not-valid');
});
// ====== dynamic placeholder END ======
$('a[rel="tooltip"]').tooltip();
$('a[rel="popover"]').popover();
$('#navbar-toggle-products').on('click', function() {
$('#navbar-collapse-menu').removeClass('in').addClass('collapse');
$('#navbar-toggle-menu').addClass('collapsed');
});
$('#navbar-toggle-menu').on('click', function() {
$('#navbar-collapse-products').removeClass('in').addClass('collapse');
$('#navbar-toggle-products').addClass('collapsed');
});
// if no extra content, don't show arrow on top extra content switcher
if ($('#top-switcher-content-extra:empty').length) {$('#top-switcher a').hide();}
// login box
$('#extra-top-nav-link-697').attr({
'id':'btn-login',
'class':'iPop',
'xipopsize':'300px auto',
'ipopclass':'loginbox-ipop'
});
// show login box if error
if ($("#login-box .alert").length) $("#btn-login").trigger('click');
// Force login box to always submit data over HTTPS
$("#login-box form").attr('action', location.href.replace(/^http:/, 'https:'));
// run ajax-loader image on login form submit
$('#login-box form').on('submit', function() {$('#ajax-loader').addClass('loading');});
// sidebar contact us form
$('#F123 input, #F123 select, #F123 textarea').attr('required','required');
$('#F123 .all-errors').length && $.fn.iPop('#F123 .all-errors', 'ipop-all-errors');
$('#F123 .all-errors').hide();
$('#F130 input, #F130 select, #F130 textarea').attr('required','required');
$('#F130 .all-errors .alert').length && $('#exit-survey-request').fadeIn();
$('div#F130').length && $('#exit-survey-request').addClass('exit-survey-request-thankyou').fadeIn();
$('#form-footer-newsletter input, #form-footer-newsletter button').on('click', function() {
$('#exit-survey-request').fadeIn();
$('body').addClass('newsletter-opened-with-link');
});
/* comment popup */
var $cmtCommentsMessagesPopup = $('.cmtMessages').not(':empty').html();
$.fn.iPop($cmtCommentsMessagesPopup, 'loginbox-ipop');
$('#postcmt').on('click', function() {
$('#commentForm').slideDown();
});
// change label of compare checkbox, when more than 1 are checked
$('.btn-compare-selected').hide();
$('.checkbox-compare').on('change', function() {
$('.checkbox-compare').parents().removeClass('compare-active');
if ($('.checkbox-compare:checked').length > 1) {
$('.checkbox-compare:checked').parents().addClass('compare-active');
$('.compare-bar').addClass('with-compare-selected');
$('.btn-compare-selected').css('display','inline-block');
}
else {
$('.btn-compare-selected').css('display','none');
$('.compare-bar').removeClass('with-compare-selected');
}
});
$('.label-checked, a.btn-compare-selected').on('click', function() {
$('input.btn-compare-selected').trigger('click');
$('#ajax-loader').addClass('loading');
})
$('input.btn-compare-selected').on('click', function() {
$('#ajax-loader').addClass('loading');
})
// compare all
$('.btn-compare-all').on('click', function() {
$('.checkbox-compare').attr('checked','checked');
$('input.btn-compare-selected').trigger('click');
$('#ajax-loader').addClass('loading');
});
/* FIX HEIGHT */
$(window).on('resize', function() {
clearTimeout(window.delayedFixHeight);
window.delayedFixHeight = setTimeout(delayedResize, 300);
});
$(window).on("load", delayedResize);
function delayedResize() {
if ($(window).width() > 599) {
$('.footer .row > div').css('height','');
$('.footer .row').fixHeight();
}
else {
$('.footer .row > div').css('height','');
}
}
$('#row-home-boxes i').on("click", function() {
var $block = $(this).closest('.col-home-box');
var pos = $block.prevAll('div').length;
$('.col-home-box').not($block).removeClass('active');
$block.toggleClass('active');
if ($block.is('.active')) {
$('.home-box-content p').slideUp();
$('.home-box-extra').slideUp().eq(pos).slideDown();
} else {
$('.home-box-content p').slideDown();
$('.home-box-extra').slideUp();
}
});
$('#top-switcher a').on('click', function() {
$('#top-switcher-content-extra, .home-slideshow, #main-navbar, #row-header-block').slideToggle();
});
/*if ($.browser.msie && parseInt($.browser.version) < 10) {
$('form').filter(function() {return $(":input[required='required']", this).length;})
.on('submit', function() {
var ret=!$(':input[required="required"]:visible', this).is(function() {
var isEmpty=($(this).val() == '' || $(this).is('.defVal'));
if (isEmpty) $(this).css({'border': '1px solid #E60000'});
else $(this).css({'border': ''});
return isEmpty;
});
// placeholders need this to return the placeholder text into fields
if (!ret) $(this).trigger("submitCancel");
return ret;
});
// replacing placeholders with value for IE9-
$(':input[placeholder]:not([placeholder=""]):not(select)').each(function() {
var $this = $(this);
var formCanceled=false;
var defVal = $this.attr('placeholder');
$this.data('placeholderText', defVal);
if ($this.attr('type') == 'password') { // create fake placehloder's text input
var $pass=$('');
$this.before($pass).hide();
$pass
.val($this.attr('placeholder'))
.attr('class', $this.attr('class'))
.attr('placeholder', $this.attr('placeholder'))
.attr('required', $this.attr('required'))
.attr('style', $this.attr('style'))
.addClass('inputPass defVal')
.show();
$pass
.focus(function() {
$pass.hide();
$this.show().focus();
});
}
if ($this.val() == "") {
$this
.val(defVal)
.addClass('defVal');
}
$this
.focus(function() {
if($this.is('.defVal')) {
$this.val("").removeClass('defVal');
}
})
.blur(function() {
if(!$this.is('.defVal') && $this.val() == "") {
$this.val(defVal).addClass('defVal');
if ($this.is('[type="password"]')) { // Replace password with text field
$this.hide();
$pass.show();
}
}
});
$this.closest('form')
.off('submit.defVal submitCancel.defVal')
.on('submit.defVal', function() {
if (formCanceled) {
formCanceled=false;
return;
}
$('.defVal', this).val('');
})
.on('submitCancel.defVal', function() {
formCanceled=true;
$('.defVal:not(.inputPass)', this).each(function() {
$(this).val($(this).data('placeholderText'));
});
})
;
});
}*/
/* =TEMPORARY FORM */
$('.formRequired').closest('.control-group').find('.controls input').attr('required', 'required');
$('.formRequired').closest('.form-group').find('.form-control').attr('required', 'required');
$('.xform select').addClass('form-control');
$('.xform .checkbox label').removeClass("checkbox");
$('.xform .radio label').removeClass("radio");
/* add class "btn" */
$('input[type="submit"], .readMore a, .slides a, .slides span.current, .slides span.pages').addClass('btn');
/* small */
$('.readMore a').addClass('btn-small');
/* primary */
$('.slides span.current').addClass('btn-primary');
/* disabled */
$('.slides span.current, .slides span.pages').addClass('disabled');
/* make continue button to be primary */
$('.checkoutNextButton').addClass('btn-primary');
/* adapt radio buttons for ecommerce */
$('.shippingOptions label, .selectorLink label, #ecsAccountMode label').addClass('radio');
$('.shippingOptions input.methodRadioSelector, #ecsAccountMode input').each(function() {
var $label = $(this).next();
$(this).prependTo($label);
});
// show 404 popup
if ( $('.ImageSlide404').length ) {
$.fn.iPop('.ImageSlide404');
}
/* adapt error styling */
$('.checkoutError .error')
.addClass('alert alert-block alert-error fade in')
.prepend('');
/* custom */
$('#F3.reloaded').closest('#contactPopup').modal('show');
$('#F4.reloaded').closest('#sendToFriendPopup').modal('show');
$('#F5.reloaded').closest('#newsletterPopup').modal('show');
$('.orderList').addClass('table table-striped');
$('.content button').addClass('btn');
$('.navbar-collapse > ul > li ')
.mouseenter(function() {
var windowWidth = parseInt($(window).width());
if (windowWidth > 1025) {
$(this).addClass('open');
}
}).mouseleave(function() {
var windowWidth = parseInt($(window).width());
if (windowWidth > 1025) {
$(this).removeClass('open');
}
});
/*if (sysCommon.getCookie('visited') < 2) {
var leavingSoonMessage = 'Why are you leaving so soon?
Please help us understand why you decided to leave us so quickly.';
$('.exit-message h3').html('' + leavingSoonMessage + '');
$("#exit-survey-message").html('
' + leavingSoonMessage + '
'); }*/ $('#ice-blast-banner i').on('click', function() { $(this).closest('section').addClass('closed'); }); $('#search-trigger, #top-search-close, #top-search-overlay').on('click', function() { $('body').toggleClass('search-active'); }); $(document).keyup(function(e) {if (e.keyCode == 27) { $('body').removeClass('search-active'); }}); }); // cancel ajax-loader animation on ESC click $(document).keyup(function(e) {if (e.keyCode == 27) { $('#ajax-loader').removeClass('loading'); }}); $(window).load(function() { /* accordion for item page */ var winWidth = parseInt($(window).width()); if ( winWidth < 768) { $('.ui-widget-content > h2').click(function(e) { var $header = $(this); var $openHeaders = $header.siblings('.accord-active'); var $div = $header.next('div'); var $openBlocks = $div.siblings('.accord-open'); var $openBlocksBefore = $div.prevAll('.accord-open'); // Animated version var scrollTop = $(document).scrollTop(); var offset=0; $openHeaders.removeClass('accord-active'); $openBlocksBefore .each(function() {offset+=$(this).outerHeight();}); $openBlocks .removeClass('accord-open') .slideUp(); var destinationTop=$header.offset().top - offset; // where would the header end up? if (destinationTop < scrollTop) { // Header off the screen $('html, body').animate({scrollTop: scrollTop - (scrollTop - destinationTop)}); // Align with top } $header .toggleClass('accord-active'); $div [$header.is('.accord-active') ? 'addClass' : 'removeClass']('accord-open') [$header.is('.accord-active') ? 'slideDown' : 'slideUp']() ; }); } // contact form $('#open-contact-form, .open-contact-form').on('click', function() { $('body').addClass('popup-form-active'); return false; }); $('#contact-popup-close').on('click', function() { $('body').removeClass('popup-form-active'); }); $('#contact-popup-overlay').on('click', function() { $('body').removeClass('popup-form-active'); }); if ( $('#contact-popup .xFormAllError').length || $('div#C9').length ) { $('body').addClass('popup-form-active'); } $(document).keyup(function(e) { if (e.keyCode === 27) { $('body').removeClass('popup-form-active'); } }); }); // cancel ajax-loader animation on ESC click $(document).keyup(function(d) { if (d.keyCode == 27) { $('#exit-survey-request').fadeOut(); } }); $(function(){ $('.navbar').data('size','big'); }); $(window).scroll(function(){ if($(document).scrollTop() > 114) { if($('.navbar').data('size') == 'big') { $('.navbar').data('size','small'); $('body').addClass('navbar-small'); $('.navbar').stop().animate({ // height:'60px' },0); } } else { if($('.navbar').data('size') == 'small') { $('body').removeClass('navbar-small'); $('.navbar').data('size','big'); $('.navbar').stop().animate({ //height:'100px' },0); } } }); /* LOCAL FILE ================================ */