// Run when the page ready (before images and other resource)
jQuery(function($) {MultiCurrencies.init();ActiveOrderPopup.init();WishList.init();});var MultiCurrencies = function() {var that = {nameSpace: 'multi-currencies',isActive: false,isChangedCurrency: false};that.init = function() {$(document).on('s123.page.ready.multi_currencies', function( event ) {that.settings = tryParseJSON($('.s123-multi-currencies').val());if ( !that.settings ) return;if ( !that.settings.active ) return;that.activeCurrency = tryParseJSON($.cookie($(websiteID).val()+'-'+that.nameSpace));that.defaultCurrency = that.settings.defaultCurrency;that.currencies = that.settings.currencies;that.setActiveCurrency(that.activeCurrency.currency);that.$menuIcon = $('[data-toggle="multiCurrenciesPopup"]');that.isActive = true;$(document).off('build_popup.open.multi_currencies').on('build_popup.open.multi_currencies', function( event ) {handleMenuIcon($('#popupFloatDivMenu [data-toggle="multiCurrenciesPopup"]'),true);});handleMenuIcon(that.$menuIcon,false);that.priceOnlyType.backup();$(document).off('pageLoaded.multi_currencies').on('pageLoaded.multi_currencies', function( event ) {if ( $.isNumeric(S123.QueryString.clientZone) ) {$('.client-zone-orders-table [data-rel="multiCurrency"]').removeAttr('data-rel');}
if ( isDefaultCurrency() && that.isChangedCurrency ) {that.reset();} else if ( isDefaultCurrency() && !that.isChangedCurrency  ) {$('[data-rel="multiCurrency"]').css({visibility: 'visible'});} else {updateAllPrices();}});if ( $.isNumeric(S123.QueryString.clientZone) ) return;$(document).off('s123.pjax.complete.multi_currencies').on('s123.pjax.complete.multi_currencies', function() {that.$menuIcon = $('[data-toggle="multiCurrenciesPopup"]');handleMenuIcon(that.$menuIcon,false);that.priceOnlyType.backup();$(document).trigger('pageLoaded.multi_currencies');});$(document).off('multi_currencies_price_update').on('multi_currencies_price_update', function( event, settings ) {$.each(settings, function( index, setting ) {if ( !isDefaultCurrency() ) {updatePrice(setting.el,setting.newPrice,true);} else {setting.el.find('[data-rel="multiCurrency"]').css({visibility: 'visible'});}});});$(document).trigger('pageLoaded.multi_currencies');modulesExtraActions();$(document).off('multi_currency_update').on('multi_currency_update', function() {buildPopup_CloseAction('popupFloatDivMenu');});});};that.setActiveCurrency = function( currency ) {that.activeCurrency = that.currencies[currency];if ( !that.activeCurrency ) {that.activeCurrency = that.defaultCurrency;}
$.cookie($(websiteID).val()+'-'+that.nameSpace,JSON.stringify(that.activeCurrency),{ expires: 365, path: '/' });};that.reset = function( ) {if ( !that.isActive ) return;if ( getOrderScreen() > 1 ) return;if ( window.czIsLoggedIn ) return;$('[data-rel="multiCurrency"]').each(function( index, el ) {var originalPrice = $(this).find('[data-type="price"]').data(that.nameSpace + '-price');var $price = $(showPrice(that.defaultCurrency.data,originalPrice));$(this).replaceWith($price);$price.css({visibility: 'visible'});backUpPrice($price.find('[data-type="price"]'),$price.find('[data-type="price"]').html(),false);});$('[data-multi-currency-symbol-only="true"]').html(that.defaultCurrency.data.symbol);that.priceOnlyType.update();that.isChangedCurrency = false;};that.geConvertedPrice = function( price ) {if ( !that.isActive ) return price;if ( !$.isNumeric(price) ) return price;if ( isDefaultCurrency() ) return price;if ( getOrderScreen() > 1 ) return price;var result = parseFloat(price) * parseFloat(that.activeCurrency.rate);return result > 0 ? result.toFixed(2) : result;};that.getOriginalPrice = function( price ) {if ( !that.isActive ) return price;if ( !$.isNumeric(price) ) return price;return parseFloat(price) / parseFloat(that.activeCurrency.rate);};that.getActiveCurrency = function() {return that.activeCurrency.data;};that.getMobileIconHtml = function() {var $clone = that.$menuIcon.clone();$clone.attr('data-is-mobile',true);return $clone.prop('outerHTML');};function handleMenuIcon( $menuIcon, isMobileMenu ) {setMenuIconCurrency($menuIcon);var html = '';var maxHeight = 160;html += '<div class="currency-menu-container fancy-scrollbar" style="max-height:' + maxHeight + 'px;">';html += '<div class="currency-list">';html += '<div class="currency-list-item" data-value="' + S123.escapeHtml(that.defaultCurrency.currency) + '">';html += '<a href="#">';html += '<span>' + that.defaultCurrency.currency + '</span>';html += '<span>-</span>';html += '<span>' + that.defaultCurrency.data.symbol + '</span>';html += '</a>';html += '</div>';$.each(that.currencies, function( currencyCode, currency ) {html += '<div class="currency-list-item" data-value="' + S123.escapeHtml(currencyCode) + '">';html += '<a href="#">';html += '<span>' + currencyCode + '</span>';html += '<span>-</span>';html += '<span>' + currency.data.symbol + '</span>';html += '</a>';html += '</div>';});html += '</div>';html += '</div>';$html = $(html);setActiveCurrencyListItem($html);$html.find('.currency-list').on('click.multi_currencies', 'a', function( event ) {event.preventDefault();if ( !isDefaultCurrency() ) {that.isChangedCurrency = true;} else {that.isChangedCurrency = false;}
that.setActiveCurrency($(this).parent().data('value'));$(document).trigger('pageLoaded.multi_currencies');modulesExtraActions();setMenuIconCurrency($menuIcon);$menuIcon.popover('hide');setActiveCurrencyListItem($html);$(document).trigger('multi_currency_update',[that.activeCurrency]);});S123.popOver.init({$el: $menuIcon,elSelector: '.multi-currencies-controller',namespace: 'multi_currency_menu_icon',oneTimeUsage: false,popOverSettings: {selector: 'multi-currency',content: $html,html: true,trigger: 'manual',template: '<div class="popover multi-currency" role="tooltip"><div class="arrow"></div><div data-menu-dismiss="popover"><i class="fa fa-times" aria-hidden="true"></i></div><div class="popover-content"></div></div>',placementCallBack: function() {if ( isMobileMenu ) return 'top';if ( getWebsiteMenuPosition() === 'top' || getWebsiteMenuPosition() === 'bottom' ) {if ( ($('nav#mainNav').offset().top - $(window).scrollTop()) > maxHeight ) {return 'top';} else {return 'bottom';}} else {if ( $('html').attr('dir') === 'rtl' ) {return 'left';} else {return 'right';}}}}});$(document).on('s123_pop_over_wrapper.show.multi_currency_menu_icon', function() {$menuIcon.addClass('active');})
.on('s123_pop_over_wrapper.hide.multi_currency_menu_icon', function() {$menuIcon.removeClass('active');});$menuIcon.off('click.multi_currencies').on('click.multi_currencies', function() {if ( $(this).hasClass('active') ) {$(this).popover('hide');} else {$(this).popover('show');}});}
function setActiveCurrencyListItem( $currencyList ) {$currencyList.find('.currency-list-item').removeClass('active');$currencyList.find('.currency-list-item[data-value="'+that.activeCurrency.currency+'"]').addClass('active');}
function setMenuIconCurrency( $menuIcon ) {var html = '';if ( $menuIcon.data('is-mobile') ) {html += '<span>' + that.activeCurrency.currency + '</span>';} else {html += '<span>' + that.activeCurrency.currency + '</span>';html += '<span class="m-c-symbol">' + that.activeCurrency.data.symbol + '</span>';if ( getWebsiteMenuPosition() === 'top' || getWebsiteMenuPosition() === 'bottom' ) {html += S123.s123IconToSvg.getHtml('caret-down','mc-icon','');} else {if ( $('html').attr('dir') === 'rtl' ) {html += S123.s123IconToSvg.getHtml('caret-left','mc-icon','');} else {html += S123.s123IconToSvg.getHtml('caret-right','mc-icon','');}}}
$menuIcon.html(html);}
function updateAllPrices() {if ( isDefaultCurrency() && that.isChangedCurrency ) {that.reset();} else if ( isDefaultCurrency() && !that.isChangedCurrency  ) {$('[data-rel="multiCurrency"]').css({visibility: 'visible'});} else {$('[data-rel="multiCurrency"]').each(function( index, el ) {updatePrice($(this),$(this).find('[data-type="price"]').html(),false);});}
$('[data-multi-currency-symbol-only="true"]').html(that.activeCurrency.data.symbol);that.priceOnlyType.update();}
function updatePrice( $el, newPrice, force ) {backUpPrice($el.find('[data-type="price"]'),newPrice,force);if ( isReplaceDisabled() ) {$el.css({visibility: 'visible'});} else {var $price = $el.find('[data-type="price"]');var priceAsString = $price.data(that.nameSpace + '-price');var price = parseFloat(priceAsString);var $newEl = $(showPrice(that.activeCurrency.data,(price * parseFloat(that.activeCurrency.rate)).toFixed(2)));backUpPrice($newEl.find('[data-type="price"]'),priceAsString,false);$price.parent().replaceWith($newEl);$newEl.css({visibility: 'visible'});}}
function backUpPrice( $el, newPrice, force ) {if ( !that.isActive ) return;if ( !$el.data(that.nameSpace + '-price') || force ) {$el.data(that.nameSpace + '-price',newPrice);}}
function modulesExtraActions() {$(document).off('donate_price_update.multi_currencies giftCard_price_update.multi_currencies').on('donate_price_update.multi_currencies giftCard_price_update.multi_currencies', function( event, $el ) {if ( isDefaultCurrency() ) return;var price = $el.val();price = parseFloat(price) * parseFloat(that.activeCurrency.rate);$el.val(price.toFixed(2));});}
function isDefaultCurrency() {return that.defaultCurrency.currency === that.activeCurrency.currency;}
function isReplaceDisabled() {if ( getOrderScreen() > 1 ) {return true;} else if ( window.czIsLoggedIn ) {return true;} else {return false;}
return false;}
function getOrderScreen() {var path = window.location.pathname.split("/");var orderScreen = path[path.length - 2];if ( orderScreen == '-order1' ) return 1;if ( orderScreen == '-order2' ) return 2;if ( orderScreen == '-order3' ) return 3;return 0;}
that.priceOnlyType = {backup: function() {$('[data-multi-currency-price-only="true"]').each(function( index, el ) {if ( $.isNumeric($(this).data(that.nameSpace + '-price')) ) return;$(this).data(that.nameSpace + '-price',$(this).html());});},update: function() {$('[data-multi-currency-price-only="true"]').each(function( index, el ) {var originalPrice = $(this).data(that.nameSpace + '-price');var newPrice = parseFloat(originalPrice) * parseFloat(that.activeCurrency.rate);if ( newPrice % 1 === 0 ) {$(this).html(newPrice);} else {$(this).html(newPrice.toFixed(2));}});}};return that;}();var ActiveOrderPopup = function() {AO = {};AO.init = function() {$( document ).on( 's123.page.ready.activeOrderPopup', function( event ) {AO.initializeAddToCart();AO.productCallToAction.init();AO.initializeShowCart();});};AO.initializeAddToCart = function() {$('.orderButtonPopup').off('click').on('click', function( event ) {var $this = $(this);if ( $this.hasClass('a-o-out-of-stock') ) {bootbox.dialog({title: translations.activeOrderPopup.messageTitle,message: translations.activeOrderPopup.messageBody,buttons: {cancel: {label: translations.Ok,className: 'btn btn-primary'}}});return;}
if ( $this.data('disable-atc-validator') != '1' ) {if ( !AO.atcValidator() ) return;}
$this.attr('disabled','');S123.ButtonLoading.start($this);var multiProducts = $this.data('multi-products') ? $this.data('multi-products') : JSON.stringify([$this.data('unique-page')]);var formData = new FormData();formData.append('w',$('#w').val());formData.append('websiteID',$('#websiteID').val());formData.append('moduleID',$this.data('module'));if ( $this.data('product-page') ) {if ( $('#productOptions').prop('type') == 'textarea' ) {formData.append('productOptions',$('#productOptions').length !== 0 ? $('#productOptions').html() : '');} else {formData.append('productOptions',$('#productOptions').length !== 0 ? $('#productOptions').val() : '');}
formData.append('customText',$('#customText').length !== 0 ? $('#customText').html() : '');}
formData.append('amount',$this.data('quantity-amount') ? $this.data('quantity-amount') : '1');formData.append('multiProducts',multiProducts);formData.append('viewModeTXT',viewModeTXT);$('input[type="file"]').each(function( index, upload ) {if ( upload.files.length > 0 ) {formData.append(upload.id,upload.files[0]);}});if ( $('.product-subscription-pricing').length !== 0 ) {let checkedPricing = $('.product-subscription-pricing').find('input[type="radio"]:checked');if ( checkedPricing.length == 0 ) {$('.product-subscription-error').remove();$('.product-subscription-title').append(`<div class="product-subscription-error">${translations.productSubscriptionError}</div>`);S123.ButtonLoading.stop($this);$this.removeAttr('disabled');return;}
formData.append('subscriptionTicketID',checkedPricing.val());formData.append('activeProductSubscription',true);}
$.ajax({type: "POST",url: "/versions/2/wizard/orders/front/addToCart.php",data: formData,cache: false,contentType: false,processData: false,success: function( response ) {response = tryParseJSON(response);showCart_GetContent('/versions/2/wizard/orders/front/showCart.php?w='+$('#w').val()+'&websiteID='+$('#websiteID').val()+'&tranW='+websiteLanguageCountryFullCode+'&moduleID='+$this.data('module')+'&viewModeTXT='+viewModeTXT,true);CartCounter.updateCartIcon();S123.ButtonLoading.stop($this);$this.removeAttr('disabled');topWindow.eCommerce_cart_lastAdded = response.updatedCartIds ? response.updatedCartIds : false;}});});};AO.initializeShowCart = function() {$('.orderOpenCart').off('click').on('click',function( event ) {AO.showCart();});};AO.showCart = function() {showCart_GetContent('/versions/2/wizard/orders/front/showCart.php?w='+$('#w').val()+'&websiteID='+$('#websiteID').val()+'&moduleTypeNUM=37&tranW='+websiteLanguageCountryFullCode+'&cartButton=1',true);};AO.atcValidator = function() {var $ct = $("#product-custom-text");var $po = $('.product-options');if ( $ct.length !== 0 && $ct.data('mandatory') ) {var $ct_fieldTitle = $('#ct_fieldTitle');if ( $ct_fieldTitle.val().length === 0 ) {$ct_fieldTitle.popover({container: 'body',content: translations.productvalidatorPopover,trigger: 'manual',template: '<div class="popover product-validator-popover" role="tooltip"><div class="arrow"></div><div class="popover-content"></div></div>',placement: function(popover, input) {return isMobileDevice.any() ? 'auto' : ($('html').attr('dir') === 'rtl' ? 'left' : 'right');}});$ct_fieldTitle.popover('show').one('input', function(e) {$(this).popover('hide');});$ct_fieldTitle.focus();return false;}}
if ( $po.length !== 0 ) {var $options = $po.find('.p-o-container[data-mandatory="1"]');var addToCart = true;var $popoverContainer;var $firstErrorOption;var $errorsOptionsList = [];$.each($options, function( index, option ) {var $option = $(option);var addErrorMsg = false;switch( $option.data('type') ) {case 'color':case 'radio':case 'checkbox':case 'size':case 'list':if ( $option.find('[id*=poi].selected').length === 0 ) {addToCart = false;addErrorMsg = true;}
$popoverContainer = $(option);break;default:if ( $option.find('.fake-input').length > 0 ) {var id = $option.find('.fake-input').data('related-id');if ( $option.find('[data-id="'+id+'"]').val().length === 0 ) {addToCart = false;addErrorMsg = true;$popoverContainer = $(option).parent();}} else {if ( $option.find('.form-control').val().length === 0 ) {addToCart = false;addErrorMsg = true;$popoverContainer = $(option).parent();}}}
if ( addErrorMsg ) {$errorsOptionsList.push($option);var $popover = $option.find('.p-o-popover-box');if ( $popover.length === 0  ) $popover = $option;$popover.popover({container: 'body',content: translations.productvalidatorPopover,trigger: 'manual',template: '<div class="popover product-validator-popover" role="tooltip"><div class="arrow"></div><div class="popover-content"></div></div>',placement: function(popover, input) {return isMobileDevice.any() ? 'auto' : ($('html').attr('dir') === 'rtl' ? 'right' : 'left');}});}});if ( $errorsOptionsList.length !== 0 ) {var offset = $('#mainNav').outerHeight();if ( !$.isNumeric(offset) ) offset = 0;if ( !elementInViewport($errorsOptionsList[0].get(0)) ) {$('html, body').scrollTop($errorsOptionsList[0].offset().top - offset);}
$.each($errorsOptionsList, function( index, $option ) {var $popover = $option.find('.p-o-popover-box');if ( $popover.length === 0  ) $popover = $option;$popover.popover('show');});$po.off('po.update').on('po.update', function( event ) {$('.product-validator-popover').popover('hide');});}
return addToCart;}
return true;};AO.productCallToAction = function() {var _ = {};_.init = function( settings ) {_.$controllers = $('.orderButtonPopup[data-p-c-t-a]');if ( _.$controllers.length == 0 ) return;_.$controllers.each(function() {var $this = $(this);var callToAction = $this.data('p-c-t-a');if ( callToAction.type == 'externalLink' && callToAction.externalLink.length > 0 ) {$this.off('click').on('click', function( event ) {window.open(callToAction.externalLink,'_blank');});} else if ( callToAction.type == 'contactUs' ) {$this.off('click').on('click', function( event ) {buildPopup('popupFloatDivSearch','',generateContactForm(callToAction),'',true,true,true,'right','')
S123.globalContactEmail.submitHandler();fillDescription(callToAction);});}});};function generateContactForm( callToAction ) {var html = '';html += '<div class="global-contact-email-container">';html += '<div class="g-c-email-info-box">';html += '<h3>'+translations.productCallToAction.title+'</h3>';html += '<p>'+translations.productCallToAction.infoBox+'</p>';html += '</div>';html += '<form class="g-c-email-form">';html += '<div class="row">';html += '<div class="col-xs-12">';html += '<div class="form-group">';html += '<label for="emailForm_fullName" class="white">'+translations.productCallToAction.fullName+'</label>';html += '<input type="text" name="emailForm_fullName" placeholder="'+translations.productCallToAction.fullName+'" class="form-control" required data-msg-required="'+translations.jqueryValidMsgRequire+'">';html += '</div>';html += '</div>';html += '<div class="col-xs-12">';html += '<div class="form-group">';html += '<label for="emailForm_email" class="white">'+translations.emailAddress+'</label>';html += '<input type="text" name="emailForm_email" placeholder="'+translations.emailAddress+'" class="form-control" required data-msg-required="'+translations.jqueryValidMsgRequire+'" data-rule-email="true" data-msg-email="'+translations.jqueryValidMsgEmail+'">';html += '</div>';html += '</div>';html += '<div class="col-xs-12">';html += '<div class="form-group">';html += '<label for="emailForm_phone" class="white">'+translations.productCallToAction.phone+'</label>';html += '<input type="text" name="emailForm_phone" placeholder="'+translations.productCallToAction.phone+'" class="form-control">';html += '</div>';html += '</div>';html += '</div>';html += '<div class="row">';html += '<div class="col-xs-12">';html += '<button type="submit" class="btn btn-primary btn-block">'+translations.send+'</button>';html += '<input type="hidden" name="websiteID" value="'+$('#websiteID').val()+'">';html += '<input type="hidden" name="w" value="'+$('#w').val()+'">';html += '<input type="hidden" name="isAddToCartBtn" value="1">';html += '<input type="hidden" name="recaptchaToken" value="">';html += '<textarea class="form-control hidden" name="emailForm_description"></textarea>';html += '</div>';html += '</div>';html += '</form>';html +='<div class="g-c-email-message-sent-box">';html += '<div class="row">';html += '<div class="col-sm-6 col-xs-12 col-md-offset-3">';html += '<h3 class="g-c-email-message-content">'+translations.productCallToAction.thankYouMessage+'</h3>';html += '</div>';html += '</div>';html += '<div class="row">';html += '<div class="col-sm-6 col-xs-12 col-md-offset-3">';html += '<button type="button" class="btn btn-primary close-order-thank-you">'+translations.productCallToAction.thankYouCloseBtn+'</button>';html += '</div>';html += '</div>';html += '</div>';html += '</div>';return html;}
function fillDescription( callToAction ) {var pageURL = window.location.protocol+'//'+domain+callToAction.pageURL;
var html = '';html += '<br>';html += '<strong>'+translations.productCallToAction.productName+'<strong> ';html += '<a href="'+pageURL+'" target="_blank">'+callToAction.title+'</a>';$('#popupFloatDivSearch [name="emailForm_description"]').val(html);}
return _;}();return AO;}();var WishList = function() {var WL = {};WL.init = function( settings ) {$( document ).on( 's123.page.ready.wish_list', function( event ) {WL.websiteID = $('#websiteID').val();WL.$menuButton = $('.wishListActionButton');if ( WL.$menuButton.length === 0 ) return;WL.eventRecurring();WL.initilizeMenuButton();WL.initializeLayoutButtons();WL.initializeDataPageButtons();});};WL.markUnMarkIcons = function() {var $container = $('.s123-module-eCommerce');var $items = $container.find('.product-data-obj');var $icons = $items.find('.wish-list-btn');WL.items = tryParseJSON($.cookie(WL.websiteID+'-wishList'));if ( !WL.items || $container.length === 0 ) return;$icons.removeClass('wl-active');$.each(WL.items, function( index, item ) {$items.filter('.product-data-obj[data-unique-id="'+item.uniqueID+'"]').find('.wish-list-btn').addClass('wl-active');});if ( $container.hasClass('s123-page-data-eCommerce') ) {WL.setToolTip($container);}};WL.setToolTip = function( $container ) {var $wishListBtn = $container.find('.wish-list-btn');$wishListBtn.attr('data-original-title',$wishListBtn.data('add-tooltip'));$wishListBtn.filter('.wl-active').attr('data-original-title',$wishListBtn.data('remove-tooltip'));$wishListBtn.tooltip({container: 'body',placement: 'auto'});};WL.eventRecurring = function() {WL.markUnMarkIcons();WL.updateCounterIcon();};WL.refresh = function() {WL.eventRecurring();};WL.initilizeMenuButton = function() {if ( WL.$menuButton.length === 0 ) return;WL.$menuButton.off('click').on('click',function( event ) {var $this = $(this);showCart_GetContent('/versions/2/wizard/orders/front/showCart.php?w='+$('#w').val()+'&websiteID='+$('#websiteID').val()+'&moduleTypeNUM=112&tranW='+websiteLanguageCountryFullCode+'&cartButton=1&wishList=true',true);});};WL.initializeLayoutButtons = function() {var $container = $('.s123-module-eCommerce:not(.s123-page-data-eCommerce)');if ( $container.length === 0 ) return;$container.find('.wish-list-btn').off('click.wishList').on('click.wishList',function( event ) {event.stopPropagation();var $this = $(this);var $wishListItem = $this.closest('.product-data-obj');if ( $this.hasClass('disabled') ) return false;if ( $this.hasClass('wl-active') ) {WL.removeItem($this,$wishListItem.data('module'),$wishListItem.data('module-type-num'),$wishListItem.data('unique-id'));} else {WL.addItem($this,$wishListItem.data('module'),$wishListItem.data('unique-id'));}});};WL.initializeDataPageButtons = function() {var $container = $('.s123-module-eCommerce.s123-page-data-eCommerce');if ( $container.length === 0 ) return;$container.find('.wish-list-btn').off('click.wishList').on('click.wishList', function( event ) {var $this = $(this);var $wishListItem = $this.closest('.product-data-obj');if ( $this.hasClass('disabled') ) return false;if ( $this.hasClass('wl-active') ) {WL.removeItem($this,$wishListItem.data('module'),$wishListItem.data('module-type-num'),$wishListItem.data('unique-id'));} else {WL.addItem($this,$wishListItem.data('module'),$wishListItem.data('unique-id'));}});};WL.addItem = function( $item , moduleID, uniqueID ) {$item.addClass('disabled');$.ajax({type: "POST",url: "/versions/2/wizard/orders/front/addToCart.php",data:  {w: $('#w').val(),websiteID: WL.websiteID,moduleID: moduleID,wishList: true,multiProducts: JSON.stringify(Array(uniqueID)),viewModeTXT: viewModeTXT,},success: function( response ) {response = tryParseJSON(response);showCart_GetContent('/versions/2/wizard/orders/front/showCart.php?w='+$('#w').val()+'&websiteID='+$('#websiteID').val()+'&tranW='+websiteLanguageCountryFullCode+'&moduleID='+moduleID+'&wishList=true',true);WishList.eventRecurring();$item.removeClass('disabled');topWindow.eCommerce_cart_lastAdded = response.updatedCartIds ? response.updatedCartIds : false;}});};WL.removeItem = function( $item, moduleID, moduleTypeNUM, uniqueID ) {$item.addClass('disabled');$.ajax({type: "POST",url: "/versions/2/wizard/orders/front/removeCartItem.php",data: {w: $('#w').val(),websiteID: WL.websiteID,moduleID: moduleID,id: WL.items[uniqueID].id,uniqueID: uniqueID,wishList: true,cartType: moduleTypeNUM,tranW: websiteLanguageCountryFullCode},success: function( response ) {var response = JSON.parse(response);if ( !response.success ) return;WishList.eventRecurring();$item.removeClass('disabled');topWindow.eCommerce_cart_lastAdded = response.updatedCartIds ? response.updatedCartIds : false;}});};WL.updateCounterIcon = function() {var $headerWishListWrapper = $('.header-wish-list');if ( $headerWishListWrapper.length === 0 ) return;var itemsNumber = WL.items ? Object.keys(WL.items).length : 0 ;if ( parseInt(itemsNumber) === 0 ) {if ( !$headerWishListWrapper.hasClass('show-static') ) {$headerWishListWrapper.hide();ResetMoreButton();}
$headerWishListWrapper.find('.count').hide();} else {if ( !$headerWishListWrapper.hasClass('show-static') ) {$headerWishListWrapper.show();ResetMoreButton();}
$headerWishListWrapper.find('.count').html(itemsNumber).css({ display: 'flex' });}};return WL;}();var ShowCartMobileHandler = function() {var _ = {};_.step1 = function( settings ) {$(document).one('buildSmallPopup.open',function() {$('body').addClass('popupWinScroll');});$(document).one('buildSmallPopup.close',function() {$('body').removeClass('popupWinScroll');if ( window.visualViewport ) {$(window.visualViewport).off('resize.cartMobile scroll.cartMobile');}
$(window).off('resize.cartMobile');});};_.step2 = function() {if ( !isMobileDevice.any() ) return;const updateQuickCartHeight = () => {const quickCart = $('.quickCart');if ( !quickCart.length ) return;const visibleHeight = window.visualViewport?.height || window.innerHeight;quickCart.height(visibleHeight);};const handleViewportChange = () => {clearTimeout(window.updateQuickCartTimeout);window.updateQuickCartTimeout = setTimeout(updateQuickCartHeight,100);};if ( window.visualViewport ) {$(window.visualViewport).on('resize.cartMobile scroll.cartMobile',handleViewportChange);}
$(window).on('resize.cartMobile',handleViewportChange);updateQuickCartHeight();};return _;}();function showCart_GetContent( url, bsp ) {var window_object = S123.isWebsiteInSlidingWindow ? parent : window;var b_s_p = window_object.buildSmallPopup;ShowCartMobileHandler.step1();$.ajax({type: "GET",url: url,success: function( response ) {if ( bsp ) {b_s_p('popupCart',translations.cart,response,'',true,false,true,'');} else {$('#popupCart .content').html(response);}
showCart(window_object);}});}
function showCart( current_window ) {var $cartOrderPage = current_window.$('#popupCart').find('.content');init();function init() {eventRecurring();if ( $.isArray(topWindow.eCommerce_cart_lastAdded) ) {$.each(topWindow.eCommerce_cart_lastAdded, function( index, cart_id ) {$cartOrderPage.find('[data-cart-id="'+cart_id+'"]').addClass('last-added-highlight');});topWindow.eCommerce_cart_lastAdded = false;}}
function eventRecurring() {current_window.CartCounter.updateCartIcon();var aop_settings = tryParseJSON($cartOrderPage.find('#aopSettings').val());$cartOrderPage.height('auto');$cartOrderPage.find('.empty-cart-btn').off('click').on('click','a.empty-cart', function() {$.ajax({type: "GET",url: $(this).data('href')+'&wishList='+aop_settings.wishList,success: function( data ) {$cartOrderPage.closest('#popupCart .content').html(data);eventRecurring();showCart_UpdateCartWasChanged();}});});$cartOrderPage.find('.change-cart').on('click', function() {$.ajax({type: "GET",url: $(this).data('href'),success: function( data ) {$cartOrderPage.closest('#popupCart .content').html(data);eventRecurring();}});});$cartOrderPage.find('.continue-shopping-btn, .closeIcon').click(function() {current_window.buildSmallPopup_CloseAction('popupCart');});$cartOrderPage.find('.edit-quantity').on('click',function() {var $this = $(this);$cartOrderPage.find('#quantity_box_'+$this.data('product-id')+'').toggle();});$cartOrderPage.find('.edit-quantity-minus').on('click',function() {var $this = $(this);var $box = $cartOrderPage.find('#quantity_box_'+$this.data('product-id')+'');$box.find('.quantity_field').val(parseInt($box.find('.quantity_field').val())-1).trigger('input');updateAutomaticCouponMsg();});$cartOrderPage.find('.edit-quantity-plus').on('click',function() {var $this = $(this);var $box = $cartOrderPage.find('#quantity_box_'+$this.data('product-id')+'');$box.find('.quantity_field').val(parseInt($box.find('.quantity_field').val())+1).trigger('input');updateAutomaticCouponMsg();});function updateAutomaticCouponMsg() {$.ajax({type: 'POST',url: '/versions/' + $('#versionNUM').val() + '/wizard/orders/front/getAutomaticCouponMsg.php',data: {w: $('#w').val(),websiteID: $(websiteID).val(),total: $('#cartTotalPrice span[data-type="price"]').html(),cartType: $('.cartBottom').data('cart-type'),couponApplyTo: 'cartOrder',},success: function( response ) {$('.cart-automatic-coupon-container').html('').append(response);}});}
$cartOrderPage.find('.quantity_field').on('input', function() {var $input = $(this);if ( $input.val().length === 0 ) $input.val(1);if ( !$.isNumeric($input.val()) ) $input.val($input.val().replace(/[^0-9]/g,''));if ( $input.val() <= 0 ) $input.val(1);if ( parseInt($input.val()) > parseInt($input.data('inventory-limit')) ) {$input.val($input.data('inventory-limit'));showCart_QuantityPopover($cartOrderPage.find('[data-cart-id="'+$input.data('product-id')+'"]'),translations.productQuntityLimit.replace('{{units_limitation}}',$input.data('inventory-limit')));} else if ( parseInt($input.val()) > parseInt($input.data('maximum-purchase')) ) {$input.val($input.data('maximum-purchase'));showCart_QuantityPopover($cartOrderPage.find('[data-cart-id="'+$input.data('product-id')+'"]'),translations.productQuntityLimit.replace('{{units_limitation}}',$input.data('maximum-purchase')));} else if ( parseInt($input.val()) < parseInt($input.data('minimum-purchase')) ) {$input.val($input.data('minimum-purchase'));showCart_QuantityPopover($cartOrderPage.find('[data-cart-id="'+$input.data('product-id')+'"]'),translations.productQuntityLimitMin.replace('{{units_limitation}}',$input.data('minimum-purchase')));}
showCart_UpdateQuantityTotalPrice();clearTimeout(window.quantityInputFinished);window.quantityInputFinished = setTimeout( function() {$cartOrderPage.find('#q_u_loading_'+$input.data('product-id')).show();$.ajax({type: 'POST',url: '/versions/' + aop_settings.versionNUM + '/wizard/orders/front/quantityUpdate.php',data: {w: aop_settings.w,websiteID: aop_settings.websiteID,tranW: aop_settings.tranW,moduleID: aop_settings.moduleID,cartType: aop_settings.cartType,id: $input.data('product-id'),newQuantity: $input.val()},success: function( response ) {var response = JSON.parse(response);if ( response.success ) {$cartOrderPage.find('#q_u_loading_'+$input.data('product-id')).hide();current_window.CartCounter.updateCartIcon();showCart_UpdateCartWasChanged();}}});},300);});$cartOrderPage.find('.remove-product-btn').off('click').on('click', function() {var $this = $(this);$this.parent().children().hide();$this.parent().append('<div class="loading-primary r-p-loading" class="text-center">'+S123.s123IconToSvg.getHtml('spinner','fa-spin','')+'</div>');$.ajax({type: 'POST',url: '/versions/' + aop_settings.versionNUM + '/wizard/orders/front/removeCartItem.php',data: {id: $this.data('product-id'),uniqueID: $this.closest('.item').get(0).id,w: aop_settings.w,websiteID: aop_settings.websiteID,tranW: aop_settings.tranW,moduleID: aop_settings.moduleID,cartType: aop_settings.cartType,wishList: aop_settings.wishList},success: function( response ) {var response = tryParseJSON(response);if ( response.success ) {if ( $this.closest('.item').siblings().not('.mix-modules-products-buttons').length == 0 ) {$cartOrderPage.find('.cart-list-container').hide();$cartOrderPage.find('.empty-cart-container').show();}
$this.closest('.item').fadeOut(300,function() {$this.closest('.item').remove();showCart_UpdateQuantityTotalPrice();if ( aop_settings.wishList ) {WishList.markUnMarkIcons();WishList.updateCounterIcon();}
showCart_UpdateCartWasChanged();updateAutomaticCouponMsg();});} else {$cartOrderPage.find('.r-p-loading').remove();$this.show();showCart_UpdateQuantityTotalPrice();}
current_window.CartCounter.updateCartIcon();},error: function(data) {$cartOrderPage.find('.r-p-loading').remove();$this.show();}});});$cartOrderPage.find('#couponWebsite').validate({errorElement: 'div',errorClass: 'help-block',focusInvalid: true,ignore: ":hidden",highlight: function (e) {$(e).closest('.form-group').removeClass('has-info').addClass('has-error');},success: function (e) {$(e).closest('.form-group').removeClass('has-error');$(e).remove();},errorPlacement: function (error, element) {if( element.is('input[type=checkbox]') || element.is('input[type=radio]') ) {var controls = element.closest('div[class*="col-"]');if( controls.find(':checkbox,:radio').length > 1 ) controls.append(error);else error.insertAfter(element.nextAll('.lbl:eq(0)').eq(0));}
else if( element.is('.select2') ) {error.insertAfter(element.siblings('[class*="select2-container"]:eq(0)'));}
else if( element.is('.chosen-select') ) {error.insertAfter(element.siblings('[class*="chosen-container"]:eq(0)'));}
else {error.appendTo(element.closest('.form-group'));}},submitHandler: function( form ) {$(form).find('button:submit').prop('disabled', true);return true;}});ShowCartMobileHandler.step2();if ( aop_settings.foodDeliveryCart ) {foodDeliveryEditProductEvent($cartOrderPage);}
if ( $('html.onlyContent123').length > 0 ) {window.parent.$(window.parent.document).trigger('pageLoaded');} else {$(document).trigger('pageLoaded');}
if ( window.location.pathname == '/-order1/' ) {$(document).off('order1.reload').on('order1.reload', function(){if ( typeof window.isCartWasChanged != 'undefined' ) {delete window.isCartWasChanged;window.location.reload();}});}}
function showCart_QuantityPopover( $input, message ) {$input.popover({container: $cartOrderPage,content: message,trigger: 'manual',template: '<div class="popover cart-validator-popover" role="tooltip"><div class="arrow"></div><div class="popover-content"></div></div>',placement: function(popover, input) {return isMobileDevice.any() ? 'auto' : 'bottom';}});$input.popover('show');clearTimeout($input.data('q-p-timeout'));$input.data('q-p-timeout',setTimeout(function(){$input.popover('destroy');},3000));}
function showCart_UpdateQuantityTotalPrice() {var cartTotal = 0.00;$cartOrderPage.find('.quantity_field').each(function() {var $quantityInput = $(this);var $info            = $quantityInput.closest('.cart-product-info');var $priceBox        = $info.find('.cart-product-price');var $price           = $info.find('.cart-product-price [data-type="price"]');var $quantityPrice   = $info.find('.quantity-total-price');var $fullPrice           = $info.find('.cart-product-full-price [data-type="price"]');var $quantityFullPrice   = $info.find('.quantity-total-full-price');var total = (parseFloat($price.closest('[data-price]').data('price')) * parseInt($quantityInput.val()));var totalFullPrice = (parseFloat($fullPrice.closest('[data-price]').data('price')) * parseInt($quantityInput.val()));cartTotal += parseFloat(total);$quantityPrice.find('.main_price [data-type="price"]').html(total.toFixed(2));$quantityFullPrice.find('.main_price [data-type="price"]').html(totalFullPrice.toFixed(2));if (parseInt($quantityInput.val()) > 1) {$quantityPrice.show();$priceBox.hide();} else {$quantityPrice.hide();$priceBox.show();}
$info.find('.cart-product-quantity .qty_count').html($quantityInput.val());$(document).trigger('multi_currencies_price_update',[[{el: $quantityPrice.find('.main_price'),newPrice: total.toFixed(2)}]]);});$cartOrderPage.find('#cartTotalPrice [data-type="price"]').html(cartTotal.toFixed(2));$(document).trigger('multi_currencies_price_update',[[{el: $cartOrderPage.find('#cartTotalPrice'),newPrice: cartTotal.toFixed(2)}]]);}
function showCart_UpdateCartWasChanged() {window.isCartWasChanged = window.location.pathname == '/-order1/';}}
jQuery(function($) {DonateModuleInitialize_Layout1();});function DonateModuleInitialize_Layout1() {$( document ).on( 's123.page.ready', function( event ) {var $section = $('.s123-module.s123-module-donate.layout-1, .s123-module.s123-page-data-donate.layout-1');$section.each(function( index ) {var $this = $(this);$this.find('.donate-category').each(function( index ) {var $sectionThis = $(this);var $donateForm = $sectionThis.find('.donateForm');var $donateButtons = $sectionThis.find('.donate-btn');var $donateBtnOther = $sectionThis.find('.donate-btn-other');var $donateAmounts = $sectionThis.find('.donate-amount');var $donateGoalContainer = $sectionThis.find('.donate-goal-container');if (!$sectionThis.data('donate-other-button')) {$sectionThis.attr('data-donate-other-button', $donateBtnOther.text());}
if ( $('.donate-order-form').length > 0 ) {$('.donate-order-form').remove();}
$donateBtnOther.text($sectionThis.data('donate-other-button'));$donateButtons.off('click').on('click',function() {var $btn = $(this);var $donatePreview = $sectionThis.find('.donation-price-preview span[data-type="price"]');setActiveBtn($donateButtons,$donateBtnOther,$btn);$sectionThis.find('.donate-price-input-container').css({ visibility: 'hidden' }).removeClass('shown');$donateAmounts.val($.trim($(this).data('amount')));$(document).trigger('donate_price_update',[$donateAmounts]);UpdateAmount($donatePreview,$btn.find('span[data-type=price]').text());$donateBtnOther.text($sectionThis.data('donate-other-button'));});$donateButtons.eq(1).trigger('click');$(document).on('pageLoaded.multi_currencies', function() {$sectionThis.find('.donate-btn.selectedPrice').trigger('click');});$donateBtnOther.off('click').on('click',function() {var $btn = $(this);setActiveBtn($donateButtons,$donateBtnOther,$btn);$sectionThis.find('.donate-price-input-container').css({ visibility: 'visible' }).addClass('shown');});$donateAmounts.off('input').on('input', function(event) {var $donatePreview = $sectionThis.find('.donation-price-preview span[data-type="price"]');var eventKey = event.which;clearTimeout($donateAmounts.inputFinished);$donateAmounts.inputFinished = setTimeout( function() {if ( !$donateAmounts.val() || eventKey === 13 ) return;if ( !$donateForm.valid() ) return;UpdateAmount($donatePreview,$donateAmounts.val());},500);});$donateForm.validate({errorElement: 'div',errorClass: 'help-block',focusInvalid: true,ignore: "",highlight: function (e) {$(e).closest('.form-group').removeClass('has-info').addClass('has-error');$sectionThis.find('.donate-price-input-container').css({ visibility: 'visible' }).addClass('shown');$donateBtnOther.trigger('click');},success: function (e) {$(e).closest('.form-group').removeClass('has-error');$(e).remove();},errorPlacement: function (error, element) {if( element.is('input[type=checkbox]') || element.is('input[type=radio]') ) {var controls = element.closest('div[class*="col-"]');if( controls.find(':checkbox,:radio').length > 1 ) controls.append(error);else error.insertAfter(element.nextAll('.lbl:eq(0)').eq(0));}
else if( element.is('.select2') ) {error.insertAfter(element.siblings('[class*="select2-container"]:eq(0)'));}
else if( element.is('.chosen-select') ) {error.insertAfter(element.siblings('[class*="chosen-container"]:eq(0)'));}
else {error.appendTo(element.closest('.form-group'));}},submitHandler: function( form ) {var $form = $(form);var formValues = getFormValues($form);var $submitBtn = $form.find('button[type=submit]:focus');var subscriptionTicketID = $submitBtn.data('payment');if ( subscriptionTicketID == 'both' ) {subscriptionTicketID = 'default';var $donateSubscription = $form.find('[name="donateSubscription"]');if ( $donateSubscription.length > 0 && $donateSubscription.is(':checked') ) {subscriptionTicketID = 'subscription';}}
if ( $('.donate-order-form').length > 0 ) $('.donate-order-form').remove();$('<form class="donate-order-form" action="/versions/2/wizard/orders/front/addToCart.php" method="post">' +'<input type="hidden" name="w" value="' + $('#w').val() + '" />' +'<input type="hidden" name="websiteID" value="' + $('#websiteID').val() + '" />' +'<input type="hidden" name="uniquePageID" value="' + formValues.uniquePageID + '" />' +'<input type="hidden" name="moduleID" value="' + formValues.moduleID + '" />' +'<input type="hidden" name="tranW" value="' + formValues.tranW + '" />' +'<input type="hidden" name="amount" value="1" />' +'<input type="hidden" name="dynamicPrice" value="' + formValues.amount + '" />' +'<input type="hidden" name="redirect" value="1" />' +'<input type="hidden" name="subscriptionTicketID" value="' + subscriptionTicketID + '" />' +'<input type="hidden" name="viewModeTXT" value="' + formValues.viewModeTXT + '" />' +'</form>')
.appendTo('body')
.submit();return false;}});if ( $donateGoalContainer.length > 0 ) {var moduleID = $this.data('module-id');var moduleTypeNUM = $this.data('module-type-num');var uniqueID = $sectionThis.find('.donate-item').data('unique-id');var request = $.post('/versions/' + $(versionNUM).val() + '/wizard/modules/donate/include/get-donate-goal-ajax.php', {w: $('#w').val(),websiteID: $('#websiteID').val(),moduleID: moduleID,moduleTypeNUM: moduleTypeNUM,uniqueID: uniqueID,language: languageCode,}).done(function( data ) {data = tryParseJSON(data);if ( data.status == 'succeed' ) {var $progressBar = $donateGoalContainer.find('.progress-bar');$donateGoalContainer.find('.donate-goal-loading').hide();$progressBar.attr('aria-valuenow',data.stylePercent);$progressBar.css('width',data.stylePercent + '%');$donateGoalContainer.find('.donate-goal').html(data.html);if (data.goalDate && data.daysRemaining) {var $goalDateContainer = $donateGoalContainer.find('.donate-goal-date-container');if ($goalDateContainer.length === 0) {$goalDateContainer = $('<div class="donate-goal-date-container"></div>');$donateGoalContainer.append($goalDateContainer);var $countdown = $('<div class="donate-goal-date-countdown" data-goal-date="' + data.goalDate + '">' +'<span class="countdown-label">' + (data.countdownLabel || 'Time remaining: ') + '</span>' +'<span class="days-left">' + data.daysRemaining + '</span> ' +'<span class="days-text">days</span> ' +'<span class="hours-left">00</span>:' +'<span class="minutes-left">00</span>:' +'<span class="seconds-left">00</span>' +'</div>');$goalDateContainer.append($countdown);initializeGoalDateCountdown($donateGoalContainer);} else {var $countdown = $goalDateContainer.find('.donate-goal-date-countdown');$countdown.attr('data-goal-date', data.goalDate);$goalDateContainer.find('.days-left').text(data.daysRemaining);initializeGoalDateCountdown($donateGoalContainer);}}
$(document).trigger('pageLoaded.multi_currencies');}});initializeGoalDateCountdown($donateGoalContainer);}});var categories = new ModuleLayoutCategories({$items :  $this.find('.donate-category'),$categoriesContainer : $this.find('.categories-panel'),$filterButton : $this.find('.items-responsive-filter'),$categories : $this.find('.items-categories-container li')});$this.off('module_layout_categories.shown').on('module_layout_categories.shown', function( event, catID ) {var $category = $(this).find('.donate-category[data-categories-filter="'+catID+'"]');if ( $category.data('shown-once') && $category.data('shown-once') == '0' ) {$category.data('shown-once','1');$category.find('.donate-btn.selectedPrice').trigger('click');}});});});function setActiveBtn( $donateButtons, $donateBtnOther, $btn ) {$donateButtons.removeClass('selectedPrice');$donateBtnOther.removeClass('selectedPrice');$donateButtons.removeClass('background-primary-color');$donateBtnOther.removeClass('background-primary-color');$btn.addClass('selectedPrice');$btn.addClass('background-primary-color');}
function UpdateAmount( $donatePreview, amount ) {$donatePreview.countTo('restart');$donatePreview.countTo({from: 0,to: amount,speed: 1000,decimals: amount.toString().indexOf('.') === -1 ? 0 : 2,refreshInterval: 50,formatter: function (value, options) {return value.toFixed(options.decimals);}});}
function initializeGoalDateCountdown($container) {var countdowns = $container.find('.donate-goal-date-countdown');$container.find('.donate-goal-date-countdown').each(function() {var $countdown = $(this);if ($countdown.length === 0) return;var goalDateString = $countdown.data('goal-date');var goalDate = new Date(goalDateString);if (isNaN(goalDate.getTime())) {return;}
var $daysLeft = $countdown.find('.days-left');var $hoursLeft = $countdown.find('.hours-left');var $minutesLeft = $countdown.find('.minutes-left');var $secondsLeft = $countdown.find('.seconds-left');updateCountdown(goalDate, $daysLeft, $hoursLeft, $minutesLeft, $secondsLeft);var countdownInterval = setInterval(function() {if (!updateCountdown(goalDate, $daysLeft, $hoursLeft, $minutesLeft, $secondsLeft)) {clearInterval(countdownInterval); // Stop if countdown is complete
}}, 1000); // Update every second
});}
function updateCountdown(goalDate, $daysLeft, $hoursLeft, $minutesLeft, $secondsLeft) {var now = new Date();var diff = Math.floor((goalDate - now) / 1000); // difference in seconds
if (diff <= 0) {$daysLeft.closest('.donate-goal-date-container').hide(); // Hide when goal date has passed
return false;}
var days = Math.floor(diff / (60 * 60 * 24));var hours = Math.floor((diff % (60 * 60 * 24)) / (60 * 60));var minutes = Math.floor((diff % (60 * 60)) / 60);var seconds = diff % 60;$daysLeft.text(days);if ($hoursLeft && $hoursLeft.length) {$hoursLeft.text(padZero(hours));}
if ($minutesLeft && $minutesLeft.length) {$minutesLeft.text(padZero(minutes));}
if ($secondsLeft && $secondsLeft.length) {$secondsLeft.text(padZero(seconds));}
return true;}
function padZero(num) {return (num < 10 ? '0' : '') + num;}}
jQuery(function($) {DonateModuleInitialize_Layout5();});function DonateModuleInitialize_Layout5() {$(document).on('s123.page.ready', function(event) {var $section = $('.s123-module.s123-module-donate.layout-5, .s123-module.s123-page-data-donate.layout-5');$section.each(function(index) {var $this = $(this);$this.find('.donate-category').each(function(index) {var $sectionThis = $(this);var $donateForm = $sectionThis.find('.donateForm');var $donateButtons = $sectionThis.find('.donate-btn');var $donateBtnOther = $sectionThis.find('.donate-btn-other');var $donateAmounts = $sectionThis.find('.donate-amount');var $donateGoalContainer = $sectionThis.find('.donate-goal-container');if (!$sectionThis.data('donate-other-button')) {$sectionThis.attr('data-donate-other-button', $donateBtnOther.text());}
if ($('.donate-order-form').length > 0) {$('.donate-order-form').remove();}
$donateBtnOther.text($sectionThis.data('donate-other-button'));$donateButtons.off('click').on('click', function() {var $btn = $(this);var $donatePreview = $sectionThis.find('.donation-price-preview span[data-type="price"]');setActiveBtn($donateButtons, $donateBtnOther, $btn);$sectionThis.find('.donate-price-input-container').removeClass('shown');$donateAmounts.val($.trim($(this).data('amount')));$(document).trigger('donate_price_update', [$donateAmounts]);UpdateAmount($donatePreview, $btn.find('span[data-type=price]').text());$donateBtnOther.text($sectionThis.data('donate-other-button'));});$donateButtons.eq(1).trigger('click');$(document).on('pageLoaded.multi_currencies', function() {$sectionThis.find('.donate-btn.selectedPrice').trigger('click');});$donateBtnOther.off('click').on('click', function() {var $btn = $(this);setActiveBtn($donateButtons, $donateBtnOther, $btn);$sectionThis.find('.donate-price-input-container').addClass('shown');});$donateAmounts.off('input').on('input', function(event) {var $donatePreview = $sectionThis.find('.donation-price-preview span[data-type="price"]');var eventKey = event.which;clearTimeout($donateAmounts.inputFinished);$donateAmounts.inputFinished = setTimeout(function() {if (!$donateAmounts.val() || eventKey === 13) return;if (!$donateForm.valid()) return;UpdateAmount($donatePreview, $donateAmounts.val());}, 500);});$donateForm.validate({errorElement: 'div',errorClass: 'help-block',focusInvalid: true,ignore: "",highlight: function(e) {$(e).closest('.form-group').removeClass('has-info').addClass('has-error');},success: function(e) {$(e).closest('.form-group').removeClass('has-error');$(e).remove();},errorPlacement: function(error, element) {if (element.is('input[type=checkbox]') || element.is('input[type=radio]')) {var controls = element.closest('div[class*="col-"]');if (controls.find(':checkbox,:radio').length > 1) controls.append(error);else error.insertAfter(element.nextAll('.lbl:eq(0)').eq(0));} else if (element.is('.select2')) {error.insertAfter(element.siblings('[class*="select2-container"]:eq(0)'));} else if (element.is('.chosen-select')) {error.insertAfter(element.siblings('[class*="chosen-container"]:eq(0)'));} else {error.appendTo(element.closest('.form-group'));}},submitHandler: function(form) {var $form = $(form);var formValues = getFormValues($form);var $submitBtn = $form.find('button[type=submit]:focus');var subscriptionTicketID = $submitBtn.data('payment');if (subscriptionTicketID == 'both') {subscriptionTicketID = 'default';var $donateSubscription = $form.find('[name="donateSubscription"]');if ($donateSubscription.length > 0 && $donateSubscription.is(':checked')) {subscriptionTicketID = 'subscription';}}
if ($('.donate-order-form').length > 0) $('.donate-order-form').remove();$('<form class="donate-order-form" action="/versions/2/wizard/orders/front/addToCart.php" method="post">' +'<input type="hidden" name="w" value="' + $('#w').val() + '" />' +'<input type="hidden" name="websiteID" value="' + $('#websiteID').val() + '" />' +'<input type="hidden" name="uniquePageID" value="' + formValues.uniquePageID + '" />' +'<input type="hidden" name="moduleID" value="' + formValues.moduleID + '" />' +'<input type="hidden" name="tranW" value="' + formValues.tranW + '" />' +'<input type="hidden" name="amount" value="1" />' +'<input type="hidden" name="dynamicPrice" value="' + formValues.amount + '" />' +'<input type="hidden" name="redirect" value="1" />' +'<input type="hidden" name="subscriptionTicketID" value="' + subscriptionTicketID + '" />' +'<input type="hidden" name="viewModeTXT" value="' + formValues.viewModeTXT + '" />' +'</form>')
.appendTo('body')
.submit();return false;}});if ($donateGoalContainer.length > 0) {var moduleID = $this.data('module-id');var moduleTypeNUM = $this.data('module-type-num');var uniqueID = $sectionThis.find('.donate-item').data('unique-id');var request = $.post('/versions/' + $(versionNUM).val() + '/wizard/modules/donate/include/get-donate-goal-ajax.php', {w: $('#w').val(),websiteID: $('#websiteID').val(),moduleID: moduleID,moduleTypeNUM: moduleTypeNUM,uniqueID: uniqueID,language: languageCode,}).done(function(data) {data = tryParseJSON(data);if (data.status == 'succeed') {var $progressBar = $donateGoalContainer.find('.progress-bar');$donateGoalContainer.find('.donate-goal-loading').hide();$progressBar.attr('aria-valuenow', data.stylePercent);$progressBar.css('width', data.stylePercent + '%');$donateGoalContainer.find('.donate-goal').html(data.html);if (data.goalDate && data.daysRemaining) {var $goalDateContainer = $donateGoalContainer.find('.donate-goal-date-container');if ($goalDateContainer.length === 0) {$goalDateContainer = $('<div class="donate-goal-date-container"></div>');$donateGoalContainer.append($goalDateContainer);var $countdown = $('<div class="donate-goal-date-countdown" data-goal-date="' + data.goalDate + '">' +'<span class="countdown-label">' + (data.countdownLabel || 'Time remaining: ') + '</span>' +'<span class="days-left">' + data.daysRemaining + '</span> ' +'<span class="days-text">days</span> ' +'<span class="hours-left">00</span>:' +'<span class="minutes-left">00</span>:' +'<span class="seconds-left">00</span>' +'</div>');$goalDateContainer.append($countdown);initializeGoalDateCountdown($donateGoalContainer);} else {var $countdown = $goalDateContainer.find('.donate-goal-date-countdown');$countdown.attr('data-goal-date', data.goalDate);$goalDateContainer.find('.days-left').text(data.daysRemaining);initializeGoalDateCountdown($donateGoalContainer);}}
$(document).trigger('pageLoaded.multi_currencies');}});initializeGoalDateCountdown($donateGoalContainer);}});var categories = new ModuleLayoutCategories({$items: $this.find('.donate-category'),$categoriesContainer: $this.find('.categories-panel'),$filterButton: $this.find('.items-responsive-filter'),$categories: $this.find('.items-categories-container li')});$this.off('module_layout_categories.shown').on('module_layout_categories.shown', function(event, catID) {var $category = $(this).find('.donate-category[data-categories-filter="' + catID + '"]');if ($category.data('shown-once') && $category.data('shown-once') == '0') {$category.data('shown-once', '1');$category.find('.donate-btn.selectedPrice').trigger('click');}});});});function setActiveBtn($donateButtons, $donateBtnOther, $btn) {$donateButtons.removeClass('selectedPrice');$donateBtnOther.removeClass('selectedPrice');$donateButtons.removeClass('background-primary-color');$donateBtnOther.removeClass('background-primary-color');$btn.addClass('selectedPrice');$btn.addClass('background-primary-color');}
function UpdateAmount($donatePreview, amount) {$donatePreview.countTo('restart');$donatePreview.countTo({from: 0,to: amount,speed: 1000,decimals: amount.toString().indexOf('.') === -1 ? 0 : 2,refreshInterval: 50,formatter: function(value, options) {return value.toFixed(options.decimals);}});}
function initializeGoalDateCountdown($container) {var countdowns = $container.find('.donate-goal-date-countdown');$container.find('.donate-goal-date-countdown').each(function() {var $countdown = $(this);if ($countdown.length === 0) return;var goalDateString = $countdown.data('goal-date');var goalDate = new Date(goalDateString);if (isNaN(goalDate.getTime())) {return;}
var $daysLeft = $countdown.find('.days-left');var $hoursLeft = $countdown.find('.hours-left');var $minutesLeft = $countdown.find('.minutes-left');var $secondsLeft = $countdown.find('.seconds-left');updateCountdown(goalDate, $daysLeft, $hoursLeft, $minutesLeft, $secondsLeft);var countdownInterval = setInterval(function() {if (!updateCountdown(goalDate, $daysLeft, $hoursLeft, $minutesLeft, $secondsLeft)) {clearInterval(countdownInterval); // Stop if countdown is complete
}}, 1000); // Update every second
});}
function updateCountdown(goalDate, $daysLeft, $hoursLeft, $minutesLeft, $secondsLeft) {var now = new Date();var diff = Math.floor((goalDate - now) / 1000); // difference in seconds
if (diff <= 0) {$daysLeft.closest('.donate-goal-date-container').hide(); // Hide when goal date has passed
return false;}
var days = Math.floor(diff / (60 * 60 * 24));var hours = Math.floor((diff % (60 * 60 * 24)) / (60 * 60));var minutes = Math.floor((diff % (60 * 60)) / 60);var seconds = diff % 60;$daysLeft.text(days);if ($hoursLeft && $hoursLeft.length) {$hoursLeft.text(padZero(hours));}
if ($minutesLeft && $minutesLeft.length) {$minutesLeft.text(padZero(minutes));}
if ($secondsLeft && $secondsLeft.length) {$secondsLeft.text(padZero(seconds));}
return true;}
function padZero(num) {return (num < 10 ? '0' : '') + num;}}
function Comments_Initialize( settings ) {var that = this;var $s123CommentsContainer = $('#'+settings.id);var $commentsForm = $s123CommentsContainer.find('.commentsForm');var $commentsContainer;var Rating = {};var submitMessage = {};var hasRating = false;that.onLoad = settings.onLoad;that.onFormSubmit = settings.onFormSubmit;that.customLabels = settings.customLabels ? settings.customLabels : {};switch( settings.type ) {case 0:$commentsContainer 	= $s123CommentsContainer.find('#commentsContainer');submitMessage.title = translations.sent;submitMessage.message = translations.blogReviewMessage;break;case 1:$commentsContainer 	= $s123CommentsContainer.find('#commentsContainer');hasRating = true;break;default:return;break;}
that.init = function() {that.loadComments(false);};that.showSubcomments = function ( subComments, $commentsContainer ) {$.each(subComments,function( index, comment ) {var $parentComments = $commentsContainer.find('.commentBox');$.each($parentComments,function( index, parentComment ) {if ($(this).data('comment-id') == comment.parentID ) {$(parentComment).find('.sub-comments-div').append(that.comment_HTML(comment.title,comment.time,comment.message));}});});};that.comment_HTML = function ( title, time, message ) {var html ='';html += '<div class="sub-comments-div-box">';html += '<h4 class="title">'+title+'</h4>';html += '<small class="time">'+time+'</small><br/>';html += '<div class="message">'+message+'</div>';html += '</div>';return html;};that.submitHandler = function ( $form ) {var forms_GoogleRecaptcha = new Forms_GoogleRecaptcha();forms_GoogleRecaptcha.init($form);$form.validate({errorElement: 'div',errorClass: 'help-block',focusInvalid: true,ignore: "",highlight: function (e) {$(e).closest('.form-group').removeClass('has-info').addClass('has-error');},success: function (e) {$(e).closest('.form-group').removeClass('has-error');$(e).remove();}});$form.off('submit.commentsForm').off('submit.commentsForm').on('submit.commentsForm', function( event ) {event.preventDefault();if ( hasRating ) {var formValid = $form.valid();var ratingValid = Rating.valid();if ( !formValid || !ratingValid ) return;} else {if ( !$form.valid() ) return;}
if ( forms_GoogleRecaptcha.isActive && !forms_GoogleRecaptcha.isGotToken ) {forms_GoogleRecaptcha.getToken();return false;}
$form.find('.blogSubmitButton').prop('disabled', true);$form.find('.blogSubmitButton').html(S123.s123IconToSvg.getHtml('spinner','fa-spin',''));$.ajax({type: "POST",url: "/versions/2/wizard/comments/addShowComments.php",data: $form.serialize(),success: function( data ) {var dataObj = tryParseJSON(data);if ( dataObj.blockComment  == '1' ) {that.showManagerApproveMessage();}
that.loadComments(data.commentsHtml);$form.trigger('reset');forms_GoogleRecaptcha.reset();$form.find('.blogSubmitButton').prop('disabled', false);$form.find('.blogSubmitButton').html($form.find('.blogSubmitButton').data('text'));WizardNotificationUpdate();if ( that.onFormSubmit ) that.onFormSubmit.call(this,dataObj.newCommentID,dataObj.blockComment);}});return false;});};that.showManagerApproveMessage = function () {if ( !submitMessage.message ) return;bootbox.alert({title: submitMessage.title,message: submitMessage.message,className: 'contactUsConfirm',buttons: {ok: {label: translations.Ok}},backdrop: true});};that.showReplyModal = function (t,childForm) {var x = '';x += '<form class="row" method="post" style="margin:0px;">';x += '<div class="col-xs-12 col-sm-12">';x += '<div class="form-group">';x += '<textarea class="form-control comment_message" name="comment_message" placeholder="'+(that.customLabels.commentResponseText ? that.customLabels.commentResponseText : t.data('tran-comment'))+'" style="min-height: 150px;" required data-msg-required="'+t.data('tran-this-field-is-required')+'"></textarea>';x += '</div>';x += '<div class="row">';x += '<div class="col-xs-12 col-sm-6">';x += '<div class="form-group">';x += '<input type="text" name="contact_name" placeholder="'+(that.customLabels.commentName ? that.customLabels.commentName : t.data('tran-name'))+'" class="form-control" required data-msg-required="'+t.data('tran-this-field-is-required')+'">';x += '</div>';x += '</div>';x += '<div class="col-xs-12 col-sm-6">';x += '<div class="form-group">';x += '<input type="text" name="contact_email" placeholder="'+(that.customLabels.commentEmail ? that.customLabels.commentEmail : t.data('tran-email-address'))+'" class="form-control" required data-msg-required="'+t.data('tran-this-field-is-required')+'" data-rule-email="true" data-msg-email="'+t.data('tran-please-enter-valid-email')+'">';x += '</div>';x += '</div>';x += '</div>';x += '<div class="text-center">';x += '<button type="submit" class="btn btn-primary blogSubmitButton" data-text="'+t.data('tran-post-reply')+'">'+(that.customLabels.replyButtonText ? that.customLabels.replyButtonText : t.data('tran-post-reply'))+'</button>';x += '</div>';x += '<div class="text-center comments-message-text">';x += '<small>* '+(that.customLabels.commentMessage ? that.customLabels.commentMessage : t.data('tran-the-email-will-not-be-published-on-the-website'))+'</small>';x += '</div>';x += '</div>';x += '<input type="hidden" name="w" value="'+t.data('hidden-w')+'">';x += '<input type="hidden" name="websiteID" value="'+t.data('hidden-website-id')+'">';x += '<input type="hidden" name="uniquePageID" value="'+t.data('hidden-unique-page-id')+'">';x += '<input type="hidden" name="moduleID" value="'+t.data('module-id')+'">';x += '<input type="hidden" name="moduleTypeNUM" value="'+t.data('module-type')+'">';x += '<input type="hidden" name="tranW" value="'+websiteLanguageCountryFullCode+'">';x += '<input type="hidden" class="commentTo" name="commentTo" value="'+t.data('hidden-comment-to')+'">';x += '<input type="hidden" name="act" value="addShow">';x += '</form>';childForm.html(x);that.submitHandler(childForm.find('form'));};Rating = new function() {var R = this;R.init = function( settings ) {if ( !settings.hasRating ) return;R.$form = settings.$form;R.$input = settings.$input;R.$json = settings.$json;if ( R.$form.length === 0 ) return;R.$raty = R.$form.find('.rating-plugin');R.$raty.raty({starType: 'i',cancel: false,number: 5,hints: R.getHints(),starHalf: (IsIE11() ? 'fa fa-star-half star-half' : 'star-half svg-m'),starOff: (IsIE11() ? 'fa fa-star-o star-o' : 'star-o svg-m'),starOn: (IsIE11() ? 'fa fa-star star' : 'star svg-m'),click: function( rating ,event ) {R.$input.val(rating);R.valid();}});};R.getHints = function() {var json = tryParseJSON(R.$json.val());if ( !json ) {return hints = [translations.reviewBad,translations.reviewPoor,translations.reviewRegular,translations.reviewGood,translations.reviewGorgeous];} else {return hints = json.hints;}};R.valid = function() {var valid = $.isNumeric(R.$input.val()) && parseInt(R.$input.val()) > 0;var $parent = R.$raty.closest('.form-group');$parent.removeClass('.has-error');$parent.find('#ratingError').remove();if ( !valid ) {$parent.addClass('has-error');$parent.append('<div id="ratingError" class="text-center help-block">'+R.$raty.data('msg-required')+'</div>');}
return valid;};};that.loadComments = function( commentsHtml ) {if ( !commentsHtml ) {loadCommentsByAjax();} else {addCommentsToPage(commentsHtml);}
$commentsForm.find('.blogCommentsBox #comment_message').focus(function() {$commentsForm.find('.blogCommentsBox').addClass('active');});that.submitHandler($commentsForm);Rating.init({$form: $commentsForm,$input: $commentsForm.find('.rating'),$json: $commentsForm.find('.rating-plugin-data'),hasRating: hasRating});};function loadCommentsByAjax() {$.ajax({type: "POST",url: '/versions/2/wizard/comments/addShowComments.php',data: {w: $('#w').val(),websiteID: $('#websiteID').val(),disableCssFiles: 1,moduleID: $commentsContainer.data('module-id'),moduleTypeNUM: $commentsContainer.data('module-type-num'),uniquePageID: $commentsContainer.data('unique-page-id'),tranW: $commentsContainer.data('tran-w'),act: $commentsContainer.data('action')},success: function( data ) {data = tryParseJSON(data);if ( !data ) return;addCommentsToPage(data.commentsHtml);}});}
function addCommentsToPage( commentsHtml ) {$commentsContainer.html(commentsHtml);$commentsContainer.find('.blog-reply-to').each(function( index, replyLink ) {$(replyLink).off('click').on('click',function() {$childForm = $(this).closest('.commentBox').find('.blogReplyForm');if ($childForm.hasClass('hidden')) {that.showReplyModal($(this),$childForm);$('.blogReplyForm').addClass('hidden');$('.blog-reply-to').html($(this).data('text-reply'));$(this).html($(this).data('text-hide'));$childForm.removeClass('hidden');} else {$childForm.addClass('hidden');$(this).html($(this).data('text-reply'));}
$childForm.find('.comment_message').select();});});var subComments = tryParseJSON($commentsContainer.find('.sub-comments').html());that.showSubcomments(subComments,$commentsContainer);if ( hasRating) {if ( that.onLoad ) that.onLoad.call(this,$commentsContainer.find('.commentBox').length,$commentsContainer.find('#reviewAvg').val(),false);}}
that.init();}
/*! Isotope PACKAGED v3.0.5 Licensed GPLv3 for open source use or Isotope Commercial License for commercial use https://isotope.metafizzy.co Copyright 2017 Metafizzy */
!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,s,a){function u(t,e,o){var n,s="$()."+i+'("'+e+'")';return t.each(function(t,u){var h=a.data(u,i);if(!h)return void r(i+" not initialized. Cannot call methods, i.e. "+s);var d=h[e];if(!d||"_"==e.charAt(0))return void r(s+" is not a valid method");var l=d.apply(h,o);n=void 0===n?l:n}),void 0!==n?n:t}function h(t,e){t.each(function(t,o){var n=a.data(o,i);n?(n.option(e),n._init()):(n=new s(o,e),a.data(o,i,n))})}a=a||e||t.jQuery,a&&(s.prototype.option||(s.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=n.call(arguments,1);return u(this,t,e)}return h(this,t),this},o(a))}function o(t){!t||t&&t.bridget||(t.bridget=i)}var n=Array.prototype.slice,s=t.console,r="undefined"==typeof s?function(){}:function(t){s.error(t)};return o(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},o=i[t]=i[t]||[];return o.indexOf(e)==-1&&o.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},o=i[t]=i[t]||{};return o[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var o=i.indexOf(e);return o!=-1&&i.splice(o,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var o=this._onceEvents&&this._onceEvents[t],n=0;n<i.length;n++){var s=i[n],r=o&&o[s];r&&(this.off(t,s),delete o[s]),s.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("get-size/get-size",[],function(){return e()}):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=t.indexOf("%")==-1&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;e<h;e++){var i=u[e];t[i]=0}return t}function o(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),e}function n(){if(!d){d=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var n=o(e);s.isBoxSizeOuter=r=200==t(n.width),i.removeChild(e)}}function s(e){if(n(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var s=o(e);if("none"==s.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox="border-box"==s.boxSizing,l=0;l<h;l++){var f=u[l],c=s[f],m=parseFloat(c);a[f]=isNaN(m)?0:m}var p=a.paddingLeft+a.paddingRight,y=a.paddingTop+a.paddingBottom,g=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,I=a.borderTopWidth+a.borderBottomWidth,z=d&&r,x=t(s.width);x!==!1&&(a.width=x+(z?0:p+_));var S=t(s.height);return S!==!1&&(a.height=S+(z?0:y+I)),a.innerWidth=a.width-(p+_),a.innerHeight=a.height-(y+I),a.outerWidth=a.width+g,a.outerHeight=a.height+v,a}}var r,a="undefined"==typeof console?e:function(t){console.error(t)},u=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],h=u.length,d=!1;return s}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i<e.length;i++){var o=e[i],n=o+"MatchesSelector";if(t[n])return n}}();return function(e,i){return e[t](i)}}),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.matchesSelector)}(window,function(t,e){var i={};i.extend=function(t,e){for(var i in e)t[i]=e[i];return t},i.modulo=function(t,e){return(t%e+e)%e},i.makeArray=function(t){var e=[];if(Array.isArray(t))e=t;else if(t&&"object"==typeof t&&"number"==typeof t.length)for(var i=0;i<t.length;i++)e.push(t[i]);else e.push(t);return e},i.removeFrom=function(t,e){var i=t.indexOf(e);i!=-1&&t.splice(i,1)},i.getParent=function(t,i){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,e(t,i))return t},i.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},i.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},i.filterFindElements=function(t,o){t=i.makeArray(t);var n=[];return t.forEach(function(t){if(t instanceof HTMLElement){if(!o)return void n.push(t);e(t,o)&&n.push(t);for(var i=t.querySelectorAll(o),s=0;s<i.length;s++)n.push(i[s])}}),n},i.debounceMethod=function(t,e,i){var o=t.prototype[e],n=e+"Timeout";t.prototype[e]=function(){var t=this[n];t&&clearTimeout(t);var e=arguments,s=this;this[n]=setTimeout(function(){o.apply(s,e),delete s[n]},i||100)}},i.docReady=function(t){var e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},i.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var o=t.console;return i.htmlInit=function(e,n){i.docReady(function(){var s=i.toDashed(n),r="data-"+s,a=document.querySelectorAll("["+r+"]"),u=document.querySelectorAll(".js-"+s),h=i.makeArray(a).concat(i.makeArray(u)),d=r+"-options",l=t.jQuery;h.forEach(function(t){var i,s=t.getAttribute(r)||t.getAttribute(d);try{i=s&&JSON.parse(s)}catch(a){return void(o&&o.error("Error parsing "+r+" on "+t.className+": "+a))}var u=new e(t,i);l&&l.data(t,n,u)})})},i}),function(t,e){"function"==typeof define&&define.amd?define("outlayer/item",["ev-emitter/ev-emitter","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("ev-emitter"),require("get-size")):(t.Outlayer={},t.Outlayer.Item=e(t.EvEmitter,t.getSize))}(window,function(t,e){"use strict";function i(t){for(var e in t)return!1;return e=null,!0}function o(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}function n(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}var s=document.documentElement.style,r="string"==typeof s.transition?"transition":"WebkitTransition",a="string"==typeof s.transform?"transform":"WebkitTransform",u={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[r],h={transform:a,transition:r,transitionDuration:r+"Duration",transitionProperty:r+"Property",transitionDelay:r+"Delay"},d=o.prototype=Object.create(t.prototype);d.constructor=o,d._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},d.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},d.getSize=function(){this.size=e(this.element)},d.css=function(t){var e=this.element.style;for(var i in t){var o=h[i]||i;e[o]=t[i]}},d.getPosition=function(){var t=getComputedStyle(this.element),e=this.layout._getOption("originLeft"),i=this.layout._getOption("originTop"),o=t[e?"left":"right"],n=t[i?"top":"bottom"],s=this.layout.size,r=o.indexOf("%")!=-1?parseFloat(o)/100*s.width:parseInt(o,10),a=n.indexOf("%")!=-1?parseFloat(n)/100*s.height:parseInt(n,10);r=isNaN(r)?0:r,a=isNaN(a)?0:a,r-=e?s.paddingLeft:s.paddingRight,a-=i?s.paddingTop:s.paddingBottom,this.position.x=r,this.position.y=a},d.layoutPosition=function(){var t=this.layout.size,e={},i=this.layout._getOption("originLeft"),o=this.layout._getOption("originTop"),n=i?"paddingLeft":"paddingRight",s=i?"left":"right",r=i?"right":"left",a=this.position.x+t[n];e[s]=this.getXValue(a),e[r]="";var u=o?"paddingTop":"paddingBottom",h=o?"top":"bottom",d=o?"bottom":"top",l=this.position.y+t[u];e[h]=this.getYValue(l),e[d]="",this.css(e),this.emitEvent("layout",[this])},d.getXValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!e?t/this.layout.size.width*100+"%":t+"px"},d.getYValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&e?t/this.layout.size.height*100+"%":t+"px"},d._transitionTo=function(t,e){this.getPosition();var i=this.position.x,o=this.position.y,n=parseInt(t,10),s=parseInt(e,10),r=n===this.position.x&&s===this.position.y;if(this.setPosition(t,e),r&&!this.isTransitioning)return void this.layoutPosition();var a=t-i,u=e-o,h={};h.transform=this.getTranslate(a,u),this.transition({to:h,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},d.getTranslate=function(t,e){var i=this.layout._getOption("originLeft"),o=this.layout._getOption("originTop");return t=i?t:-t,e=o?e:-e,"translate3d("+t+"px, "+e+"px, 0)"},d.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},d.moveTo=d._transitionTo,d.setPosition=function(t,e){this.position.x=parseInt(t,10),this.position.y=parseInt(e,10)},d._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},d.transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(t);var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var o=this.element.offsetHeight;o=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var l="opacity,"+n(a);d.enableTransition=function(){if(!this.isTransitioning){var t=this.layout.options.transitionDuration;t="number"==typeof t?t+"ms":t,this.css({transitionProperty:l,transitionDuration:t,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(u,this,!1)}},d.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},d.onotransitionend=function(t){this.ontransitionend(t)};var f={"-webkit-transform":"transform"};d.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,o=f[t.propertyName]||t.propertyName;if(delete e.ingProperties[o],i(e.ingProperties)&&this.disableTransition(),o in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[o]),o in e.onEnd){var n=e.onEnd[o];n.call(this),delete e.onEnd[o]}this.emitEvent("transitionEnd",[this])}},d.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(u,this,!1),this.isTransitioning=!1},d._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var c={transitionProperty:"",transitionDuration:"",transitionDelay:""};return d.removeTransitionStyles=function(){this.css(c)},d.stagger=function(t){t=isNaN(t)?0:t,this.staggerDelay=t+"ms"},d.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},d.remove=function(){return r&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",function(){this.removeElem()}),void this.hide()):void this.removeElem()},d.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("visibleStyle");e[i]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},d.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},d.getHideRevealTransitionEndProperty=function(t){var e=this.layout.options[t];if(e.opacity)return"opacity";for(var i in e)return i},d.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("hiddenStyle");e[i]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},d.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},d.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},o}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("outlayer/outlayer",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(i,o,n,s){return e(t,i,o,n,s)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):t.Outlayer=e(t,t.EvEmitter,t.getSize,t.fizzyUIUtils,t.Outlayer.Item)}(window,function(t,e,i,o,n){"use strict";function s(t,e){var i=o.getQueryElement(t);if(!i)return void(u&&u.error("Bad element for "+this.constructor.namespace+": "+(i||t)));this.element=i,h&&(this.$element=h(this.element)),this.options=o.extend({},this.constructor.defaults),this.option(e);var n=++l;this.element.outlayerGUID=n,f[n]=this,this._create();var s=this._getOption("initLayout");s&&this.layout()}function r(t){function e(){t.apply(this,arguments)}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}function a(t){if("number"==typeof t)return t;var e=t.match(/(^\d*\.?\d*)(\w*)/),i=e&&e[1],o=e&&e[2];if(!i.length)return 0;i=parseFloat(i);var n=m[o]||1;return i*n}var u=t.console,h=t.jQuery,d=function(){},l=0,f={};s.namespace="outlayer",s.Item=n,s.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var c=s.prototype;o.extend(c,e.prototype),c.option=function(t){o.extend(this.options,t)},c._getOption=function(t){var e=this.constructor.compatOptions[t];return e&&void 0!==this.options[e]?this.options[e]:this.options[t]},s.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},c._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),o.extend(this.element.style,this.options.containerStyle);var t=this._getOption("resize");t&&this.bindResize()},c.reloadItems=function(){this.items=this._itemize(this.element.children)},c._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,o=[],n=0;n<e.length;n++){var s=e[n],r=new i(s,this);o.push(r)}return o},c._filterFindItemElements=function(t){return o.filterFindElements(t,this.options.itemSelector)},c.getItemElements=function(){return this.items.map(function(t){return t.element})},c.layout=function(){this._resetLayout(),this._manageStamps();var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;this.layoutItems(this.items,e),this._isLayoutInited=!0},c._init=c.layout,c._resetLayout=function(){this.getSize()},c.getSize=function(){this.size=i(this.element)},c._getMeasurement=function(t,e){var o,n=this.options[t];n?("string"==typeof n?o=this.element.querySelector(n):n instanceof HTMLElement&&(o=n),this[t]=o?i(o)[e]:n):this[t]=0},c.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},c._getItemsForLayout=function(t){return t.filter(function(t){return!t.isIgnored})},c._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){var i=[];t.forEach(function(t){var o=this._getItemLayoutPosition(t);o.item=t,o.isInstant=e||t.isLayoutInstant,i.push(o)},this),this._processLayoutQueue(i)}},c._getItemLayoutPosition=function(){return{x:0,y:0}},c._processLayoutQueue=function(t){this.updateStagger(),t.forEach(function(t,e){this._positionItem(t.item,t.x,t.y,t.isInstant,e)},this)},c.updateStagger=function(){var t=this.options.stagger;return null===t||void 0===t?void(this.stagger=0):(this.stagger=a(t),this.stagger)},c._positionItem=function(t,e,i,o,n){o?t.goTo(e,i):(t.stagger(n*this.stagger),t.moveTo(e,i))},c._postLayout=function(){this.resizeContainer()},c.resizeContainer=function(){var t=this._getOption("resizeContainer");if(t){var e=this._getContainerSize();e&&(this._setContainerMeasure(e.width,!0),this._setContainerMeasure(e.height,!1))}},c._getContainerSize=d,c._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},c._emitCompleteOnItems=function(t,e){function i(){n.dispatchEvent(t+"Complete",null,[e])}function o(){r++,r==s&&i()}var n=this,s=e.length;if(!e||!s)return void i();var r=0;e.forEach(function(e){e.once(t,o)})},c.dispatchEvent=function(t,e,i){var o=e?[e].concat(i):i;if(this.emitEvent(t,o),h)if(this.$element=this.$element||h(this.element),e){var n=h.Event(e);n.type=t,this.$element.trigger(n,i)}else this.$element.trigger(t,i)},c.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},c.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},c.stamp=function(t){t=this._find(t),t&&(this.stamps=this.stamps.concat(t),t.forEach(this.ignore,this))},c.unstamp=function(t){t=this._find(t),t&&t.forEach(function(t){o.removeFrom(this.stamps,t),this.unignore(t)},this)},c._find=function(t){if(t)return"string"==typeof t&&(t=this.element.querySelectorAll(t)),t=o.makeArray(t)},c._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this))},c._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},c._manageStamp=d,c._getElementOffset=function(t){var e=t.getBoundingClientRect(),o=this._boundingRect,n=i(t),s={left:e.left-o.left-n.marginLeft,top:e.top-o.top-n.marginTop,right:o.right-e.right-n.marginRight,bottom:o.bottom-e.bottom-n.marginBottom};return s},c.handleEvent=o.handleEvent,c.bindResize=function(){t.addEventListener("resize",this),this.isResizeBound=!0},c.unbindResize=function(){t.removeEventListener("resize",this),this.isResizeBound=!1},c.onresize=function(){this.resize()},o.debounceMethod(s,"onresize",100),c.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},c.needsResizeLayout=function(){var t=i(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},c.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},c.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},c.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},c.reveal=function(t){if(this._emitCompleteOnItems("reveal",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.reveal()})}},c.hide=function(t){if(this._emitCompleteOnItems("hide",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.hide()})}},c.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e)},c.hideItemElements=function(t){var e=this.getItems(t);this.hide(e)},c.getItem=function(t){for(var e=0;e<this.items.length;e++){var i=this.items[e];if(i.element==t)return i}},c.getItems=function(t){t=o.makeArray(t);var e=[];return t.forEach(function(t){var i=this.getItem(t);i&&e.push(i)},this),e},c.remove=function(t){var e=this.getItems(t);this._emitCompleteOnItems("remove",e),e&&e.length&&e.forEach(function(t){t.remove(),o.removeFrom(this.items,t)},this)},c.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="",this.items.forEach(function(t){t.destroy()}),this.unbindResize();var e=this.element.outlayerGUID;delete f[e],delete this.element.outlayerGUID,h&&h.removeData(this.element,this.constructor.namespace)},s.data=function(t){t=o.getQueryElement(t);var e=t&&t.outlayerGUID;return e&&f[e]},s.create=function(t,e){var i=r(s);return i.defaults=o.extend({},s.defaults),o.extend(i.defaults,e),i.compatOptions=o.extend({},s.compatOptions),i.namespace=t,i.data=s.data,i.Item=r(n),o.htmlInit(i,t),h&&h.bridget&&h.bridget(t,i),i};var m={ms:1,s:1e3};return s.Item=n,s}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/item",["outlayer/outlayer"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer")):(t.Isotope=t.Isotope||{},t.Isotope.Item=e(t.Outlayer))}(window,function(t){"use strict";function e(){t.Item.apply(this,arguments)}var i=e.prototype=Object.create(t.Item.prototype),o=i._create;i._create=function(){this.id=this.layout.itemGUID++,o.call(this),this.sortData={}},i.updateSortData=function(){if(!this.isIgnored){this.sortData.id=this.id,this.sortData["original-order"]=this.id,this.sortData.random=Math.random();var t=this.layout.options.getSortData,e=this.layout._sorters;for(var i in t){var o=e[i];this.sortData[i]=o(this.element,this)}}};var n=i.destroy;return i.destroy=function(){n.apply(this,arguments),this.css({display:""})},e}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/layout-mode",["get-size/get-size","outlayer/outlayer"],e):"object"==typeof module&&module.exports?module.exports=e(require("get-size"),require("outlayer")):(t.Isotope=t.Isotope||{},t.Isotope.LayoutMode=e(t.getSize,t.Outlayer))}(window,function(t,e){"use strict";function i(t){this.isotope=t,t&&(this.options=t.options[this.namespace],this.element=t.element,this.items=t.filteredItems,this.size=t.size)}var o=i.prototype,n=["_resetLayout","_getItemLayoutPosition","_manageStamp","_getContainerSize","_getElementOffset","needsResizeLayout","_getOption"];return n.forEach(function(t){o[t]=function(){return e.prototype[t].apply(this.isotope,arguments)}}),o.needsVerticalResizeLayout=function(){var e=t(this.isotope.element),i=this.isotope.size&&e;return i&&e.innerHeight!=this.isotope.size.innerHeight},o._getMeasurement=function(){this.isotope._getMeasurement.apply(this,arguments)},o.getColumnWidth=function(){this.getSegmentSize("column","Width")},o.getRowHeight=function(){this.getSegmentSize("row","Height")},o.getSegmentSize=function(t,e){var i=t+e,o="outer"+e;if(this._getMeasurement(i,o),!this[i]){var n=this.getFirstItemSize();this[i]=n&&n[o]||this.isotope.size["inner"+e]}},o.getFirstItemSize=function(){var e=this.isotope.filteredItems[0];return e&&e.element&&t(e.element)},o.layout=function(){this.isotope.layout.apply(this.isotope,arguments)},o.getSize=function(){this.isotope.getSize(),this.size=this.isotope.size},i.modes={},i.create=function(t,e){function n(){i.apply(this,arguments)}return n.prototype=Object.create(o),n.prototype.constructor=n,e&&(n.options=e),n.prototype.namespace=t,i.modes[t]=n,n},i}),function(t,e){"function"==typeof define&&define.amd?define("masonry-layout/masonry",["outlayer/outlayer","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer"),require("get-size")):t.Masonry=e(t.Outlayer,t.getSize)}(window,function(t,e){var i=t.create("masonry");i.compatOptions.fitWidth="isFitWidth";var o=i.prototype;return o._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var t=0;t<this.cols;t++)this.colYs.push(0);this.maxY=0,this.horizontalColIndex=0},o.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}var o=this.columnWidth+=this.gutter,n=this.containerWidth+this.gutter,s=n/o,r=o-n%o,a=r&&r<1?"round":"floor";s=Math[a](s),this.cols=Math.max(s,1)},o.getContainerWidth=function(){var t=this._getOption("fitWidth"),i=t?this.element.parentNode:this.element,o=e(i);this.containerWidth=o&&o.innerWidth},o._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=e&&e<1?"round":"ceil",o=Math[i](t.size.outerWidth/this.columnWidth);o=Math.min(o,this.cols);for(var n=this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition",s=this[n](o,t),r={x:this.columnWidth*s.col,y:s.y},a=s.y+t.size.outerHeight,u=o+s.col,h=s.col;h<u;h++)this.colYs[h]=a;return r},o._getTopColPosition=function(t){var e=this._getTopColGroup(t),i=Math.min.apply(Math,e);return{col:e.indexOf(i),y:i}},o._getTopColGroup=function(t){if(t<2)return this.colYs;for(var e=[],i=this.cols+1-t,o=0;o<i;o++)e[o]=this._getColGroupY(o,t);return e},o._getColGroupY=function(t,e){if(e<2)return this.colYs[t];var i=this.colYs.slice(t,t+e);return Math.max.apply(Math,i)},o._getHorizontalColPosition=function(t,e){var i=this.horizontalColIndex%this.cols,o=t>1&&i+t>this.cols;i=o?0:i;var n=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=n?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},o._manageStamp=function(t){var i=e(t),o=this._getElementOffset(t),n=this._getOption("originLeft"),s=n?o.left:o.right,r=s+i.outerWidth,a=Math.floor(s/this.columnWidth);a=Math.max(0,a);var u=Math.floor(r/this.columnWidth);u-=r%this.columnWidth?0:1,u=Math.min(this.cols-1,u);for(var h=this._getOption("originTop"),d=(h?o.top:o.bottom)+i.outerHeight,l=a;l<=u;l++)this.colYs[l]=Math.max(d,this.colYs[l])},o._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},o._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},o.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/layout-modes/masonry",["../layout-mode","masonry-layout/masonry"],e):"object"==typeof module&&module.exports?module.exports=e(require("../layout-mode"),require("masonry-layout")):e(t.Isotope.LayoutMode,t.Masonry)}(window,function(t,e){"use strict";var i=t.create("masonry"),o=i.prototype,n={_getElementOffset:!0,layout:!0,_getMeasurement:!0};for(var s in e.prototype)n[s]||(o[s]=e.prototype[s]);var r=o.measureColumns;o.measureColumns=function(){this.items=this.isotope.filteredItems,r.call(this)};var a=o._getOption;return o._getOption=function(t){return"fitWidth"==t?void 0!==this.options.isFitWidth?this.options.isFitWidth:this.options.fitWidth:a.apply(this.isotope,arguments)},i}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/layout-modes/fit-rows",["../layout-mode"],e):"object"==typeof exports?module.exports=e(require("../layout-mode")):e(t.Isotope.LayoutMode)}(window,function(t){"use strict";var e=t.create("fitRows"),i=e.prototype;return i._resetLayout=function(){this.x=0,this.y=0,this.maxY=0,this._getMeasurement("gutter","outerWidth")},i._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth+this.gutter,i=this.isotope.size.innerWidth+this.gutter;0!==this.x&&e+this.x>i&&(this.x=0,this.y=this.maxY);var o={x:this.x,y:this.y};return this.maxY=Math.max(this.maxY,this.y+t.size.outerHeight),this.x+=e,o},i._getContainerSize=function(){return{height:this.maxY}},e}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/layout-modes/vertical",["../layout-mode"],e):"object"==typeof module&&module.exports?module.exports=e(require("../layout-mode")):e(t.Isotope.LayoutMode)}(window,function(t){"use strict";var e=t.create("vertical",{horizontalAlignment:0}),i=e.prototype;return i._resetLayout=function(){this.y=0},i._getItemLayoutPosition=function(t){t.getSize();var e=(this.isotope.size.innerWidth-t.size.outerWidth)*this.options.horizontalAlignment,i=this.y;return this.y+=t.size.outerHeight,{x:e,y:i}},i._getContainerSize=function(){return{height:this.y}},e}),function(t,e){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","desandro-matches-selector/matches-selector","fizzy-ui-utils/utils","isotope-layout/js/item","isotope-layout/js/layout-mode","isotope-layout/js/layout-modes/masonry","isotope-layout/js/layout-modes/fit-rows","isotope-layout/js/layout-modes/vertical"],function(i,o,n,s,r,a){return e(t,i,o,n,s,r,a)}):"object"==typeof module&&module.exports?module.exports=e(t,require("outlayer"),require("get-size"),require("desandro-matches-selector"),require("fizzy-ui-utils"),require("isotope-layout/js/item"),require("isotope-layout/js/layout-mode"),require("isotope-layout/js/layout-modes/masonry"),require("isotope-layout/js/layout-modes/fit-rows"),require("isotope-layout/js/layout-modes/vertical")):t.Isotope=e(t,t.Outlayer,t.getSize,t.matchesSelector,t.fizzyUIUtils,t.Isotope.Item,t.Isotope.LayoutMode)}(window,function(t,e,i,o,n,s,r){function a(t,e){return function(i,o){for(var n=0;n<t.length;n++){var s=t[n],r=i.sortData[s],a=o.sortData[s];if(r>a||r<a){var u=void 0!==e[s]?e[s]:e,h=u?1:-1;return(r>a?1:-1)*h}}return 0}}var u=t.jQuery,h=String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^\s+|\s+$/g,"")},d=e.create("isotope",{layoutMode:"masonry",isJQueryFiltering:!0,sortAscending:!0});d.Item=s,d.LayoutMode=r;var l=d.prototype;l._create=function(){this.itemGUID=0,this._sorters={},this._getSorters(),e.prototype._create.call(this),this.modes={},this.filteredItems=this.items,this.sortHistory=["original-order"];for(var t in r.modes)this._initLayoutMode(t)},l.reloadItems=function(){this.itemGUID=0,e.prototype.reloadItems.call(this)},l._itemize=function(){for(var t=e.prototype._itemize.apply(this,arguments),i=0;i<t.length;i++){var o=t[i];o.id=this.itemGUID++}return this._updateItemsSortData(t),t},l._initLayoutMode=function(t){var e=r.modes[t],i=this.options[t]||{};this.options[t]=e.options?n.extend(e.options,i):i,this.modes[t]=new e(this)},l.layout=function(){return!this._isLayoutInited&&this._getOption("initLayout")?void this.arrange():void this._layout()},l._layout=function(){var t=this._getIsInstant();this._resetLayout(),this._manageStamps(),this.layoutItems(this.filteredItems,t),this._isLayoutInited=!0},l.arrange=function(t){this.option(t),this._getIsInstant();var e=this._filter(this.items);this.filteredItems=e.matches,this._bindArrangeComplete(),this._isInstant?this._noTransition(this._hideReveal,[e]):this._hideReveal(e),this._sort(),this._layout()},l._init=l.arrange,l._hideReveal=function(t){this.reveal(t.needReveal),this.hide(t.needHide)},l._getIsInstant=function(){var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;return this._isInstant=e,e},l._bindArrangeComplete=function(){function t(){e&&i&&o&&n.dispatchEvent("arrangeComplete",null,[n.filteredItems])}var e,i,o,n=this;this.once("layoutComplete",function(){e=!0,t()}),this.once("hideComplete",function(){i=!0,t()}),this.once("revealComplete",function(){o=!0,t()})},l._filter=function(t){var e=this.options.filter;e=e||"*";for(var i=[],o=[],n=[],s=this._getFilterTest(e),r=0;r<t.length;r++){var a=t[r];if(!a.isIgnored){var u=s(a);u&&i.push(a),u&&a.isHidden?o.push(a):u||a.isHidden||n.push(a)}}return{matches:i,needReveal:o,needHide:n}},l._getFilterTest=function(t){
return u&&this.options.isJQueryFiltering?function(e){return u(e.element).is(t)}:"function"==typeof t?function(e){return t(e.element)}:function(e){return o(e.element,t)}},l.updateSortData=function(t){var e;t?(t=n.makeArray(t),e=this.getItems(t)):e=this.items,this._getSorters(),this._updateItemsSortData(e)},l._getSorters=function(){var t=this.options.getSortData;for(var e in t){var i=t[e];this._sorters[e]=f(i)}},l._updateItemsSortData=function(t){for(var e=t&&t.length,i=0;e&&i<e;i++){var o=t[i];o.updateSortData()}};var f=function(){function t(t){if("string"!=typeof t)return t;var i=h(t).split(" "),o=i[0],n=o.match(/^\[(.+)\]$/),s=n&&n[1],r=e(s,o),a=d.sortDataParsers[i[1]];return t=a?function(t){return t&&a(r(t))}:function(t){return t&&r(t)}}function e(t,e){return t?function(e){return e.getAttribute(t)}:function(t){var i=t.querySelector(e);return i&&i.textContent}}return t}();d.sortDataParsers={parseInt:function(t){return parseInt(t,10)},parseFloat:function(t){return parseFloat(t)}},l._sort=function(){if(this.options.sortBy){var t=n.makeArray(this.options.sortBy);this._getIsSameSortBy(t)||(this.sortHistory=t.concat(this.sortHistory));var e=a(this.sortHistory,this.options.sortAscending);this.filteredItems.sort(e)}},l._getIsSameSortBy=function(t){for(var e=0;e<t.length;e++)if(t[e]!=this.sortHistory[e])return!1;return!0},l._mode=function(){var t=this.options.layoutMode,e=this.modes[t];if(!e)throw new Error("No layout mode: "+t);return e.options=this.options[t],e},l._resetLayout=function(){e.prototype._resetLayout.call(this),this._mode()._resetLayout()},l._getItemLayoutPosition=function(t){return this._mode()._getItemLayoutPosition(t)},l._manageStamp=function(t){this._mode()._manageStamp(t)},l._getContainerSize=function(){return this._mode()._getContainerSize()},l.needsResizeLayout=function(){return this._mode().needsResizeLayout()},l.appended=function(t){var e=this.addItems(t);if(e.length){var i=this._filterRevealAdded(e);this.filteredItems=this.filteredItems.concat(i)}},l.prepended=function(t){var e=this._itemize(t);if(e.length){this._resetLayout(),this._manageStamps();var i=this._filterRevealAdded(e);this.layoutItems(this.filteredItems),this.filteredItems=i.concat(this.filteredItems),this.items=e.concat(this.items)}},l._filterRevealAdded=function(t){var e=this._filter(t);return this.hide(e.needHide),this.reveal(e.matches),this.layoutItems(e.matches,!0),e.matches},l.insert=function(t){var e=this.addItems(t);if(e.length){var i,o,n=e.length;for(i=0;i<n;i++)o=e[i],this.element.appendChild(o.element);var s=this._filter(e).matches;for(i=0;i<n;i++)e[i].isLayoutInstant=!0;for(this.arrange(),i=0;i<n;i++)delete e[i].isLayoutInstant;this.reveal(s)}};var c=l.remove;return l.remove=function(t){t=n.makeArray(t);var e=this.getItems(t);c.call(this,t);for(var i=e&&e.length,o=0;i&&o<i;o++){var s=e[o];n.removeFrom(this.filteredItems,s)}},l.shuffle=function(){for(var t=0;t<this.items.length;t++){var e=this.items[t];e.sortData.random=Math.random()}this.options.sortBy="random",this._sort(),this._layout()},l._noTransition=function(t,e){var i=this.options.transitionDuration;this.options.transitionDuration=0;var o=t.apply(this,e);return this.options.transitionDuration=i,o},l.getFilteredItemElements=function(){return this.filteredItems.map(function(t){return t.element})},d});
jQuery(function($) {portfolioModuleInitialize();});function portfolioModuleInitialize() {$( document ).on( 's123.page.ready', function( event ) {var $section = $('section.s123-module-portfolio.layout-4');if ( $section.length === 0 ) return;$section.each(function( index ) {var $sectionThis = $(this);if ( is_touch_device() ) {$sectionThis.addClass('touch-device');}});});}
jQuery(function($) {headersModuleInitialize_Layout();});function headersModuleInitialize_Layout() {$( document ).on( "s123.page.ready", function( event ) {var $sections = $('section.s123-module-headers:is(.layout-6,.layout-7,.layout-8,.layout-9,.layout-18,.layout-20,.layout-22,.layout-23,.layout-24,.layout-25,.layout-26,.layout-27,.layout-29,.layout-30,.layout-35,.layout-39,.layout-40,.mobile-layout-1,.mobile-layout-3,.mobile-layout-7,.mobile-layout-8,.mobile-layout-11');$sections.each(function( index ) {var $s = $(this);var $carousel = $s.find('[data-ride="carousel"]');var sliderSpeed = $s.data('slider-speed');if ( sliderSpeed == '' || parseInt(sliderSpeed) < 1 || parseInt(sliderSpeed) > 21 ) {sliderSpeed = 5000;} else {sliderSpeed = parseInt(sliderSpeed) * 1000;}
$s.find('.header1, .header2').each(function( index ) {var $this = $(this);if ( $this.data('line-height') && $this.data('line-height').length > 0 ) {$this.get(0).style.setProperty('--header_line_height',$this.data('line-height'));$this.css('line-height',$this.data('line-height'));}});if( $s.hasClass('layout-20') ) {var $firstImage = $s.find('.headers-image').first();if ( $firstImage.length > 0 ) {if ( $firstImage.data('bg') !== undefined ) {var img = new Image();img.src = $firstImage.data('bg');img.onload = function() {var aspectRatio = this.width / this.height;$s.find('.headers-image').css('aspect-ratio',String(aspectRatio));if( $s.find('.headers-container').hasClass('circle-under-image') && aspectRatio < 1 ) {$s.addClass('corner-circle');}};} else {$firstImage.closest('.headers-img-wrap').addClass('circle-fixed-width');}}}
if( $s.hasClass('layout-22') || $s.hasClass('layout-29') || $s.hasClass('mobile-layout-7') ) {var $headersDescription = $s.find('.headers-description');var $headersimage = $s.find('.headers-image');if ( $headersimage.length == 0 ) {$headersimage = $s.find('.headers-bg-video');}
if ( $headersimage.length > 0 && $headersDescription.length > 0 ) {if ( ($headersDescription.get(0).offsetHeight - 60) > $headersimage.get(0).offsetHeight ) {$s.get(0).style.setProperty('--headers-description-height',$headersDescription.get(0).offsetHeight+'px');}}}
$carousel.carousel({interval: sliderSpeed});if( $s.hasClass('layout-26') && $s.attr('data-version') !== undefined && $s.attr('data-version') == '2' ) {if ( IsWizard() ) {$(document).on('site123.colorPicker.change',function( event ) {updateBackgroundColor();});}
updateBackgroundColor();}
function updateBackgroundColor() {var boxColorClass = $s.data('box-color');var color = $s.hasClass('bg-primary') ?getComputedStyle(document.documentElement).getPropertyValue('--modules_color_box') :getComputedStyle(document.documentElement).getPropertyValue('--modules_color_second_box');switch (boxColorClass) {case 'bg-primary-gray':color = '#ebedf0';break;case 'bg-primary-white':color = '#ffffff';break;case 'bg-primary-black':color = '#000000';break;case 'background-primary-color btn-primary-text-color':color = $s.hasClass('bg-primary') ?getComputedStyle(document.documentElement).getPropertyValue('--modules_color_section_main') :getComputedStyle(document.documentElement).getPropertyValue('--modules_color_second_section_main');break;}
$s.find('.headers-img-wrap').get(0).style.setProperty('--layout26OpacityColor',hexToRGB(color));}
function hexToRGB(hex) {var r = parseInt(hex.slice(1, 3), 16),g = parseInt(hex.slice(3, 5), 16),b = parseInt(hex.slice(5, 7), 16);return r + ", " + g + ", " + b;}
if( $s.data('image-width') == 2 ) {var sectionHeight = $s.height();$s.find('.headers-container').css('min-height',sectionHeight+'px');if( $s.hasClass('layout-22') ) {$s.find('.headers-image').css('min-height',sectionHeight+'px');}
$s.data('image-width',0);}});var $sections = $('section.s123-module-headers');$sections.each(function( index ) {var $s = $(this);$s.find('.custom-header-font').each(function( index ) {var $this = $(this);var customFont = $this.data('custom-font');if ( customFont.length > 0 ) {$this.css('font-family',customFont);}});$s.find('.header1, .header2').each(function( index ) {var $this = $(this);if( $s.hasClass('layout-7') || $s.hasClass('layout-9') || $s.hasClass('layout-22') || $s.hasClass('layout-23') || $s.hasClass('layout-24') || $s.hasClass('layout-26') || $s.hasClass('layout-27') || $s.hasClass('layout-29') || $s.hasClass('layout-33') || $s.hasClass('mobile-layout-1') || $s.hasClass('mobile-layout-7') ) {fitHeaderTextToParentContainer($this);}});$s.find('.h-s-form').each(function( index ) {let $this = $(this);hotelBookingWidgetInit($this);$this.off('submit').on('submit', function(event) {event.preventDefault();window.location.href = '/'+ $this.find('[data-id="page"] option').val() + '?' + $this.serialize();});});function fitHeaderTextToParentContainer( $textEl ) {if ( $textEl.length == 0 ) return;fontSize = parseFloat($textEl.css('font-size'));if ( !$.isNumeric(fontSize) ) return;var $parentContainer = $textEl.closest('.headers-text-resize-container');if ( $parentContainer.length > 0 && $parentContainer.width() < $textEl.width() ) {$textEl.css('visibility','hidden');var parentContainerWidth = $parentContainer.width();if ( $textEl.closest('section').hasClass('layout-9') || $textEl.closest('section').hasClass('layout-27') || $textEl.closest('section').hasClass('mobile-layout-1') ) {parentContainerWidth = parentContainerWidth + 5;}
if ( $textEl.closest('section').hasClass('layout-23') ) {parentContainerWidth = $parentContainer.innerWidth();}
var index = 0;while ( parentContainerWidth < $textEl.width() && index < 99 ) {index++;fontSize--;$textEl.get(0).style.setProperty('--header-font-size',fontSize);}
$textEl.css('visibility','unset');}}});S123_ActionButtons.init();});}
jQuery(function($) {HeadersModuleInitialize_Layout5();});function HeadersModuleInitialize_Layout5() {$( document ).on( 's123.page.ready', function( event ) {var $section = $('section.s123-module-headers.layout-5');$section.each(function( index ) {var $sectionThis = $(this);var $flickityContainer = $sectionThis.find('.carousel');var originalFirstImageSize = {};if ( $flickityContainer.length === 0 ) return;$flickityContainer.flickity({imagesLoaded: true,lazyLoad: 2,pageDots: false,wrapAround: true,percentPosition: false});});});}
jQuery(function($) {HeadersModuleInitialize_Layout30();});function HeadersModuleInitialize_Layout30() {$( document ).on( 's123.page.ready', function( event ) {var $section = $('section.s123-module-headers.layout-30, section.s123-module-headers.mobile-layout-11');$section.each(function( index ) {var $sectionThis = $(this);$sectionThis.find('.contactUsForm').each( function( index ) {var $form = $(this);var customFormMultiSteps = new CustomFormMultiSteps();customFormMultiSteps.init({$form: $form,$nextButton: $form.find('.next-form-btn'),$submitButton: $form.find('.submit-form-btn'),$previousButton: $form.find('.previous-form-btn'),totalSteps: $form.find('.custom-form-steps').data('total-steps')});var forms_GoogleRecaptcha = new Forms_GoogleRecaptcha();forms_GoogleRecaptcha.init($form);$form.validate({errorElement: 'div',errorClass: 'help-block',focusInvalid: true,ignore: ':hidden:not(.custom-form-step:visible input[name^="datePicker-"])',highlight: function (e) {$(e).closest('.form-group').removeClass('has-info').addClass('has-error');},success: function (e) {$(e).closest('.form-group').removeClass('has-error');$(e).remove();},errorPlacement: function (error, element) {if( element.is('input[type=checkbox]') || element.is('input[type=radio]') ) {var controls = element.closest('div[class*="col-"]');if( controls.find(':checkbox,:radio').length > 0 ) element.closest('.form-group').append(error);else error.insertAfter(element.nextAll('.lbl:eq(0)').eq(0));}
else if( element.is('.select2') ) {error.insertAfter(element.siblings('[class*="select2-container"]:eq(0)'));}
else if( element.is('.chosen-select') ) {error.insertAfter(element.siblings('[class*="chosen-container"]:eq(0)'));}
else {error.appendTo(element.closest('.form-group'));}},submitHandler: function( form ) {var $form = $(form);var clickAction = $form.data('click-action');$form.append($('<div class="conv-code-container"></div>'));var $convCodeContainer = $form.find('.conv-code-container');var thankYouMessage = translations.ThankYouAfterSubmmit;if ( $form.data('thanks-msg') ) {thankYouMessage = $form.data('thanks-msg');}
$form.find('button:submit').prop('disabled', true);S123.ButtonLoading.start($form.find('button:submit'));var url = "/versions/2/include/contactO.php";if ( $form.hasClass('custom-form') || $form.hasClass('horizontal-custom-form') ) {if ( !CustomForm_IsLastStep( $form ) ) {$form.find('.next-form-btn:visible').trigger('click');S123.ButtonLoading.stop($form.find('button:submit'));$form.find('button:submit').prop('disabled', false);return false;}
if ( !CustomForm_IsFillOutAtLeastOneField($form) ) {bootbox.alert(translations.fillOutAtLeastOneField);S123.ButtonLoading.stop($form.find('button:submit'));$form.find('button:submit').prop('disabled', false);return false;}
url = "/versions/2/include/customFormO.php";}
if ( forms_GoogleRecaptcha.isActive && !forms_GoogleRecaptcha.isGotToken ) {forms_GoogleRecaptcha.getToken();return false;}
$.ajax({type: "POST",url: url,data: $form.serialize(),success: function( data ) {var dataObj = jQuery.parseJSON(data);$form.trigger("reset");if ( clickAction == 'thankYouMessage' || clickAction == '' ) {bootbox.alert({title: translations.sent,message: thankYouMessage+'<iframe src="/versions/2/include/contactSentO.php?w='+$('#w').val()+'&websiteID='+dataObj.websiteID+'&moduleID='+dataObj.moduleID+'" style="width:100%;height:30px;" frameborder="0"></iframe>',className: 'contactUsConfirm',buttons: {ok: {label: translations.Ok}},backdrop: true});} else {if ( dataObj.conv_code.length > 0 ) {var $convCode = $('<div>' + dataObj.conv_code + '</div>');$convCodeContainer.html($convCode.text());}
if( top.$('#websitePreviewIframe').length ) {bootbox.alert({title: translations.previewExternalLinkTitle,message: translations.previewExternalLinkMsg.replace('{{externalLink}}','<b>'+dataObj.action.url+'</b>'),className: 'externalAlert'});} else {window.open(dataObj.action.url,'_self');}}
customFormMultiSteps.reset();forms_GoogleRecaptcha.reset();S123.ButtonLoading.stop($form.find('button:submit'));$form.find('button:submit').prop('disabled', false);WizardNotificationUpdate();}});return false;}});$form.find('.f-b-date-timePicker').each( function() {var $option = $(this);var $datePicker = $option.find('.fake-input.date-time-picker');var $hiddenInput = $option.find('[data-id="'+$datePicker.data('related-id')+'"]');var $datePickerIcon = $option.find('.f-b-date-timePicker-icon');var formBuilderCalendar = new calendar_handler();$datePicker.data('date-format',$form.data('date-format'));formBuilderCalendar.init({$fakeInput: $datePicker,$hiddenInput: $hiddenInput,$fakeInputIcon: $datePickerIcon,type: 'datePicker',title: translations.chooseDate,calendarSettings: {format: $datePicker.data('date-format'),weekStart: 0,todayBtn: "linked",clearBtn: false,language: languageCode,todayHighlight: true},onSubmit: function( selectedDate ) {$datePicker.html(selectedDate);$hiddenInput.val(selectedDate);}});});CustomForm_DisableTwoColumns($form);});});});}
