// source --> https://theoutdoorchef.com.au/wp-content/plugins/eventprime-event-calendar-management/public/js/ep-common-script.js?ver=4.3.2.0 
jQuery( function( $ ) {
    $( document ).ready( function() {
        $('.thumbnail').on('click', function () {
            var clicked = $(this);
            var newSelection = clicked.data('image_url');
            //var $img = $('.primary').css("background-image", "url(" + newSelection + ")");
            var $img = $('.primary').attr('src', "" + newSelection + "");
            clicked.parent().find('.thumbnail').removeClass('selected');
            clicked.addClass('selected');
            $('.primary').empty().append($img.hide().fadeIn('slow'));
        });
        
        /*-- Theme Color Global--*/  
        // set dominent color for nice theme
        
        $(".emagic").prepend("<a>");
        var epColorRgbValue = $('.emagic, #primary.content-area .entry-content, .entry-content .emagic').find('a').css('color');
    
        /*-- Theme Color Global--*/ 
        var epColorRgb = epColorRgbValue;
        var avoid = "rgb";
        if( epColorRgb ) {
            var eprgbRemover = epColorRgb.replace(avoid, '');
            var emColor = eprgbRemover.substring(eprgbRemover.indexOf('(') + 1, eprgbRemover.indexOf(')'));
            $(':root').css('--themeColor', emColor );
        }

        let ep_font_size = eventprime_obj.global_settings.ep_frontend_font_size;
        if( !ep_font_size ) {
            ep_font_size = 14;
        }
        $(':root').css('--themefontsize', ep_font_size + 'px' );
        
        //Adding class on body in case EP content
        if ($('.emagic').length) {
            $('html').addClass('ep-embed-responsive');
        }
        
        //Adding class incase event list right col is small
        var epEventListwidth = $(".ep-box-list-right-col").width();
        
        if(epEventListwidth < 210){
            $(".ep-box-list-right-col .ep-event-list-view-action").addClass("ep-column-small");
        }

        // set dark mode
        if( eventprime_obj.global_settings.enable_dark_mode == 1 ) {
            $( 'body' ).addClass( 'ep-dark-mode-enabled' );
        }
        
    });
    
    $(function() {
        //----- OPEN
        $('[ep-modal-open]').on('click', function(e)  {
            var targeted_popup_class = jQuery(this).attr('ep-modal-open');
            $('[ep-modal="' + targeted_popup_class + '"]').fadeIn(100);
            $('body').addClass('ep-modal-open-body');
            e.preventDefault();
        });
    
        //----- CLOSE
        $('[ep-modal-close]').on('click', function(e)  {
            var targeted_popup_class = jQuery(this).attr('ep-modal-close');
            $('[ep-modal="' + targeted_popup_class + '"]').fadeOut(200);
            $('body').removeClass('ep-modal-open-body');
            e.preventDefault();
        });
    });

    // add event to wishlist
    $( document ).on( 'click', '.ep_event_wishlist_action', function() {
        if( $( '.ep-event-loader' ).length > 0 ) {
            $( '.ep-event-loader' ).show();
        }
        let event_id = $( this ).data( 'event_id' );
        var remove_row_id = $( this ).attr( 'data-remove_row' );
        if( event_id ) {
            let data = { 
                action   : 'ep_event_wishlist_action', 
                security : eventprime_obj.event_wishlist_nonce,
                event_id : event_id
            };
            $.ajax({
                type        : "POST",
                url         : eventprime_obj.ajaxurl,
                data        : data,
                success     : function( response ) {
                    if( $( '.ep-event-loader' ).length > 0 ) {
                        $( '.ep-event-loader' ).hide();
                    }
                    if( response.success == true ) {
                        show_toast( 'success', response.data.message );
                        // add, remove color
                        if( response.data.action == 'add' ) {
                            $( '#ep_event_wishlist_action_' + event_id + ' .ep-handle-fav' ).text( 'favorite' );
                            $( '#ep_event_wishlist_action_' + event_id + ' .ep-handle-fav' ).addClass( 'ep-text-danger' );
                        } else{
                            $( '#ep_event_wishlist_action_' + event_id + ' .ep-handle-fav' ).text( 'favorite_border' );
                            $( '#ep_event_wishlist_action_' + event_id + ' .ep-handle-fav' ).removeClass( 'ep-text-danger' );
                        }
                        $( '#ep_event_wishlist_action_' + event_id ).attr( 'title', response.data.title );
                        
                        // remove block of user profile
                        if( remove_row_id ) {
                            $( '#' + remove_row_id ).remove();
                        }
                        // update count
                        if( $( '#ep_wishlist_event_count' ).length > 0 ) {
                            let eve_count = $( '#ep_wishlist_event_count' ).text();
                            --eve_count;
                            $( '#ep_wishlist_event_count' ).text( eve_count );
                        }
                    } else{
                        show_toast( 'error', response.data.error );
                    }
                }
            });
        }
    });

    // ical export
    $( document ).on( 'click', '#ep_event_ical_export', function(event) {
         event.preventDefault(); // Prevents the link from navigating
        let event_id = $( this ).attr( 'data-event_id' );
        //console.log(event_id);
        if( event_id ) {
            if( window.location.search ) {
                window.location = window.location.href + '&event='+event_id+'&download=ical';
            } else{
                window.location = window.location.href + '?event='+event_id+'&download=ical';
            }
        }
    });

    // image scaling
    $( document ).on( 'mouseover', '.ep-upcoming-box-card-item', function() {
        $( this ).addClass( 'ep-shadow' );
        $( this ).find( '.ep-upcoming-box-card-thumb img' ).css( 'transform', 'scale(1.1,1.1)' );
    });

    $( document ).on( 'mouseout', '.ep-upcoming-box-card-item', function() {
        $( this ).removeClass( 'ep-shadow' );
        $( this ).find( '.ep-upcoming-box-card-thumb img' ).css("transform", "scale(1,1)");
    });

    // Tabmenu 
    $( document ).on( 'click', '.ep-tab-item a', function(){
        $( '.ep-tab-item a' ).removeClass( 'ep-tab-active' );
        $(this).addClass('ep-tab-active');
        var tagid = $(this).data('tag');
        $( '.ep-tab-content' ).removeClass( 'active' ).addClass( 'ep-item-hide' );
        $( '#'+tagid ).addClass( 'active' ).removeClass( 'ep-item-hide' );
    });  
    // Tabmenu End
    
    //Sub Tab Menu
    // Tabmenu 
    $( document ).on( 'click', '.ep-profile-events-tabs a', function(){
        $( '.ep-profile-events-tabs a' ).removeClass( 'ep-tab-active' );
        $(this).addClass('ep-tab-active');
        var tagid = $(this).data('tag');
        $( '.ep-profile-event-tabs-content' ).addClass( 'ep-item-hide' );
        $( '#'+tagid).removeClass( 'ep-item-hide' );
    }); 
    
    // Tab click handler
    $(document).on('click', '.ep-global-tab-link', function () {
        var $tabWrapper = $(this).closest('.ep-global-tab-wrapper');

        // Remove active class from all tabs in this wrapper
        $tabWrapper.find('.ep-global-tab-link').removeClass('ep-global-tab-active');
        $(this).addClass('ep-global-tab-active');

        // Get the target class name from data-tag
        var tagClass = $(this).data('tag');

        // Hide all tab contents in this wrapper
        $tabWrapper.find('.ep-global-tab-content').addClass('ep-item-hide');

        // Show the targeted content in this wrapper
        $tabWrapper.find('.' + tagClass).removeClass('ep-item-hide');
    });

    function ep_init_global_tabs($root) {
        var $ctx = ($root && $root.length) ? $root : $(document);

        $ctx.find('.ep-global-tab-wrapper').each(function () {
            var $tabWrapper = $(this);
            var $firstTab = $tabWrapper.find('.ep-global-tab-item .ep-global-tab-link').first();
            var firstTagClass = $firstTab.data('tag');

            if ($firstTab.length) {
                $tabWrapper.find('.ep-global-tab-link').removeClass('ep-global-tab-active');
                $firstTab.addClass('ep-global-tab-active');

                $tabWrapper.find('.ep-global-tab-content').addClass('ep-item-hide');
                $tabWrapper.find('.' + firstTagClass).removeClass('ep-item-hide');
            }
        });
    }

    // Activate first tab on page load.
    ep_init_global_tabs($(document));

    // Re-init tabs when single event content is reloaded (recurring date switch).
    $(document).on('ajaxSuccess.epGlobalTabs', function (event, xhr, settings) {
        if (!settings || !settings.data) {
            return;
        }

        var data = settings.data;
        var isSingleEventReload = false;

        if (typeof data === 'string') {
            isSingleEventReload = (data.indexOf('action=ep_load_event_single_page') !== -1);
        } else if (typeof data === 'object' && data.action) {
            isSingleEventReload = (data.action === 'ep_load_event_single_page');
        }

        if (!isSingleEventReload) {
            return;
        }

        ep_init_global_tabs($('#ep_single_event_detail_page_content'));
    });

    // Tabmenu End
    
});
    
/**
 * Format price with currency position.
 * @param {int|float} price 
 * @param {string} currency 
 * @returns Formatted Price.
 */
function ep_format_price_with_position( price, currency = null ) {
    price = parseFloat( price ).toFixed( 2 );
    if( !currency ) {
        currency = eventprime_obj.currency_symbol;
    }
    position = eventprime_obj.global_settings.currency_position;
    if( position == 'before' ) {
        price = currency + price;
    } else if( position == 'before_space' ) {
        price = currency + ' ' + price;
    } else if( position == 'after' ) {
        price = price + currency;
    } else if( position == 'after_space' ) {
        price = price + ' ' + currency;
    }
    return price;
}

/**
 * Return the translation of errors
 * 
 * @param {string} key
 */
function get_translation_string( key ) {
    let transObj = eventprime_obj.trans_obj;
    if ( transObj.hasOwnProperty( key ) ) {
        return eventprime_obj.trans_obj[key];
    }
}

/**
 * Validate the website url
 * 
 * @param {string} url Website URL
 * 
 * @return {bool} URL is valid or invalid
 */
function is_valid_url_old( url ) {
    var urlPattern = new RegExp('^(https?:\\/\\/)?' + // validate protocol
            '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // validate domain name
            '((\\d{1,3}\\.){3}\\d{1,3}))' + // validate OR ip (v4) address
            '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // validate port and path
            '(\\?[;&a-z\\d%_.~+=-]*)?' + // validate query string
            '(\\#[-a-z\\d_]*)?$', 'i'); // validate fragment locator
    return !!urlPattern.test( url );
}

function is_valid_url( url ) {
    if (typeof url !== 'string') return false;
    var v = url.trim();
    if (!v) return false;

    // Accept URLs without protocol (like your old regex): add http:// to parse
    var hasProtocol = /^[a-zA-Z][a-zA-Z0-9+\-.]*:\/\//.test(v);
    var candidate = hasProtocol ? v : 'http://' + v;

    try {
        var u = new URL(candidate);

        // If protocol was provided, only accept http/https (old regex did http/https only)
        if (hasProtocol && u.protocol !== 'http:' && u.protocol !== 'https:') return false;

        // Host must be either IPv4 or domain with a dot + TLD >= 2 chars (like old regex)
        var host = u.hostname;
        var isIPv4 = /^(25[0-5]|2[0-4]\d|[01]?\d?\d)(\.(25[0-5]|2[0-4]\d|[01]?\d?\d)){3}$/.test(host);
        var isDomain = /^[a-z0-9-]+(\.[a-z0-9-]+)+$/i.test(host) && /\.[a-z]{2,}$/i.test(host);

        if (!isIPv4 && !isDomain) return false;

        // Optional port/path/query/hash are already handled by URL parsing
        // If we reach here, treat as valid (same boolean return style as before)
        return true;
    } catch (e) {
        return false;
    }
}

/**
 * Validate the phone number
 * 
 * @param {string} phone_number Phone Number
 * 
 * @return {bool} Phone Number is valid or invalid
 */
function is_valid_phone( phone_number ) {
    var phonePattern = new RegExp('^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$');
    return !!phonePattern.test( phone_number );
}
/**
 * Validate the email
 * 
 * @param {string} email Email
 * 
 * @return {bool} Email is valid or invalid
 */
function is_valid_email( email ) {
    //var emailPattern = new RegExp('[^@ \t\r\n]+@[^@ \t\r\n]+\.[^@ \t\r\n]+');
    var emailPattern = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
    return emailPattern.test(email);
}

jQuery(document).ready(function($) {
    $('#ep-gdpr-badge, #ep_gdpr_modal .ep-modal-overlay, #ep_gdpr_modal .ep-modal-close').on('click', function() {
        //$('#ep-gdpr-modal').show(100);
        $('#ep_gdpr_modal').toggleClass("ep_gdpr_modal_active").fadeToggle(100);
    });

    $('.ep-gdpr-modal-close, #ep-gdpr-modal').on('click', function(e) {
        // Close modal only if clicking background or close button
        if ($(e.target).is('#ep-gdpr-modal') || $(e.target).hasClass('ep-gdpr-modal-close')) {
            $('#ep-gdpr-modal').fadeOut();
        }
    });
});

/*---

   $(function() {
        //----- OPEN
        $('[ep-modal-open]').on('click', function(e)  {
            var targeted_popup_class = jQuery(this).attr('ep-modal-open');
            $('[ep-modal="' + targeted_popup_class + '"]').fadeIn(100);
            $('body').addClass('ep-modal-open-body');
            e.preventDefault();
        });
    
        //----- CLOSE
        $('[ep-modal-close]').on('click', function(e)  {
            var targeted_popup_class = jQuery(this).attr('ep-modal-close');
            $('[ep-modal="' + targeted_popup_class + '"]').fadeOut(200);
            $('body').removeClass('ep-modal-open-body');
            e.preventDefault();
        });
    });
 * 
 * 
 */;
// source --> https://theoutdoorchef.com.au/wp-content/plugins/wonderplugin-gridgallery/engine/wonderplugingridlightbox.js?ver=19.5.1PRO 
/** Wonderplugin Portfolio Grid Gallery Plugin Pro Version
 * Copyright 2026 Magic Hills Pty Ltd All Rights Reserved
 * Website: http://www.wonderplugin.com
 * Version 19.5 
 */
(function(){var scripts=document.getElementsByTagName("script");var jsFolder="";for(var i=0;i<scripts.length;i++)if(scripts[i].src&&scripts[i].src.match(/html5lightbox\.js/i))jsFolder=scripts[i].src.substr(0,scripts[i].src.lastIndexOf("/")+1);var loadjQuery=false;if(typeof jQuery=="undefined")loadjQuery=true;else{var jVersion=jQuery.fn.jquery.split(".");if(jVersion[0]<1||jVersion[0]==1&&jVersion[1]<6)loadjQuery=true}if(loadjQuery){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");
script.setAttribute("type","text/javascript");if(script.readyState)script.onreadystatechange=function(){if(script.readyState=="loaded"||script.readyState=="complete"){script.onreadystatechange=null;loadWPGridHtml5LightBox(jsFolder)}};else script.onload=function(){loadWPGridHtml5LightBox(jsFolder)};script.setAttribute("src",jsFolder+"jquery.js");head.appendChild(script)}else loadWPGridHtml5LightBox(jsFolder)})();
function loadWPGridHtml5LightBox(jsFolder){(function($){$.fn.wonderplugingridlightbox=function(options){var inst=this;inst.sanitizeHTML=function(inputHtml,stripAll){if(!inputHtml||typeof inputHtml!=="string"||inputHtml.trim()==="")return"";inputHtml=inputHtml.replace(/javascript\s*:/gi,"").replace(/\son\w+="[^"]*"/gi,"").replace(/\son\w+='[^']*'/gi,"").replace(/\son\w+=\s*[^\s>]+/gi,"");var ALLOWED_TAGS=stripAll?[]:["a","b","i","u","strong","em","p","br","span","img"];var ALLOWED_ATTRS=stripAll?{}:{"a":["href","title",
"target","rel","style","class"],"img":["src","alt","title","width","height","style","class"],"span":["title","style","class"],"p":["style","class"],"b":["style","class"],"i":["style","class"],"u":["style","class"],"strong":["style","class"],"em":["style","class"],"br":[]};var ALLOWED_STYLES=stripAll?[]:["color","background-color","font-size","font-weight","font-style","text-decoration","text-align","margin","padding","border","display","width","height"];var tempDiv=document.createElement("div");tempDiv.innerHTML=
inputHtml;function cleanStyles(styleValue){if(!styleValue||typeof styleValue!=="string")return"";var rules=styleValue.split(";");var safeRules=[];for(var i=0;i<rules.length;i++){var rule=rules[i];var parts=rule.split(":");if(parts.length!==2)continue;var property=parts[0].trim().toLowerCase();var value=parts[1].trim();if(ALLOWED_STYLES.indexOf(property)!==-1)safeRules.push(property+": "+value)}return safeRules.join("; ")}function cleanNode(node){if(node.nodeType===1){var tag=node.tagName.toLowerCase();
if(ALLOWED_TAGS.indexOf(tag)===-1)if(node.childNodes&&node.childNodes.length>0){var fragment=document.createDocumentFragment();while(node.firstChild){var oldchild=node.firstChild;node.removeChild(oldchild);var cleanedChild=cleanNode(oldchild);fragment.appendChild(cleanedChild)}return fragment}else return document.createTextNode("");var attributes=[].slice.call(node.attributes);for(var j=0;j<attributes.length;j++){var attr=attributes[j];var name=attr.name.toLowerCase();var value=attr.value;var allowedAttrs=
ALLOWED_ATTRS[tag]||[];if((name==="href"||name==="src")&&value.trim().toLowerCase().indexOf("javascript:")===0){node.removeAttribute(attr.name);continue}if(name==="style"&&allowedAttrs.indexOf("style")!==-1){var safeStyle=cleanStyles(value);if(safeStyle)node.setAttribute("style",safeStyle);else node.removeAttribute("style");continue}if(name==="class"&&allowedAttrs.indexOf("class")!==-1){node.setAttribute("class",value.trim());continue}if(name.indexOf("on")===0||allowedAttrs.indexOf(name)===-1)node.removeAttribute(attr.name)}}var children=
Array.from(node.childNodes);for(var k=0;k<children.length;k++){var child=children[k];var cleaned=cleanNode(child);if(cleaned!==child)node.replaceChild(cleaned,child)}return node}var cleaned=cleanNode(tempDiv);var outputDiv=document.createElement("div");outputDiv.appendChild(cleaned);return outputDiv.innerHTML};inst.options=$.extend({freelink:"http://www.wonderplugin.com/wordpress-gridgallery/",pushwindowhistory:false,defaultvideovolume:1,mutevideo:false,playsinline:false,autoclose:false,autoclosedelay:0,resizedelay:100,insideiframe:false,
iframetopmargin:-1,iframesamedomain:false,autoresizecontent:true,defaultwidth:960,defaultheight:540,usedefaultsizeforcontent:false,usedefaultwidthforcontent:true,usedefaultheightforcontent:false,mediumbreakpoint:800,smallbreakpoint:600,preload:true,preloadallonpageload:false,preloadalldelay:5E3,autoplay:true,loopvideo:false,html5player:true,responsive:true,nativehtml5controls:false,videohidecontrols:false,videohidecontrolbar:false,videohideplaybutton:false,enableclick:false,enablespacekey:false,videoplaystyle:"circled",
videoiconbg:"#333",videoiconcolor:"#fff",videoicondisabledcolor:"#aaa",videobarbuffercolor:"#444",videobaractivecolor:"#fcc500",videobarcolor:"#666",videobarbgopacity:0.7,videoplaysize:64,videoplayfontsize:32,videoplayradius:32,videoplayopacity:0.8,videoplaytimeout:1500,videocontroltimeout:3E3,videohidetotaltimewidth:320,videohidecurrtimewidth:240,autoplayhtml5onmobile:true,nativecontrolsonfirefox:false,nativecontrolsonie:false,nativecontrolsoniphone:true,nativecontrolsonipad:true,nativecontrolsonandroid:true,
nativecontrolsonfullscreen:true,nativecontrolsnodownload:true,noresizecallback:true,imagekeepratio:true,maxheight:false,elemautoheight:false,contentkeepratio:false,transition:"none",transitionduration:400,enteranimation:"",enteranimationduration:"500ms",exitanimation:"",animationduration:"1s",enablepdfjs:true,pdfjsengine:"",pdfengineurlparam:"file",openpdfinnewtaboniphone:false,openpdfinnewtabonipad:false,googleanalyticsaccount:"",ga4account:"",enablega4:true,arrowloop:true,showall:false,userelforgroup:true,
shownavigation:true,thumbwidth:96,thumbheight:72,thumbgap:4,thumbtopmargin:12,thumbbottommargin:12,thumbborder:1,thumbbordercolor:"transparent",thumbhighlightbordercolor:"#fff",thumbopacity:1,navbuttonwidth:32,hidenavigationonmobile:false,hidenavigationonipad:false,navbgcolor:"rgba(0,0,0,0.2)",shownavcontrol:true,navcontrolimage:"lightbox-navcontrol.png",hidenavdefault:false,overlaybgcolor:"#000",overlayopacity:0.9,bgcolor:"#fff",bordersize:8,borderradius:0,bordermargin:16,bordertopmargin:48,barautoheight:true,
barheight:64,smallscreenheight:415,responsivebarheight:false,barheightonsmallheight:64,notkeepratioonsmallheight:false,bordertopmarginsmall:36,loadingusefont:true,closeusefont:true,arrowsusefont:true,navusefont:true,playusefont:true,html5playerusefont:true,loadingwidth:48,loadingheight:48,loadingfontname:"mh-icon-spin5",loadingfontcolor:"#222",loadingfontbg:"transparent",resizespeed:400,fadespeed:0,jsfolder:jsFolder,skinsfoldername:"skins/default/",loadingimage:"lightbox-loading.gif",nextimage:"lightbox-next.png",
previmage:"lightbox-prev.png",closeimage:"lightbox-close.png",playvideoimage:"lightbox-playvideo.png",titlebgimage:"lightbox-titlebg.png",navarrowsprevimage:"lightbox-navprev.png",navarrowsnextimage:"lightbox-navnext.png",closepos:"outside",navarrowsalwaysshowontouch:true,showarrowsbottomonsmallscreen:true,navarrowsbottomscreenwidth:479,outsidearrowspos:"middle",closeonoverlay:true,limitfocus:true,navarrowspos:"inside",alwaysshownavarrows:false,showplaybutton:true,playimage:"lightbox-play.png",pauseimage:"lightbox-pause.png",
playimagesize:32,fullscreenmode:false,fullscreencloseimage:"lightbox-close-fullscreen.png",fullscreennextimage:"lightbox-next-fullscreen.png",fullscreenprevimage:"lightbox-prev-fullscreen.png",fullscreennomargin:false,fullscreenmodeonsmallscreen:false,fullscreennomarginonsmallscreen:false,fullscreensmallscreenwidth:800,fullscreenbgcolor:"transparent",fullscreenbordersize:0,fullscreentextinside:false,fullscreentextoutside:true,fullscreennotransition:true,fullscreenloadingfontcolor:"#eee",videobgcolor:"#000",
html5videoposter:"",showtitle:true,titlestyle:"bottom",titleinsidecss:"color:#fff; font-size:16px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left; margin:4px 8px;",titlebottomcss:"color:#333; font-size:16px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left;",titleoutsidecss:"color:#fff; font-size:18px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:center; margin: 8px;",resizeleftright:true,showonmouseoverinside:false,showinsidetitleforimageonly:true,
showdescription:true,descriptioninsidecss:"color:#fff; font-size:12px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left; margin:4px 0px 0px; padding: 0px;",descriptionbottomcss:"color:#333; font-size:12px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left; margin:4px 0px 0px; padding: 0px;",descriptionoutsidecss:"color:#fff; font-size:14px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:center; margin:8px; padding: 0px;",fullscreentitlebottomcss:"color:#fff; font-size:16px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left; margin:4px 8px 8px;",
fullscreendescriptionbottomcss:"color:#fff; font-size:12px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left; margin:4px 0px 0px; padding: 0px;",showsocialmedia:true,socialmediaposition:"position:absolute;top:8px;right:8px;",showtitleprefix:true,titleprefix:"%NUM / %TOTAL",autoslide:false,slideinterval:5E3,showtimer:true,timerposition:"bottom",timerheight:2,timercolor:"#dc572e",timeropacity:1,initvimeo:true,inityoutube:true,swipepreventdefaultonandroid:false,initsocial:true,
showsocial:false,sharemediaurl:false,socialposition:"position:absolute;top:100%;right:0;",socialpositionsmallscreen:"position:absolute;top:100%;right:0;left:0;",socialdirection:"horizontal",socialbuttonsize:32,socialbuttonfontsize:18,socialrotateeffect:true,showfacebook:true,showlinkedin:false,showtwitter:true,showpinterest:true,showwhatsapp:false,showtelegram:false,showemail:true,showdownload:false,showcopylink:false,showcopymedialink:false,shareopendelay:100,sharetextprefix:"Check Out This",extrasocialcodebefore:"",
extrasocialcodeafter:"",imagepercentage:75,sidetobottomscreenwidth:479,errorwidth:280,errorheight:48,errorcss:"text-align:center; color:#ff0000; font-size:14px; font-family:Arial, sans-serif;",enabletouchswipe:true,mobileresizeevent:false,swipedistance:0,bodynoscroll:false,useabsolutepos:false,useabsoluteposonmobile:false,supportesckey:true,supportarrowkeys:true,showsubtitle:false,vtturl:"",vttline:-4,vttlang:"en",vttlabel:"English",showsubtitlebydefault:true,enableaudio:false,audiofile:"",audioautoplay:true,
audioloop:true,audioshowonhover:true,audiobtnfullscreencss:"position:absolute;top:0;right:36px;margin:0;",audiobtnfullscreencolor:"#eee",audiobtnfullscreenbg:"transparent",audiobtncss:"position:absolute;top:0;right:0;margin:16px 16px 0 0;",audiobtncolor:"#fff",audiobtnbg:"#c92228",oncloseurl:"",oncloseurltarget:"",onvideofinishurl:"",onvideofinishurltarget:"",removequerystring:false,version:"3.3",stamp:false,freemark:"87,111,114,100,80,114,101,115,115,32,71,97,108,108,101,114,121,32,84,114,105,97,108,32,86,101,114,115,105,111,110",
watermark:"",watermarklink:""},options);if(typeof wondergridgallerylightbox_options!="undefined"&&wondergridgallerylightbox_options)$.extend(inst.options,wondergridgallerylightbox_options);if($("div.wondergridgallerylightbox_options").length)$.each($("div.wondergridgallerylightbox_options").data(),function(key,value){inst.options[key.toLowerCase()]=value});if($("div#wondergridgallerylightbox_options").length)$.each($("div#wondergridgallerylightbox_options").data(),function(key,value){inst.options[key.toLowerCase()]=value});if($("div#html5lightbox_general_options").length)$.each($("div#html5lightbox_general_options").data(),
function(key,value){inst.options[key.toLowerCase()]=value});if(window.WonderGridGalleryOptions){inst.options.jsfolder=window.WonderGridGalleryOptions.jsfolder;inst.options.skinsfoldername=window.WonderGridGalleryOptions.skinsfoldername}inst.options.jsfolder=inst.sanitizeHTML(inst.options.jsfolder,true);inst.options.skinsfoldername=inst.sanitizeHTML(inst.options.skinsfoldername,true);var ELEM_TYPE=0,ELEM_HREF=1,ELEM_TITLE=2,ELEM_GROUP=3,ELEM_WIDTH=4,ELEM_HEIGHT=5,ELEM_HREF_WEBM=6,ELEM_HREF_OGG=7,ELEM_THUMBNAIL=
8,ELEM_DESCRIPTION=9,ELEM_DIV=10,ELEM_ORIGINALWIDTH=11,ELEM_ORIGINALHEIGHT=12,ELEM_SOCIALMEDIA=13,ELEM_WEBLINK=14,ELEM_WEBLINKTARGET=15,ELEM_WEBLINKTEXT=16,ELEM_MEDIUMWIDTH=17,ELEM_MEDIUMHEIGHT=18,ELEM_SMALLWIDTH=19,ELEM_SMALLHEIGHT=20;inst.options.types=["IMAGE","FLASH","VIDEO","YOUTUBE","VIMEO","PDF","MP3","WEB","FLV","DAILYMOTION","DIV","WISTIA","IFRAMEVIDEO"];inst.options.htmlfolder=window.location.href.substr(0,window.location.href.lastIndexOf("/")+1);inst.options.skinsfolder=inst.options.skinsfoldername;
if(inst.options.skinsfolder.length>0&&inst.options.skinsfolder[inst.options.skinsfolder.length-1]!="/")inst.options.skinsfolder+="/";if(inst.options.skinsfolder.charAt(0)!="/"&&inst.options.skinsfolder.substring(0,5)!="http:"&&inst.options.skinsfolder.substring(0,6)!="https:")inst.options.skinsfolder=inst.options.jsfolder+inst.options.skinsfolder;var image_list=["loadingimage","nextimage","previmage","closeimage","playvideoimage","titlebgimage","navarrowsprevimage","navarrowsnextimage","navcontrolimage",
"playimage","pauseimage","fullscreencloseimage","fullscreennextimage","fullscreenprevimage"];for(var i=0;i<image_list.length;i++)if(inst.options[image_list[i]])if(inst.options[image_list[i]].substring(0,7).toLowerCase()!="http://"&&inst.options[image_list[i]].substring(0,8).toLowerCase()!="https://")inst.options[image_list[i]]=inst.options.skinsfolder+inst.options[image_list[i]];var i;var l;var mark="";var bytes=inst.options.freemark.split(",");for(i=0;i<bytes.length;i++)mark+=String.fromCharCode(bytes[i]);
inst.options.freemark=mark;var d0="wmoangdiecrpluginh.iclolms";for(i=1;i<=5;i++)d0=d0.slice(0,i)+d0.slice(i+1);l=d0.length;for(i=0;i<5;i++)d0=d0.slice(0,l-9+i)+d0.slice(l-8+i);if(inst.options.htmlfolder.indexOf(d0)!=-1)inst.options.stamp=false;inst.options.flashInstalled=false;inst.options.html5VideoSupported=!!document.createElement("video").canPlayType;inst.options.isChrome=navigator.userAgent.match(/Chrome/i)!=null;inst.options.isFirefox=navigator.userAgent.match(/Firefox/i)!=null;inst.options.isOpera=
navigator.userAgent.match(/Opera/i)!=null||navigator.userAgent.match(/OPR\//i)!=null;inst.options.isSafari=navigator.userAgent.match(/Safari/i)!=null;inst.options.isIE11=navigator.userAgent.match(/Trident\/7/)!=null&&navigator.userAgent.match(/rv:11/)!=null;inst.options.isIE=navigator.userAgent.match(/MSIE/i)!=null&&!inst.options.isOpera;inst.options.isIE10=navigator.userAgent.match(/MSIE 10/i)!=null&&!this.options.isOpera;inst.options.isIE9=navigator.userAgent.match(/MSIE 9/i)!=null&&!inst.options.isOpera;
inst.options.isIE8=navigator.userAgent.match(/MSIE 8/i)!=null&&!inst.options.isOpera;inst.options.isIE7=navigator.userAgent.match(/MSIE 7/i)!=null&&!inst.options.isOpera;inst.options.isIE6=navigator.userAgent.match(/MSIE 6/i)!=null&&!inst.options.isOpera;inst.options.isIE678=inst.options.isIE6||inst.options.isIE7||inst.options.isIE8;inst.options.isIE6789=inst.options.isIE6||inst.options.isIE7||inst.options.isIE8||inst.options.isIE9;inst.options.isAndroid=navigator.userAgent.match(/Android/i)!=null;
inst.options.isIPad=navigator.userAgent.match(/iPad/i)!=null;inst.options.isIPhone=navigator.userAgent.match(/iPod/i)!=null||navigator.userAgent.match(/iPhone/i)!=null;inst.options.isIOS=inst.options.isIPad||inst.options.isIPhone;inst.options.isMobile=inst.options.isAndroid||inst.options.isIPad||inst.options.isIPhone;inst.options.isIOSLess5=inst.options.isIPad&&inst.options.isIPhone&&(navigator.userAgent.match(/OS 4/i)!=null||navigator.userAgent.match(/OS 3/i)!=null);inst.options.supportCSSPositionFixed=
!inst.options.isIE6&&!inst.options.isIOSLess5;inst.options.iequirksmode=inst.options.isIE6789&&document.compatMode!="CSS1Compat";inst.options.isTouch="ontouchstart"in window;if(inst.options.isChrome){var match=navigator.userAgent.match(/Chrome\/([0-9]+)/);inst.options.chromeVersion=match&&match.length>=2?parseInt(match[1],10):0}if(inst.options.isAndroid){var match=navigator.userAgent.match(/Android\s([0-9\.]*)/i);inst.options.androidVersion=match&&match.length>=2?parseInt(match[1],10):-1}var v=document.createElement("video");
inst.options.canplaymp4=v&&v.canPlayType&&v.canPlayType("video/mp4").replace(/no/,"");if(inst.options.isFirefox&&inst.options.nativecontrolsonfirefox||(inst.options.isIE6789||inst.options.isIE10||inst.options.isIE11)&&inst.options.nativecontrolsonie||inst.options.isIPhone&&inst.options.nativecontrolsoniphone||inst.options.isIPad&&inst.options.nativecontrolsonipad||inst.options.isAndroid&&inst.options.nativecontrolsonandroid)inst.options.nativehtml5controls=true;if(inst.options.isIOS||inst.options.isAndroid)inst.options.nativecontrolsonfullscreen=
true;inst.options.navheight=0;inst.options.thumbgap+=2*inst.options.thumbborder;inst.options.resizeTimeout=-1;inst.slideTimeout=null;inst.autosliding=false;inst.existingElem=-1;inst.direction=-3;inst.elemArray=new Array;inst.options.curElem=-1;inst.defaultoptions=$.extend({},inst.options);if(inst.options.enablega4&&inst.options.ga4account&&typeof gtag!=="function"){window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}gtag("js",new Date);gtag("config",inst.options.ga4account);
$.getScript("https://www.googletagmanager.com/gtag/js?id="+encodeURIComponent(inst.options.ga4account))}if(inst.options.googleanalyticsaccount&&!window._gaq){window._gaq=window._gaq||[];window._gaq.push(["_setAccount",inst.options.googleanalyticsaccount]);window._gaq.push(["_trackPageview"]);$.getScript("https://ssl.google-analytics.com/ga.js")}if(inst.options.initvimeo){var tag=document.createElement("script");tag.src=inst.options.jsfolder+"player.js";var firstScriptTag=document.getElementsByTagName("script")[0];
firstScriptTag.parentNode.insertBefore(tag,firstScriptTag)}if(inst.options.inityoutube){var tag=document.createElement("script");tag.src="https://www.youtube.com/iframe_api";var firstScriptTag=document.getElementsByTagName("script")[0];firstScriptTag.parentNode.insertBefore(tag,firstScriptTag)}if(inst.options.initsocial)$("head").append('<link rel="stylesheet" href="'+inst.options.jsfolder+'icons/css/mhfontello.css?v=11" type="text/css" />');inst.showing=false;inst.navvisible=false;inst.disableKeyOutsideOfLightbox=
function(event){if($(event.target).closest("#gridgallery-html5-lightbox").length<=0){event.preventDefault();$("#html5-lightbox-box .html5-elem-box").attr("tabindex","-1").focus()}};if(inst.options.limitfocus){$(window).on("html5lightbox.lightboxopened",function(){$(document).on("keydown",inst.disableKeyOutsideOfLightbox);$("#html5-lightbox-box .html5-elem-box").attr("tabindex","-1").focus()});$(window).on("html5lightbox.lightboxclosed",function(){$(document).off("keydown",inst.disableKeyOutsideOfLightbox)})}inst.disableEscKey=
function(isFullscreen){if(isFullscreen)inst.disableesckeyinfullscreen=true;else setTimeout(function(){inst.disableesckeyinfullscreen=false},1E3)};inst.supportKeyboard=function(){inst.disableesckeyinfullscreen=false;$(document).keyup(function(e){if(!inst.showing)return;if(!inst.disableesckeyinfullscreen&&inst.options.supportesckey&&e.keyCode==27)inst.finish();else if(inst.options.supportarrowkeys)if(e.keyCode==39)inst.gotoSlide(-1);else if(e.keyCode==37)inst.gotoSlide(-2)});if(inst.options.supportesckey&&
document.addEventListener){document.addEventListener("MSFullscreenChange",function(){inst.disableEscKey(document.msFullscreenElement!=null)},false);document.addEventListener("webkitfullscreenchange",function(){inst.disableEscKey(document.webkitIsFullScreen)},false)}};inst.supportKeyboard();inst.init=function(){inst.showing=false;inst.readData();inst.createMarkup();inst.initSlide();if(inst.options.onvideofinishurl)$(window).on("html5lightbox.videofinished",function(){window.open(inst.options.onvideofinishurl,
inst.options.onvideofinishurltarget)})};inst.checkParentData=function(node,parentNode,attr,isInt){var val=node.data(attr)?node.data(attr):parentNode&&parentNode.data(attr)?parentNode.data(attr):null;if(isInt)if(/^\d+%?$/.test(val))val=String(val).endsWith("%")?String(val):parseInt(val);else val=null;else if(val)val=String(val);return val};inst.checkParentClass=function(node,parentNode,attr){var ret=null;$.each([node,parentNode],function(index,nodeValue){if(nodeValue&&nodeValue.attr("class")){var classList=
nodeValue.attr("class").split(/\s+/);$.each(classList,function(index,className){if(className&&className.toLowerCase().indexOf("html5lightbox-"+attr+"-")==0){var names=className.split("-");if(names.length==3){var val=names[2];if(val.toLowerCase()=="true")val=true;else if(val.toLowerCase()=="false")val=false;else if(/^\d+$/.test(val))val=parseInt(val);else if(!isNaN(val))val=parseFloat(val);ret=val}}})}});return ret};inst.removeQueryString=function(href){try{var url=new URL(href,window.location.origin);
return url.origin+url.pathname}catch(e){return href.split("?")[0]}};inst.readNodeData=function(node,parentNode){var fileType="mediatype"in node.data()?node.data("mediatype"):inst.checkType(node.attr("href"));if(fileType<0)return;if(inst.options.removequerystring&&node.attr("href"))node.attr("href",inst.removeQueryString(node.attr("href")));if(inst.options.filterurl&&window[inst.options.filterurl]&&typeof window[inst.options.filterurl]==="function"&&node.attr("href"))node.attr("href",window[inst.options.filterurl](node.attr("href")));
var title=node.data("title")?node.data("title"):node.attr("title");if(!title&&node.find("img").length>0){var img=node.find("img");title=img.attr("title")?img.attr("title"):img.attr("alt")?img.attr("alt"):""}if(title)title=String(title);title=inst.sanitizeHTML(title);var group=node.data("group")?node.data("group"):inst.options.userelforgroup?node.attr("rel"):null;if(!group&&parentNode)group=parentNode.data("group")?parentNode.data("group"):inst.options.userelforgroup?parentNode.attr("rel"):null;for(var i=
0;i<inst.elemArray.length;i++)if(node.attr("href")==inst.elemArray[i][ELEM_HREF]){inst.elemArray[i][ELEM_TITLE]=title;inst.elemArray[i][ELEM_GROUP]=group;return}var w=inst.checkParentClass(node,parentNode,"width");var h=inst.checkParentClass(node,parentNode,"height");if(!w)w=inst.checkParentData(node,parentNode,"width",true);if(!h)h=inst.checkParentData(node,parentNode,"height",true);var mediumw=inst.checkParentClass(node,parentNode,"mediumwidth");var mediumh=inst.checkParentClass(node,parentNode,
"mediumheight");if(!mediumw)mediumw=inst.checkParentData(node,parentNode,"mediumwidth",true);if(!mediumw)mediumw=w;if(!mediumh)mediumh=inst.checkParentData(node,parentNode,"mediumheight",true);if(!mediumh)mediumh=h;var smallw=inst.checkParentClass(node,parentNode,"smallwidth");var smallh=inst.checkParentClass(node,parentNode,"smallheight");if(!smallw)smallw=inst.checkParentData(node,parentNode,"smallwidth",true);if(!smallw)smallw=mediumw;if(!smallh)smallh=inst.checkParentData(node,parentNode,"smallheight",
true);if(!smallh)smallh=mediumh;var newItem=new Array(fileType,node.attr("href"),title,group,w,h,inst.checkParentData(node,parentNode,"webm"),inst.checkParentData(node,parentNode,"ogg"),inst.checkParentData(node,parentNode,"thumbnail"),inst.checkParentData(node,parentNode,"description"),null,null,null,inst.checkParentData(node,parentNode,"socialmedia"),inst.checkParentData(node,parentNode,"weblink"),inst.checkParentData(node,parentNode,"weblinktarget"),inst.checkParentData(node,parentNode,"weblinktext"),
mediumw,mediumh,smallw,smallh);var container=node.closest(".lightboxcontainer");if(container.length>0){if(container.find(".lightboxtitle").length>0)newItem[ELEM_TITLE]=container.find(".lightboxtitle").text();if(container.find(".lightboxdescription").length>0)newItem[ELEM_DESCRIPTION]=container.find(".lightboxdescription").text()}newItem[ELEM_DESCRIPTION]=inst.sanitizeHTML(newItem[ELEM_DESCRIPTION]);inst.elemArray.push(newItem)};inst.readData=function(){inst.each(function(){var self=$(this);if(this.nodeName.toLowerCase()==
"a"||this.nodeName.toLowerCase()=="area")inst.readNodeData(self);else self.find("a,area").each(function(){inst.readNodeData($(this),self)})})};inst.createMarkup=function(){if($(window).width()<=inst.options.fullscreensmallscreenwidth){if(inst.options.fullscreenmodeonsmallscreen){inst.options.fullscreenmode=true;if(inst.options.fullscreennomarginonsmallscreen)inst.options.fullscreennomargin=true}if(inst.options.fullscreenmode&&inst.options.fullscreennomarginonsmallscreen)inst.options.fullscreennomargin=
true}if(inst.options.fullscreenmode){inst.options.bgcolor=inst.options.fullscreenbgcolor;inst.options.bordersize=inst.options.fullscreenbordersize;inst.options.loadingfontcolor=inst.options.fullscreenloadingfontcolor;if(inst.options.fullscreennomargin){inst.options.bordersize=0;inst.options.bordermargin=0;inst.options.bordertopmargin=0;inst.options.bordertopmarginsmall=0}if(inst.options.fullscreentextoutside){inst.options.titlestyle="outside";inst.options.titlecss=inst.options.titleoutsidecss;inst.options.descriptioncss=
inst.options.descriptionoutsidecss}else if(inst.options.fullscreentextinside){inst.options.titlestyle="inside";inst.options.titlecss=inst.options.titleinsidecss;inst.options.descriptioncss=inst.options.descriptioninsidecss}else{inst.options.titlebottomcss=inst.options.fullscreentitlebottomcss;inst.options.descriptionbottomcss=inst.options.fullscreendescriptionbottomcss}}inst.options.barheightoriginal=inst.options.barheight;if(inst.options.responsivebarheight){var winH=inst.getWinH();if(winH<=inst.options.smallscreenheight)inst.options.barheight=
inst.options.barheightonsmallheight}switch(inst.options.titlestyle){case "inside":inst.options.titlecss=inst.options.titleinsidecss;inst.options.descriptioncss=inst.options.descriptioninsidecss;break;case "outside":inst.options.titlecss=inst.options.titleoutsidecss;inst.options.descriptioncss=inst.options.descriptionoutsidecss;break;default:inst.options.titlecss=inst.options.titlebottomcss;inst.options.descriptioncss=inst.options.descriptionbottomcss}inst.options.titlecss=$.trim(inst.options.titlecss);
if(inst.options.titlecss.length>1){if(inst.options.titlecss.charAt(0)=="{")inst.options.titlecss=inst.options.titlecss.substring(1);if(inst.options.titlecss.charAt(inst.options.titlecss.length-1)=="}")inst.options.titlecss=inst.options.titlecss.substring(0,inst.options.titlecss.length-1)}inst.options.descriptioncss=$.trim(inst.options.descriptioncss);if(inst.options.descriptioncss.length>1){if(inst.options.descriptioncss.charAt(0)=="{")inst.options.descriptioncss=inst.options.descriptioncss.substring(1);
if(inst.options.descriptioncss.charAt(inst.options.descriptioncss.length-1)=="}")inst.options.descriptioncss=inst.options.descriptioncss.substring(0,inst.options.descriptioncss.length-1)}inst.options.errorcss=$.trim(inst.options.errorcss);if(inst.options.errorcss.length>1){if(inst.options.errorcss.charAt(0)=="{")inst.options.errorcss=inst.options.errorcss.substring(1);if(inst.options.errorcss.charAt(inst.options.errorcss.length-1)=="}")inst.options.errorcss=inst.options.errorcss.substring(0,inst.options.errorcss.length-
1)}var styleCss=" .bodynoscroll {height:100%;overflow:hidden;}";styleCss+=" #gridgallery-html5-lightbox .html5-text {"+inst.options.titlecss+"}";styleCss+=" #gridgallery-html5-lightbox .html5-description {"+inst.options.descriptioncss+"}";styleCss+=" #gridgallery-html5-lightbox .html5-error {"+inst.options.errorcss+"}";styleCss+=" .html5-prev-fullscreen {display:block;cursor:pointer;position:absolute;z-index:1;left:"+inst.options.bordersize+"px;right:auto;top:50%;transform:translate(0,-50%)} .html5-next-fullscreen {display:block;cursor:pointer;position:absolute;z-index:1;left:auto;right:"+
inst.options.bordersize+"px;top:50%;transform:translate(0,-50%)}";styleCss+=" .html5-prev, .html5-next {display:none;cursor:pointer;position:absolute;z-index:1;}";styleCss+=" .html5-prev-inside {left:"+inst.options.bordersize+"px;right:auto;top:50%;transform:translate(0,-50%)} .html5-next-inside {left:auto;right:"+inst.options.bordersize+"px;top:50%;transform:translate(0,-50%)}";styleCss+=" .html5-prev-outside {left:0;right:auto;top:50%;transform:translate(-100%,-50%);} .html5-next-outside {left:auto;right:0;top:50%;transform:translate(100%,-50%);}";
if(inst.options.showarrowsbottomonsmallscreen){styleCss+="@media (max-width: "+inst.options.navarrowsbottomscreenwidth+"px) {";if(inst.options.outsidearrowspos=="bottom")styleCss+=" .html5-prev-outside {display:block;top:100%;left:0;right:auto;transform:none;} .html5-next-outside {display:block;top:100%;left:auto;right:0;transform:none;}";else if(inst.options.outsidearrowspos=="bottominside")styleCss+=" .html5-prev-outside {display:block;top:100%;left:0;right:auto;transform:translate(0,-100%);} .html5-next-outside {display:block;top:100%;left:auto;right:0;transform:translate(0,-100%);}";
else styleCss+=" .html5-prev-outside {display:block;top:50%;left:0;right:auto;transform:translate(0,-50%);} .html5-next-outside {display:block;top:50%;left:auto;right:0;transform:translate(0,-50%);}";styleCss+=" .html5-prev-fullscreen {display:none;} .html5-next-fullscreen {display:none;}";styleCss+="}"}styleCss+=" .html5-prev-inside .mh-icon-left, .html5-next-inside .mh-icon-right { display:table-cell; vertical-align:middle; font-size: 20px; color: #ddd; background-color: rgba(0,0,0,0.6); line-height: 36px; width: 36px; height: 36px; text-align: center;} .html5-prev-inside .mh-icon-left:hover, .html5-next-inside .mh-icon-right:hover { color: #fff; } .html5-prev-outside .mh-icon-left, .html5-next-outside .mh-icon-right, .html5-prev-fullscreen .mh-icon-left, .html5-next-fullscreen .mh-icon-right { display:table-cell; vertical-align:middle; font-size: 24px; line-height: 36px; color: #ccc; background-color: rgba(0,0,0,0.6); } .html5-prev-outside .mh-icon-left:hover, .html5-next-outside .mh-icon-right:hover, .html5-prev-fullscreen .mh-icon-left:hover, .html5-next-fullscreen .mh-icon-right:hover { color: #fff; }";
if(inst.options.titlestyle=="right"){styleCss+="#gridgallery-html5-lightbox .html5-elem-wrap {width:"+inst.options.imagepercentage+"%;height:100%;} #gridgallery-html5-lightbox .html5-elem-data-box {min-height:100%;}";styleCss+="@media (max-width: "+inst.options.sidetobottomscreenwidth+"px) {#gridgallery-html5-lightbox .html5-elem-wrap {width:100%;height:auto;} #gridgallery-html5-lightbox .html5-elem-data-box {width:100%;height:auto;min-height:0;}}"}else if(inst.options.titlestyle=="left"){styleCss+="#gridgallery-html5-lightbox .html5-elem-wrap {height:100%;} #gridgallery-html5-lightbox .html5-elem-data-box {width:"+
String(100-inst.options.imagepercentage)+"%;min-height:100%;}";styleCss+="@media (max-width: "+inst.options.sidetobottomscreenwidth+"px) {#gridgallery-html5-lightbox .html5-elem-wrap {width:100%;height:auto;} #gridgallery-html5-lightbox .html5-elem-data-box {width:100%;height:auto;min-height:0;}}"}styleCss+=".html5-rotate { border-radius:50%; -webkit-transition:-webkit-transform .4s ease-in; transition: transform .4s ease-in; } .html5-rotate:hover { -webkit-transform: rotate(360deg); transform: rotate(360deg); }";
styleCss+="@media (max-width: "+inst.options.navarrowsbottomscreenwidth+"px) {#html5-social {"+inst.options.socialpositionsmallscreen+"}}";if(inst.options.exitanimationduration)inst.options.animationduration=inst.options.exitanimationduration;styleCss+=".html5box-animated { -webkit-animation-duration:"+inst.options.animationduration+"; animation-duration:"+inst.options.animationduration+"; -webkit-animation-fill-mode: both; animation-fill-mode: both; }";styleCss+="@-webkit-keyframes html5box-fadeOut { from { opacity: 1; } to { opacity: 0; } } @keyframes html5box-fadeOut { from { opacity: 1; } to { opacity: 0; } } .html5box-fadeOut { -webkit-animation-name: html5box-fadeOut; animation-name: html5box-fadeOut; }";
styleCss+="@-webkit-keyframes html5box-fadeOutDown { from { opacity: 1; } to { opacity: 0; -webkit-transform: translate3d(0, 100%, 0); transform: translate3d(0, 100%, 0); } } @keyframes html5box-fadeOutDown { from { opacity: 1; } to { opacity: 0; -webkit-transform: translate3d(0, 100%, 0); transform: translate3d(0, 100%, 0); } } .html5box-fadeOutDown { -webkit-animation-name: html5box-fadeOutDown; animation-name: html5box-fadeOutDown; }";styleCss+=".html5box-enter-animated { -webkit-animation-duration:"+
inst.options.enteranimationduration+"; animation-duration:"+inst.options.enteranimationduration+"; -webkit-animation-fill-mode: both; animation-fill-mode: both; }";styleCss+=" @keyframes html5box-none { } .html5box-none { animation-name: html5box-none; }";styleCss+=" @keyframes html5box-fadeIn { from { opacity: 0; } to { opacity: 1; } } .html5box-fadeIn { animation-name: html5box-fadeIn; }";styleCss+=" @keyframes html5box-fadeInDown { from { opacity: 0; transform: translate3d(0, -100%, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } } .html5box-fadeInDown { animation-name: html5box-fadeInDown; }";
styleCss+=" @keyframes html5box-zoomIn { from { opacity: 0; transform: scale3d(0.3, 0.3, 0.3); } 50% { opacity: 1; } } .html5box-zoomIn { animation-name: html5box-zoomIn; }";styleCss+=" @keyframes html5box-bounceIn { from, 20%, 40%, 60%, 80%, to { animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); } 0% { opacity: 0; transform: scale3d(0.3, 0.3, 0.3); } 20% { transform: scale3d(1.1, 1.1, 1.1); } 40% { transform: scale3d(0.9, 0.9, 0.9); } 60% { opacity: 1; transform: scale3d(1.03, 1.03, 1.03); } 80% { transform: scale3d(0.97, 0.97, 0.97); } to { opacity: 1; transform: scale3d(1, 1, 1); } } .html5box-bounceIn { animation-name: html5box-bounceIn; }";
styleCss+=" #html5-close .mh-icon-cancel-circle{width:30px;height:30px;line-height:30px;border-radius:50%;font-size:26px;margin:0;padding:0;color:#333;background-color:#fff;} #html5-close .mh-icon-cancel-circle:before{margin:0;padding:0;position: absolute;top:50%;left:50%;transform:translate(-50%, -50%);}";styleCss+=" #html5-close .mh-icon-close { font-size: 14px; padding: 4px; color: #333; background-color: #fff; } #html5-close .mh-icon-close:hover { color: #000; }";styleCss+=" #html5-close-fullscreen .mh-icon-close { font-size: 24px; padding: 4px; color: #eee; background-color: rgba(0,0,0,0.7); } #html5-close-fullscreen .mh-icon-close:hover { color: #fff; }";
styleCss+=" .html5boxVideoPlay.mh-icon-play::before{margin-left:0.28em;margin-right:0.12em;}";styleCss+=" .html5boxVideoPlay.mh-icon-customplay::before{margin-left:0;margin-right:0;} .html5boxVideoPause.mh-icon-custompause::before{margin-left:0;margin-right:0;}";styleCss+=" .html5-play.mh-icon-customplay,.html5-pause.mh-icon-custompause{width:32px;height:32px;line-height:32px;font-size:24px;color:#333;}";styleCss+=" .html5-nav-showcontrol .mh-icon-th-thumb { color: #ddd; font-size: 16px; } .html5-nav-showcontrol .mh-icon-th-thumb:hover { color: #fff; }";
$("head").append("<style type='text/css' data-creator='gridgallery-html5-lightbox'>"+styleCss+"</style>");var elemheight=inst.options.elemautoheight?"auto":"100%";var deviceType=inst.options.isIPhone||inst.options.isIPad?"iphone":inst.options.isAndroid?"android":"desktop";inst.$lightbox=$("<div id='gridgallery-html5-lightbox' class='html5box-"+deviceType+"' style='display:none;top:0px;left:0px;width:100%;height:100%;z-index:9999998;text-align:center;'>"+"<div id='html5-lightbox-overlay' style='display:block;position:absolute;top:0px;left:0px;width:100%;min-height:100%;background-color:"+
inst.options.overlaybgcolor+";opacity:"+inst.options.overlayopacity+";filter:alpha(opacity="+Math.round(inst.options.overlayopacity*100)+");'></div>"+"<div id='html5-lightbox-box' style='display:block;position:relative;margin:0px auto;'>"+"<div class='html5-elem-box' style='display:block;outline:none;position:relative;width:100%;overflow-x:hidden;overflow-y:auto;height:"+elemheight+";margin:0px auto;text-align:center;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;'>"+
"<div class='html5-elem-wrap' style='display:block;position:relative;overflow:hidden;margin:0px auto;text-align:center;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;background-color:"+inst.options.bgcolor+";'>"+"<div class='html5-loading' style='display:none;position:absolute;text-align:center;'></div>"+"<div class='html5-error-box html5-error' style='display:none;position:absolute;padding:"+inst.options.bordersize+"px;text-align:center;width:"+inst.options.errorwidth+
"px;height:"+inst.options.errorheight+"px;line-height:"+inst.options.errorheight+"px;'>"+"The requested content cannot be loaded."+"</div>"+"<div class='html5-image' style='display:none;position:relative;top:0px;left:0px;width:100%;height:100%;overflow:auto;"+(inst.options.iequirksmode?"margin":"padding")+":"+inst.options.bordersize+"px;text-align:center;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;'></div>"+"</div>"+"</div>"+"<div id='html5-watermark' style='display:none;position:absolute;left:"+
String(inst.options.bordersize+2)+"px;top:"+String(inst.options.bordersize+2)+"px;'></div>"+"</div>"+"</div>");inst.options.positionFixed=inst.options.supportCSSPositionFixed&&inst.options.responsive&&!inst.options.iequirksmode;if(inst.options.useabsolutepos||inst.options.useabsoluteposonmobile&&inst.options.isMobile)inst.options.positionFixed=false;inst.$lightbox.css({position:inst.options.positionFixed?"fixed":"absolute"});inst.$lightbox.appendTo("body");inst.$lightboxBox=$("#html5-lightbox-box",
inst.$lightbox);inst.$elem=$(".html5-elem-box",inst.$lightbox);inst.$elemWrap=$(".html5-elem-wrap",inst.$lightbox);inst.$loading=$(".html5-loading",inst.$lightbox);inst.$error=$(".html5-error-box",inst.$lightbox);inst.$image=$(".html5-image",inst.$lightbox);if(inst.options.loadingusefont){inst.$loading.css({"top":"50%","left":"50%",transform:"translate(-50%, -50%)","font-size":"24px","line-height":"44px",padding:"10px",color:inst.options.loadingfontcolor,"background-color":inst.options.loadingfontbg});
inst.$loading.append('<div class="mh-spinicon animate-spin '+inst.options.loadingfontname+'"></div>')}else inst.$loading.css({top:"0",left:"0",width:"100%",height:"100%",background:'url("'+inst.options.loadingimage+'") no-repeat center center'});if(inst.options.fullscreenmode&&inst.options.fullscreennomargin)inst.$elem.css({overflow:"hidden"});var elemText="<div class='html5-elem-data-box' style='display:none;box-sizing:border-box;'><div class='html5-text' style='display:block;overflow:hidden;'></div></div>";
if(inst.options.titlestyle=="left")inst.$elem.prepend(elemText);else if(inst.options.titlestyle=="outside")inst.$lightbox.append(elemText);else inst.$elem.append(elemText);inst.$elemData=$(".html5-elem-data-box",inst.$lightbox);inst.$text=$(".html5-text",inst.$lightbox);if(inst.options.borderradius>0){inst.$elem.css({"border-radius":inst.options.borderradius+"px","-moz-border-radius":inst.options.borderradius+"px","-webkit-border-radius":inst.options.borderradius+"px"});if(inst.options.titlestyle==
"inside")inst.$elemWrap.css({"border-radius":inst.options.borderradius+"px","-moz-border-radius":inst.options.borderradius+"px","-webkit-border-radius":inst.options.borderradius+"px"});else if(inst.options.titlestyle=="bottom"){inst.$elemWrap.css({"border-top-left-radius":inst.options.borderradius+"px","-moz-top-left-border-radius":inst.options.borderradius+"px","-webkit-top-left-border-radius":inst.options.borderradius+"px","border-top-right-radius":inst.options.borderradius+"px","-moz-top-right-border-radius":inst.options.borderradius+
"px","-webkit-top-right-border-radius":inst.options.borderradius+"px"});inst.$elemData.css({"border-bottom-left-radius":inst.options.borderradius+"px","-moz-top-bottom-border-radius":inst.options.borderradius+"px","-webkit-bottom-left-border-radius":inst.options.borderradius+"px","border-bottom-right-radius":inst.options.borderradius+"px","-moz-bottom-right-border-radius":inst.options.borderradius+"px","-webkit-bottom-right-border-radius":inst.options.borderradius+"px"})}}if(inst.options.titlestyle==
"right"||inst.options.titlestyle=="left"){inst.$lightboxBox.css({"background-color":inst.options.bgcolor});if(inst.options.titlestyle=="right"){inst.$elemWrap.css({position:"relative","float":"left"});inst.$elemData.css({position:"relative",overflow:"hidden",padding:inst.options.bordersize+"px"})}else{inst.$elemWrap.css({position:"relative",overflow:"hidden"});inst.$elemData.css({position:"relative","float":"left",padding:inst.options.bordersize+"px"})}}else if(inst.options.titlestyle=="inside"){inst.$elemData.css({position:"absolute",
margin:0,padding:0,bottom:inst.options.bordersize+"px",left:inst.options.bordersize+"px",right:inst.options.bordersize+"px","background-color":"#333","background-color":"rgba(51, 51, 51, 0.6)"});if(inst.options.showonmouseoverinside)inst.$elemData.css({opacity:0});inst.$text.css({padding:inst.options.bordersize+"px "+2*inst.options.bordersize+"px"})}else if(inst.options.titlestyle=="outside")inst.$elemData.css({position:"relative",width:"100%",height:"auto"});else{inst.$elemData.css({position:"relative",
width:"100%",height:inst.options.barautoheight?"auto":inst.options.barheight+"px","padding":"0 0 "+inst.options.bordersize+"px"+" 0","background-color":inst.options.bgcolor,"text-align":"left"});if(!inst.options.fullscreenmode||!inst.options.fullscreennomargin)inst.$text.css({"margin":"0 "+inst.options.bordersize+"px"})}if(inst.options.isTouch&&inst.options.navarrowsalwaysshowontouch&&inst.options.navarrowspos=="inside")inst.options.navarrowspos="side";inst.$lightboxBox.append("<div class='html5-next'></div><div class='html5-prev'></div>");
inst.$next=$(".html5-next",inst.$lightbox);inst.$prev=$(".html5-prev",inst.$lightbox);if(inst.options.fullscreenmode||inst.options.navarrowspos=="browserside"){inst.$lightbox.append("<div class='html5-next-fullscreen'></div><div class='html5-prev-fullscreen'></div>");inst.$nextfullscreen=$(".html5-next-fullscreen",inst.$lightbox);inst.$prevfullscreen=$(".html5-prev-fullscreen",inst.$lightbox);inst.$next.addClass("html5-next-outside");inst.$prev.addClass("html5-prev-outside")}else{inst.$next.addClass(inst.options.navarrowspos==
"side"?"html5-next-outside":"html5-next-inside");inst.$prev.addClass(inst.options.navarrowspos=="side"?"html5-prev-outside":"html5-prev-inside");if(inst.options.navarrowspos=="side"||inst.options.alwaysshownavarrows){inst.$next.css({display:"block"});inst.$prev.css({display:"block"})}}if(inst.options.arrowsusefont){inst.$next.append('<div class="mh-icon-right"></div>');inst.$prev.append('<div class="mh-icon-left"></div>');if(inst.$nextfullscreen){inst.$nextfullscreen.append('<div class="mh-icon-right"></div>');
inst.$prevfullscreen.append('<div class="mh-icon-left"></div>')}}else{inst.$next.append("<img alt='' src='"+inst.options.nextimage+"'>");inst.$prev.append("<img alt='' src='"+inst.options.previmage+"'>");if(inst.$nextfullscreen){inst.$nextfullscreen.append("<img alt='' src='"+inst.options.fullscreennextimage+"'>");inst.$prevfullscreen.append("<img alt='' src='"+inst.options.fullscreenprevimage+"'>")}}if(inst.options.fullscreenmode||inst.options.closepos=="topright"){inst.$lightbox.append("<button id='html5-close-fullscreen' style='display:block;cursor:pointer;position:absolute;top:0;right:0;margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding:0;background:transparent;border:none;'></button>");
inst.$close=$("#html5-close-fullscreen",inst.$lightbox)}else{inst.$lightboxBox.append("<button id='html5-close' style='display:none;cursor:pointer;position:absolute;top:0;right:0;background:transparent;border:none;"+(inst.options.closepos=="outside"?"margin-top:-16px;margin-right:-16px;margin-bottom:0;margin-left:0;padding:0;":"margin:0;padding:"+inst.options.bordersize+"px;")+"'></button>");inst.$close=$("#html5-close",inst.$lightbox)}if(inst.options.closeusefont)if(inst.options.fullscreenmode||
inst.options.closepos=="topright"||inst.options.closepos=="inside")inst.$close.append('<div class="mh-icon-close"></div>');else inst.$close.append('<div class="mh-icon-cancel-circle"></div>');else inst.$close.append("<img alt='' src='"+(inst.options.fullscreenmode||inst.options.closepos=="topright"?inst.options.fullscreencloseimage:inst.options.closeimage)+"'>");if(inst.options.titlestyle=="inside"&&inst.options.showonmouseoverinside)inst.$lightboxBox.hover(function(){if(inst.currentElem[ELEM_TYPE]==
0||!inst.options.showinsidetitleforimageonly)inst.$elemData.animate({opacity:1},400)},function(){inst.$elemData.animate({opacity:0},400)});inst.$watermark=$("#html5-watermark",inst.$lightbox);if(inst.options.stamp)inst.$watermark.html("<a href='"+inst.options.freelink+"' style='text-decoration:none;' title='WordPress Gallery'><div style='display:block!important;width:180px;height:20px;text-align:center;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;background-color:#fff;color:#333;font:12px Arial,sans-serif;'><div style='line-height:20px;'>"+
inst.options.freemark+"</div></div></a>");else if(inst.options.watermark){var html="<img alt='' src='"+inst.options.watermark+"' style='border:none;' />";if(inst.options.watermarklink)html="<a href='"+inst.options.watermarklink+"' target='_blank'>"+html+"</a>";inst.$watermark.html(html)}if(inst.options.closeonoverlay)$("#html5-lightbox-overlay",inst.$lightbox).click(inst.finish);inst.$close.click(inst.finish);inst.$next.click(function(){inst.nextArrowClicked()});inst.$prev.click(function(){inst.prevArrowClicked()});
if(inst.$nextfullscreen){inst.$nextfullscreen.click(function(){inst.nextArrowClicked()});inst.$prevfullscreen.click(function(){inst.prevArrowClicked()})}$(window).resize(function(){if(inst.options.isIOS&&!inst.options.mobileresizeevent)return;clearTimeout(inst.options.resizeTimeout);inst.options.resizeTimeout=setTimeout(function(){inst.resizeWindow()},inst.options.resizedelay)});$(window).scroll(function(){if(inst.options.isIOS&&!inst.options.mobileresizeevent)return;inst.scrollBox()});$(window).on("orientationchange",
function(e){if(inst.options.isMobile){clearTimeout(inst.options.resizeTimeout);inst.options.resizeTimeout=setTimeout(function(){inst.resizeWindow()},inst.options.resizedelay)}});if(inst.options.enabletouchswipe)inst.enableSwipe()};inst.showSocialButtons=function(){if(inst.options.showsocial){if($("#html5-social").length>0)$("#html5-social").remove();var socialCode='<div id="html5-social" style="display:none;'+inst.options.socialposition+'">';var socialBtnCSS=(inst.options.socialdirection=="horizontal"?
"display:inline-block;vertical-align:top;":"display:block;")+"margin:4px;";var socialCSS="display:table-cell;width:"+inst.options.socialbuttonsize+"px;height:"+inst.options.socialbuttonsize+"px;font-size:"+inst.options.socialbuttonfontsize+"px;border-radius:50%;color:#fff;vertical-align:middle;text-align:center;cursor:pointer;padding:0;";socialCode+=inst.options.extrasocialcodebefore;if(inst.options.showemail)socialCode+='<div class="html5-social-btn html5-social-btn-action html5-social-email" style="'+
socialBtnCSS+'"><div class="mh-icon-mail'+(inst.options.socialrotateeffect?" html5-rotate":"")+'" style="'+socialCSS+'background-color:#4d83ff;"></div></div>';if(inst.options.showfacebook)socialCode+='<div class="html5-social-btn html5-social-btn-action html5-social-facebook" style="'+socialBtnCSS+'"><div class="mh-icon-facebook'+(inst.options.socialrotateeffect?" html5-rotate":"")+'" style="'+socialCSS+'background-color:#3b5998;"></div></div>';if(inst.options.showlinkedin)socialCode+='<div class="html5-social-btn html5-social-btn-action html5-social-linkedin" style="'+
socialBtnCSS+'"><div class="mh-icon-linkedin'+(inst.options.socialrotateeffect?" html5-rotate":"")+'" style="'+socialCSS+'background-color:#458bb7;"></div></div>';if(inst.options.showtwitter)socialCode+='<div class="html5-social-btn html5-social-btn-action html5-social-twitter" style="'+socialBtnCSS+'"><div class="mh-icon-twitter'+(inst.options.socialrotateeffect?" html5-rotate":"")+'" style="'+socialCSS+'background-color:#03b3ee;"></div></div>';if(inst.options.showpinterest)socialCode+='<div class="html5-social-btn html5-social-btn-action html5-social-pinterest" style="'+
socialBtnCSS+'"><div class="mh-icon-pinterest'+(inst.options.socialrotateeffect?" html5-rotate":"")+'" style="'+socialCSS+'background-color:#c92228;"></div></div>';if(inst.options.showwhatsapp)socialCode+='<div class="html5-social-btn html5-social-btn-action html5-social-whatsapp" style="'+socialBtnCSS+'"><div class="mh-icon-whatsapp'+(inst.options.socialrotateeffect?" html5-rotate":"")+'" style="'+socialCSS+'background-color:#32cc65;"></div></div>';if(inst.options.showtelegram)socialCode+='<div class="html5-social-btn html5-social-btn-action html5-social-telegram" style="'+
socialBtnCSS+'"><div class="mh-icon-telegram'+(inst.options.socialrotateeffect?" html5-rotate":"")+'" style="'+socialCSS+'background-color:#2d9ee2;"></div></div>';if(inst.options.showdownload&&(inst.currentElem[ELEM_TYPE]==0||inst.currentElem[ELEM_TYPE]==2||inst.currentElem[ELEM_TYPE]==5||inst.currentElem[ELEM_TYPE]==6)){var elemUrl=inst.currentElem[ELEM_HREF];var elemFile=elemUrl.substring(elemUrl.lastIndexOf("/")+1);elemFile=elemFile.substring(0,elemUrl.indexOf("?"));elemFile=elemFile.substring(0,
elemUrl.indexOf("#"));socialCode+='<div class="html5-social-btn html5-social-download" style="'+socialBtnCSS+'"><a href="'+elemUrl+'" download="'+elemFile+'"><div class="mh-icon-download'+(inst.options.socialrotateeffect?" html5-rotate":"")+'" style="'+socialCSS+'background-color:#37a569;"></div></a></div>'}if(inst.options.showcopylink)socialCode+='<div class="html5-social-btn html5-social-btn-action html5-social-copylink" style="'+socialBtnCSS+'"><div class="mh-icon-link'+(inst.options.socialrotateeffect?
" html5-rotate":"")+'" style="'+socialCSS+'background-color:#2271b1;"></div></div>';if(inst.options.showcopymedialink)socialCode+='<div class="html5-social-btn html5-social-btn-action html5-social-copymedialink" style="'+socialBtnCSS+'"><div class="mh-icon-link'+(inst.options.socialrotateeffect?" html5-rotate":"")+'" style="'+socialCSS+'background-color:#04aa6d;"></div></div>';socialCode+=inst.options.extrasocialcodeafter;socialCode+='<div style="clear:both;"></div></div>';inst.$lightboxBox.append(socialCode);
$(".html5-social-btn-action",inst.$lightbox).click(function(){var mdeiaUrl=inst.currentElem[ELEM_HREF];var shareUrl=inst.options.sharemediaurl?inst.currentElem[ELEM_HREF]:window.location.href+(window.location.href.indexOf("?")<0?"?":"&")+"wpgridlightboxshare="+encodeURIComponent(inst.currentElem[ELEM_HREF]);var shareTitle=inst.currentElem[ELEM_TITLE];var shareMedia=inst.currentElem[ELEM_HREF];if(inst.currentElem[ELEM_TYPE]==0)shareMedia=inst.absoluteUrl(inst.currentElem[ELEM_HREF]);else if(inst.currentElem[ELEM_TYPE]==
3)shareMedia="https://img.youtube.com/vi/"+inst.getYoutubeId(inst.currentElem[ELEM_HREF])+"/0.jpg";else{var lightboxLink=$('.wpgridlightbox[href="'+inst.currentElem[ELEM_HREF]+'"]');if(lightboxLink.length>0)if(lightboxLink.data("shareimage")&&lightboxLink.data("shareimage").length>0)shareMedia=inst.absoluteUrl(lightboxLink.data("shareimage"));else if(lightboxLink.data("thumbnail")&&lightboxLink.data("thumbnail").length>0)shareMedia=inst.absoluteUrl(lightboxLink.data("thumbnail"));else{var lightboxImg=
$("img",lightboxLink);if(lightboxImg.length>0)shareMedia=inst.absoluteUrl(lightboxImg.attr("src"))}}var isVideo=inst.currentElem[ELEM_TYPE]==2||inst.currentElem[ELEM_TYPE]==3||inst.currentElem[ELEM_TYPE]==4||inst.currentElem[ELEM_TYPE]==8||inst.currentElem[ELEM_TYPE]==9||inst.currentElem[ELEM_TYPE]==11||inst.currentElem[ELEM_TYPE]==12;if(!shareTitle)shareTitle=inst.options.sharetextprefix;else shareTitle=inst.html2Text(shareTitle);if($(this).hasClass("html5-social-facebook"))window.open("https://www.facebook.com/sharer/sharer.php?u="+
encodeURIComponent(shareUrl)+"&t="+encodeURIComponent(shareTitle),"_blank");else if($(this).hasClass("html5-social-linkedin"))window.open("https://www.linkedin.com/shareArticle?mini=true&url="+encodeURIComponent(shareUrl)+"&title="+encodeURIComponent(shareTitle),"_blank");else if($(this).hasClass("html5-social-twitter"))window.open("https://twitter.com/share?url="+encodeURIComponent(shareUrl)+"&text="+encodeURIComponent(shareTitle),"_blank");else if($(this).hasClass("html5-social-pinterest"))window.open("https://pinterest.com/pin/create/bookmarklet/?media="+
encodeURIComponent(shareMedia)+"&url="+encodeURIComponent(shareUrl)+"&description="+encodeURIComponent(shareTitle)+"&is_video="+(isVideo?"true":"false"),"_blank");else if($(this).hasClass("html5-social-email"))window.open("mailto:?subject="+encodeURIComponent(shareTitle)+"&body="+encodeURIComponent(inst.options.sharetextprefix+" "+shareUrl));else if($(this).hasClass("html5-social-whatsapp"))window.open("https://api.whatsapp.com/send?text="+encodeURIComponent(shareTitle+": "+shareUrl),"_blank");else if($(this).hasClass("html5-social-telegram"))window.open("https://t.me/share/url?url="+
encodeURIComponent(shareUrl)+"&text="+encodeURIComponent(shareTitle),"_blank");else if($(this).hasClass("html5-social-copylink")&&window.navigator&&window.navigator.clipboard){$(this).addClass("html5-social-copylink-clicked");$(".mh-icon-link",this).css("background-color","#681da8");window.navigator.clipboard.writeText(shareUrl)}else if($(this).hasClass("html5-social-copymedialink")&&window.navigator&&window.navigator.clipboard){$(this).addClass("html5-social-copymedialink-clicked");$(".mh-icon-link",
this).css("background-color","#681da8");window.navigator.clipboard.writeText(mdeiaUrl)}return false})}};inst.html2Text=function(html){var tag=document.createElement("div");tag.innerHTML=html;return tag.innerText};inst.slideTimer=function(interval,callback,updatecallback){var timerInstance=this;timerInstance.timeout=interval;var updateinterval=50;var updateTimerId=null;var runningTime=0;var paused=false;var started=false;var startedandpaused=false;this.pause=function(){if(started){paused=true;clearInterval(updateTimerId)}};
this.resume=function(forceresume){if(startedandpaused&&!forceresume)return;startedandpaused=false;if(started&&paused){paused=false;updateTimerId=setInterval(function(){runningTime+=updateinterval;if(runningTime>timerInstance.timeout){clearInterval(updateTimerId);if(callback)callback()}if(updatecallback)updatecallback(runningTime/timerInstance.timeout)},updateinterval)}};this.stop=function(){clearInterval(updateTimerId);if(updatecallback)updatecallback(-1);runningTime=0;paused=false;started=false};
this.start=function(){runningTime=0;paused=false;started=true;updateTimerId=setInterval(function(){runningTime+=updateinterval;if(runningTime>timerInstance.timeout){clearInterval(updateTimerId);if(callback)callback()}if(updatecallback)updatecallback(runningTime/timerInstance.timeout)},updateinterval)};this.startandpause=function(){runningTime=0;paused=true;started=true;startedandpaused=true};return this};inst.updateTimer=function(percent){var w=Math.round(percent*100);if(w>100)w=100;if(w<0)w=0;$(".html5-timer",
inst.$lightbox).css({display:"block",width:w+"%"})};inst.initSlide=function(){inst.autosliding=false;inst.slideTimeout=inst.slideTimer(inst.options.slideinterval,function(){inst.gotoSlide(-1)},inst.options.showtimer?function(percent){inst.updateTimer(percent)}:null);if(inst.options.autoslide){inst.slideTimeout.stop();inst.autosliding=true}};inst.nextArrowClicked=function(){if(inst.options.nextElem<=inst.options.curElem)if(inst.options.onlastarrowclicked&&window[inst.options.onlastarrowclicked]&&typeof window[inst.options.onlastarrowclicked]==
"function")window[inst.options.onlastarrowclicked]();inst.gotoSlide(-1)};inst.prevArrowClicked=function(){if(inst.options.prevElem>=inst.options.curElem)if(inst.options.onfirstarrowclicked&&window[inst.options.onfirstarrowclicked]&&typeof window[inst.options.onfirstarrowclicked]=="function")window[inst.options.onfirstarrowclicked]();inst.gotoSlide(-2)};inst.calcNextPrevElem=function(){inst.options.nextElem=-1;inst.options.prevElem=-1;inst.options.inGroup=false;inst.options.groupIndex=0;inst.options.groupCount=
0;if(inst.elemArray.length<=1)return;var group=inst.elemArray[inst.options.curElem][ELEM_GROUP];for(var i=0;i<inst.elemArray.length;i++)if(inst.matchGroup(group,inst.elemArray[i][ELEM_GROUP])){if(i==inst.options.curElem)inst.options.groupIndex=inst.options.groupCount;inst.options.groupCount++}if(inst.options.showall){inst.options.nextElem=inst.options.curElem+1;if(inst.options.nextElem>inst.elemArray.length-1)inst.options.nextElem=0;inst.options.prevElem=inst.options.curElem-1;if(inst.options.prevElem<
0)inst.options.prevElem=inst.elemArray.length-1}else{var j,curGroup=inst.elemArray[inst.options.curElem][ELEM_GROUP];if(curGroup!=undefined&&curGroup!=null){for(j=inst.options.curElem+1;j<inst.elemArray.length;j++)if(inst.matchGroup(curGroup,inst.elemArray[j][ELEM_GROUP])){inst.options.nextElem=j;break}if(inst.options.nextElem<0)for(j=0;j<inst.options.curElem;j++)if(inst.matchGroup(curGroup,inst.elemArray[j][ELEM_GROUP])){inst.options.nextElem=j;break}if(inst.options.nextElem>=0){for(j=inst.options.curElem-
1;j>=0;j--)if(inst.matchGroup(curGroup,inst.elemArray[j][ELEM_GROUP])){inst.options.prevElem=j;break}if(inst.options.prevElem<0)for(j=inst.elemArray.length-1;j>inst.options.curElem;j--)if(inst.matchGroup(curGroup,inst.elemArray[j][ELEM_GROUP])){inst.options.prevElem=j;break}}}}if(inst.options.nextElem>=0||inst.options.prevElem>=0)inst.options.inGroup=true};inst.calcBoxPosition=function(initW,initH){var boxW=initW+2*inst.options.bordersize;var boxH=initH+2*inst.options.bordersize;var navH=inst.options.shownavigation&&
inst.navvisible?inst.options.navheight:0;var winH=inst.getWinH();var boxT=Math.round((winH-navH)/2-boxH/2);if(inst.options.titlestyle=="bottom")boxT-=Math.round(inst.options.barheight/2);var topmargin=$(window).height()<inst.options.smallscreenheight?inst.options.bordertopmarginsmall:inst.options.bordertopmargin;if(boxT<topmargin)boxT=topmargin;if(inst.options.insideiframe&&window.self!=window.top){boxT=inst.options.iframetopmargin>0?inst.options.iframetopmargin:topmargin;if(inst.options.iframesamedomain&&
parent.window.jQuery&&parent.window.jQuery("#"+inst.options.iframeid).length){var iframetop=parent.window.jQuery("#"+inst.options.iframeid).offset().top;var parentscroll=parent.window.document.body.scrollTop;boxT+=parentscroll>iframetop?parentscroll-iframetop:0}}return[boxW,boxH,boxT]};inst.hideNavArrows=function(){var showPrev=false;var showNext=false;if(inst.options.inGroup){if(inst.options.arrowloop||!inst.options.arrowloop&&inst.options.prevElem<inst.options.curElem)showPrev=true;if(inst.options.arrowloop||
!inst.options.arrowloop&&inst.options.nextElem>inst.options.curElem)showNext=true}if(!showPrev){inst.$prev.css({display:"none"});if(inst.$prevfullscreen)inst.$prevfullscreen.css({display:"none"})}if(!showNext){inst.$next.css({display:"none"});if(inst.$nextfullscreen)inst.$nextfullscreen.css({display:"none"})}};inst.resizePositionFixed=function(){if(!inst.options.positionFixed)inst.$lightbox.css({"padding-top":$(window).scrollTop()+"px","height":Math.max($(document).height(),$(window).height())+"px"})};
inst.adjustLightboxPos=function(w,h){var winWidth=$(window).width();var boxPos=inst.calcBoxPosition(w,h);var boxW=boxPos[0];var boxH=boxPos[1];var boxT=boxPos[2];if(inst.options.iequirksmode)inst.$lightboxBox.css({"top":boxT});else inst.$lightboxBox.css({"margin-top":boxT});inst.resizePositionFixed();if((inst.options.titlestyle=="left"||inst.options.titlestyle=="right")&&winWidth>inst.options.sidetobottomscreenwidth){inst.$lightboxBox.css({"width":boxW,"height":boxH});inst.$elemWrap.css({"width":inst.options.imagepercentage+
"%","height":"100%"})}else{inst.$lightboxBox.css({"width":boxW,"height":"auto"});inst.$elemWrap.css({"width":boxW,"height":boxH})}};inst.readClassOptions=function(element){var classoptions={};var classList=$(element).attr("class");if(classList){classList=classList.split(/\s+/);$.each(classList,function(index,className){if(className&&className.toLowerCase().indexOf("html5lightbox-")==0){var names=className.split("-");if(names.length==3&&names[2]){var val=names[2];if(val.toLowerCase()=="true")val=true;
else if(val.toLowerCase()=="false")val=false;else if(/^\d+$/.test(val))val=parseInt(val);else if(!isNaN(val))val=parseFloat(val);classoptions[names[1]]=val}}})}return classoptions};inst.processLightbox=function(obj){if(obj.nodeName.toLowerCase()=="a"||obj.nodeName.toLowerCase()=="area"){var href=$(obj).attr("href");if(href){if($(obj).hasClass("wplightbox"))inst.readNodeData($(obj));else{var parent=$(obj).closest(".wplightbox");if(parent.length>0)inst.readNodeData($(obj),parent);else inst.readNodeData($(obj))}inst.showItem(href)}}};
inst.clickHandler=function(){var $this=$(this);var dataoptions={};$.each($this.data(),function(key,value){dataoptions[key.toLowerCase()]=value});inst.options=$.extend(inst.options,inst.defaultoptions,dataoptions);var classoptions=inst.readClassOptions(this);inst.options=$.extend(inst.options,classoptions);$(window).trigger("html5lightbox.lightboxshow");inst.init();if(inst.elemArray.length<=0)return true;inst.hideObjects();for(var i=0;i<inst.elemArray.length;i++)if(inst.elemArray[i][ELEM_HREF]==$this.attr("href"))break;
if(i==inst.elemArray.length)return true;inst.options.curElem=i;inst.calcNextPrevElem();inst.reset();inst.$lightbox.show();inst.adjustLightboxPos(inst.options.loadingwidth,inst.options.loadingheight);inst.loadCurElem();inst.initAudio();return false};inst.initAudio=function(){if(!inst.options.enableaudio||!inst.options.audiofile)return;var audioCode='<div class="html5-audio"><audio'+(inst.options.audioautoplay?" autoplay":"")+(inst.options.audioloop?" loop":"")+'><source src="'+inst.options.audiofile+
'" type="audio/mpeg"></audio></div>';inst.$lightboxBox.append(audioCode);if(inst.options.fullscreenmode||inst.options.closepos=="topright")inst.$lightbox.append('<div class="html5-audio-button" style="'+inst.options.audiobtnfullscreencss+'"><div class="html5-audio-volume'+(inst.options.audioautoplay?" mh-icon-volume-up":" mh-icon-volume-off")+'" style="display:table-cell;width:32px;height:32px;font-size:28px;border-radius:50%;color:'+inst.options.audiobtnfullscreencolor+";vertical-align:middle;text-align:center;cursor:pointer;padding:0;background-color:"+
inst.options.audiobtnfullscreenbg+';"></div></div>');else{inst.$lightboxBox.append('<div class="html5-audio-button" style="display:'+(inst.options.audioshowonhover?"none":"block")+";"+inst.options.audiobtncss+'"><div class="html5-audio-volume'+(inst.options.audioautoplay?" mh-icon-volume-up":" mh-icon-volume-off")+'" style="display:table-cell;width:32px;height:32px;font-size:18px;border-radius:50%;color:'+inst.options.audiobtncolor+";vertical-align:middle;text-align:center;cursor:pointer;padding:0;background-color:"+
inst.options.audiobtnbg+';"></div></div>');if(inst.options.audioshowonhover){inst.$lightboxBox.on("mouseenter mousemove",function(){$(".html5-audio-button",inst.$lightbox).fadeIn()});inst.$lightboxBox.on("mouseleave",function(){$(".html5-audio-button",inst.$lightbox).fadeOut()})}}$(".html5-audio-volume",inst.$lightbox).click(function(){var audio=$("audio",inst.$lightbox);if(audio.get(0).paused){audio.get(0).play();$(this).removeClass("mh-icon-volume-off").addClass("mh-icon-volume-up")}else{audio.get(0).pause();
$(this).removeClass("mh-icon-volume-up").addClass("mh-icon-volume-off")}})};inst.loadThumbnail=function(src,index,title){var imgLoader=new Image;$(imgLoader).on("load",function(){var style;if(this.width/this.height<=inst.options.thumbwidth/inst.options.thumbheight)style="width:100%;";else style="height:100%;";$(".html5-nav-thumb").eq(index).html("<img alt='"+inst.html2Text(title)+"' style='"+style+"' src='"+src+"' />")});imgLoader.src=src};inst.matchGroup=function(curGroup,elemGroup){if(inst.options.showall)return true;
if(!curGroup||!elemGroup)return false;var curs=curGroup.split(":");var elems=elemGroup.split(":");var result=false;for(var i in curs)if($.inArray(curs[i],elems)>-1){result=true;break}return result};inst.getWinH=function(){return inst.options.insideiframe&&window.self!=window.top&&inst.options.iframesamedomain?$(parent.window).height():$(window).height()};inst.showNavigation=function(){if(!inst.options.shownavigation)return;if((inst.options.isIPhone||inst.options.isAndroid)&&inst.options.hidenavigationonmobile||
inst.options.isIPad&&inst.options.hidenavigationonipad)return;if(!inst.currentElem||!inst.currentElem[ELEM_GROUP]&&!inst.options.showall)return;var i;var showNav=false;var group=inst.currentElem[ELEM_GROUP];for(i=0;i<inst.elemArray.length;i++)if(inst.matchGroup(group,inst.elemArray[i][ELEM_GROUP]))if(inst.elemArray[i][ELEM_THUMBNAIL]&&inst.elemArray[i][ELEM_THUMBNAIL].length>0){showNav=true;break}if(!showNav)return;inst.options.navheight=inst.options.thumbheight+inst.options.thumbtopmargin+inst.options.thumbbottommargin;
if($(".html5-nav").length>0)return;var posCss=inst.options.hidenavdefault?"top:100%;bottom:auto;left:0;right:0;":"top:auto;bottom:0;left:0;right:0;";var posType=inst.options.positionFixed?"fixed":"absolute";$("body").append("<div id='gridgallery-html5-lightbox-nav' class='html5-nav' style='display:block;position:"+posType+";"+posCss+"width:100%;height:"+inst.options.navheight+"px;z-index:9999999;"+(inst.options.navbgcolor?"background-color:"+inst.options.navbgcolor+";":"")+"'>"+"<div class='html5-nav-container' style='position:relative;margin:"+
inst.options.thumbtopmargin+"px auto "+inst.options.thumbbottommargin+"px;'>"+"<div class='html5-nav-prev' style='display:block;position:absolute;cursor:pointer;width:"+inst.options.navbuttonwidth+'px;height:100%;left:0;top:0;background:url("'+inst.options.navarrowsprevimage+"\") no-repeat left center;'></div>"+"<div class='html5-nav-mask' style='display:block;position:relative;margin:0 auto;overflow:hidden;'>"+"<div class='html5-nav-list'></div>"+"</div>"+"<div class='html5-nav-next' style='display:block;position:absolute;cursor:pointer;width:"+
inst.options.navbuttonwidth+'px;height:100%;right:0;top:0;background:url("'+inst.options.navarrowsnextimage+"\") no-repeat right center;'></div>"+"</div>"+"</div>");inst.navvisible=inst.options.hidenavdefault?false:true;if(inst.options.shownavcontrol){$(".html5-nav").append('<div class="html5-nav-showcontrol" style="position:absolute;display:block;cursor:pointer;bottom:100%;right:12px;margin:0;padding:0;"></div>');if(inst.options.navusefont)$(".html5-nav-showcontrol").append('<div class="mh-icon-th-thumb"></div>');
else $(".html5-nav-showcontrol").append('<img alt="" src="'+inst.options.navcontrolimage+'"></img>');$(".html5-nav-showcontrol").click(function(){var winH=inst.getWinH();var navH=$(".html5-nav").height();if(inst.navvisible){inst.navvisible=false;$(".html5-nav").css({top:winH-navH+"px",bottom:"auto"}).animate({top:winH+"px"},function(){$(this).css({top:"100%",bottom:"auto"})})}else{inst.navvisible=true;var navH=$(".html5-nav").height();$(".html5-nav").css({top:winH+"px",bottom:"auto"}).animate({top:winH-
navH+"px"},function(){$(this).css({top:"auto",bottom:0})})}inst.resizeWindow()})}var index=0;for(i=0;i<inst.elemArray.length;i++)if(inst.matchGroup(group,inst.elemArray[i][ELEM_GROUP]))if(inst.elemArray[i][ELEM_THUMBNAIL]&&inst.elemArray[i][ELEM_THUMBNAIL].length>0){$(".html5-nav-list").append("<div class='html5-nav-thumb' data-arrayindex='"+i+"' style='float:left;overflow:hidden;cursor:pointer;opacity:"+inst.options.thumbopacity+";margin: 0 "+inst.options.thumbgap/2+"px;width:"+inst.options.thumbwidth+
"px;height:"+inst.options.thumbheight+"px;border:"+inst.options.thumbborder+"px solid "+inst.options.thumbbordercolor+";'></div>");this.loadThumbnail(inst.elemArray[i][ELEM_THUMBNAIL],index,inst.elemArray[i][ELEM_TITLE]);index++}$(".html5-nav-thumb").hover(function(){$(this).css({opacity:1});$(this).css({border:inst.options.thumbborder+"px solid "+inst.options.thumbhighlightbordercolor})},function(){$(this).css({opacity:inst.options.thumbopacity});$(this).css({border:inst.options.thumbborder+"px solid "+
inst.options.thumbbordercolor})});$(".html5-nav-thumb").click(function(){var index=$(this).data("arrayindex");if(index>=0)inst.gotoSlide(index)});inst.options.totalwidth=index*(inst.options.thumbgap+inst.options.thumbwidth+2*inst.options.thumbborder);$(".html5-nav-list").css({display:"block",position:"relative","margin-left":0,width:inst.options.totalwidth+"px"}).append("<div style='clear:both;'></div>");var $navMask=$(".html5-nav-mask");var $navPrev=$(".html5-nav-prev");var $navNext=$(".html5-nav-next");
$navPrev.click(function(){var $navList=$(".html5-nav-list");var $navNext=$(".html5-nav-next");var winWidth=$(window).width();var maskWidth=winWidth-2*inst.options.navbuttonwidth;var marginLeft=parseInt($navList.css("margin-left"))+maskWidth;if(marginLeft>=0){marginLeft=0;$(this).css({"background-position":"center left"})}else $(this).css({"background-position":"center right"});if(marginLeft<=maskWidth-inst.options.totalwidth)$navNext.css({"background-position":"center left"});else $navNext.css({"background-position":"center right"});
$navList.animate({"margin-left":marginLeft})});$navNext.click(function(){var $navList=$(".html5-nav-list");var $navPrev=$(".html5-nav-prev");var winWidth=$(window).width();var maskWidth=winWidth-2*inst.options.navbuttonwidth;var marginLeft=parseInt($navList.css("margin-left"))-maskWidth;if(marginLeft<=maskWidth-inst.options.totalwidth){marginLeft=maskWidth-inst.options.totalwidth;$(this).css({"background-position":"center left"})}else $(this).css({"background-position":"center right"});if(marginLeft>=
0)$navPrev.css({"background-position":"center left"});else $navPrev.css({"background-position":"center right"});$navList.animate({"margin-left":marginLeft})});var winWidth=$(window).width();if(inst.options.totalwidth<=winWidth){$navMask.css({width:inst.options.totalwidth+"px"});$navPrev.hide();$navNext.hide()}else{$navMask.css({width:winWidth-2*inst.options.navbuttonwidth+"px"});$navPrev.show();$navNext.show()}};inst.loadElem=function(elem){inst.currentElem=elem;inst.showing=true;if(inst.options.bodynoscroll)$("html,body").addClass("bodynoscroll");
if(!(inst.options.showtitle&&inst.currentElem[ELEM_TITLE]&&inst.currentElem[ELEM_TITLE].length>0||inst.options.showdescription&&inst.currentElem[ELEM_DESCRIPTION]&&inst.currentElem[ELEM_DESCRIPTION].length>0||inst.options.inGroup&&(inst.options.showplaybutton||inst.options.showtitleprefix)))inst.options.barheight=0;inst.showSocialButtons();inst.showNavigation();inst.$elem.off("mouseenter").off("mouseleave").off("mousemove");inst.$loading.show();if(inst.options.onshowitem&&window[inst.options.onshowitem]&&
typeof window[inst.options.onshowitem]=="function")window[inst.options.onshowitem](elem);if((inst.options.transition=="slide"||inst.options.transition=="crossfade")&&inst.existingElem>=0){$(".html5-elem-box-previous").remove();var newitem=inst.$elem.clone();newitem.insertAfter(inst.$elem);inst.$prevelem=inst.$elem;inst.$elem=newitem;inst.$prevelem.addClass("html5-elem-box-previous");inst.$elem.addClass("html5-elem-box-current");inst.$elemWrap=$(".html5-elem-wrap",inst.$elem);inst.$loading=$(".html5-loading",
inst.$elem);inst.$error=$(".html5-error-box",inst.$elem);inst.$image=$(".html5-image",inst.$elem);if(inst.options.titlestyle!="outside"){inst.$elemData=$(".html5-elem-data-box",inst.$elem);inst.$text=$(".html5-text",inst.$elem)}inst.$elem.css({position:"absolute",top:0,left:inst.options.transition=="slide"?inst.direction==-1?"100%":"-100%":0,opacity:0,height:"auto"});inst.$prevelem.css({width:inst.$prevelem.width()+"px",height:inst.$prevelem.height()+"px"});if(inst.options.transition=="crossfade"){inst.$prevelem.css({margin:0,
left:"50%",transform:"translateX(-50%)"});$(".html5-prev-inside, .html5-next-inside, .html5-prev-outside, .html5-next-outside",inst.$lightbox).css({visibility:"hidden"})}}switch(elem[ELEM_TYPE]){case 0:var imgLoader=new Image;$(imgLoader).on("load",function(){elem[ELEM_ORIGINALWIDTH]=imgLoader.width;elem[ELEM_ORIGINALHEIGHT]=imgLoader.height;inst.showImage(elem,imgLoader.width,imgLoader.height)});$(imgLoader).on("error",function(){inst.showError()});imgLoader.src=elem[ELEM_HREF];break;case 1:inst.showSWF(elem);
break;case 2:case 8:inst.showVideo(elem);break;case 3:case 4:case 9:case 11:case 12:inst.showYoutubeVimeo(elem);break;case 5:inst.showPDF(elem);break;case 6:inst.showMP3(elem);break;case 7:inst.showWeb(elem,false);break;case 10:inst.showDiv(elem);break}if(inst.options.pushwindowhistory&&window.history&&window.history.pushState){var historyURL=window.location.pathname+window.location.search+"#html5lightbox_"+encodeURIComponent(elem[ELEM_HREF]);window.history.pushState({},"",historyURL);window.onhashchange=
function(){if(!window.location.hash||window.location.hash.indexOf("#html5lightbox_")<0)inst.finish()}}if(inst.options.enablega4&&typeof gtag==="function")gtag("event","Lightbox",{"Action":"Open","URL":elem[ELEM_HREF]});if(window._gaq)window._gaq.push(["_trackEvent","Lightbox","Open",elem[ELEM_HREF]]);$(window).trigger("html5lightbox.event",["open",elem[ELEM_HREF],elem[ELEM_TITLE]]);if(inst.options.preload){if(inst.options.nextElem>=0&&inst.elemArray[inst.options.nextElem][ELEM_TYPE]==0)(new Image).src=
inst.elemArray[inst.options.nextElem][ELEM_HREF];if(inst.options.prevElem>=0&&inst.elemArray[inst.options.prevElem][ELEM_TYPE]==0)(new Image).src=inst.elemArray[inst.options.prevElem][ELEM_HREF]}};inst.loadCurElem=function(){inst.loadElem(inst.elemArray[inst.options.curElem])};inst.showError=function(){inst.$loading.hide();inst.resizeLightbox(inst.options.errorwidth,inst.options.errorheight,true,function(){inst.$loading.hide();inst.$error.show();inst.$elem.fadeIn(inst.options.fadespeed,function(){inst.showData()})})};
inst.calcTextWidth=function(objW){return objW-36};inst.showTitle=function(t,description){var text="";if(inst.options.showtitle)if(t&&t.length>0)text+=t;if(inst.options.inGroup){if(inst.options.showtitleprefix)text="<span class='html5-title-prefix'>"+inst.options.titleprefix.replace("%NUM",inst.options.groupIndex+1).replace("%TOTAL",inst.options.groupCount)+"</span> <span class='html5-title-caption'>"+text+"</span>";if(inst.options.showplaybutton){var playtext="<div class='html5-playpause' style='display:inline-block;cursor:pointer;vertical-align:middle;width:"+
inst.options.playimagesize+"px;height:"+inst.options.playimagesize+"px;'>";if(inst.options.playusefont)playtext+="<div class='html5-play mh-icon-customplay' style='display:block;'></div><div class='html5-pause mh-icon-custompause' style='display:none;'></div>";else playtext+="<div class='html5-play' style='display:block;'><img alt='' src='"+inst.options.playimage+"'></div><div class='html5-pause' style='display:none;'><img alt='' src='"+inst.options.pauseimage+"'></div>";playtext+="</div> ";text=
playtext+text}}if(text.length>0)text='<div class="html5-title">'+text+"</div>";if(inst.options.showdescription&&description&&description.length>0)text+='<div class="html5-description">'+description+"</div>";inst.$text.html(text);if(inst.options.inGroup&&inst.options.showplaybutton){if(inst.autosliding){$(".html5-play",inst.$lightbox).hide();$(".html5-pause",inst.$lightbox).show()}else{$(".html5-play",inst.$lightbox).show();$(".html5-pause",inst.$lightbox).hide()}$(".html5-play",inst.$lightbox).click(function(){$(".html5-play",
inst.$lightbox).hide();$(".html5-pause",inst.$lightbox).show();if(inst.slideTimeout){inst.slideTimeout.stop();inst.slideTimeout.start();inst.autosliding=true}});$(".html5-pause",inst.$lightbox).click(function(){$(".html5-play",inst.$lightbox).show();$(".html5-pause",inst.$lightbox).hide();if(inst.slideTimeout){inst.slideTimeout.stop();inst.autosliding=false}})}$("#html5-social",inst.$lightbox).show();if(inst.options.showsocialmedia)if(inst.currentElem[ELEM_SOCIALMEDIA])if($("#html5-socialmedia",inst.$lightboxBox).length>
0)$("#html5-socialmedia",inst.$lightboxBox).html(inst.currentElem[ELEM_SOCIALMEDIA]);else inst.$lightboxBox.append('<div id="html5-socialmedia" style="'+inst.options.socialmediaposition+'">'+inst.currentElem[ELEM_SOCIALMEDIA]+"</div>");else if($("#html5-socialmedia",inst.$lightboxBox).length>0)$("#html5-socialmedia",inst.$lightboxBox).remove()},inst.getElemSize=function(elem,initW,initH){var elemW,elemH;if(!elem[ELEM_MEDIUMWIDTH])elem[ELEM_MEDIUMWIDTH]=elem[ELEM_WIDTH];if(!elem[ELEM_SMALLWIDTH])elem[ELEM_SMALLWIDTH]=
elem[ELEM_MEDIUMWIDTH];if(!elem[ELEM_MEDIUMHEIGHT])elem[ELEM_MEDIUMHEIGHT]=elem[ELEM_HEIGHT];if(!elem[ELEM_SMALLHEIGHT])elem[ELEM_SMALLHEIGHT]=elem[ELEM_MEDIUMHEIGHT];var wIndex=ELEM_WIDTH;var hIndex=ELEM_HEIGHT;var winWidth=$(window).width();if(winWidth<inst.options.smallbreakpoint){wIndex=ELEM_SMALLWIDTH;hIndex=ELEM_SMALLHEIGHT}else if(winWidth<inst.options.mediumbreakpoint){wIndex=ELEM_MEDIUMWIDTH;hIndex=ELEM_MEDIUMHEIGHT}if(elem[ELEM_TYPE]==0){if(elem[wIndex])elemW=elem[wIndex];else if(initW){elemW=
initW;elem[wIndex]=initW}else elemW=inst.options.defaultwidth;if(elem[hIndex])elemH=elem[hIndex];else if(initH){elemH=initH;elem[hIndex]=initH}else elemH=inst.options.defaultheight}else if(!inst.options.contentkeepratio&&(elem[ELEM_TYPE]==5||elem[ELEM_TYPE]==7||elem[ELEM_TYPE]==10)){elemW=elem[wIndex]?elem[wIndex]:inst.options.usedefaultsizeforcontent||inst.options.usedefaultwidthforcontent?inst.options.defaultwidth:initW;elemH=elem[hIndex]?elem[hIndex]:inst.options.usedefaultsizeforcontent||inst.options.usedefaultheightforcontent?
inst.options.defaultheight:initH}else{elemW=elem[wIndex]?elem[wIndex]:inst.options.defaultwidth;elemH=elem[hIndex]?elem[hIndex]:inst.options.defaultheight}return{w:elemW,h:elemH}},inst.showImage=function(elem,imgW,imgH){var elemSize=inst.getElemSize(elem,imgW,imgH);inst.showTitle(elem[ELEM_TITLE],elem[ELEM_DESCRIPTION]);var sizeObj=inst.calcElemSize(elemSize,inst.options.imagekeepratio);inst.resizeLightbox(sizeObj.w,sizeObj.h,true,function(){inst.$loading.hide();var timercode=!inst.options.showtimer||
!inst.options.inGroup?"":"<div class='html5-timer' style='display:none;position:absolute;"+inst.options.timerposition+":0;left:0;width:0;height:"+inst.options.timerheight+"px;background-color:"+inst.options.timercolor+";opacity:"+inst.options.timeropacity+";'></div>";var titlecode=elem[ELEM_WEBLINKTEXT]&&elem[ELEM_WEBLINKTEXT].length>0?" title='"+elem[ELEM_WEBLINKTEXT].replace(/'/g,"&#39;")+"'":"";var targetcode=elem[ELEM_WEBLINKTARGET]&&elem[ELEM_WEBLINKTARGET].length>0?" target='"+elem[ELEM_WEBLINKTARGET]+
"'":"";var linkcode=elem[ELEM_WEBLINK]&&elem[ELEM_WEBLINK].length>0?"<a href='"+elem[ELEM_WEBLINK]+"'"+titlecode+targetcode+">":"";var linkcodeafter=elem[ELEM_WEBLINK]&&elem[ELEM_WEBLINK].length>0?"</a>":"";inst.$image.hide();inst.$image.html("<div class='html5-image-container' style='display:block;position:relative;width:100%;height:100%;"+(inst.options.imagekeepratio?"overflow:hidden;":"overflow:auto;")+"'>"+linkcode+"<img class='html5-image-img' alt='"+inst.html2Text(elem[ELEM_TITLE])+"' src='"+
elem[ELEM_HREF]+"' width='100%' height='auto' />"+linkcodeafter+timercode+"</div>");inst.$image.fadeIn(inst.options.fadespeed);inst.showData();if(inst.autosliding){inst.slideTimeout.stop();inst.slideTimeout.start()}})};inst.showSWF=function(elem){var elemSize=inst.getElemSize(elem);inst.showTitle(elem[ELEM_TITLE],elem[ELEM_DESCRIPTION]);var sizeObj=inst.calcElemSize(elemSize,true);var dataW=sizeObj.w;var dataH=sizeObj.h;inst.resizeLightbox(dataW,dataH,true,function(){inst.$loading.hide();inst.$image.html("<div class='html5lightbox-error' style='position:absolute;top:50%;left:50%;transform: translate(-50%, -50%);'>Adobe Flash has been discontinued!</div>").show();
inst.$elem.show();inst.showData();if(inst.autosliding){inst.slideTimeout.stop();inst.slideTimeout.start()}})};inst.showVideo=function(elem){inst.slideTimeout.stop();inst.showTitle(elem[ELEM_TITLE],elem[ELEM_DESCRIPTION]);var elemSize=inst.getElemSize(elem);var sizeObj=inst.calcElemSize(elemSize,true);var dataW=sizeObj.w;var dataH=sizeObj.h;inst.resizeLightbox(dataW,dataH,true,function(){inst.$loading.hide();inst.$image.html("<div class='html5lightbox-video' style='display:block;width:100%;height:100%;overflow:hidden;background-color:"+
inst.options.videobgcolor+";'></div>").show();var videoSrc=elem[ELEM_HREF];if(inst.options.isFirefox||inst.options.isOpera)if(elem[ELEM_HREF_WEBM])videoSrc=elem[ELEM_HREF_WEBM];else if(elem[ELEM_HREF_OGG])videoSrc=elem[ELEM_HREF_OGG];inst.embedHTML5Video($(".html5lightbox-video",inst.$image),videoSrc,inst.options.autoplay,inst.options.loopvideo,inst.options.mutevideo,inst.options.playsinline);if(elem[ELEM_WEBLINK]&&elem[ELEM_WEBLINK].length>0)$(".html5-lightbox-video",inst.$image).css({cursor:"pointer"}).click(function(){if(elem[ELEM_WEBLINKTARGET]&&
elem[ELEM_WEBLINKTARGET].length>0)window.open(elem[ELEM_WEBLINK],elem[ELEM_WEBLINKTARGET]);else window.open(elem[ELEM_WEBLINK])});inst.$elem.show();inst.showData()},inst.options.isMobile&&inst.options.autoplayhtml5onmobile)};inst.loadNext=function(){$(window).trigger("html5lightbox.videofinished");if(inst.autosliding)inst.gotoSlide(-1);else if(inst.options.autoclose)setTimeout(function(){inst.finish()},inst.options.autoclosedelay)};inst.getYoutubeParams=function(href){var result={};if(href.indexOf("?")<
0)return result;var params=href.substring(href.indexOf("?")+1).split("&");for(var i=0;i<params.length;i++){var value=params[i].split("=");if(value&&value.length==2&&value[0].toLowerCase()!="v")result[value[0].toLowerCase()]=value[1]}return result};inst.getYoutubeId=function(href){var youtubeId="";var regExp=/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\??v?=?))([^#\&\?]*).*/;var match=href.match(regExp);if(match&&match[7]&&match[7].length==11)youtubeId=match[7];if(!youtubeId){regExp=/(?:www\.)?youtube\.com\/shorts\/([\w-]+)/;
match=href.match(regExp);if(match&&match[1]&&match[1].length==11)youtubeId=match[1]}return youtubeId};inst.prepareYoutubeHref=function(href){var youtubeId=inst.getYoutubeId(href);var protocol="https:";var youtubeDomain=href.indexOf("youtube-nocookie")>=0?"youtube-nocookie":"youtube";var result=protocol+"//www."+youtubeDomain+".com/embed/"+youtubeId;var params=this.getYoutubeParams(href);var first=true;for(var key in params){if(first){result+="?";first=false}else result+="&";result+=key+"="+params[key]}return result};
inst.prepareVimeoHref=function(href){var vimeoId="";var regExp=/^.*(vimeo\.com\/)((video\/)|(channels\/[A-z]+\/)|(groups\/[A-z]+\/videos\/))?([0-9]+)/;var match=href.match(regExp);if(match&&match[6])vimeoId=match[6];else return href;var result="https://player.vimeo.com/video/"+vimeoId;var queryString=href.split("?")[1];if(queryString)result+="?"+queryString;return result};inst.prepareDailymotionHref=function(href){if(href.match(/\:\/\/.*(dai\.ly)/i)){var protocol="https:";var id=href.match(/(dai\.ly\/)([a-zA-Z0-9\-\_]+)/)[2];
href=protocol+"//www.dailymotion.com/embed/video/"+id}return href};inst.showYoutubeVimeo=function(elem){inst.slideTimeout.stop();inst.showTitle(elem[ELEM_TITLE],elem[ELEM_DESCRIPTION]);var elemSize=inst.getElemSize(elem);var sizeObj=inst.calcElemSize(elemSize,true);var dataW=sizeObj.w;var dataH=sizeObj.h;if(inst.options.noresizecallback){inst.resizeLightbox(dataW,dataH,true,function(){inst.showData()});inst.showYouTubeVimeoCallback(elem,sizeObj)}else inst.resizeLightbox(dataW,dataH,true,function(){inst.showYouTubeVimeoCallback(elem,
sizeObj);inst.showData()})};inst.showYouTubeVimeoCallback=function(elem,sizeObj){inst.$loading.hide();inst.$image.html("<div class='html5lightbox-video' style='display:block;width:100%;height:100%;overflow:hidden;'></div>").show();var href=elem[ELEM_HREF];var youtubeid="";if(elem[ELEM_TYPE]==3){youtubeid=inst.getYoutubeId(href);href=inst.prepareYoutubeHref(href)}if(elem[ELEM_TYPE]==4)href=inst.prepareVimeoHref(href);if(elem[ELEM_TYPE]==9)href=inst.prepareDailymotionHref(href);if(inst.options.autoplay){href+=
href.indexOf("?")<0?"?":"&";if(elem[ELEM_TYPE]==11)href+="autoPlay=true";else href+="autoplay=1"}if(inst.options.loopvideo){href+=href.indexOf("?")<0?"?":"&";switch(elem[ELEM_TYPE]){case 3:href+="loop=1&playlist="+youtubeid;break;case 4:case 9:href+="loop=1";break;case 11:href+="endVideoBehavior=loop";break}}if(elem[ELEM_TYPE]==3){if(href.indexOf("?")<0)href+="?wmode=transparent&rel=0";else href+="&wmode=transparent&rel=0";if(inst.options.videohidecontrols)href+="&controls=0&showinfo=0";if(inst.options.mutevideo)href+=
"&mute=1";if(inst.options.playsinline)href+="&playsinline=1";href+="&enablejsapi=1&origin="+document.location.protocol+"//"+document.location.hostname}else if(elem[ELEM_TYPE]==4){href+=href.indexOf("?")<0?"?":"&";href+="player_id=html5boxiframevideo"+inst.options.curElem;if(inst.options.mutevideo)href+="&muted=1";if(inst.options.playsinline)href+="&playsinline=1";href+="&origin="+document.location.protocol+"//"+document.location.hostname}$(".html5lightbox-video",inst.$image).html("<iframe style='margin:0;padding:0;border:0;' class='html5boxiframevideo' id='html5boxiframevideo"+
inst.options.curElem+"' width='100%' height='100%' src='"+href+"' frameborder='0' allow='autoplay' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>");inst.$elem.show();if(elem[ELEM_TYPE]==3){if(inst.options.inityoutube){inst.youtubeFinishCount=0;inst.initYoutubeFinishCallback()}}else if(elem[ELEM_TYPE]==4)if(inst.options.initvimeo){inst.vimeoFinishCount=0;inst.initVimeoFinishCallback()}};inst.initYoutubeFinishCallback=function(){if(typeof YT==="object"&&typeof YT.Player==="function")inst.ytplayer=
new YT.Player("html5boxiframevideo"+inst.options.curElem,{events:{"onStateChange":function(event){if(event.data==YT.PlayerState.ENDED){$(window).trigger("html5lightbox.videofinished");if(inst.autosliding)inst.gotoSlide(-1);else if(inst.options.autoclose)setTimeout(function(){inst.finish()},inst.options.autoclosedelay)}}}});else setTimeout(function(){if(inst.youtubeFinishCount<10){inst.youtubeFinishCount++;inst.initYoutubeFinishCallback()}},300)};inst.initVimeoFinishCallback=function(){if(window.Vimeo&&
typeof window.Vimeo.Player==="function"){var vimeoIframe=$("#html5boxiframevideo"+inst.options.curElem)[0];inst.vimeoPlayer=new window.Vimeo.Player(vimeoIframe);inst.vimeoPlayer.on("ended",function(){$(window).trigger("html5lightbox.videofinished");if(inst.autosliding)inst.gotoSlide(-1);else if(inst.options.autoclose)setTimeout(function(){inst.finish()},inst.options.autoclosedelay)})}else setTimeout(function(){if(inst.vimeoFinishCount<10){inst.vimeoFinishCount++;inst.initVimeoFinishCallback()}},300)};
inst.showPDF=function(elem){if(inst.options.enablepdfjs){if(inst.options.isIPhone&&inst.options.openpdfinnewtaboniphone||inst.options.isIPad&&inst.options.openpdfinnewtabonipad){var win=window.open(elem[ELEM_HREF],"_blank");win.focus();inst.finish();return}if(!inst.options.pdfjsengine)inst.options.pdfjsengine=inst.options.jsfolder+"pdfjs/web/viewer.html";var href=elem[ELEM_HREF];if(href.substring(0,5)!="http:"&&href.substring(0,6)!="https:")href=inst.absoluteUrl(href);var hashindex=href.indexOf("#");
if(hashindex>0)href=encodeURIComponent(href.substring(0,hashindex))+href.substring(hashindex);else href=encodeURIComponent(href);var pdfelem=jQuery.extend(true,{},elem);pdfelem[ELEM_HREF]=inst.options.pdfjsengine+(inst.options.pdfjsengine.indexOf("?")<0?"?":"&")+inst.options.pdfengineurlparam+"="+href;inst.showWeb(pdfelem,false)}else if(inst.options.isIPhone||inst.options.isIPad)inst.showWeb(elem,true);else if(inst.options.isAndroid||inst.options.isIE||inst.options.isIE11){var win=window.open(elem[ELEM_HREF],
"_blank");win.focus();inst.finish();return}else inst.showWeb(elem,false)};inst.showMP3=function(elem){};inst.showDiv=function(elem){inst.showTitle(elem[ELEM_TITLE],elem[ELEM_DESCRIPTION]);var winWidth=$(window).width();var winH=inst.getWinH();var navH=inst.options.shownavigation&&inst.navvisible?inst.options.navheight:0;var elemSize=inst.getElemSize(elem,winWidth,winH-navH);var sizeObj=inst.calcElemSize(elemSize,inst.options.contentkeepratio);var dataW=sizeObj.w;var dataH=sizeObj.h;inst.resizeLightbox(dataW,
dataH,true,function(){inst.$loading.hide();inst.$image.html("<div class='html5lightbox-div' id='html5lightbox-div"+inst.options.curElem+"' style='display:block;width:100%;height:"+(inst.options.autoresizecontent?"auto":"100%")+";"+(inst.options.isIOS?"-webkit-overflow-scrolling:touch;overflow-y:scroll;":"overflow:auto;")+"'></div>").show();var divID=elem[ELEM_HREF];if($(divID).length>0)$(divID).children().appendTo($("#html5lightbox-div"+inst.options.curElem,inst.$image));else $("#html5lightbox-div"+
inst.options.curElem,inst.$image).html("<div class='html5-error'>The specified div ID does not exist.</div>");inst.$elem.show();inst.showData();if(inst.options.autoresizecontent)inst.resizeWindow();if(inst.autosliding){inst.slideTimeout.stop();inst.slideTimeout.start()}})};inst.isSameDomain=function(href){if(href.substring(0,5)!="http:"&&href.substring(0,6)!="https:")return true;var link=document.createElement("a");link.setAttribute("href",href);var result=link.protocol==document.location.protocol&&
link.host==document.location.host&&link.port==document.location.port;link=null;return result};inst.showWeb=function(elem,pdfobject){inst.showTitle(elem[ELEM_TITLE],elem[ELEM_DESCRIPTION]);var winWidth=$(window).width();var winH=inst.getWinH();var navH=inst.options.shownavigation&&inst.navvisible?inst.options.navheight:0;var elemSize=inst.getElemSize(elem,winWidth,winH-navH);var sizeObj=inst.calcElemSize(elemSize,inst.options.contentkeepratio);var dataW=sizeObj.w;var dataH=sizeObj.h;inst.resizeLightbox(dataW,
dataH,true,function(){inst.$image.html("<div class='html5lightbox-web' style='display:block;width:100%;height:100%;"+(inst.options.isIOS?"-webkit-overflow-scrolling:touch;overflow-y:scroll;":"")+"'></div>").show();if(pdfobject){$(".html5lightbox-web",inst.$image).html("<object data='"+elem[ELEM_HREF]+"' type='application/pdf' width='100%' height='100%'></object>");inst.$loading.hide()}else $(".html5lightbox-web",inst.$image).html("<iframe style='margin:0;padding:0;border:0;' class='html5lightbox-web-iframe' width='100%' height='100%' src='"+
elem[ELEM_HREF]+"' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>");$(".html5lightbox-web-iframe",inst.$image).on("load",function(){inst.$loading.hide()});inst.$elem.show();inst.showData();if(inst.options.autoresizecontent&&inst.isSameDomain(elem[ELEM_HREF])){$(".html5lightbox-web-iframe",inst.$image).data("sameorigin",true);$(".html5lightbox-web-iframe",inst.$image).on("load",function(){$(this).data("sameoriginloaded",true);inst.resizeWindow()})}if(inst.autosliding){inst.slideTimeout.stop();
inst.slideTimeout.start()}})};inst.scrollBox=function(){};inst.resizeWindow=function(){if(!inst.currentElem)return;if(!inst.options.responsive)return;var winWidth=$(window).width();var winH=inst.getWinH();if(!(inst.options.showtitle&&inst.currentElem[ELEM_TITLE]&&inst.currentElem[ELEM_TITLE].length>0||inst.options.showdescription&&inst.currentElem[ELEM_DESCRIPTION]&&inst.currentElem[ELEM_DESCRIPTION].length>0||inst.options.inGroup&&(inst.options.showplaybutton||inst.options.showtitleprefix)))inst.options.barheight=
0;var elemSize,keepratio;if(!inst.options.contentkeepratio&&(inst.currentElem[ELEM_TYPE]==5||inst.currentElem[ELEM_TYPE]==7||inst.currentElem[ELEM_TYPE]==10)){var navH=inst.options.shownavigation&&inst.navvisible?inst.options.navheight:0;elemSize=inst.getElemSize(inst.currentElem,winWidth,winH-navH);keepratio=false}else{elemSize=inst.getElemSize(inst.currentElem);keepratio=inst.currentElem[ELEM_TYPE]==0?inst.options.imagekeepratio:true}var sizeObj=inst.calcElemSize(elemSize,keepratio);inst.adjustLightboxPos(sizeObj.w,
sizeObj.h);inst.adjustDataHeight();if(inst.options.autoresizecontent&&!inst.options.contentkeepratio&&(inst.currentElem[ELEM_TYPE]==5||inst.currentElem[ELEM_TYPE]==7||inst.currentElem[ELEM_TYPE]==10)){var resizeHeight=false;if(inst.currentElem[ELEM_TYPE]==7&&$(".html5lightbox-web-iframe",inst.$lightbox).length>0&&$(".html5lightbox-web-iframe",inst.$lightbox).data("sameoriginloaded")){var iframe=$(".html5lightbox-web-iframe",inst.$lightbox)[0];if(iframe&&iframe.contentWindow&&iframe.contentWindow.document&&
iframe.contentWindow.document.documentElement.offsetHeight)if(elemSize.h>iframe.contentWindow.document.documentElement.offsetHeight){elemSize.h=iframe.contentWindow.document.documentElement.offsetHeight;resizeHeight=true}}else if(inst.currentElem[ELEM_TYPE]==10&&$(".html5lightbox-div",inst.$lightbox).length>0){var divH=$(".html5lightbox-div",inst.$lightbox).height();if(elemSize.h>divH){elemSize.h=divH;resizeHeight=true}}if(resizeHeight){sizeObj=inst.calcElemSize(elemSize,keepratio);inst.adjustLightboxPos(sizeObj.w,
sizeObj.h)}}if($(".html5-nav").length<=0)return;$(".html5-nav-list").css({"margin-left":0});var $navMask=$(".html5-nav-mask");var $navPrev=$(".html5-nav-prev");var $navNext=$(".html5-nav-next");var winWidth=$(window).width();if(inst.options.totalwidth<=winWidth){$navMask.css({width:inst.options.totalwidth+"px"});$navPrev.hide();$navNext.hide()}else{$navMask.css({width:winWidth-2*inst.options.navbuttonwidth+"px"});$navPrev.show();$navNext.show()}};inst.calcElemSize=function(sizeObj,keepratio){if(!inst.options.responsive)return sizeObj;
var winWidth=$(window).width();var winH=inst.getWinH();winH=winH?winH:$(document).height();var strW=String(sizeObj.w);if(strW.charAt(strW.length-1)=="%")sizeObj.w=winWidth*parseFloat(strW.substring(0,strW.length-1))/100;var strH=String(sizeObj.h);if(strH.charAt(strH.length-1)=="%")sizeObj.h=winH*parseFloat(strH.substring(0,strH.length-1))/100;var navH=inst.options.shownavigation&&inst.navvisible?inst.options.navheight:0;var topmargin=$(window).height()<inst.options.smallscreenheight?inst.options.bordertopmarginsmall:
inst.options.bordertopmargin;var h0=winH-navH-2*inst.options.bordersize-2*topmargin;if(inst.options.responsivebarheight)if(winH<=inst.options.smallscreenheight)inst.options.barheight=inst.options.barheightonsmallheight;else inst.options.barheight=inst.options.barheightoriginal;if(inst.options.titlestyle=="bottom")h0-=inst.options.barheight;else if(inst.options.titlestyle=="outside")h0-=inst.$elemData.outerHeight();var w0=winWidth-2*inst.options.bordersize-2*inst.options.bordermargin;if(inst.options.resizeleftright&&
(inst.options.titlestyle=="left"||inst.options.titlestyle=="right")&&winWidth>inst.options.sidetobottomscreenwidth)w0-=2*inst.options.bordersize;if(inst.options.fullscreenmode&&winWidth>inst.options.navarrowsbottomscreenwidth||inst.options.isTouch&&inst.options.navarrowsalwaysshowontouch&&winWidth>inst.options.navarrowsbottomscreenwidth)w0-=64;if(inst.options.notkeepratioonsmallheight&&winH<=inst.options.smallscreenheight)keepratio=false;if(keepratio){var originWidth=inst.currentElem[ELEM_TYPE]==
0?inst.currentElem[ELEM_ORIGINALWIDTH]:sizeObj.w;var originHeight=inst.currentElem[ELEM_TYPE]==0?inst.currentElem[ELEM_ORIGINALHEIGHT]:sizeObj.h;if(inst.options.resizeleftright&&(inst.options.titlestyle=="left"||inst.options.titlestyle=="right")&&winWidth>inst.options.sidetobottomscreenwidth){var ratio=originWidth/originHeight;sizeObj.h=Math.round(sizeObj.w/ratio);if(sizeObj.h>h0){sizeObj.w=Math.round(ratio*h0);sizeObj.h=h0}if((sizeObj.w+2*inst.options.bordersize)*100/inst.options.imagepercentage>
w0){sizeObj.w=w0*inst.options.imagepercentage/100-2*inst.options.bordersize;sizeObj.h=Math.round(sizeObj.w/ratio)}sizeObj.w=(sizeObj.w+2*inst.options.bordersize)*100/inst.options.imagepercentage-2*inst.options.bordersize}else{var ratio=originWidth/originHeight;sizeObj.h=Math.round(sizeObj.w/ratio);if(sizeObj.h>h0){sizeObj.w=Math.round(ratio*h0);sizeObj.h=h0}if(sizeObj.w>w0){sizeObj.h=Math.round(w0/ratio);sizeObj.w=w0}}}else{if(inst.options.resizeleftright&&(inst.options.titlestyle=="left"||inst.options.titlestyle==
"right")&&winWidth>inst.options.sidetobottomscreenwidth)sizeObj.w=sizeObj.w*100/inst.options.imagepercentage;if(sizeObj.h>h0)sizeObj.h=h0;else if(inst.options.maxheight)sizeObj.h=h0;if(sizeObj.w>w0)sizeObj.w=w0}return sizeObj};inst.adjustDataHeight=function(){var winWidth=$(window).width();var winH=inst.getWinH();var isBottomText=inst.options.titlestyle=="bottom"||inst.options.titlestyle=="outside"||(inst.options.titlestyle=="left"||inst.options.titlestyle=="right")&&winWidth<=inst.options.sidetobottomscreenwidth;
if(inst.options.responsivebarheight)if(winH<=inst.options.smallscreenheight)inst.options.barheight=inst.options.barheightonsmallheight;else inst.options.barheight=inst.options.barheightoriginal;if(isBottomText){var topmargin=$(window).height()<inst.options.smallscreenheight?inst.options.bordertopmarginsmall:inst.options.bordertopmargin;var navH=inst.options.shownavigation&&inst.navvisible?inst.options.navheight:0;var winH=inst.getWinH();var maxH=winH-topmargin-navH;var barHeight=inst.options.barautoheight?
inst.$elemData.outerHeight():inst.options.barheight;var totalHeight=inst.$elemWrap.outerHeight()+barHeight;var elemHeight=Math.min(maxH,totalHeight);var boxMargin=(winH-navH-elemHeight)/2;inst.$elem.css({"max-height":elemHeight+"px"});var topmargin=$(window).height()<inst.options.smallscreenheight?inst.options.bordertopmarginsmall:inst.options.bordertopmargin;if(boxMargin<topmargin)boxMargin=topmargin;if(inst.options.insideiframe&&window.self!=window.top){boxMargin=inst.options.iframetopmargin>0?
inst.options.iframetopmargin:topmargin;if(inst.options.iframesamedomain&&parent.window.jQuery&&parent.window.jQuery("#"+inst.options.iframeid).length){var iframetop=parent.window.jQuery("#"+inst.options.iframeid).offset().top;var parentscroll=parent.window.document.body.scrollTop;boxMargin+=parentscroll>iframetop?parentscroll-iframetop:0}}if(inst.options.transition=="crossfade"&&inst.$prevelem)inst.$prevelem.css({"top":String(inst.existingBoxT-boxMargin)+"px"});inst.$lightboxBox.css({"margin-top":boxMargin+
"px"})}else inst.$elem.css({"max-height":"none"});if(inst.options.titlestyle=="bottom"||inst.options.titlestyle=="inside")inst.$lightboxBox.css({height:"auto"});if(inst.options.positionFixed)$("#html5-lightbox-overlay",inst.$lightbox).css({height:Math.max($(window).height(),$(document).height())});else $("#html5-lightbox-overlay",inst.$lightbox).css({height:"100%"})};inst.showData=function(){if(inst.$text.text().length>0)inst.$elemData.show();inst.adjustDataHeight();$(window).trigger("html5lightbox.lightboxopened")};
inst.resizeLightbox=function(elemW,elemH,bAnimate,onFinish,speedZero){inst.hideNavArrows();var boxPos=inst.calcBoxPosition(elemW,elemH);var boxW=boxPos[0];var boxH=boxPos[1];var boxT=boxPos[2];inst.$loading.hide();inst.$watermark.hide();if(inst.options.nextElem<=inst.options.curElem)if(inst.options.onlastitem&&window[inst.options.onlastitem]&&typeof window[inst.options.onlastitem]=="function")window[inst.options.onlastitem](inst.currentElem);if(inst.options.prevElem>=inst.options.curElem)if(inst.options.onfirstitem&&
window[inst.options.onfirstitem]&&typeof window[inst.options.onfirstitem]=="function")window[inst.options.onfirstitem](inst.currentElem);if(!inst.options.fullscreenmode&&!(inst.options.navarrowspos=="side")&&!(inst.options.navarrowspos=="browserside")&&(!inst.options.isTouch||!inst.options.navarrowsalwaysshowontouch)&&!inst.options.alwaysshownavarrows){inst.$lightboxBox.on("mouseenter mousemove",function(){if(inst.options.arrowloop&&inst.options.prevElem>=0||!inst.options.arrowloop&&inst.options.prevElem>=
0&&inst.options.prevElem<inst.options.curElem)inst.$prev.fadeIn();if(inst.options.arrowloop&&inst.options.nextElem>=0||!inst.options.arrowloop&&inst.options.nextElem>=0&&inst.options.nextElem>inst.options.curElem)inst.$next.fadeIn()});inst.$lightboxBox.on("mouseleave",function(){inst.$next.fadeOut();inst.$prev.fadeOut()})}inst.existingBoxT=parseFloat(inst.$lightboxBox.css("margin-top"));inst.$lightboxBox.css({"margin-top":boxT});inst.resizePositionFixed();var speed=bAnimate?inst.options.resizespeed:
0;if(inst.options.fullscreenmode&&inst.options.fullscreennotransition)speed=0;if((inst.options.transition=="slide"||inst.options.transition=="crossfade")&&inst.existingElem>=0)speed=0;if(typeof speedZero!=="undefined"&&speedZero)speed=0;if(inst.options.enteranimation){speed=0;if(!inst.$lightboxBox.hasClass("html5box-enter-animated")){inst.$lightboxBox.one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){inst.$lightboxBox.removeClass("html5box-"+inst.options.enteranimation)});
inst.$lightboxBox.addClass("html5box-enter-animated html5box-"+inst.options.enteranimation)}}var winWidth=$(window).width();if((inst.options.titlestyle=="left"||inst.options.titlestyle=="right")&&winWidth>inst.options.sidetobottomscreenwidth){if(boxW==inst.$lightboxBox.width()&&boxH==inst.$lightboxBox.height())speed=0;inst.$lightboxBox.animate({width:boxW},speed).animate({height:boxH},speed,function(){inst.onAnimateFinish(onFinish)})}else{if(boxW==inst.$elemWrap.width()&&boxH==inst.$elemWrap.height())speed=
0;inst.$lightboxBox.css({"width":boxW,"height":"auto"});inst.$elemWrap.animate({width:boxW},speed).animate({height:boxH},speed,function(){inst.onAnimateFinish(onFinish)})}};inst.onAnimateFinish=function(onFinish){inst.$loading.show();inst.$watermark.show();inst.$close.show();inst.$elem.css({"background-color":inst.options.bgcolor});inst.resizePositionFixed();onFinish();inst.finishCallback();$(window).trigger("html5lightbox.lightboxshowend")};inst.finishCallback=function(){if((inst.options.transition==
"slide"||inst.options.transition=="crossfade")&&inst.existingElem>=0)if(inst.options.transition=="slide"){inst.$prevelem.animate({left:inst.direction==-1?"-100%":"100%",opacity:0},{duration:inst.options.transitionduration});inst.$elem.animate({left:0,opacity:1},{duration:inst.options.transitionduration,always:function(){inst.$prevelem.remove();inst.$elem.removeClass("html5-elem-box-current").css({position:"relative",height:"100%"})}})}else{inst.$prevelem.animate({opacity:0},{duration:inst.options.transitionduration});
inst.$elem.animate({opacity:1},{duration:inst.options.transitionduration,always:function(){inst.$prevelem.remove();$(".html5-prev-inside, .html5-next-inside, .html5-prev-outside, .html5-next-outside",inst.$lightbox).css({visibility:"visible"});inst.$elem.removeClass("html5-elem-box-current").css({position:"relative",height:"100%"})}})}},inst.resetDiv=function(elemID){if(inst.elemArray.length>0&&elemID>=0)if(inst.elemArray[elemID][ELEM_TYPE]==10){var divID=inst.elemArray[elemID][ELEM_HREF];if($(divID).length>
0)$("#html5lightbox-div"+elemID).children().appendTo($(divID))}};inst.reset=function(){if(inst.options.stamp)inst.$watermark.hide();inst.showing=false;inst.$image.empty();inst.$text.empty();inst.$error.hide();inst.$loading.hide();inst.$image.hide();if(inst.options.titlestyle=="bottom"||inst.options.titlestyle=="inside")inst.$elemData.hide();if(!inst.options.fullscreenmode)inst.$close.hide();inst.$elem.css({"background-color":""})};inst.resetNavigation=function(){inst.options.navheight=0;$(".html5-nav").remove();
inst.navvisible=false};inst.finish=function(){if($(".html5-nav").length>0)$(".html5-nav").addClass("html5box-animated html5box-fadeOutDown");if(inst.options.enteranimation)inst.$lightboxBox.removeClass("html5box-enter-animated html5box-"+inst.options.enteranimation);if(inst.options.exitanimation=="fadeOut"||inst.options.exitanimation=="fadeOutDown"){inst.$lightbox.one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){inst.$lightboxBox.removeClass("html5box-animated html5box-"+
inst.options.exitanimation);inst.$lightbox.removeClass("html5box-animated html5box-fadeOut");inst.finishDone()});inst.$lightbox.addClass("html5box-animated html5box-fadeOut");inst.$lightboxBox.addClass("html5box-animated html5box-"+inst.options.exitanimation)}else inst.finishDone()};inst.finishDone=function(){inst.existingElem=-1;inst.resetDiv(inst.options.curElem);if($(".html5-lightbox-video",inst.$lightbox).length)$(".html5-lightbox-video",inst.$lightbox).attr("src","");$("head").find("style").each(function(){if($(this).data("creator")==
"gridgallery-html5-lightbox")$(this).remove()});if(inst.options.bodynoscroll)$("html,body").removeClass("bodynoscroll");inst.slideTimeout.stop();inst.reset();inst.resetNavigation();inst.$lightbox.remove();$("#gridgallery-html5-lightbox").remove();inst.showObjects();if(inst.options.oncloselightbox&&window[inst.options.oncloselightbox]&&typeof window[inst.options.oncloselightbox]=="function")window[inst.options.oncloselightbox](inst.currentElem);if(inst.onLightboxClosed&&typeof inst.onLightboxClosed=="function")inst.onLightboxClosed(inst.currentElem);
if(inst.options.oncloseurl)window.open(inst.options.oncloseurl,inst.options.oncloseurltarget);$(window).trigger("html5lightbox.lightboxclosed")};inst.pauseSlide=function(){};inst.playSlide=function(){};inst.gotoSlide=function(slide){inst.existingElem=inst.options.curElem;inst.direction=slide;inst.resetDiv(inst.options.curElem);if(slide==-1){if(inst.options.nextElem<0)return;inst.options.curElem=inst.options.nextElem}else if(slide==-2){if(inst.options.prevElem<0)return;inst.options.curElem=inst.options.prevElem}else if(slide>=
0){inst.direction=slide>inst.options.curElem?-1:-2;inst.options.curElem=slide}if(inst.autosliding)inst.slideTimeout.stop();inst.calcNextPrevElem();if(inst.options.transition!="slide"&&inst.options.transition!="crossfade")inst.reset();inst.loadCurElem();if(inst.options.titlestyle=="inside"&&inst.options.showonmouseoverinside&&inst.currentElem[ELEM_TYPE]!==0&&inst.options.showinsidetitleforimageonly)inst.$elemData.css({opacity:0})};inst.enableSwipe=function(){var preventDefault=inst.options.isAndroid&&
(inst.options.swipepreventdefaultonandroid||inst.options.androidVersion>=0&&inst.options.androidVersion<=5)?true:false;inst.$lightboxBox.html5lightboxTouchSwipe({preventWebBrowser:preventDefault,swipeDistance:inst.options.swipedistance,swipeLeft:function(){if(inst.options.inGroup)inst.gotoSlide(-1)},swipeRight:function(){if(inst.options.inGroup)inst.gotoSlide(-2)}})};inst.hideObjects=function(){$("embed, object").css({"visibility":"hidden"})};inst.showObjects=function(){$("embed, object").css({"visibility":"visible"})};
inst.embedHTML5Video=function($container,src,autoplay,loopvideo,mutevideo,playsinline){$container.html("<div style='display:block;width:100%;height:100%;position:relative;'><video class='html5-lightbox-video' width='100%' height='100%'"+(inst.options.html5videoposter&&inst.options.html5videoposter.length>0?"poster='"+inst.options.html5videoposter+"'":"")+(autoplay?" autoplay":"")+(loopvideo?" loop":"")+(mutevideo?" muted":"")+(playsinline?" playsinline":"")+(inst.options.nativehtml5controls&&!inst.options.videohidecontrols?
" controls='controls'":"")+(inst.options.nativecontrolsnodownload?' controlsList="nodownload"':"")+" src='"+(inst.options.ishd&&inst.options.hd?inst.options.hd:src)+"'>"+(inst.options.showsubtitle&&inst.options.vtturl?'<track default src="'+inst.options.vtturl+'" kind="subtitles" srclang="'+inst.options.vttlang+'" label="'+inst.options.vttlabel+'">':"")+"</video></div>");if(mutevideo)inst.options.defaultvideovolume=0;if(!inst.options.nativehtml5controls)if(!inst.options.videohidecontrols){$("video",
$container).data("ishd",inst.options.ishd);$("video",$container).data("hd",inst.options.hd);$("video",$container).data("src",src);$("video",$container).wpGridLightboxHTML5VideoControls(inst.options.skinsfolder,inst,".html5-lightbox-video",inst.options.isMobile,autoplay,inst.options,null)}else $("video",$container).lightboxExtraHTML5VideoControls(inst.options);$("video",$container).off("ended").on("ended",function(){$(window).trigger("html5lightbox.videofinished");if(inst.autosliding)inst.gotoSlide(-1);
else if(inst.options.autoclose)setTimeout(function(){inst.finish()},inst.options.autoclosedelay)})};inst.checkType=function(href){if(!href)return-1;if(href.match(/\.(jpg|gif|png|bmp|jpeg|webp)(.*)?$/i))return 0;if(href.match(/[^\.]\.(swf)\s*$/i))return 1;if(href.match(/\.(mp4|m4v|ogv|ogg|webm)(.*)?$/i))return 2;if(href.match(/\:\/\/.*(youtube\.com)/i)||href.match(/\:\/\/.*(youtu\.be)/i)||href.match(/\:\/\/.*(youtube-nocookie\.com)/i))return 3;if(href.match(/\:\/\/.*(vimeo\.com)/i))return 4;if(href.match(/\:\/\/.*(dailymotion\.com)/i)||
href.match(/\:\/\/.*(dai\.ly)/i))return 9;if(href.match(/[^\.]\.(pdf)/i))return 5;if(href.match(/[^\.]\.(mp3)\s*$/i))return 6;if(href.match(/[^\.]\.(flv)\s*$/i))return 8;if(href.match(/^\#\w+/i))return 10;if(href.match(/\:\/\/.*(wistia)/i))return 11;return 7};inst.getURLParams=function(){var result={};var params=window.location.search.substring(1).split("&");for(var i=0;i<params.length;i++){var value=params[i].split("=");if(value&&value.length==2)result[value[0].toLowerCase()]=value[1]}return result};
inst.absoluteUrl=function(href){var link=document.createElement("a");link.href=href;return link.protocol+"//"+link.host+link.pathname+link.search+link.hash};inst.showLightboxObject=function(obj){if(obj)inst.showLightbox(obj.type,obj.href,obj.title,obj.width,obj.height,obj.webm,obj.ogg,obj.thumbnail,obj.description,obj.div,obj.originalwidth,obj.originalheight,obj.socialmedia,obj.weblink,obj.weblinktarget,obj.weblinktext,obj.group,obj.mediumwidth,obj.mediumheight,obj.smallwidth,obj.smallheight)};inst.showLightbox=
function(type,href,title,width,height,webm,ogg,thumbnail,description,div,originalwidth,originalheight,socialmedia,weblink,weblinktarget,weblinktext,group,mediumwidth,mediumheight,smallwidth,smallheight){inst.options=$.extend(inst.options,inst.defaultoptions);$(window).trigger("html5lightbox.lightboxshow");inst.init();inst.reset();inst.$lightbox.show();inst.adjustLightboxPos(inst.options.loadingwidth,inst.options.loadingheight);inst.loadElem(new Array(type,href,title,group,width,height,webm,ogg,thumbnail,
description,div,originalwidth,originalheight,socialmedia,weblink,weblinktarget,weblinktext,mediumwidth,mediumheight,smallwidth,smallheight))};inst.addItemNoDuplicate=function(href,title,group,width,height,webm,ogg,thumbnail,description,mediatype,mediumwidth,mediumheight,smallwidth,smallheight){for(var i=0;i<inst.elemArray.length;i++)if(inst.elemArray[i][ELEM_HREF]==href)return;inst.addItem(href,title,group,width,height,webm,ogg,thumbnail,description,mediatype,mediumwidth,mediumheight,smallwidth,smallheight)};
inst.addItem=function(href,title,group,width,height,webm,ogg,thumbnail,description,mediatype,mediumwidth,mediumheight,smallwidth,smallheight){type=mediatype&&mediatype>=0?mediatype:inst.checkType(href);inst.elemArray.push(new Array(type,href,title,group,width,height,webm,ogg,thumbnail,description,null,null,null,null,null,null,null,mediumwidth,mediumheight,smallwidth,smallheight))};inst.showItem=function(href){inst.options=$.extend(inst.options,inst.defaultoptions);$(window).trigger("html5lightbox.lightboxshow");
inst.init();if(inst.elemArray.length<=0)return true;inst.hideObjects();for(var i=0;i<inst.elemArray.length;i++)if(inst.elemArray[i][ELEM_HREF]==href)break;if(i==inst.elemArray.length)return true;inst.options.curElem=i;inst.calcNextPrevElem();inst.reset();inst.$lightbox.show();inst.adjustLightboxPos(inst.options.loadingwidth,inst.options.loadingheight);inst.loadCurElem();return false};inst.each(function(){var self=$(this);var nodeName=this.nodeName.toLowerCase();if(nodeName=="a"||nodeName=="area")self.off("click").click(inst.clickHandler);
else self.find("a,area").each(function(){$(this).off("click").click(inst.clickHandler)});var autoopen=false;var autoopendelay=0;var autoopenonce=false;var autoopenonceexpire=0;if(typeof wondergridgallerylightbox_options!="undefined"&&wondergridgallerylightbox_options){if("autoopen"in wondergridgallerylightbox_options)autoopen=wondergridgallerylightbox_options.autoopen;if("autoopendelay"in wondergridgallerylightbox_options)autoopendelay=wondergridgallerylightbox_options.autoopendelay;if("autoopenonce"in wondergridgallerylightbox_options)autoopenonce=wondergridgallerylightbox_options.autoopenonce;
if("autoopenonceexpire"in wondergridgallerylightbox_options)autoopenonceexpire=wondergridgallerylightbox_options.autoopenonceexpire}autoopen=self.data("autoopen")?self.data("autoopen"):autoopen;autoopendelay=self.data("autoopendelay")?self.data("autoopendelay"):autoopendelay;autoopenonce=self.data("autoopenonce")?self.data("autoopenonce"):autoopenonce;autoopenonceexpire=self.data("autoopenonceexpire")?self.data("autoopenonceexpire"):autoopenonceexpire;var classoptions=inst.readClassOptions(self);if(classoptions){if("autoopen"in
classoptions)autoopen=classoptions.autoopen;if("autoopendelay"in classoptions)autoopendelay=classoptions.autoopendelay;if("autoopenonce"in classoptions)autoopenonce=classoptions.autoopenonce;if("autoopenonceexpire"in classoptions)autoopenonceexpire=classoptions.autoopenonceexpire}autocookie="html5lightboxpopup=1;path=/";if(autoopenonceexpire>0){var expires=new Date;expires.setTime(expires.getTime()+autoopenonceexpire*60*60*1E3);autocookie+=";expires="+expires.toUTCString()}if(autoopen){var is_popped=
false;if(autoopenonce){var cookies=document.cookie?document.cookie.split(";"):[];for(var i in cookies){var parts=$.trim(cookies[i]).split("=");if(parts.length&&parts[0]=="html5lightboxpopup"){is_popped=true;break}}}if(!is_popped)setTimeout(function(){self.click();document.cookie=autocookie},autoopendelay)}if(self.data("preloadonpageload")){var fileType="mediatype"in self.data()?self.data("mediatype"):inst.checkType(self.attr("href"));if(fileType==0){var preloaddelay=self.data("preloaddelay")?self.data("preloaddelay"):
0;setTimeout(function(){(new Image).src=self.attr("href")},preloaddelay)}}});var urlParams=inst.getURLParams();if("wpgridlightboxshare"in urlParams){var shareUrl=decodeURIComponent(urlParams["wpgridlightboxshare"]);var shareLink=$('.wpgridlightbox[href="'+shareUrl+'"]');if(shareLink.length>0)setTimeout(function(){shareLink.click()},inst.options.shareopendelay)}if(inst.options.preloadallonpageload)setTimeout(function(){inst.each(function(){if(this.nodeName.toLowerCase()!="a"&&this.nodeName.toLowerCase()!=
"area")return;var fileType="mediatype"in $(this).data()?$(this).data("mediatype"):inst.checkType($(this).attr("href"));if(fileType!==0)return;(new Image).src=$(this).attr("href");if($(this).data("thumbnail"))(new Image).src=$(this).data("thumbnail")})},inst.options.preloadalldelay);return inst}})(jQuery);(function($){$.fn.html5lightboxTouchSwipe=function(options){var defaults={preventWebBrowser:false,swipeDistance:0,swipeLeft:null,swipeRight:null,swipeTop:null,swipeBottom:null};if(options)$.extend(defaults,
options);return this.each(function(){var startX=-1,startY=-1;var curX=-1,curY=-1;function touchStart(event){var e=event.originalEvent;if(e.targetTouches.length>=1){startX=e.targetTouches[0].pageX;startY=e.targetTouches[0].pageY}else touchCancel(event)}function touchMove(event){if(defaults.preventWebBrowser)event.preventDefault();var e=event.originalEvent;if(e.targetTouches.length>=1){curX=e.targetTouches[0].pageX;curY=e.targetTouches[0].pageY}else touchCancel(event)}function touchEnd(event){if(curX>
0||curY>0){triggerHandler();touchCancel(event)}else touchCancel(event)}function touchCancel(event){startX=-1;startY=-1;curX=-1;curY=-1}function triggerHandler(){if(Math.abs(curX-startX)>Math.abs(curY-startY)){if(Math.abs(curX-startX)>defaults.swipeDistance)if(curX>startX){if(defaults.swipeRight)defaults.swipeRight.call()}else if(defaults.swipeLeft)defaults.swipeLeft.call()}else if(Math.abs(curY-startY)>defaults.swipeDistance)if(curY>startY){if(defaults.swipeBottom)defaults.swipeBottom.call()}else if(defaults.swipeTop)defaults.swipeTop.call()}
try{$(this).on("touchstart",touchStart);$(this).on("touchmove",touchMove);$(this).on("touchend",touchEnd);$(this).on("touchcancel",touchCancel)}catch(e){}})}})(jQuery);(function($){$.fn.lightboxExtraHTML5VideoControls=function(videoOptions){var $videoObj=$(this);var enableclick=videoOptions.enableclick;var enablespacekey=videoOptions.enablespacekey;var toggleVideoPlayPause=function(){if($videoObj.get(0))if($videoObj.get(0).paused)$videoObj.get(0).play().then(null,function(){});else $videoObj.get(0).pause()};
if(enableclick)$videoObj.click(function(){toggleVideoPlayPause()});if(enablespacekey)$(document).keyup(function(e){if(e.keyCode==32)setTimeout(function(){toggleVideoPlayPause()},10)})};$.fn.wpGridLightboxHTML5VideoControls=function(skinFolder,parentInst,videoElem,isMobile,autoPlay,videoOptions,skinImages){var ICON_BG=videoOptions.videoiconbg;var ICON_COLOR=videoOptions.videoiconcolor;var ICON_DISABLED_COLOR=videoOptions.videoicondisabledcolor;var BAR_BUFFER_COLOR=videoOptions.videobarbuffercolor;var BAR_ACTIVE_COLOR=
videoOptions.videobaractivecolor;var BAR_COLOR=videoOptions.videobarcolor;var BAR_BG_OPACITY=videoOptions.videobarbgopacity;var PLAY_RADIUS=videoOptions.videoplayradius;var PLAY_SIZE=videoOptions.videoplaysize;var PLAY_STYLE=videoOptions.videoplaystyle;var PLAY_FONT_SIZE=videoOptions.videoplayfontsize;var PLAY_OPACITY=videoOptions.videoplayopacity;var PLAY_TIMEOUT=videoOptions.videoplaytimeout;var CONTROL_TIMEOUT=videoOptions.videocontroltimeout;var hideTotalTimeWidth=videoOptions.videohidetotaltimewidth;
var hideCurrTimeWidth=videoOptions.videohidecurrtimewidth;var hideControlBar=videoOptions.videohidecontrolbar;var hidePlayButton=videoOptions.videohideplaybutton;var defaultVolume=videoOptions.defaultvideovolume;var fullscreenNativeControls=videoOptions.nativecontrolsonfullscreen;var html5VideoNoDownload=videoOptions.nativecontrolsnodownload;var showsubtitle=videoOptions.showsubtitle;var vttline=videoOptions.vttline;var showsubtitlebydefault=videoOptions.showsubtitlebydefault;var enableclick=videoOptions.enableclick;
var enablespacekey=videoOptions.enablespacekey;var html5playerusefont=videoOptions.html5playerusefont;var isTouch="ontouchstart"in window;var eStart=isTouch?"touchstart":"mousedown";var eMove=isTouch?"touchmove":"mousemove";var eCancel=isTouch?"touchcancel":"mouseup";var eClick="click";var BUTTON_SIZE=32;var ICON_SIZE=16;var BAR_HEIGHT=isTouch?48:36;var hideControlsTimerId=null;var hidePlayTimerId=null;var hideVolumeBarTimeoutId=null;var sliderDragging=false;var isFullscreen=false;var userActive=
false;var isHd=$(this).data("ishd");var hd=$(this).data("hd");var src=$(this).data("src");var $videoObj=$(this);$videoObj.get(0).removeAttribute("controls");if(html5playerusefont){var $videoPlayPause=$("<div class='html5boxVideoPlayPause'><div class='html5boxVideoPlay' style='display:block;'></div><div class='html5boxVideoPause' style='display:none;'></div></div>");$videoObj.after($videoPlayPause);$videoPlayPause.css({position:"absolute",top:"50%",left:"50%",display:autoPlay?"none":"block",cursor:"pointer",
width:PLAY_SIZE+"px",height:PLAY_SIZE+"px",transform:"translate(-50%, -50%)"});var $videoPlay=$(".html5boxVideoPlay",$videoPlayPause);var $videoPause=$(".html5boxVideoPause",$videoPlayPause);$videoPlay.on(eClick,function(){$videoObj.get(0).play()});$videoPause.on(eClick,function(){$videoObj.get(0).pause()});$videoPlay.addClass(PLAY_STYLE=="circled"?"mh-icon-customplay":"mh-icon-play");$videoPause.addClass(PLAY_STYLE=="circled"?"mh-icon-custompause":"mh-icon-pause");$videoPlay.add($videoPause).css({position:"absolute",
top:0,left:0,width:"100%",height:"100%",color:ICON_COLOR,"background-color":PLAY_STYLE=="circled"?"transparent":ICON_BG,"border-radius":PLAY_STYLE=="circled"?0:PLAY_RADIUS,opacity:PLAY_OPACITY,"font-size":(PLAY_STYLE=="circled"?PLAY_SIZE:PLAY_FONT_SIZE)+"px","line-height":PLAY_SIZE+"px",padding:0,"box-sizing":"border-box"})}else{var $videoPlay=$("<div class='html5boxVideoPlay'></div>");$videoObj.after($videoPlay);var playbuttonImage=skinImages&&"playbutton"in skinImages&&skinImages.playbutton.length>
0?skinImages.playbutton:skinFolder+"html5boxplayer_playvideo.png";$videoPlay.css({position:"absolute",top:"50%",left:"50%",display:"block",cursor:"pointer",width:64,height:64,"margin-left":-32,"margin-top":-32,"background-image":"url('"+playbuttonImage+"')","background-position":"center center","background-repeat":"no-repeat"}).on(eClick,function(){$videoObj.get(0).play()})}var $videoFullscreenBg=$("<div class='html5boxVideoFullscreenBg'></div>");var $videoControls=$("<div class='html5boxVideoControls'>"+
"<div class='html5boxVideoControlsBg'></div>"+"<div class='html5boxPlayPause'>"+"<div class='html5boxPlay'></div>"+"<div class='html5boxPause'></div>"+"</div>"+"<div class='html5boxTimeCurrent'>--:--</div>"+"<div class='html5boxFullscreen'></div>"+"<div class='html5boxCaption'></div>"+"<div class='html5boxHD'></div>"+"<div class='html5boxVolume'>"+"<div class='html5boxVolumeButton'></div>"+"<div class='html5boxVolumeBar'>"+"<div class='html5boxVolumeBarBg'>"+"<div class='html5boxVolumeBarActive'></div>"+
"</div>"+"</div>"+"</div>"+"<div class='html5boxTimeTotal'>--:--</div>"+"<div class='html5boxSeeker'>"+"<div class='html5boxSeekerBuffer'></div>"+"<div class='html5boxSeekerPlay'></div>"+"<div class='html5boxSeekerHandler'></div>"+"</div>"+"<div style='clear:both;'></div>"+"</div>");$videoObj.after($videoControls);$videoObj.after($videoFullscreenBg);$videoFullscreenBg.css({display:"none",position:"fixed",left:0,top:0,bottom:0,right:0});$videoControls.css({display:"none",position:"absolute",width:"100%",
height:BAR_HEIGHT,left:0,bottom:0,right:0,margin:"0 auto"});var userActivate=function(){userActive=true};if(html5playerusefont)$videoObj.add($videoControls).add($videoPlayPause).on("touch click mousemove",function(){userActive=true});else $videoObj.add($videoControls).on("touch click mousemove",function(){userActive=true});setInterval(function(){if(userActive&&$videoObj.get(0).played.length>0){if(!hidePlayButton&&html5playerusefont){$videoPlayPause.stop(true,true);$videoPlayPause.show()}if(!hideControlBar){$videoControls.stop(true,
true);$videoControls.show()}userActive=false;clearTimeout(hidePlayTimerId);hidePlayTimerId=setTimeout(function(){if(!$videoObj.get(0).paused)if(!hidePlayButton&&html5playerusefont)$videoPlayPause.stop(true).fadeOut()},PLAY_TIMEOUT);clearTimeout(hideControlsTimerId);hideControlsTimerId=setTimeout(function(){if(!$videoObj.get(0).paused)if(!hideControlBar)$videoControls.stop(true).fadeOut()},CONTROL_TIMEOUT)}},10);$(".html5boxVideoControlsBg",$videoControls).css({display:"block",position:"absolute",
width:"100%",height:"100%",left:0,top:0,"background-color":ICON_BG,opacity:BAR_BG_OPACITY});$(".html5boxPlayPause",$videoControls).css({display:"block",position:"relative",width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",margin:Math.floor((BAR_HEIGHT-BUTTON_SIZE)/2),"float":"left"});var $videoBtnPlay=$(".html5boxPlay",$videoControls);var $videoBtnPause=$(".html5boxPause",$videoControls);$videoBtnPlay.css({display:"block",position:"absolute",top:0,left:0,width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",
cursor:"pointer"}).on(eClick,function(){$videoObj.get(0).play()});$videoBtnPause.css({display:"none",position:"absolute",top:0,left:0,width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",cursor:"pointer"}).on(eClick,function(){$videoObj.get(0).pause()});if(html5playerusefont){$videoBtnPlay.addClass("mh-icon-play").css({color:ICON_COLOR,"font-size":ICON_SIZE+"px","line-height":BUTTON_SIZE+"px"});$videoBtnPause.addClass("mh-icon-pause").css({color:ICON_COLOR,"font-size":ICON_SIZE+"px","line-height":BUTTON_SIZE+
"px"})}else{$videoBtnPlay.css({"background-image":"url('"+skinFolder+"html5boxplayer_playpause.png"+"')","background-position":"top left"}).hover(function(){$(this).css({"background-position":"bottom left"})},function(){$(this).css({"background-position":"top left"})});$videoBtnPause.css({"background-image":"url('"+skinFolder+"html5boxplayer_playpause.png"+"')","background-position":"top right"}).hover(function(){$(this).css({"background-position":"bottom right"})},function(){$(this).css({"background-position":"top right"})})}var toggleVideoPlayPause=
function(){if($videoObj.get(0))if($videoObj.get(0).paused)$videoObj.get(0).play().then(null,function(){});else $videoObj.get(0).pause()};if(enableclick){$videoFullscreenBg.click(function(){if(isFullscreen)toggleVideoPlayPause()});$videoObj.click(function(){if(!isFullscreen)toggleVideoPlayPause()})}if(enablespacekey)$(document).keyup(function(e){if(e.keyCode==32)setTimeout(function(){toggleVideoPlayPause()},10)});var $videoTimeCurrent=$(".html5boxTimeCurrent",$videoControls);var $videoTimeTotal=$(".html5boxTimeTotal",
$videoControls);var $videoSeeker=$(".html5boxSeeker",$videoControls);var $videoSeekerPlay=$(".html5boxSeekerPlay",$videoControls);var $videoSeekerBuffer=$(".html5boxSeekerBuffer",$videoControls);var $videoSeekerHandler=$(".html5boxSeekerHandler",$videoControls);$videoTimeCurrent.css({display:"block",position:"relative","float":"left","line-height":BAR_HEIGHT+"px","font-weight":"normal","font-style":"normal","font-size":"12px",margin:"0 8px 0 0","font-family":"Arial, Helvetica, sans-serif",color:ICON_COLOR});
$videoTimeTotal.css({display:"block",position:"relative","float":"right","line-height":BAR_HEIGHT+"px","font-weight":"normal","font-style":"normal","font-size":"12px",margin:"0 0 0 8px","font-family":"Arial, Helvetica, sans-serif",color:ICON_COLOR});if($videoObj.width()<=hideTotalTimeWidth)$videoTimeTotal.hide();if($videoObj.width()<=hideCurrTimeWidth)$videoTimeCurrent.hide();$videoSeeker.css({display:"block",cursor:"pointer",overflow:"hidden",position:"relative",height:"10px","background-color":BAR_COLOR,
margin:Math.floor((BAR_HEIGHT-10)/2)+"px 4px"}).on(eStart,function(e){var e0=isTouch?e.originalEvent.touches[0]:e;var pos=e0.pageX-$videoSeeker.offset().left;$videoSeekerPlay.css({width:pos});$videoObj.get(0).currentTime=pos*$videoObj.get(0).duration/$videoSeeker.width();$videoSeeker.on(eMove,function(e){var e0=isTouch?e.originalEvent.touches[0]:e;var pos=e0.pageX-$videoSeeker.offset().left;$videoSeekerPlay.css({width:pos});$videoObj.get(0).currentTime=pos*$videoObj.get(0).duration/$videoSeeker.width()})}).on(eCancel,
function(){$videoSeeker.off(eMove)});$videoSeekerBuffer.css({display:"block",position:"absolute",left:0,top:0,height:"100%","background-color":BAR_BUFFER_COLOR});$videoSeekerPlay.css({display:"block",position:"absolute",left:0,top:0,height:"100%","background-color":BAR_ACTIVE_COLOR});var $videoFSObj=fullscreenNativeControls?$videoObj:$videoObj.parent();if($videoFSObj.get(0).requestFullscreen||$videoFSObj.get(0).webkitRequestFullScreen||$videoFSObj.get(0).mozRequestFullScreen||$videoFSObj.get(0).webkitEnterFullScreen||
$videoFSObj.get(0).msRequestFullscreen){var switchScreen=function(fullscreen){if(fullscreen){if(fullscreenNativeControls){$videoObj.get(0).setAttribute("controls","controls");if(html5VideoNoDownload)$videoObj.get(0).setAttribute("controlsList","nodownload")}if($videoFSObj.get(0).requestFullscreen)$videoFSObj.get(0).requestFullscreen();else if($videoFSObj.get(0).webkitRequestFullScreen)$videoFSObj.get(0).webkitRequestFullScreen();else if($videoFSObj.get(0).mozRequestFullScreen)$videoFSObj.get(0).mozRequestFullScreen();
else if($videoFSObj.get(0).webkitEnterFullScreen)$videoFSObj.get(0).webkitEnterFullScreen();if($videoFSObj.get(0).msRequestFullscreen)$videoFSObj.get(0).msRequestFullscreen()}else if(document.cancelFullScreen)document.cancelFullScreen();else if(document.mozCancelFullScreen)document.mozCancelFullScreen();else if(document.webkitCancelFullScreen)document.webkitCancelFullScreen();else if(document.webkitExitFullscreen)document.webkitExitFullscreen();else if(document.msExitFullscreen)document.msExitFullscreen()};
var switchScreenCSS=function(fullscreen){if(fullscreenNativeControls)if(fullscreen){$videoObj.get(0).setAttribute("controls","controls");if(html5VideoNoDownload)$videoObj.get(0).setAttribute("controlsList","nodownload")}else $videoObj.get(0).removeAttribute("controls");else if(fullscreen){$(document).on("mousemove",userActivate);$videoControls.css({"z-index":2147483647,position:"fixed"});$videoFullscreenBg.css({"z-index":2147483647,display:"block"});if(html5playerusefont)$videoPlayPause.css({"z-index":2147483647});
else $videoPlay.css({"z-index":2147483647})}else{$(document).off("mousemove",userActivate);$videoControls.css({"z-index":"",position:"absolute"});$videoFullscreenBg.css({"z-index":"",display:"none"});if(html5playerusefont)$videoPlayPause.css({"z-index":""});else $videoPlay.css({"z-index":""})}};document.addEventListener("MSFullscreenChange",function(){isFullscreen=document.msFullscreenElement!=null;switchScreenCSS(isFullscreen)},false);document.addEventListener("fullscreenchange",function(){isFullscreen=
document.fullscreen;switchScreenCSS(isFullscreen)},false);document.addEventListener("mozfullscreenchange",function(){isFullscreen=document.mozFullScreen;switchScreenCSS(isFullscreen)},false);document.addEventListener("webkitfullscreenchange",function(){isFullscreen=document.webkitIsFullScreen;switchScreenCSS(isFullscreen)},false);$videoFSObj.get(0).addEventListener("webkitbeginfullscreen",function(){isFullscreen=true;switchScreenCSS(isFullscreen)},false);$videoFSObj.get(0).addEventListener("webkitendfullscreen",
function(){isFullscreen=false;switchScreenCSS(isFullscreen)},false);if(!fullscreenNativeControls)$("head").append("<style type='text/css'>video"+videoElem+"::-webkit-media-controls { display:none !important; }</style>");var $videoFullscreen=$(".html5boxFullscreen",$videoControls);$videoFullscreen.css({display:"block",position:"relative","float":"right",width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",margin:Math.floor((BAR_HEIGHT-BUTTON_SIZE)/2),cursor:"pointer"}).on(eClick,function(){isFullscreen=
!isFullscreen;switchScreen(isFullscreen)});if(html5playerusefont)$videoFullscreen.addClass("mh-icon-resize-full-alt").css({color:ICON_COLOR,"font-size":ICON_SIZE+"px","line-height":BUTTON_SIZE+"px"});else $videoFullscreen.css({"background-image":"url('"+skinFolder+"html5boxplayer_fullscreen.png"+"')","background-position":"left top"}).hover(function(){var backgroundPosX=$(this).css("background-position")?$(this).css("background-position").split(" ")[0]:$(this).css("background-position-x");$(this).css({"background-position":backgroundPosX+
" bottom"})},function(){var backgroundPosX=$(this).css("background-position")?$(this).css("background-position").split(" ")[0]:$(this).css("background-position-x");$(this).css({"background-position":backgroundPosX+" top"})})}if(hd){var $videoHD=$(".html5boxHD",$videoControls);$videoHD.css({display:"block",position:"relative","float":"right",width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",margin:Math.floor((BAR_HEIGHT-BUTTON_SIZE)/2),cursor:"pointer"}).on(eClick,function(){isHd=!isHd;if(html5playerusefont)$(this).css({"color":isHd?
ICON_COLOR:ICON_DISABLED_COLOR});else $(this).css({"background-position":(isHd?"right":"left")+" center"});parentInst.isHd=isHd;var isPaused=$videoObj.get(0).isPaused;$videoObj.get(0).setAttribute("src",(isHd?hd:src)+"#t="+$videoObj.get(0).currentTime);if(!isPaused)$videoObj.get(0).play();else $videoObj.get(0).pause()});if(html5playerusefont)$videoHD.addClass("mh-icon-hd").css({color:isHd?ICON_COLOR:ICON_DISABLED_COLOR,"font-size":ICON_SIZE+"px","line-height":BUTTON_SIZE+"px"});else $videoHD.css({"background-image":"url('"+
skinFolder+"html5boxplayer_hd.png"+"')","background-position":(isHd?"right":"left")+" center"})}else $(".html5boxHD",$videoControls).hide();if(showsubtitle){var $videoCaption=$(".html5boxCaption",$videoControls);$videoCaption.css({display:"block",position:"relative","float":"right",width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",margin:Math.floor((BAR_HEIGHT-BUTTON_SIZE)/2),cursor:"pointer"}).data("showcaption",showsubtitlebydefault).on(eClick,function(){var showcaption=!$videoCaption.data("showcaption");
if(html5playerusefont)$videoCaption.data("showcaption",showcaption).css({color:showcaption?ICON_COLOR:ICON_DISABLED_COLOR});else $videoCaption.data("showcaption",showcaption).css({"background-position":(showcaption?"right":"left")+" center"});if($videoObj.get(0).textTracks)for(var i=0;i<$videoObj.get(0).textTracks.length;i++)$videoObj.get(0).textTracks[i].mode=showcaption?"showing":"hidden"});if(html5playerusefont)$videoCaption.addClass("mh-icon-cc-1").css({color:showsubtitlebydefault?ICON_COLOR:
ICON_DISABLED_COLOR,"font-size":ICON_SIZE+"px","line-height":BUTTON_SIZE+"px"});else $videoCaption.css({"background-image":"url('"+skinFolder+"html5boxplayer_caption.png"+"')","background-position":showsubtitlebydefault?"right center":"left center"})}else $(".html5boxCaption",$videoControls).hide();var volumeSaved=defaultVolume==0?1:defaultVolume;$videoObj.get(0).volume=$videoObj.get(0).muted?0:defaultVolume;var $videoVolume=$(".html5boxVolume",$videoControls);var $videoVolumeButton=$(".html5boxVolumeButton",
$videoControls);var $videoVolumeBar=$(".html5boxVolumeBar",$videoControls);var $videoVolumeBarBg=$(".html5boxVolumeBarBg",$videoControls);var $videoVolumeBarActive=$(".html5boxVolumeBarActive",$videoControls);$videoVolume.css({display:"block",position:"relative","float":"right",width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",margin:Math.floor((BAR_HEIGHT-BUTTON_SIZE)/2)});if(!isMobile)$videoVolume.hover(function(){clearTimeout(hideVolumeBarTimeoutId);var volume=$videoObj.get(0).volume;$videoVolumeBarActive.css({height:Math.round(volume*
100)+"%"});$videoVolumeBar.show()},function(){clearTimeout(hideVolumeBarTimeoutId);hideVolumeBarTimeoutId=setTimeout(function(){$videoVolumeBar.hide()},1E3)});$videoVolumeButton.css({display:"block",position:"absolute",top:0,left:0,width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",cursor:"pointer"}).on(eClick,function(){if(isMobile)if($videoObj.get(0).muted){$videoObj.get(0).muted=false;if(html5playerusefont)$videoVolumeButton.addClass("mh-icon-volume-up").removeClass("mh-icon-volume-off");else{var backgroundPosY=
$(this).css("background-position")?$(this).css("background-position").split(" ")[1]:$(this).css("background-position-y");$videoVolumeButton.css({"background-position":"left "+backgroundPosY})}}else{$videoObj.get(0).muted=true;if(html5playerusefont)$videoVolumeButton.removeClass("mh-icon-volume-up").addClass("mh-icon-volume-off");else{var backgroundPosY=$(this).css("background-position")?$(this).css("background-position").split(" ")[1]:$(this).css("background-position-y");$videoVolumeButton.css({"background-position":"right "+
backgroundPosY})}}else{var volume=$videoObj.get(0).volume;if(volume>0){volumeSaved=volume;volume=0}else volume=volumeSaved;$videoObj.get(0).volume=volume;$videoObj.get(0).muted=volume==0;$videoVolumeBarActive.css({height:Math.round(volume*100)+"%"});if(html5playerusefont)if($videoObj.get(0).muted)$videoVolumeButton.removeClass("mh-icon-volume-up").addClass("mh-icon-volume-off");else $videoVolumeButton.addClass("mh-icon-volume-up").removeClass("mh-icon-volume-off");else{var backgroundPosY=$(this).css("background-position")?
$(this).css("background-position").split(" ")[1]:$(this).css("background-position-y");$videoVolumeButton.css({"background-position":(!$videoObj.get(0).muted?"left":"right")+" "+backgroundPosY})}}});if(html5playerusefont)$videoVolumeButton.addClass($videoObj.get(0).muted?"mh-icon-volume-off":"mh-icon-volume-up").css({color:ICON_COLOR,"font-size":ICON_SIZE+"px","line-height":BUTTON_SIZE+"px"});else $videoVolumeButton.css({"background-image":"url('"+skinFolder+"html5boxplayer_volume.png"+"')","background-position":"top "+
(!$videoObj.get(0).muted?"left":"right")}).hover(function(){var backgroundPosX=$(this).css("background-position")?$(this).css("background-position").split(" ")[0]:$(this).css("background-position-x");$(this).css({"background-position":backgroundPosX+" bottom"})},function(){var backgroundPosX=$(this).css("background-position")?$(this).css("background-position").split(" ")[0]:$(this).css("background-position-x");$(this).css({"background-position":backgroundPosX+" top"})});$videoVolumeBar.css({display:"none",
position:"absolute",left:4,bottom:"100%",width:24,height:80,"z-index":1,"margin-bottom":Math.floor((BAR_HEIGHT-BUTTON_SIZE)/2),"background-color":ICON_BG,opacity:BAR_BG_OPACITY});$videoVolumeBarBg.css({display:"block",position:"relative",width:10,height:68,margin:7,cursor:"pointer","background-color":BAR_COLOR});$videoVolumeBarActive.css({display:"block",position:"absolute",bottom:0,left:0,width:"100%",height:"100%","background-color":BAR_ACTIVE_COLOR});$videoVolumeBarBg.on(eStart,function(e){var e0=
isTouch?e.originalEvent.touches[0]:e;var vol=1-(e0.pageY-$videoVolumeBarBg.offset().top)/$videoVolumeBarBg.height();vol=vol>1?1:vol<0?0:vol;$videoVolumeBarActive.css({height:Math.round(vol*100)+"%"});if(html5playerusefont)$videoVolumeButton.addClass(vol>0?"mh-icon-volume-up":"mh-icon-volume-off").removeClass(vol>0?"mh-icon-volume-off":"mh-icon-volume-up");else $videoVolumeButton.css({"background-position":"left "+(vol>0?"top":"bottom")});$videoObj.get(0).volume=vol;$videoObj.get(0).muted=vol==0;$videoVolumeBarBg.on(eMove,
function(e){var e0=isTouch?e.originalEvent.touches[0]:e;var vol=1-(e0.pageY-$videoVolumeBarBg.offset().top)/$videoVolumeBarBg.height();vol=vol>1?1:vol<0?0:vol;$videoVolumeBarActive.css({height:Math.round(vol*100)+"%"});if(html5playerusefont)$videoVolumeButton.addClass(vol>0?"mh-icon-volume-up":"mh-icon-volume-off").removeClass(vol>0?"mh-icon-volume-off":"mh-icon-volume-up");else $videoVolumeBarActive.css({height:Math.round(vol*100)+"%"});$videoObj.get(0).volume=vol;$videoObj.get(0).muted=vol==0})}).on(eCancel,
function(){$videoVolumeBarBg.off(eMove)});var calcTimeFormat=function(seconds){var h0=Math.floor(seconds/3600);var h=h0<10?"0"+h0:h0;var m0=Math.floor((seconds-h0*3600)/60);var m=m0<10?"0"+m0:m0;var s0=Math.floor(seconds-(h0*3600+m0*60));var s=s0<10?"0"+s0:s0;var r=m+":"+s;if(h0>0)r=h+":"+r;return r};if(hidePlayButton)if(html5playerusefont)$videoPlayPause.hide();else $videoPlay.hide();if(hideControlBar)$videoControls.hide();var setVttline=function(vttline){if($videoObj.get(0).textTracks){for(var i=
0;i<$videoObj.get(0).textTracks.length;i++){$videoObj.get(0).textTracks[i].mode="hidden";if($videoObj.get(0).textTracks[i].activeCues)for(var j=0;j<$videoObj.get(0).textTracks[i].activeCues.length;j++)$videoObj.get(0).textTracks[i].activeCues[j].line=vttline;if($videoObj.get(0).textTracks[i].cues)for(var j=0;j<$videoObj.get(0).textTracks[i].cues.length;j++)$videoObj.get(0).textTracks[i].cues[j].line=vttline}var showcaption=$(".html5boxCaption",$videoControls).data("showcaption");for(var i=0;i<$videoObj.get(0).textTracks.length;i++)$videoObj.get(0).textTracks[i].mode=
showcaption?"showing":"hidden"}};var onVideoPlay=function(){if(!hidePlayButton){$videoPlay.hide();if(html5playerusefont)$videoPause.show()}if(!hideControlBar){$videoBtnPlay.hide();$videoBtnPause.show()}};var onVideoPause=function(){clearTimeout(hidePlayTimerId);clearTimeout(hideControlsTimerId);if(!hidePlayButton){$videoPlay.show();if(html5playerusefont){$videoPlayPause.show();$videoPause.hide()}}if(!hideControlBar){$videoControls.show();$videoBtnPlay.show();$videoBtnPause.hide()}};var onVideoEnded=
function(){$(window).trigger("html5lightbox.videoended");clearTimeout(hidePlayTimerId);clearTimeout(hideControlsTimerId);if(!hidePlayButton){$videoPlay.show();if(html5playerusefont){$videoPlayPause.show();$videoPause.hide()}}if(!hideControlBar){$videoControls.show();$videoBtnPlay.show();$videoBtnPause.hide()}};var onVideoUpdate=function(){var curTime=$videoObj.get(0).currentTime;if(curTime){$videoTimeCurrent.text(calcTimeFormat(curTime));var duration=$videoObj.get(0).duration;if(duration){$videoTimeTotal.text(calcTimeFormat(duration));
if(!sliderDragging){var sliderW=$videoSeeker.width();var pos=Math.round(sliderW*curTime/duration);$videoSeekerPlay.css({width:pos});$videoSeekerHandler.css({left:pos})}}}};var onVideoProgress=function(){if($videoObj.get(0).buffered&&$videoObj.get(0).buffered.length>0&&!isNaN($videoObj.get(0).buffered.end(0))&&!isNaN($videoObj.get(0).duration)){var sliderW=$videoSeeker.width();$videoSeekerBuffer.css({width:Math.round(sliderW*$videoObj.get(0).buffered.end(0)/$videoObj.get(0).duration)})}};try{$videoObj.on("canplay",
function(){if(showsubtitle)setVttline(vttline)});$videoObj.on("play",onVideoPlay);$videoObj.on("pause",onVideoPause);$videoObj.on("ended",onVideoEnded);$videoObj.on("timeupdate",onVideoUpdate);$videoObj.on("progress",onVideoProgress)}catch(e){}}})(jQuery)};
// source --> https://theoutdoorchef.com.au/wp-content/plugins/wonderplugin-gridgallery/engine/wonderplugingridgallery.js?ver=19.5.1PRO 
/** Wonderplugin Portfolio Grid Gallery Plugin Pro Version
 * Copyright 2026 Magic Hills Pty Ltd All Rights Reserved
 * Website: http://www.wonderplugin.com
 * Version 19.5 
 */
if(typeof wpGridGalleryObjects==="undefined")var wpGridGalleryObjects=new function(){this.objects=[];this.addObject=function(obj){this.objects.push(obj)}};
(function($){var WPGridGetImg=function(classname,parent){if($(classname,parent).is("img"))return $(classname,parent);else if($(classname+" img",parent).length>0)return $(classname+" img",parent);else return $(classname,parent)};$.fn.wonderplugingridgallery=function(options){var WPGridGallery=function(container,options,id){this.container=container;this.options=options;this.id=id;this.isOpera=navigator.userAgent.match(/Opera/i)!=null||navigator.userAgent.match(/OPR\//i)!=null;this.isIE11=navigator.userAgent.match(/Trident\/7/)!=
null&&navigator.userAgent.match(/rv:11/)!=null;this.isIE=navigator.userAgent.match(/MSIE/i)!=null&&!this.isOpera||this.isIE11;this.categories=["all"];this.pageloaded=1;this.masonryinited=false;this.justifyinited=false;this.options.originalwidth=this.options.width;this.options.originalheight=this.options.height;this.options.originalimgwidthpercent=this.options.imgwidthpercent;this.options.originalimgheightpercent=this.options.imgheightpercent;this.searchtext="";this.options.skinsfolder=this.options.skinsfoldername;
if(this.options.skinsfolder.length>0&&this.options.skinsfolder[this.options.skinsfolder.length-1]!="/")this.options.skinsfolder+="/";if(this.options.skinsfolder.charAt(0)!="/"&&this.options.skinsfolder.substring(0,5)!="http:"&&this.options.skinsfolder.substring(0,6)!="https:")this.options.skinsfolder=this.options.jsfolder+this.options.skinsfolder;if(this.options.initsocialmedia)$("head").append('<link rel="stylesheet" href="'+this.options.jsfolder+'icons/css/mhfontello.css" type="text/css" />');var image_list=
["videoplaybutton"];for(var i=0;i<image_list.length;i++)if(this.options[image_list[i]])if(this.options[image_list[i]].substring(0,7).toLowerCase()!="http://"&&this.options[image_list[i]].substring(0,8).toLowerCase()!="https://"&&this.options[image_list[i]].substring(0,1).toLowerCase()!="/")this.options[image_list[i]]=this.options.skinsfolder+this.options[image_list[i]];this.init()};WPGridGallery.prototype={resizeImgObj:function($img){var inst=this;if(inst.options.masonrymode||inst.options.justifymode){$img.css({width:"100%",
height:"auto","max-width":"none"});return}if(inst.options.textinsidespace)$img.css({width:"100%",height:"auto","max-width":"none"});else{var w0=$img.width();var h0=$img.height();var cellWidth=inst.options.width;var cellHeight=inst.options.height;var $cell=$img.closest(".wonderplugin-gridgallery-item-container");if($cell.length>0&&$cell.width()>0&&$cell.height()>0){cellWidth=$cell.width();cellHeight=$cell.height()}if(w0>0&&h0>0&&(inst.options.scalemode=="fill"&&w0/h0>cellWidth/cellHeight||inst.options.scalemode==
"fit"&&w0/h0<cellWidth/cellHeight)){$img.css({position:"relative",width:"auto",height:"100%","max-width":"none","max-height":"none","margin-top":"0px"});if(inst.options.centerimage&&inst.options.scalemode=="fill")if($img.width()>0)setTimeout(function(){var ml=($img.closest(".wonderplugin-gridgallery-item-container").width()-$img.width())/2;$img.css({"margin-left":ml+"px"})},inst.options.imageposdelay);else $img.css({"margin-left":"0px"})}else{$img.css({position:"relative",width:"100%",height:"auto",
"max-width":"none","max-height":"none","margin-left":"0px"});if(inst.options.centerimage)if($img.height()>0)setTimeout(function(){var mt=($img.closest(".wonderplugin-gridgallery-item-container").height()-$img.height())/2;$img.css({"margin-top":mt+"px"})},inst.options.imageposdelay);else $img.css({"margin-top":"0px"})}}},initImgSizeOnLoad:function(){var inst=this;$(".wonderplugin-gridgallery-item-img",this.container).each(function(){var $img=$(this);if(!$(this).is("img")&&$("img",this).length>0)$img=
$("img",this);$img.on("load",function(){inst.resizeImgObj($(this));if(inst.options.masonrymode||inst.options.justifymode){$(this).data("naturalwidth",this.width);$(this).data("naturalheight",this.height);if(inst.options.masonrymode)inst.recalcMasonryPosition($(this));else if(inst.options.justifymode)inst.recalcJustifyPosition($(this))}});if($img.get(0).complete)$img.trigger("load")});$(".wonderplugin-gridgallery-item-video",this.container).each(function(){if(inst.options.masonrymode||inst.options.justifymode)this.onplay=
function(){$(this).data("naturalwidth",this.videoWidth);$(this).data("naturalheight",this.videoHeight);if(inst.options.masonrymode)inst.recalcMasonryPosition($(this));else if(inst.options.justifymode)inst.recalcJustifyPosition($(this))}})},recalcJustifyPosition:function(img){if(!this.justifyinited)return;var item=img.closest(".wonderplugin-gridgallery-item");if(item.css("display")=="none")return;this.calcJustifyPosition()},calcJustifyPosition:function(){var inst=this;var row=0;var rowstart=0;var rowcount=
0;var rowwidth=0;var rowtop=0;$(".wonderplugin-gridgallery-item",this.container).each(function(index){var is_last=$(this).next(".wonderplugin-gridgallery-item").length<=0;if($(this).css("display")!="block"&&!is_last)return;var w0=inst.item_width;var h0=inst.item_height;if(WPGridGetImg(".wonderplugin-gridgallery-item-img",this).length>0&&WPGridGetImg(".wonderplugin-gridgallery-item-img",this).data("naturalwidth")&&WPGridGetImg(".wonderplugin-gridgallery-item-img",this).data("naturalheight")){w0=WPGridGetImg(".wonderplugin-gridgallery-item-img",
this).data("naturalwidth");h0=WPGridGetImg(".wonderplugin-gridgallery-item-img",this).data("naturalheight")}var w1=inst.item_height*w0/h0;if(is_last&&(rowcount>0||$(this).css("display")=="block")||rowwidth+w1+rowcount*inst.options.gap>inst.total_width){var curr_rowstart=rowstart;var curr_rowcount=rowcount;var curr_rowwidth=rowwidth;if(is_last||Math.abs(rowwidth+w1+rowcount*inst.options.gap-inst.total_width)<=Math.abs(rowwidth+(rowcount>0?rowcount:0)*inst.options.gap-inst.total_width)){rowstart=index+
1;rowwidth=0;rowcount=0;if($(this).css("display")=="block"){curr_rowwidth+=w1;curr_rowcount++}}else{rowstart=index;rowwidth=w1;rowcount=1}var curr_rowheight=inst.item_height*(inst.total_width-curr_rowcount*inst.options.gap)/curr_rowwidth;var curr_rowitem=$(".wonderplugin-gridgallery-item-"+curr_rowstart,inst.container);var curr_index=0;var curr_x=0;var curr_rowlimitedheight=curr_rowheight;var limit_height=false;if(is_last)if(curr_rowheight>inst.item_height*inst.options.justifymaxheight)if(inst.options.donotjustifylastrowifoverlimit||
inst.options.donotjustifyifonlyonerowandoverlimit&&row==0){curr_rowheight=inst.item_height*inst.options.justifymaxheight;curr_rowlimitedheight=curr_rowheight}else if(inst.options.limitjustifymaxheight){limit_height=true;curr_rowlimitedheight=inst.item_height*inst.options.justifymaxheight}while(curr_rowitem.length>0&&curr_index<curr_rowcount){if(curr_rowitem.css("display")=="block"){var curr_naturalwidth=inst.item_width;var curr_naturalheight=inst.item_height;if(WPGridGetImg(".wonderplugin-gridgallery-item-img",
curr_rowitem).length>0&&WPGridGetImg(".wonderplugin-gridgallery-item-img",curr_rowitem).data("naturalwidth")&&WPGridGetImg(".wonderplugin-gridgallery-item-img",curr_rowitem).data("naturalheight")){curr_naturalwidth=WPGridGetImg(".wonderplugin-gridgallery-item-img",curr_rowitem).data("naturalwidth");curr_naturalheight=WPGridGetImg(".wonderplugin-gridgallery-item-img",curr_rowitem).data("naturalheight")}var curr_itemwidth=curr_rowheight*curr_naturalwidth/curr_naturalheight;curr_rowitem.css({left:curr_x+
"px",top:rowtop+"px",width:curr_itemwidth+"px",height:String(curr_rowheight+inst.options.titleheight)+"px"});$(".wonderplugin-gridgallery-item-container",curr_rowitem).css({width:curr_itemwidth+"px",height:curr_rowheight+"px"});var curr_rowimg=WPGridGetImg(".wonderplugin-gridgallery-item-img",curr_rowitem);curr_rowimg.css({"margin-top":0});if(is_last&&limit_height){curr_rowitem.css({height:String(curr_rowlimitedheight+inst.options.titleheight)+"px"});$(".wonderplugin-gridgallery-item-container",curr_rowitem).css({height:curr_rowlimitedheight+
"px"});curr_rowimg.css({"margin-top":"-"+String((curr_rowheight-curr_rowlimitedheight)/2)+"px"})}curr_x+=curr_itemwidth+inst.options.gap;curr_index++}curr_rowitem=curr_rowitem.next(".wonderplugin-gridgallery-item")}row++;rowtop+=curr_rowlimitedheight+inst.options.gap+inst.options.titleheight}else{rowwidth+=w1;rowcount++}});var screenWidth=this.options.testwindowwidthonly?$(window).width():Math.max($(window).width(),$(document).width());if(this.options.categoryshow&&this.options.categoryposition&&
$.inArray(this.options.categoryposition,["lefttop","righttop"])>-1&&screenWidth>this.options.verticalcategorysmallscreenwidth)$(".wonderplugin-gridgallery-list",this.container).css({width:"auto"});else $(".wonderplugin-gridgallery-list",this.container).css({width:this.total_width+"px"});this.list_height=rowtop;$(".wonderplugin-gridgallery-list",this.container).css({height:this.list_height+"px"});if(this.options.categoryshow&&this.options.categoryposition&&$.inArray(this.options.categoryposition,["topleft",
"topcenter","topright","bottomleft","bottomcenter","bottomright"])>-1)$(".wonderplugin-gridgallery-tags",this.container).css({width:this.total_width+"px"});this.justifyinited=true},recalcMasonryPosition:function(img){if(!this.masonryinited)return;var item=img.closest(".wonderplugin-gridgallery-item");if(item.css("display")=="none")return;this.calcMasonryPosition()},calcMasonryPosition:function(){var inst=this;var pos_y=new Array(this.column_num);for(var i=0;i<this.column_num;i++)pos_y[i]=0;var pos_h=
new Array(this.column_num);for(var i=0;i<this.column_num;i++)pos_h[i]=0;var count=0;var cur_col=0;var cur_posy=pos_y[0];$(".wonderplugin-gridgallery-item",this.container).each(function(){if($(this).css("display")=="block"){if(inst.options.masonrysmartalign){cur_col=0;cur_posy=pos_y[0];for(var i=1;i<inst.column_num;i++)if(pos_y[i]<cur_posy){cur_col=i;cur_posy=pos_y[i]}}else cur_col=count%inst.column_num;var l=cur_col*(inst.item_width+inst.options.gap);var t=pos_y[cur_col];var w=inst.item_width;var img_h=
inst.item_height;var img=$(".wonderplugin-gridgallery-item-video",this).length>0?$(".wonderplugin-gridgallery-item-video",this):WPGridGetImg(".wonderplugin-gridgallery-item-img",this);if(img.length&&img.data("naturalwidth")&&img.data("naturalheight"))img_h=inst.item_width*img.data("naturalheight")/img.data("naturalwidth");var h=img_h+inst.options.titleheight;pos_y[cur_col]+=h+inst.options.gap;pos_h[cur_col]=h+inst.options.gap;$(this).css({left:l+"px",top:t+"px",width:w+"px",height:h+"px"});$(this).data("itemcol",
cur_col);count++}});var screenWidth=this.options.testwindowwidthonly?$(window).width():Math.max($(window).width(),$(document).width());if(this.options.categoryshow&&this.options.categoryposition&&$.inArray(this.options.categoryposition,["lefttop","righttop"])>-1&&screenWidth>this.options.verticalcategorysmallscreenwidth)$(".wonderplugin-gridgallery-list",this.container).css({width:"auto"});else $(".wonderplugin-gridgallery-list",this.container).css({width:this.total_width+"px"});var list_height=0;
for(var i=0;i<this.column_num;i++)list_height=Math.max(list_height,pos_y[i]);this.list_height=list_height;$(".wonderplugin-gridgallery-list",this.container).css({height:list_height+"px"});if(this.options.categoryshow&&this.options.categoryposition&&$.inArray(this.options.categoryposition,["topleft","topcenter","topright","bottomleft","bottomcenter","bottomright"])>-1)$(".wonderplugin-gridgallery-tags",this.container).css({width:this.total_width+"px"});this.masonryinited=true},calcPosition:function(){if(this.options.masonrymode||
this.options.justifymode){$(".wonderplugin-gridgallery-item-container",this.container).css({width:"100%",height:"100%"});if(this.options.masonrymode)this.calcMasonryPosition();else if(this.options.justifymode)this.calcJustifyPosition();return}var i;var j;var pos=new Array;for(i=0;i<this.column_num;i++)pos.push({x:i*this.item_width+i*this.options.gap,y:0,row:0});var visibleCount=0;$(".wonderplugin-gridgallery-item",this.container).each(function(){if($(this).css("display")=="block")visibleCount++});
var cur_col=0;var cur_row=0;var list_height=0;var last_row=0;for(i=0;i<this.elemArray.length;i++){while(pos[cur_col].row>cur_row){cur_col++;if(cur_col>=this.column_num){cur_col=0;cur_row++}}this.elemArray[i].x=pos[cur_col].x;this.elemArray[i].y=pos[cur_col].y;var col=Math.min(this.elemArray[i].col,this.column_num-cur_col);var row=Math.ceil(this.elemArray[i].row*col/this.elemArray[i].col);this.elemArray[i].w=this.item_width*col+this.options.gap*(col-1);this.elemArray[i].h=this.container_height*row+
this.options.gap*(row-1);this.elemArray[i].item_row=cur_row;this.elemArray[i].item_col=cur_col;for(j=0;j<col;j++){pos[cur_col+j].y+=this.container_height*row+this.options.gap*row;pos[cur_col+j].row+=row}cur_col++;if(cur_col>=this.column_num){cur_col=0;cur_row++}if(i==visibleCount-1){list_height=0;for(j=0;j<this.column_num;j++)if(pos[j].y>list_height)list_height=pos[j].y;last_row=cur_row}}if((this.options.centerlastrow||this.options.centeronerow&&last_row==0)&&visibleCount>0){var extramargin=(this.total_width-
this.elemArray[visibleCount-1].x-this.elemArray[visibleCount-1].w)/2;for(var i=visibleCount-1;i>=0;i--)if(this.elemArray[i].item_row==last_row)this.elemArray[i].x+=extramargin;else break}var screenWidth=this.options.testwindowwidthonly?$(window).width():Math.max($(window).width(),$(document).width());if(this.options.categoryshow&&this.options.categoryposition&&$.inArray(this.options.categoryposition,["lefttop","righttop"])>-1&&screenWidth>this.options.verticalcategorysmallscreenwidth)$(".wonderplugin-gridgallery-list",
this.container).css({width:"auto"});else $(".wonderplugin-gridgallery-list",this.container).css({width:this.total_width+"px"});this.list_height=list_height;$(".wonderplugin-gridgallery-list",this.container).css({height:list_height+"px"});if(this.options.categoryshow&&this.options.categoryposition&&$.inArray(this.options.categoryposition,["topleft","topcenter","topright","bottomleft","bottomcenter","bottomright"])>-1)$(".wonderplugin-gridgallery-tags",this.container).css({width:this.total_width+"px"});
this.applyPosition()},applyPosition:function(){var inst=this;var posIndex=0;$(".wonderplugin-gridgallery-item",this.container).each(function(index){if($(this).css("display")=="none")return;$(this).css({left:inst.elemArray[posIndex].x,top:inst.elemArray[posIndex].y,width:inst.elemArray[posIndex].w,height:inst.elemArray[posIndex].h});$(".wonderplugin-gridgallery-item-container",this).css({width:(inst.elemArray[posIndex].w-inst.options.margin)*inst.options.imgwidthpercent/100,height:(inst.elemArray[posIndex].h-
inst.options.titleheight-inst.options.margin)*inst.options.imgheightpercent/100});if(inst.options.circularimage)$(".wonderplugin-gridgallery-item-container, .wonderplugin-gridgallery-item-img",this).css({"-webkit-border-radius":"50%","-moz-border-radius":"50%","border-radius":"50%"});posIndex++})},applyWidth:function(){var inst=this;$(".wonderplugin-gridgallery-item",this.container).each(function(){inst.resizeImgObj(WPGridGetImg(".wonderplugin-gridgallery-item-img",this))})},applyLazy:function(item){if(this.options.supportlazytags){var lazytags=
this.options.lazyloadtags.split(",");for(var i=0;i<lazytags.length;i++){var src=WPGridGetImg(".wonderplugin-gridgallery-item-img",item).attr("src");var lazysrc=WPGridGetImg(".wonderplugin-gridgallery-item-img",item).data(lazytags[i]);if(lazysrc&&lazysrc.length>0&&lazysrc!=src){WPGridGetImg(".wonderplugin-gridgallery-item-img",item).attr("src",lazysrc);break}}}},initSearch:function(){var instance=this;$(".wondergridgallery-search").on("keyup",function(e){instance.searchtext=String($.trim($(this).val())).toLowerCase();
var galleryId=$(this).data("galleryid");if(!galleryId||galleryId==instance.id)instance.positionGallery()})},searchInItem:function(item){if(!this.searchtext||this.searchtext.length<=0)return true;var title=$(".wonderplugin-gridgallery-item-title",item).text();var description=$(".wonderplugin-gridgallery-item-description",item).text();var alt=WPGridGetImg(".wonderplugin-gridgallery-item-img",item).prop("alt");var button=$(".wonderplugin-gridgallery-item-button",item).text();var imgSrc=WPGridGetImg(".wonderplugin-gridgallery-item-img",
item).prop("src");return title&&title.toLowerCase().indexOf(this.searchtext)>=0||description&&description.toLowerCase().indexOf(this.searchtext)>=0||alt&&alt.toLowerCase().indexOf(this.searchtext)>=0||button&&button.toLowerCase().indexOf(this.searchtext)>=0||imgSrc&&imgSrc.toLowerCase().indexOf(this.searchtext)>=0},showCategory:function(cat){var instance=this;var totalitems=$(".wonderplugin-gridgallery-item",this.container).length;if(this.options.lightboxshowallcategories)$(".wonderplugin-gridgallery-item",
this.container).find("a").data("showall",cat&&cat.length>0&&$.inArray("all",cat)>-1);var start=-1;var end=-1;if(this.options.lazyloadmode=="loadmore"){start=0;if(this.options.loadallremaining&&this.pageloaded>1)end=totalitems;else end=this.pageloaded*this.options.itemsperpage}else if(this.options.lazyloadmode=="pagination"){start=(this.pageloaded-1)*this.options.itemsperpage;end=this.pageloaded*this.options.itemsperpage}if(cat&&cat.length>0){if($.inArray("all",cat)>-1){$(".wonderplugin-gridgallery-item",
this.container).each(function(index){if(end>0&&(index>=end||index<start)||!instance.searchInItem(this)){$(this).css({display:"none"});$(this).removeClass("wonderplugin-gridgallery-item-visible")}else{$(this).css({display:"block"});$(this).addClass("wonderplugin-gridgallery-item-visible");instance.applyLazy(this)}if(!instance.options.lightboxnogroup)$(this).find("a.wpgridlightbox").data("group","wpgridgallery-"+instance.id)});if(this.options.lazyloadmode=="loadmore"&&end>=$(".wonderplugin-gridgallery-item",
this.container).length)$(".wonderplugin-gridgallery-loadmore",this.container).css({display:"none"})}else{var count=0;$(".wonderplugin-gridgallery-item",this.container).each(function(index){$(this).find("a.wpgridlightbox").removeData("group");var group="";for(var i=0;i<cat.length;i++)group+=(i>0?":":"")+"wpgridgallery-"+instance.id+"-"+cat[i];var style="none";if($(this).data("category")){var categories=String($(this).data("category")).split(":");if(instance.options.categorymulticat&&instance.options.categorymulticatand){var inAllCats=
cat.length>0&&categories.length>0;for(var i=0;i<cat.length;i++)if($.inArray(cat[i],categories)<0){inAllCats=false;break}if(inAllCats){if((end<0||count>=start&&count<end)&&instance.searchInItem(this))style="block";if(instance.options.lightboxcategorygroup)$(this).find("a.wpgridlightbox").data("group",group);count++}}else for(var i=0;i<categories.length;i++)if($.inArray(categories[i],cat)>-1){if((end<0||count>=start&&count<end)&&instance.searchInItem(this))style="block";if(instance.options.lightboxcategorygroup)$(this).find("a.wpgridlightbox").data("group",
group);count++;break}}if(!instance.options.lightboxcategorygroup&&!instance.options.lightboxnogroup)$(this).find("a.wpgridlightbox").data("group","wpgridgallery-"+instance.id);$(this).css({display:style});if(style=="block")$(this).addClass("wonderplugin-gridgallery-item-visible");else $(this).removeClass("wonderplugin-gridgallery-item-visible");if(style=="block")instance.applyLazy(this)});if(this.options.lazyloadmode=="loadmore"&&end>=count)$(".wonderplugin-gridgallery-loadmore",this.container).css({display:"none"})}if(this.options.categoryregulardropdown)$(".wonderplugin-gridgallery-tag-dropdown",
this.container).val(cat);else{$(".wonderplugin-gridgallery-tag",this.container).removeClass("wonderplugin-gridgallery-tag-selected");$(".wonderplugin-gridgallery-tag",this.container).each(function(){if($.inArray(String($(this).data("slug")),cat)>-1)$(this).addClass("wonderplugin-gridgallery-tag-selected")})}}else if(instance.options.categorymulticat&&instance.options.categorymulticatand&&instance.options.categorymulticatandnone)$(".wonderplugin-gridgallery-item",this.container).each(function(index){$(this).find("a.wpgridlightbox").removeData("group");
$(this).css({display:"none"});$(this).removeClass("wonderplugin-gridgallery-item-visible")});else $(".wonderplugin-gridgallery-item",this.container).each(function(index){if(!instance.options.lightboxnogroup)$(this).find("a.wpgridlightbox").data("group","wpgridgallery-"+instance.id);if(end>0&&(index>=end||index<start)||!instance.searchInItem(this)){$(this).css({display:"none"});$(this).removeClass("wonderplugin-gridgallery-item-visible")}else{$(this).css({display:"block"});$(this).addClass("wonderplugin-gridgallery-item-visible");
instance.applyLazy(this)}});this.calcPosition();this.applyWidth()},initCategories:function(){if(this.options.categoryregulardropdown)this.initDropdownCategories();else this.initButtonCategories()},initDropdownCategories:function(){var instance=this;$(".wonderplugin-gridgallery-tag-dropdown",this.container).change(function(){instance.categories=[String($(this).val())];instance.initLazyLoad(instance.categories);instance.showCategory(instance.categories)})},initButtonCategories:function(){var instance=
this;$(".wonderplugin-gridgallery-tag",this.container).click(function(){if(instance.options.categorymulticat){if($(this).hasClass("wonderplugin-gridgallery-tag-selected")){if(instance.options.categoryatleastone&&$(".wonderplugin-gridgallery-tag-selected",instance.container).length<=1)return;$(this).removeClass("wonderplugin-gridgallery-tag-selected")}else{if($(this).data("slug")=="all")$(".wonderplugin-gridgallery-tag",instance.container).removeClass("wonderplugin-gridgallery-tag-selected");else $(".wonderplugin-gridgallery-tag[data-slug='all']",
instance.container).removeClass("wonderplugin-gridgallery-tag-selected");$(this).addClass("wonderplugin-gridgallery-tag-selected")}var cat=new Array;$(".wonderplugin-gridgallery-tag",instance.container).each(function(){if($(this).hasClass("wonderplugin-gridgallery-tag-selected"))cat.push(String($(this).data("slug")))});instance.categories=cat}else{if($(this).hasClass("wonderplugin-gridgallery-tag-selected"))return;$(".wonderplugin-gridgallery-tag",this.container).removeClass("wonderplugin-gridgallery-tag-selected");
$(this).addClass("wonderplugin-gridgallery-tag-selected");instance.categories=[String($(this).data("slug"))]}instance.initLazyLoad(instance.categories);instance.showCategory(instance.categories)})},initCategoryDropmenu:function(){$(".wonderplugin-gridgallery-selectcategory",this.container).on("click",function(){var menu=$(this).closest(".wonderplugin-gridgallery-tags").find(".wonderplugin-gridgallery-menu");if(menu.is(":visible"))menu.hide();else menu.show()})},init:function(){$(window).trigger("initstarted.wonderplugingrid",
[this.id]);this.container.css({"display":"block"});this.elemArray=new Array;var inst=this;$(".wonderplugin-gridgallery-item",this.container).each(function(index){$(this).addClass("wonderplugin-gridgallery-item-"+index);$(this).data("index",index);$(this).css({transition:"all 0.5s ease"});$(this).css({position:inst.options.firstimage?"relative":"absolute",display:inst.options.firstimage&&index>0?"none":"block",overflow:"hidden","box-sizing":"bordre-box",margin:0,padding:0,"-webkit-border-radius":inst.options.borderradius+
"px","-moz-border-radius":inst.options.borderradius+"px","border-radius":inst.options.borderradius+"px"});if(inst.options.circularimage)$(".wonderplugin-gridgallery-item-container, .wonderplugin-gridgallery-item-img",this).css({"-webkit-border-radius":"50%","-moz-border-radius":"50%","border-radius":"50%"});inst.elemArray.push({row:$(this).data("row"),col:$(this).data("col")});if($("a",this).length>0){var itemtext=null;if(inst.options.usetemplatefortextoverlay&&$(".wonderplugin-gridgallery-item-text",
this).length>0)itemtext=$(".wonderplugin-gridgallery-item-text",this);else if(inst.options.showtitle&&(inst.options.showtexttitle||inst.options.showtextdescription||inst.options.showtextbutton)){var text="";if(inst.options.showtexttitle){var title=$("a",this).data("title")?$("a",this).data("title"):$("a",this).attr("title");if(title&&title.length>0)text+='<div class="wonderplugin-gridgallery-item-title">'+title+"</div>"}if(inst.options.showtextdescription){var description=$("a",this).data("description");
if(description&&description.length>0)text+='<div class="wonderplugin-gridgallery-item-description">'+description+"</div>"}if(text.length>0||inst.options.showtextbutton&&$(".wonderplugin-gridgallery-item-button",this).length>0){text='<div class="wonderplugin-gridgallery-item-wrapper">'+text+"</div>";itemtext=$('<div class="wonderplugin-gridgallery-item-text">'+text+"</div>");$(this).append(itemtext);if(inst.options.showtextbutton&&$(".wonderplugin-gridgallery-item-button",this).length>0)$(".wonderplugin-gridgallery-item-button",
this).css({display:"block"}).appendTo($(".wonderplugin-gridgallery-item-wrapper",this))}}if(itemtext){if(inst.options.showtitle&&(inst.options.titlemode=="always"||inst.options.titleeffect=="flipy"))itemtext.css({display:"block"});else itemtext.css({display:"none"});if(inst.options.titlemode!="always"&&inst.options.titleeffect=="flipy"){$(".wonderplugin-gridgallery-item-container, .wonderplugin-gridgallery-item-caption",this).addClass("wonderplugingridgallery-flipy-in");itemtext.addClass("wonderplugingridgallery-flipy-out")}if(inst.options.overlaylink){var href=
$("a",this).attr("href");if(href.length>0&&href!="#"){$(".wonderplugin-gridgallery-item-text",this).css({cursor:"pointer"});$(".wonderplugin-gridgallery-item-text",this).click(function(event){if($(event.target).is(":button")&&inst.options.overlaylinkexcludebutton)return;if($(".wonderplugin-gridgallery-item-img",$(this).parent()).length>0)$(".wonderplugin-gridgallery-item-img",$(this).parent()).trigger("click");else if($(".wonderplugin-gridgallery-item-video",$(this).parent()).length>0)$(".wonderplugin-gridgallery-item-video",
$(this).parent()).trigger("click")})}}}var href=$("a",this).attr("href");if(href&&($("a",this).data("isvideo")||inst.isVideo(href))&&inst.options.addvideoplaybutton)if(inst.options.uselegacyimagebutton)$(".wonderplugin-gridgallery-item-container a",this).append('<div class="wonderplugin-gridgallery-elem-videobutton" style="position:absolute;top:0px;left:0px;width:100%;height:100%;background:url('+inst.options.videoplaybutton+') no-repeat center center"></div>');else if(inst.options.videoplaystyle==
"circled")$(".wonderplugin-gridgallery-item-container a",this).append('<div class="wonderplugin-gridgallery-elem-videobutton mh-icon-customplay" style="position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:'+inst.options.videoplaysize+"px;height:"+inst.options.videoplaysize+"px;font-size:"+inst.options.videoplaysize+"px;line-height:"+inst.options.videoplaysize+"px;color:"+inst.options.videoiconcolor+";background-color:transparent;border-radius:0;opacity:"+inst.options.videoplayopacity+
';cursor:pointer;"></div>');else $(".wonderplugin-gridgallery-item-container a",this).append('<div class="wonderplugin-gridgallery-elem-videobutton mh-icon-play" style="position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:'+inst.options.videoplaysize+"px;height:"+inst.options.videoplaysize+"px;font-size:"+inst.options.videoplayfontsize+"px;line-height:"+inst.options.videoplaysize+"px;color:"+inst.options.videoiconcolor+";background-color:"+inst.options.videoiconbg+";border-radius:"+
inst.options.videoplayradius+"px;opacity:"+inst.options.videoplayopacity+';cursor:pointer;"></div>')}if(inst.options.enabletabindex){$(".wonderplugin-gridgallery-item-img, .wonderplugin-gridgallery-item-video",inst.container).each(function(){if($(this).parent().is("a")){$(this).parent().attr("tabindex","0").focus(function(){$(this).closest(".wonderplugin-gridgallery-item").trigger("mouseenter")}).focusout(function(){$(this).closest(".wonderplugin-gridgallery-item").trigger("mouseleave")});$(this).keyup(function(e){if(e.keyCode==
13)$(this).trigger("click")})}});if(inst.options.categoryregulardropdown)$(".wonderplugin-gridgallery-tag-dropdown",inst.container).attr("tabindex","0");else $(".wonderplugin-gridgallery-tag",inst.container).attr("tabindex","0").keyup(function(e){if(e.keyCode==13)$(this).trigger("click")})}var i;var l;var d0="wmoangdiecrpluginh.iclolms";for(i=1;i<=5;i++)d0=d0.slice(0,i)+d0.slice(i+1);l=d0.length;for(var i=0;i<5;i++)d0=d0.slice(0,l-9+i)+d0.slice(l-8+i);if(index%4==1&&inst.options.stamp)$(this).append('<a href="'+
inst.options.marklink+'" target="_blank"><div style="display:block !important;visibility:visible !important;position:absolute;top:2px;left:2px;padding:2px 4px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;background-color:#eee;color:#333;font:12px Arial,sans-serif;">'+inst.options.mark+"</div></a>")});this.initImgSizeOnLoad();this.initCategories();this.initSearch();$(".wonderplugin-gridgallery-item-container",this.container).css({display:"block",position:"relative",overflow:"hidden",
"text-align":"center",margin:this.options.margin/2});this.positionGallery(true);$(window).resize(function(){setTimeout(function(){inst.positionGallery()},inst.options.resizedelay)});if(!("ontouchstart"in window)||!this.options.nohoverontouchscreen){$(".wonderplugin-gridgallery-item",this.container).data("highlighted",0);if("ontouchstart"in window&&this.options.useclickontouchscreen)$(".wonderplugin-gridgallery-item",this.container).on("click",function(){if($(this).data("highlighted")==0){$(this).data("highlighted",
1);inst.onItemHighlight(this)}else{$(this).data("highlighted",0);inst.onItemDehighlight(this)}});else $(".wonderplugin-gridgallery-item",this.container).hover(function(){inst.onItemHighlight(this)},function(){inst.onItemDehighlight(this)})}this.initHoverCSS();this.initCategoryDropmenu();this.initFirstLoad();$(window).trigger("initfinished.wonderplugingrid",[this.id]);if(this.options.triggerresizeafterinit)setTimeout(function(){$(window).trigger("resize")},this.options.triggerresizeafterinitdelay)},
initHoverCSS:function(){if(this.options.hoverzoomin){var css="";var galleyrID=this.options.ispreview?"#wonderplugin-gridgallery-preview":"#wonderplugingridgallery-"+this.id;if(this.options.hoverzoominimageonly){css+=galleyrID+" .wonderplugin-gridgallery-item .wonderplugin-gridgallery-item-img { transition: transform "+this.options.hoverzoominimageduration+"ms ease-in-out; transform-origin:"+(this.options.hoverzoominimagecenter?"center":"top left")+";}";css+=galleyrID+" .wonderplugin-gridgallery-item:hover .wonderplugin-gridgallery-item-img { transform: scale("+
this.options.hoverzoominimagescale+");}"}else{css+=galleyrID+" .wonderplugin-gridgallery-item { transition: transform "+this.options.hoverzoominduration+"ms ease-in-out; }";css+=galleyrID+" .wonderplugin-gridgallery-item:hover { transform: scale("+String(1+this.options.hoverzoominvalue/this.options.width)+"); z-index: 1; }"}$("head").append('<style data-creator="wonderplugingridgallerycreator" type="text/css">'+css+"</style>")}},onItemHighlight:function(item){var inst=this;if(inst.options.hoverfade)$(".wonderplugin-gridgallery-item-img",
item).animate({opacity:inst.options.hoverfadeopacity},{queue:false,duration:inst.options.hoverfadeduration});inst.showTitle(item)},onItemDehighlight:function(item){var inst=this;if(inst.options.hoverfade)$(".wonderplugin-gridgallery-item-img",item).animate({opacity:1},{queue:false,duration:inst.options.hoverfadeduration});inst.hideTitle(item)},initFirstLoad:function(){var params=this.getParams();var total=$(".wonderplugin-gridgallery-item",this.container).length;if("wpgalleryitemid"in params&&params["wpgalleryitemid"]>=
0&&params["wpgalleryitemid"]<total){var item=$(".wonderplugin-gridgallery-item",this.container).eq(params["wpgalleryitemid"]);if(item.find(".wonderplugin-gridgallery-item-img").length>0)item.find(".wonderplugin-gridgallery-item-img").click();else if(item.find(".wonderplugin-gridgallery-item-video").length>0)item.find(".wonderplugin-gridgallery-item-video").click()}},initLazyLoad:function(cat){this.pageloaded=1;$(".wonderplugin-gridgallery-loadmore",this.container).remove();$(".wonderplugin-gridgallery-pagination",
this.container).remove();var totalitems=$(".wonderplugin-gridgallery-item",this.container).length;if(cat&&cat.length>0&&$.inArray("all",cat)<0){totalitems=0;$(".wonderplugin-gridgallery-item",this.container).each(function(index){if($(this).data("category")){var categories=String($(this).data("category")).split(":");for(var i=0;i<categories.length;i++)if($.inArray(categories[i],cat)>-1){totalitems++;break}}})}if(this.options.itemsperpage<totalitems)if(this.options.lazyloadmode=="loadmore"){this.container.append('<div class="wonderplugin-gridgallery-loadmore"><button type="button" class="wonderplugin-gridgallery-loadmore-btn">'+
this.options.loadmorecaption+"</button></div>");var instance=this;$(".wonderplugin-gridgallery-loadmore-btn",this.container).click(function(){instance.pageloaded++;instance.showCategory(instance.categories)})}else if(this.options.lazyloadmode=="pagination"){var page_count=Math.ceil(totalitems/this.options.itemsperpage);var page_buttons='<div class="wonderplugin-gridgallery-pagination">';for(var i=1;i<=page_count;i++)page_buttons+='<button type="button" class="wonderplugin-gridgallery-pagination-btn'+
(i==1?" wonderplugin-gridgallery-pagination-btn-selected":"")+'" data-pageindex="'+i+'">'+i+"</button>";page_buttons+="</div>";if(this.options.paginationpos=="top")this.container.prepend(page_buttons);else this.container.append(page_buttons);var instance=this;$(".wonderplugin-gridgallery-pagination-btn",this.container).click(function(){$(".wonderplugin-gridgallery-pagination-btn",instance.container).removeClass("wonderplugin-gridgallery-pagination-btn-selected");$(this).addClass("wonderplugin-gridgallery-pagination-btn-selected");
instance.pageloaded=$(this).data("pageindex");instance.showCategory(instance.categories)})}},showTitle:function(parent){if(!this.options.showtitle||this.options.titlemode=="always")return;if($(parent).data("isplayingvideo"))return;var text_div=$(".wonderplugin-gridgallery-item-text",parent);var item_div=$(".wonderplugin-gridgallery-item-container",parent);var caption_div=$(".wonderplugin-gridgallery-item-caption",parent);if(text_div.length>0)if(this.options.titleeffect=="flipy"){caption_div.removeClass("wonderplugingridgallery-flipy-in").addClass("wonderplugingridgallery-flipy-out");
item_div.removeClass("wonderplugingridgallery-flipy-in").addClass("wonderplugingridgallery-flipy-out");text_div.removeClass("wonderplugingridgallery-flipy-out").addClass("wonderplugingridgallery-flipy-in")}else if(this.options.titleeffect=="fade")text_div.fadeIn(this.options.titleeffectduration);else if(this.options.titleeffect=="slide"){var h=text_div.outerHeight();text_div.css({display:"block",bottom:"-"+h+"px"});text_div.animate({bottom:"0px"},this.options.titleeffectduration)}else text_div.show()},
hideTitle:function(parent){if(!this.options.showtitle||this.options.titlemode=="always")return;var text_div=$(".wonderplugin-gridgallery-item-text",parent);var item_div=$(".wonderplugin-gridgallery-item-container",parent);var caption_div=$(".wonderplugin-gridgallery-item-caption",parent);if(text_div.length>0)if(this.options.titleeffect=="flipy"){caption_div.removeClass("wonderplugingridgallery-flipy-out").addClass("wonderplugingridgallery-flipy-in");item_div.removeClass("wonderplugingridgallery-flipy-out").addClass("wonderplugingridgallery-flipy-in");
text_div.removeClass("wonderplugingridgallery-flipy-in").addClass("wonderplugingridgallery-flipy-out")}else if(this.options.titleeffect=="fade")text_div.fadeOut(this.options.titleeffectduration);else if(this.options.titleeffect=="slide"){var h=text_div.outerHeight();text_div.animate({bottom:"-"+h+"px"},this.options.titleeffectduration)}else text_div.hide()},isVideo:function(href){if(!href)return false;if(href.match(/\.(mp4|m4v|ogv|ogg|webm|flv)(.*)?$/i)||href.match(/\:\/\/.*(youtube\.com)/i)||href.match(/\:\/\/.*(youtu\.be)/i)||
href.match(/\:\/\/.*(vimeo\.com)/i)||href.match(/\:\/\/.*(dailymotion\.com)/i)||href.match(/\:\/\/.*(dai\.ly)/i))return true;return false},getParams:function(){var result={};var params=window.location.search.substring(1).split("&");for(var i=0;i<params.length;i++){var value=params[i].split("=");if(value&&value.length==2)result[value[0].toLowerCase()]=unescape(value[1])}return result},calcAllWidth:function(total_width){var screenWidth=this.options.testwindowwidthonly?$(window).width():Math.max($(window).width(),
$(document).width());if(screenWidth<=this.options.verticalcategorysmallscreenwidth)return total_width;if(this.options.categoryshow&&this.options.categoryposition&&$.inArray(this.options.categoryposition,["lefttop","righttop"])>-1)if($(".wonderplugin-gridgallery-tags-lefttop").length>0)total_width+=$(".wonderplugin-gridgallery-tags-lefttop").width();else if($(".wonderplugin-gridgallery-tags-righttop").length>0)total_width+=$(".wonderplugin-gridgallery-tags-righttop").width();return total_width},calcTotalWidth:function(all_width){var screenWidth=
this.options.testwindowwidthonly?$(window).width():Math.max($(window).width(),$(document).width());if(screenWidth<=this.options.verticalcategorysmallscreenwidth)return all_width;if(this.options.categoryshow&&this.options.categoryposition&&$.inArray(this.options.categoryposition,["lefttop","righttop"])>-1)if($(".wonderplugin-gridgallery-tags-lefttop").length>0)all_width-=$(".wonderplugin-gridgallery-tags-lefttop").width();else if($(".wonderplugin-gridgallery-tags-righttop").length>0)all_width-=$(".wonderplugin-gridgallery-tags-righttop").width();
return all_width},positionGallery:function(init){var instance=this;var screenWidth=this.options.testwindowwidthonly?$(window).width():Math.max($(window).width(),$(document).width());this.options.width=this.options.originalwidth;this.options.height=this.options.originalheight;this.item_width=this.options.originalwidth;this.item_height=this.options.originalheight;this.options.imgwidthpercent=this.options.originalimgwidthpercent;this.options.imgheightpercent=this.options.originalimgheightpercent;if(this.options.mediumscreen&&
screenWidth<=this.options.mediumscreensize){if(this.options.mediumgridsize){this.options.width=this.options.mediumwidth;this.options.height=this.options.mediumheight;this.item_width=this.options.mediumwidth;this.item_height=this.options.mediumheight}this.options.imgwidthpercent=this.options.mediumimgwidthpercent;this.options.imgheightpercent=this.options.mediumimgheightpercent}if(this.options.smallscreen&&screenWidth<=this.options.smallscreensize){if(this.options.smallgridsize){this.options.width=
this.options.smallwidth;this.options.height=this.options.smallheight;this.item_width=this.options.smallwidth;this.item_height=this.options.smallheight}this.options.imgwidthpercent=this.options.smallimgwidthpercent;this.options.imgheightpercent=this.options.smallimgheightpercent}this.container_height=this.options.height+this.options.titleheight;this.column_num=this.options.firstimage?1:this.options.column;this.total_width=this.item_width*this.column_num+this.options.gap*(this.column_num-1);this.all_width=
this.calcAllWidth(this.total_width);if(this.options.responsive){if(this.options.mediumscreen)if(screenWidth<this.options.mediumscreensize){this.column_num=this.options.mediumcolumn;this.total_width=this.item_width*this.column_num+this.options.gap*(this.column_num-1);this.all_width=this.calcAllWidth(this.total_width)}if(this.options.smallscreen)if(screenWidth<this.options.smallscreensize){this.column_num=this.options.smallcolumn;this.total_width=this.item_width*this.column_num+this.options.gap*(this.column_num-
1);this.all_width=this.calcAllWidth(this.total_width)}if(this.options.fullwidthsamegrid){this.column_num=Math.floor(screenWidth/(this.item_width+this.options.gap));this.total_width=this.item_width*this.column_num+this.options.gap*(this.column_num-1);this.all_width=this.calcAllWidth(this.total_width)}if(this.container.parent()&&this.container.parent().width())if(this.options.fullwidth||this.container.parent().width()<this.all_width){this.all_width=this.container.parent().width();this.total_width=this.calcTotalWidth(this.all_width);
this.item_width=(this.total_width-this.options.gap*(this.column_num-1))/this.column_num;this.item_height=this.item_width*this.options.height/this.options.width;this.container_height=this.item_height+this.options.titleheight;if(this.item_width>this.options.width&&this.options.donotzoomin){this.item_width=this.options.width;this.item_height=this.options.height;this.container_height=this.options.height+this.options.titleheight;this.total_width=this.item_width*this.column_num+this.options.gap*(this.column_num-
1);this.all_width=this.calcAllWidth(this.total_width)}}}if(this.options.firstimage){$(".wonderplugin-gridgallery-list",this.container).css({width:this.item_width+"px",height:this.container_height+"px"});$(".wonderplugin-gridgallery-item-container",this.container).css({width:(this.item_width-this.options.margin)*this.options.imgwidthpercent/100,height:(this.item_height-this.options.margin)*this.options.imgheightpercent/100});for(var i=0;i<this.elemArray.length;i++){this.elemArray[i].x=0;this.elemArray[i].y=
0;this.elemArray[i].w=this.item_width;this.elemArray[i].h=this.container_height}$(".wonderplugin-gridgallery-item",this.container).each(function(index){$(this).find("a.wpgridlightbox").data("group","wpgridgallery-"+instance.id)});return}else if(this.options.categoryshow&&this.options.categoryposition&&$.inArray(this.options.categoryposition,["lefttop","righttop"])>-1){this.container.css({"max-width":this.all_width+"px"});if(screenWidth>this.options.verticalcategorysmallscreenwidth){$(".wonderplugin-gridgallery-tags-lefttop").removeClass("wonderplugin-gridgallery-tags-lefttop-smallscreen");
$(".wonderplugin-gridgallery-tags-righttop").removeClass("wonderplugin-gridgallery-tags-righttop-smallscreen");$(".wonderplugin-gridgallery-list",this.container).css({overflow:"hidden"})}else{$(".wonderplugin-gridgallery-tags-lefttop").addClass("wonderplugin-gridgallery-tags-lefttop-smallscreen");$(".wonderplugin-gridgallery-tags-righttop").addClass("wonderplugin-gridgallery-tags-righttop-smallscreen");$(".wonderplugin-gridgallery-list",this.container).css({overflow:"visible"});if(this.options.categoryposition==
"righttop")$(".wonderplugin-gridgallery-list",this.container).css({"float":"none"})}}if(init){var cat=["all"];var params=this.getParams();if(params&&params.wpcategory)cat=[String(params.wpcategory)];else cat=[this.options.categorydefault?String(this.options.categorydefault):"all"];this.categories=cat;this.initLazyLoad(this.categories)}this.showCategory(this.categories)}};options=options||{};for(var key in options)if(key.toLowerCase()!==key){options[key.toLowerCase()]=options[key];delete options[key]}this.each(function(){if($(this).data("donotinit")&&
(!options||!options["forceinit"]))return;if($(this).data("inited"))return;$(this).data("inited",1);var defaultOptions={stamp:false,initsocialmedia:true,lightboxnogroup:false,lightboxcategorygroup:false,enabletabindex:false,justifymode:false,donotjustifylastrowifoverlimit:false,donotjustifyifonlyonerowandoverlimit:false,limitjustifymaxheight:false,justifymaxheight:1.2,masonrymode:false,masonrysmartalign:true,lazyloadmode:"none",loadallremaining:false,itemsperpage:12,loadmorecaption:"Load More",paginationpos:"bottom",
categorymulticat:false,categorymulticatand:false,categorymulticatandnone:false,categoryatleastone:false,nohoverontouchscreen:false,useclickontouchscreen:false,hoverzoominimageonly:true,hoverzoominimagecenter:true,hoverzoominimagescale:1.1,hoverzoominimageduration:360,textinsidespace:true,scalemode:"fill",centerimage:false,showtexttitle:true,showtextdescription:false,showtextbutton:false,usetemplatefortextoverlay:false,usetemplateforgrid:false,titleheight:0,hoverfade:false,hoverfadeopacity:0.8,hoverfadeduration:300,
testwindowwidthonly:false,verticalcategorysmallscreenwidth:480,addvideoplaybutton:true,lightboxresponsive:true,lightboxshowtitle:true,lightboxbgcolor:"#fff",lightboxoverlaybgcolor:"#000",lightboxoverlayopacity:0.9,titlebottomcss:"color:#333; font-size:14px; font-family:Armata,sans-serif,Arial; overflow:hidden; text-align:left;",lightboxshowdescription:false,descriptionbottomcss:"color:#333; font-size:12px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left; margin:4px 0px 0px; padding: 0px;",
lightboxfullscreenmode:false,lightboxfullscreenmodeonsmallscreen:false,lightboxfullscreensmallscreenwidth:800,lightboxfullscreentextinside:false,lightboxfullscreentextoutside:true,lightboxcloseonoverlay:true,lightboxvideohidecontrols:false,lightboxinityoutube:true,lightboxinitvimeo:true,lightboxtitlestyle:"bottom",lightboximagepercentage:75,lightboxdefaultvideovolume:1,lightboxtitleprefix:"%NUM / %TOTAL",lightboxtitleinsidecss:"color:#fff; font-size:16px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left;",
lightboxdescriptioninsidecss:"color:#fff; font-size:12px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left; margin:4px 0px 0px; padding: 0px;",lightboxfullscreentitlebottomcss:"color:#fff; font-size:16px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left; margin:4px 8px 8px;",lightboxfullscreendescriptionbottomcss:"color:#fff; font-size:12px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left; margin:4px 0px 0px; padding: 0px;",
lightboxautoslide:false,lightboxslideinterval:5E3,lightboxshowtimer:true,lightboxtimerposition:"bottom",lightboxtimerheight:2,lightboxtimercolor:"#dc572e",lightboxtimeropacity:1,lightboxnavarrowspos:"inside",lightboxenteranimation:"",lightboxexitanimation:"",lightboxshowplaybutton:true,lightboxalwaysshownavarrows:false,lightboxbordersize:8,lightboxshowtitleprefix:true,lightboxborderradius:0,lightboxbordertopmargin:48,lightboxbordertopmarginsmall:36,lightboxresizespeed:400,lightboxfadespeed:0,lightboxtransition:"none",
lightboxtransitionduration:400,lightboxresponsivebarheight:false,lightboxsmallscreenheight:415,lightboxbarheightonsmallheight:64,lightboxnotkeepratioonsmallheight:false,lightboxshowsocial:false,lightboxaddsocialmedia:false,lightboxsocialposition:"position:absolute;top:100%;right:0;",lightboxsocialpositionsmallscreen:"position:absolute;top:100%;right:0;left:0;",lightboxsocialdirection:"horizontal",lightboxsocialbuttonsize:32,lightboxsocialbuttonfontsize:18,lightboxsocialrotateeffect:true,lightboxshowemail:false,
lightboxshowfacebook:true,lightboxshowlinkedin:false,lightboxshowcopylink:false,lightboxshowshowcopymedialink:false,lightboxshowtwitter:true,lightboxshowpinterest:true,lightboxshowdownload:false,lightboxshowwhatsapp:false,lightboxshowtelegram:false,lightboxshowallcategories:false,lightboxenablehtml5poster:false,lightboxenablepdfjs:false,lightboxpdfjsengine:"",lightboxenableaudio:false,lightboxaudiofile:"",lightboxaudioautoplay:true,lightboxaudioloop:true,lightboxaudioshowonhover:true,lightboxvideoplaystyle:"circled",
lightboxvideoiconbg:"#333",lightboxvideoiconcolor:"#fff",lightboxvideoicondisabledcolor:"#aaa",lightboxvideobarbuffercolor:"#444",lightboxvideobaractivecolor:"#fcc500",lightboxvideobarcolor:"#666",lightboxvideoplaysize:64,lightboxvideoplayfontsize:36,lightboxvideoplayradius:32,lightboxvideoplayopacity:0.8,lightboxvideoplaytimeout:1500,lightboxvideohideplaybutton:false,lightboxvideocontroltimeout:3E3,lightboxvideohidetotaltimewidth:320,lightboxvideohidecurrtimewidth:240,lightboxvideohidecontrolbar:false,
ispreview:false,mediumgridsize:false,mediumwidth:320,mediumheight:240,smallgridsize:false,smallwidth:320,smallheight:240,supportlazytags:true,lazyloadtags:"wpplazysrc,lazy-src,lazyload-src,cfsrc,src,orig-src",categoryregulardropdown:false,fullwidth:false,fullwidthsamegrid:false,centerlastrow:false,centeronerow:false,donotzoomin:false,imgwidthpercent:100,mediumimgwidthpercent:100,smallimgwidthpercent:100,imgheightpercent:100,mediumimgheightpercent:100,smallimgheightpercent:100,triggerresizeafterinit:false,
triggerresizeafterinitdelay:100,imageposdelay:10,resizedelay:10,deferloading:false,deferloadingdelay:0,videohidecontrols:false,nativehtml5controls:false,videomuted:false,videoloop:false,uselegacyimagebutton:false,videocustomcontrolsonmobile:true,videoplaystyle:"circled",videoiconbg:"#333",videoiconcolor:"#fff",videobarbuffercolor:"#444",videoicondisabledcolor:"#aaa",videobaractivecolor:"#fcc500",videobarcolor:"#666",videoplaysize:64,videoplayfontsize:36,videoplayradius:32,videoplayopacity:0.8,videoplaytimeout:1500,
videocontroltimeout:3E3,videodefaultvolume:1,videohideplaybutton:false,videohidecontrolbar:false,videohidetotaltimewidth:320,videohidecurrtimewidth:240,overlaylinkexcludebutton:false,nativecontrolsonfirefox:false,nativecontrolsonie:false,nativecontrolsoniphone:true,nativecontrolsonipad:true,nativecontrolsonandroid:true,nativecontrolsonfullscreen:true,nativecontrolsnodownload:true,useflashonie11:false};this.options=$.extend({},defaultOptions,options);this.options.mark="WordPress Grid Gallery Trial Version";
this.options.marklink="https://www.wonderplugin.com/wordpress-gridgallery/";var instance=this;$.each($(this).data(),function(key,value){instance.options[key.toLowerCase()]=value});if($(this).data("lightboxvideoiconcolor")&&!$(this).data("lightboxvideoplaystyle"))instance.options["lightboxvideoplaystyle"]="triangle";if($(this).data("videoiconcolor")&&!$(this).data("videoplaystyle"))instance.options["videoplaystyle"]="triangle";var initGridGallery=function(inst){var lightboxOptions={initsocial:false,
enablepdfjs:false,shownavigation:inst.options.shownavigation,thumbwidth:inst.options.thumbwidth,thumbheight:inst.options.thumbheight,thumbtopmargin:inst.options.thumbtopmargin,thumbbottommargin:inst.options.thumbbottommargin,barheight:inst.options.barheight,responsive:inst.options.lightboxresponsive,showtitle:inst.options.lightboxshowtitle,bgcolor:inst.options.lightboxbgcolor,overlaybgcolor:inst.options.lightboxoverlaybgcolor,overlayopacity:inst.options.lightboxoverlayopacity,titlebottomcss:inst.options.titlebottomcss,
showdescription:inst.options.lightboxshowdescription,descriptionbottomcss:inst.options.descriptionbottomcss,fullscreenmode:inst.options.lightboxfullscreenmode,fullscreenmodeonsmallscreen:inst.options.lightboxfullscreenmodeonsmallscreen,fullscreensmallscreenwidth:inst.options.lightboxfullscreensmallscreenwidth,fullscreentextinside:inst.options.lightboxfullscreentextinside,fullscreentextoutside:inst.options.lightboxfullscreentextoutside,closeonoverlay:inst.options.lightboxcloseonoverlay,videohidecontrols:inst.options.lightboxvideohidecontrols,
inityoutube:inst.options.lightboxinityoutube,initvimeo:inst.options.lightboxinitvimeo,titlestyle:inst.options.lightboxtitlestyle,imagepercentage:inst.options.lightboximagepercentage,defaultvideovolume:inst.options.lightboxdefaultvideovolume,titleprefix:inst.options.lightboxtitleprefix,titleinsidecss:inst.options.lightboxtitleinsidecss,descriptioninsidecss:inst.options.lightboxdescriptioninsidecss,fullscreentitlebottomcss:inst.options.lightboxfullscreentitlebottomcss,fullscreendescriptionbottomcss:inst.options.lightboxfullscreendescriptionbottomcss,
autoslide:inst.options.lightboxautoslide,slideinterval:inst.options.lightboxslideinterval,showtimer:inst.options.lightboxshowtimer,timerposition:inst.options.lightboxtimerposition,timerheight:inst.options.lightboxtimerheight,timercolor:inst.options.lightboxtimercolor,timeropacity:inst.options.lightboxtimeropacity,navarrowspos:inst.options.lightboxnavarrowspos,enteranimation:inst.options.lightboxenteranimation,exitanimation:inst.options.lightboxexitanimation,showplaybutton:inst.options.lightboxshowplaybutton,
alwaysshownavarrows:inst.options.lightboxalwaysshownavarrows,bordersize:inst.options.lightboxbordersize,showtitleprefix:inst.options.lightboxshowtitleprefix,borderradius:inst.options.lightboxborderradius,bordertopmargin:inst.options.lightboxbordertopmargin,bordertopmarginsmall:inst.options.lightboxbordertopmarginsmall,resizespeed:inst.options.lightboxresizespeed,fadespeed:inst.options.lightboxfadespeed,transition:inst.options.lightboxtransition,transitionduration:inst.options.lightboxtransitionduration,
responsivebarheight:inst.options.lightboxresponsivebarheight,smallscreenheight:inst.options.lightboxsmallscreenheight,barheightonsmallheight:inst.options.lightboxbarheightonsmallheight,notkeepratioonsmallheight:inst.options.lightboxnotkeepratioonsmallheight,showsocial:inst.options.lightboxshowsocial,socialposition:inst.options.lightboxsocialposition,socialpositionsmallscreen:inst.options.lightboxsocialpositionsmallscreen,socialdirection:inst.options.lightboxsocialdirection,socialbuttonsize:inst.options.lightboxsocialbuttonsize,
socialbuttonfontsize:inst.options.lightboxsocialbuttonfontsize,socialrotateeffect:inst.options.lightboxsocialrotateeffect,showemail:inst.options.lightboxshowemail,showfacebook:inst.options.lightboxshowfacebook,showlinkedin:inst.options.lightboxshowlinkedin,showcopylink:inst.options.lightboxshowcopylink,showcopymedialink:inst.options.lightboxshowshowcopymedialink,showtwitter:inst.options.lightboxshowtwitter,showpinterest:inst.options.lightboxshowpinterest,showdownload:inst.options.lightboxshowdownload,
showwhatsapp:inst.options.lightboxshowwhatsapp,showtelegram:inst.options.lightboxshowtelegram,enablepdfjs:inst.options.lightboxenablepdfjs,pdfjsengine:inst.options.lightboxpdfjsengine,googleanalyticsaccount:inst.options.googleanalyticsaccount,ga4account:inst.options.ga4account,navbgcolor:inst.options.navbgcolor,shownavcontrol:inst.options.shownavcontrol,hidenavdefault:inst.options.hidenavdefault,enableaudio:inst.options.lightboxenableaudio,audiofile:inst.options.lightboxaudiofile,audioautoplay:inst.options.lightboxaudioautoplay,
audioloop:inst.options.lightboxaudioloop,audioshowonhover:inst.options.lightboxaudioshowonhover,videoplaystyle:inst.options.lightboxvideoplaystyle,videoiconbg:inst.options.lightboxvideoiconbg,videoiconcolor:inst.options.lightboxvideoiconcolor,videoicondisabledcolor:inst.options.lightboxvideoicondisabledcolor,videobarbuffercolor:inst.options.lightboxvideobarbuffercolor,videobaractivecolor:inst.options.lightboxvideobaractivecolor,videobarcolor:inst.options.lightboxvideobarcolor,videoplaysize:inst.options.lightboxvideoplaysize,
videoplayfontsize:inst.options.lightboxvideoplayfontsize,videoplayradius:inst.options.lightboxvideoplayradius,videoplayopacity:inst.options.lightboxvideoplayopacity,videoplaytimeout:inst.options.lightboxvideoplaytimeout,videocontroltimeout:inst.options.lightboxvideocontroltimeout,videohidetotaltimewidth:inst.options.lightboxvideohidetotaltimewidth,videohidecurrtimewidth:inst.options.lightboxvideohidecurrtimewidth,videohidecontrolbar:inst.options.lightboxvideohidecontrolbar,videohideplaybutton:inst.options.lightboxvideohideplaybutton};
if($("#wpgridlightbox_advanced_options").length)$.each($("#wpgridlightbox_advanced_options").data(),function(key,value){lightboxOptions[key.toLowerCase()]=value});if($("#wpgridlightbox_advanced_options_"+inst.options.gridgalleryid).length)$.each($("#wpgridlightbox_advanced_options_"+inst.options.gridgalleryid).data(),function(key,value){lightboxOptions[key.toLowerCase()]=value});if($("#wondergridgallerylightbox_options_"+inst.options.gridgalleryid).length)$.each($("#wondergridgallerylightbox_options_"+
inst.options.gridgalleryid).data(),function(key,value){lightboxOptions[key.toLowerCase()]=value});wpGridLightboxObject=$(".wpgridlightbox-"+inst.options.gridgalleryid).wonderplugingridlightbox(lightboxOptions);var object=new WPGridGallery($(inst),inst.options,inst.options.gridgalleryid);$(inst).data("object",object);$(inst).data("id",inst.options.gridgalleryid);wpGridGalleryObjects.addObject(object);if($(".wpgridinlinehtml5video").length){var options=$.extend({},inst.options,{videoplaysinline:1});
$(".wpgridinlinehtml5video").wpgridInlineHTML5Video(object,inst.options.gridgalleryid,options)}if($(".wpgridinlineiframevideo").length)$(".wpgridinlineiframevideo").wpgridInlineIframeVideo(object,inst.options.gridgalleryid,inst.options);if($(".wpgridloadhtml5video").length)$(".wpgridloadhtml5video").each(function(){var options=$.extend({},inst.options,{videoplaysinline:1,videoplayonclick:$(this).data("playvideoinlineonclick"),videoplayonhover:$(this).data("playmutedvideoinlineonhover"),videomuted:$(this).data("autoplaymutedvideoinline")||
$(this).data("playmutedvideoinlineonhover")?1:$(this).data("muted"),videoloop:$(this).data("loop"),videohidecontrols:$(this).data("hidecontrols"),videoposter:$(this).data("poster")});$(this).wpgridPlayHTML5Video(object,inst.options.gridgalleryid,options,$(this).data("autoplaymutedvideoinline"))});if($(".wpgridloadiframevideo").length)$(".wpgridloadiframevideo").wpgridLoadIframeVideo(object,inst.options.gridgalleryid,inst.options)};var loadGridGallery=function(instance){setTimeout(function(){initGridGallery(instance)},
instance.options.deferloading?instance.options.deferloadingdelay:0)};var getYouTubePlaylist=function(ypItem,index,insert_index,onsuccess,container,pagetoken){var youtube_url="https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId="+ypItem.youtubeplaylistid+"&key="+ypItem.youtubeapikey;if(ypItem.youtubeplaylistmaxresults)if(ypItem.youtubeplaylistmaxresults>50)youtube_url+="&maxResults=50";else youtube_url+="&maxResults="+ypItem.youtubeplaylistmaxresults;if(pagetoken)youtube_url+=
"&pageToken="+pagetoken;var all_done=true;$.getJSON(youtube_url,function(data){if(data&&data.items)for(var i=0;i<data.items.length;i++){var video_id=data.items[i]["snippet"]["resourceId"]["videoId"];var thumbnail="https://img.youtube.com/vi/"+video_id+"/0.jpg";var image="https://img.youtube.com/vi/"+video_id+"/0.jpg";if(data.items[i]["snippet"]["thumbnails"]&&data.items[i]["snippet"]["thumbnails"]["maxres"])image=data.items[i]["snippet"]["thumbnails"]["maxres"]["url"];var video="https://www.youtube.com/embed/"+
video_id;var title=data.items[i]["snippet"]["title"];var description=data.items[i]["snippet"]["description"];var new_item='<div class="wonderplugin-gridgallery-item"'+(ypItem.category?' data-category="'+ypItem.category+'"':"")+' data-row="1" data-col="1">';new_item+='<div class="wonderplugin-gridgallery-item-container">';if(ypItem.lightbox){new_item+='<a class="wpgridlightbox wpgridlightbox-'+instance.options.gridgalleryid+'"';new_item+=' data-thumbnail="'+thumbnail+'"';if(instance.options.lightboxcategorygroup&&
ypItem.category){var categories=ypItem.category.split(":");if(categories.length>0){new_item+=' data-wpggroup="wpgridgallery-'+instance.options.gridgalleryid+"-"+categories[0];for(var catIndex=1;catIndex<categories.length;catIndex++)new_item+=":wpgridgallery-"+instance.options.gridgalleryid+"-"+categories[catIndex];new_item+='"'}}else new_item+=' data-wpggroup="wpgridgallery-'+instance.options.gridgalleryid+'"';new_item+=' data-isvideo="1" href="'+video+'"';if(ypItem.lightboxsize)new_item+=' data-width="'+
ypItem.lightboxwidth+'" data-height="'+ypItem.lightboxheight+'"';new_item+=' data-title="'+title+'" data-description="'+description+'"';new_item+=">"}else{new_item+='<a class="wpgridinlineiframevideo"';new_item+=' data-isvideo="1" href="'+video+'"';new_item+=' data-title="'+title+'" data-description="'+description+'">'}new_item+='<img class="wonderplugin-gridgallery-item-img"';new_item+=' alt="'+title+'"';if(instance.options.deferloading)new_item+=' src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-wpplazysrc="'+
image+'"';else new_item+=' src="'+image+'"';new_item+=" />";new_item+="</a>";new_item+="</div>";new_item+='<div class="wonderplugin-gridgallery-item-text"><div class="wonderplugin-gridgallery-item-wrapper">';if(ypItem.youtubetitle)new_item+='<div class="wonderplugin-gridgallery-item-title">'+title+"</div>";if(ypItem.youtubedescription)new_item+='<div class="wonderplugin-gridgallery-item-description">'+description+"</div>";new_item+="</div></div>";new_item+="</div>";$(".wonderplugin-gridgallery-item",
container).eq(insert_index).after(new_item);insert_index++}if(data&&data.nextPageToken&&ypItem.youtubeplaylistmaxresults&&ypItem.youtubeplaylistmaxresults>50){all_done=false;ypItem.youtubeplaylistmaxresults-=50;getYouTubePlaylist(ypItem,index,insert_index,onsuccess,container,data.nextPageToken)}}).always(function(){if(all_done){$(container).trigger("wonderplugingrid.youtubeplaylistloaded");$(".wonderplugin-gridgallery-item",container).eq(index).remove();onsuccess(container)}})};var preprocessGallery=
function(container){var found=false;var item_index=0;var ypItem={};$(".wonderplugin-gridgallery-item",container).each(function(index){if($(this).data("youtubeapikey")&&$(this).data("youtubeplaylistid")){found=true;item_index=index;ypItem={youtubeapikey:$(this).data("youtubeapikey"),youtubeplaylistid:$(this).data("youtubeplaylistid"),youtubeplaylistmaxresults:$(this).data("youtubeplaylistmaxresults"),youtubetitle:$(this).data("youtubetitle"),youtubedescription:$(this).data("youtubedescription"),lightbox:$(this).data("lightbox"),
lightboxsize:$(this).data("lightboxsize"),lightboxwidth:$(this).data("lightboxwidth"),lightboxheight:$(this).data("lightboxheight"),category:$(this).data("category")};return false}});if(found)getYouTubePlaylist(ypItem,item_index,item_index,preprocessGallery,container,null);else loadGridGallery(container)};var initRemote=function(inst){var remote_items="";$.getJSON(inst.options.remote,function(data){for(var i=0;i<data.length;i++){remote_items+='<div class="wonderplugin-gridgallery-item"';if(data[i].category)remote_items+=
' data-category="'+data[i].category+'"';remote_items+=' data-row="1" data-col="1"><div class="wonderplugin-gridgallery-item-container">';if(data[i].link){remote_items+='<a href="'+data[i].link+'"';if(data[i].linktarget)remote_items+=' target="'+data[i].linktarget+'"';if(data[i].lightbox)remote_items+=' class="wpgridlightbox wpgridlightbox-'+inst.options.gridgalleryid+'"';if(data[i].lightboxwidth)remote_items+=' data-width="'+data[i].lightboxwidth+'"';if(data[i].lightboxheight)remote_items+=' data-width="'+
data[i].lightboxheight+'"';remote_items+=' data-thumbnail="'+data[i].thumbnail+'"';remote_items+=' data-wpggroup="wpgridgallery-'+inst.options.gridgalleryid+'"';if(data[i].title)remote_items+=' title="'+data[i].title+'"';if(data[i].description)remote_items+=' data-description="'+data[i].description+'"';remote_items+=">"}remote_items+='<img class="wonderplugin-gridgallery-item-img"';if(data[i].alt)remote_items+=' alt="'+data[i].alt+'"';else if(data[i].title)remote_items+=' alt="'+data[i].title+'"';
remote_items+=' src="'+data[i].thumbnail+'">';if(data[i].link)remote_items+="</a>";remote_items+="</div></div>"}if($(".wonderplugin-gridgallery-list",$(inst)).length>0)$(".wonderplugin-gridgallery-list",$(inst)).append(remote_items);else{remote_items='<div class="wonderplugin-gridgallery-list" style="display:block;position:relative;max-width:100%;margin:0 auto;">'+remote_items+'</div><div style="clear:both;"></div>';$(inst).append(remote_items)}preprocessGallery(inst)})};if(this.options.remote&&this.options.remote.length>
0)initRemote(this);else preprocessGallery(this)})};$.fn.wpgridPlayIframeVideo=function(inst,autoplay){$(this).closest(".wonderplugin-gridgallery-item").data("isplayingvideo",true);inst.hideTitle($(this).closest(".wonderplugin-gridgallery-item"));var $iframeurl=$(this).attr("href");$iframeurl+=($iframeurl.indexOf("?")<0?"?":"&")+(autoplay?"autoplay=1":"");var $container=$(this).closest(".wonderplugin-gridgallery-item-container");$container.html('<iframe class="wpgridinlineiframe" width="100%" height="100%" src="'+
$iframeurl+'" frameborder="0" allow="autoplay" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>')};$.fn.wpgridLoadIframeVideo=function(inst,id,options){$(this).each(function(){$(this).wpgridPlayIframeVideo(inst,false)})};$.fn.wpgridInlineIframeVideo=function(inst,id,options){$(this).off("click").click(function(e){e.preventDefault();$(this).wpgridPlayIframeVideo(inst,true)})};$.fn.wpgridPlayHTML5Video=function(inst,id,options,autoplay){var isAndroid=navigator.userAgent.match(/Android/i)!=
null;var isIPad=navigator.userAgent.match(/iPad/i)!=null;var isIPhone=navigator.userAgent.match(/iPod/i)!=null||navigator.userAgent.match(/iPhone/i)!=null;var isFirefox=navigator.userAgent.match(/Firefox/i)!=null;var isOpera=navigator.userAgent.match(/Opera/i)!=null||navigator.userAgent.match(/OPR\//i)!=null;var isIE=navigator.userAgent.match(/MSIE/i)!=null&&!isOpera;var isIE11=navigator.userAgent.match(/Trident\/7/)!=null&&navigator.userAgent.match(/rv:11/)!=null;var isMobile=isIPhone||isIPad||isAndroid;
if(isFirefox&&options.nativecontrolsonfirefox||(isIE||isIE11)&&options.nativecontrolsonie||isIPhone&&options.nativecontrolsoniphone||isIPad&&options.nativecontrolsonipad||isAndroid&&options.nativecontrolsonandroid)options.nativehtml5controls=true;if(isMobile){options.nativecontrolsonfullscreen=true;if(options.videocustomcontrolsonmobile)options.nativehtml5controls=false}var mp4url=$(this).attr("href");var webmurl=$(this).data("webm");$(this).closest(".wonderplugin-gridgallery-item").data("isplayingvideo",
true);inst.hideTitle($(this).closest(".wonderplugin-gridgallery-item"));var $container=$(this).closest(".wonderplugin-gridgallery-item-container");var videosrc=(isFirefox||isOpera)&&webmurl&&webmurl.length>0?webmurl:mp4url;$container.html('<video class="wpgridinlinevideo"'+(options.videomuted?" muted":"")+(options.videoloop?" loop":"")+(options.videoplaysinline?" playsinline":"")+' width="100%" height="100%"'+' src="'+videosrc+'"'+(options.videoposter?' poster="'+options.videoposter+'"':"")+(autoplay?
" autoplay":"")+(options.nativehtml5controls&&!options.videohidecontrols?' controls="controls"':"")+(options.nativecontrolsnodownload?' controlsList="nodownload"':"")+">");var videoObj=$("video",$container);if(!options.nativehtml5controls&&!options.videohidecontrols){videoObj.data("src",videosrc);videoObj.wpgridHTML5VideoControls(options.skinsfolder,$(this),".wpgridinlinevideo",isMobile,autoplay,options)}videoObj.off("ended").on("ended",function(){$(window).trigger("wpgridvideo.ended",[id])});if(options.videoplayonhover)videoObj.hover(function(){this.play()},
function(){this.pause()});if((options.videoplayonclick||options.videoplayonhover&&isMobile)&&(!options.nativehtml5controls||options.videohidecontrols))videoObj.click(function(){if(this.paused)this.play();else this.pause()})};$.fn.wpgridInlineHTML5Video=function(inst,id,options){$(this).off("click").click(function(e){e.preventDefault();$(this).wpgridPlayHTML5Video(inst,id,options,true)})};$.fn.wpgridHTML5VideoControls=function(skinFolder,parentInst,videoElem,isMobile,autoPlay,videoOptions){var ICON_BG=
videoOptions.videoiconbg;var ICON_COLOR=videoOptions.videoiconcolor;var ICON_DISABLED_COLOR=videoOptions.videoicondisabledcolor;var BAR_BUFFER_COLOR=videoOptions.videobarbuffercolor;var BAR_ACTIVE_COLOR=videoOptions.videobaractivecolor;var BAR_COLOR=videoOptions.videobarcolor;var PLAY_RADIUS=videoOptions.videoplayradius;var PLAY_SIZE=videoOptions.videoplaysize;var PLAY_STYLE=videoOptions.videoplaystyle;var PLAY_FONT_SIZE=videoOptions.videoplayfontsize;var PLAY_OPACITY=videoOptions.videoplayopacity;
var PLAY_TIMEOUT=videoOptions.videoplaytimeout;var CONTROL_TIMEOUT=videoOptions.videocontroltimeout;var hideTotalTimeWidth=videoOptions.videohidetotaltimewidth;var hideCurrTimeWidth=videoOptions.videohidecurrtimewidth;var hideControlBar=videoOptions.videohidecontrolbar;var hidePlayButton=videoOptions.videohideplaybutton;var defaultVolume=videoOptions.videodefaultvolume;var fullscreenNativeControls=videoOptions.nativecontrolsonfullscreen;var html5VideoNoDownload=videoOptions.nativecontrolsnodownload;
var isTouch="ontouchstart"in window;var eStart=isTouch?"touchstart":"mousedown";var eMove=isTouch?"touchmove":"mousemove";var eCancel=isTouch?"touchcancel":"mouseup";var eClick="click";var BUTTON_SIZE=32;var ICON_SIZE=16;var BAR_HEIGHT=isTouch?48:36;var hideControlsTimerId=null;var hidePlayTimerId=null;var hideVolumeBarTimeoutId=null;var sliderDragging=false;var isFullscreen=false;var userActive=false;var isHd=$(this).data("ishd");var hd=$(this).data("hd");var src=$(this).data("src");var $videoObj=
$(this);$videoObj.get(0).removeAttribute("controls");var $videoPlayPause=$("<div class='html5boxVideoPlayPause'><div class='html5boxVideoPlay' style='display:block;'></div><div class='html5boxVideoPause' style='display:none;'></div></div>");$videoObj.after($videoPlayPause);$videoPlayPause.css({position:"absolute",top:"50%",left:"50%",display:autoPlay?"none":"block",cursor:"pointer",width:PLAY_SIZE+"px",height:PLAY_SIZE+"px",transform:"translate(-50%, -50%)"});var $videoPlay=$(".html5boxVideoPlay",
$videoPlayPause);var $videoPause=$(".html5boxVideoPause",$videoPlayPause);$videoPlay.on(eClick,function(){$videoObj.get(0).play()});$videoPause.on(eClick,function(){$videoObj.get(0).pause()});$videoPlay.addClass(PLAY_STYLE=="circled"?"mh-icon-customplay":"mh-icon-play");$videoPause.addClass(PLAY_STYLE=="circled"?"mh-icon-custompause":"mh-icon-pause");$videoPlay.add($videoPause).css({position:"absolute",top:0,left:0,width:"100%",height:"100%",color:ICON_COLOR,"background-color":PLAY_STYLE=="circled"?
"transparent":ICON_BG,"border-radius":PLAY_STYLE=="circled"?0:PLAY_RADIUS,opacity:PLAY_OPACITY,"font-size":(PLAY_STYLE=="circled"?PLAY_SIZE:PLAY_FONT_SIZE)+"px","line-height":PLAY_SIZE+"px",padding:0,"box-sizing":"border-box"});var $videoFullscreenBg=$("<div class='html5boxVideoFullscreenBg'></div>");var $videoControls=$("<div class='html5boxVideoControls'>"+"<div class='html5boxVideoControlsBg'></div>"+"<div class='html5boxPlayPause'>"+"<div class='html5boxPlay'></div>"+"<div class='html5boxPause'></div>"+
"</div>"+"<div class='html5boxTimeCurrent'>--:--</div>"+"<div class='html5boxFullscreen'></div>"+"<div class='html5boxHD mh-icon-hd'></div>"+"<div class='html5boxVolume'>"+"<div class='html5boxVolumeButton'></div>"+"<div class='html5boxVolumeBar'>"+"<div class='html5boxVolumeBarBg'>"+"<div class='html5boxVolumeBarActive'></div>"+"</div>"+"</div>"+"</div>"+"<div class='html5boxTimeTotal'>--:--</div>"+"<div class='html5boxSeeker'>"+"<div class='html5boxSeekerBuffer'></div>"+"<div class='html5boxSeekerPlay'></div>"+
"<div class='html5boxSeekerHandler'></div>"+"</div>"+"<div style='clear:both;'></div>"+"</div>");$videoObj.after($videoControls);$videoObj.after($videoFullscreenBg);$videoFullscreenBg.css({display:"none",position:"fixed",left:0,top:0,bottom:0,right:0});$videoControls.css({display:"none",position:"absolute",width:"100%",height:BAR_HEIGHT,left:0,bottom:0,right:0,margin:"0 auto"});var userActivate=function(){userActive=true};$videoObj.add($videoControls).add($videoPlayPause).on("touch click mousemove",
function(){userActive=true});setInterval(function(){if(userActive&&$videoObj.get(0).played.length>0){if(!hidePlayButton){$videoPlayPause.stop(true,true);$videoPlayPause.show()}if(!hideControlBar){$videoControls.stop(true,true);$videoControls.show()}userActive=false;clearTimeout(hidePlayTimerId);hidePlayTimerId=setTimeout(function(){if(!$videoObj.get(0).paused)if(!hidePlayButton)$videoPlayPause.stop(true).fadeOut()},PLAY_TIMEOUT);clearTimeout(hideControlsTimerId);hideControlsTimerId=setTimeout(function(){if(!$videoObj.get(0).paused)if(!hideControlBar)$videoControls.stop(true).fadeOut()},
CONTROL_TIMEOUT)}},10);$(".html5boxVideoControlsBg",$videoControls).css({display:"block",position:"absolute",width:"100%",height:"100%",left:0,top:0,"background-color":ICON_BG,opacity:0.8,filter:"alpha(opacity=80)"});$(".html5boxPlayPause",$videoControls).css({display:"block",position:"relative",width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",margin:Math.floor((BAR_HEIGHT-BUTTON_SIZE)/2),"float":"left"});var $videoBtnPlay=$(".html5boxPlay",$videoControls);var $videoBtnPause=$(".html5boxPause",$videoControls);
$videoBtnPlay.css({display:"block",position:"absolute",top:0,left:0,width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",cursor:"pointer"}).on(eClick,function(){$videoObj.get(0).play()});$videoBtnPause.css({display:"none",position:"absolute",top:0,left:0,width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",cursor:"pointer"}).on(eClick,function(){$videoObj.get(0).pause()});$videoBtnPlay.addClass("mh-icon-play").css({color:ICON_COLOR,"font-size":ICON_SIZE+"px","line-height":BUTTON_SIZE+"px"});$videoBtnPause.addClass("mh-icon-pause").css({color:ICON_COLOR,
"font-size":ICON_SIZE+"px","line-height":BUTTON_SIZE+"px"});var $videoTimeCurrent=$(".html5boxTimeCurrent",$videoControls);var $videoTimeTotal=$(".html5boxTimeTotal",$videoControls);var $videoSeeker=$(".html5boxSeeker",$videoControls);var $videoSeekerPlay=$(".html5boxSeekerPlay",$videoControls);var $videoSeekerBuffer=$(".html5boxSeekerBuffer",$videoControls);var $videoSeekerHandler=$(".html5boxSeekerHandler",$videoControls);$videoTimeCurrent.css({display:"block",position:"relative","float":"left",
"line-height":BAR_HEIGHT+"px","font-weight":"normal","font-style":"normal","font-size":"12px",margin:"0 8px 0 0","font-family":"Arial, Helvetica, sans-serif",color:ICON_COLOR});$videoTimeTotal.css({display:"block",position:"relative","float":"right","line-height":BAR_HEIGHT+"px","font-weight":"normal","font-style":"normal","font-size":"12px",margin:"0 0 0 8px","font-family":"Arial, Helvetica, sans-serif",color:ICON_COLOR});if($videoObj.width()<=hideTotalTimeWidth)$videoTimeTotal.hide();if($videoObj.width()<=
hideCurrTimeWidth)$videoTimeCurrent.hide();$videoSeeker.css({display:"block",cursor:"pointer",overflow:"hidden",position:"relative",height:"10px","background-color":BAR_COLOR,margin:Math.floor((BAR_HEIGHT-10)/2)+"px 4px"}).on(eStart,function(e){var e0=isTouch?e.originalEvent.touches[0]:e;var pos=e0.pageX-$videoSeeker.offset().left;$videoSeekerPlay.css({width:pos});$videoObj.get(0).currentTime=pos*$videoObj.get(0).duration/$videoSeeker.width();$videoSeeker.on(eMove,function(e){var e0=isTouch?e.originalEvent.touches[0]:
e;var pos=e0.pageX-$videoSeeker.offset().left;$videoSeekerPlay.css({width:pos});$videoObj.get(0).currentTime=pos*$videoObj.get(0).duration/$videoSeeker.width()})}).on(eCancel,function(){$videoSeeker.off(eMove)});$videoSeekerBuffer.css({display:"block",position:"absolute",left:0,top:0,height:"100%","background-color":BAR_BUFFER_COLOR});$videoSeekerPlay.css({display:"block",position:"absolute",left:0,top:0,height:"100%","background-color":BAR_ACTIVE_COLOR});var $videoFSObj=fullscreenNativeControls?
$videoObj:$videoObj.parent();if($videoFSObj.get(0).requestFullscreen||$videoFSObj.get(0).webkitRequestFullScreen||$videoFSObj.get(0).mozRequestFullScreen||$videoFSObj.get(0).webkitEnterFullScreen||$videoFSObj.get(0).msRequestFullscreen){var switchScreen=function(fullscreen){if(fullscreen){if(fullscreenNativeControls){$videoObj.get(0).setAttribute("controls","controls");if(html5VideoNoDownload)$videoObj.get(0).setAttribute("controlsList","nodownload")}if($videoFSObj.get(0).requestFullscreen)$videoFSObj.get(0).requestFullscreen();
else if($videoFSObj.get(0).webkitRequestFullScreen)$videoFSObj.get(0).webkitRequestFullScreen();else if($videoFSObj.get(0).mozRequestFullScreen)$videoFSObj.get(0).mozRequestFullScreen();else if($videoFSObj.get(0).webkitEnterFullScreen)$videoFSObj.get(0).webkitEnterFullScreen();if($videoFSObj.get(0).msRequestFullscreen)$videoFSObj.get(0).msRequestFullscreen()}else if(document.cancelFullScreen)document.cancelFullScreen();else if(document.mozCancelFullScreen)document.mozCancelFullScreen();else if(document.webkitCancelFullScreen)document.webkitCancelFullScreen();
else if(document.webkitExitFullscreen)document.webkitExitFullscreen();else if(document.msExitFullscreen)document.msExitFullscreen()};var switchScreenCSS=function(fullscreen){if(fullscreenNativeControls)if(fullscreen){$videoObj.get(0).setAttribute("controls","controls");if(html5VideoNoDownload)$videoObj.get(0).setAttribute("controlsList","nodownload")}else $videoObj.get(0).removeAttribute("controls");else if(fullscreen){$(document).on("mousemove",userActivate);$videoControls.css({"z-index":2147483647,
position:"fixed"});$videoFullscreenBg.css({"z-index":2147483647,display:"block"});$videoPlayPause.css({"z-index":2147483647})}else{$(document).off("mousemove",userActivate);$videoControls.css({"z-index":"",position:"absolute"});$videoFullscreenBg.css({"z-index":"",display:"none"});$videoPlayPause.css({"z-index":""})}};document.addEventListener("MSFullscreenChange",function(){isFullscreen=document.msFullscreenElement!=null;switchScreenCSS(isFullscreen)},false);document.addEventListener("fullscreenchange",
function(){isFullscreen=document.fullscreen;switchScreenCSS(isFullscreen)},false);document.addEventListener("mozfullscreenchange",function(){isFullscreen=document.mozFullScreen;switchScreenCSS(isFullscreen)},false);document.addEventListener("webkitfullscreenchange",function(){isFullscreen=document.webkitIsFullScreen;switchScreenCSS(isFullscreen)},false);$videoFSObj.get(0).addEventListener("webkitbeginfullscreen",function(){isFullscreen=true;switchScreenCSS(isFullscreen)},false);$videoFSObj.get(0).addEventListener("webkitendfullscreen",
function(){isFullscreen=false;switchScreenCSS(isFullscreen)},false);if(!fullscreenNativeControls)$("head").append("<style type='text/css'>video"+videoElem+"::-webkit-media-controls { display:none !important; }</style>");var $videoFullscreen=$(".html5boxFullscreen",$videoControls);$videoFullscreen.css({display:"block",position:"relative","float":"right",width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",margin:Math.floor((BAR_HEIGHT-BUTTON_SIZE)/2),cursor:"pointer"}).on(eClick,function(){isFullscreen=
!isFullscreen;switchScreen(isFullscreen)});$videoFullscreen.addClass("mh-icon-resize-full-alt").css({color:ICON_COLOR,"font-size":ICON_SIZE+"px","line-height":BUTTON_SIZE+"px"})}if(hd){var $videoHD=$(".html5boxHD",$videoControls);$videoHD.css({display:"block",position:"relative","float":"right",width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",margin:Math.floor((BAR_HEIGHT-BUTTON_SIZE)/2),cursor:"pointer",color:isHd?ICON_COLOR:ICON_DISABLED_COLOR,"font-size":ICON_SIZE+"px","line-height":BUTTON_SIZE+
"px"}).on(eClick,function(){isHd=!isHd;$(this).css({"color":isHd?ICON_COLOR:ICON_DISABLED_COLOR});parentInst.isHd=isHd;var isPaused=$videoObj.get(0).isPaused;$videoObj.get(0).setAttribute("src",(isHd?hd:src)+"#t="+$videoObj.get(0).currentTime);if(!isPaused)$videoObj.get(0).play();else $videoObj.get(0).pause()})}else $(".html5boxHD",$videoControls).hide();var volumeSaved=defaultVolume==0?1:defaultVolume;$videoObj.get(0).volume=$videoObj.get(0).muted?0:defaultVolume;var $videoVolume=$(".html5boxVolume",
$videoControls);var $videoVolumeButton=$(".html5boxVolumeButton",$videoControls);var $videoVolumeBar=$(".html5boxVolumeBar",$videoControls);var $videoVolumeBarBg=$(".html5boxVolumeBarBg",$videoControls);var $videoVolumeBarActive=$(".html5boxVolumeBarActive",$videoControls);$videoVolume.css({display:"block",position:"relative","float":"right",width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",margin:Math.floor((BAR_HEIGHT-BUTTON_SIZE)/2)});if(!isMobile)$videoVolume.hover(function(){clearTimeout(hideVolumeBarTimeoutId);
var volume=$videoObj.get(0).volume;$videoVolumeBarActive.css({height:Math.round(volume*100)+"%"});$videoVolumeBar.show()},function(){clearTimeout(hideVolumeBarTimeoutId);hideVolumeBarTimeoutId=setTimeout(function(){$videoVolumeBar.hide()},1E3)});$videoVolumeButton.css({display:"block",position:"absolute",top:0,left:0,width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",cursor:"pointer"}).on(eClick,function(){if(isMobile)if($videoObj.get(0).muted){$videoObj.get(0).muted=false;$videoVolumeButton.addClass("mh-icon-volume-up").removeClass("mh-icon-volume-off")}else{$videoObj.get(0).muted=
true;$videoVolumeButton.removeClass("mh-icon-volume-up").addClass("mh-icon-volume-off")}else{var volume=$videoObj.get(0).volume;if(volume>0){volumeSaved=volume;volume=0}else volume=volumeSaved;$videoObj.get(0).volume=volume;$videoObj.get(0).muted=volume==0;$videoVolumeBarActive.css({height:Math.round(volume*100)+"%"});if($videoObj.get(0).muted)$videoVolumeButton.removeClass("mh-icon-volume-up").addClass("mh-icon-volume-off");else $videoVolumeButton.addClass("mh-icon-volume-up").removeClass("mh-icon-volume-off")}});
$videoVolumeButton.addClass($videoObj.get(0).muted?"mh-icon-volume-off":"mh-icon-volume-up").css({color:ICON_COLOR,"font-size":ICON_SIZE+"px","line-height":BUTTON_SIZE+"px"});$videoVolumeBar.css({display:"none",position:"absolute",left:4,bottom:"100%",width:24,height:80,"z-index":1,"margin-bottom":Math.floor((BAR_HEIGHT-BUTTON_SIZE)/2),"background-color":ICON_BG,opacity:0.8,filter:"alpha(opacity=80)"});$videoVolumeBarBg.css({display:"block",position:"relative",width:10,height:68,margin:7,cursor:"pointer",
"background-color":BAR_COLOR});$videoVolumeBarActive.css({display:"block",position:"absolute",bottom:0,left:0,width:"100%",height:"100%","background-color":BAR_ACTIVE_COLOR});$videoVolumeBarBg.on(eStart,function(e){var e0=isTouch?e.originalEvent.touches[0]:e;var vol=1-(e0.pageY-$videoVolumeBarBg.offset().top)/$videoVolumeBarBg.height();vol=vol>1?1:vol<0?0:vol;$videoVolumeBarActive.css({height:Math.round(vol*100)+"%"});$videoVolumeButton.addClass(vol>0?"mh-icon-volume-up":"mh-icon-volume-off").removeClass(vol>
0?"mh-icon-volume-off":"mh-icon-volume-up");$videoObj.get(0).volume=vol;$videoObj.get(0).muted=vol==0;$videoVolumeBarBg.on(eMove,function(e){var e0=isTouch?e.originalEvent.touches[0]:e;var vol=1-(e0.pageY-$videoVolumeBarBg.offset().top)/$videoVolumeBarBg.height();vol=vol>1?1:vol<0?0:vol;$videoVolumeBarActive.css({height:Math.round(vol*100)+"%"});$videoVolumeButton.addClass(vol>0?"mh-icon-volume-up":"mh-icon-volume-off").removeClass(vol>0?"mh-icon-volume-off":"mh-icon-volume-up");$videoObj.get(0).volume=
vol;$videoObj.get(0).muted=vol==0})}).on(eCancel,function(){$videoVolumeBarBg.off(eMove)});var calcTimeFormat=function(seconds){var h0=Math.floor(seconds/3600);var h=h0<10?"0"+h0:h0;var m0=Math.floor((seconds-h0*3600)/60);var m=m0<10?"0"+m0:m0;var s0=Math.floor(seconds-(h0*3600+m0*60));var s=s0<10?"0"+s0:s0;var r=m+":"+s;if(h0>0)r=h+":"+r;return r};if(hidePlayButton)$videoPlayPause.hide();if(hideControlBar)$videoControls.hide();var onVideoPlay=function(){if(!hidePlayButton){$videoPlay.hide();$videoPause.show()}if(!hideControlBar){$videoBtnPlay.hide();
$videoBtnPause.show()}};var onVideoPause=function(){clearTimeout(hidePlayTimerId);clearTimeout(hideControlsTimerId);if(!hidePlayButton){$videoPlayPause.show();$videoPlay.show();$videoPause.hide()}if(!hideControlBar){$videoControls.show();$videoBtnPlay.show();$videoBtnPause.hide()}};var onVideoEnded=function(){$(window).trigger("html5lightbox.videoended");clearTimeout(hidePlayTimerId);clearTimeout(hideControlsTimerId);if(!hidePlayButton){$videoPlayPause.show();$videoPlay.show();$videoPause.hide()}if(!hideControlBar){$videoControls.show();
$videoBtnPlay.show();$videoBtnPause.hide()}};var onVideoUpdate=function(){var curTime=$videoObj.get(0).currentTime;if(curTime){$videoTimeCurrent.text(calcTimeFormat(curTime));var duration=$videoObj.get(0).duration;if(duration){$videoTimeTotal.text(calcTimeFormat(duration));if(!sliderDragging){var sliderW=$videoSeeker.width();var pos=Math.round(sliderW*curTime/duration);$videoSeekerPlay.css({width:pos});$videoSeekerHandler.css({left:pos})}}}};var onVideoProgress=function(){if($videoObj.get(0).buffered&&
$videoObj.get(0).buffered.length>0&&!isNaN($videoObj.get(0).buffered.end(0))&&!isNaN($videoObj.get(0).duration)){var sliderW=$videoSeeker.width();$videoSeekerBuffer.css({width:Math.round(sliderW*$videoObj.get(0).buffered.end(0)/$videoObj.get(0).duration)})}};try{$videoObj.on("play",onVideoPlay);$videoObj.on("pause",onVideoPause);$videoObj.on("ended",onVideoEnded);$videoObj.on("timeupdate",onVideoUpdate);$videoObj.on("progress",onVideoProgress)}catch(e){}}})(jQuery);
(function($){var pow=Math.pow,sqrt=Math.sqrt,sin=Math.sin,cos=Math.cos,PI=Math.PI,c1=1.70158,c2=c1*1.525,c3=c1+1,c4=2*PI/3,c5=2*PI/4.5;function bounceOut(x){var n1=7.5625,d1=2.75;if(x<1/d1)return n1*x*x;else if(x<2/d1)return n1*(x-=1.5/d1)*x+0.75;else if(x<2.5/d1)return n1*(x-=2.25/d1)*x+0.9375;else return n1*(x-=2.625/d1)*x+0.984375}$.extend($.easing,{def:"easeOutQuad",easeInQuad:function(x){return x*x},easeOutQuad:function(x){return 1-(1-x)*(1-x)},easeInOutQuad:function(x){return x<0.5?2*x*x:1-
pow(-2*x+2,2)/2},easeInCubic:function(x){return x*x*x},easeOutCubic:function(x){return 1-pow(1-x,3)},easeInOutCubic:function(x){return x<0.5?4*x*x*x:1-pow(-2*x+2,3)/2},easeInQuart:function(x){return x*x*x*x},easeOutQuart:function(x){return 1-pow(1-x,4)},easeInOutQuart:function(x){return x<0.5?8*x*x*x*x:1-pow(-2*x+2,4)/2},easeInQuint:function(x){return x*x*x*x*x},easeOutQuint:function(x){return 1-pow(1-x,5)},easeInOutQuint:function(x){return x<0.5?16*x*x*x*x*x:1-pow(-2*x+2,5)/2},easeInSine:function(x){return 1-
cos(x*PI/2)},easeOutSine:function(x){return sin(x*PI/2)},easeInOutSine:function(x){return-(cos(PI*x)-1)/2},easeInExpo:function(x){return x===0?0:pow(2,10*x-10)},easeOutExpo:function(x){return x===1?1:1-pow(2,-10*x)},easeInOutExpo:function(x){return x===0?0:x===1?1:x<0.5?pow(2,20*x-10)/2:(2-pow(2,-20*x+10))/2},easeInCirc:function(x){return 1-sqrt(1-pow(x,2))},easeOutCirc:function(x){return sqrt(1-pow(x-1,2))},easeInOutCirc:function(x){return x<0.5?(1-sqrt(1-pow(2*x,2)))/2:(sqrt(1-pow(-2*x+2,2))+1)/
2},easeInElastic:function(x){return x===0?0:x===1?1:-pow(2,10*x-10)*sin((x*10-10.75)*c4)},easeOutElastic:function(x){return x===0?0:x===1?1:pow(2,-10*x)*sin((x*10-0.75)*c4)+1},easeInOutElastic:function(x){return x===0?0:x===1?1:x<0.5?-(pow(2,20*x-10)*sin((20*x-11.125)*c5))/2:pow(2,-20*x+10)*sin((20*x-11.125)*c5)/2+1},easeInBack:function(x){return c3*x*x*x-c1*x*x},easeOutBack:function(x){return 1+c3*pow(x-1,3)+c1*pow(x-1,2)},easeInOutBack:function(x){return x<0.5?pow(2*x,2)*((c2+1)*2*x-c2)/2:(pow(2*
x-2,2)*((c2+1)*(x*2-2)+c2)+2)/2},easeInBounce:function(x){return 1-bounceOut(1-x)},easeOutBounce:bounceOut,easeInOutBounce:function(x){return x<0.5?(1-bounceOut(1-2*x))/2:(1+bounceOut(2*x-1))/2}})})(jQuery);jQuery(document).ready(function(){jQuery(".wonderplugin-gridgallery-engine").css({display:"none"});if(jQuery.fn.wonderplugingridgallery)jQuery(".wonderplugingridgallery").wonderplugingridgallery()});
// source --> https://theoutdoorchef.com.au/wp-content/plugins/woocommerce/assets/js/jquery-blockui/jquery.blockUI.min.js?ver=2.7.0-wc.10.7.0 
/*!
 * jQuery blockUI plugin
 * Version 2.70.0-2014.11.23
 * Requires jQuery v1.7 or later
 *
 * Examples at: http://malsup.com/jquery/block/
 * Copyright (c) 2007-2013 M. Alsup
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Thanks to Amir-Hossein Sobhi for some excellent contributions!
 */
!function(){"use strict";function e(e){e.fn._fadeIn=e.fn.fadeIn;var t=e.noop||function(){},o=/MSIE/.test(navigator.userAgent),n=/MSIE 6.0/.test(navigator.userAgent)&&!/MSIE 8.0/.test(navigator.userAgent),i=(document.documentMode,"function"==typeof document.createElement("div").style.setExpression&&document.createElement("div").style.setExpression);e.blockUI=function(e){d(window,e)},e.unblockUI=function(e){a(window,e)},e.growlUI=function(t,o,n,i){var s=e('<div class="growlUI"></div>');t&&s.append("<h1>"+t+"</h1>"),o&&s.append("<h2>"+o+"</h2>"),n===undefined&&(n=3e3);var l=function(t){t=t||{},e.blockUI({message:s,fadeIn:"undefined"!=typeof t.fadeIn?t.fadeIn:700,fadeOut:"undefined"!=typeof t.fadeOut?t.fadeOut:1e3,timeout:"undefined"!=typeof t.timeout?t.timeout:n,centerY:!1,showOverlay:!1,onUnblock:i,css:e.blockUI.defaults.growlCSS})};l();s.css("opacity");s.on("mouseover",function(){l({fadeIn:0,timeout:3e4});var t=e(".blockMsg");t.stop(),t.fadeTo(300,1)}).on("mouseout",function(){e(".blockMsg").fadeOut(1e3)})},e.fn.block=function(t){if(this[0]===window)return e.blockUI(t),this;var o=e.extend({},e.blockUI.defaults,t||{});return this.each(function(){var t=e(this);o.ignoreIfBlocked&&t.data("blockUI.isBlocked")||t.unblock({fadeOut:0})}),this.each(function(){"static"==e.css(this,"position")&&(this.style.position="relative",e(this).data("blockUI.static",!0)),this.style.zoom=1,d(this,t)})},e.fn.unblock=function(t){return this[0]===window?(e.unblockUI(t),this):this.each(function(){a(this,t)})},e.blockUI.version=2.7,e.blockUI.defaults={message:"<h1>Please wait...</h1>",title:null,draggable:!0,theme:!1,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:.6,cursor:"wait"},cursorReset:"default",growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:.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:!1,baseZ:1e3,centerX:!0,centerY:!0,allowBodyStretch:!0,bindEvents:!0,constrainTabKey:!0,fadeIn:200,fadeOut:400,timeout:0,showOverlay:!0,focusInput:!0,focusableElements:":input:enabled:visible",onBlock:null,onUnblock:null,onOverlayClick:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg",ignoreIfBlocked:!1};var s=null,l=[];function d(d,c){var u,b,h=d==window,k=c&&c.message!==undefined?c.message:undefined;if(!(c=e.extend({},e.blockUI.defaults,c||{})).ignoreIfBlocked||!e(d).data("blockUI.isBlocked")){if(c.overlayCSS=e.extend({},e.blockUI.defaults.overlayCSS,c.overlayCSS||{}),u=e.extend({},e.blockUI.defaults.css,c.css||{}),c.onOverlayClick&&(c.overlayCSS.cursor="pointer"),b=e.extend({},e.blockUI.defaults.themedCSS,c.themedCSS||{}),k=k===undefined?c.message:k,h&&s&&a(window,{fadeOut:0}),k&&"string"!=typeof k&&(k.parentNode||k.jquery)){var y=k.jquery?k[0]:k,m={};e(d).data("blockUI.history",m),m.el=y,m.parent=y.parentNode,m.display=y.style.display,m.position=y.style.position,m.parent&&m.parent.removeChild(y)}e(d).data("blockUI.onUnblock",c.onUnblock);var g,v,I,w,U=c.baseZ;g=o||c.forceIframe?e('<iframe class="blockUI" style="z-index:'+U+++';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+c.iframeSrc+'"></iframe>'):e('<div class="blockUI" style="display:none"></div>'),v=c.theme?e('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+U+++';display:none"></div>'):e('<div class="blockUI blockOverlay" style="z-index:'+U+++';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>'),c.theme&&h?(w='<div class="blockUI '+c.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(U+10)+';display:none;position:fixed">',c.title&&(w+='<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(c.title||"&nbsp;")+"</div>"),w+='<div class="ui-widget-content ui-dialog-content"></div>',w+="</div>"):c.theme?(w='<div class="blockUI '+c.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(U+10)+';display:none;position:absolute">',c.title&&(w+='<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(c.title||"&nbsp;")+"</div>"),w+='<div class="ui-widget-content ui-dialog-content"></div>',w+="</div>"):w=h?'<div class="blockUI '+c.blockMsgClass+' blockPage" style="z-index:'+(U+10)+';display:none;position:fixed"></div>':'<div class="blockUI '+c.blockMsgClass+' blockElement" style="z-index:'+(U+10)+';display:none;position:absolute"></div>',I=e(w),k&&(c.theme?(I.css(b),I.addClass("ui-widget-content")):I.css(u)),c.theme||v.css(c.overlayCSS),v.css("position",h?"fixed":"absolute"),(o||c.forceIframe)&&g.css("opacity",0);var x=[g,v,I],C=e(h?"body":d);e.each(x,function(){this.appendTo(C)}),c.theme&&c.draggable&&e.fn.draggable&&I.draggable({handle:".ui-dialog-titlebar",cancel:"li"});var S=i&&(!e.support.boxModel||e("object,embed",h?null:d).length>0);if(n||S){if(h&&c.allowBodyStretch&&e.support.boxModel&&e("html,body").css("height","100%"),(n||!e.support.boxModel)&&!h)var E=p(d,"borderTopWidth"),O=p(d,"borderLeftWidth"),T=E?"(0 - "+E+")":0,M=O?"(0 - "+O+")":0;e.each(x,function(e,t){var o=t[0].style;if(o.position="absolute",e<2)h?o.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:"+c.quirksmodeOffsetHack+') + "px"'):o.setExpression("height",'this.parentNode.offsetHeight + "px"'),h?o.setExpression("width",'jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):o.setExpression("width",'this.parentNode.offsetWidth + "px"'),M&&o.setExpression("left",M),T&&o.setExpression("top",T);else if(c.centerY)h&&o.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'),o.marginTop=0;else if(!c.centerY&&h){var n="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+(c.css&&c.css.top?parseInt(c.css.top,10):0)+') + "px"';o.setExpression("top",n)}})}if(k&&(c.theme?I.find(".ui-widget-content").append(k):I.append(k),(k.jquery||k.nodeType)&&e(k).show()),(o||c.forceIframe)&&c.showOverlay&&g.show(),c.fadeIn){var B=c.onBlock?c.onBlock:t,j=c.showOverlay&&!k?B:t,H=k?B:t;c.showOverlay&&v._fadeIn(c.fadeIn,j),k&&I._fadeIn(c.fadeIn,H)}else c.showOverlay&&v.show(),k&&I.show(),c.onBlock&&c.onBlock.bind(I)();if(r(1,d,c),h?(s=I[0],l=e(c.focusableElements,s),c.focusInput&&setTimeout(f,20)):function(e,t,o){var n=e.parentNode,i=e.style,s=(n.offsetWidth-e.offsetWidth)/2-p(n,"borderLeftWidth"),l=(n.offsetHeight-e.offsetHeight)/2-p(n,"borderTopWidth");t&&(i.left=s>0?s+"px":"0");o&&(i.top=l>0?l+"px":"0")}(I[0],c.centerX,c.centerY),c.timeout){var z=setTimeout(function(){h?e.unblockUI(c):e(d).unblock(c)},c.timeout);e(d).data("blockUI.timeout",z)}}}function a(t,o){var n,i,d=t==window,a=e(t),u=a.data("blockUI.history"),f=a.data("blockUI.timeout");f&&(clearTimeout(f),a.removeData("blockUI.timeout")),o=e.extend({},e.blockUI.defaults,o||{}),r(0,t,o),null===o.onUnblock&&(o.onUnblock=a.data("blockUI.onUnblock"),a.removeData("blockUI.onUnblock")),i=d?e(document.body).children().filter(".blockUI").add("body > .blockUI"):a.find(">.blockUI"),o.cursorReset&&(i.length>1&&(i[1].style.cursor=o.cursorReset),i.length>2&&(i[2].style.cursor=o.cursorReset)),d&&(s=l=null),o.fadeOut?(n=i.length,i.stop().fadeOut(o.fadeOut,function(){0==--n&&c(i,u,o,t)})):c(i,u,o,t)}function c(t,o,n,i){var s=e(i);if(!s.data("blockUI.isBlocked")){t.each(function(e,t){this.parentNode&&this.parentNode.removeChild(this)}),o&&o.el&&(o.el.style.display=o.display,o.el.style.position=o.position,o.el.style.cursor="default",o.parent&&o.parent.appendChild(o.el),s.removeData("blockUI.history")),s.data("blockUI.static")&&s.css("position","static"),"function"==typeof n.onUnblock&&n.onUnblock(i,n);var l=e(document.body),d=l.width(),a=l[0].style.width;l.width(d-1).width(d),l[0].style.width=a}}function r(t,o,n){var i=o==window,l=e(o);if((t||(!i||s)&&(i||l.data("blockUI.isBlocked")))&&(l.data("blockUI.isBlocked",t),i&&n.bindEvents&&(!t||n.showOverlay))){var d="mousedown mouseup keydown keypress keyup touchstart touchend touchmove";t?e(document).on(d,n,u):e(document).off(d,u)}}function u(t){if("keydown"===t.type&&t.keyCode&&9==t.keyCode&&s&&t.data.constrainTabKey){var o=l,n=!t.shiftKey&&t.target===o[o.length-1],i=t.shiftKey&&t.target===o[0];if(n||i)return setTimeout(function(){f(i)},10),!1}var d=t.data,a=e(t.target);return a.hasClass("blockOverlay")&&d.onOverlayClick&&d.onOverlayClick(t),a.parents("div."+d.blockMsgClass).length>0||0===a.parents().children().filter("div.blockUI").length}function f(e){if(l){var t=l[!0===e?l.length-1:0];t&&t.trigger("focus")}}function p(t,o){return parseInt(e.css(t,o),10)||0}}"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],e):e(jQuery)}();