// source --> https://styleindia.com.au/wp-content/plugins/et-core-plugin/packages/st-woo-swatches/public/js/frontend.js var $ = jQuery.noConflict(), ST_WC_FRONT_SWATCH = ST_WC_FRONT_SWATCH || {}; (function($){ "use strict"; ST_WC_FRONT_SWATCH.onSelect = function() { $("body").on("click", "ul.st-swatch-preview span.st-custom-attribute", function(){ if ( $(this).parents().is( '.swiper-entry, .products-loop, .quick-view-popup' ) ) return; var $attribute = $(this).closest("[data-attribute]").data("attribute"), $select = $("select#"+$attribute ), $name = $(this).data("name"), $value = $(this).data("value"), $li = $(this).parent("li"); // Check if this combination is available // var $swatches = $(this).parents('.variations_form.cart'); // var $variations = $.parseJSON( $swatches.attr("data-product_variations") ); // ST_WC_FRONT_SWATCH.productLoop.updateAttributes( $swatches, $variations ); if ( ! $select.find( 'option[value="' + $value + '"]' ).length ) { $select.val(" ").trigger("change"); $li.siblings().removeClass("selected"); window.alert( wc_add_to_cart_variation_params.i18n_no_matching_variations_text ); return; } if( $li.hasClass("selected") ) { $li.removeClass("selected"); $select.val(" "); if( sten_wc_params.is_singular_product == 1 && sten_wc_params.is_customize_preview ) { $li.css({ 'border-color':$li.data("border-color") }); } } else { $li.addClass('selected').siblings().removeClass("selected"); $select.val( $value ); if( sten_wc_params.is_singular_product == 1 && sten_wc_params.is_customize_preview ) { $li.removeAttr("style"); $li.siblings().css({ 'border-color':$li.data("border-color") }); $li.css({ 'border-color':$li.data("active-border-color") }); } } $select.trigger("change"); }); }, ST_WC_FRONT_SWATCH.onSelectUpdateAttribute = function() { $("body.single-product form.variations_form").on('woocommerce_update_variation_values', function(){ $( this ).find("ul.st-swatch-preview").each(function(){ var $this = this, $attribute = $($this).data("attribute"), $select = document.getElementById( $attribute ), // $("select#"+$attribute ), - it has issues in other languages ( jquery selector doesn't accepts special chars ) $options = $($select).find("option"), $eq = $($select).find("option").eq(1), $li = $($this).find("li"), $current = $($select).find("option:selected"), $selects = [], $selected = ''; $options.each(function(){ if ($(this).val() !== '') { $selects.push( $(this).val() ); $selected = $current ? $current.val() : $eq.val(); } }); $li.each(function(){ var $this = this, $value = $($this).find("span.st-custom-attribute").attr("data-value"); $($this).removeClass("selected sten-li-disabled").addClass("sten-li-disabled"); if( $selects.indexOf( $value.toString() ) !== -1 ) { $($this).removeClass("sten-li-disabled"); if( $value.toString() == $selected ) { $($this).addClass("selected"); } } }); }); }); }, ST_WC_FRONT_SWATCH.onClear = function(){ $("body.single-product").on("click", "a.reset_variations", function(){ var $selected = $(this).closest('form.variations_form').find("ul.st-swatch-preview li.selected"); $selected.removeClass( 'selected' ); if( sten_wc_params.is_singular_product == 1 && sten_wc_params.is_customize_preview ) { $selected.css({ 'border-color':$selected.data("border-color") }); } }); }, ST_WC_FRONT_SWATCH.productLoop = { init : function() { ST_WC_FRONT_SWATCH.productLoop.itemSwatches(); ST_WC_FRONT_SWATCH.productLoop.addToCart(); }, itemSwatches: function() { $("div.st-swatch-in-loop").each(function(){ var $swatches = $(this), $terms = $swatches.find("span.st-custom-attribute:not(.sten-disabled)"), $reset_btn = $swatches.find("a.sten-reset-loop-variation, .et-delete"), $product = $swatches.closest(".product-type-variable"), $variations = $.parseJSON( $swatches.attr("data-product_variations") ), $uls = $swatches.find("ul.has-default-attribute"); // force update for out of stock products ST_WC_FRONT_SWATCH.productLoop.updateAttributes( $swatches, $variations ); // !force update for out of stock products // enable variation default attribute by default in product loop $uls.each( function(){ var $ul = $(this), $ul_reset_btn = $ul.parent("div.st-swatch-in-loop").find("a.sten-reset-loop-variation"); $ul_reset_btn.show(); var $attributes = ST_WC_FRONT_SWATCH.productLoop.getChosenAttributes( $swatches ), $current_attributes = $attributes.data; if( $attributes.count === $attributes.chosenCount ) { ST_WC_FRONT_SWATCH.productLoop.updateAttributes( $swatches, $variations ); var $matching_variations = ST_WC_FRONT_SWATCH.productLoop.findMatchingVariations( $variations, $current_attributes ), $variation = $matching_variations.shift(); if( $variation ) { ST_WC_FRONT_SWATCH.productLoop.foundVariation( $product, $swatches, $variation ); } else { $ul_reset_btn.trigger( 'click' ); } } else { ST_WC_FRONT_SWATCH.productLoop.updateAttributes( $swatches, $variations ); } }); // swatch click $terms.on( "click", function(){ var $term = $(this), $li = $term.parent("li"); if( $term.hasClass('sten-disabled') ) { return false; } $product.find("span.st-custom-attribute").removeClass("sten-disabled sten-enabled"); $product.find("span.st-custom-attribute").parent("li").removeClass("sten-li-disabled sten-li-enabled"); if( $li.hasClass("selected") && sten_wc_params.is_customize_preview ) { $li.css({ 'border-color':$li.data("border-color") }); } if( !$li.hasClass("selected") ) { $li.addClass("selected").siblings().removeClass("selected"); if( sten_wc_params.is_customize_preview ) { $li.removeAttr("style"); $li.siblings().css({ 'border-color':$li.data("border-color") }); $li.css({ 'border-color':$li.data("active-border-color") }); } $reset_btn.show(); } var $attributes = ST_WC_FRONT_SWATCH.productLoop.getChosenAttributes( $swatches ), $current_attributes = $attributes.data; if( $attributes.count === $attributes.chosenCount ) { ST_WC_FRONT_SWATCH.productLoop.updateAttributes( $swatches, $variations ); var $matching_variations = ST_WC_FRONT_SWATCH.productLoop.findMatchingVariations( $variations, $current_attributes ), $variation = $matching_variations.shift(); if( $variation ) { ST_WC_FRONT_SWATCH.productLoop.foundVariation( $product, $swatches, $variation ); } else { $reset_btn.trigger( 'click' ); } } else { ST_WC_FRONT_SWATCH.productLoop.updateAttributes( $swatches, $variations ); } }); // reset click $reset_btn.on( "click", function(){ $swatches.removeAttr( 'data-variation_id' ); if( sten_wc_params.is_customize_preview ) { var $sel = $swatches.find("ul.st-swatch-preview li.selected"); $sel.css({ 'border-color':$sel.data("border-color") }); } $swatches.find("ul.st-swatch-preview li").removeClass("selected sten-li-disabled sten-li-enabled"); $swatches.find("ul.st-swatch-preview span").removeClass("sten-disabled sten-enabled"); $product.find("a.add_to_cart_button") .removeClass("st-swatch-btn-ready st-swatch-btn-readmore st-swatch-btn-text-changed added loading") .text( sten_wc_params.select_options_btn_text ); $product.find("a.added_to_cart").remove(); var $price = $product.find("span.price").not( '.price-cloned' ), $price_cloned = $product.find( '.price-cloned' ); if ( $price_cloned.length ) { $price.html( $price_cloned.html() ); $price_cloned.remove(); } // force update for out of stock products $variations = $.parseJSON( $swatches.attr("data-product_variations") ); ST_WC_FRONT_SWATCH.productLoop.updateAttributes( $swatches, $variations ); // !force update for out of stock products ST_WC_FRONT_SWATCH.productLoop.variationsImageUpdate( $product, false ); $(this).hide(); }); }); }, getChosenAttributes: function ( $swatches ) { var $data = {}, $count = 0, $chosen = 0, $swatch = $swatches.find("ul.st-swatch-preview"); $swatch.each(function(){ var $attr_name = 'attribute_' + $(this).data("attribute"), $value = $(this).find("li.selected span.st-custom-attribute").attr("data-value") || ''; $value = $value.toString(); if ( $value.length > 0 ) { $chosen++; } $count++; $data[ $attr_name ] = $value; }); return { 'count': $count, 'chosenCount': $chosen, 'data': $data, }; }, updateAttributes: function( $swatches, $variations ) { var $attributes = ST_WC_FRONT_SWATCH.productLoop.getChosenAttributes( $swatches ), $current_attributes = $attributes.data, $available_options_count = 0, $swatch = $swatches.find( 'ul.st-swatch-preview'); $swatch.each(function( $idx, $ele ){ var $current_attribute_swatch = $( $ele ), $current_attribute_name = "attribute_" + $current_attribute_swatch.data("attribute"), $selected_attr_val = $current_attribute_swatch.find("li.selected span.st-custom-attribute").data("value"), $selected_attr_val_valid = true, $check_attributes = $.extend( true, {}, $current_attributes ); $check_attributes[ $current_attribute_name ] = ''; var $matching_variations = ST_WC_FRONT_SWATCH.productLoop.findMatchingVariations( $variations, $check_attributes ); //console.log($matching_variations); // Loop through matching variations for( var $num in $matching_variations ) { if ( typeof $matching_variations[ $num ] !== 'undefined' ) { var $variation_attributes = $matching_variations[ $num ].attributes; for( var $attribute_name in $variation_attributes ) { if( $variation_attributes.hasOwnProperty( $attribute_name ) ) { var $attribute_val = $variation_attributes[ $attribute_name ], $variation_active = ''; if ( $attribute_name === $current_attribute_name ) { if ( $matching_variations[ $num ].variation_is_active ) { $variation_active = 'sten-enabled'; } // ! Add et-out-of-stock class // if ( ! $matching_variations[ $num ].is_in_stock ) { // $swatch.find( 'span.st-custom-attribute[data-value="' + $attribute_val + '"]' ).parent( "li" ).addClass( "et-out-of-stock" ); // } else { // $swatch.find( 'span.st-custom-attribute[data-value="' + $attribute_val + '"]' ).parent( "li" ).removeClass( "et-out-of-stock" ); // } if( $attribute_val ) { $current_attribute_swatch.find('span.st-custom-attribute[data-value="' + $attribute_val + '"]').addClass("sten-enabled"); } else { // apply for all swatches $current_attribute_swatch.find("span.st-custom-attribute").addClass("sten-enabled"); } } } } } } $available_options_count = $current_attribute_swatch.find('span.st-custom-attribute.sten-enabled' ).length; if ( $selected_attr_val && ( $available_options_count === 0 || $current_attribute_swatch .find('span.st-custom-attribute.sten-enabled[data-value="' + ST_WC_FRONT_SWATCH.productLoop.addSlashes( $selected_attr_val ) + '"]' ) .length === 0 ) ) { $selected_attr_val_valid = false; } // Disable terms if not available $current_attribute_swatch.find('span.st-custom-attribute:not(.sten-enabled)' ).addClass("sten-disabled"); $current_attribute_swatch.find('span.st-custom-attribute:not(.sten-enabled)' ).parent("li").addClass("sten-li-disabled"); // Choose selected value. if ( $selected_attr_val ) { // If the previously selected value is no longer available, // fall back to the placeholder (it's going to be there). if ( !$selected_attr_val_valid ) { $current_attribute_swatch.find("li.selected").removeClass('selected'); } } else { $current_attribute_swatch.find("li.selected").removeClass('selected'); } }); }, findMatchingVariations: function( $variations, $current_attributes ) { var $matching = []; for( var $i = 0; $i < $variations.length; $i++ ){ var $variation = $variations[$i]; if( ST_WC_FRONT_SWATCH.productLoop.isMatch( $variation.attributes, $current_attributes ) ) { $matching.push( $variation ); } } return $matching; }, isMatch: function( $variation_attributes, $current_attributes ) { var $match = true; for( var $attr_name in $variation_attributes ) { if( $variation_attributes.hasOwnProperty( $attr_name ) ) { var $val1 = $variation_attributes[ $attr_name ], $val2 = $current_attributes[ $attr_name ]; if( ( typeof $val1 !== "undefined" ) && ( typeof $val2 !== "undefined" ) && ( $val1.length !== 0 ) && ( $val2.length !== 0 ) && ( $val1 !== $val2 ) ) { $match = false; } } } return $match; }, foundVariation: function( $product, $swatches, $variation ) { var $price = $product.find("span.price").not( '.price-cloned' ), $price_clone = $price.clone().addClass( 'price-cloned' ).css( 'display', 'none' ); $swatches.attr("data-variation_id", $variation.variation_id ); if( $variation.price_html ) { if ( !$product.find( '.price-cloned' ).length ) { $product.append($price_clone); } $price.replaceWith( $variation.price_html ); } else { if ( $product.find( '.price-cloned' ).length ) { $price.replaceWith( $price_clone.html() ); $price_clone.remove(); } } // Update Image ST_WC_FRONT_SWATCH.productLoop.variationsImageUpdate( $product, $variation ); // change add to cart button text ST_WC_FRONT_SWATCH.productLoop.changeAddToCartBtnText( $product, $variation ); }, variationsImageUpdate: function( $product, $variation ) { var $product_img = $product.find("img.wp-post-image, img.attachment-woocommerce_thumbnail"); var $parent = $product.find( '.st-swatch-in-loop' ); // ! Etheme change sku for product quick-view-popup if ( $parent.parents().is( '.quick-view-popup' ) ) { if ( $variation.sku ) { if ( ! $( '.sku_wrapper .sku' ).attr( 'data-o_content' ) ) { $( '.sku_wrapper .sku' ).attr( 'data-o_content' , $( '.sku_wrapper .sku' ).html() ); } $( '.sku_wrapper .sku' ).html( $variation.sku ); } else { $( '.sku_wrapper .sku' ).html( $( '.sku_wrapper .sku' ).attr( 'data-o_content' ) ); } } if ( $parent.parents().is( '.quick-view-popup' ) && $variation && $variation.st_image_src && $variation.image.src && $variation.st_image_src.length > 1 ) { // ST_WC_FRONT_SWATCH.productLoop.setVariationAttr( $product_img, 'src', $variation.st_image_src[0] ); // ST_WC_FRONT_SWATCH.productLoop.setVariationAttr( $product_img, 'srcset', $variation.st_image_src[0] ); // ST_WC_FRONT_SWATCH.productLoop.setVariationAttr( $product_img, 'sizes', $variation.image.sizes ); ST_WC_FRONT_SWATCH.productLoop.setVariationAttr( $product_img, 'src', $variation.image.full_src ); ST_WC_FRONT_SWATCH.productLoop.setVariationAttr( $product_img, 'srcset', $variation.image.full_src ); ST_WC_FRONT_SWATCH.productLoop.setVariationAttr( $product_img, 'sizes', $variation.sizes ); if ( etTheme !== undefined ) { etTheme.setVariationsGallery($($parent).parents('.quick-view-popup'), $variation); } } else if( $variation && $variation.st_image_src && $variation.image.src && $variation.st_image_src.length > 1 ) { if ( $product_img.parents().is( '.product-image-wrapper' ) ) { var image_wrap = $( $product_img ).parents( '.product-image-wrapper' ); var image_link = image_wrap.find('.product-content-image'); if ( !$parent.is('.st-swatch-popup') ) { image_wrap.addClass( 'variation-changed' ); } if ( etTheme !== undefined && etConfig.archiveVariationGallery ) { if ( $(image_link).attr('data-default-images') === undefined ) { $(image_link).attr('data-default-images', $(image_link).attr('data-images') ); } $(image_link).attr('data-images', $variation.variation_images_string.join(',') ); etTheme.contentProdImages(); } } ST_WC_FRONT_SWATCH.productLoop.setVariationAttr( $product_img, 'src', $variation.st_image_src[0] ); ST_WC_FRONT_SWATCH.productLoop.setVariationAttr( $product_img, 'srcset', $variation.st_image_srcset ); ST_WC_FRONT_SWATCH.productLoop.setVariationAttr( $product_img, 'sizes', $variation.st_image_sizes ); } else { if ( $product_img.parents().is( '.product-image-wrapper' ) ) { var image_wrap = $( $product_img ).parents( '.product-image-wrapper' ); var image_link = image_wrap.find('.product-content-image'); if ( !$parent.is('.st-swatch-popup') ) { image_wrap.removeClass( 'variation-changed' ); } if ( etTheme !== undefined && etConfig.archiveVariationGallery ) { image_link.attr('data-images', image_link.attr('data-default-images')); image_link.attr('data-default-images', null); etTheme.contentProdImages(); } } ST_WC_FRONT_SWATCH.productLoop.resetVariationAttr( $product_img, 'src' ); ST_WC_FRONT_SWATCH.productLoop.resetVariationAttr( $product_img, 'srcset' ); ST_WC_FRONT_SWATCH.productLoop.resetVariationAttr( $product_img, 'sizes' ); if ( $($parent).parents().is( '.quick-view-popup' ) ) { if ( etTheme !== undefined ) { var defaultEmptySlider = $($parent).parents('.quick-view-popup').find('.swiper-control-top').attr('data-default-empty') == "true"; etTheme.resetVariationsGallery($($parent).parents('.quick-view-popup'), defaultEmptySlider); } } } }, changeAddToCartBtnText: function( $product, $variation ) { var $btn = $product.find("a.add_to_cart_button"), $txt = ''; $btn.removeClass("added"); if( Object.keys( $variation.attributes ).length === $product.find( "ul.st-swatch-preview" ).length ) { if ( $variation.is_in_stock === true ) { $txt = sten_wc_params.add_to_cart_btn_text; $btn.addClass("st-swatch-btn-ready").removeClass("st-swatch-btn-readmore"); } else { $txt = sten_wc_params.read_more_btn_text; $btn.addClass("st-swatch-btn-readmore").removeClass("st-swatch-btn-ready"); } } else { $txt = sten_wc_params.select_options_btn_text; $btn.removeClass( "st-swatch-btn-ready st-swatch-btn-readmore" ); } $btn.addClass( "st-swatch-btn-text-changed" ).text( $txt ); }, setVariationAttr: function ( $el, $attr, $value ) { if ( undefined === $el.attr( 'data-o_' + $attr ) ) { $el.attr( 'data-o_' + $attr, ( !$el.attr( $attr ) ) ? '' : $el.attr( $attr ) ); } if ( false === $value ) { $el.removeAttr( $attr ); } else { $el.attr( $attr, $value ); } }, resetVariationAttr: function ( $el, $attr ) { $el.parents( '.content-product, .product-content' ).find( '.et-out-of-stock' ).removeClass('et-out-of-stock'); if ( undefined !== $el.attr( 'data-o_' + $attr ) ) { $el.attr( $attr, $el.attr( 'data-o_' + $attr ) ); } if ( $el && $el.hasClass('lazyloaded') ) { $el.removeClass('lazyloaded').addClass('lazyload'); etTheme.global_image_lazy(); } }, addSlashes: function ( $string ) { $string = $string.toString(); $string = $string.replace( /'/g, '\\\'' ); $string = $string.replace( /"/g, '\\\"' ); return $string; }, addToCart: function(){ $(document).on("click", "a.product_type_variable.add_to_cart_button.st-swatch-btn-ready", function(e){ var $btn = $( this ), $swatches = $btn.closest(".product-type-variable").find("div.st-swatch-in-loop"), $variation_id = $swatches.attr( 'data-variation_id' ); if( typeof $variation_id == "undefined" || $variation_id == '' ) { return true; } var $product_id = $btn.data("product_id"), $quantity = $btn.data("quantity"), $item = {}; $swatches.find("ul.st-swatch-preview").each(function(){ var $attribute = $(this).data("attribute"), $attribute_val = $(this).find("li.selected span").data("value"); $item[ "attribute_" + $attribute ] = $attribute_val; }); $btn.removeClass( 'added' ); $btn.addClass( 'loading' ); var $data = { action : 'sten_wc_product_loop_add_to_cart', product_id : $product_id, quantity : $quantity, variation_id : $variation_id, variation : $item, }; $( 'body' ).trigger( 'adding_to_cart', [ $btn, $data ] ); $.ajax({ type : "POST", url : sten_wc_params.ajax_url, data : $data, success : function ( $response ) { if( !$response ) { return false; } if ( $response.error && $response.product_url ) { window.location = $response.product_url; return false; } // update cart fragment var $fragments = $response.fragments, $cart_hash = $response.cart_hash; if ( $fragments ) { $.each( $fragments, function ( $key, $value ) { $( $key ).replaceWith( $value ); } ); } $( '.quick-view-popup .mfp-close' ).trigger( 'click' ); $btn.addClass( 'added' ); $( 'body' ).trigger( 'added_to_cart', [ $fragments, $cart_hash, $btn ] ); $btn.parents( '.product-type-variable' ).find( '.st-swatch-in-loop .et-delete' ).trigger( 'click' ); }, error : function ( $error ) { console.log( $error ); } }); e.preventDefault(); }); }, }; ST_WC_FRONT_SWATCH.documentOnReady = { init : function() { ST_WC_FRONT_SWATCH.onSelect(); ST_WC_FRONT_SWATCH.onClear(); ST_WC_FRONT_SWATCH.onSelectUpdateAttribute(); ST_WC_FRONT_SWATCH.productLoop.init(); }, ET_In_Popup: function(){ $(document).on( 'click', '.st-swatch-et-disabled li span', function(e) { if ( $(this).parents().is( '.quick-view-popup' ) ) return; var parent = $(this).parents( '.st-swatch-in-loop' ); var content_product = parent.parents('.content-product'); parent.addClass( 'active' ); $(this).parents('.product-details').addClass('st-swatch-popup-active'); $.each( parent.closest('div').find( 'div.et_st-default-holder' ), function() { var et_html = $(this).html(); et_html = et_html.replace( 'st-swatch-size-small', 'st-swatch-size-normal' ); et_html = et_html.replace( 'st-swatch-et-disabled', 'st-swatch-et-anabled' ); $(this).parents( '.st-swatch-in-loop' ).find( '.st-swatch-preview-wrap .et_st-popup-holder' ).append( et_html ); }); var height = parent.find( 'div.et_st-default-holder' ).height(); parent.find( 'div.et_st-default-holder' ).css( 'min-height', height ); parent.find( 'div.et_st-default-holder ul' ).remove(); parent.find( '.sten-reset-loop-variation' ).remove(); if (!content_product.find('.product-image-wrapper').is('.variation-changed')) { content_product.find('.product-image-wrapper').addClass('variation-changed') } ST_WC_FRONT_SWATCH.productLoop.itemSwatches(); }); $(document).on( 'click', '.st-swatch-in-loop .et-delete', function(e) { if ( $(this).parents().is( '.quick-view-popup' ) ) return; var parent = $(this).parents( '.st-swatch-in-loop' ); var content_product = parent.parents('.content-product'); $.each( $(this).parents( '.st-swatch-in-loop' ).find( 'div.st-swatch-preview-wrap .et_st-popup-holder ul' ), function() { var et_html = $(this).removeClass( 'st-swatch-et-anabled' ).addClass( 'st-swatch-et-disabled' ); var attribute = $(this).data( 'attribute' ); $(this).parents( '.st-swatch-in-loop' ).find( 'div.et_st-default-holder[data-et-holder="' + attribute + '"]' ).prepend( et_html ); }); $(this).parents( '.st-swatch-in-loop' ).removeClass( 'active' ); $(this).parents('.product-details').removeClass('st-swatch-popup-active'); $(this).parents( '.st-swatch-in-loop' ).find( '.st-swatch-preview-wrap .et_st-popup-holder ul' ).remove(); if (content_product.find('.product-image-wrapper').is('.variation-changed')) { content_product.find('.product-image-wrapper').removeClass('variation-changed') } ST_WC_FRONT_SWATCH.productLoop.itemSwatches(); }); }, }; $(document).ready( ST_WC_FRONT_SWATCH.documentOnReady.init ); $(document).ready( ST_WC_FRONT_SWATCH.documentOnReady.ET_In_Popup ); })(jQuery); // source --> https://styleindia.com.au/wp-content/plugins/smart-product-viewer/includes/js/jquery.magnific-popup.min.js /*! Magnific Popup - v1.0.0 - 2015-01-03 * http://dimsemenov.com/plugins/magnific-popup/ * Copyright (c) 2015 Dmitry Semenov; */ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):window.jQuery||window.Zepto)}(function(a){var b,c,d,e,f,g,h="Close",i="BeforeClose",j="AfterClose",k="BeforeAppend",l="MarkupParse",m="Open",n="Change",o="mfp",p="."+o,q="mfp-ready",r="mfp-removing",s="mfp-prevent-close",t=function(){},u=!!window.jQuery,v=a(window),w=function(a,c){b.ev.on(o+a+p,c)},x=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},y=function(c,d){b.ev.triggerHandler(o+c,d),b.st.callbacks&&(c=c.charAt(0).toLowerCase()+c.slice(1),b.st.callbacks[c]&&b.st.callbacks[c].apply(b,a.isArray(d)?d:[d]))},z=function(c){return c===g&&b.currTemplate.closeBtn||(b.currTemplate.closeBtn=a(b.st.closeMarkup.replace("%title%",b.st.tClose)),g=c),b.currTemplate.closeBtn},A=function(){a.magnificPopup.instance||(b=new t,b.init(),a.magnificPopup.instance=b)},B=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(void 0!==a.transition)return!0;for(;b.length;)if(b.pop()+"Transition"in a)return!0;return!1};t.prototype={constructor:t,init:function(){var c=navigator.appVersion;b.isIE7=-1!==c.indexOf("MSIE 7."),b.isIE8=-1!==c.indexOf("MSIE 8."),b.isLowIE=b.isIE7||b.isIE8,b.isAndroid=/android/gi.test(c),b.isIOS=/iphone|ipad|ipod/gi.test(c),b.supportsTransition=B(),b.probablyMobile=b.isAndroid||b.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),d=a(document),b.popupsCache={}},open:function(c){var e;if(c.isObj===!1){b.items=c.items.toArray(),b.index=0;var g,h=c.items;for(e=0;e(a||v.height())},_setFocus:function(){(b.st.focus?b.content.find(b.st.focus).eq(0):b.wrap).focus()},_onFocusIn:function(c){return c.target===b.wrap[0]||a.contains(b.wrap[0],c.target)?void 0:(b._setFocus(),!1)},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),y(l,[b,c,d]),a.each(c,function(a,c){if(void 0===c||c===!1)return!0;if(e=a.split("_"),e.length>1){var d=b.find(p+"-"+e[0]);if(d.length>0){var f=e[1];"replaceWith"===f?d[0]!==c[0]&&d.replaceWith(c):"img"===f?d.is("img")?d.attr("src",c):d.replaceWith(''):d.attr(e[1],c)}}else b.find(p+"-"+a).html(c)})},_getScrollbarSize:function(){if(void 0===b.scrollbarSize){var a=document.createElement("div");a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),b.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return b.scrollbarSize}},a.magnificPopup={instance:null,proto:t.prototype,modules:[],open:function(b,c){return A(),b=b?a.extend(!0,{},b):{},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'',tClose:"Close (Esc)",tLoading:"Loading..."}},a.fn.magnificPopup=function(c){A();var d=a(this);if("string"==typeof c)if("open"===c){var e,f=u?d.data("magnificPopup"):d[0].magnificPopup,g=parseInt(arguments[1],10)||0;f.items?e=f.items[g]:(e=d,f.delegate&&(e=e.find(f.delegate)),e=e.eq(g)),b._openClick({mfpEl:e},d,f)}else b.isOpen&&b[c].apply(b,Array.prototype.slice.call(arguments,1));else c=a.extend(!0,{},c),u?d.data("magnificPopup",c):d[0].magnificPopup=c,b.addGroup(d,c);return d};var C,D,E,F="inline",G=function(){E&&(D.after(E.addClass(C)).detach(),E=null)};a.magnificPopup.registerModule(F,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){b.types.push(F),w(h+"."+F,function(){G()})},getInline:function(c,d){if(G(),c.src){var e=b.st.inline,f=a(c.src);if(f.length){var g=f[0].parentNode;g&&g.tagName&&(D||(C=e.hiddenClass,D=x(C),C="mfp-"+C),E=f.after(D).detach().removeClass(C)),b.updateStatus("ready")}else b.updateStatus("error",e.tNotFound),f=a("
");return c.inlineElement=f,f}return b.updateStatus("ready"),b._parseMarkup(d,{},c),d}}});var H,I="ajax",J=function(){H&&a(document.body).removeClass(H)},K=function(){J(),b.req&&b.req.abort()};a.magnificPopup.registerModule(I,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'The content could not be loaded.'},proto:{initAjax:function(){b.types.push(I),H=b.st.ajax.cursor,w(h+"."+I,K),w("BeforeChange."+I,K)},getAjax:function(c){H&&a(document.body).addClass(H),b.updateStatus("loading");var d=a.extend({url:c.src,success:function(d,e,f){var g={data:d,xhr:f};y("ParseAjax",g),b.appendContent(a(g.data),I),c.finished=!0,J(),b._setFocus(),setTimeout(function(){b.wrap.addClass(q)},16),b.updateStatus("ready"),y("AjaxContentAdded")},error:function(){J(),c.finished=c.loadError=!0,b.updateStatus("error",b.st.ajax.tError.replace("%url%",c.src))}},b.st.ajax.settings);return b.req=a.ajax(d),""}}});var L,M=function(c){if(c.data&&void 0!==c.data.title)return c.data.title;var d=b.st.image.titleSrc;if(d){if(a.isFunction(d))return d.call(b,c);if(c.el)return c.el.attr(d)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'
',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'The image could not be loaded.'},proto:{initImage:function(){var c=b.st.image,d=".image";b.types.push("image"),w(m+d,function(){"image"===b.currItem.type&&c.cursor&&a(document.body).addClass(c.cursor)}),w(h+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),v.off("resize"+p)}),w("Resize"+d,b.resizeImage),b.isLowIE&&w("AfterChange",b.resizeImage)},resizeImage:function(){var a=b.currItem;if(a&&a.img&&b.st.image.verticalFit){var c=0;b.isLowIE&&(c=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",b.wH-c)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y("ImageHasSize",a),a.imgHidden&&(b.content&&b.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var c=0,d=a.img[0],e=function(f){L&&clearInterval(L),L=setInterval(function(){return d.naturalWidth>0?void b._onImageHasSize(a):(c>200&&clearInterval(L),c++,void(3===c?e(10):40===c?e(50):100===c&&e(500)))},f)};e(1)},getImage:function(c,d){var e=0,f=function(){c&&(c.img[0].complete?(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("ready")),c.hasSize=!0,c.loaded=!0,y("ImageLoadComplete")):(e++,200>e?setTimeout(f,100):g()))},g=function(){c&&(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("error",h.tError.replace("%url%",c.src))),c.hasSize=!0,c.loaded=!0,c.loadError=!0)},h=b.st.image,i=d.find(".mfp-img");if(i.length){var j=document.createElement("img");j.className="mfp-img",c.el&&c.el.find("img").length&&(j.alt=c.el.find("img").attr("alt")),c.img=a(j).on("load.mfploader",f).on("error.mfploader",g),j.src=c.src,i.is("img")&&(c.img=c.img.clone()),j=c.img[0],j.naturalWidth>0?c.hasSize=!0:j.width||(c.hasSize=!1)}return b._parseMarkup(d,{title:M(c),img_replaceWith:c.img},c),b.resizeImage(),c.hasSize?(L&&clearInterval(L),c.loadError?(d.addClass("mfp-loading"),b.updateStatus("error",h.tError.replace("%url%",c.src))):(d.removeClass("mfp-loading"),b.updateStatus("ready")),d):(b.updateStatus("loading"),c.loading=!0,c.hasSize||(c.imgHidden=!0,d.addClass("mfp-loading"),b.findImageSize(c)),d)}}});var N,O=function(){return void 0===N&&(N=void 0!==document.createElement("p").style.MozTransform),N};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a,c=b.st.zoom,d=".zoom";if(c.enabled&&b.supportsTransition){var e,f,g=c.duration,j=function(a){var b=a.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+c.duration/1e3+"s "+c.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,b.css(e),b},k=function(){b.content.css("visibility","visible")};w("BuildControls"+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.content.css("visibility","hidden"),a=b._getItemToZoom(),!a)return void k();f=j(a),f.css(b._getOffset()),b.wrap.append(f),e=setTimeout(function(){f.css(b._getOffset(!0)),e=setTimeout(function(){k(),setTimeout(function(){f.remove(),a=f=null,y("ZoomAnimationEnded")},16)},g)},16)}}),w(i+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.st.removalDelay=g,!a){if(a=b._getItemToZoom(),!a)return;f=j(a)}f.css(b._getOffset(!0)),b.wrap.append(f),b.content.css("visibility","hidden"),setTimeout(function(){f.css(b._getOffset())},16)}}),w(h+d,function(){b._allowZoom()&&(k(),f&&f.remove(),a=null)})}},_allowZoom:function(){return"image"===b.currItem.type},_getItemToZoom:function(){return b.currItem.hasSize?b.currItem.img:!1},_getOffset:function(c){var d;d=c?b.currItem.img:b.st.zoom.opener(b.currItem.el||b.currItem);var e=d.offset(),f=parseInt(d.css("padding-top"),10),g=parseInt(d.css("padding-bottom"),10);e.top-=a(window).scrollTop()-f;var h={width:d.width(),height:(u?d.innerHeight():d[0].offsetHeight)-g-f};return O()?h["-moz-transform"]=h.transform="translate("+e.left+"px,"+e.top+"px)":(h.left=e.left,h.top=e.top),h}}});var P="iframe",Q="//about:blank",R=function(a){if(b.currTemplate[P]){var c=b.currTemplate[P].find("iframe");c.length&&(a||(c[0].src=Q),b.isIE8&&c.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(P,{options:{markup:'
',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){b.types.push(P),w("BeforeChange",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(h+"."+P,function(){R()})},getIframe:function(c,d){var e=c.src,f=b.st.iframe;a.each(f.patterns,function(){return e.indexOf(this.index)>-1?(this.id&&(e="string"==typeof this.id?e.substr(e.lastIndexOf(this.id)+this.id.length,e.length):this.id.call(this,e)),e=this.src.replace("%id%",e),!1):void 0});var g={};return f.srcAction&&(g[f.srcAction]=e),b._parseMarkup(d,g,c),b.updateStatus("ready"),d}}});var S=function(a){var c=b.items.length;return a>c-1?a-c:0>a?c+a:a},T=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=b.st.gallery,e=".mfp-gallery",g=Boolean(a.fn.mfpFastClick);return b.direction=!0,c&&c.enabled?(f+=" mfp-gallery",w(m+e,function(){c.navigateByImgClick&&b.wrap.on("click"+e,".mfp-img",function(){return b.items.length>1?(b.next(),!1):void 0}),d.on("keydown"+e,function(a){37===a.keyCode?b.prev():39===a.keyCode&&b.next()})}),w("UpdateStatus"+e,function(a,c){c.text&&(c.text=T(c.text,b.currItem.index,b.items.length))}),w(l+e,function(a,d,e,f){var g=b.items.length;e.counter=g>1?T(c.tCounter,f.index,g):""}),w("BuildControls"+e,function(){if(b.items.length>1&&c.arrows&&!b.arrowLeft){var d=c.arrowMarkup,e=b.arrowLeft=a(d.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(s),f=b.arrowRight=a(d.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(s),h=g?"mfpFastClick":"click";e[h](function(){b.prev()}),f[h](function(){b.next()}),b.isIE7&&(x("b",e[0],!1,!0),x("a",e[0],!1,!0),x("b",f[0],!1,!0),x("a",f[0],!1,!0)),b.container.append(e.add(f))}}),w(n+e,function(){b._preloadTimeout&&clearTimeout(b._preloadTimeout),b._preloadTimeout=setTimeout(function(){b.preloadNearbyImages(),b._preloadTimeout=null},16)}),void w(h+e,function(){d.off(e),b.wrap.off("click"+e),b.arrowLeft&&g&&b.arrowLeft.add(b.arrowRight).destroyMfpFastClick(),b.arrowRight=b.arrowLeft=null})):!1},next:function(){b.direction=!0,b.index=S(b.index+1),b.updateItemHTML()},prev:function(){b.direction=!1,b.index=S(b.index-1),b.updateItemHTML()},goTo:function(a){b.direction=a>=b.index,b.index=a,b.updateItemHTML()},preloadNearbyImages:function(){var a,c=b.st.gallery.preload,d=Math.min(c[0],b.items.length),e=Math.min(c[1],b.items.length);for(a=1;a<=(b.direction?e:d);a++)b._preloadItem(b.index+a);for(a=1;a<=(b.direction?d:e);a++)b._preloadItem(b.index-a)},_preloadItem:function(c){if(c=S(c),!b.items[c].preloaded){var d=b.items[c];d.parsed||(d=b.parseEl(c)),y("LazyLoad",d),"image"===d.type&&(d.img=a('').on("load.mfploader",function(){d.hasSize=!0}).on("error.mfploader",function(){d.hasSize=!0,d.loadError=!0,y("LazyLoadError",d)}).attr("src",d.src)),d.preloaded=!0}}}});var U="retina";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=b.st.retina,c=a.ratio;c=isNaN(c)?c():c,c>1&&(w("ImageHasSize."+U,function(a,b){b.img.css({"max-width":b.img[0].naturalWidth/c,width:"100%"})}),w("ElementParse."+U,function(b,d){d.src=a.replaceSrc(d,c)}))}}}}),function(){var b=1e3,c="ontouchstart"in window,d=function(){v.off("touchmove"+f+" touchend"+f)},e="mfpFastClick",f="."+e;a.fn.mfpFastClick=function(e){return a(this).each(function(){var g,h=a(this);if(c){var i,j,k,l,m,n;h.on("touchstart"+f,function(a){l=!1,n=1,m=a.originalEvent?a.originalEvent.touches[0]:a.touches[0],j=m.clientX,k=m.clientY,v.on("touchmove"+f,function(a){m=a.originalEvent?a.originalEvent.touches:a.touches,n=m.length,m=m[0],(Math.abs(m.clientX-j)>10||Math.abs(m.clientY-k)>10)&&(l=!0,d())}).on("touchend"+f,function(a){d(),l||n>1||(g=!0,a.preventDefault(),clearTimeout(i),i=setTimeout(function(){g=!1},b),e())})})}h.on("click"+f,function(){g||e()})})},a.fn.destroyMfpFastClick=function(){a(this).off("touchstart"+f+" click"+f),c&&v.off("touchmove"+f+" touchend"+f)}}(),A()}); // source --> https://styleindia.com.au/wp-content/plugins/smart-product-viewer/includes/js/smart.product.min.js /* $.Link (part of noUiSlider) - WTFPL */ (function(c){function m(a,c,d){if((a[c]||a[d])&&a[c]===a[d])throw Error("(Link) '"+c+"' can't match '"+d+"'.'");}function r(a){void 0===a&&(a={});if("object"!==typeof a)throw Error("(Format) 'format' option must be an object.");var h={};c(u).each(function(c,n){if(void 0===a[n])h[n]=A[c];else if(typeof a[n]===typeof A[c]){if("decimals"===n&&(0>a[n]||7a&&(n=this.a("negative"),k=this.a("negativeBefore"));a=Math.abs(a).toFixed(d).toString();a=a.split(".");this.a("thousand")?(m=c(a[0]).match(/.{1,3}/g),m=c(m.join(c(this.a("thousand"))))):m=a[0];this.a("mark")&&1")[0]};k.prototype.H=function(a){this.method="val";this.j=document.createElement("input");this.j.name=a;this.j.type="hidden"};k.prototype.G=function(a){function h(a,c){return[c?null:a,c?a:null]}var d=this;this.method="val";this.target=a.on("change",function(a){d.B.val(h(c(a.target).val(),d.t),{link:d,set:!0})})};k.prototype.p=function(a,h,d,k){this.g=d;this.update=!k;if("string"=== typeof a&&0===a.indexOf("-tooltip-"))this.K(a,h);else if("string"===typeof a&&0!==a.indexOf("-"))this.H(a);else if("function"===typeof a)this.target=!1,this.method=a;else{if(a instanceof c||c.zepto&&c.zepto.isZ(a)){if(!h){if(a.is("input, select, textarea")){this.G(a);return}h="html"}if("function"===typeof h||"string"===typeof h&&a[h]){this.method=h;this.target=a;return}}throw new RangeError("(Link) Invalid Link.");}};k.prototype.write=function(a,c,d,k){if(!this.update||!1!==k)if(this.u=a,this.F=a= this.format(a),"function"===typeof this.method)this.method.call(this.target[0]||d[0],a,c,d);else this.target[this.method](a,c,d)};k.prototype.q=function(a){this.g=new r(c.extend({},a,this.g instanceof r?this.g.r:this.g))};k.prototype.J=function(a){this.B=a};k.prototype.I=function(a){this.t=a};k.prototype.format=function(a){return this.g.L(a)};k.prototype.A=function(a){return this.g.w(a)};k.prototype.p.prototype=k.prototype;c.Link=k})(window.jQuery||window.Zepto); /* $.fn.noUiSlider - WTFPL - refreshless.com/nouislider/ */ (function(c){function m(e){return"number"===typeof e&&!isNaN(e)&&isFinite(e)}function r(e){return c.isArray(e)?e:[e]}function k(e,b){e.addClass(b);setTimeout(function(){e.removeClass(b)},300)}function u(e,b){return 100*b/(e[1]-e[0])}function A(e,b){if(b>=e.d.slice(-1)[0])return 100;for(var a=1,c,f,d;b>=e.d[a];)a++;c=e.d[a-1];f=e.d[a];d=e.c[a-1];c=[c,f];return d+u(c,0>c[0]?b+Math.abs(c[0]):b-c[0])/(100/(e.c[a]-d))}function a(e,b){if(100<=b)return e.d.slice(-1)[0];for(var a=1,c,f,d;b>=e.c[a];)a++;c= e.d[a-1];f=e.d[a];d=e.c[a-1];c=[c,f];return 100/(e.c[a]-d)*(b-d)*(c[1]-c[0])/100+c[0]}function h(a,b){for(var c=1,g;(a.dir?100-b:b)>=a.c[c];)c++;if(a.m)return g=a.c[c-1],c=a.c[c],b-g>(c-g)/2?c:g;a.h[c-1]?(g=a.h[c-1],c=a.c[c-1]+Math.round((b-a.c[c-1])/g)*g):c=b;return c}function d(a,b){if(!m(b))throw Error("noUiSlider: 'step' is not numeric.");a.h[0]=b}function n(a,b){if("object"!==typeof b||c.isArray(b))throw Error("noUiSlider: 'range' is not an object.");if(void 0===b.min||void 0===b.max)throw Error("noUiSlider: Missing 'min' or 'max' in 'range'."); c.each(b,function(b,g){var d;"number"===typeof g&&(g=[g]);if(!c.isArray(g))throw Error("noUiSlider: 'range' contains invalid value.");d="min"===b?0:"max"===b?100:parseFloat(b);if(!m(d)||!m(g[0]))throw Error("noUiSlider: 'range' value isn't numeric.");a.c.push(d);a.d.push(g[0]);d?a.h.push(isNaN(g[1])?!1:g[1]):isNaN(g[1])||(a.h[0]=g[1])});c.each(a.h,function(b,c){if(!c)return!0;a.h[b]=u([a.d[b],a.d[b+1]],c)/(100/(a.c[b+1]-a.c[b]))})}function E(a,b){"number"===typeof b&&(b=[b]);if(!c.isArray(b)||!b.length|| 2
").addClass(f[2]),g=["-lower","-upper"];a.dir&&g.reverse();d.children().addClass(f[3]+" "+f[3]+g[b]);return d}function Q(a,b){b.j&&(b=new c.Link({target:c(b.j).clone().appendTo(a),method:b.method,format:b.g},!0));return b}function R(a,b){var d,f=[];for(d=0;d").appendTo(b).addClass(f[1])}function V(d,b,m){function g(){return t[["width","height"][b.k]]()}function n(a){var b,c=[q.val()];for(b=0;bp&&(p=h(b,p));p=Math.max(Math.min(parseFloat(p.toFixed(7)),100),0);if(p===x[g])return 1===l.length?!1:p===H||p===k?0:!1;d.css(b.style,p+"%");d.is(":first-child")&&d.toggleClass(f[17],50d&&(e+=Math.abs(d)),100").attr("src",r).addClass("previous-image").appendTo(t),o.push(i),n.$el.find(a.imgList).append(t),e(i).load(function(){n.imageLoaded()})},n.imageLoaded=function(){a.loadedImages+=1,e(a.progress+" span").text(Math.floor(a.loadedImages/a.totalFrames*100)+"%"),a.loadedImages>=a.totalFrames?(a.disableSpin&&o[0].removeClass("previous-image").addClass("current-image"),e(a.progress).fadeOut("slow",function(){e(this).hide(),e(a.preview).css("opacity",0),n.showImages(),n.showNavigation()})):n.loadImages()},n.showImages=function(){n.$el.find(a.imgList).fadeIn(),n.ready=!0,a.ready=!0,a.drag&&n.initEvents(),n.refresh(),n.initPlugins(),a.onReady()},n.initPlugins=function(){e.each(a.plugins,function(t,r){if("function"!=typeof e[r])throw new Error(r+" not available.");e[r].call(n,n.$el,a)})},n.showNavigation=function(){if(a.navigation&&!a.navigation_init){var t,r,o,i;if(t=e("
").attr("class","threesixty-nav-bar"),r=e("").attr({href:"#","class":"threesixty-next"}).html("next"),o=e("").attr({href:"#","class":"threesixty-previous"}).html("previous"),a.startAutoplay)var s="threesixty-stop";else var s="threesixty-play";i=e("").attr({href:"#","class":s}).html("play"),t.append(o),t.append(i),t.append(r),n.$el.prepend(t),r.bind("mousedown touchstart",n.next),o.bind("mousedown touchstart",n.previous),i.bind("mousedown touchstart",n.play_stop),a.navigation_init=!0}},n.play_stop=function(t){t.preventDefault(),a.autoplay?(a.autoplay=!1,e(t.currentTarget).removeClass("threesixty-stop").addClass("threesixty-play"),clearInterval(a.play),a.play=null):(a.autoplay=!0,a.play=setInterval(n.moveToNextFrame,a.interval),e(t.currentTarget).removeClass("threesixty-play").addClass("threesixty-stop"))},n.next=function(e){e&&e.preventDefault(),a.endFrame-=5,n.refresh()},n.previous=function(e){e&&e.preventDefault(),a.endFrame+=5,n.refresh()},n.play=function(e){a.autoplay||(a.autoplay=!0,a.play=setInterval(n.moveToNextFrame,a.interval))},n.stop=function(){a.autoplay&&(a.autoplay=!1,clearInterval(a.play),a.play=null)},n.moveToNextFrame=function(){1===a.autoplayDirection?a.endFrame-=1:a.endFrame+=1,n.refresh()},n.gotoAndPlay=function(e){if(a.disableWrap)a.endFrame=e,n.refresh();else{var t=Math.ceil(a.endFrame/a.totalFrames);0===t&&(t=1);var r=t>1?a.endFrame-(t-1)*a.totalFrames:a.endFrame,o=a.totalFrames-r,i=0;i=e-r>0?e-rr-e?a.endFrame-(r-e):a.endFrame+(o+e),r!==e&&(a.endFrame=i,n.refresh())}},n.initEvents=function(){n.$el.bind("mousedown touchstart touchmove touchend mousemove click",function(t){e(t.target).hasClass("threesixty-mfp-anchor")||e(t.target).hasClass("mfp-close")||(t.preventDefault(),"mousedown"===t.type&&1===t.which||"touchstart"===t.type?(a.pointerStartPosX=n.getPointerEvent(t).pageX,a.dragging=!0,a.autoplay&&(a.stopped=!0,n.stop())):"touchmove"===t.type?n.trackPointer(t):"touchend"===t.type&&(a.dragging=!1,a.stopped&&(a.stopped=!1,n.play())),"click"!==t.type||n.browser.isIE()||n.$el.removeClass("threesixty-hand-open").addClass("threesixty-hand-closed"))}),e(document).bind("mouseup",function(t){a.dragging=!1,a.stopped&&(a.stopped=!1,n.play()),e(this).removeClass("threesixty-hand-open"),e(this).removeClass("threesixty-hand-closed")}),e(document).bind("mousemove",function(e){a.dragging?(e.preventDefault(),!n.browser.isIE()&&a.showCursor&&n.$el.removeClass("threesixty-hand-open").addClass("threesixty-hand-closed")):!n.browser.isIE()&&a.showCursor&&n.$el.removeClass("threesixty-hand-closed").addClass("threesixty-hand-open"),n.trackPointer(e)})},n.getPointerEvent=function(e){return e.originalEvent.targetTouches?e.originalEvent.targetTouches[0]:e},n.trackPointer=function(e){a.ready&&a.dragging&&(a.pointerEndPosX=n.getPointerEvent(e).pageX,a.monitorStartTime<(new Date).getTime()-a.monitorInt&&(a.pointerDistance=a.pointerEndPosX-a.pointerStartPosX,a.pointerDistance>0?a.endFrame=a.currentFrame+Math.ceil((a.totalFrames-1)*a.speedMultiplier*(a.pointerDistance/n.$el.width())):a.endFrame=a.currentFrame+Math.floor((a.totalFrames-1)*a.speedMultiplier*(a.pointerDistance/n.$el.width())),a.disableWrap&&(a.endFrame=Math.min(a.totalFrames-(a.zeroBased?1:0),a.endFrame),a.endFrame=Math.max(a.zeroBased?0:1,a.endFrame)),n.refresh(),a.monitorStartTime=(new Date).getTime(),a.pointerStartPosX=n.getPointerEvent(e).pageX))},n.refresh=function(){0===a.ticker&&(a.ticker=setInterval(n.render,Math.round(1e3/a.framerate)))},n.render=function(){var e;a.currentFrame!==a.endFrame?(e=a.endFramee&&(e+=a.totalFrames-1)),e},n.zeroPad=function(e){function t(e,t){var r=e.toString();if(a.zeroPadding)for(;r.lengthFullscreen"),i=!1,s=["webkit","moz","ms","o",""];o.bind("click",function(e){a.onClickHandler.apply(this,e)}),a.setStyles=function(){return o.css({"z-index":12,display:"block",position:"absolute",background:"url(img/fs.png) no-repeat",width:"20px",height:"20px","text-indent":"-99999px",right:"5px",bottom:"5px","background-position":"0px -20px"}),this},a.RunPrefixMethod=function(e,t){for(var r,a,n=0;n