jQuery(document).ready(function($){ $('body').on('click','.brideliness-post-like',function(e){ "use strict"; e.preventDefault(); var heart=$(this); var post_id=heart.data("post_id"); heart.html(""); $.ajax({ type: "post", url: ajax_var.url, data: "action=brideliness-post-like&nonce="+ajax_var.nonce+"&brideliness_post_like=&post_id="+post_id, success: function(count){ if(count.indexOf("already")!==-1){ var lecount=count.replace("already",""); if(lecount==="0"){ lecount="Like"; } heart.prop('title', 'Like'); heart.removeClass("liked"); heart.html(""+lecount+""); }else{ heart.prop('title', 'Unlike'); heart.addClass("liked"); heart.html(""+count+""); }} }); }); }); (function($){ 'use strict'; if(typeof wpcf7==='undefined'||wpcf7===null){ return; } wpcf7=$.extend({ cached: 0, inputs: [] }, wpcf7); $(function(){ wpcf7.supportHtml5=(function(){ var features={}; var input=document.createElement('input'); features.placeholder='placeholder' in input; var inputTypes=[ 'email', 'url', 'tel', 'number', 'range', 'date' ]; $.each(inputTypes, function(index, value){ input.setAttribute('type', value); features[ value ]=input.type!=='text'; }); return features; })(); $('div.wpcf7 > form').each(function(){ var $form=$(this); wpcf7.initForm($form); if(wpcf7.cached){ wpcf7.refill($form); }}); }); wpcf7.getId=function(form){ return parseInt($('input[name="_wpcf7"]', form).val(), 10); }; wpcf7.initForm=function(form){ var $form=$(form); $form.submit(function(event){ if(typeof window.FormData!=='function'){ return; } wpcf7.submit($form); event.preventDefault(); }); $('.wpcf7-submit', $form).after(''); wpcf7.toggleSubmit($form); $form.on('click', '.wpcf7-acceptance', function(){ wpcf7.toggleSubmit($form); }); $('.wpcf7-exclusive-checkbox', $form).on('click', 'input:checkbox', function(){ var name=$(this).attr('name'); $form.find('input:checkbox[name="' + name + '"]').not(this).prop('checked', false); }); $('.wpcf7-list-item.has-free-text', $form).each(function(){ var $freetext=$(':input.wpcf7-free-text', this); var $wrap=$(this).closest('.wpcf7-form-control'); if($(':checkbox, :radio', this).is(':checked')){ $freetext.prop('disabled', false); }else{ $freetext.prop('disabled', true); } $wrap.on('change', ':checkbox, :radio', function(){ var $cb=$('.has-free-text', $wrap).find(':checkbox, :radio'); if($cb.is(':checked')){ $freetext.prop('disabled', false).focus(); }else{ $freetext.prop('disabled', true); }}); }); if(! wpcf7.supportHtml5.placeholder){ $('[placeholder]', $form).each(function(){ $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); $(this).focus(function(){ if($(this).hasClass('placeheld')){ $(this).val('').removeClass('placeheld'); }}); $(this).blur(function(){ if(''===$(this).val()){ $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); }}); }); } if(wpcf7.jqueryUi&&! wpcf7.supportHtml5.date){ $form.find('input.wpcf7-date[type="date"]').each(function(){ $(this).datepicker({ dateFormat: 'yy-mm-dd', minDate: new Date($(this).attr('min')), maxDate: new Date($(this).attr('max')) }); }); } if(wpcf7.jqueryUi&&! wpcf7.supportHtml5.number){ $form.find('input.wpcf7-number[type="number"]').each(function(){ $(this).spinner({ min: $(this).attr('min'), max: $(this).attr('max'), step: $(this).attr('step') }); }); } $('.wpcf7-character-count', $form).each(function(){ var $count=$(this); var name=$count.attr('data-target-name'); var down=$count.hasClass('down'); var starting=parseInt($count.attr('data-starting-value'), 10); var maximum=parseInt($count.attr('data-maximum-value'), 10); var minimum=parseInt($count.attr('data-minimum-value'), 10); var updateCount=function(target){ var $target=$(target); var length=$target.val().length; var count=down ? starting - length:length; $count.attr('data-current-value', count); $count.text(count); if(maximum&&maximum < length){ $count.addClass('too-long'); }else{ $count.removeClass('too-long'); } if(minimum&&length < minimum){ $count.addClass('too-short'); }else{ $count.removeClass('too-short'); }}; $(':input[name="' + name + '"]', $form).each(function(){ updateCount(this); $(this).keyup(function(){ updateCount(this); }); }); }); $form.on('change', '.wpcf7-validates-as-url', function(){ var val=$.trim($(this).val()); if(val && ! val.match(/^[a-z][a-z0-9.+-]*:/i) && -1!==val.indexOf('.')){ val=val.replace(/^\/+/, ''); val='http://' + val; } $(this).val(val); }); }; wpcf7.submit=function(form){ if(typeof window.FormData!=='function'){ return; } var $form=$(form); $('.ajax-loader', $form).addClass('is-active'); $('[placeholder].placeheld', $form).each(function(i, n){ $(n).val(''); }); wpcf7.clearResponse($form); var formData=new FormData($form.get(0)); var detail={ id: $form.closest('div.wpcf7').attr('id'), status: 'init', inputs: [], formData: formData }; $.each($form.serializeArray(), function(i, field){ if('_wpcf7'==field.name){ detail.contactFormId=field.value; }else if('_wpcf7_version'==field.name){ detail.pluginVersion=field.value; }else if('_wpcf7_locale'==field.name){ detail.contactFormLocale=field.value; }else if('_wpcf7_unit_tag'==field.name){ detail.unitTag=field.value; }else if('_wpcf7_container_post'==field.name){ detail.containerPostId=field.value; }else if(field.name.match(/^_wpcf7_\w+_free_text_/)){ var owner=field.name.replace(/^_wpcf7_\w+_free_text_/, ''); detail.inputs.push({ name: owner + '-free-text', value: field.value }); }else if(field.name.match(/^_/)){ }else{ detail.inputs.push(field); }}); wpcf7.triggerEvent($form.closest('div.wpcf7'), 'beforesubmit', detail); var ajaxSuccess=function(data, status, xhr, $form){ detail.id=$(data.into).attr('id'); detail.status=data.status; detail.apiResponse=data; var $message=$('.wpcf7-response-output', $form); switch(data.status){ case 'validation_failed': $.each(data.invalidFields, function(i, n){ $(n.into, $form).each(function(){ wpcf7.notValidTip(this, n.message); $('.wpcf7-form-control', this).addClass('wpcf7-not-valid'); $('[aria-invalid]', this).attr('aria-invalid', 'true'); }); }); $message.addClass('wpcf7-validation-errors'); $form.addClass('invalid'); wpcf7.triggerEvent(data.into, 'invalid', detail); break; case 'acceptance_missing': $message.addClass('wpcf7-acceptance-missing'); $form.addClass('unaccepted'); wpcf7.triggerEvent(data.into, 'unaccepted', detail); break; case 'spam': $message.addClass('wpcf7-spam-blocked'); $form.addClass('spam'); $('[name="g-recaptcha-response"]', $form).each(function(){ if(''===$(this).val()){ var $recaptcha=$(this).closest('.wpcf7-form-control-wrap'); wpcf7.notValidTip($recaptcha, wpcf7.recaptcha.messages.empty); }}); wpcf7.triggerEvent(data.into, 'spam', detail); break; case 'aborted': $message.addClass('wpcf7-aborted'); $form.addClass('aborted'); wpcf7.triggerEvent(data.into, 'aborted', detail); break; case 'mail_sent': $message.addClass('wpcf7-mail-sent-ok'); $form.addClass('sent'); wpcf7.triggerEvent(data.into, 'mailsent', detail); break; case 'mail_failed': $message.addClass('wpcf7-mail-sent-ng'); $form.addClass('failed'); wpcf7.triggerEvent(data.into, 'mailfailed', detail); break; default: var customStatusClass='custom-' + data.status.replace(/[^0-9a-z]+/i, '-'); $message.addClass('wpcf7-' + customStatusClass); $form.addClass(customStatusClass); } wpcf7.refill($form, data); wpcf7.triggerEvent(data.into, 'submit', detail); if('mail_sent'==data.status){ $form.each(function(){ this.reset(); }); } $form.find('[placeholder].placeheld').each(function(i, n){ $(n).val($(n).attr('placeholder')); }); $message.html('').append(data.message).slideDown('fast'); $message.attr('role', 'alert'); $('.screen-reader-response', $form.closest('.wpcf7')).each(function(){ var $response=$(this); $response.html('').attr('role', '').append(data.message); if(data.invalidFields){ var $invalids=$(''); $.each(data.invalidFields, function(i, n){ if(n.idref){ var $li=$('
  • ').append($('').attr('href', '#' + n.idref).append(n.message)); }else{ var $li=$('
  • ').append(n.message); } $invalids.append($li); }); $response.append($invalids); } $response.attr('role', 'alert').focus(); }); }; $.ajax({ type: 'POST', url: wpcf7.apiSettings.getRoute('/contact-forms/' + wpcf7.getId($form) + '/feedback'), data: formData, dataType: 'json', processData: false, contentType: false }).done(function(data, status, xhr){ ajaxSuccess(data, status, xhr, $form); $('.ajax-loader', $form).removeClass('is-active'); }).fail(function(xhr, status, error){ var $e=$('
    ').text(error.message); $form.after($e); }); }; wpcf7.triggerEvent=function(target, name, detail){ var $target=$(target); var event=new CustomEvent('wpcf7' + name, { bubbles: true, detail: detail }); $target.get(0).dispatchEvent(event); $target.trigger('wpcf7:' + name, detail); $target.trigger(name + '.wpcf7', detail); }; wpcf7.toggleSubmit=function(form, state){ var $form=$(form); var $submit=$('input:submit', $form); if(typeof state!=='undefined'){ $submit.prop('disabled', ! state); return; } if($form.hasClass('wpcf7-acceptance-as-validation')){ return; } $submit.prop('disabled', false); $('.wpcf7-acceptance', $form).each(function(){ var $span=$(this); var $input=$('input:checkbox', $span); if(! $span.hasClass('optional')){ if($span.hasClass('invert')&&$input.is(':checked') || ! $span.hasClass('invert')&&! $input.is(':checked')){ $submit.prop('disabled', true); return false; }} }); }; wpcf7.notValidTip=function(target, message){ var $target=$(target); $('.wpcf7-not-valid-tip', $target).remove(); $('') .text(message).appendTo($target); if($target.is('.use-floating-validation-tip *')){ var fadeOut=function(target){ $(target).not(':hidden').animate({ opacity: 0 }, 'fast', function(){ $(this).css({ 'z-index': -100 }); }); }; $target.on('mouseover', '.wpcf7-not-valid-tip', function(){ fadeOut(this); }); $target.on('focus', ':input', function(){ fadeOut($('.wpcf7-not-valid-tip', $target)); }); }}; wpcf7.refill=function(form, data){ var $form=$(form); var refillCaptcha=function($form, items){ $.each(items, function(i, n){ $form.find(':input[name="' + i + '"]').val(''); $form.find('img.wpcf7-captcha-' + i).attr('src', n); var match=/([0-9]+)\.(png|gif|jpeg)$/.exec(n); $form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[ 1 ]); }); }; var refillQuiz=function($form, items){ $.each(items, function(i, n){ $form.find(':input[name="' + i + '"]').val(''); $form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[ 0 ]); $form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[ 1 ]); }); }; if(typeof data==='undefined'){ $.ajax({ type: 'GET', url: wpcf7.apiSettings.getRoute('/contact-forms/' + wpcf7.getId($form) + '/refill'), beforeSend: function(xhr){ var nonce=$form.find(':input[name="_wpnonce"]').val(); if(nonce){ xhr.setRequestHeader('X-WP-Nonce', nonce); }}, dataType: 'json' }).done(function(data, status, xhr){ if(data.captcha){ refillCaptcha($form, data.captcha); } if(data.quiz){ refillQuiz($form, data.quiz); }}); }else{ if(data.captcha){ refillCaptcha($form, data.captcha); } if(data.quiz){ refillQuiz($form, data.quiz); }} }; wpcf7.clearResponse=function(form){ var $form=$(form); $form.removeClass('invalid spam sent failed'); $form.siblings('.screen-reader-response').html('').attr('role', ''); $('.wpcf7-not-valid-tip', $form).remove(); $('[aria-invalid]', $form).attr('aria-invalid', 'false'); $('.wpcf7-form-control', $form).removeClass('wpcf7-not-valid'); $('.wpcf7-response-output', $form) .hide().empty().removeAttr('role') .removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked'); }; wpcf7.apiSettings.getRoute=function(path){ var url=wpcf7.apiSettings.root; url=url.replace(wpcf7.apiSettings.namespace, wpcf7.apiSettings.namespace + path); return url; };})(jQuery); (function (){ if(typeof window.CustomEvent==="function") return false; function CustomEvent(event, params){ params=params||{ bubbles: false, cancelable: false, detail: undefined }; var evt=document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; } CustomEvent.prototype=window.Event.prototype; window.CustomEvent=CustomEvent; })(); (function($){ 'use strict'; /** * All of the code for your public-facing JavaScript source * should reside in this file. * * Note: It has been assumed you will write jQuery code here, so the * $ function reference has been prepared for usage within the scope * of this function. * * This enables you to define handlers, for when the DOM is ready: * * $(function(){ * * }); * * When the window is loaded: * * $(window).load(function(){ * * }); * * ...and/or other possibilities. * * Ideally, it is not considered best practise to attach more than a * single DOM-ready or window-load handler for a particular page. * Although scripts in the WordPress core, Plugins and Themes may be * practising this, we should strive to set a better example in our own work. */ })(jQuery); jQuery(function($){ if(typeof wc_single_product_params==='undefined'){ return false; } $('body') .on('init', '.wc-tabs-wrapper, .woocommerce-tabs', function(){ $('.wc-tab, .woocommerce-tabs .panel:not(.panel .panel)').hide(); var hash=window.location.hash; var url=window.location.href; var $tabs=$(this).find('.wc-tabs, ul.tabs').first(); if(hash.toLowerCase().indexOf('comment-') >=0||hash==='#reviews'||hash==='#tab-reviews'){ $tabs.find('li.reviews_tab a').click(); }else if(url.indexOf('comment-page-') > 0||url.indexOf('cpage=') > 0){ $tabs.find('li.reviews_tab a').click(); }else if(hash==='#tab-additional_information'){ $tabs.find('li.additional_information_tab a').click(); }else{ $tabs.find('li:first a').click(); }}) .on('click', '.wc-tabs li a, ul.tabs li a', function(e){ e.preventDefault(); var $tab=$(this); var $tabs_wrapper=$tab.closest('.wc-tabs-wrapper, .woocommerce-tabs'); var $tabs=$tabs_wrapper.find('.wc-tabs, ul.tabs'); $tabs.find('li').removeClass('active'); $tabs_wrapper.find('.wc-tab, .panel:not(.panel .panel)').hide(); $tab.closest('li').addClass('active'); $tabs_wrapper.find($tab.attr('href')).show(); }) .on('click', 'a.woocommerce-review-link', function(){ $('.reviews_tab a').click(); return true; }) .on('init', '#rating', function(){ $('#rating').hide().before('

    12345

    '); }) .on('click', '#respond p.stars a', function(){ var $star=$(this), $rating=$(this).closest('#respond').find('#rating'), $container=$(this).closest('.stars'); $rating.val($star.text()); $star.siblings('a').removeClass('active'); $star.addClass('active'); $container.addClass('selected'); return false; }) .on('click', '#respond #submit', function(){ var $rating=$(this).closest('#respond').find('#rating'), rating=$rating.val(); if($rating.length > 0&&! rating&&wc_single_product_params.review_rating_required==='yes'){ window.alert(wc_single_product_params.i18n_required_rating_text); return false; }}); $('.wc-tabs-wrapper, .woocommerce-tabs, #rating').trigger('init'); var ProductGallery=function($target, args){ this.$target=$target; this.$images=$('.woocommerce-product-gallery__image', $target); if(0===this.$images.length){ this.$target.css('opacity', 1); return; } $target.data('product_gallery', this); this.flexslider_enabled=$.isFunction($.fn.flexslider)&&wc_single_product_params.flexslider_enabled; this.zoom_enabled=$.isFunction($.fn.zoom)&&wc_single_product_params.zoom_enabled; this.photoswipe_enabled=typeof PhotoSwipe!=='undefined'&&wc_single_product_params.photoswipe_enabled; if(args){ this.flexslider_enabled=false===args.flexslider_enabled ? false:this.flexslider_enabled; this.zoom_enabled=false===args.zoom_enabled ? false:this.zoom_enabled; this.photoswipe_enabled=false===args.photoswipe_enabled ? false:this.photoswipe_enabled; } if(1===this.$images.length){ this.flexslider_enabled=false; } this.initFlexslider=this.initFlexslider.bind(this); this.initZoom=this.initZoom.bind(this); this.initZoomForTarget=this.initZoomForTarget.bind(this); this.initPhotoswipe=this.initPhotoswipe.bind(this); this.onResetSlidePosition=this.onResetSlidePosition.bind(this); this.getGalleryItems=this.getGalleryItems.bind(this); this.openPhotoswipe=this.openPhotoswipe.bind(this); if(this.flexslider_enabled){ this.initFlexslider(); $target.on('woocommerce_gallery_reset_slide_position', this.onResetSlidePosition); }else{ this.$target.css('opacity', 1); } if(this.zoom_enabled){ this.initZoom(); $target.on('woocommerce_gallery_init_zoom', this.initZoom); } if(this.photoswipe_enabled){ this.initPhotoswipe(); }}; ProductGallery.prototype.initFlexslider=function(){ var $target=this.$target, gallery=this; var options=$.extend({ selector: '.woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image', start: function(){ $target.css('opacity', 1); }, after: function(slider){ gallery.initZoomForTarget(gallery.$images.eq(slider.currentSlide)); }}, wc_single_product_params.flexslider); $target.flexslider(options); $('.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:eq(0) .wp-post-image').one('load', function(){ var $image=$(this); if($image){ setTimeout(function(){ var setHeight=$image.closest('.woocommerce-product-gallery__image').height(); var $viewport=$image.closest('.flex-viewport'); if(setHeight&&$viewport){ $viewport.height(setHeight); }}, 100); }}).each(function(){ if(this.complete){ $(this).trigger('load'); }}); }; ProductGallery.prototype.initZoom=function(){ this.initZoomForTarget(this.$images.first()); }; ProductGallery.prototype.initZoomForTarget=function(zoomTarget){ if(! this.zoom_enabled){ return false; } var galleryWidth=this.$target.width(), zoomEnabled=false; $(zoomTarget).each(function(index, target){ var image=$(target).find('img'); if(image.data('large_image_width') > galleryWidth){ zoomEnabled=true; return false; }}); if(zoomEnabled){ var zoom_options=$.extend({ touch: false }, wc_single_product_params.zoom_options); if('ontouchstart' in window){ zoom_options.on='click'; } zoomTarget.trigger('zoom.destroy'); zoomTarget.zoom(zoom_options); }}; ProductGallery.prototype.initPhotoswipe=function(){ if(this.zoom_enabled&&this.$images.length > 0){ this.$target.prepend('🔍'); this.$target.on('click', '.woocommerce-product-gallery__trigger', this.openPhotoswipe); } this.$target.on('click', '.woocommerce-product-gallery__image a', this.openPhotoswipe); }; ProductGallery.prototype.onResetSlidePosition=function(){ this.$target.flexslider(0); }; ProductGallery.prototype.getGalleryItems=function(){ var $slides=this.$images, items=[]; if($slides.length > 0){ $slides.each(function(i, el){ var img=$(el).find('img'), large_image_src=img.attr('data-large_image'), large_image_w=img.attr('data-large_image_width'), large_image_h=img.attr('data-large_image_height'), item={ src:large_image_src, w:large_image_w, h:large_image_h, title: img.attr('data-caption') ? img.attr('data-caption'):img.attr('title') }; items.push(item); }); } return items; }; ProductGallery.prototype.openPhotoswipe=function(e){ e.preventDefault(); var pswpElement=$('.pswp')[0], items=this.getGalleryItems(), eventTarget=$(e.target), clicked; if(eventTarget.is('.woocommerce-product-gallery__trigger')||eventTarget.is('.woocommerce-product-gallery__trigger img')){ clicked=this.$target.find('.flex-active-slide'); }else{ clicked=eventTarget.closest('.woocommerce-product-gallery__image'); } var options=$.extend({ index: $(clicked).index() }, wc_single_product_params.photoswipe_options); var photoswipe=new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options); photoswipe.init(); }; $.fn.wc_product_gallery=function(args){ new ProductGallery(this, args); return this; }; $('.woocommerce-product-gallery').each(function(){ $(this).wc_product_gallery(); }); }); ;(function(){ "use strict"; function setup($){ $.fn._fadeIn=$.fn.fadeIn; var noOp=$.noop||function(){}; var msie=/MSIE/.test(navigator.userAgent); var ie6=/MSIE 6.0/.test(navigator.userAgent)&&! /MSIE 8.0/.test(navigator.userAgent); var mode=document.documentMode||0; var setExpr=$.isFunction(document.createElement('div').style.setExpression); $.blockUI=function(opts){ install(window, opts); }; $.unblockUI=function(opts){ remove(window, opts); }; $.growlUI=function(title, message, timeout, onClose){ var $m=$('
    '); if(title) $m.append('

    '+title+'

    '); if(message) $m.append('

    '+message+'

    '); if(timeout===undefined) timeout=3000; var callBlock=function(opts){ opts=opts||{}; $.blockUI({ message: $m, fadeIn:typeof opts.fadeIn!=='undefined' ? opts.fadeIn:700, fadeOut: typeof opts.fadeOut!=='undefined' ? opts.fadeOut:1000, timeout: typeof opts.timeout!=='undefined' ? opts.timeout:timeout, centerY: false, showOverlay: false, onUnblock: onClose, css: $.blockUI.defaults.growlCSS }); }; callBlock(); var nonmousedOpacity=$m.css('opacity'); $m.mouseover(function(){ callBlock({ fadeIn: 0, timeout: 30000 }); var displayBlock=$('.blockMsg'); displayBlock.stop(); displayBlock.fadeTo(300, 1); }).mouseout(function(){ $('.blockMsg').fadeOut(1000); }); }; $.fn.block=function(opts){ if(this[0]===window){ $.blockUI(opts); return this; } var fullOpts=$.extend({}, $.blockUI.defaults, opts||{}); this.each(function(){ var $el=$(this); if(fullOpts.ignoreIfBlocked&&$el.data('blockUI.isBlocked')) return; $el.unblock({ fadeOut: 0 }); }); return this.each(function(){ if($.css(this,'position')=='static'){ this.style.position='relative'; $(this).data('blockUI.static', true); } this.style.zoom=1; install(this, opts); }); }; $.fn.unblock=function(opts){ if(this[0]===window){ $.unblockUI(opts); return this; } return this.each(function(){ remove(this, opts); }); }; $.blockUI.version=2.70; $.blockUI.defaults={ message: '

    Please wait...

    ', title: null, draggable: true, theme: false, css: { padding: 0, margin: 0, width: '30%', top: '40%', left: '35%', textAlign: 'center', color: '#000', border: '3px solid #aaa', backgroundColor:'#fff', cursor: 'wait' }, themedCSS: { width: '30%', top: '40%', left: '35%' }, overlayCSS: { backgroundColor: '#000', opacity: 0.6, cursor: 'wait' }, cursorReset: 'default', growlCSS: { width: '350px', top: '10px', left: '', right: '10px', border: 'none', padding: '5px', opacity: 0.6, cursor: 'default', color: '#fff', backgroundColor: '#000', '-webkit-border-radius':'10px', '-moz-border-radius': '10px', 'border-radius': '10px' }, iframeSrc: /^https/i.test(window.location.href||'') ? 'javascript:false':'about:blank', forceIframe: false, baseZ: 1000, centerX: true, centerY: true, allowBodyStretch: true, bindEvents: true, constrainTabKey: true, fadeIn: 200, fadeOut: 400, timeout: 0, showOverlay: true, focusInput: true, focusableElements: ':input:enabled:visible', onBlock: null, onUnblock: null, onOverlayClick: null, quirksmodeOffsetHack: 4, blockMsgClass: 'blockMsg', ignoreIfBlocked: false }; var pageBlock=null; var pageBlockEls=[]; function install(el, opts){ var css, themedCSS; var full=(el==window); var msg=(opts&&opts.message!==undefined ? opts.message:undefined); opts=$.extend({}, $.blockUI.defaults, opts||{}); if(opts.ignoreIfBlocked&&$(el).data('blockUI.isBlocked')) return; opts.overlayCSS=$.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS||{}); css=$.extend({}, $.blockUI.defaults.css, opts.css||{}); if(opts.onOverlayClick) opts.overlayCSS.cursor='pointer'; themedCSS=$.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS||{}); msg=msg===undefined ? opts.message:msg; if(full&&pageBlock) remove(window, {fadeOut:0}); if(msg&&typeof msg!='string'&&(msg.parentNode||msg.jquery)){ var node=msg.jquery ? msg[0]:msg; var data={}; $(el).data('blockUI.history', data); data.el=node; data.parent=node.parentNode; data.display=node.style.display; data.position=node.style.position; if(data.parent) data.parent.removeChild(node); } $(el).data('blockUI.onUnblock', opts.onUnblock); var z=opts.baseZ; var lyr1, lyr2, lyr3, s; if(msie||opts.forceIframe) lyr1=$(''); else lyr1=$(''); if(opts.theme) lyr2=$(''); else lyr2=$(''); if(opts.theme&&full){ s=''; } else if(opts.theme){ s=''; } else if(full){ s=''; }else{ s=''; } lyr3=$(s); if(msg){ if(opts.theme){ lyr3.css(themedCSS); lyr3.addClass('ui-widget-content'); } else lyr3.css(css); } if(!opts.theme ) lyr2.css(opts.overlayCSS); lyr2.css('position', full ? 'fixed':'absolute'); if(msie||opts.forceIframe) lyr1.css('opacity',0.0); var layers=[lyr1,lyr2,lyr3], $par=full ? $('body'):$(el); $.each(layers, function(){ this.appendTo($par); }); if(opts.theme&&opts.draggable&&$.fn.draggable){ lyr3.draggable({ handle: '.ui-dialog-titlebar', cancel: 'li' }); } var expr=setExpr&&(!$.support.boxModel||$('object,embed', full ? null:el).length > 0); if(ie6||expr){ if(full&&opts.allowBodyStretch&&$.support.boxModel) $('html,body').css('height','100%'); if((ie6||!$.support.boxModel)&&!full){ var t=sz(el,'borderTopWidth'), l=sz(el,'borderLeftWidth'); var fixT=t ? '(0 - '+t+')':0; var fixL=l ? '(0 - '+l+')':0; } $.each(layers, function(i,o){ var s=o[0].style; s.position='absolute'; if(i < 2){ if(full) s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"'); else s.setExpression('height','this.parentNode.offsetHeight + "px"'); if(full) s.setExpression('width','jQuery.support.boxModel&&document.documentElement.clientWidth||document.body.clientWidth + "px"'); else s.setExpression('width','this.parentNode.offsetWidth + "px"'); if(fixL) s.setExpression('left', fixL); if(fixT) s.setExpression('top', fixT); } else if(opts.centerY){ if(full) s.setExpression('top','(document.documentElement.clientHeight||document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah=document.documentElement.scrollTop ? document.documentElement.scrollTop:document.body.scrollTop) + "px"'); s.marginTop=0; } else if(!opts.centerY&&full){ var top=(opts.css&&opts.css.top) ? parseInt(opts.css.top, 10):0; var expression='((document.documentElement.scrollTop ? document.documentElement.scrollTop:document.body.scrollTop) + '+top+') + "px"'; s.setExpression('top',expression); }}); } if(msg){ if(opts.theme) lyr3.find('.ui-widget-content').append(msg); else lyr3.append(msg); if(msg.jquery||msg.nodeType) $(msg).show(); } if((msie||opts.forceIframe)&&opts.showOverlay) lyr1.show(); if(opts.fadeIn){ var cb=opts.onBlock ? opts.onBlock:noOp; var cb1=(opts.showOverlay&&!msg) ? cb:noOp; var cb2=msg ? cb:noOp; if(opts.showOverlay) lyr2._fadeIn(opts.fadeIn, cb1); if(msg) lyr3._fadeIn(opts.fadeIn, cb2); }else{ if(opts.showOverlay) lyr2.show(); if(msg) lyr3.show(); if(opts.onBlock) opts.onBlock.bind(lyr3)(); } bind(1, el, opts); if(full){ pageBlock=lyr3[0]; pageBlockEls=$(opts.focusableElements,pageBlock); if(opts.focusInput) setTimeout(focus, 20); } else center(lyr3[0], opts.centerX, opts.centerY); if(opts.timeout){ var to=setTimeout(function(){ if(full) $.unblockUI(opts); else $(el).unblock(opts); }, opts.timeout); $(el).data('blockUI.timeout', to); }} function remove(el, opts){ var count; var full=(el==window); var $el=$(el); var data=$el.data('blockUI.history'); var to=$el.data('blockUI.timeout'); if(to){ clearTimeout(to); $el.removeData('blockUI.timeout'); } opts=$.extend({}, $.blockUI.defaults, opts||{}); bind(0, el, opts); if(opts.onUnblock===null){ opts.onUnblock=$el.data('blockUI.onUnblock'); $el.removeData('blockUI.onUnblock'); } var els; if(full) els=$(document.body).children().filter('.blockUI').add('body > .blockUI'); else els=$el.find('>.blockUI'); if(opts.cursorReset){ if(els.length > 1) els[1].style.cursor=opts.cursorReset; if(els.length > 2) els[2].style.cursor=opts.cursorReset; } if(full) pageBlock=pageBlockEls=null; if(opts.fadeOut){ count=els.length; els.stop().fadeOut(opts.fadeOut, function(){ if(--count===0) reset(els,data,opts,el); }); } else reset(els, data, opts, el); } function reset(els,data,opts,el){ var $el=$(el); if($el.data('blockUI.isBlocked')) return; els.each(function(i,o){ if(this.parentNode) this.parentNode.removeChild(this); }); if(data&&data.el){ data.el.style.display=data.display; data.el.style.position=data.position; data.el.style.cursor='default'; if(data.parent) data.parent.appendChild(data.el); $el.removeData('blockUI.history'); } if($el.data('blockUI.static')){ $el.css('position', 'static'); } if(typeof opts.onUnblock=='function') opts.onUnblock(el,opts); var body=$(document.body), w=body.width(), cssW=body[0].style.width; body.width(w-1).width(w); body[0].style.width=cssW; } function bind(b, el, opts){ var full=el==window, $el=$(el); if(!b&&(full&&!pageBlock||!full&&!$el.data('blockUI.isBlocked'))) return; $el.data('blockUI.isBlocked', b); if(!full||!opts.bindEvents||(b&&!opts.showOverlay)) return; var events='mousedown mouseup keydown keypress keyup touchstart touchend touchmove'; if(b) $(document).bind(events, opts, handler); else $(document).unbind(events, handler); } function handler(e){ if(e.type==='keydown'&&e.keyCode&&e.keyCode==9){ if(pageBlock&&e.data.constrainTabKey){ var els=pageBlockEls; var fwd = !e.shiftKey&&e.target===els[els.length-1]; var back=e.shiftKey&&e.target===els[0]; if(fwd||back){ setTimeout(function(){focus(back);},10); return false; }} } var opts=e.data; var target=$(e.target); if(target.hasClass('blockOverlay')&&opts.onOverlayClick) opts.onOverlayClick(e); if(target.parents('div.' + opts.blockMsgClass).length > 0) return true; return target.parents().children().filter('div.blockUI').length===0; } function focus(back){ if(!pageBlockEls) return; var e=pageBlockEls[back===true ? pageBlockEls.length-1:0]; if(e) e.focus(); } function center(el, x, y){ var p=el.parentNode, s=el.style; var l=((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth'); var t=((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth'); if(x) s.left=l > 0 ? (l+'px'):'0'; if(y) s.top=t > 0 ? (t+'px'):'0'; } function sz(el, p){ return parseInt($.css(el,p),10)||0; }} if(typeof define==='function'&&define.amd&&define.amd.jQuery){ define(['jquery'], setup); }else{ setup(jQuery); }})(); ;(function (factory){ var registeredInModuleLoader=false; if(typeof define==='function'&&define.amd){ define(factory); registeredInModuleLoader=true; } if(typeof exports==='object'){ module.exports=factory(); registeredInModuleLoader=true; } if(!registeredInModuleLoader){ var OldCookies=window.Cookies; var api=window.Cookies=factory(); api.noConflict=function (){ window.Cookies=OldCookies; return api; };}}(function (){ function extend (){ var i=0; var result={}; for (; i < arguments.length; i++){ var attributes=arguments[ i ]; for (var key in attributes){ result[key]=attributes[key]; }} return result; } function init (converter){ function api (key, value, attributes){ var result; if(typeof document==='undefined'){ return; } if(arguments.length > 1){ attributes=extend({ path: '/' }, api.defaults, attributes); if(typeof attributes.expires==='number'){ var expires=new Date(); expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5); attributes.expires=expires; } attributes.expires=attributes.expires ? attributes.expires.toUTCString():''; try { result=JSON.stringify(value); if(/^[\{\[]/.test(result)){ value=result; }} catch (e){} if(!converter.write){ value=encodeURIComponent(String(value)) .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); }else{ value=converter.write(value, key); } key=encodeURIComponent(String(key)); key=key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent); key=key.replace(/[\(\)]/g, escape); var stringifiedAttributes=''; for (var attributeName in attributes){ if(!attributes[attributeName]){ continue; } stringifiedAttributes +='; ' + attributeName; if(attributes[attributeName]===true){ continue; } stringifiedAttributes +='=' + attributes[attributeName]; } return (document.cookie=key + '=' + value + stringifiedAttributes); } if(!key){ result={};} var cookies=document.cookie ? document.cookie.split('; '):[]; var rdecode=/(%[0-9A-Z]{2})+/g; var i=0; for (; i < cookies.length; i++){ var parts=cookies[i].split('='); var cookie=parts.slice(1).join('='); if(cookie.charAt(0)==='"'){ cookie=cookie.slice(1, -1); } try { var name=parts[0].replace(rdecode, decodeURIComponent); cookie=converter.read ? converter.read(cookie, name):converter(cookie, name) || cookie.replace(rdecode, decodeURIComponent); if(this.json){ try { cookie=JSON.parse(cookie); } catch (e){}} if(key===name){ result=cookie; break; } if(!key){ result[name]=cookie; }} catch (e){}} return result; } api.set=api; api.get=function (key){ return api.call(api, key); }; api.getJSON=function (){ return api.apply({ json: true }, [].slice.call(arguments)); }; api.defaults={}; api.remove=function (key, attributes){ api(key, '', extend(attributes, { expires: -1 })); }; api.withConverter=init; return api; } return init(function (){}); })); jQuery(function($){ $('.woocommerce-ordering').on('change', 'select.orderby', function(){ $(this).closest('form').submit(); }); $('input.qty:not(.product-quantity input.qty)').each(function(){ var min=parseFloat($(this).attr('min')); if(min >=0&&parseFloat($(this).val()) < min){ $(this).val(min); }}); jQuery('.woocommerce-store-notice__dismiss-link').click(function(){ Cookies.set('store_notice', 'hidden', { path: '/' }); jQuery('.woocommerce-store-notice').hide(); }); if('hidden'===Cookies.get('store_notice')){ jQuery('.woocommerce-store-notice').hide(); }else{ jQuery('.woocommerce-store-notice').show(); }}); jQuery(function($){ if(typeof wc_cart_fragments_params==='undefined'){ return false; } var $supports_html5_storage=true, cart_hash_key=wc_cart_fragments_params.cart_hash_key; try { $supports_html5_storage=('sessionStorage' in window&&window.sessionStorage!==null); window.sessionStorage.setItem('wc', 'test'); window.sessionStorage.removeItem('wc'); window.localStorage.setItem('wc', 'test'); window.localStorage.removeItem('wc'); } catch(err){ $supports_html5_storage=false; } function set_cart_creation_timestamp(){ if($supports_html5_storage){ sessionStorage.setItem('wc_cart_created',(new Date()).getTime()); }} function set_cart_hash(cart_hash){ if($supports_html5_storage){ localStorage.setItem(cart_hash_key, cart_hash); sessionStorage.setItem(cart_hash_key, cart_hash); }} var $fragment_refresh={ url: wc_cart_fragments_params.wc_ajax_url.toString().replace('%%endpoint%%', 'get_refreshed_fragments'), type: 'POST', success: function(data){ if(data&&data.fragments){ $.each(data.fragments, function(key, value){ $(key).replaceWith(value); }); if($supports_html5_storage){ sessionStorage.setItem(wc_cart_fragments_params.fragment_name, JSON.stringify(data.fragments)); set_cart_hash(data.cart_hash); if(data.cart_hash){ set_cart_creation_timestamp(); }} $(document.body).trigger('wc_fragments_refreshed'); }} }; function refresh_cart_fragment(){ $.ajax($fragment_refresh); } if($supports_html5_storage){ var cart_timeout=null, day_in_ms=(24 * 60 * 60 * 1000); $(document.body).on('wc_fragment_refresh updated_wc_div', function(){ refresh_cart_fragment(); }); $(document.body).on('added_to_cart removed_from_cart', function(event, fragments, cart_hash){ var prev_cart_hash=sessionStorage.getItem(cart_hash_key); if(prev_cart_hash===null||prev_cart_hash===undefined||prev_cart_hash===''){ set_cart_creation_timestamp(); } sessionStorage.setItem(wc_cart_fragments_params.fragment_name, JSON.stringify(fragments)); set_cart_hash(cart_hash); }); $(document.body).on('wc_fragments_refreshed', function(){ clearTimeout(cart_timeout); cart_timeout=setTimeout(refresh_cart_fragment, day_in_ms); }); $(window).on('storage onstorage', function(e){ if(cart_hash_key===e.originalEvent.key&&localStorage.getItem(cart_hash_key)!==sessionStorage.getItem(cart_hash_key)){ refresh_cart_fragment(); }}); $(window).on('pageshow' , function(e){ if(e.originalEvent.persisted){ $('.widget_shopping_cart_content').empty(); $(document.body).trigger('wc_fragment_refresh'); }}); try { var wc_fragments=$.parseJSON(sessionStorage.getItem(wc_cart_fragments_params.fragment_name)), cart_hash=sessionStorage.getItem(cart_hash_key), cookie_hash=Cookies.get('woocommerce_cart_hash'), cart_created=sessionStorage.getItem('wc_cart_created'); if(cart_hash===null||cart_hash===undefined||cart_hash===''){ cart_hash=''; } if(cookie_hash===null||cookie_hash===undefined||cookie_hash===''){ cookie_hash=''; } if(cart_hash&&(cart_created===null||cart_created===undefined||cart_created==='')){ throw 'No cart_created'; } if(cart_created){ var cart_expiration=(( 1 * cart_created) + day_in_ms), timestamp_now=(new Date()).getTime(); if(cart_expiration < timestamp_now){ throw 'Fragment expired'; } cart_timeout=setTimeout(refresh_cart_fragment,(cart_expiration - timestamp_now)); } if(wc_fragments&&wc_fragments['div.widget_shopping_cart_content']&&cart_hash===cookie_hash){ $.each(wc_fragments, function(key, value){ $(key).replaceWith(value); }); $(document.body).trigger('wc_fragments_loaded'); }else{ throw 'No fragment'; }} catch(err){ refresh_cart_fragment(); }}else{ refresh_cart_fragment(); } if(Cookies.get('woocommerce_items_in_cart') > 0){ $('.hide_cart_widget_if_empty').closest('.widget_shopping_cart').show(); }else{ $('.hide_cart_widget_if_empty').closest('.widget_shopping_cart').hide(); } $(document.body).on('adding_to_cart', function(){ $('.hide_cart_widget_if_empty').closest('.widget_shopping_cart').show(); }); }); jQuery(document).ready(function($){ $(document).on('click', '.product a.compare:not(.added)', function(e){ e.preventDefault(); var button=$(this), data={ action: yith_woocompare.actionadd, id: button.data('product_id'), context: 'frontend' }, widget_list=$('.yith-woocompare-widget ul.products-list'); if(typeof $.fn.block!='undefined'){ button.block({message: null, overlayCSS: { background: '#fff url(' + yith_woocompare.loader + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}}); widget_list.block({message: null, overlayCSS: { background: '#fff url(' + yith_woocompare.loader + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}}); } $.ajax({ type: 'post', url: yith_woocompare.ajaxurl.toString().replace('%%endpoint%%', yith_woocompare.actionadd), data: data, dataType: 'json', success: function(response){ if(typeof $.fn.block!='undefined'){ button.unblock(); widget_list.unblock() } button.addClass('added') .attr('href', response.table_url) .text(yith_woocompare.added_label); widget_list.html(response.widget_table); if(yith_woocompare.auto_open=='yes') $('body').trigger('yith_woocompare_open_popup', { response: response.table_url, button: button }); }}); }); $(document).on('click', '.product a.compare.added', function (ev){ ev.preventDefault(); var table_url=this.href; if(typeof table_url=='undefined') return; $('body').trigger('yith_woocompare_open_popup', {response: table_url, button: $(this)}); }); $('body').on('yith_woocompare_open_popup', function(e, data){ var response=data.response; if($(window).width() >=768){ $.colorbox({ href: response, iframe: true, width: '90%', height: '90%', className: 'yith_woocompare_colorbox', close: yith_woocompare.close_label, onClosed: function(){ var widget_list=$('.yith-woocompare-widget ul.products-list'), data={ action: yith_woocompare.actionreload, context: 'frontend' }; if(typeof $.fn.block!='undefined'){ widget_list.block({message: null, overlayCSS: {background: '#fff url(' + yith_woocompare.loader + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}}); } $.ajax({ type: 'post', url: yith_woocompare.ajaxurl.toString().replace('%%endpoint%%', yith_woocompare.actionreload), data: data, success: function(response){ if(typeof $.fn.block!='undefined'){ widget_list.unblock().html(response); } widget_list.html(response); }}); }}); $(window).resize(function (){ $.colorbox.resize({ width: '90%', height: '90%' }); }); }else{ var urlparts=response.split('?'); var parameter='iframe'; if(urlparts.length >=2){ var prefix=encodeURIComponent(parameter) + '='; var pars=urlparts[1].split(/[&;]/g); for (var i=pars.length; i-- > 0;){ if(pars[i].lastIndexOf(prefix, 0)!==-1){ pars.splice(i, 1); }} response=urlparts[0] + '?' + pars.join('&'); } window.open(response, yith_woocompare.table_title); }}); $(document).on('click', '.remove a', function(e){ e.preventDefault(); var button=$(this), data={ action: yith_woocompare.actionremove, id: button.data('product_id'), context: 'frontend' }, product_cell=$('td.product_' + data.id + ', th.product_' + data.id); if(typeof $.fn.block!='undefined'){ button.block({ message: null, overlayCSS: { background: '#fff url(' + yith_woocompare.loader + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6 }}); } $.ajax({ type: 'post', url: yith_woocompare.ajaxurl.toString().replace('%%endpoint%%', yith_woocompare.actionremove), data: data, dataType:'html', success: function(response){ var table=$(response).filter('table.compare-list'); $('body > table.compare-list').replaceWith(table); $('.compare[data-product_id="' + button.data('product_id') + '"]', window.parent.document).removeClass('added').html(yith_woocompare.button_text); $(window).trigger('yith_woocompare_product_removed'); }}); }); $('.yith-woocompare-open a, a.yith-woocompare-open').on('click', function(e){ e.preventDefault(); $('body').trigger('yith_woocompare_open_popup', { response: yith_add_query_arg('action', yith_woocompare.actionview) + '&iframe=true' }); }); $('.yith-woocompare-widget') .on('click', 'a.compare', function (e){ e.preventDefault(); $('body').trigger('yith_woocompare_open_popup', { response: $(this).attr('href') }); }) .on('click', 'li a.remove, a.clear-all', function (e){ e.preventDefault(); var lang=$('.yith-woocompare-widget .products-list').data('lang'); var button=$(this), prod_id=button.data('product_id'), data={ action: yith_woocompare.actionremove, id: prod_id, context: 'frontend', responseType: 'product_list', lang: lang }, product_list=button.parents('.yith-woocompare-widget').find('ul.products-list'); if(typeof $.fn.block!='undefined'){ product_list.block({message: null, overlayCSS:{ background:'#fff url(' + yith_woocompare.loader + ') no-repeat center', backgroundSize: '16px 16px', opacity:0.6 }}); } $.ajax({ type: 'post', url: yith_woocompare.ajaxurl.toString().replace('%%endpoint%%', yith_woocompare.actionremove), data: data, dataType: 'html', success: function (response){ if(prod_id=='all'){ $('.compare.added').removeClass('added').html(yith_woocompare.button_text); }else{ $('.compare[data-product_id="' + prod_id + '"]').removeClass('added').html(yith_woocompare.button_text); } product_list.html(response); if(typeof $.fn.block!='undefined'){ product_list.unblock(); }} }); }); $('body').on('added_to_cart', function(ev, fragments, cart_hash, $thisbutton){ if($($thisbutton).closest('table.compare-list').length) $thisbutton.hide(); }); function yith_add_query_arg(key, value){ key=escape(key); value=escape(value); var s=document.location.search; var kvp=key+"="+value; var r=new RegExp("(&|\\?)"+key+"=[^\&]*"); s=s.replace(r,"$1"+kvp); if(!RegExp.$1){s +=(s.length>0 ? '&':'?') + kvp;}; return s; }}); (function(t,e,i){function n(i,n,o){var r=e.createElement(i);return n&&(r.id=Z+n),o&&(r.style.cssText=o),t(r)}function o(){return i.innerHeight?i.innerHeight:t(i).height()}function r(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var n;return void 0===this.cache[e]&&(n=t(this.el).attr("data-cbox-"+e),void 0!==n?this.cache[e]=n:void 0!==i[e]?this.cache[e]=i[e]:void 0!==X[e]&&(this.cache[e]=X[e])),this.cache[e]},this.get=function(e){var i=this.value(e);return t.isFunction(i)?i.call(this.el,this):i}}function h(t){var e=W.length,i=(z+t)%e;return 0>i?e+i:i}function a(t,e){return Math.round((/%/.test(t)?("x"===e?E.width():o())/100:1)*parseInt(t,10))}function s(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function l(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function d(t){"contains"in y[0]&&!y[0].contains(t.target)&&t.target!==v[0]&&(t.stopPropagation(),y.focus())}function c(t){c.str!==t&&(y.add(v).removeClass(c.str).addClass(t),c.str=t)}function g(e){z=0,e&&e!==!1&&"nofollow"!==e?(W=t("."+te).filter(function(){var i=t.data(this,Y),n=new r(this,i);return n.get("rel")===e}),z=W.index(_.el),-1===z&&(W=W.add(_.el),z=W.length-1)):W=t(_.el)}function u(i){t(e).trigger(i),ae.triggerHandler(i)}function f(i){var o;if(!G){if(o=t(i).data(Y),_=new r(i,o),g(_.get("rel")),!$){$=q=!0,c(_.get("className")),y.css({visibility:"hidden",display:"block",opacity:""}),L=n(se,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),b.css({width:"",height:""}).append(L),D=T.height()+k.height()+b.outerHeight(!0)-b.height(),j=C.width()+H.width()+b.outerWidth(!0)-b.width(),A=L.outerHeight(!0),N=L.outerWidth(!0);var h=a(_.get("initialWidth"),"x"),s=a(_.get("initialHeight"),"y"),l=_.get("maxWidth"),f=_.get("maxHeight");_.w=(l!==!1?Math.min(h,a(l,"x")):h)-N-j,_.h=(f!==!1?Math.min(s,a(f,"y")):s)-A-D,L.css({width:"",height:_.h}),J.position(),u(ee),_.get("onOpen"),O.add(I).hide(),y.focus(),_.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",d,!0),ae.one(re,function(){e.removeEventListener("focus",d,!0)})),_.get("returnFocus")&&ae.one(re,function(){t(_.el).focus()})}v.css({opacity:parseFloat(_.get("opacity"))||"",cursor:_.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),_.get("closeButton")?B.html(_.get("close")).appendTo(b):B.appendTo("
    "),w()}}function p(){!y&&e.body&&(V=!1,E=t(i),y=n(se).attr({id:Y,"class":t.support.opacity===!1?Z+"IE":"",role:"dialog",tabindex:"-1"}).hide(),v=n(se,"Overlay").hide(),S=t([n(se,"LoadingOverlay")[0],n(se,"LoadingGraphic")[0]]),x=n(se,"Wrapper"),b=n(se,"Content").append(I=n(se,"Title"),R=n(se,"Current"),P=t('