!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof exports?module.exports=e(require("jquery")):e(jQuery)}(function(_){_.fn.SumoSelect=function(e){var o=_.extend({placeholder:"Select Here",csvDispCount:3,captionFormat:"{0} Selected",captionFormatAllSelected:"{0} all selected!",floatWidth:400,forceCustomRendering:!1,nativeOnDevice:["Android","BlackBerry","iPhone","iPad","iPod","Opera Mini","IEMobile","Silk"],outputAsCSV:!1,csvSepChar:",",okCancelInMulti:!1,isClickAwayOk:!1,triggerChangeCombined:!0,selectAll:!1,search:!1,searchText:"Search...",noMatch:'No matches for "{0}"',prefix:"",locale:["OK","Cancel","Select All"],up:!1,showTitle:!0},e),t=this.each(function(){var r=this;!this.sumo&&_(this).is("select")&&(this.sumo={E:_(r),is_multi:_(r).attr("multiple"),select:"",caption:"",placeholder:"",optDiv:"",CaptionCont:"",ul:"",is_floating:!1,is_opened:!1,mob:!1,Pstate:[],createElems:function(){var e=this;e.E.wrap('<div class="SumoSelect" tabindex="0" role="button" aria-expanded="false">'),e.select=e.E.parent(),e.caption=_("<span>"),e.CaptionCont=_('<p class="CaptionCont SelectBox" ><label><i></i></label></p>').attr("style",e.E.attr("style")).prepend(e.caption),e.select.append(e.CaptionCont),e.is_multi||(o.okCancelInMulti=!1),e.E.attr("disabled")&&e.select.addClass("disabled").removeAttr("tabindex"),o.outputAsCSV&&e.is_multi&&e.E.attr("name")&&(e.select.append(_('<input class="HEMANT123" type="hidden" />').attr("name",e.E.attr("name")).val(e.getSelStr())),e.E.removeAttr("name")),!e.isMobile()||o.forceCustomRendering?(e.E.attr("name")&&e.select.addClass("sumo_"+e.E.attr("name").replace(/\[\]/,"")),e.E.addClass("SumoUnder").attr("tabindex","-1"),e.optDiv=_('<div class="optWrapper '+(o.up?"up":"")+'">'),e.floatingList(),e.ul=_('<ul class="options">'),e.optDiv.append(e.ul),o.selectAll&&e.is_multi&&e.SelAll(),o.search&&e.Search(),e.ul.append(e.prepItems(e.E.children())),e.is_multi&&e.multiSelelect(),e.select.append(e.optDiv),e.basicEvents(),e.selAllState()):e.setNativeMobile()},prepItems:function(e,a){var i=[],r=this;return _(e).each(function(e,t){t=_(t),i.push(t.is("optgroup")?_('<li class="group '+(t[0].disabled?"disabled":"")+'"><label>'+t.attr("label")+"</label><ul></ul></li>").find("ul").append(r.prepItems(t.children(),t[0].disabled)).end():r.createLi(t,a))}),i},createLi:function(e,t){e.attr("value")||e.attr("value",e.val());var a=_('<li class="opt"><label>'+e.text()+"</label></li>");return a.data("opt",e),e.data("li",a),this.is_multi&&a.prepend("<span><i></i></span>"),(e[0].disabled||t)&&(a=a.addClass("disabled")),this.onOptClick(a),e[0].selected&&a.addClass("selected"),e.attr("class")&&a.addClass(e.attr("class")),e.attr("title")&&a.attr("title",e.attr("title")),a},getSelStr:function(){return sopt=[],this.E.find("option:selected").each(function(){sopt.push(_(this).val())}),sopt.join(o.csvSepChar)},multiSelelect:function(){var a=this;a.optDiv.addClass("multiple"),a.okbtn=_('<p tabindex="0" class="btnOk">'+o.locale[0]+"</p>").click(function(){a._okbtn(),a.hideOpts()}),a.cancelBtn=_('<p tabindex="0" class="btnCancel">'+o.locale[1]+"</p>").click(function(){a._cnbtn(),a.hideOpts()});var e=a.okbtn.add(a.cancelBtn);a.optDiv.append(_('<div class="MultiControls">').append(e)),e.on("keydown.sumo",function(e){var t=_(this);switch(e.which){case 32:case 13:t.trigger("click");break;case 9:if(t.hasClass("btnOk"))return;case 27:return a._cnbtn(),void a.hideOpts()}e.stopPropagation(),e.preventDefault()})},_okbtn:function(){var a=this,i=0;o.triggerChangeCombined&&(a.E.find("option:selected").length!=a.Pstate.length?i=1:a.E.find("option").each(function(e,t){t.selected&&a.Pstate.indexOf(e)<0&&(i=1)}),i&&(a.callChange(),a.setText()))},_cnbtn:function(){var e=this;e.E.find("option:selected").each(function(){this.selected=!1}),e.optDiv.find("li.selected").removeClass("selected");for(var t=0;t<e.Pstate.length;t++)e.E.find("option")[e.Pstate[t]].selected=!0,e.ul.find("li.opt").eq(e.Pstate[t]).addClass("selected");e.selAllState()},SelAll:function(){var e=this;e.is_multi&&(e.selAll=_('<p class="select-all"><span><i></i></span><label>'+o.locale[2]+"</label></p>"),e.optDiv.addClass("selall"),e.selAll.on("click",function(){e.selAll.toggleClass("selected"),e.toggSelAll(e.selAll.hasClass("selected"),1)}),e.optDiv.prepend(e.selAll))},Search:function(){var i=this,e=i.CaptionCont.addClass("search"),t=_('<p class="no-match">');i.ftxt=_('<input type="text" class="search-txt" value="" placeholder="'+o.searchText+'">').on("click",function(e){e.stopPropagation()}),e.append(i.ftxt),i.optDiv.children("ul").after(t),i.ftxt.on("keyup.sumo",function(){var e=i.optDiv.find("ul.options li.opt").each(function(e,t){var a=(t=_(t)).data("opt")[0];a.hidden=t.text().toLowerCase().indexOf(i.ftxt.val().toLowerCase())<0,t.toggleClass("hidden",a.hidden)}).not(".hidden");t.html(o.noMatch.replace(/\{0\}/g,"<em></em>")).toggle(!e.length),t.find("em").text(i.ftxt.val()),i.selAllState()})},selAllState:function(){var e=this;if(o.selectAll&&e.is_multi){var a=0,i=0;e.optDiv.find("li.opt").not(".hidden").each(function(e,t){_(t).hasClass("selected")&&a++,_(t).hasClass("disabled")||i++}),a==i?e.selAll.removeClass("partial").addClass("selected"):0==a?e.selAll.removeClass("selected partial"):e.selAll.addClass("partial")}},showOpts:function(){var t=this;t.E.attr("disabled")||(t.E.trigger("sumo:opening",t),t.is_opened=!0,t.select.addClass("open").attr("aria-expanded","true"),t.E.trigger("sumo:opened",t),t.ftxt?t.ftxt.focus():t.select.focus(),_(document).on("click.sumo",function(e){if(!t.select.is(e.target)&&0===t.select.has(e.target).length){if(!t.is_opened)return;t.hideOpts(),o.okCancelInMulti&&(o.isClickAwayOk?t._okbtn():t._cnbtn())}}),t.is_floating&&(H=t.optDiv.children("ul").outerHeight()+2,t.is_multi&&(H+=parseInt(t.optDiv.css("padding-bottom"))),t.optDiv.css("height",H),_("body").addClass("sumoStopScroll")),t.setPstate())},setPstate:function(){var a=this;a.is_multi&&(a.is_floating||o.okCancelInMulti)&&(a.Pstate=[],a.E.find("option").each(function(e,t){t.selected&&a.Pstate.push(e)}))},callChange:function(){this.E.trigger("change").trigger("click")},hideOpts:function(){var e=this;e.is_opened&&(e.E.trigger("sumo:closing",e),e.is_opened=!1,e.select.removeClass("open").attr("aria-expanded","true").find("ul li.sel").removeClass("sel"),e.E.trigger("sumo:closed",e),_(document).off("click.sumo"),e.select.focus(),_("body").removeClass("sumoStopScroll"),o.search&&(e.ftxt.val(""),e.ftxt.trigger("keyup.sumo")))},setOnOpen:function(){var e=this,t=e.optDiv.find("li.opt:not(.hidden)").eq(o.search?0:e.E[0].selectedIndex);t.hasClass("disabled")&&!(t=t.next(":not(disabled)")).length||(e.optDiv.find("li.sel").removeClass("sel"),t.addClass("sel"),e.showOpts())},nav:function(e){var t,a=this,i=a.ul.find("li.opt:not(.disabled, .hidden)"),r=a.ul.find("li.opt.sel:not(.hidden)"),o=i.index(r);if(a.is_opened&&r.length){if(e&&0<o)t=i.eq(o-1);else{if(!(!e&&o<i.length-1&&-1<o))return;t=i.eq(o+1)}r.removeClass("sel"),r=t.addClass("sel");var _=a.ul,s=_.scrollTop(),n=r.position().top+s;n>=s+_.height()-r.outerHeight()&&_.scrollTop(n-_.height()+r.outerHeight()),n<s&&_.scrollTop(n)}else a.setOnOpen()},basicEvents:function(){var t=this;t.CaptionCont.click(function(e){t.E.trigger("click"),t.is_opened?t.hideOpts():t.showOpts(),e.stopPropagation()}),t.select.on("keydown.sumo",function(e){switch(e.which){case 38:t.nav(!0);break;case 40:t.nav(!1);break;case 65:if(t.is_multi&&e.ctrlKey){t.toggSelAll(!e.shiftKey,1);break}return;case 32:if(o.search&&t.ftxt.is(e.target))return;case 13:t.is_opened?t.optDiv.find("ul li.sel").trigger("click"):t.setOnOpen();break;case 9:return void(o.okCancelInMulti||t.hideOpts());case 27:return o.okCancelInMulti&&t._cnbtn(),void t.hideOpts();default:return}e.preventDefault()}),_(window).on("resize.sumo",function(){t.floatingList()})},onOptClick:function(e){var t=this;e.click(function(){var e=_(this);if(!e.hasClass("disabled")){t.is_multi?(e.toggleClass("selected"),e.data("opt")[0].selected=e.hasClass("selected"),t.selAllState()):(e.parent().find("li.selected").removeClass("selected"),e.toggleClass("selected"),e.data("opt")[0].selected=!0),t.is_multi&&o.triggerChangeCombined&&(t.is_floating||o.okCancelInMulti)||(t.setText(),t.callChange()),t.is_multi||t.hideOpts()}})},setText:function(){var e=this;if(e.placeholder="",e.is_multi){for(sels=e.E.find(":selected").not(":disabled"),i=0;i<sels.length;i++){if(i+1>=o.csvDispCount&&o.csvDispCount){sels.length==e.E.find("option").length&&o.captionFormatAllSelected?e.placeholder=o.captionFormatAllSelected.replace(/\{0\}/g,sels.length)+",":e.placeholder=o.captionFormat.replace(/\{0\}/g,sels.length)+",";break}e.placeholder+=_(sels[i]).text()+", "}e.placeholder=e.placeholder.replace(/,([^,]*)$/,"$1")}else e.placeholder=e.E.find(":selected").not(":disabled").text();var t=!1;e.placeholder||(t=!0,e.placeholder=e.E.attr("placeholder"),e.placeholder||(e.placeholder=e.E.find("option:disabled:selected").text())),e.placeholder=e.placeholder?o.prefix+" "+e.placeholder:o.placeholder,e.caption.html(e.placeholder),o.showTitle&&e.CaptionCont.attr("title",e.placeholder);var a=e.select.find("input.HEMANT123");return a.length&&a.val(e.getSelStr()),t?e.caption.addClass("placeholder"):e.caption.removeClass("placeholder"),e.placeholder},isMobile:function(){for(var e=navigator.userAgent||navigator.vendor||window.opera,t=0;t<o.nativeOnDevice.length;t++)if(0<e.toString().toLowerCase().indexOf(o.nativeOnDevice[t].toLowerCase()))return o.nativeOnDevice[t];return!1},setNativeMobile:function(){var e=this;e.E.addClass("SelectClass"),e.mob=!0,e.E.change(function(){e.setText()})},floatingList:function(){var e=this;e.is_floating=_(window).width()<=o.floatWidth,e.optDiv.toggleClass("isFloating",e.is_floating),e.is_floating||e.optDiv.css("height",""),e.optDiv.toggleClass("okCancelInMulti",o.okCancelInMulti&&!e.is_floating)},vRange:function(e){if(this.E.find("option").length<=e||e<0)throw"index out of bounds";return this},toggSel:function(e,t){var a,i=this;(a="number"==typeof t?(i.vRange(t),i.E.find("option")[t]):i.E.find('option[value="'+t+'"]')[0]||0)&&!a.disabled&&a.selected!=e&&(a.selected=e,i.mob||_(a).data("li").toggleClass("selected",e),i.callChange(),i.setPstate(),i.setText(),i.selAllState())},toggDis:function(e,t){var a=this.vRange(t);(a.E.find("option")[t].disabled=e)&&(a.E.find("option")[t].selected=!1),a.mob||a.optDiv.find("ul.options li").eq(t).toggleClass("disabled",e).removeClass("selected"),a.setText()},toggSumo:function(e){var t=this;return t.enabled=e,t.select.toggleClass("disabled",e),e?(t.E.attr("disabled","disabled"),t.select.removeAttr("tabindex")):(t.E.removeAttr("disabled"),t.select.attr("tabindex","0")),t},toggSelAll:function(i,e){var t=this;t.E.find("option:not(:disabled,:hidden)").each(function(e,t){var a=t.selected;(t=_(t).data("li")).hasClass("hidden")||(i?a||t.trigger("click"):a&&t.trigger("click"))}),e||(!t.mob&&t.selAll&&t.selAll.removeClass("partial").toggleClass("selected",!!i),t.callChange(),t.setText(),t.setPstate())},reload:function(){var e=this.unload();return _(e).SumoSelect(o)},unload:function(){var e=this;return e.select.before(e.E),e.E.show(),o.outputAsCSV&&e.is_multi&&e.select.find("input.HEMANT123").length&&e.E.attr("name",e.select.find("input.HEMANT123").attr("name")),e.select.remove(),delete r.sumo,r},add:function(e,t,a){if(void 0===e)throw"No value to add";var i=this;if(opts=i.E.find("option"),"number"==typeof t&&(a=t,t=e),void 0===t&&(t=e),opt=_("<option></option>").val(e).html(t),opts.length<a)throw"index out of bounds";return void 0===a||opts.length==a?(i.E.append(opt),i.mob||i.ul.append(i.createLi(opt))):(opts.eq(a).before(opt),i.mob||i.ul.find("li.opt").eq(a).before(i.createLi(opt))),r},remove:function(e){var t=this.vRange(e);t.E.find("option").eq(e).remove(),t.mob||t.optDiv.find("ul.options li").eq(e).remove(),t.setText()},selectItem:function(e){this.toggSel(!0,e)},unSelectItem:function(e){this.toggSel(!1,e)},selectAll:function(){this.toggSelAll(!0)},unSelectAll:function(){this.toggSelAll(!1)},disableItem:function(e){this.toggDis(!0,e)},enableItem:function(e){this.toggDis(!1,e)},enabled:!0,enable:function(){return this.toggSumo(!1)},disable:function(){return this.toggSumo(!0)},init:function(){return this.createElems(),this.setText(),this}},r.sumo.init())});return 1==t.length?t[0]:t}}),function(t,a,i){"function"==typeof define&&define.amd?define(["jquery"],function(e){return i(e,t,a),e.mobile}):i(t.jQuery,t,a)}(this,document,function(e,t,r,a){var i,o;(function(c,e,t,d){function h(e){for(;e&&void 0!==e.originalEvent;)e=e.originalEvent;return e}function o(e){for(var t,a,i={};e;){for(a in t=c.data(e,j))t[a]&&(i[a]=i.hasVirtualBinding=!0);e=e.parentNode}return i}function r(){M=!0}function _(){M=!1}function s(){n(),k=setTimeout(function(){B=k=0,T.length=0,O=!1,r()},c.vmouse.resetTimerDuration)}function n(){k&&(clearTimeout(k),k=0)}function l(e,t,a){var i;return(a&&a[e]||!a&&function(e,t){for(var a;e;){if((a=c.data(e,j))&&(!t||a[t]))return e;e=e.parentNode}return null}(t.target,e))&&(i=function(e,t){var a,i,r,o,_,s,n,l,g,u=e.type;if((e=c.Event(e)).type=t,a=e.originalEvent,i=c.event.props,-1<u.search(/^(mouse|click)/)&&(i=C),a)for(n=i.length;n;)e[o=i[--n]]=a[o];if(-1<u.search(/mouse(down|up)|click/)&&!e.which&&(e.which=1),-1!==u.search(/^touch/)&&(u=(r=h(a)).touches,_=r.changedTouches,s=u&&u.length?u[0]:_&&_.length?_[0]:d))for(l=0,g=v.length;l<g;l++)e[o=v[l]]=s[o];return e}(t,e),c(t.target).trigger(i)),i}function g(e){var t=c.data(e.target,Q);if(!(O||B&&B===t)){var a=l("v"+e.type,e);a&&(a.isDefaultPrevented()&&e.preventDefault(),a.isPropagationStopped()&&e.stopPropagation(),a.isImmediatePropagationStopped()&&e.stopImmediatePropagation())}}function u(e){var t,a,i=h(e).touches;if(i&&1===i.length&&(a=o(t=e.target)).hasVirtualBinding){B=A++,c.data(t,Q,B),n(),_(),z=!1;var r=h(e).touches[0];E=r.pageX,I=r.pageY,l("vmouseover",e,a),l("vmousedown",e,a)}}function b(e){M||(z||l("vmousecancel",e,o(e.target)),z=!0,s())}function p(e){if(!M){var t=h(e).touches[0],a=z,i=c.vmouse.moveDistanceThreshold,r=o(e.target);(z=z||Math.abs(t.pageX-E)>i||Math.abs(t.pageY-I)>i)&&!a&&l("vmousecancel",e,r),l("vmousemove",e,r),s()}}function m(e){if(!M){r();var t,a=o(e.target);if(l("vmouseup",e,a),!z){var i=l("vclick",e,a);i&&i.isDefaultPrevented()&&(t=h(e).changedTouches[0],T.push({touchID:B,x:t.clientX,y:t.clientY}),O=!0)}l("vmouseout",e,a),z=!1,s()}}function w(e){var t,a=c.data(e,j);if(a)for(t in a)if(a[t])return!0;return!1}function y(){}function a(r){var o=r.substr(1);return{setup:function(e,t){w(this)||c.data(this,j,{}),c.data(this,j)[r]=!0,S[r]=(S[r]||0)+1,1===S[r]&&F.bind(o,g),c(this).bind(o,y),D&&(S.touchstart=(S.touchstart||0)+1,1===S.touchstart&&F.bind("touchstart",u).bind("touchend",m).bind("touchmove",p).bind("scroll",b))},teardown:function(e,t){--S[r],S[r]||F.unbind(o,g),D&&(--S.touchstart,S.touchstart||F.unbind("touchstart",u).unbind("touchmove",p).unbind("touchend",m).unbind("scroll",b));var a=c(this),i=c.data(this,j);i&&(i[r]=!1),a.unbind(o,y),w(this)||a.removeData(j)}}}var f,j="virtualMouseBindings",Q="virtualTouchID",i="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),v="clientX clientY pageX pageY screenX screenY".split(" "),x=c.event.mouseHooks?c.event.mouseHooks.props:[],C=c.event.props.concat(x),S={},k=0,E=0,I=0,z=!1,T=[],O=!1,M=!1,D="addEventListener"in t,F=c(t),A=1,B=0;c.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500};for(var H=0;H<i.length;H++)c.event.special[i[H]]=a(i[H]);D&&t.addEventListener("click",function(e){var t,a,i,r,o,_=T.length,s=e.target;if(_)for(t=e.clientX,a=e.clientY,f=c.vmouse.clickDistanceThreshold,i=s;i;){for(r=0;r<_;r++)if(o=T[r],0,i===s&&Math.abs(o.x-t)<f&&Math.abs(o.y-a)<f||c.data(i,Q)===o.touchID)return e.preventDefault(),void e.stopPropagation();i=i.parentNode}},!0)})(e,0,r),e.mobile={},o={touch:"ontouchend"in r},(i=e).mobile.support=i.mobile.support||{},i.extend(i.support,o),i.extend(i.mobile.support,o),function(n,e,t){function l(e,t,a){var i=a.type;a.type=t,n.event.dispatch.call(e,a),a.type=i}var g=n(r);n.each("touchstart touchmove touchend tap taphold swipe swipeleft swiperight scrollstart scrollstop".split(" "),function(e,t){n.fn[t]=function(e){return e?this.bind(t,e):this.trigger(t)},n.attrFn&&(n.attrFn[t]=!0)});var a=n.mobile.support.touch,i=a?"touchstart":"mousedown",o=a?"touchend":"mouseup",_=a?"touchmove":"mousemove";n.event.special.scrollstart={enabled:!0,setup:function(){function t(e,t){l(r,(a=t)?"scrollstart":"scrollstop",e)}var a,i,r=this;n(r).bind("touchmove scroll",function(e){n.event.special.scrollstart.enabled&&(a||t(e,!0),clearTimeout(i),i=setTimeout(function(){t(e,!1)},50))})}},n.event.special.tap={tapholdThreshold:750,setup:function(){var _=this,s=n(_);s.bind("vmousedown",function(e){function t(){clearTimeout(r)}function a(){t(),s.unbind("vclick",i).unbind("vmouseup",t),g.unbind("vmousecancel",a)}function i(e){a(),o===e.target&&l(_,"tap",e)}if(e.which&&1!==e.which)return!1;var r,o=e.target;e.originalEvent;s.bind("vmouseup",t).bind("vclick",i),g.bind("vmousecancel",a),r=setTimeout(function(){l(_,"taphold",n.Event("taphold",{target:o}))},n.event.special.tap.tapholdThreshold)})}},n.event.special.swipe={scrollSupressionThreshold:10,durationThreshold:1e3,horizontalDistanceThreshold:10,verticalDistanceThreshold:475,start:function(e){var t=e.originalEvent.touches?e.originalEvent.touches[0]:e;return{time:(new Date).getTime(),coords:[t.pageX,t.pageY],origin:n(e.target)}},stop:function(e){var t=e.originalEvent.touches?e.originalEvent.touches[0]:e;return{time:(new Date).getTime(),coords:[t.pageX,t.pageY]}},handleSwipe:function(e,t){t.time-e.time<n.event.special.swipe.durationThreshold&&Math.abs(e.coords[0]-t.coords[0])>n.event.special.swipe.horizontalDistanceThreshold&&Math.abs(e.coords[1]-t.coords[1])<n.event.special.swipe.verticalDistanceThreshold&&e.origin.trigger("swipe").trigger(e.coords[0]>t.coords[0]?"swipeleft":"swiperight")},setup:function(){var r=n(this);r.bind(i,function(e){function t(e){i&&(a=n.event.special.swipe.stop(e),Math.abs(i.coords[0]-a.coords[0])>n.event.special.swipe.scrollSupressionThreshold&&e.preventDefault())}var a,i=n.event.special.swipe.start(e);r.bind(_,t).one(o,function(){r.unbind(_,t),i&&a&&n.event.special.swipe.handleSwipe(i,a),i=a=void 0})})}},n.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe",swiperight:"swipe"},function(e,t){n.event.special[e]={setup:function(){n(this).bind(t,n.noop)}}})}(e)}),function(_){function t(e){var t=e||window.event,a=[].slice.call(arguments,1),i=0,r=0,o=0;return(e=_.event.fix(t)).type="mousewheel",t.wheelDelta&&(i=t.wheelDelta/120),t.detail&&(i=-t.detail/3),o=i,void 0!==t.axis&&t.axis===t.HORIZONTAL_AXIS&&(o=0,r=-1*i),void 0!==t.wheelDeltaY&&(o=t.wheelDeltaY/120),void 0!==t.wheelDeltaX&&(r=-1*t.wheelDeltaX/120),a.unshift(e,i,r,o),(_.event.dispatch||_.event.handle).apply(this,a)}var a=["DOMMouseScroll","mousewheel"];if(_.event.fixHooks)for(var e=a.length;e;)_.event.fixHooks[a[--e]]=_.event.mouseHooks;_.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var e=a.length;e;)this.addEventListener(a[--e],t,!1);else this.onmousewheel=t},teardown:function(){if(this.removeEventListener)for(var e=a.length;e;)this.removeEventListener(a[--e],t,!1);else this.onmousewheel=null}},_.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}(jQuery),function(x){var t={init:function(d){d=x.extend(!0,{set_width:!1,set_height:!1,horizontalScroll:!1,scrollInertia:950,mouseWheel:!0,mouseWheelPixels:"auto",autoDraggerLength:!0,autoHideScrollbar:!1,snapAmount:null,snapOffset:0,scrollButtons:{enable:!1,scrollType:"continuous",scrollSpeed:"auto",scrollAmount:40},advanced:{updateOnBrowserResize:!0,updateOnContentResize:!1,autoExpandHorizontalScroll:!1,autoScrollOnFocus:!0,normalizeMouseWheelDelta:!1},contentTouchScroll:!0,callbacks:{onScrollStart:function(){},onScroll:function(){},onTotalScroll:function(){},onTotalScrollBack:function(){},onTotalScrollOffset:0,onTotalScrollBackOffset:0,whileScrolling:function(){}},theme:"light"},d);return this.each(function(){var a=x(this);if(d.set_width&&a.css("width",d.set_width),d.set_height&&a.css("height",d.set_height),x(document).data("mCustomScrollbar-index")){var e=parseInt(x(document).data("mCustomScrollbar-index"));x(document).data("mCustomScrollbar-index",e+1)}else x(document).data("mCustomScrollbar-index","1");a.wrapInner("<div class='mCustomScrollBox mCS-"+d.theme+"' id='mCSB_"+x(document).data("mCustomScrollbar-index")+"' style='position:relative; height:100%; overflow:hidden; max-width:100%;' />").addClass("mCustomScrollbar _mCS_"+x(document).data("mCustomScrollbar-index"));var i=a.children(".mCustomScrollBox");if(d.horizontalScroll){i.addClass("mCSB_horizontal").wrapInner("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />");var t=i.children(".mCSB_h_wrapper");t.wrapInner("<div class='mCSB_container' style='position:absolute; left:0;' />").children(".mCSB_container").css({width:t.children().outerWidth(),position:"relative"}).unwrap()}else i.wrapInner("<div class='mCSB_container' style='position:relative; top:0;' />");var r=i.children(".mCSB_container");x.support.touch&&r.addClass("mCS_touch"),r.after("<div class='mCSB_scrollTools' style='position:absolute;'><div class='mCSB_draggerContainer'><div class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' style='position:relative;'></div></div><div class='mCSB_draggerRail'></div></div></div>");var o=i.children(".mCSB_scrollTools"),_=o.children(".mCSB_draggerContainer").children(".mCSB_dragger");if(d.horizontalScroll?_.data("minDraggerWidth",_.width()):_.data("minDraggerHeight",_.height()),d.scrollButtons.enable&&(d.horizontalScroll?o.prepend("<a class='mCSB_buttonLeft' oncontextmenu='return false;'></a>").append("<a class='mCSB_buttonRight' oncontextmenu='return false;'></a>"):o.prepend("<a class='mCSB_buttonUp' oncontextmenu='return false;'></a>").append("<a class='mCSB_buttonDown' oncontextmenu='return false;'></a>")),i.bind("scroll",function(){a.is(".mCS_disabled")||i.scrollTop(0).scrollLeft(0)}),a.data({mCS_Init:!0,mCustomScrollbarIndex:x(document).data("mCustomScrollbar-index"),horizontalScroll:d.horizontalScroll,scrollInertia:d.scrollInertia,scrollEasing:"mcsEaseOut",mouseWheel:d.mouseWheel,mouseWheelPixels:d.mouseWheelPixels,autoDraggerLength:d.autoDraggerLength,autoHideScrollbar:d.autoHideScrollbar,snapAmount:d.snapAmount,snapOffset:d.snapOffset,scrollButtons_enable:d.scrollButtons.enable,scrollButtons_scrollType:d.scrollButtons.scrollType,scrollButtons_scrollSpeed:d.scrollButtons.scrollSpeed,scrollButtons_scrollAmount:d.scrollButtons.scrollAmount,autoExpandHorizontalScroll:d.advanced.autoExpandHorizontalScroll,autoScrollOnFocus:d.advanced.autoScrollOnFocus,normalizeMouseWheelDelta:d.advanced.normalizeMouseWheelDelta,contentTouchScroll:d.contentTouchScroll,onScrollStart_Callback:d.callbacks.onScrollStart,onScroll_Callback:d.callbacks.onScroll,onTotalScroll_Callback:d.callbacks.onTotalScroll,onTotalScrollBack_Callback:d.callbacks.onTotalScrollBack,onTotalScroll_Offset:d.callbacks.onTotalScrollOffset,onTotalScrollBack_Offset:d.callbacks.onTotalScrollBackOffset,whileScrolling_Callback:d.callbacks.whileScrolling,bindEvent_scrollbar_drag:!1,bindEvent_content_touch:!1,bindEvent_scrollbar_click:!1,bindEvent_mousewheel:!1,bindEvent_buttonsContinuous_y:!1,bindEvent_buttonsContinuous_x:!1,bindEvent_buttonsPixels_y:!1,bindEvent_buttonsPixels_x:!1,bindEvent_focusin:!1,bindEvent_autoHideScrollbar:!1,mCSB_buttonScrollRight:!1,mCSB_buttonScrollLeft:!1,mCSB_buttonScrollDown:!1,mCSB_buttonScrollUp:!1}),d.horizontalScroll)"none"!==a.css("max-width")&&(d.advanced.updateOnContentResize||(d.advanced.updateOnContentResize=!0));else if("none"!==a.css("max-height")){var s=!1,n=parseInt(a.css("max-height"));0<=a.css("max-height").indexOf("%")&&(s=n,n=a.parent().height()*s/100),a.css("overflow","hidden"),i.css("max-height",n)}if(a.mCustomScrollbar("update"),d.advanced.updateOnBrowserResize){var l,g=x(window).width(),u=x(window).height();x(window).bind("resize."+a.data("mCustomScrollbarIndex"),function(){l&&clearTimeout(l),l=setTimeout(function(){if(!a.is(".mCS_disabled")&&!a.is(".mCS_destroyed")){var e=x(window).width(),t=x(window).height();g===e&&u===t||("none"!==a.css("max-height")&&s&&i.css("max-height",a.parent().height()*s/100),a.mCustomScrollbar("update"),g=e,u=t)}},150)})}if(d.advanced.updateOnContentResize){if(d.horizontalScroll)var c=r.outerWidth();else c=r.outerHeight();setInterval(function(){if(d.horizontalScroll){d.advanced.autoExpandHorizontalScroll&&r.css({position:"absolute",width:"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:r.outerWidth(),position:"relative"}).unwrap();var e=r.outerWidth()}else e=r.outerHeight();e!=c&&(a.mCustomScrollbar("update"),c=e)},300)}})},update:function(){var e=x(this),t=e.children(".mCustomScrollBox"),a=t.children(".mCSB_container");a.removeClass("mCS_no_scrollbar"),e.removeClass("mCS_disabled mCS_destroyed"),t.scrollTop(0).scrollLeft(0);var i=t.children(".mCSB_scrollTools"),r=i.children(".mCSB_draggerContainer"),o=r.children(".mCSB_dragger");if(e.data("horizontalScroll")){var _=i.children(".mCSB_buttonLeft"),s=i.children(".mCSB_buttonRight"),n=t.width();e.data("autoExpandHorizontalScroll")&&a.css({position:"absolute",width:"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:a.outerWidth(),position:"relative"}).unwrap();var l=a.outerWidth()}else var g=i.children(".mCSB_buttonUp"),u=i.children(".mCSB_buttonDown"),c=t.height(),d=a.outerHeight();if(c<d&&!e.data("horizontalScroll")){i.css("display","block");var h=r.height();if(e.data("autoDraggerLength")){var b=Math.round(c/d*h),p=o.data("minDraggerHeight");if(b<=p)o.css({height:p});else if(h-10<=b){var m=h-10;o.css({height:m})}else o.css({height:b});o.children(".mCSB_dragger_bar").css({"line-height":o.height()+"px"})}var w=(d-c)/(h-o.height());e.data("scrollAmount",w).mCustomScrollbar("scrolling",t,a,r,o,g,u,_,s);var y=Math.abs(a.position().top);e.mCustomScrollbar("scrollTo",y,{scrollInertia:0,trigger:"internal"})}else if(n<l&&e.data("horizontalScroll")){i.css("display","block");var f=r.width();if(e.data("autoDraggerLength")){var j=Math.round(n/l*f),Q=o.data("minDraggerWidth");if(j<=Q)o.css({width:Q});else if(f-10<=j){var v=f-10;o.css({width:v})}else o.css({width:j})}w=(l-n)/(f-o.width());e.data("scrollAmount",w).mCustomScrollbar("scrolling",t,a,r,o,g,u,_,s);y=Math.abs(a.position().left);e.mCustomScrollbar("scrollTo",y,{scrollInertia:0,trigger:"internal"})}else t.unbind("mousewheel focusin"),e.data("horizontalScroll")?o.add(a).css("left",0):o.add(a).css("top",0),i.css("display","none"),a.addClass("mCS_no_scrollbar"),e.data({bindEvent_mousewheel:!1,bindEvent_focusin:!1})},scrolling:function(r,s,n,l,e,t,a,i){var _,g,o,u,c,d,h,b,p,m=x(this);m.data("bindEvent_scrollbar_drag")||(x.support.msPointer?(l.bind("MSPointerDown",function(e){e.preventDefault(),m.data({on_drag:!0}),l.addClass("mCSB_dragger_onDrag");var t=x(this),a=t.offset(),i=e.originalEvent.pageX-a.left,r=e.originalEvent.pageY-a.top;i<t.width()&&0<i&&r<t.height()&&0<r&&(_=r,g=i)}),x(document).bind("MSPointerMove."+m.data("mCustomScrollbarIndex"),function(e){if(e.preventDefault(),m.data("on_drag")){var t=l.offset(),a=e.originalEvent.pageX-t.left,i=e.originalEvent.pageY-t.top;w(_,g,i,a)}}).bind("MSPointerUp."+m.data("mCustomScrollbarIndex"),function(e){m.data({on_drag:!1}),l.removeClass("mCSB_dragger_onDrag")})):(l.bind("mousedown touchstart",function(e){e.preventDefault(),e.stopImmediatePropagation();var t,a,i=x(this),r=i.offset();if("touchstart"===e.type){var o=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0];t=o.pageX-r.left,a=o.pageY-r.top}else m.data({on_drag:!0}),l.addClass("mCSB_dragger_onDrag"),t=e.pageX-r.left,a=e.pageY-r.top;t<i.width()&&0<t&&a<i.height()&&0<a&&(_=a,g=t)}).bind("touchmove",function(e){e.preventDefault(),e.stopImmediatePropagation();var t=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0],a=x(this).offset(),i=t.pageX-a.left,r=t.pageY-a.top;w(_,g,r,i)}),x(document).bind("mousemove."+m.data("mCustomScrollbarIndex"),function(e){if(m.data("on_drag")){var t=l.offset(),a=e.pageX-t.left,i=e.pageY-t.top;w(_,g,i,a)}}).bind("mouseup."+m.data("mCustomScrollbarIndex"),function(e){m.data({on_drag:!1}),l.removeClass("mCSB_dragger_onDrag")})),m.data({bindEvent_scrollbar_drag:!0}));function w(e,t,a,i){m.data("horizontalScroll")?m.mCustomScrollbar("scrollTo",l.position().left-t+i,{moveDragger:!0,trigger:"internal"}):m.mCustomScrollbar("scrollTo",l.position().top-e+a,{moveDragger:!0,trigger:"internal"})}x.support.touch&&m.data("contentTouchScroll")&&(m.data("bindEvent_content_touch")||(s.bind("touchstart",function(e){e.stopImmediatePropagation(),o=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0],u=x(this),c=u.offset(),h=o.pageX-c.left,d=o.pageY-c.top,b=d,p=h}),s.bind("touchmove",function(e){e.preventDefault(),e.stopImmediatePropagation(),o=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0],u=x(this).parent(),c=u.offset(),h=o.pageX-c.left,d=o.pageY-c.top,m.data("horizontalScroll")?m.mCustomScrollbar("scrollTo",p-h,{trigger:"internal"}):m.mCustomScrollbar("scrollTo",b-d,{trigger:"internal"})})));if(m.data("bindEvent_scrollbar_click")||(n.bind("click",function(e){var t=(e.pageY-n.offset().top)*m.data("scrollAmount"),a=x(e.target);m.data("horizontalScroll")&&(t=(e.pageX-n.offset().left)*m.data("scrollAmount")),(a.hasClass("mCSB_draggerContainer")||a.hasClass("mCSB_draggerRail"))&&m.mCustomScrollbar("scrollTo",t,{trigger:"internal",scrollEasing:"draggerRailEase"})}),m.data({bindEvent_scrollbar_click:!0})),m.data("mouseWheel")&&(m.data("bindEvent_mousewheel")||(r.bind("mousewheel",function(e,t){var a,i=m.data("mouseWheelPixels"),r=Math.abs(s.position().top),o=l.position().top,_=n.height()-l.height();m.data("normalizeMouseWheelDelta")&&(t=t<0?-1:1),"auto"===i&&(i=100+Math.round(m.data("scrollAmount")/2)),m.data("horizontalScroll")&&(o=l.position().left,_=n.width()-l.width(),r=Math.abs(s.position().left)),(0<t&&0!==o||t<0&&o!==_)&&(e.preventDefault(),e.stopImmediatePropagation()),a=r-t*i,m.mCustomScrollbar("scrollTo",a,{trigger:"internal"})}),m.data({bindEvent_mousewheel:!0}))),m.data("scrollButtons_enable"))if("pixels"===m.data("scrollButtons_scrollType")){function y(e){l.data("preventAction")||(l.data("preventAction",!0),m.mCustomScrollbar("scrollTo",e,{trigger:"internal"}))}m.data("horizontalScroll")?(i.add(a).unbind("mousedown touchstart MSPointerDown mouseup MSPointerUp mouseout MSPointerOut touchend",f,j),m.data({bindEvent_buttonsContinuous_x:!1}),m.data("bindEvent_buttonsPixels_x")||(i.bind("click",function(e){e.preventDefault(),y(Math.abs(s.position().left)+m.data("scrollButtons_scrollAmount"))}),a.bind("click",function(e){e.preventDefault(),y(Math.abs(s.position().left)-m.data("scrollButtons_scrollAmount"))}),m.data({bindEvent_buttonsPixels_x:!0}))):(t.add(e).unbind("mousedown touchstart MSPointerDown mouseup MSPointerUp mouseout MSPointerOut touchend",f,j),m.data({bindEvent_buttonsContinuous_y:!1}),m.data("bindEvent_buttonsPixels_y")||(t.bind("click",function(e){e.preventDefault(),y(Math.abs(s.position().top)+m.data("scrollButtons_scrollAmount"))}),e.bind("click",function(e){e.preventDefault(),y(Math.abs(s.position().top)-m.data("scrollButtons_scrollAmount"))}),m.data({bindEvent_buttonsPixels_y:!0})))}else{if(m.data("horizontalScroll")){if(i.add(a).unbind("click"),m.data({bindEvent_buttonsPixels_x:!1}),!m.data("bindEvent_buttonsContinuous_x")){i.bind("mousedown touchstart MSPointerDown",function(e){e.preventDefault();var t=Q();m.data({mCSB_buttonScrollRight:setInterval(function(){m.mCustomScrollbar("scrollTo",Math.abs(s.position().left)+t,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var f=function(e){e.preventDefault(),clearInterval(m.data("mCSB_buttonScrollRight"))};i.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",f),a.bind("mousedown touchstart MSPointerDown",function(e){e.preventDefault();var t=Q();m.data({mCSB_buttonScrollLeft:setInterval(function(){m.mCustomScrollbar("scrollTo",Math.abs(s.position().left)-t,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var j=function(e){e.preventDefault(),clearInterval(m.data("mCSB_buttonScrollLeft"))};a.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",j),m.data({bindEvent_buttonsContinuous_x:!0})}}else if(t.add(e).unbind("click"),m.data({bindEvent_buttonsPixels_y:!1}),!m.data("bindEvent_buttonsContinuous_y")){t.bind("mousedown touchstart MSPointerDown",function(e){e.preventDefault();var t=Q();m.data({mCSB_buttonScrollDown:setInterval(function(){m.mCustomScrollbar("scrollTo",Math.abs(s.position().top)+t,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});t.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",function(e){e.preventDefault(),clearInterval(m.data("mCSB_buttonScrollDown"))}),e.bind("mousedown touchstart MSPointerDown",function(e){e.preventDefault();var t=Q();m.data({mCSB_buttonScrollUp:setInterval(function(){m.mCustomScrollbar("scrollTo",Math.abs(s.position().top)-t,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});e.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",function(e){e.preventDefault(),clearInterval(m.data("mCSB_buttonScrollUp"))}),m.data({bindEvent_buttonsContinuous_y:!0})}function Q(){var e=m.data("scrollButtons_scrollSpeed");return"auto"===m.data("scrollButtons_scrollSpeed")&&(e=Math.round((m.data("scrollInertia")+100)/40)),e}}m.data("autoScrollOnFocus")&&(m.data("bindEvent_focusin")||(r.bind("focusin",function(){r.scrollTop(0).scrollLeft(0);var e=x(document.activeElement);if(e.is("input,textarea,select,button,a[tabindex],area,object")){var t=s.position().top,a=e.position().top,i=r.height()-e.outerHeight();m.data("horizontalScroll")&&(t=s.position().left,a=e.position().left,i=r.width()-e.outerWidth()),(t+a<0||i<t+a)&&m.mCustomScrollbar("scrollTo",a,{trigger:"internal"})}}),m.data({bindEvent_focusin:!0}))),m.data("autoHideScrollbar")&&(m.data("bindEvent_autoHideScrollbar")||(r.bind("mouseenter",function(e){r.addClass("mCS-mouse-over"),v.showScrollbar.call(r.children(".mCSB_scrollTools"))}).bind("mouseleave touchend",function(e){r.removeClass("mCS-mouse-over"),"mouseleave"===e.type&&v.hideScrollbar.call(r.children(".mCSB_scrollTools"))}),m.data({bindEvent_autoHideScrollbar:!0})))},scrollTo:function(e,t){var a,i,r,o,_,s=x(this),n={moveDragger:!1,trigger:"external",callbacks:!0,scrollInertia:s.data("scrollInertia"),scrollEasing:s.data("scrollEasing")},l=(t=x.extend(n,t),s.children(".mCustomScrollBox")),g=l.children(".mCSB_container"),u=l.children(".mCSB_scrollTools"),c=u.children(".mCSB_draggerContainer"),d=c.children(".mCSB_dragger"),h=draggerSpeed=t.scrollInertia;if(!g.hasClass("mCS_no_scrollbar")&&(s.data({mCS_trigger:t.trigger}),s.data("mCS_Init")&&(t.callbacks=!1),e||0===e)){var b,p;if("number"==typeof e)t.moveDragger?(a=e,e=s.data("horizontalScroll")?d.position().left*s.data("scrollAmount"):d.position().top*s.data("scrollAmount"),draggerSpeed=0):a=e/s.data("scrollAmount");else if("string"==typeof e)a=1===(b="top"===e?0:"bottom"!==e||s.data("horizontalScroll")?"left"===e?0:"right"===e&&s.data("horizontalScroll")?g.outerWidth()-l.width():"first"===e?s.find(".mCSB_container").find(":first"):"last"===e?s.find(".mCSB_container").find(":last"):s.find(e):g.outerHeight()-l.height()).length?(e=s.data("horizontalScroll")?b.position().left:b.position().top)/s.data("scrollAmount"):e=b;if(s.data("horizontalScroll"))s.data("onTotalScrollBack_Offset")&&(r=-s.data("onTotalScrollBack_Offset")),s.data("onTotalScroll_Offset")&&(_=l.width()-g.outerWidth()+s.data("onTotalScroll_Offset")),a<0?(a=e=0,clearInterval(s.data("mCSB_buttonScrollLeft")),r||(i=!0)):a>=c.width()-d.width()?(a=c.width()-d.width(),e=l.width()-g.outerWidth(),clearInterval(s.data("mCSB_buttonScrollRight")),_||(o=!0)):e=-e,(p=s.data("snapAmount"))&&(e=Math.round(e/p)*p-s.data("snapOffset")),v.mTweenAxis.call(this,d[0],"left",Math.round(a),draggerSpeed,t.scrollEasing),v.mTweenAxis.call(this,g[0],"left",Math.round(e),h,t.scrollEasing,{onStart:function(){t.callbacks&&!s.data("mCS_tweenRunning")&&m("onScrollStart"),s.data("autoHideScrollbar")&&v.showScrollbar.call(u)},onUpdate:function(){t.callbacks&&m("whileScrolling")},onComplete:function(){t.callbacks&&(m("onScroll"),(i||r&&g.position().left>=r)&&m("onTotalScrollBack"),(o||_&&g.position().left<=_)&&m("onTotalScroll")),d.data("preventAction",!1),s.data("mCS_tweenRunning",!1),s.data("autoHideScrollbar")&&(l.hasClass("mCS-mouse-over")||v.hideScrollbar.call(u))}});else s.data("onTotalScrollBack_Offset")&&(r=-s.data("onTotalScrollBack_Offset")),s.data("onTotalScroll_Offset")&&(_=l.height()-g.outerHeight()+s.data("onTotalScroll_Offset")),a<0?(a=e=0,clearInterval(s.data("mCSB_buttonScrollUp")),r||(i=!0)):a>=c.height()-d.height()?(a=c.height()-d.height(),e=l.height()-g.outerHeight(),clearInterval(s.data("mCSB_buttonScrollDown")),_||(o=!0)):e=-e,(p=s.data("snapAmount"))&&(e=Math.round(e/p)*p-s.data("snapOffset")),v.mTweenAxis.call(this,d[0],"top",Math.round(a),draggerSpeed,t.scrollEasing),v.mTweenAxis.call(this,g[0],"top",Math.round(e),h,t.scrollEasing,{onStart:function(){t.callbacks&&!s.data("mCS_tweenRunning")&&m("onScrollStart"),s.data("autoHideScrollbar")&&v.showScrollbar.call(u)},onUpdate:function(){t.callbacks&&m("whileScrolling")},onComplete:function(){t.callbacks&&(m("onScroll"),(i||r&&g.position().top>=r)&&m("onTotalScrollBack"),(o||_&&g.position().top<=_)&&m("onTotalScroll")),d.data("preventAction",!1),s.data("mCS_tweenRunning",!1),s.data("autoHideScrollbar")&&(l.hasClass("mCS-mouse-over")||v.hideScrollbar.call(u))}});s.data("mCS_Init")&&s.data({mCS_Init:!1})}function m(e){switch(this.mcs={top:g.position().top,left:g.position().left,draggerTop:d.position().top,draggerLeft:d.position().left,topPct:Math.round(100*Math.abs(g.position().top)/Math.abs(g.outerHeight()-l.height())),leftPct:Math.round(100*Math.abs(g.position().left)/Math.abs(g.outerWidth()-l.width()))},e){case"onScrollStart":s.data("mCS_tweenRunning",!0).data("onScrollStart_Callback").call(s,this.mcs);break;case"whileScrolling":s.data("whileScrolling_Callback").call(s,this.mcs);break;case"onScroll":s.data("onScroll_Callback").call(s,this.mcs);break;case"onTotalScrollBack":s.data("onTotalScrollBack_Callback").call(s,this.mcs);break;case"onTotalScroll":s.data("onTotalScroll_Callback").call(s,this.mcs)}}},stop:function(){var e=x(this),t=e.children().children(".mCSB_container"),a=e.children().children().children().children(".mCSB_dragger");v.mTweenAxisStop.call(this,t[0]),v.mTweenAxisStop.call(this,a[0])},disable:function(e){var t=x(this),a=t.children(".mCustomScrollBox"),i=a.children(".mCSB_container"),r=a.children(".mCSB_scrollTools"),o=r.children().children(".mCSB_dragger");a.unbind("mousewheel focusin mouseenter mouseleave touchend"),i.unbind("touchstart touchmove"),e&&(t.data("horizontalScroll")?o.add(i).css("left",0):o.add(i).css("top",0)),r.css("display","none"),i.addClass("mCS_no_scrollbar"),t.data({bindEvent_mousewheel:!1,bindEvent_focusin:!1,bindEvent_content_touch:!1,bindEvent_autoHideScrollbar:!1}).addClass("mCS_disabled")},destroy:function(){var e=x(this);e.removeClass("mCustomScrollbar _mCS_"+e.data("mCustomScrollbarIndex")).addClass("mCS_destroyed").children().children(".mCSB_container").unwrap().children().unwrap().siblings(".mCSB_scrollTools").remove(),x(document).unbind("mousemove."+e.data("mCustomScrollbarIndex")+" mouseup."+e.data("mCustomScrollbarIndex")+" MSPointerMove."+e.data("mCustomScrollbarIndex")+" MSPointerUp."+e.data("mCustomScrollbarIndex")),x(window).unbind("resize."+e.data("mCustomScrollbarIndex"))}},v={showScrollbar:function(){this.stop().animate({opacity:1},"fast")},hideScrollbar:function(){this.stop().animate({opacity:0},"fast")},mTweenAxis:function(e,t,a,i,r,o){var _,s=(o=o||{}).onStart||function(){},n=o.onUpdate||function(){},l=o.onComplete||function(){},g=b(),u=0,c=e.offsetTop,d=e.style;"left"===t&&(c=e.offsetLeft);var h=a-c;function b(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()}function p(){u||s.call(),u=b()-g,m(),u>=e._time&&(e._time=u>e._time?u+_-(u-e._time):u+_-1,e._time<u+1&&(e._time=u+1)),e._time<i?e._id=_request(p):l.call()}function m(){d[t]=0<i?(e.currVal=function(e,t,a,i,r){switch(r){case"linear":return a*e/i+t;case"easeOutQuad":return-a*(e/=i)*(e-2)+t;case"easeInOutQuad":return(e/=i/2)<1?a/2*e*e+t:-a/2*(--e*(e-2)-1)+t;case"easeOutCubic":return e/=i,a*(--e*e*e+1)+t;case"easeOutQuart":return e/=i,-a*(--e*e*e*e-1)+t;case"easeOutQuint":return e/=i,a*(--e*e*e*e*e+1)+t;case"easeOutCirc":return e/=i,e--,a*Math.sqrt(1-e*e)+t;case"easeOutSine":return a*Math.sin(e/i*(Math.PI/2))+t;case"easeOutExpo":return a*(1-Math.pow(2,-10*e/i))+t;case"mcsEaseOut":var o=(e/=i)*e,_=o*e;return t+a*(.499999999999997*_*o+-2.5*o*o+5.5*_+-6.5*o+4*e);case"draggerRailEase":return(e/=i/2)<1?a/2*e*e*e+t:a/2*((e-=2)*e*e+2)+t}}(e._time,c,h,i,r),Math.round(e.currVal)+"px"):a+"px",n.call()}!function(){if(null==e._id)return;window.requestAnimationFrame?window.cancelAnimationFrame(e._id):clearTimeout(e._id);e._id=null}(),_=1e3/60,e._time=u+_,_request=window.requestAnimationFrame?window.requestAnimationFrame:function(e){return m(),setTimeout(e,.01)},e._id=_request(p)},mTweenAxisStop:function(e){null!=e._id&&(window.requestAnimationFrame?window.cancelAnimationFrame(e._id):clearTimeout(e._id),e._id=null)},rafPolyfill:function(){for(var e=["ms","moz","webkit","o"],t=e.length;-1<--t&&!window.requestAnimationFrame;)window.requestAnimationFrame=window[e[t]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[e[t]+"CancelAnimationFrame"]||window[e[t]+"CancelRequestAnimationFrame"]}};v.rafPolyfill.call(),x.support.touch=!!("ontouchstart"in window),x.support.msPointer=window.navigator.msPointerEnabled;var e="https:"==document.location.protocol?"https:":"http:";x.event.special.mousewheel||document.write('<script src="'+e+'//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.0.6/jquery.mousewheel.min.js"><\/script>'),x.fn.mCustomScrollbar=function(e){return t[e]?t[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void x.error("Method "+e+" does not exist"):t.init.apply(this,arguments)}}(jQuery),function(r){function o(e){return void 0!==e}function e(e,t,a){var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e,t.prototype.constructor=t,e._super=t.prototype,a&&r.extend(e.prototype,a)}var _=[["",""],["exit","cancel"],["screen","Screen"]],s=["","o","ms","moz","webkit","webkitCurrent"];function a(e,t){var a;"string"==typeof e&&(t=e,e=document);for(var i=0;i<_.length;++i){t=t.replace(_[i][0],_[i][1]);for(var r=0;r<s.length;++r)if(a=s[r],o(e[a+=0===r?t:t.charAt(0).toUpperCase()+t.substr(1)]))return e[a]}}var t=navigator.userAgent,i=a("fullscreenEnabled"),n=!(-1!==t.indexOf("Android")&&-1!==t.indexOf("Chrome"))&&o(a("fullscreenElement"))&&(!o(i)||!0===i),l=r.fn.jquery.split("."),g=parseInt(l[0])<2&&parseInt(l[1])<7,u=function(){this.__options=null,this._fullScreenElement=null,this.__savedStyles={}};u.prototype={_DEFAULT_OPTIONS:{styles:{boxSizing:"border-box",MozBoxSizing:"border-box",WebkitBoxSizing:"border-box"},toggleClass:null},__documentOverflow:"",__htmlOverflow:"",_preventDocumentScroll:function(){this.__documentOverflow=r("body")[0].style.overflow,this.__htmlOverflow=r("html")[0].style.overflow},_allowDocumentScroll:function(){},_fullScreenChange:function(){this.isFullScreen()?(this._preventDocumentScroll(),this._triggerEvents()):(this._allowDocumentScroll(),this._revertStyles(),this._triggerEvents(),this._fullScreenElement=null)},_fullScreenError:function(e){this._revertStyles(),this._fullScreenElement=null,e&&r(document).trigger("fscreenerror",[e])},_triggerEvents:function(){r(this._fullScreenElement).trigger(this.isFullScreen()?"fscreenopen":"fscreenclose"),r(document).trigger("fscreenchange",[this.isFullScreen(),this._fullScreenElement])},_saveAndApplyStyles:function(){var e=r(this._fullScreenElement);for(var t in this.__savedStyles={},this.__options.styles)this.__savedStyles[t]=this._fullScreenElement.style[t],this._fullScreenElement.style[t]=this.__options.styles[t];this.__options.toggleClass&&e.addClass(this.__options.toggleClass)},_revertStyles:function(){var e=r(this._fullScreenElement);for(var t in this.__options.styles)this._fullScreenElement.style[t]=this.__savedStyles[t];this.__options.toggleClass&&e.removeClass(this.__options.toggleClass)},open:function(e,t){e!==this._fullScreenElement&&(this.isFullScreen()&&this.exit(),this._fullScreenElement=e,this.__options=r.extend(!0,{},this._DEFAULT_OPTIONS,t),this._saveAndApplyStyles())},exit:null,isFullScreen:null,isNativelySupported:function(){return n}};var c=function(){c._super.constructor.apply(this,arguments),this.exit=r.proxy(a("exitFullscreen"),document),this._DEFAULT_OPTIONS=r.extend(!0,{},this._DEFAULT_OPTIONS,{styles:{width:"100%",height:"100%"}}),r(document).bind(this._prefixedString("fullscreenchange")+" MSFullscreenChange",r.proxy(this._fullScreenChange,this)).bind(this._prefixedString("fullscreenerror")+" MSFullscreenError",r.proxy(this._fullScreenError,this))};e(c,u,{VENDOR_PREFIXES:["","o","moz","webkit"],_prefixedString:function(t){return r.map(this.VENDOR_PREFIXES,function(e){return e+t}).join(" ")},open:function(e,t){c._super.open.apply(this,arguments),a(e,"requestFullscreen").call(e)},exit:r.noop,isFullScreen:function(){return null!==a("fullscreenElement")},element:function(){return a("fullscreenElement")}});var d=function(){d._super.constructor.apply(this,arguments),this._DEFAULT_OPTIONS=r.extend({},this._DEFAULT_OPTIONS,{styles:{position:"fixed",zIndex:"2147483647",left:0,top:0,bottom:0,right:0}}),this.__delegateKeydownHandler()};e(d,u,{__isFullScreen:!1,__delegateKeydownHandler:function(){var e=r(document);e.delegate("*","keydown.fullscreen",r.proxy(this.__keydownHandler,this));var t=g?e.data("events"):r._data(document).events,a=t.keydown;g?t.live.unshift(t.live.pop()):a.splice(0,0,a.splice(a.delegateCount-1,1)[0])},__keydownHandler:function(e){return!this.isFullScreen()||27!==e.which||(this.exit(),!1)},_revertStyles:function(){d._super._revertStyles.apply(this,arguments),this._fullScreenElement.offsetHeight},open:function(e){d._super.open.apply(this,arguments),this.__isFullScreen=!0,this._fullScreenChange()},exit:function(){this.__isFullScreen=!1,this._fullScreenChange()},isFullScreen:function(){return this.__isFullScreen},element:function(){return this.__isFullScreen?this._fullScreenElement:null}}),r.fullscreen=n?new c:new d,r.fn.fullscreen=function(e){var t=this[0];return(e=r.extend({toggleClass:null},e)).styles={},t&&r.fullscreen.open(t,e),this}}(jQuery);var bwg_current_filmstrip_pos,total_thumbnail_count,key,startPoint,endPoint,bwg_image_info_pos,filmstrip_width,preloadCount,filmstrip_thumbnail_width,filmstrip_thumbnail_height,addthis_share,lightbox_comment_pos,bwg_transition_duration,bwg_playInterval,gallery_box_data,bwg_param,isPopUpOpened=!1,bwg_overflow_initial_value=!1,bwg_overflow_x_initial_value=!1,bwg_overflow_y_initial_value=!1;function gallery_box_ready(){filmstrip_thumbnail_width=jQuery(".bwg_filmstrip_thumbnail").width(),filmstrip_thumbnail_height=jQuery(".bwg_filmstrip_thumbnail").height(),0<jQuery("#gallery_box_data").length&&(gallery_box_data=JSON.parse(jQuery("#gallery_box_data").val()),bwg_param=gallery_box_data),gallery_box_data.open_with_fullscreen?(filmstrip_width=jQuery(window).width(),filmstrip_height=jQuery(window).height()):(filmstrip_width=jQuery(".bwg_filmstrip_container").width(),filmstrip_height=jQuery(".bwg_filmstrip_container").height()),preloadCount="horizontal"==gallery_box_data.filmstrip_direction?parseInt(filmstrip_width/filmstrip_thumbnail_width)+gallery_box_data.preload_images_count:parseInt(filmstrip_height/filmstrip_thumbnail_height)+gallery_box_data.preload_images_count,total_thumbnail_count=jQuery(".bwg_filmstrip_thumbnail").length,key=parseInt(jQuery("#bwg_current_image_key").val()),startPoint=0,endPoint=key+preloadCount,jQuery(document).ready(function(){wds_load_visible_images(key,preloadCount,total_thumbnail_count,startPoint,endPoint),jQuery(".pge_tabs li a").on("click",function(){return jQuery(".pge_tabs_container > div").hide(),jQuery(".pge_tabs li").removeClass("pge_active"),jQuery(jQuery(this).attr("href")).show(),jQuery(this).closest("li").addClass("pge_active"),jQuery("[name=type]").val(jQuery(this).attr("href").substr(1)),!1});var e=jQuery("#bwg_rated").attr("data-params");bwg_rating((e=JSON.parse(e)).current_rate,e.current_rate_count,e.current_avg_rating,e.current_image_key)}),gallery_box_data.is_pro&&gallery_box_data.enable_addthis&&gallery_box_data.addthis_profile_id&&(addthis_share={url:gallery_box_data.share_url}),lightbox_comment_pos=gallery_box_data.lightbox_comment_pos,bwg_image_info_pos=jQuery(".bwg_ctrl_btn_container").length?jQuery(".bwg_ctrl_btn_container").height():0,setTimeout(function(){jQuery(".bwg_image_info_container1").height()<jQuery(".bwg_image_info").height()+jQuery(".bwg_toggle_container").height()+bwg_image_info_pos+2*parseInt(gallery_box_data.lightbox_info_margin)&&("top"==gallery_box_data.lightbox_ctrl_btn_pos&&jQuery(".bwg_image_info").css("top",bwg_image_info_pos+"px"),jQuery(".bwg_image_info").height(jQuery(".bwg_image_info_container1").height()-jQuery(".bwg_toggle_container").height()-bwg_image_info_pos-2*parseInt(gallery_box_data.lightbox_info_margin)))},100),bwg_transition_duration=gallery_box_data.slideshow_interval<4*gallery_box_data.slideshow_effect_duration&&0!=gallery_box_data.slideshow_interval?1e3*gallery_box_data.slideshow_interval/4:1e3*gallery_box_data.slideshow_effect_duration,gallery_box_data.bwg_transition_duration=bwg_transition_duration,gallery_box_data.bwg_trans_in_progress=!1,(jQuery("#spider_popup_wrap").width()>=jQuery(window).width()||jQuery("#spider_popup_wrap").height()>=jQuery(window).height())&&jQuery(".spider_popup_close").attr("class","bwg_ctrl_btn spider_popup_close_fullscreen"),window.clearInterval(bwg_playInterval),bwg_current_filmstrip_pos=gallery_box_data.current_pos,jQuery(document).on("keydown",function(e){jQuery("#bwg_name").is(":focus")||jQuery("#bwg_email").is(":focus")||jQuery("#bwg_comment").is(":focus")||jQuery("#bwg_captcha_input").is(":focus")||(39===e.keyCode?bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),parseInt(jQuery("#bwg_current_image_key").val())+1,gallery_box_data.data):37===e.keyCode?bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),parseInt(jQuery("#bwg_current_image_key").val())-1,gallery_box_data.data):27===e.keyCode?spider_destroypopup(1e3):32===e.keyCode&&jQuery(".bwg_play_pause").trigger("click"))}),jQuery(window).resize(function(){void 0!==jQuery().fullscreen&&jQuery.isFunction(jQuery().fullscreen)&&(jQuery.fullscreen.isFullScreen()||bwg_popup_resize())});var r=gallery_box_data.image_width,o=gallery_box_data.image_height;if(gallery_box_data.is_pro){gallery_box_data.enable_addthis&&gallery_box_data.addthis_profile_id&&jQuery(".at4-share-outer").show(),spider_set_input_value("rate_ajax_task","save_hit_count"),spider_rate_ajax_save("bwg_rate_form");var e=gallery_box_data.data,t=gallery_box_data.current_image_key;jQuery(".bwg_image_hits span").html(++e[t].hit_count);var a=window.location.hash;a&&"-1"!=a.indexOf("bwg")||(location.replace("#bwg"+gallery_box_data.gallery_id+"/"+gallery_box_data.current_image_id),history.replaceState(void 0,void 0,"#bwg"+gallery_box_data.gallery_id+"/"+gallery_box_data.current_image_id))}gallery_box_data.image_right_click&&(jQuery(".bwg_image_wrap").bind("contextmenu",function(e){return!1}),jQuery(".bwg_image_wrap").css("webkitTouchCallout","none")),jQuery("#spider_popup_wrap").bind("touchmove",function(e){e.preventDefault()}),void 0!==jQuery().swiperight&&jQuery.isFunction(jQuery().swiperight)&&jQuery("#spider_popup_wrap .bwg_image_wrap").swiperight(function(){return bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),(parseInt(jQuery("#bwg_current_image_key").val())+gallery_box_data.data.length-1)%gallery_box_data.data.length,gallery_box_data.data),!1}),void 0!==jQuery().swipeleft&&jQuery.isFunction(jQuery().swipeleft)&&jQuery("#spider_popup_wrap .bwg_image_wrap").swipeleft(function(){return bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),(parseInt(jQuery("#bwg_current_image_key").val())+1)%gallery_box_data.data.length,gallery_box_data.data),!1}),bwg_reset_zoom();var i=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())?"touchend":"click";jQuery("#spider_popup_left").on(i,function(){return bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),(parseInt(jQuery("#bwg_current_image_key").val())+gallery_box_data.data.length-1)%gallery_box_data.data.length,gallery_box_data.data),!1}),jQuery("#spider_popup_right").on(i,function(){return bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),(parseInt(jQuery("#bwg_current_image_key").val())+1)%gallery_box_data.data.length,gallery_box_data.data),!1}),-1!=navigator.appVersion.indexOf("MSIE 10")||-1!=navigator.appVersion.indexOf("MSIE 9")?setTimeout(function(){bwg_popup_resize()},1):bwg_popup_resize(),jQuery(".bwg_watermark").css({display:"none"}),setTimeout(function(){bwg_change_watermark_container()},500),void 0!==jQuery().fullscreen&&jQuery.isFunction(jQuery().fullscreen)&&(jQuery.fullscreen.isNativelySupported()||jQuery(".bwg_fullscreen").hide()),"horizontal"==gallery_box_data.filmstrip_direction?(jQuery(".bwg_image_container").height(jQuery(".bwg_image_wrap").height()-gallery_box_data.image_filmstrip_height),jQuery(".bwg_image_container").width(jQuery(".bwg_image_wrap").width())):(jQuery(".bwg_image_container").height(jQuery(".bwg_image_wrap").height()),jQuery(".bwg_image_container").width(jQuery(".bwg_image_wrap").width()-gallery_box_data.image_filmstrip_width)),void 0!==jQuery().mCustomScrollbar&&jQuery.isFunction(jQuery().mCustomScrollbar)&&(jQuery(".bwg_comments").mCustomScrollbar({scrollInertia:150}),jQuery(".bwg_ecommerce_panel").mCustomScrollbar({scrollInertia:150,advanced:{updateOnContentResize:!0}}));var _=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel";jQuery(".bwg_filmstrip").on(_,function(e){var t=window.event||e,a=(t=t.originalEvent?t.originalEvent:t).detail?-40*t.detail:t.wheelDelta,i=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase());0<a?jQuery(".bwg_filmstrip_left").trigger(i?"touchend":"click"):jQuery(".bwg_filmstrip_right").trigger(i?"touchend":"click")}),jQuery(".bwg_filmstrip_right").on(i,function(){jQuery(".bwg_filmstrip_thumbnails").stop(!0,!1),"left"==gallery_box_data.left_or_top?"width"==gallery_box_data.width_or_height?(jQuery(".bwg_filmstrip_thumbnails").position().left>=-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width())&&(jQuery(".bwg_filmstrip_left").css({opacity:1,filter:"Alpha(opacity=100)"}),jQuery(".bwg_filmstrip_thumbnails").position().left<-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width()-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width+gallery_box_data.all_images_right_left_space))?jQuery(".bwg_filmstrip_thumbnails").animate({left:-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width()-gallery_box_data.all_images_right_left_space)},500,"linear"):jQuery(".bwg_filmstrip_thumbnails").animate({left:jQuery(".bwg_filmstrip_thumbnails").position().left-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width)},500,"linear")),window.setTimeout(function(){jQuery(".bwg_filmstrip_thumbnails").position().left==-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width())&&jQuery(".bwg_filmstrip_right").css({opacity:.3,filter:"Alpha(opacity=30)"})},500)):(jQuery(".bwg_filmstrip_thumbnails").position().left>=-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height())&&(jQuery(".bwg_filmstrip_left").css({opacity:1,filter:"Alpha(opacity=100)"}),jQuery(".bwg_filmstrip_thumbnails").position().left<-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height()-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width+gallery_box_data.all_images_right_left_space))?jQuery(".bwg_filmstrip_thumbnails").animate({left:-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height()-gallery_box_data.all_images_right_left_space)},500,"linear"):jQuery(".bwg_filmstrip_thumbnails").animate({left:jQuery(".bwg_filmstrip_thumbnails").position().left-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width)},500,"linear")),window.setTimeout(function(){jQuery(".bwg_filmstrip_thumbnails").position().left==-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height())&&jQuery(".bwg_filmstrip_right").css({opacity:.3,filter:"Alpha(opacity=30)"})},500)):"width"==gallery_box_data.width_or_height?(jQuery(".bwg_filmstrip_thumbnails").position().top>=-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width())&&(jQuery(".bwg_filmstrip_left").css({opacity:1,filter:"Alpha(opacity=100)"}),jQuery(".bwg_filmstrip_thumbnails").position().top<-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width()-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width+gallery_box_data.all_images_right_left_space))?jQuery(".bwg_filmstrip_thumbnails").animate({left:-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width()-gallery_box_data.all_images_right_left_space)},500,"linear"):jQuery(".bwg_filmstrip_thumbnails").animate({left:jQuery(".bwg_filmstrip_thumbnails").position().top-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width)},500,"linear")),window.setTimeout(function(){jQuery(".bwg_filmstrip_thumbnails").position().left==-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width())&&jQuery(".bwg_filmstrip_right").css({opacity:.3,filter:"Alpha(opacity=30)"})},500)):(jQuery(".bwg_filmstrip_thumbnails").position().top>=-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height())&&(jQuery(".bwg_filmstrip_left").css({opacity:1,filter:"Alpha(opacity=100)"}),jQuery(".bwg_filmstrip_thumbnails").position().top<-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height()-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width+gallery_box_data.all_images_right_left_space))?jQuery(".bwg_filmstrip_thumbnails").animate({top:-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height()-gallery_box_data.all_images_right_left_space)},500,"linear"):jQuery(".bwg_filmstrip_thumbnails").animate({top:jQuery(".bwg_filmstrip_thumbnails").position().top-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width)},500,"linear")),window.setTimeout(function(){jQuery(".bwg_filmstrip_thumbnails").position().left==-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height())&&jQuery(".bwg_filmstrip_right").css({opacity:.3,filter:"Alpha(opacity=30)"})},500))}),"left"==gallery_box_data.left_or_top?jQuery(".bwg_filmstrip_left").on(i,function(){jQuery(".bwg_filmstrip_thumbnails").stop(!0,!1),jQuery(".bwg_filmstrip_thumbnails").position().left<0&&(jQuery(".bwg_filmstrip_right").css({opacity:1,filter:"Alpha(opacity=100)"}),jQuery(".bwg_filmstrip_thumbnails").position().left>-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width)?jQuery(".bwg_filmstrip_thumbnails").animate({left:0},500,"linear"):jQuery(".bwg_filmstrip_thumbnails").animate({left:jQuery(".bwg_filmstrip_thumbnails").position().left+gallery_box_data.image_filmstrip_width+gallery_box_data.filmstrip_thumb_right_left_space},500,"linear")),window.setTimeout(function(){0==jQuery(".bwg_filmstrip_thumbnails").position().left&&jQuery(".bwg_filmstrip_left").css({opacity:.3,filter:"Alpha(opacity=30)"})},500)}):jQuery(".bwg_filmstrip_left").on(i,function(){jQuery(".bwg_filmstrip_thumbnails").stop(!0,!1),jQuery(".bwg_filmstrip_thumbnails").position().top<0&&(jQuery(".bwg_filmstrip_right").css({opacity:1,filter:"Alpha(opacity=100)"}),jQuery(".bwg_filmstrip_thumbnails").position().top>-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width)?jQuery(".bwg_filmstrip_thumbnails").animate({top:0},500,"linear"):jQuery(".bwg_filmstrip_thumbnails").animate({top:jQuery(".bwg_filmstrip_thumbnails").position().top+gallery_box_data.image_filmstrip_width+gallery_box_data.filmstrip_thumb_right_left_space},500,"linear")),window.setTimeout(function(){0==jQuery(".bwg_filmstrip_thumbnails").position().top&&jQuery(".bwg_filmstrip_left").css({opacity:.3,filter:"Alpha(opacity=30)"})},500)}),"width"==gallery_box_data.width_or_height?bwg_set_filmstrip_pos(jQuery(".bwg_filmstrip").width(),"",gallery_box_data):bwg_set_filmstrip_pos(jQuery(".bwg_filmstrip").height(),"",gallery_box_data),jQuery(".bwg_info").on(i,function(){if("none"==jQuery(".bwg_image_info_container1").css("display")){jQuery(".bwg_image_info_container1").css("display","table-cell"),jQuery(".bwg_info").attr("title",bwg_objectsL10n.bwg_hide_info);var e=jQuery(".bwg_ctrl_btn_container").length?jQuery(".bwg_ctrl_btn_container").height():0;setTimeout(function(){jQuery(".bwg_image_info_container1").height()<jQuery(".bwg_image_info").height()+e+2*parseInt(gallery_box_data.lightbox_info_margin)&&("top"==gallery_box_data.lightbox_ctrl_btn_pos&&jQuery(".bwg_image_info").css("top",e+"px"),jQuery(".bwg_image_info").height(jQuery(".bwg_image_info_container1").height()-e-2*parseInt(gallery_box_data.lightbox_info_margin)))},100)}else jQuery(".bwg_image_info_container1").css("display","none"),jQuery(".bwg_info").attr("title",bwg_objectsL10n.bwg_show_info)}),jQuery(".bwg_rate").on(i,function(){"none"==jQuery(".bwg_image_rate_container1").css("display")?(jQuery(".bwg_image_rate_container1").css("display","table-cell"),jQuery(".bwg_rate").attr("title",bwg_objectsL10n.bwg_hide_rating)):(jQuery(".bwg_image_rate_container1").css("display","none"),jQuery(".bwg_rate").attr("title",bwg_objectsL10n.bwg_show_rating))}),jQuery(".bwg_comment, .bwg_comments_close_btn").on(i,function(){bwg_comment()}),jQuery(".bwg_ecommerce, .bwg_ecommerce_close_btn").on(i,function(){bwg_ecommerce()}),jQuery(".bwg_toggle_container").on(i,function(){var e="top"==gallery_box_data.lightbox_ctrl_btn_pos?"bwg-icon-caret-up":"bwg-icon-caret-down",t="top"==gallery_box_data.lightbox_ctrl_btn_pos?"bwg-icon-caret-down":"bwg-icon-caret-up",a=jQuery(".bwg_image_info_container1").height()-jQuery(".bwg_ctrl_btn_container").height()-2*parseInt(gallery_box_data.lightbox_info_margin),i=jQuery(".bwg_image_description").outerHeight()+jQuery(".bwg_image_title").outerHeight()+2*parseInt(gallery_box_data.lightbox_info_margin);if(jQuery(".bwg_toggle_container i").hasClass(e)){var r=a+jQuery(".bwg_ctrl_btn_container").height(),o=parseInt(jQuery(".bwg_image_info").css("top"))-jQuery(".bwg_ctrl_btn_container").height();jQuery(".bwg_ctrl_btn_container").height();"top"==gallery_box_data.lightbox_ctrl_btn_pos&&"top"==gallery_box_data.lightbox_info_pos?jQuery(".bwg_image_info_container1").height()<i?jQuery(".bwg_image_info").animate({top:o+"px",height:r},500):jQuery(".bwg_image_info").animate({top:o+"px"},500):"bottom"==gallery_box_data.lightbox_ctrl_btn_pos&&(jQuery(".bwg_image_info_container1").height()<i?jQuery(".bwg_image_info").animate({bottom:0,height:r},500):"bottom"==gallery_box_data.lightbox_info_pos?jQuery(".bwg_image_info").animate({top:-o+"px"},500):jQuery(".bwg_image_info").animate({top:0},500)),gallery_box_data.enable_image_filmstrip&&"bottom"==gallery_box_data.lightbox_filmstrip_pos||"bottom"!=gallery_box_data.lightbox_ctrl_btn_pos||"bottom"!=gallery_box_data.lightbox_info_pos?gallery_box_data.enable_image_filmstrip&&"top"==gallery_box_data.lightbox_filmstrip_pos||"top"!=gallery_box_data.lightbox_ctrl_btn_pos||"top"!=gallery_box_data.lightbox_info_pos||jQuery(".bwg_image_info").animate({top:0},500):jQuery(".bwg_image_info").animate({bottom:0},500),gallery_box_data.enable_image_filmstrip&&"bottom"==gallery_box_data.lightbox_filmstrip_pos||"bottom"!=gallery_box_data.lightbox_ctrl_btn_pos||"bottom"!=gallery_box_data.lightbox_rate_pos?gallery_box_data.enable_image_filmstrip&&"top"==gallery_box_data.lightbox_filmstrip_pos||"top"!=gallery_box_data.lightbox_ctrl_btn_pos||"top"!=gallery_box_data.lightbox_rate_pos||jQuery(".bwg_image_rate").animate({top:0},500):jQuery(".bwg_image_rate").animate({bottom:0},500),gallery_box_data.enable_image_filmstrip&&"bottom"==gallery_box_data.lightbox_filmstrip_pos||"bottom"!=gallery_box_data.lightbox_ctrl_btn_pos||"bottom"!=gallery_box_data.lightbox_hit_pos?gallery_box_data.enable_image_filmstrip&&"top"==gallery_box_data.lightbox_filmstrip_pos||"top"!=gallery_box_data.lightbox_ctrl_btn_pos||"top"!=gallery_box_data.lightbox_hit_pos||jQuery(".bwg_image_hit").animate({top:0},500):jQuery(".bwg_image_hit").animate({bottom:0},500),"bottom"==gallery_box_data.lightbox_ctrl_btn_pos?(jQuery(".bwg_ctrl_btn_container").animate({bottom:"-"+jQuery(".bwg_ctrl_btn_container").height()},500),jQuery(".bwg_toggle_container").animate({bottom:0},{duration:500,complete:function(){jQuery(".bwg_toggle_container i").attr("class","bwg_toggle_btn "+t)}})):(jQuery(".bwg_ctrl_btn_container").animate({top:"-"+jQuery(".bwg_ctrl_btn_container").height()},500),jQuery(".bwg_toggle_container").animate({top:0},{duration:500,complete:function(){jQuery(".bwg_toggle_container i").attr("class","bwg_toggle_btn "+t)}}))}else{a=jQuery(".bwg_image_info_container1").height()-2*parseInt(gallery_box_data.lightbox_info_margin)-jQuery(".bwg_toggle_container").height(),i=jQuery(".bwg_image_description").outerHeight()+jQuery(".bwg_image_title").outerHeight()+2*parseInt(gallery_box_data.lightbox_info_margin)+jQuery(".bwg_toggle_container").height(),r=a,o=parseInt(jQuery(".bwg_image_info").css("top"))+jQuery(".bwg_ctrl_btn_container").height();"top"==gallery_box_data.lightbox_ctrl_btn_pos&&"top"==gallery_box_data.lightbox_info_pos?jQuery(".bwg_image_info_container1").height()<i?jQuery(".bwg_image_info").animate({top:o+"px",height:r},500):jQuery(".bwg_image_info").animate({top:o+"px"},500):"bottom"==gallery_box_data.lightbox_ctrl_btn_pos&&(jQuery(".bwg_image_info_container1").height()<i?jQuery(".bwg_image_info").animate({bottom:0,height:r},500):jQuery(".bwg_image_info").animate({top:0},500)),gallery_box_data.enable_image_filmstrip&&"bottom"==gallery_box_data.lightbox_filmstrip_pos||"bottom"!=gallery_box_data.lightbox_ctrl_btn_pos||"bottom"!=gallery_box_data.lightbox_info_pos?gallery_box_data.enable_image_filmstrip&&"top"==gallery_box_data.lightbox_filmstrip_pos||"top"!=gallery_box_data.lightbox_ctrl_btn_pos||"top"!=gallery_box_data.lightbox_info_pos||jQuery(".bwg_image_info").animate({top:jQuery(".bwg_ctrl_btn_container").height()},500):jQuery(".bwg_image_info").animate({bottom:jQuery(".bwg_ctrl_btn_container").height()},500),gallery_box_data.enable_image_filmstrip&&"bottom"==gallery_box_data.lightbox_filmstrip_pos||"bottom"!=gallery_box_data.lightbox_ctrl_btn_pos||"bottom"!=gallery_box_data.lightbox_rate_pos?gallery_box_data.enable_image_filmstrip&&"top"==gallery_box_data.lightbox_filmstrip_pos||"top"!=gallery_box_data.lightbox_ctrl_btn_pos||"top"!=gallery_box_data.lightbox_rate_pos||jQuery(".bwg_image_rate").animate({top:jQuery(".bwg_ctrl_btn_container").height()},500):jQuery(".bwg_image_rate").animate({bottom:jQuery(".bwg_ctrl_btn_container").height()},500),gallery_box_data.enable_image_filmstrip&&"bottom"==gallery_box_data.lightbox_filmstrip_pos||"bottom"!=gallery_box_data.lightbox_ctrl_btn_pos||"bottom"!=gallery_box_data.lightbox_hit_pos?gallery_box_data.enable_image_filmstrip&&"top"==gallery_box_data.lightbox_filmstrip_pos||"top"!=gallery_box_data.lightbox_ctrl_btn_pos||"top"!=gallery_box_data.lightbox_hit_pos||jQuery(".bwg_image_hit").animate({top:jQuery(".bwg_ctrl_btn_container").height()},500):jQuery(".bwg_image_hit").animate({bottom:jQuery(".bwg_ctrl_btn_container").height()},500),"bottom"==gallery_box_data.lightbox_ctrl_btn_pos?(jQuery(".bwg_ctrl_btn_container").animate({bottom:0},500),jQuery(".bwg_toggle_container").animate({bottom:jQuery(".bwg_ctrl_btn_container").height()},{duration:500,complete:function(){jQuery(".bwg_toggle_container i").attr("class","bwg_toggle_btn "+e)}})):(jQuery(".bwg_ctrl_btn_container").animate({top:0},500),jQuery(".bwg_toggle_container").animate({top:jQuery(".bwg_ctrl_btn_container").height()},{duration:500,complete:function(){jQuery(".bwg_toggle_container i").attr("class","bwg_toggle_btn "+e)}}))}});var s=window.innerHeight;jQuery(".bwg_resize-full").on(i,function(){bwg_resize_full()}),jQuery(".bwg_fullscreen").on(i,function(){jQuery(".bwg_watermark").css({display:"none"});var e,t=0;if((jQuery(".bwg_comment_container").hasClass("bwg_open")||jQuery(".bwg_ecommerce_container").hasClass("bwg_open"))&&(t=jQuery(".bwg_comment_container").width()||jQuery(".bwg_ecommerce_container").width()),void 0!==jQuery().fullscreen&&jQuery.isFunction(jQuery().fullscreen))if(jQuery.fullscreen.isFullScreen())jQuery.fullscreen.exit(),e=s,jQuery(window).width()>gallery_box_data.image_width&&(r=gallery_box_data.image_width),window.innerHeight>gallery_box_data.image_height&&(o=gallery_box_data.image_height),gallery_box_data.open_with_fullscreen&&(r=jQuery(window).width(),o=e),jQuery("#spider_popup_wrap").on("fscreenclose",function(){jQuery("#spider_popup_wrap").css({width:r,height:o,left:"50%",top:"50%",marginLeft:-r/2,marginTop:-o/2,zIndex:1e5}),jQuery(".bwg_image_wrap").css({width:r-t}),jQuery(".bwg_image_container").css({height:o-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0),width:r-t-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)}),jQuery(".bwg_popup_image").css({maxWidth:r-t-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:o-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxWidth:r-t-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:o-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),bwg_resize_instagram_post(),bwg_change_watermark_container(),"width"==gallery_box_data.width_or_height?(jQuery(".bwg_filmstrip_container").css({width:r-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)}),jQuery(".bwg_filmstrip").css({width:r-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-40}),bwg_set_filmstrip_pos(r-40,"",gallery_box_data)):(jQuery(".bwg_filmstrip_container").css({height:o-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)}),jQuery(".bwg_filmstrip").css({height:o-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-40}),bwg_set_filmstrip_pos(o-40,"",gallery_box_data)),jQuery(".bwg_resize-full").show(),jQuery(".bwg_resize-full").attr("class","bwg-icon-expand bwg_ctrl_btn bwg_resize-full"),jQuery(".bwg_resize-full").attr("title",bwg_objectsL10n.bwg_maximize),jQuery(".bwg_fullscreen").attr("class","bwg-icon-arrows-out bwg_ctrl_btn bwg_fullscreen"),jQuery(".bwg_fullscreen").attr("title",bwg_objectsL10n.bwg_fullscreen),jQuery("#spider_popup_wrap").width()<jQuery(window).width()&&jQuery("#spider_popup_wrap").height()<window.innerHeight&&jQuery(".spider_popup_close_fullscreen").attr("class","spider_popup_close")});else{jQuery("#spider_popup_wrap").fullscreen();var a=screen.width,i=screen.height;jQuery("#spider_popup_wrap").css({width:a,height:i,left:0,top:0,margin:0,zIndex:1e5}),jQuery(".bwg_image_wrap").css({width:a-t}),jQuery(".bwg_image_container").css({height:i-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0),width:a-t-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)}),jQuery(".bwg_popup_image").css({maxWidth:a-t-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:i-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxWidth:a-t-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:i-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),bwg_resize_instagram_post(),bwg_change_watermark_container(),"width"==gallery_box_data.width_or_height?(jQuery(".bwg_filmstrip_container").css({width:a-("horizontal"==gallery_box_data.filmstrip_direction)?"comment_container_width":0}),jQuery(".bwg_filmstrip").css({width:a-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-40}),bwg_set_filmstrip_pos(a-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-40,"",gallery_box_data)):(jQuery(".bwg_filmstrip_container").css({height:i-("horizontal"==gallery_box_data.filmstrip_direction)?"comment_container_width":0}),jQuery(".bwg_filmstrip").css({height:a-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-40}),bwg_set_filmstrip_pos(i-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-40,"",gallery_box_data)),jQuery(".bwg_resize-full").hide(),jQuery(".bwg_fullscreen").attr("class","bwg-icon-compress bwg_ctrl_btn bwg_fullscreen"),jQuery(".bwg_fullscreen").attr("title",bwg_objectsL10n.bwg_exit_fullscreen),jQuery(".spider_popup_close").attr("class","bwg_ctrl_btn spider_popup_close_fullscreen")}return!1}),jQuery(".bwg_play_pause, .bwg_popup_image").on(i,function(){jQuery(".bwg_play_pause").length&&jQuery(".bwg_play_pause").hasClass("bwg-icon-play")&&!jQuery(".bwg_comment_container").hasClass("bwg_open")?(bwg_play(gallery_box_data.data),jQuery(".bwg_play_pause").attr("title",bwg_objectsL10n.bwg_pause),jQuery(".bwg_play_pause").attr("class","bwg-icon-pause bwg_ctrl_btn bwg_play_pause")):(window.clearInterval(bwg_playInterval),jQuery(".bwg_play_pause").attr("title",bwg_objectsL10n.bwg_play),jQuery(".bwg_play_pause").attr("class","bwg-icon-play bwg_ctrl_btn bwg_play_pause"))}),gallery_box_data.open_with_autoplay&&(bwg_play(gallery_box_data.data),jQuery(".bwg_play_pause").attr("title",bwg_objectsL10n.bwg_pause),jQuery(".bwg_play_pause").attr("class","bwg-icon-pause bwg_ctrl_btn bwg_play_pause")),gallery_box_data.open_with_fullscreen&&bwg_open_with_fullscreen(),jQuery(".bwg_popup_image").removeAttr("width"),jQuery(".bwg_popup_image").removeAttr("height"),jQuery(window).focus(function(){jQuery(".bwg_play_pause").length&&!jQuery(".bwg_play_pause").hasClass("bwg-icon-play")&&bwg_play(gallery_box_data.data)}),jQuery(window).blur(function(){event_stack=[],window.clearInterval(bwg_playInterval)});gallery_box_data.lightbox_ctrl_btn_pos;1==gallery_box_data.open_ecommerce&&setTimeout(function(){bwg_ecommerce()},400),gallery_box_data.open_comment&&bwg_comment()}function spider_createpopup(e,t,a,i,r,o,_,s){e=e.replace(/&#038;/g,"&"),isPopUpOpened||(isPopUpOpened=!0,spider_hasalreadyreceivedpopup(o)||spider_isunsupporteduseragent()||(bwg_overflow_initial_value=jQuery("html").css("overflow"),bwg_overflow_x_initial_value=jQuery("html").css("overflow-x"),bwg_overflow_y_initial_value=jQuery("html").css("overflow-y"),jQuery("html").attr("style","overflow:hidden !important;"),jQuery("#bwg_spider_popup_loading_"+t).show(),jQuery("#spider_popup_overlay_"+t).css({display:"block"}),jQuery.ajax({type:"GET",url:e,success:function(e){var t=jQuery('<div id="spider_popup_wrap" class="spider_popup_wrap" style=" width:'+a+"px; height:"+i+"px; margin-top:-"+i/2+"px; margin-left: -"+a/2+'px; ">'+e+"</div>").hide().appendTo("body");gallery_box_ready(),spider_showpopup(o,_,t,r,s)},beforeSend:function(){},complete:function(){}})))}function spider_showpopup(e,t,a,i,r){var o=JSON.parse(jQuery("#gallery_box_data").val()).data,_=parseInt(jQuery("#bwg_current_image_key").val());void 0!==o[_]&&(isPopUpOpened=!0,-1<o[_].filetype.indexOf("EMBED_")?bwg_first_image_load(a):jQuery("#spider_popup_wrap .bwg_popup_image_spun img").prop("complete")?bwg_first_image_load(a):jQuery("#spider_popup_wrap .bwg_popup_image_spun img").on("load error",function(){bwg_first_image_load(a)}),spider_receivedpopup(e,t,r))}function bwg_first_image_load(e){e.show(),jQuery(".bwg_spider_popup_loading").hide(),gallery_box_data.preload_images&&bwg_preload_images(parseInt(jQuery("#bwg_current_image_key").val())),bwg_load_filmstrip()}function spider_hasalreadyreceivedpopup(e){return-1<document.cookie.indexOf(e)&&delete document.cookie[document.cookie.indexOf(e)],!1}function spider_receivedpopup(e,t,a){var i=new Date;i.setDate(i.getDate()+t),document.cookie=e+"=true;expires="+i.toUTCString()+";path=/";var r=gallery_box_data.bwg_ctrl_btn_container_height;"bottom"==a?jQuery(".bwg_toggle_container").css("bottom",r+"px"):"top"==a&&jQuery(".bwg_toggle_container").css("top",r+"px")}function spider_isunsupporteduseragent(){return!window.XMLHttpRequest}function spider_destroypopup(e){null!=document.getElementById("spider_popup_wrap")&&(void 0!==jQuery().fullscreen&&jQuery.isFunction(jQuery().fullscreen)&&jQuery.fullscreen.isFullScreen()&&jQuery.fullscreen.exit(),"undefined"!=typeof enable_addthis&&enable_addthis&&jQuery(".at4-share-outer").hide(),setTimeout(function(){jQuery(".spider_popup_wrap").remove(),jQuery(".bwg_spider_popup_loading").css({display:"none"}),jQuery(".spider_popup_overlay").css({display:"none"}),jQuery(document).off("keydown"),!1!==bwg_overflow_initial_value&&jQuery("html").css("overflow",bwg_overflow_initial_value),!1!==bwg_overflow_x_initial_value&&jQuery("html").css("overflow-x",bwg_overflow_x_initial_value),!1!==bwg_overflow_y_initial_value&&jQuery("html").css("overflow-y",bwg_overflow_y_initial_value)},20)),isPopUpOpened=!1;var t=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()),a=document.querySelector('meta[name="viewport"]');t&&a&&(a.content="width=device-width, initial-scale=1");var i=jQuery(document).scrollTop();bwg_objectsL10n.is_pro&&location.replace("#"),jQuery(document).scrollTop(i),void 0!==gallery_box_data.bwg_playInterval&&clearInterval(gallery_box_data.bwg_playInterval)}function get_ajax_pricelist(){var e={};return jQuery(".add_to_cart_msg").html(""),e.ajax_task="display",e.image_id=jQuery("#bwg_popup_image").attr("image_id"),jQuery("#ecommerce_ajax_loading").css("height",jQuery(".bwg_ecommerce_panel").css("height")),jQuery("#ecommerce_opacity_div").css("width",jQuery(".bwg_ecommerce_panel").css("width")),jQuery("#ecommerce_opacity_div").css("height",jQuery(".bwg_ecommerce_panel").css("height")),jQuery("#ecommerce_loading_div").css("width",jQuery(".bwg_ecommerce_panel").css("width")),jQuery("#ecommerce_loading_div").css("height",jQuery(".bwg_ecommerce_panel").css("height")),document.getElementById("ecommerce_opacity_div").style.display="",document.getElementById("ecommerce_loading_div").style.display="table-cell",jQuery.ajax({type:"POST",url:jQuery("#bwg_ecommerce_form").attr("action"),data:e,success:function(e){jQuery(".pge_tabs li a").on("click",function(){return jQuery(".pge_tabs_container > div").hide(),jQuery(".pge_tabs li").removeClass("pge_active"),jQuery(jQuery(this).attr("href")).show(),jQuery(this).closest("li").addClass("pge_active"),jQuery("[name=type]").val(jQuery(this).attr("href").substr(1)),!1});var t=jQuery(e).find(".manual").html();jQuery(".manual").html(t);var a=jQuery(e).find(".downloads").html();jQuery(".downloads").html(a);var i=jQuery(e).find(".pge_options").html();jQuery(".pge_options").html(i);var r=jQuery(e).find(".pge_add_to_cart").html();jQuery(".pge_add_to_cart").html(r)},beforeSend:function(){},complete:function(){document.getElementById("ecommerce_opacity_div").style.display="none",document.getElementById("ecommerce_loading_div").style.display="none"}}),!1}function spider_ajax_save(e){var t={};return t.bwg_name=jQuery("#bwg_name").val(),t.bwg_comment=jQuery("#bwg_comment").val(),t.bwg_email=jQuery("#bwg_email").val(),t.bwg_captcha_input=jQuery("#bwg_captcha_input").val(),t.ajax_task=jQuery("#ajax_task").val(),t.image_id=jQuery("#image_id").val(),t.comment_id=jQuery("#comment_id").val(),jQuery("#ajax_loading").css("height",jQuery(".bwg_comments").css("height")),jQuery("#opacity_div").css("width",jQuery(".bwg_comments").css("width")),jQuery("#opacity_div").css("height",jQuery(".bwg_comments").css("height")),jQuery("#loading_div").css("width",jQuery(".bwg_comments").css("width")),jQuery("#loading_div").css("height",jQuery(".bwg_comments").css("height")),document.getElementById("opacity_div").style.display="",document.getElementById("loading_div").style.display="table-cell",jQuery.ajax({type:"POST",url:jQuery("#"+e).attr("action"),data:t,success:function(e){var t=jQuery(e).find(".bwg_comments").html();jQuery(".bwg_comments").html(t)},beforeSend:function(){},complete:function(){document.getElementById("opacity_div").style.display="none",document.getElementById("loading_div").style.display="none",jQuery(".bwg_comments").mCustomScrollbar({scrollInertia:150,advanced:{updateOnContentResize:!0}}),jQuery(".bwg_comments_close_btn").click(bwg_comment),bwg_captcha_refresh("bwg_captcha")}}),!1}function spider_rate_ajax_save(a){var e={};return e.image_id=jQuery("#"+a+" input[name='image_id']").val(),e.rate=jQuery("#"+a+" input[name='score']").val(),e.ajax_task=jQuery("#rate_ajax_task").val(),jQuery.ajax({type:"POST",url:jQuery("#"+a).attr("action"),data:e,success:function(e){var t=jQuery(e).find("#"+a).html();jQuery("#"+a).html(t)},beforeSend:function(){},complete:function(){}}),!1}function spider_set_input_value(e,t){document.getElementById(e)&&(document.getElementById(e).value=t)}function spider_form_submit(e,t){document.getElementById(t)&&document.getElementById(t).submit(),e.preventDefault?e.preventDefault():e.returnValue=!1}function spider_check_required(e,t){return""==jQuery("#"+e).val()&&(alert(t+" "+bwg_objectsL10n.bwg_field_required),jQuery("#"+e).attr("style","border-color: #FF0000;"),jQuery("#"+e).focus(),!0)}function comment_check_privacy_policy(){var e=jQuery("#bwg_submit");e.removeClass("bwg-submit-disabled"),e.removeAttr("disabled"),jQuery("#bwg_comment_privacy_policy").is(":checked")||(e.addClass("bwg-submit-disabled"),e.attr("disabled","disabled"))}function spider_check_email(e){if(""!=jQuery("#"+e).val())return-1==jQuery("#"+e).val().replace(/^\s+|\s+$/g,"").search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)&&(alert(bwg_objectsL10n.bwg_mail_validation),!0)}function bwg_captcha_refresh(e){document.getElementById(e+"_img")&&document.getElementById(e+"_input")&&(srcArr=document.getElementById(e+"_img").src.split("&r="),document.getElementById(e+"_img").src=srcArr[0]+"&r="+Math.floor(100*Math.random()),document.getElementById(e+"_img").style.display="inline-block",document.getElementById(e+"_input").value="")}function bwg_play_instagram_video(e,t){jQuery(e).parent().find("video").each(function(){jQuery(this).get(0).paused?(jQuery(this).get(0).play(),jQuery(e).children().hide()):(jQuery(this).get(0).pause(),jQuery(e).children().show())})}function bwg_add_comment(){var t=jQuery("#bwg_comment_form"),e=t.attr("action"),a={ajax_task:"add_comment"};return a.comment_name=t.find("#bwg_name").val(),a.comment_email=t.find("#bwg_email").val(),a.comment_text=t.find("#bwg_comment").val(),a.comment_captcha=t.find("#bwg_captcha_input").val(),a.privacy_policy=t.find("#bwg_comment_privacy_policy").is(":checked")?1:0,a.comment_image_id=jQuery("#bwg_popup_image").attr("image_id"),a.comment_moderation=t.find("#bwg_comment_moderation").val(),jQuery(".bwg_spider_ajax_loading").hide(),jQuery.ajax({url:e,type:"POST",dataType:"json",data:a,success:function(e){jQuery(".bwg_comment_error").text(""),1==e.error?jQuery.each(e.error_messages,function(e,t){t&&jQuery(".bwg_comment_"+e+"_error").text(t)}):(t.find("#bwg_comment").val(""),jQuery(".bwg_comment_waiting_message").hide(),0==e.published&&jQuery(".bwg_comment_waiting_message").show(),""!=e.html_comments_block&&jQuery("#bwg_added_comments").html(e.html_comments_block).show())},beforeSend:function(){jQuery(".bwg_spider_ajax_loading").show()},complete:function(){0<t.find("#bwg_comment_privacy_policy").length&&(t.find("#bwg_comment_privacy_policy").prop("checked",!1),comment_check_privacy_policy()),bwg_captcha_refresh("bwg_captcha"),jQuery(".bwg_spider_ajax_loading").hide()},error:function(){}}),!1}function bwg_remove_comment(t){var e=jQuery("#bwg_comment_form").attr("action"),a={ajax_task:"delete_comment"};return a.id_image=jQuery("#bwg_popup_image").attr("image_id"),a.id_comment=t,jQuery.ajax({url:e,type:"POST",dataType:"json",data:a,success:function(e){0==e.error&&jQuery("#bwg_comment_block_"+t).fadeOut("slow").remove()},beforeSend:function(){},complete:function(){},error:function(){}}),!1}function bwg_gallery_box(e,t,a,i){jQuery(".bwg-validate").each(function(){jQuery(this).on("keypress change",function(){jQuery(this).parent().next().find(".bwg_comment_error").html("")})}),void 0===a&&(a=!1);var r,o=t.data("bwg");r=t.find(".bwg-container").data("lightbox-url")?t.find(".bwg-container").data("lightbox-url"):t.data("lightbox-url");var _=jQuery("#bwg_tag_id_"+o).val();_=_||0;var s=1==a?"&open_ecommerce=1":"",n=jQuery("#bwg_search_input_"+o).val(),l=jQuery("#bwg_order_"+o).val()?"&filtersortby="+jQuery("#bwg_order_"+o).val():"";n=n||"",void 0!==i&&(r+="&gallery_id="+i);var g="",u=jQuery("#bwg_blog_style_share_buttons_"+e).attr("data-open-comment");void 0!==u&&!1!==u&&(g="&open_comment=1"),spider_createpopup(r+"&image_id="+e+"&filter_tag="+_+s+g+"&filter_search_name="+n+l,o,t.data("popup-width"),t.data("popup-height"),1,"testpopup",5,t.data("buttons-position"))}function bwg_change_image_lightbox(e,i,r,t){if(bwg_current_key=gallery_box_data.bwg_current_key,jQuery(".bwg_image_info").css("height","auto"),setTimeout(function(){jQuery(".bwg_image_info_container1").height()<jQuery(".bwg_image_info").height()+jQuery(".bwg_toggle_container").height()+bwg_image_info_pos+2*parseInt(gallery_box_data.lightbox_info_margin)&&("top"==gallery_box_data.lightbox_ctrl_btn_pos&&jQuery(".bwg_image_info").css("top",bwg_image_info_pos+"px"),jQuery(".bwg_image_info").height(jQuery(".bwg_image_info_container1").height()-jQuery(".bwg_toggle_container").height()-bwg_image_info_pos-2*parseInt(gallery_box_data.lightbox_info_margin)))},200),jQuery("#spider_popup_left").show(),jQuery("#spider_popup_right").show(),jQuery(".bwg_image_info").hide(),0==gallery_box_data.enable_loop&&(i==parseInt(r.length)-1&&jQuery("#spider_popup_right").hide(),0==i&&jQuery("#spider_popup_left").hide()),1==gallery_box_data.ecommerceACtive&&1==gallery_box_data.enable_image_ecommerce)if(0==gallery_box_data.data[i].pricelist)jQuery(".bwg_ecommerce").hide();else{jQuery(".bwg_ecommerce").show(),jQuery(".pge_tabs li").hide(),jQuery("#downloads").hide(),jQuery("#manual").hide();var a=gallery_box_data.data[i].pricelist_sections.split(",");if(a)if(jQuery("#"+a[0]).show(),jQuery("[name=type]").val(a[0]),1<a.length)for(jQuery(".pge_tabs").show(),k=0;k<a.length;k++)jQuery("#"+a[k]+"_li").show();else jQuery(".pge_tabs").hide();else jQuery("[name=type]").val("")}if(jQuery("#bwg_image_container").find("iframe").each(function(){jQuery(this)[0].contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*"),jQuery(this)[0].contentWindow.postMessage('{ "method": "pause" }',"*"),jQuery(this)[0].contentWindow.postMessage("pause","*")}),jQuery("#bwg_image_container").find("video").each(function(){jQuery(this).trigger("pause")}),void 0===r&&(r=gallery_box_data.data),void 0!==r[i]&&void 0!==r[e]){if(jQuery(".bwg_play_pause").length&&!jQuery(".bwg_play_pause").hasClass("bwg-icon-play")&&bwg_play(r),t||jQuery("#bwg_current_image_key").val(i),gallery_box_data.bwg_trans_in_progress)return void gallery_box_data.event_stack.push(e+"-"+i);var o="right";if(bwg_current_key>i)o="left";else if(bwg_current_key==i)return;jQuery(".bwg_image_count").html(r[i].number),jQuery(".bwg_watermark").css({display:"none"}),"width"==gallery_box_data.width_or_height?bwg_current_filmstrip_pos=i*(jQuery(".bwg_filmstrip_thumbnail").width()+2+2*gallery_box_data.lightbox_filmstrip_thumb_border_width):"height"==gallery_box_data.width_or_height&&(bwg_current_filmstrip_pos=i*(jQuery(".bwg_filmstrip_thumbnail").height()+2+2*gallery_box_data.lightbox_filmstrip_thumb_border_width)),gallery_box_data.bwg_current_key=i,bwg_objectsL10n.is_pro&&(location.replace("#bwg"+gallery_box_data.gallery_id+"/"+r[i].id),history.replaceState(void 0,void 0,"#bwg"+gallery_box_data.gallery_id+"/"+r[i].id)),gallery_box_data.popup_enable_rate&&(jQuery("#bwg_rate_form input[name='image_id']").val(r[i].id),jQuery("#bwg_star").attr("data-score",r[i].avg_rating),jQuery("#bwg_star").removeAttr("title"),r[i].cur_key=i,bwg_rating(r[i].rate,r[i].rate_count,r[i].avg_rating,i)),spider_set_input_value("rate_ajax_task","save_hit_count"),spider_rate_ajax_save("bwg_rate_form"),jQuery(".bwg_image_hits span").html(++r[i].hit_count),jQuery("#bwg_popup_image").attr("image_id",r[i].id),jQuery(".bwg_image_title").html(jQuery('<span style="display: block;" />').html(r[i].alt).text()),jQuery(".bwg_image_description").html(jQuery('<span style="display: block;" />').html(r[i].description).text()),jQuery(".bwg_filmstrip_thumbnail").removeClass("bwg_thumb_active").addClass("bwg_thumb_deactive"),jQuery("#bwg_filmstrip_thumbnail_"+i).removeClass("bwg_thumb_deactive").addClass("bwg_thumb_active"),jQuery(".bwg_image_info").css("opacity",1),""==r[i].alt.trim()&&""==r[i].description.trim()&&jQuery(".bwg_image_info").css("opacity",0),"none"!=jQuery(".bwg_image_info_container1").css("display")?jQuery(".bwg_image_info_container1").css("display","table-cell"):jQuery(".bwg_image_info_container1").css("display","none"),"none"!=jQuery(".bwg_image_rate_container1").css("display")?jQuery(".bwg_image_rate_container1").css("display","table-cell"):jQuery(".bwg_image_rate_container1").css("display","none");var _=2==jQuery(".bwg_popup_image_spun").css("zIndex")?".bwg_popup_image_spun":".bwg_popup_image_second_spun",s=".bwg_popup_image_second_spun"==_?".bwg_popup_image_spun":".bwg_popup_image_second_spun",n=-1<r[i].filetype.indexOf("EMBED_"),l=-1<r[i].filetype.indexOf("INSTAGRAM_POST"),g=-1<r[i].filetype.indexOf("INSTAGRAM_VIDEO"),u=-1!==jQuery.inArray(r[i].filetype,["EMBED_OEMBED_YOUTUBE_VIDEO","EMBED_OEMBED_VIMEO_VIDEO","EMBED_OEMBED_FACEBOOK_VIDEO","EMBED_OEMBED_DAILYMOTION_VIDEO"]),c=jQuery(_).height(),d=jQuery(_).width(),h='<span class="bwg_popup_image_spun1" style="display: '+(n?"block":"table")+'; width: inherit; height: inherit;"><span class="bwg_popup_image_spun2" style="display:'+(n?"block":"table-cell")+'; vertical-align: middle;text-align: center;height: 100%;">';if(n){if(jQuery("#bwg_download").addClass("hidden"),h+='<span class="bwg_popup_embed bwg_popup_watermark" style="display: '+(u?"block":"table")+'; table-layout: fixed; height: 100%;">'+(g?'<div class="bwg_inst_play_btn_cont" onclick="bwg_play_instagram_video(this)" ><div class="bwg_inst_play"></div></div>':" "),l){var b=0,p=0;c<d+88?b=(p=c)-88:p=(b=d)+88,h+=spider_display_embed(r[i].filetype,r[i].image_url,r[i].filename,{class:"bwg_embed_frame","data-width":r[i].image_width,"data-height":r[i].image_height,frameborder:"0",allowfullscreen:"allowfullscreen",style:"width:"+b+"px; height:"+p+"px; vertical-align:middle; display:inline-block; position:relative;"})}else h+=spider_display_embed(r[i].filetype,r[i].image_url,r[i].filename,{class:"bwg_embed_frame",frameborder:"0",allowfullscreen:"allowfullscreen",style:"display:"+(u?"block":"table-cell")+"; width:inherit; height:inherit; vertical-align:middle;"});h+="</span>"}else jQuery(".bwg-loading").removeClass("hidden"),jQuery("#bwg_download").removeClass("hidden"),h+='<img style="max-height: '+c+"px; max-width: "+d+'px;" class="bwg_popup_image bwg_popup_watermark" src="'+gallery_box_data.site_url+jQuery('<span style="display: block;" />').html(r[i].image_url).text()+'" alt="'+r[i].alt+'" />';function m(){gallery_box_data.preload_images&&bwg_preload_images(i),window["bwg_"+gallery_box_data.bwg_image_effect](_,s,o),jQuery(_).find(".bwg_fb_video").each(function(){jQuery(this).attr("src","")}),n?jQuery("#bwg_fullsize_image").attr("href",r[i].image_url):(jQuery("#bwg_fullsize_image").attr("href",gallery_box_data.site_url+r[i].image_url),jQuery("#bwg_download").attr("href",gallery_box_data.site_url+r[i].thumb_url.replace("/thumb/","/.original/")));var e=r[i].image_url.split("/");jQuery("#bwg_download").attr("download",e[e.length-1].replace(/\?bwg=(\d+)$/,""));var t=encodeURIComponent(gallery_box_data.bwg_share_url)+"="+r[i].id+encodeURIComponent("#bwg"+gallery_box_data.gallery_id+"/")+r[i].id;if(n)var a=encodeURIComponent(r[i].thumb_url);else a=gallery_box_data.bwg_share_image_url+encodeURIComponent(encodeURIComponent(r[i].image_url));a=a.replace(/%252F/g,"%2F"),void 0!==addthis_share&&(addthis_share.url=t),jQuery("#bwg_facebook_a").attr("href","https://www.facebook.com/sharer/sharer.php?u="+t),jQuery("#bwg_twitter_a").attr("href","https://twitter.com/share?url="+t),jQuery("#bwg_google_a").attr("href","https://plus.google.com/share?url="+t),jQuery("#bwg_pinterest_a").attr("href","http://pinterest.com/pin/create/button/?s=100&url="+t+"&media="+a+"&description="+r[i].alt+"%0A"+r[i].description),jQuery("#bwg_tumblr_a").attr("href","https://www.tumblr.com/share/photo?source="+a+"&caption="+r[i].alt+"&clickthru="+t),jQuery(".bwg_comment_container").hasClass("bwg_open")&&(0==r[i].comment_count?jQuery("#bwg_added_comments").hide():(jQuery("#bwg_added_comments").show(),spider_set_input_value("ajax_task","display"),spider_set_input_value("image_id",jQuery("#bwg_popup_image").attr("image_id")),spider_ajax_save("bwg_comment_form"))),jQuery(".bwg_ecommerce_container").hasClass("bwg_open")&&(0==r[i].pricelist?(bwg_popup_sidebar_close(jQuery(".bwg_ecommerce_container")),bwg_animate_image_box_for_hide_sidebar(),jQuery(".bwg_ecommerce_container").attr("class","bwg_ecommerce_container bwg_close"),jQuery(".bwg_ecommerce").attr("title",bwg_objectsL10n.bwg_show_ecommerce),jQuery(".spider_popup_close_fullscreen").show()):get_ajax_pricelist()),void 0!==jQuery().mCustomScrollbar&&jQuery.isFunction(jQuery().mCustomScrollbar)&&jQuery(".bwg_comments").mCustomScrollbar({advanced:{updateOnContentResize:!0}}),jQuery(".bwg_comments .mCSB_scrollTools").hide(),gallery_box_data.enable_image_filmstrip&&bwg_move_filmstrip(),bwg_resize_instagram_post()}if(h+="</span></span>",jQuery(s).html(h),jQuery(s).find("img").on("load error",function(){jQuery(".bwg-loading").addClass("hidden")}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxWidth:d,maxHeight:c,height:"auto"}),n)m();else jQuery(s).find("img").one("load",function(){m()}).each(function(){this.complete&&jQuery(this).load()})}}function bwg_preload_images_lightbox(e){for(var t=gallery_box_data.data,a=t.length,i=0==gallery_box_data.preload_images_count||gallery_box_data.preload_images_count>=a?a:gallery_box_data.preload_images_count,r=0,o=1;r<i;o++){var _=1;do{var s=(e+o*_+a)%a;if(void 0!==t[s])-1<t[s].filetype.indexOf("EMBED_")||jQuery("<img/>").attr("src",gallery_box_data.site_url+jQuery('<span style="display: block;" />').html(t[s].image_url).text());_*=-1,r++}while(1!=_)}}function bwg_popup_sidebar_open(e){var t=gallery_box_data.lightbox_comment_width,a=gallery_box_data.lightbox_comment_pos;if(t>jQuery(window).width()){if(t=jQuery(window).width(),e.css({width:t}),jQuery(".spider_popup_close_fullscreen").hide(),jQuery(".spider_popup_close").hide(),jQuery(".bwg_ctrl_btn").hasClass("bwg-icon-pause")){var i=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase());jQuery(".bwg_play_pause").trigger(i?"touchend":"click")}}else jQuery(".spider_popup_close_fullscreen").show();"left"==a?e.animate({left:0},100):e.animate({right:0},100)}function bwg_comment(){if(jQuery(".bwg_watermark").css({display:"none"}),jQuery(".bwg_ecommerce_wrap").css("z-index","-1"),jQuery(".bwg_comment_wrap").css("z-index","25"),jQuery(".bwg_ecommerce_container").hasClass("bwg_open")&&(bwg_popup_sidebar_close(jQuery(".bwg_ecommerce_container")),jQuery(".bwg_ecommerce_container").attr("class","bwg_ecommerce_container bwg_close"),jQuery(".bwg_ecommerce").attr("title",bwg_objectsL10n.bwg_show_ecommerce)),jQuery(".bwg_comment_container").hasClass("bwg_open"))"1"==jQuery(".bwg_comment_container").attr("data-play-status")&&jQuery(".bwg_ctrl_btn.bwg_play_pause").removeClass("bwg-icon-play").addClass("bwg-icon-pause").attr("title",bwg_objectsL10n.bwg_pause),bwg_popup_sidebar_close(jQuery(".bwg_comment_container")),bwg_animate_image_box_for_hide_sidebar(),jQuery(".bwg_comment_wrap").css("z-index","-1"),jQuery(".bwg_comment_container").attr("class","bwg_comment_container bwg_close"),jQuery(".bwg_comment").attr("title",bwg_objectsL10n.bwg_show_comments),jQuery(".spider_popup_close_fullscreen").show();else{jQuery(".bwg_play_pause").hasClass("bwg-icon-pause")?jQuery(".bwg_comment_container").attr("data-play-status","1"):jQuery(".bwg_comment_container").attr("data-play-status","0"),jQuery(".bwg_ctrl_btn.bwg_play_pause").removeClass("bwg-icon-pause").addClass("bwg-icon-play").attr("title",bwg_objectsL10n.bwg_play),bwg_popup_sidebar_open(jQuery(".bwg_comment_container")),bwg_animate_image_box_for_show_sidebar(),jQuery(".bwg_comment_container").attr("class","bwg_comment_container bwg_open"),jQuery(".bwg_comment").attr("title",bwg_objectsL10n.bwg_hide_comments);var e=parseInt(jQuery("#bwg_current_image_key").val());void 0!==gallery_box_data[e]&&0!=gallery_box_data[e].comment_count&&(jQuery("#bwg_added_comments").show(),spider_set_input_value("ajax_task","display"),spider_set_input_value("image_id",jQuery("#bwg_popup_image").attr("image_id")),spider_ajax_save("bwg_comment_form"))}jQuery(".bwg_comments").mCustomScrollbar({scrollInertia:150,advanced:{updateOnContentResize:!0}})}function bwg_ecommerce(){jQuery(".bwg_watermark").css({display:"none"}),jQuery(".bwg_ecommerce_wrap").css("z-index","25"),jQuery(".bwg_comment_wrap").css("z-index","-1"),jQuery(".bwg_comment_container").hasClass("bwg_open")&&(bwg_popup_sidebar_close(jQuery(".bwg_comment_container")),jQuery(".bwg_comment_container").attr("class","bwg_comment_container bwg_close"),jQuery(".bwg_comment").attr("title",bwg_objectsL10n.bwg_show_comments)),jQuery(".bwg_ecommerce_container").hasClass("bwg_open")?(bwg_popup_sidebar_close(jQuery(".bwg_ecommerce_container")),bwg_animate_image_box_for_hide_sidebar(),jQuery(".bwg_ecommerce_container").attr("class","bwg_ecommerce_container bwg_close"),jQuery(".bwg_ecommerce").attr("title",bwg_objectsL10n.bwg_show_ecommerce)):(bwg_popup_sidebar_open(jQuery(".bwg_ecommerce_container")),bwg_animate_image_box_for_show_sidebar(),jQuery(".bwg_ecommerce_container").attr("class","bwg_ecommerce_container bwg_open"),jQuery(".bwg_ecommerce").attr("title",bwg_objectsL10n.bwg_hide_ecommerce),get_ajax_pricelist())}function bwg_popup_sidebar_close(e){var t=parseInt(e.css("borderRightWidth"));t||(t=0),"left"==lightbox_comment_pos?e.animate({left:-e.width()-t},100):"right"==lightbox_comment_pos&&e.animate({right:-e.width()-t},100)}function bwg_animate_image_box_for_hide_sidebar(){"left"==lightbox_comment_pos?jQuery(".bwg_image_wrap").animate({left:0,width:jQuery("#spider_popup_wrap").width()},100):"right"==lightbox_comment_pos&&jQuery(".bwg_image_wrap").animate({right:0,width:jQuery("#spider_popup_wrap").width()},100),jQuery(".bwg_image_container").animate({width:jQuery("#spider_popup_wrap").width()-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)},100),jQuery(".bwg_popup_image").animate({maxWidth:jQuery("#spider_popup_wrap").width()-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)},{duration:100,complete:function(){bwg_change_watermark_container()}}),jQuery(".bwg_popup_embed").animate({width:jQuery("#spider_popup_wrap").width()-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)},{duration:100,complete:function(){bwg_resize_instagram_post(),bwg_change_watermark_container()}}),"width"==gallery_box_data.width_or_height?(jQuery(".bwg_filmstrip_container").animate({width:jQuery(".spider_popup_wrap").width()},100),jQuery(".bwg_filmstrip").animate({width:jQuery(".spider_popup_wrap").width()-40},100)):"height"==gallery_box_data.width_or_height&&(jQuery(".bwg_filmstrip_container").animate({height:jQuery(".spider_popup_wrap").width()},100),jQuery(".bwg_filmstrip").animate({height:jQuery(".spider_popup_wrap").width()-40},100)),bwg_set_filmstrip_pos(jQuery(".spider_popup_wrap").width()-40,"",gallery_box_data),jQuery(".spider_popup_close_fullscreen").show(100)}function bwg_animate_image_box_for_show_sidebar(){var e=jQuery(".bwg_comment_container").width()||jQuery(".bwg_ecommerce_container").width();"left"==lightbox_comment_pos?jQuery(".bwg_image_wrap").animate({left:e,width:jQuery("#spider_popup_wrap").width()-e},100):"right"==lightbox_comment_pos&&jQuery(".bwg_image_wrap").animate({right:e,width:jQuery("#spider_popup_wrap").width()-e},100),jQuery(".bwg_image_container").animate({width:jQuery("#spider_popup_wrap").width()-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)-e},100),jQuery(".bwg_popup_image").animate({maxWidth:jQuery("#spider_popup_wrap").width()-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)},{duration:100,complete:function(){bwg_change_watermark_container()}}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").animate({maxWidth:jQuery("#spider_popup_wrap").width()-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)},{duration:100,complete:function(){bwg_resize_instagram_post(),bwg_change_watermark_container()}}),"width"==gallery_box_data.width_or_height&&(jQuery(".bwg_filmstrip_container").css({width:jQuery("#spider_popup_wrap").width()-("vertical"==gallery_box_data.filmstrip_direction?0:e)}),jQuery(".bwg_filmstrip").animate({width:jQuery(".bwg_filmstrip_container").width()-40},100),bwg_set_filmstrip_pos(jQuery(".bwg_filmstrip_container").width()-40,"",gallery_box_data))}function bwg_reset_zoom(){var e=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()),t=document.querySelector('meta[name="viewport"]');e&&t&&(t.content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=0")}function bwg_open_with_fullscreen(){jQuery(".bwg_watermark").css({display:"none"});var e=0;(jQuery(".bwg_comment_container").hasClass("bwg_open")||jQuery(".bwg_ecommerce_container").hasClass("bwg_open"))&&(e=jQuery(".bwg_comment_container").width()||jQuery(".bwg_ecommerce_container").width()),bwg_popup_current_width=jQuery(window).width(),bwg_popup_current_height=window.innerHeight,jQuery("#spider_popup_wrap").css({width:jQuery(window).width(),height:window.innerHeight,left:0,top:0,margin:0,zIndex:100002}),jQuery(".bwg_image_wrap").css({width:jQuery(window).width()-e}),jQuery(".bwg_image_container").css({height:bwg_popup_current_height-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0),width:bwg_popup_current_width-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)}),jQuery(".bwg_popup_image").css({maxWidth:jQuery(window).width()-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)},{complete:function(){bwg_change_watermark_container()}}),jQuery(".bwg_popup_video").css({width:jQuery(window).width()-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),height:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)},{complete:function(){bwg_change_watermark_container()}}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxWidth:jQuery(window).width()-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)},{complete:function(){bwg_resize_instagram_post(),bwg_change_watermark_container()}}),"width"==gallery_box_data.width_or_height?(jQuery(".bwg_filmstrip_container").css({width:jQuery(window).width()-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)}),jQuery(".bwg_filmstrip").css({width:jQuery(window).width()-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-40}),bwg_set_filmstrip_pos(jQuery(window).width()-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-40,"",gallery_box_data)):(jQuery(".bwg_filmstrip_container").css({height:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)}),jQuery(".bwg_filmstrip").css({height:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-40}),bwg_set_filmstrip_pos(window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-40,"",gallery_box_data)),jQuery(".bwg_resize-full").attr("class","bwg-icon-compress bwg_ctrl_btn bwg_resize-full"),jQuery(".bwg_resize-full").attr("title",bwg_objectsL10n.bwg_restore),jQuery(".spider_popup_close").attr("class","bwg_ctrl_btn spider_popup_close_fullscreen")}function bwg_resize_full(){jQuery(".bwg_watermark").css({display:"none"});var e=0;(jQuery(".bwg_comment_container").hasClass("bwg_open")||jQuery(".bwg_ecommerce_container").hasClass("bwg_open"))&&(e=jQuery(".bwg_comment_container").width()||jQuery(".bwg_ecommerce_container").width()),jQuery(".bwg_resize-full").hasClass("bwg-icon-compress")?(jQuery(window).width()>gallery_box_data.image_width&&(bwg_popup_current_width=gallery_box_data.image_width),window.innerHeight>gallery_box_data.image_height&&(bwg_popup_current_height=gallery_box_data.image_height),jQuery("#spider_popup_wrap").animate({width:bwg_popup_current_width,height:bwg_popup_current_height,left:"50%",top:"50%",marginLeft:-bwg_popup_current_width/2,marginTop:-bwg_popup_current_height/2,zIndex:100002},500),jQuery(".bwg_image_wrap").animate({width:bwg_popup_current_width-e},500),jQuery(".bwg_image_container").animate({height:bwg_popup_current_height-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0),width:bwg_popup_current_width-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)},500),jQuery(".bwg_popup_image").animate({maxWidth:bwg_popup_current_width-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:bwg_popup_current_height-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)},{duration:500,complete:function(){bwg_change_watermark_container(),jQuery("#spider_popup_wrap").width()<jQuery(window).width()&&jQuery("#spider_popup_wrap").height()<window.innerHeight&&jQuery(".spider_popup_close_fullscreen").attr("class","spider_popup_close")}}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").animate({maxWidth:bwg_popup_current_width-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:bwg_popup_current_height-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)},{duration:500,complete:function(){bwg_resize_instagram_post(),bwg_change_watermark_container(),jQuery("#spider_popup_wrap").width()<jQuery(window).width()&&jQuery("#spider_popup_wrap").height()<window.innerHeight&&jQuery(".spider_popup_close_fullscreen").attr("class","spider_popup_close")}}),"width"==gallery_box_data.width_or_height?(jQuery(".bwg_filmstrip_container").animate({width:bwg_popup_current_width-("horizontal"==gallery_box_data.filmstrip_direction?e:0)},500),jQuery(".bwg_filmstrip").animate({width:bwg_popup_current_width-("horizontal"==gallery_box_data.filmstrip_direction?e:0)-40},500),bwg_set_filmstrip_pos(bwg_popup_current_width-40,"",gallery_box_data)):(jQuery(".bwg_filmstrip_container").animate({height:bwg_popup_current_height-("horizontal"==gallery_box_data.filmstrip_direction?e:0)},500),jQuery(".bwg_filmstrip").animate({height:bwg_popup_current_height-("horizontal"==gallery_box_data.filmstrip_direction?e:0)-40},500),bwg_set_filmstrip_pos(bwg_popup_current_height-40,"",gallery_box_data)),jQuery(".bwg_resize-full").attr("class","bwg-icon-expand bwg_ctrl_btn bwg_resize-full"),jQuery(".bwg_resize-full").attr("title",bwg_objectsL10n.bwg_maximize)):(bwg_popup_current_width=jQuery(window).width(),bwg_popup_current_height=window.innerHeight,jQuery("#spider_popup_wrap").animate({width:jQuery(window).width(),height:window.innerHeight,left:0,top:0,margin:0,zIndex:100002},500),jQuery(".bwg_image_wrap").animate({width:jQuery(window).width()-e},500),jQuery(".bwg_image_container").animate({height:bwg_popup_current_height-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0),width:bwg_popup_current_width-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)},500),jQuery(".bwg_popup_image").animate({maxWidth:jQuery(window).width()-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)},{duration:500,complete:function(){bwg_change_watermark_container()}}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").animate({maxWidth:jQuery(window).width()-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)},{duration:500,complete:function(){bwg_resize_instagram_post(),bwg_change_watermark_container()}}),"width"==gallery_box_data.width_or_height?(jQuery(".bwg_filmstrip_container").animate({width:jQuery(window).width()-("horizontal"==gallery_box_data.filmstrip_direction?e:0)},500),jQuery(".bwg_filmstrip").animate({width:jQuery(window).width()-("horizontal"==gallery_box_data.filmstrip_direction?e:0)-40},500),bwg_set_filmstrip_pos(jQuery(window).width()-("horizontal"==gallery_box_data.filmstrip_direction?e:0)-40,"",gallery_box_data)):(jQuery(".bwg_filmstrip_container").animate({height:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?e:0)},500),jQuery(".bwg_filmstrip").animate({height:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?e:0)-40},500),bwg_set_filmstrip_pos(window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?e:0)-40,"",gallery_box_data)),jQuery(".bwg_resize-full").attr("class","bwg-icon-compress bwg_ctrl_btn bwg_resize-full"),jQuery(".bwg_resize-full").attr("title",bwg_objectsL10n.bwg_restore),jQuery(".spider_popup_close").attr("class","bwg_ctrl_btn spider_popup_close_fullscreen"))}function bwg_popup_resize_lightbox(){void 0!==jQuery().fullscreen&&jQuery.isFunction(jQuery().fullscreen)&&(jQuery.fullscreen.isFullScreen()||(jQuery(".bwg_resize-full").show(),jQuery(".bwg_resize-full").hasClass("bwg-icon-compress")||jQuery(".bwg_resize-full").attr("class","bwg-icon-expand bwg_ctrl_btn bwg_resize-full"),jQuery(".bwg_resize-full").attr("title",bwg_objectsL10n.bwg_maximize),jQuery(".bwg_fullscreen").attr("class","bwg-icon-arrows-out bwg_ctrl_btn bwg_fullscreen"),jQuery(".bwg_fullscreen").attr("title",bwg_objectsL10n.fullscreen)));var e=0;(jQuery(".bwg_comment_container").hasClass("bwg_open")||jQuery(".bwg_ecommerce_container").hasClass("bwg_open"))&&(e=gallery_box_data.lightbox_comment_width),e>jQuery(window).width()?(e=jQuery(window).width(),jQuery(".bwg_comment_container").css({width:e}),jQuery(".bwg_ecommerce_container").css({width:e}),jQuery(".spider_popup_close_fullscreen").hide()):jQuery(".spider_popup_close_fullscreen").show(),window.innerHeight>gallery_box_data.image_height&&1!=gallery_box_data.open_with_fullscreen&&!jQuery(".bwg_resize-full").hasClass("bwg-icon-compress")?(jQuery("#spider_popup_wrap").css({height:gallery_box_data.image_height,top:"50%",marginTop:-gallery_box_data.image_height/2,zIndex:100002}),jQuery(".bwg_image_container").css({height:gallery_box_data.image_height-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),jQuery(".bwg_popup_image").css({maxHeight:gallery_box_data.image_height-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxHeight:gallery_box_data.image_height-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),"vertical"==gallery_box_data.filmstrip_direction&&(jQuery(".bwg_filmstrip_container").css({height:gallery_box_data.image_height}),jQuery(".bwg_filmstrip").css({height:gallery_box_data.image_height-40})),bwg_popup_current_height=gallery_box_data.image_height):(jQuery("#spider_popup_wrap").css({height:window.innerHeight,top:0,marginTop:0,zIndex:100002}),jQuery(".bwg_image_container").css({height:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),jQuery(".bwg_popup_image").css({maxHeight:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxHeight:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),"vertical"==gallery_box_data.filmstrip_direction&&(jQuery(".bwg_filmstrip_container").css({height:window.innerHeight}),jQuery(".bwg_filmstrip").css({height:window.innerHeight-40})),bwg_popup_current_height=window.innerHeight),jQuery(window).width()>=gallery_box_data.image_width&&1!=gallery_box_data.open_with_fullscreen?(jQuery("#spider_popup_wrap").css({width:gallery_box_data.image_width,left:"50%",marginLeft:-gallery_box_data.image_width/2,zIndex:100002}),jQuery(".bwg_image_wrap").css({width:gallery_box_data.image_width-e}),jQuery(".bwg_image_container").css({width:gallery_box_data.image_width-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)-e}),jQuery(".bwg_popup_image").css({maxWidth:gallery_box_data.image_width-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)-e}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxWidth:gallery_box_data.image_width-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)-e}),"horizontal"==gallery_box_data.filmstrip_direction&&(jQuery(".bwg_filmstrip_container").css({width:gallery_box_data.image_width-e}),jQuery(".bwg_filmstrip").css({width:gallery_box_data.image_width-e-40})),bwg_popup_current_width=gallery_box_data.image_width):(jQuery("#spider_popup_wrap").css({width:jQuery(window).width(),left:0,marginLeft:0,zIndex:100002}),jQuery(".bwg_image_wrap").css({width:jQuery(window).width()-e}),jQuery(".bwg_image_container").css({width:jQuery(window).width()-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)-e}),jQuery(".bwg_popup_image").css({maxWidth:jQuery(window).width()-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)-e}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxWidth:jQuery(window).width()-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)-e}),"horizontal"==gallery_box_data.filmstrip_direction&&(jQuery(".bwg_filmstrip_container").css({width:jQuery(window).width()-e}),jQuery(".bwg_filmstrip").css({width:jQuery(window).width()-e-40})),bwg_popup_current_width=jQuery(window).width()),bwg_resize_instagram_post(),bwg_change_watermark_container(),window.innerHeight>gallery_box_data.image_height-2*gallery_box_data.lightbox_close_btn_top&&jQuery(window).width()>=gallery_box_data.image_width-2*gallery_box_data.lightbox_close_btn_right&&1!=gallery_box_data.open_with_fullscreen?jQuery(".spider_popup_close_fullscreen").attr("class","spider_popup_close"):jQuery("#spider_popup_wrap").width()<jQuery(window).width()&&jQuery("#spider_popup_wrap").height()<jQuery(window).height()&&jQuery(".spider_popup_close").attr("class","bwg_ctrl_btn spider_popup_close_fullscreen");var t=gallery_box_data.bwg_ctrl_btn_container_height;"bottom"==gallery_box_data.lightbox_ctrl_btn_pos&&jQuery(".bwg_toggle_container i").hasClass("bwg-icon-caret-down")&&jQuery(".bwg_toggle_container").css("bottom",t+"px"),"top"==gallery_box_data.lightbox_ctrl_btn_pos&&jQuery(".bwg_toggle_container i").hasClass("bwg-icon-caret-up")&&jQuery(".bwg_toggle_container").css("top",t+"px")}function bwg_rating(e,t,a,i){lightbox_rate_stars_count=gallery_box_data.lightbox_rate_stars_count,lightbox_rate_size=gallery_box_data.lightbox_rate_size,lightbox_rate_icon=gallery_box_data.lightbox_rate_icon;var r="Not rated yet.";0!=a&&""!=a&&(r=parseFloat(a).toFixed(1)+"\n Votes: "+t),void 0!==jQuery().raty&&jQuery.isFunction(jQuery().raty)&&jQuery("#bwg_star").raty({score:function(){return jQuery(this).attr("data-score")},starType:"i",number:lightbox_rate_stars_count,size:lightbox_rate_size,readOnly:function(){return!!e},noRatedMsg:"Not rated yet.",click:function(e,t){jQuery("#bwg_star").hide(),jQuery("#bwg_rated").show(),spider_set_input_value("rate_ajax_task","save_rate"),spider_rate_ajax_save("bwg_rate_form"),gallery_box_data.data[i].rate=e,++gallery_box_data.data[i].rate_count;var a=parseFloat(jQuery("#bwg_star").attr("data-score"));gallery_box_data.data[i].avg_rating=a?((a+e)/2).toFixed(1):e.toFixed(1)},starHalf:"bwg-icon-"+lightbox_rate_icon+("star"==lightbox_rate_icon?"-half":"")+"-o",starOff:"bwg-icon-"+lightbox_rate_icon+"-o",starOn:"bwg-icon-"+lightbox_rate_icon,cancelOff:"bwg-icon-minus-square-o",cancelOn:"bwg-icon-minus-square-o",cancel:!1,cancelHint:"Cancel your rating.",hints:[r,r,r,r,r],alreadyRatedMsg:parseFloat(a).toFixed(1)+"\nYou have already rated.\nVotes: "+t})}function changeDownloadsTotal(e){var t=0;0==jQuery("[name=option_show_digital_items_count]").val()?jQuery("[name=selected_download_item]:checked").each(function(){t+=Number(jQuery(this).closest("tr").attr("data-price"))}):jQuery(".digital_image_count").each(function(){0!=Number(jQuery(this).val())&&(t+=Number(jQuery(this).closest("tr").attr("data-price"))*Number(jQuery(this).val()))}),t=t.toFixed(2).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,"),jQuery(".product_downloads_price").html(t)}function changeMenualTotal(e){Number(jQuery(e).val())<=0&&jQuery(e).val("1");var t=Number(jQuery(e).val()),a=Number(jQuery(".product_manual_price").attr("data-actual-price"));a=(a*=t).toFixed(2).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,"),jQuery(".product_manual_price").html(a)}function onSelectableParametersChange(e){var t=0,a=gallery_box_data[jQuery("#bwg_current_image_key").val()].pricelist_manual_price?gallery_box_data[jQuery("#bwg_current_image_key").val()].pricelist_manual_price:"0";a=parseFloat(a.replace(",",""));var i=jQuery(e).closest(".image_selected_parameter").attr("data-parameter-type"),r=jQuery(e).val();r=r.split("*");var o=parseFloat(r[1]),_=r[0],s=Number(jQuery(e).closest(".image_selected_parameter").find(".already_selected_values").val());if("4"==i||"5"==i){var n=parseFloat(_+o);jQuery(e).closest(".image_selected_parameter").find(".already_selected_values").val(n)}else if("6"==i){if(0==jQuery(e).is(":checked"))var l=s-parseFloat(_+o);else l=s+parseFloat(_+o);jQuery(e).closest(".image_selected_parameter").find(".already_selected_values").val(l)}jQuery(".already_selected_values").each(function(){t+=Number(jQuery(this).val())}),a+=t,jQuery(".product_manual_price").attr("data-actual-price",a),a=(a*=Number(jQuery(".image_count").val())<=0?1:Number(jQuery(".image_count").val())).toFixed(2).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,"),jQuery(".product_manual_price").html(a)}function onBtnClickAddToCart(){var e=jQuery("[name=type]").val();if(""!=e){var t={};if("manual"==e){var a=jQuery(".image_count").val(),i={};jQuery(".manual").find(".image_selected_parameter").each(function(){var e=jQuery(this).attr("data-parameter-id"),t="";switch(jQuery(this).attr("data-parameter-type")){case"2":t=jQuery(this).find("input").val();break;case"3":t=jQuery(this).find("textarea").val();break;case"4":t=jQuery(this).find("select :selected").val();break;case"5":t=jQuery(this).find("[type=radio]:checked").val();break;case"6":var a=[];jQuery(this).find("[type=checkbox]:checked").each(function(){a.push(jQuery(this).val())}),t=a}i[e]=t}),t.count=a,t.parameters=i,t.price=jQuery(".product_manual_price").attr("data-price").replace(",","")}else{var r=[];if(0==jQuery("[name=option_show_digital_items_count]").val()){if(0==jQuery("[name=selected_download_item]:checked").length)return void jQuery(".add_to_cart_msg").html("You must select at least one item.");jQuery("[name=selected_download_item]:checked").each(function(){var e={};e.id=jQuery(this).val(),e.count=1,e.price=jQuery(this).closest("tr").attr("data-price"),r.push(e)})}else jQuery(".digital_image_count").each(function(){var e={};0<jQuery(this).val()&&(e.id=jQuery(this).closest("tr").attr("data-id"),e.price=jQuery(this).closest("tr").attr("data-price"),e.count=jQuery(this).val(),r.push(e))});if(0==(t.downloadItems=r).length)return void jQuery(".add_to_cart_msg").html("Please select at least one item")}var o=jQuery("#ajax_url").val(),_={action:"add_cart",task:"add_cart",controller:"checkout",image_id:jQuery("#bwg_popup_image").attr("image_id"),type:e,data:JSON.stringify(t)};jQuery.ajax({type:"POST",url:o,data:_,success:function(e){responseData=JSON.parse(e),jQuery(".add_to_cart_msg").html(responseData.msg),jQuery(".products_in_cart").html(responseData.products_in_cart),1==responseData.redirect&&(window.location.href="<?php echo get_permalink($options->checkout_page);?>")},beforeSend:function(){},complete:function(){}})}else jQuery(".add_to_cart_msg").html("Please select Prints and products or Downloads")}function onBtnViewCart(){var e=jQuery("[name=option_checkout_page]").val();jQuery("#bwg_ecommerce_form").attr("action",e),jQuery("#bwg_ecommerce_form").submit()}function wds_load_visible_images(e,t,a,i,r){0<=e-t&&(i=e-t),a<e+t&&(r=a);for(var o=i;o<=r;o++){var _=jQuery("#bwg_filmstrip_thumbnail_"+o+" img");_.removeClass("hidden"),_.attr("src",_.data("url"))}}function bwg_load_filmstrip(){for(var e=1;e<=total_thumbnail_count;e++){var t;if(leftIndex=startPoint-e,rightIndex=endPoint+e,rightIndex<total_thumbnail_count)(t=jQuery("#bwg_filmstrip_thumbnail_"+rightIndex+" img")).removeClass("hidden"),t.attr("src",t.data("url"));if(0<=leftIndex)(t=jQuery("#bwg_filmstrip_thumbnail_"+leftIndex+" img")).removeClass("hidden"),t.attr("src",t.data("url"))}}function spider_display_embed(e,t,a,i){var r="";switch(e){case"EMBED_OEMBED_YOUTUBE_VIDEO":var o="<iframe ";for(attr in""!=a&&(o+=' src="//www.youtube.com/embed/'+a+'?enablejsapi=1&wmode=transparent"'),i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(o+=" "+attr+'="'+i[attr]+'"');r+=o+=" ></iframe>";break;case"EMBED_OEMBED_VIMEO_VIDEO":var _="<iframe ";for(attr in""!=a&&(_+=' src="//player.vimeo.com/video/'+a+'?enablejsapi=1"'),i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(_+=" "+attr+'="'+i[attr]+'"');r+=_+=" ></iframe>";break;case"EMBED_OEMBED_FLICKR_IMAGE":var s="<div ";for(attr in i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(s+=" "+attr+'="'+i[attr]+'"');s+=" >",""!=a&&(s+='<img src="'+a+'" style="max-width:100% !important; max-height:100% !important; width:auto !important; height:auto !important;">'),r+=s+="</div>";break;case"EMBED_OEMBED_FLICKR_VIDEO":break;case"EMBED_OEMBED_INSTAGRAM_VIDEO":var n="<div ";for(attr in i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(n+=" "+attr+'="'+i[attr]+'"');n+=" >",""!=a&&(n+='<video style="width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;" controls><source src="'+a+'" type="video/mp4"> Your browser does not support the video tag. </video>'),r+=n+="</div>";break;case"EMBED_OEMBED_INSTAGRAM_IMAGE":n="<div ";for(attr in i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(n+=" "+attr+'="'+i[attr]+'"');n+=" >",""!=a&&(n+='<img src="//instagram.com/p/'+a+'/media/?size=l" style=" max-width:100% !important; max-height:100% !important; width:auto; height:auto;">'),r+=n+="</div>";break;case"EMBED_OEMBED_INSTAGRAM_POST":n="<div ";for(attr in i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(n+=" "+attr+'="'+i[attr]+'"',"CLASS"!=attr&&"class"!=attr&&"Class"!=attr||(obj_class=i[attr]));n+=" >",""!=a&&(n+='<iframe class="inner_instagram_iframe_'+obj_class+'" src="//instagr.am/p/'+a+'/embed/?enablejsapi=1" style="max-width:100% !important; max-height:100% !important; width:100%; height:100%; margin:0; display:table-cell; vertical-align:middle;"frameborder="0" scrolling="no" allowtransparency="false" allowfullscreen></iframe>'),r+=n+="</div>";break;case"EMBED_OEMBED_FACEBOOK_IMAGE":var l="<span ";for(attr in i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(l+=" "+attr+'="'+i[attr]+'"');l+=" >",""!=a&&(l+='<img src="'+t+'" style=" max-width:100% !important; max-height:100% !important; width:auto; height:100%;">'),r+=l+="</span>";break;case"EMBED_OEMBED_FACEBOOK_VIDEO":var g="<div ";for(attr in i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(g+=" "+attr+'="'+i[attr]+'"');g+=" >",""!=a&&(g+='<iframe src="//www.facebook.com/video/embed?video_id='+t+'&enablejsapi=1&wmode=transparent" style="max-width:100% !important; max-height:100% !important; width:100%; height:100%; margin:0; display:table-cell; vertical-align:middle;"frameborder="0" class="bwg_fb_video" scrolling="no" allowtransparency="false" allowfullscreen></iframe>'),r+=g+="</div>";break;case"EMBED_OEMBED_DAILYMOTION_VIDEO":var u="<iframe ";for(attr in""!=a&&(u+=' src="//www.dailymotion.com/embed/video/'+a+'?api=postMessage"'),i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(u+=" "+attr+'="'+i[attr]+'"');r+=u+=" ></iframe>";break;case"EMBED_OEMBED_IMGUR":var c="<div ";for(attr in i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(n+=" "+attr+'="'+i[attr]+'"');c+=" >",""!=a&&(c+='<img src="'+a+'" style="max-width:100% !important; max-height:100% !important; width:auto; height:auto !important;">'),r+=c+="</div>"}return r}function bwg_add_instagram_gallery(e,_){if(!0===(_=void 0!==_&&_)){if(bwg_check_instagram_gallery_input(e,_))return!1;var t="0";1==jQuery("input[name=popup_instagram_post_gallery]:checked").val()&&(t="1");var a=encodeURI(jQuery("#popup_instagram_gallery_source").val()),i=encodeURI(jQuery("#popup_instagram_image_number").val())}else{if(bwg_check_instagram_gallery_input(e,_))return!1;if(!bwg_check_gallery_empty(!1,!0))return!1;t="0";1==jQuery("input[name=instagram_post_gallery]:checked").val()&&(t="1");a=encodeURI(jQuery("#gallery_source").val());var r=jQuery("input[name=update_flag]:checked").val();i=encodeURI(jQuery("#autogallery_image_number").val())}jQuery("#bulk_embed").hide(),jQuery("#loading_div").show();var s=[],o={action:"addInstagramGallery",instagram_user:a,instagram_access_token:e,whole_post:t,autogallery_image_number:i,update_flag:r,async:!0};jQuery.post(ajax_url,o,function(e){if(0==e)return alert("Error: cannot get response from the server."),jQuery("#loading_div").hide(),_&&jQuery("#bulk_embed").show(),!1;var t=e.indexOf("WD_delimiter_start"),a=e.indexOf("WD_delimiter_end");if(-1==t||-1==a)return jQuery("#loading_div").hide(),_&&jQuery("#bulk_embed").show(),!1;if(e=e.substring(t+18,a),response_JSON=jQuery.parseJSON(e),response_JSON){if("error"==response_JSON[0])return alert("Error: "+jQuery.parseJSON(e)[1]),jQuery("#loading_div").hide(),_&&jQuery("#bulk_embed").show(),!1;for(var i=response_JSON.length,r=1;r<=i;r++)if(0!=response_JSON[i-r]){var o=response_JSON[i-r];s.push(o)}return bwg_add_image(s),_||(bwg_gallery_update_flag(),jQuery("#tr_instagram_gallery_add_button").hide()),jQuery("#loading_div").hide(),_&&jQuery(".opacity_bulk_embed").hide(),"ok"}return alert("There is some error. Cannot add Instagram gallery."),jQuery("#loading_div").hide(),_&&jQuery("#bulk_embed").show(),!1})}!function(_){var s={init:function(i){return this.each(function(){s.destroy.call(this),this.opt=_.extend(!0,{},_.fn.raty.defaults,i);var e=_(this);s._callback.call(this,["number","readOnly","score","scoreName"]),this.opt.precision&&s._adjustPrecision.call(this),this.opt.number=s._between(this.opt.number,0,this.opt.numberMax),this.opt.path=this.opt.path||"",this.opt.path&&"/"!==this.opt.path.slice(this.opt.path.length-1,this.opt.path.length)&&(this.opt.path+="/"),this.stars=s._createStars.call(this),this.score=s._createScore.call(this),s._apply.call(this,this.opt.score);var t=this.opt.space?4:0,a=this.opt.width||this.opt.number*this.opt.size+this.opt.number*t;this.opt.cancel&&(this.cancel=s._createCancel.call(this),a+=this.opt.size+t),this.opt.readOnly?s._lock.call(this):(e.css("cursor","pointer"),s._binds.call(this)),!1!==this.opt.width&&(e.css("width",a),_(".bwg_rate_spun").css("width",a)),s._target.call(this,this.opt.score),e.data({settings:this.opt,raty:!0})})},_adjustPrecision:function(){this.opt.targetType="score",this.opt.half=!0},_apply:function(e){e&&0<e&&(e=s._between(e,0,this.opt.number),this.score.val(e)),s._fill.call(this,e),e&&s._roundStars.call(this,e),_("#bwg_star *").removeClass("bwg_rate_hover")},_between:function(e,t,a){return Math.min(Math.max(parseFloat(e),t),a)},_binds:function(){this.cancel&&s._bindCancel.call(this),s._bindClick.call(this),s._bindOut.call(this),s._bindOver.call(this)},_bindCancel:function(){s._bindClickCancel.call(this),s._bindOutCancel.call(this),s._bindOverCancel.call(this)},_bindClick:function(){var t=this,a=_(t);t.stars.on("click.raty",function(e){t.score.val(t.opt.half||t.opt.precision?a.data("score"):_(this).attr("alt")),t.opt.click&&t.opt.click.call(t,parseFloat(t.score.val()),e)})},_bindClickCancel:function(){var t=this;t.cancel.on("click.raty",function(e){t.score.removeAttr("value"),t.opt.click&&t.opt.click.call(t,null,e)})},_bindOut:function(){var a=this;_(this).on("mouseleave.raty",function(e){var t=parseFloat(a.score.val())||void 0;s._apply.call(a,t),s._target.call(a,t,e),a.opt.mouseout&&a.opt.mouseout.call(a,t,e)})},_bindOutCancel:function(){var t=this;t.cancel.on("mouseleave.raty",function(e){_(this).attr("class",t.opt.cancelOff),t.opt.mouseout&&t.opt.mouseout.call(t,t.score.val()||null,e)})},_bindOverCancel:function(){var t=this;t.cancel.on("mouseover.raty",function(e){_(this).attr("class",t.opt.cancelOn),t.stars.attr("class",t.opt.starOff),s._target.call(t,null,e),t.opt.mouseover&&t.opt.mouseover.call(t,null)})},_bindOver:function(){var r=this,o=_(r),e=r.opt.half?"mousemove.raty":"mouseover.raty";r.stars.on(e,function(e){var t=parseInt(_(this).attr("alt"),10);if(r.opt.half){var a=parseFloat((e.pageX-_(this).offset().left)/r.opt.size),i=.5<a?1:.5;t=t-1+i,s._fill.call(r,t),r.opt.precision&&(t=t-i+a),s._roundStars.call(r,t),o.data("score",t)}else s._fill.call(r,t);s._target.call(r,t,e),r.opt.mouseover&&r.opt.mouseover.call(r,t,e)})},_callback:function(e){for(i in e)"function"==typeof this.opt[e[i]]&&(this.opt[e[i]]=this.opt[e[i]].call(this))},_createCancel:function(){var e=_(this),t=this.opt.cancelOff,a=_("<i />",{class:"raty-cancel "+t,alt:"x",title:this.opt.cancelHint});return"left"==this.opt.cancelPlace?e.prepend("&#160;").prepend(a):e.append("&#160;").append(a),a},_createScore:function(){return _("<input />",{type:"hidden",name:this.opt.scoreName}).appendTo(this)},_createStars:function(){for(var e=_(this),t=1;t<=this.opt.number;t++){var a=s._getHint.call(this,t),i=this.opt.score&&this.opt.score>=t?"starOn":"starOff";i=this.opt[i],_("<i />",{class:i,alt:t,title:a}).appendTo(this),this.opt.space&&e.append(t<this.opt.number?"&#160;":"")}return e.children("i")},_error:function(e){_(this).html(e),_.error(e)},_fill:function(e){for(var t=this,a=0,i=1;i<=t.stars.length;i++){var r=t.stars.eq(i-1),o=t.opt.single?i==e:i<=e;if(t.opt.iconRange&&t.opt.iconRange.length>a){var _=t.opt.iconRange[a],s=_.on||"starOn",n=_.off||"starOff",l=o?s:n;i<=_.range&&(r.attr("class",this.opt[l]),l==s&&r.addClass("bwg_rate_hover")),i==_.range&&a++}else{l=o?"starOn":"starOff";r.attr("class",this.opt[l]),"starOn"==l&&r.addClass("bwg_rate_hover")}}},_getHint:function(e){var t=this.opt.hints[e-1];return""===t?"":t||e},_lock:function(){var e=parseInt(this.score.val(),10);e?s._getHint.call(this,e):this.opt.noRatedMsg;_(this).data("readonly",!0).css("cursor","").attr("title",this.opt.alreadyRatedMsg),this.score.attr("readonly","readonly"),this.stars.attr("title",this.opt.alreadyRatedMsg),this.cancel&&this.cancel.hide()},_roundStars:function(e){var t=(e-Math.floor(e)).toFixed(2);if(t>this.opt.round.down){var a="starOn";this.opt.halfShow&&t<this.opt.round.up?a="starHalf":t<this.opt.round.full&&(a="starOff"),this.stars.eq(Math.ceil(e)-1).attr("class",this.opt[a])}},_target:function(e,t){if(this.opt.target){var a=_(this.opt.target);0===a.length&&s._error.call(this,"Target selector invalid or missing!"),this.opt.targetFormat.indexOf("{score}")<0&&s._error.call(this,'Template "{score}" missing!');var i=t&&"mouseover"==t.type;void 0===e?e=this.opt.targetText:null===e?e=i?this.opt.cancelHint:this.opt.targetText:("hint"==this.opt.targetType?e=s._getHint.call(this,Math.ceil(e)):this.opt.precision&&(e=parseFloat(e).toFixed(1)),i||this.opt.targetKeep||(e=this.opt.targetText)),e&&(e=this.opt.targetFormat.toString().replace("{score}",e)),a.is(":input")?a.val(e):a.html(e)}},_unlock:function(){_(this).data("readonly",!1).css("cursor","pointer").removeAttr("title"),this.score.removeAttr("readonly","readonly");for(var e=0;e<this.opt.number;e++)this.stars.eq(e).attr("title",s._getHint.call(this,e+1));this.cancel&&this.cancel.css("display","")},cancel:function(e){return this.each(function(){!0!==_(this).data("readonly")&&(s[e?"click":"score"].call(this,null),this.score.removeAttr("value"))})},click:function(e){return _(this).each(function(){!0!==_(this).data("readonly")&&(s._apply.call(this,e),this.opt.click||s._error.call(this,'You must add the "click: function(score, evt) { }" callback.'),this.opt.click.call(this,e,{type:"click"}),s._target.call(this,e))})},destroy:function(){return _(this).each(function(){var e=_(this),t=e.data("raw");t?e.off(".raty").empty().css({cursor:t.style.cursor,width:t.style.width}).removeData("readonly"):e.data("raw",e.clone()[0])})},getScore:function(){var e,t=[];return _(this).each(function(){e=this.score.val(),t.push(e?parseFloat(e):void 0)}),1<t.length?t:t[0]},readOnly:function(t){return this.each(function(){var e=_(this);e.data("readonly")!==t&&(t?(e.off(".raty").children("i").off(".raty"),s._lock.call(this)):(s._binds.call(this),s._unlock.call(this)),e.data("readonly",t))})},reload:function(){return s.set.call(this,{})},score:function(){return arguments.length?s.setScore.apply(this,arguments):s.getScore.call(this)},set:function(i){return this.each(function(){var e=_(this),t=e.data("settings"),a=_.extend({},t,i);e.raty(a)})},setScore:function(e){return _(this).each(function(){!0!==_(this).data("readonly")&&(s._apply.call(this,e),s._target.call(this,e))})}};_.fn.raty=function(e){return s[e]?s[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void _.error("Method "+e+" does not exist!"):s.init.apply(this,arguments)},_.fn.raty.defaults={cancel:!1,cancelHint:"Cancel this rating!",cancelOff:"bwg-icon-minus-square-o",cancelOn:"bwg-icon-minus-square",cancelPlace:"left",click:void 0,half:!1,halfShow:!0,hints:["bad","poor","regular","good","gorgeous"],iconRange:void 0,mouseout:void 0,mouseover:void 0,noRatedMsg:"Not rated yet!",alreadyRatedMsg:"Not rated yet!",number:5,numberMax:20,path:"",precision:!1,readOnly:!1,round:{down:.25,full:.6,up:.76},score:void 0,scoreName:"score",single:!1,size:16,space:!0,starHalf:"bwg-icon-star-half-o",starOff:"bwg-icon-star-o",starOn:"bwg-icon-star",target:void 0,targetFormat:"{score}",targetKeep:!1,targetText:"",targetType:"hint",width:void 0}}(jQuery),function(y){y.fn.featureCarousel=function(d){if(1<this.length)return this.each(function(){y(this).featureCarousel(d)}),this;d=y.extend({},y.fn.featureCarousel.defaults,d||{});var h={containerWidth:0,containerHeight:0,largeFeatureWidth:0,largeFeatureHeight:0,smallFeatureHeight:0,smallFeatureWidth:0,totalFeatureCount:y(this).children("div").length,featuresContainer:y(this),featuresArray:[],containerIDTag:"#"+y(this).attr("id"),timeoutVar:null,rotationsRemaining:0,itemsToAnimate:0,borderWidth:0,autoTime:0},_=function(e){return h.featuresArray[e-1]},b=function(e){return e-1==0?h.totalFeatureCount:e-1},p=function(e){return e+1>h.totalFeatureCount?1:e+1},m=function(e){if(clearTimeout(h.timeoutVar),!e&&0!=d.autoPlay){var t=Math.abs(d.autoPlay)<d.carouselSpeed?d.carouselSpeed:Math.abs(d.autoPlay);h.timeoutVar=setTimeout(function(){0<d.autoPlay?a(!0,1):a(!1,1)},t)}},s=function(a,i){var e,t,r,o,_,s,n,l;bwg_params_carousel[d.bwg_number].data[a.attr("image_key")].is_embed_video&&jQuery(".bwg_carousel-feature"+d.bwg_number).find("iframe").each(function(){jQuery(this)[0].contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*"),jQuery(this)[0].contentWindow.postMessage('{ "method": "pause" }',"*"),jQuery(this)[0].contentWindow.postMessage("pause","*")}),bwg_params_carousel[d.bwg_number].data[a.attr("image_key")].is_embed_instagram_post&&jQuery("#bwg_carousel_play_pause_"+d.bwg_number).hide(),a.find(".bwg_video_hide"+d.bwg_number).each(function(){jQuery(this).css({display:""})}),a.find(".bwg_carousel_image_container_"+d.bwg_number).each(function(){jQuery(this).hide()}),a.find(".bwg_carousel_watermark_"+d.bwg_number).each(function(){jQuery(this).hide()});var g,u=a.data("position");if(g=1==i?b(u):p(u),1==u&&d.leavingCenter(a),1==g){var c=bwg_params_carousel[d.bwg_number].data[a.attr("image_key")].alt;""!==(c=c.replace(/^\s+/,"").replace(/\s+$/,""))&&d.enable_image_title?jQuery(".bwg_carousel_title_text_"+d.bwg_number).css({display:""}):jQuery(".bwg_carousel_title_text_"+d.bwg_number).css({display:"none"}),e=h.largeFeatureWidth,t=h.largeFeatureHeight,r=d.containerHeight/2-t/2,_=a.css("z-index"),o=d.containerWidth/2-h.largeFeatureWidth/2-h.borderWidth/2,s=1,n=100,bwg_params_carousel[d.bwg_number].data[a.attr("image_key")].is_embed_video?(jQuery(".bwg_carousel_play_pause_"+d.bwg_number).css({display:"none"}),jQuery(".bwg_carousel_image_container_"+d.bwg_number).css({display:""}),jQuery(".bwg_carousel_watermark_container_"+d.bwg_number).css({display:""}),jQuery(".bwg_carousel_watermark_spun_"+d.bwg_number).css({display:""}),jQuery(".bwg_carousel_watermark_"+d.bwg_number).css({display:""}),a.find(".bwg_video_hide"+d.bwg_number).each(function(){jQuery(this).hide()})):(a.find(".bwg_video_hide"+d.bwg_number).each(function(){jQuery(this).hide()}),jQuery(".bwg_carousel_play_pause_"+d.bwg_number).css({display:""}),a.find(".bwg_carousel_image_container_"+d.bwg_number).each(function(){jQuery(this).css({display:""})}),a.find(".bwg_carousel_watermark_"+d.bwg_number).each(function(){jQuery(this).css({display:""})})),l="grayscale(0%)",bwg_params_carousel[d.bwg_number].data[a.attr("image_key")].is_embed_instagram_post&&(a.find(".bwg_embed_frame_"+d.bwg_number).css("min-height",""),a.find(".bwg_embed_frame_"+d.bwg_number).css("min-width","")),bwg_params_carousel[d.bwg_number].data[a.attr("image_key")].is_embed_video&&a.find(".bwg_embed_frame_"+d.bwg_number).css("display","inline-block"),a.find(".bwg_carousel_image_container_"+d.bwg_number).next().each(function(){jQuery("#"+jQuery(this).attr("id")).css({"pointer-events":""})})}else g<=h.totalFeatureCount&&g>h.totalFeatureCount-d.imagecount/2+1?(e=h.largeFeatureWidth*Math.pow(d.smallFeaturePar,h.totalFeatureCount-g+1),t=h.largeFeatureHeight*Math.pow(d.smallFeaturePar,h.totalFeatureCount-g+1),r=d.containerHeight/2-t/2,s=1,l="grayscale(0%)",n=100,e=h.largeFeatureWidth*Math.pow(d.smallFeaturePar,h.totalFeatureCount-g+1),t=h.largeFeatureHeight*Math.pow(d.smallFeaturePar,h.totalFeatureCount-g+1),r=d.containerHeight/2-t/2,bwg_params_carousel[d.bwg_number].data[a.attr("image_key")].is_embed_instagram_post&&(a.find(".bwg_embed_frame_"+d.bwg_number).css("min-height","100%"),a.find(".bwg_embed_frame_"+d.bwg_number).css("min-width","100%")),o=0==d.fit_containerWidth&&d.smallFeaturePar<1?d.containerWidth/2-h.largeFeatureWidth/2-h.largeFeatureWidth*(1-d.smallFeaturePar)*d.smallFeaturePar*(h.totalFeatureCount-g+1):0==d.fit_containerWidth&&1==d.smallFeaturePar?d.containerWidth/2-h.largeFeatureWidth/2-h.largeFeatureWidth*d.smallFeaturePar*d.smallFeaturePar*(h.totalFeatureCount-g+1):(new_left1=(d.containerWidth/2-h.largeFeatureWidth/2)/(d.imagecount/2-.5),d.containerWidth/2-h.largeFeatureWidth/2-h.borderWidth/2-new_left1*(h.totalFeatureCount-g+1)),a.find(".bwg_carousel_image_container_"+d.bwg_number).next().each(function(){jQuery("#"+jQuery(this).attr("id")).css({"pointer-events":"none"})})):2<=g&&g<=d.imagecount/2+1?(e=h.largeFeatureWidth*Math.pow(d.smallFeaturePar,g-1),t=h.largeFeatureHeight*Math.pow(d.smallFeaturePar,g-1),r=d.containerHeight/2-t/2,s=1,l="grayscale(0%)",n=100,bwg_params_carousel[d.bwg_number].data[a.attr("image_key")].is_embed_instagram_post&&(a.find(".bwg_embed_frame_"+d.bwg_number).css("min-height","100%"),a.find(".bwg_embed_frame_"+d.bwg_number).css("min-width","100%")),o=0==d.fit_containerWidth&&d.smallFeaturePar<1?d.containerWidth/2+h.largeFeatureWidth/2+h.largeFeatureWidth*d.smallFeaturePar*(1-d.smallFeaturePar)*(g-1)-e:0==d.fit_containerWidth&&1==d.smallFeaturePar?d.containerWidth/2+h.largeFeatureWidth/2+h.largeFeatureWidth*d.smallFeaturePar*d.smallFeaturePar*(g-1)-e:(new_left1=(d.containerWidth/2-h.largeFeatureWidth/2)/(d.imagecount/2-.5),d.containerWidth/2+h.largeFeatureWidth/2-e+new_left1*(g-1)),a.find(".bwg_carousel_image_container_"+d.bwg_number).next().each(function(){jQuery("#"+jQuery(this).attr("id")).css({"pointer-events":"none"})})):(o=d.containerWidth/2-h.largeFeatureWidth*d.smallFeaturePar/2-h.borderWidth/2,n=s=0);1==u&&a.find(".bwg_carousel-caption"+d.bwg_number).hide(),a.find("div[class^='bwg_carousel-image']").css({filter:l,"-webkit-filter":l}),a.animate({width:e,height:t,top:r,left:o,opacity:s,filter:n},d.carouselSpeed,d.animationEasing,function(){if(1==g&&(d.captionBelow&&a.css("height","auto"),a.find(".bwg_carousel-caption"+d.bwg_number).fadeTo("fast",.85),d.movedToCenter(a)),h.rotationsRemaining=h.rotationsRemaining-1,a.css("z-index",_),(d.trackerIndividual||d.trackerSummation)&&1==g){var e=h.featuresContainer.find(".bwg_carousel-feature"+d.bwg_number).index(a)+1;(function(e,t){d.trackerIndividual&&((a=h.featuresContainer.find(".tracker-individual-container")).find("#tracker-"+e),a.find("#tracker-"+t));var a;d.trackerSummation&&(a=h.featuresContainer.find(".tracker-summation-container")).find(".tracker-summation-current").text(t)})(0==i?p(e):b(e),e)}var t;h.rotationsRemaining/h.itemsToAnimate%1==0&&(bwg_params_carousel[d.bwg_number].bwg_currentlyMoving=!1,t=i,y.each(h.featuresArray,function(){var e;e=0==t?p(y(this).data().position):b(y(this).data().position),y(this).data("position",e)}),0<h.rotationsRemaining&&w(i)),m(!1)}).end()},w=function(e){var t,a,i,r;if(bwg_params_carousel[d.bwg_number].bwg_currentlyMoving=!0,1==e){t=_(p(bwg_params_carousel[d.bwg_number].bwg_currentCenterNum)),a=[],r=bwg_params_carousel[d.bwg_number].bwg_currentCenterNum;for(var o=1;o<=d.imagecount/2+1;++o)a.push(_(r)),r=b(r);i=[],r=p(bwg_params_carousel[d.bwg_number].bwg_currentCenterNum);for(o=1;o<=d.imagecount/2+1;++o)r=p(r),i.push(_(r));bwg_params_carousel[d.bwg_number].bwg_currentCenterNum=p(bwg_params_carousel[d.bwg_number].bwg_currentCenterNum)}else{t=_(b(bwg_params_carousel[d.bwg_number].bwg_currentCenterNum)),a=[],r=b(bwg_params_carousel[d.bwg_number].bwg_currentCenterNum);for(o=1;o<=d.imagecount/2+1;++o)r=b(r),a.push(_(r));i=[],r=bwg_params_carousel[d.bwg_number].bwg_currentCenterNum;for(o=1;o<=d.imagecount/2+1;++o)i.push(_(r)),r=p(r);bwg_params_carousel[d.bwg_number].bwg_currentCenterNum=b(bwg_params_carousel[d.bwg_number].bwg_currentCenterNum)}for(o=0;o<a.length;o++)e?a[o].css("z-index",a.length-o+3):a.length-2>o&&a[o].css("z-index",a.length-o+3),s(a[o],e,onload);for(t.css("z-index",Math.max(a.length,i.length)+4),s(t,e,onload),o=0;o<i.length;o++)e?a.length-2>o&&i[o].css("z-index",i.length-o+3):i[o].css("z-index",i.length-o+3),s(i[o],e,onload)},a=function(e,t){if(0==bwg_params_carousel[d.bwg_number].bwg_currentlyMoving){var a=t*h.itemsToAnimate;h.rotationsRemaining=a,bwg_carousel_watermark(d.bwg_number),w(e)}};return y(d.leftButtonTag).on("click",function(){a(!1,1)}),y(d.rightButtonTag).on("click",function(){a(!0,1)}),h.featuresContainer.find(".bwg_carousel-feature"+d.bwg_number).mouseover(function(){if(0==bwg_params_carousel[d.bwg_number].bwg_currentlyMoving){var e=y(this).data("position");3!=e&&e!=h.totalFeatureCount||y(this).css("opacity",1)}d.pauseOnHover&&m(!0),d.stopOnHover&&(d.autoPlay=0)}).mouseout(function(){if(0==bwg_params_carousel[d.bwg_number].bwg_currentlyMoving){var e=y(this).data("position");3!=e&&e!=h.totalFeatureCount||y(this).css("opacity",1)}d.pauseOnHover&&m(!1)}),y("a",h.containerIDTag).on("click",function(t){y(this).parentsUntil(h.containerIDTag).each(function(){var e=y(this).data("position");if(null!=e){if(1!=e)return e==h.totalFeatureCount?a(!1,1):2==e&&a(!0,1),t.preventDefault(),!1;d.clickedCenter(y(this))}})}),this.initialize=function(){return function(i){if(1==d.preload){var e=h.featuresContainer.find("img"),r=0,o=e.length;e.each(function(e,t){var a=new Image;y(a).bind("load error",function(){++r==o&&i()}),a.src=t.src})}else i()}(function(){!function(){d.containerWidth=h.featuresContainer.width(),d.containerHeight=h.featuresContainer.height();var e=y(h.containerIDTag).find(".bwg_carousel-image"+d.bwg_number+":first");1<d.largeFeatureWidth?h.largeFeatureWidth=d.largeFeatureWidth:0<d.largeFeatureWidth&&d.largeFeatureWidth<1?h.largeFeatureWidth=e.width()*d.largeFeatureWidth:h.largeFeatureWidth=e.outerWidth(),1<d.largeFeatureHeight?h.largeFeatureHeight=d.largeFeatureHeight:0<d.largeFeatureHeight&&d.largeFeatureHeight<1?h.largeFeatureHeight=e.height()*d.largeFeatureHeight:h.largeFeatureHeight=e.outerHeight(),1<d.smallFeatureWidth?h.smallFeatureWidth=d.smallFeatureWidth:0<d.smallFeatureWidth&&d.smallFeatureWidth<1?h.smallFeatureWidth=e.width()*d.smallFeatureWidth:h.smallFeatureWidth=e.outerWidth()/2}(),0<d.displayCutoff&&d.displayCutoff<h.totalFeatureCount&&(h.totalFeatureCount=d.displayCutoff),h.featuresContainer.find(".bwg_carousel-feature"+d.bwg_number).each(function(e){e<h.totalFeatureCount&&(h.featuresArray[e]=y(this))}),"medium"!=h.featuresContainer.find(".bwg_carousel-feature"+d.bwg_number).first().css("borderLeftWidth")&&(h.borderWidth=parseInt(h.featuresContainer.find(".bwg_carousel-feature"+d.bwg_number).first().css("borderLeftWidth"))),1!=d.imagecount?h.featuresContainer.find(".bwg_carousel-feature"+d.bwg_number).each(function(){y(this).css({left:d.containerWidth/2-d.largeFeatureWidth*d.smallFeaturePar/2-h.borderWidth/2+d.largeFeatureWidth/2,width:d.largeFeatureWidth*d.smallFeaturePar/100,height:d.largeFeatureHeight*d.smallFeaturePar/100,top:d.smallFeatureOffset+d.topPadding+d.largeFeatureHeight/2,opacity:0,filter:"Alpha(opacity=100)"})}):h.featuresContainer.find(".bwg_carousel-feature"+d.bwg_number).each(function(){y(this).css({left:0,width:d.largeFeatureWidth*d.smallFeaturePar,height:d.largeFeatureHeight*d.smallFeaturePar,top:0,opacity:0,filter:"Alpha(opacity=100)"})}),d.captionBelow&&h.featuresContainer.find(".bwg_carousel-caption"+d.bwg_number).css("position","absolute"),h.totalFeatureCount<d.imagecount?h.itemsToAnimate=h.totalFeatureCount:h.itemsToAnimate=parseInt(d.imagecount)+2,h.featuresContainer.find(".bwg_carousel-caption"+d.bwg_number).hide(),0==bwg_params_carousel[d.bwg_number].bwg_currentlyMoving&&(!function(){y.each(h.featuresArray,function(e){y(this).data("setPosition",e+1)});var e=b(d.startingFeature);bwg_params_carousel[d.bwg_number].bwg_currentCenterNum=e;var t=_(e);t.data("position",1),t.prevAll().each(function(e){y(this).data("position",h.totalFeatureCount-e)}),t.nextAll().each(function(e){null!=y(this).data("setPosition")&&y(this).data("position",e+2)}),"caption"==d.counterStyle&&y.each(h.featuresArray,function(){var e=b(y(this).data("position")),t=y("<span></span>");t.addClass("numberTag"),t.html("("+e+" of "+h.totalFeatureCount+") "),y(this).find(".bwg_carousel-caption"+d.bwg_number).prepend(t)})}(),a(!0,1))}),this},this.shift=function(e){var t=y(e).data("position");1!=t&&(t>h.totalFeatureCount/2+1?(bwg_carousel_preload(d.bwg_number,!1),a(!1,h.totalFeatureCount-t+1)):(bwg_carousel_preload(d.bwg_number,!0),a(!0,t-1)),d.carouselSpeed=400,d.animationEasing)},this.next=function(){bwg_carousel_preload(d.bwg_number,!0),a(!0,1)},this.prev=function(){bwg_carousel_preload(d.bwg_number,!1),a(!1,1)},this.pause=function(){d.autoPlay=0,m(!0)},this.start=function(){d.autoPlay=d.interval,m(!1)},this.initialize()},y.fn.featureCarousel.defaults={largeFeatureWidth:0,largeFeatureHeight:0,smallFeatureWidth:.5,smallFeatureHeight:.5,containerWidth:0,containerHeight:0,fit_containerWidth:0,bwg_number:0,topPadding:20,sidePadding:50,smallFeatureOffset:50,smallFeaturePar:0,startingFeature:1,carouselSpeed:300,autoPlay:4e3,imagecount:7,enable_image_title:0,pauseOnHover:!0,stopOnHover:!1,trackerIndividual:!0,trackerSummation:!0,preload:!1,displayCutoff:0,animationEasing:"swing",leftButtonTag:"#bwg_carousel-left",rightButtonTag:"#bwg_carousel-right",captionBelow:!1,movedToCenter:y.noop,leavingCenter:y.noop,clickedCenter:y.noop}}(jQuery);var DisplayObject3D=function(){return this};DisplayObject3D.prototype._x=0,DisplayObject3D.prototype._y=0,DisplayObject3D.prototype.make3DPoint=function(e,t,a){var i={};return i.x=e,i.y=t,i.z=a,i},DisplayObject3D.prototype.make2DPoint=function(e,t,a,i){var r={};return r.x=e,r.y=t,r.depth=a,r.scaleFactor=i,r},DisplayObject3D.prototype.container=void 0,DisplayObject3D.prototype.pointsArray=[],DisplayObject3D.prototype.init=function(e){if(this.container=e,this.containerId=this.container.attr("id"),0===e.has("ul").length)for(i=0;i<this.pointsArray.length;i++)this.container.append('<b id="tags_cloud_item'+i+'">+</b>')};var Camera3D=function(){};Camera3D.prototype.x=0,Camera3D.prototype.y=0,Camera3D.prototype.z=500,Camera3D.prototype.focalLength=1e3,Camera3D.prototype.scaleRatio=function(e){return this.focalLength/(this.focalLength+e.z-this.z)},Camera3D.prototype.init=function(e,t,a,i){this.x=e,this.y=t,this.z=a,this.focalLength=i};var Object3D=function(e){this.container=e};Object3D.prototype.objects=[],Object3D.prototype.addChild=function(e){return this.objects.push(e),e.init(this.container),e};var Scene3D=function(){};Scene3D.prototype.sceneItems=[],Scene3D.prototype.addToScene=function(e){this.sceneItems.push(e)},Scene3D.prototype.Transform3DPointsTo2DPoints=function(e,t,a){for(var i,r,o,_,s,n,l,g,u,c=[],d=Math.sin(t.x),h=Math.cos(t.x),b=Math.sin(t.y),p=Math.cos(t.y),m=Math.sin(t.z),w=Math.cos(t.z),y=e.length;y--;){i=e[y].x,l=p*(s=d*(r=e[y].y)+h*(o=e[y].z))-b*i,g=m*(n=b*s+p*i)+w*(_=h*r-d*o),i=(w*n-m*_)*(u=a.focalLength/(a.focalLength+l)),r=g*u,o=l;var f=new DisplayObject3D;c[y]=f.make2DPoint(i,r,-o,u)}return c},Scene3D.prototype.renderCamera=function(e){for(var t=0;t<this.sceneItems.length;t++){var a=this.sceneItems[t].objects[0],i=this.Transform3DPointsTo2DPoints(a.pointsArray,axisRotation,e),r=0<document.getElementById(a.containerId).getElementsByTagName("ul").length;for(k=0;k<a.pointsArray.length;k++){var o=null;(o=r?document.getElementById(a.containerId).getElementsByTagName("ul")[0].getElementsByTagName("li")[k]:document.getElementById(a.containerId).getElementsByTagName("*")[k])&&(o._x=i[k].x,o._y=i[k].y,o.scale=i[k].scaleFactor,o.style.position="absolute",o.style.top=o._y+.4*jQuery("#"+a.containerId).height()+"px",o.style.left=o._x+.4*jQuery("#"+a.containerId).width()+"px",o.style.fontSize=100*o.scale+"%",jQuery(o).css({opacity:o.scale-.5}),curChild=jQuery(o).find("#imgg"),curChild&&(jQuery(o).css("zIndex",Math.round(100*o.scale)),curChild.css({maxWidth:50*o.scale}),curChild.css({maxHeight:50*o.scale})))}}};var axisRotation=(new DisplayObject3D).make3DPoint(0,0,0),Sphere=function(e,t,a){for(var i=t;0<i;i--)for(var r=a/t;0<r;r--){var o=r*Math.PI/(a/t+1),_=i*Math.PI*2/t,s=Math.sin(_)*Math.sin(o)*e,n=Math.cos(_)*Math.sin(o)*e,l=Math.cos(o)*e;this.pointsArray.push(this.make3DPoint(s,n,l))}};Sphere.prototype=new DisplayObject3D;var bwg=0,isMobile=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()),bwg_click=isMobile?"touchend":"click",bwg_params=[],bwg_params_ib=[],bwg_params_carousel=[];function bwg_main_ready(){jQuery(".bwg_container").each(function(){0<jQuery(this).find(".wd_error").length&&bwg_container_loaded(jQuery(this).data("bwg"))}),bwg_document_ready(),jQuery(".bwg-thumbnails, .bwg-masonry-thumbnails, .bwg-album-thumbnails").each(function(){bwg_all_thumnails_loaded(this)}),jQuery(".bwg-mosaic-thumbnails").each(function(){bwg_thumbnail_mosaic(this)}),bwg_slideshow_ready(),bwg_carousel_ready(),bwg_carousel_onload(),bwg_image_browser_ready()}function bwg_resize_search_line(){jQuery(".search_line").each(function(){var e=jQuery(this);e.width()<410?e.addClass("bwg-search-line-responsive"):e.removeClass("bwg-search-line-responsive")})}function bwg_slideshow_resize(){jQuery(".bwg_slideshow").each(function(){bwg=jQuery(this).attr("data-bwg"),jQuery("#bwg_slideshow_image_container_"+bwg).length&&(bwg_params[bwg]=JSON.parse(jQuery("#bwg_slideshow_image_container_"+bwg).attr("data-params")),bwg_params[bwg].event_stack=[],bwg_popup_resize(bwg))})}function bwg_blog_style_resize(){jQuery(".bwg_blog_style").each(function(){bwg=jQuery(this).attr("data-bwg"),jQuery(".bwg_embed_frame_16x9_"+bwg).each(function(e){jQuery(this).width(jQuery(this).parent().width()),jQuery(this).height(.5625*jQuery(this).width())}),jQuery(".bwg_embed_frame_instapost_"+bwg).each(function(e){jQuery(this).width(jQuery(this).parent().width()),jQuery(this).height((jQuery(this).width()-16)*jQuery(this).attr("data-height")/jQuery(this).attr("data-width")+96)})})}function bwg_blog_style_onload(){jQuery(".bwg_blog_style").each(function(){bwg=jQuery(this).attr("data-bwg");jQuery("#bwg_blog_style_"+bwg);jQuery(".bwg_embed_frame_16x9_"+bwg).each(function(e){if(jQuery(".bwg_blog_style_image_"+bwg).find(".fluid-width-video-wrapper").length){jQuery(".fluid-width-video-wrapper").removeAttr("style");var t=jQuery(this).parents(".bwg_blog_style_image_"+bwg).find(".fluid-width-video-wrapper").contents();jQuery(this).parents(".fluid-width-video-wrapper").replaceWith(t)}jQuery(this).width(jQuery(this).parents(".bwg_blog_style_image_"+bwg).width()),jQuery(this).height(.5625*jQuery(this).width())}),jQuery(".bwg_embed_frame_instapost_"+bwg).each(function(e){jQuery(this).width(jQuery(this).parents(".bwg_blog_style_image_"+bwg).width()),jQuery(this).height((jQuery(this).width()-16)*jQuery(this).attr("data-height")/jQuery(this).attr("data-width")+96)}),bwg_container_loaded(bwg)})}function bwg_blog_style_ready(){jQuery(".bwg_blog_style").each(function(){var e=jQuery(this).attr("data-bwg");bwg_container_loaded(e);var t=!1;jQuery(this).find(".bwg_lightbox_"+e).on("click",function(){var e=jQuery(this).attr("data-image-id");if(jQuery("#bwg_blog_style_share_buttons_"+e).removeAttr("data-open-comment"),!t)return t=!0,setTimeout(function(){t=!1},100),bwg_gallery_box(e,jQuery(this).closest(".bwg_container")),!1}),jQuery(".bwg_lightbox_"+e+" .bwg_ecommerce").on("click",function(e){if(e.stopPropagation(),!t)return t=!0,setTimeout(function(){t=!1},100),bwg_gallery_box(jQuery(this).attr("data-image-id"),jQuery(this).closest(".bwg_container"),!0),!1});var a=window.location.hash.substring(1);a&&"-1"!=a.indexOf("bwg")&&(bwg_hash_array=a.replace("bwg","").split("/"),"<?php echo $params_array['gallery_id']; ?>"==bwg_hash_array[0]&&bwg_gallery_box(bwg_hash_array[1]))})}function bwg_slideshow_focus(){jQuery(".bwg_slideshow").each(function(){bwg=jQuery(this).attr("data-bwg"),jQuery("#bwg_slideshow_image_container_"+bwg).length&&(bwg_params[bwg]=JSON.parse(jQuery("#bwg_slideshow_image_container_"+bwg).attr("data-params")),bwg_params[bwg].event_stack=[],window.clearInterval(window["bwg_playInterval"+bwg]),jQuery(".bwg_ctrl_btn_"+bwg).hasClass("bwg-icon-play")||bwg_play(bwg_params[bwg].data,bwg))})}function bwg_slideshow_blur(){jQuery(".bwg_slideshow").each(function(){bwg=jQuery(this).attr("data-bwg"),jQuery("#bwg_slideshow_image_container_"+bwg).length&&(bwg_params[bwg]=JSON.parse(jQuery("#bwg_slideshow_image_container_"+bwg).attr("data-params")),bwg_params[bwg].event_stack=[],window.clearInterval(window["bwg_playInterval"+bwg]))})}function bwg_carousel_ready(){jQuery(".bwg-carousel").each(function(){var e=jQuery(this).data("bwg");bwg_params_carousel[e]=[],bwg_params_carousel[e].bwg_currentCenterNum=1,bwg_params_carousel[e].bwg_currentlyMoving=!1,bwg_params_carousel[e].data=[],jQuery("#spider_carousel_left-ico_"+e).on("click",function(){bwg_params_carousel[e].carousel.prev()}),jQuery("#spider_carousel_right-ico_"+e).on("click",function(){bwg_params_carousel[e].carousel.next()}),parseInt(bwg_params_carousel[e].carousel_enable_autoplay)&&(jQuery(".bwg_carousel_play_pause_"+e).attr("title",bwg_objectsL10n.pause),jQuery(".bwg_carousel_play_pause_"+e).attr("class","bwg-icon-pause bwg_ctrl_btn_"+e+" bwg_carousel_play_pause_"+e)),jQuery(".bwg_carousel_play_pause_"+e).on(bwg_click,function(){jQuery(".bwg_ctrl_btn_"+e).hasClass("bwg-icon-play")?(jQuery(".bwg_carousel_play_pause_"+e).attr("title",bwg_objectsL10n.pause),jQuery(".bwg_carousel_play_pause_"+e).attr("class","bwg-icon-pause bwg_ctrl_btn_"+e+" bwg_carousel_play_pause_"+e),bwg_params_carousel[e].carousel.start()):(jQuery(".bwg_carousel_play_pause_"+e).attr("title",bwg_objectsL10n.play),jQuery(".bwg_carousel_play_pause_"+e).attr("class","bwg-icon-play bwg_ctrl_btn_"+e+" bwg_carousel_play_pause_"+e),bwg_params_carousel[e].carousel.pause())}),void 0!==jQuery().swiperight&&jQuery.isFunction(jQuery().swiperight)&&jQuery("#bwg_container1_"+e).swiperight(function(){bwg_params_carousel[e].carousel.prev()}),void 0!==jQuery().swipeleft&&jQuery.isFunction(jQuery().swipeleft)&&jQuery("#bwg_container1_"+e).swipeleft(function(){bwg_params_carousel[e].carousel.next()})})}function bwg_carousel_resize(){jQuery(".bwg-carousel").each(function(){var e=jQuery(this).data("bwg");bwg_carousel_params(e),bwg_params_carousel[e].carousel.pause(),bwg_carousel_watermark(e),jQuery(".bwg_ctrl_btn_"+e).hasClass("bwg-icon-play")||bwg_params_carousel[e].carousel.start()})}function bwg_carousel_onload(){jQuery(".bwg-carousel").each(function(){var e=jQuery(this).data("bwg");bwg_params_carousel[e]=jQuery(this).data("params"),bwg_carousel_watermark(e),bwg_carousel_params(e),bwg_container_loaded(e)})}function bwg_carousel_params(t){var e=jQuery("#bwg_container1_"+t).parent().width(),a=1;e<bwg_params_carousel[t].carousel_r_width?a=e/bwg_params_carousel[t].carousel_r_width:e=bwg_params_carousel[t].carousel_r_width,bwg_params_carousel[t].carousel_image_column_number>bwg_params_carousel[t].count&&(bwg_params_carousel[t].carousel_image_column_number=bwg_params_carousel[t].count),jQuery(".bwg_carousel_play_pause_"+t).css({display:parseInt(bwg_params_carousel[t].carousel_play_pause_butt)?"":"none"}),parseInt(bwg_params_carousel[t].carousel_prev_next_butt)?(jQuery("#bwg_carousel-right"+t).css({display:""}),jQuery("#bwg_carousel-left"+t).css({display:""})):(jQuery("#bwg_carousel-left"+t).css({display:"none"}),jQuery("#bwg_carousel-right"+t).css({display:"none"})),jQuery(".inner_instagram_iframe_bwg_embed_frame_"+t).each(function(){var e=jQuery(this).parent();bwg_params_carousel[t].image_height/(parseInt(e.attr("data-height"))+96)<bwg_params_carousel[t].image_width/parseInt(e.attr("data-width"))?(e.height(bwg_params_carousel[t].image_height*a),e.width((e.height()-96)*e.attr("data-width")/e.attr("data-height")+16)):(e.width(bwg_params_carousel[t].image_width*a),e.height((e.width()-16)*e.attr("data-height")/e.attr("data-width")+96))}),jQuery(".bwg_carousel_image_container_"+t).css({width:bwg_params_carousel[t].image_width*a,height:bwg_params_carousel[t].image_height*a}),jQuery(".bwg_carousel_watermark_text_"+t+", .bwg_carousel_watermark_text_"+t+":hover").css({fontSize:e*(bwg_params_carousel[t].watermark_font_size/bwg_params_carousel[t].image_width)*a}),jQuery(".bwg_carousel-image "+t).css({width:bwg_params_carousel[t].image_width*a,height:bwg_params_carousel[t].image_height*a}),jQuery(".bwg_carousel_watermark_container_"+t).css({width:bwg_params_carousel[t].image_width*a,height:bwg_params_carousel[t].image_height*a}),jQuery(".bwg_carousel_embed_video_"+t).css({width:bwg_params_carousel[t].image_width*a,height:bwg_params_carousel[t].image_height*a}),jQuery(".bwg_carousel_watermark_spun_"+t).css({width:bwg_params_carousel[t].image_width*a,height:bwg_params_carousel[t].image_height*a}),jQuery(".bwg_carousel-container"+t).css({width:e,height:bwg_params_carousel[t].image_height*a}),jQuery(".bwg_video_hide"+t).css({width:bwg_params_carousel[t].image_width*a,height:bwg_params_carousel[t].image_height*a}),bwg_params_carousel[t].carousel=jQuery("#bwg_carousel"+t).featureCarousel({containerWidth:e*a,containerHeight:bwg_params_carousel[t].image_height*a,fit_containerWidth:bwg_params_carousel[t].carousel_fit_containerWidth,largeFeatureWidth:bwg_params_carousel[t].image_width*a,largeFeatureHeight:bwg_params_carousel[t].image_height*a,smallFeaturePar:bwg_params_carousel[t].carousel_image_par,currentlyMoving:!1,startingFeature:bwg_params_carousel[t].bwg_currentCenterNum,featuresArray:[],timeoutVar:null,rotationsRemaining:0,autoPlay:1e3*bwg_params_carousel[t].car_inter,interval:1e3*bwg_params_carousel[t].carousel_interval,imagecount:bwg_params_carousel[t].carousel_image_column_number,bwg_number:t,enable_image_title:bwg_params_carousel[t].enable_image_title,borderWidth:0})}function bwg_carousel_watermark(e){var t=1,a=jQuery("#bwg_container1_"+e).parent().width();if(a<bwg_params_carousel[e].carousel_r_width&&(t=a/bwg_params_carousel[e].carousel_r_width),a>=bwg_params_carousel[e].image_width)bwg_carousel_change_watermark_container(e),jQuery("#bwg_carousel_play_pause-ico_"+e).css({fontSize:bwg_params_carousel[e].carousel_play_pause_btn_size}),jQuery(".bwg_carousel_watermark_image_"+e).css({maxWidth:bwg_params_carousel[e].watermark_width*t,maxHeight:bwg_params_carousel[e].watermark_height*t}),jQuery(".bwg_carousel_watermark_text_"+e+", .bwg_carousel_watermark_text_"+e+":hover").css({fontSize:t*bwg_params_carousel[e].watermark_font_size});else{var i=bwg_params_carousel[e].image_width/t;bwg_carousel_change_watermark_container(e),jQuery("#bwg_carousel_play_pause-ico_"+e).css({fontSize:a*bwg_params_carousel[e].carousel_play_pause_btn_size/i}),jQuery(".bwg_carousel_watermark_image_"+e).css({maxWidth:a*bwg_params_carousel[e].watermark_width/i,maxHeight:a*bwg_params_carousel[e].watermark_height/i}),jQuery(".bwg_carousel_watermark_text_"+e+", .bwg_carousel_watermark_text_"+e+":hover").css({fontSize:a*bwg_params_carousel[e].watermark_font_size/i})}}function bwg_carousel_change_watermark_container(i){jQuery(".bwg_carousel"+i).children().each(function(){if(2==jQuery(this).css("zIndex")){var e=jQuery(this).find("img");e.length||(e=jQuery(this).find("iframe"));var t=e.width(),a=e.height();jQuery(".bwg_carousel_watermark_spun_"+i).width(t),jQuery(".bwg_carousel_watermark_spun_"+i).height(a),jQuery(".bwg_carousel_title_spun_"+i).width(t),jQuery(".bwg_carouel_title_spun_"+i).height(a),jQuery(".bwg_carousel_watermark_"+i).css({display:"none"})}})}function bwg_carousel_preload(e,t){var a=jQuery(".bwg_carousel_preload").get();t||a.reverse();var i=0;jQuery(a).each(function(){if(1<++i)return!1;jQuery(this).parent().hasClass("bwg_carousel_embed_video_"+e)||jQuery(this).parent().hasClass("bwg_embed_frame_"+e)||jQuery(this).parent().hasClass("bwg_carousel_video")?(jQuery(this).attr("src",jQuery(this).attr("data-src")),jQuery(this).on("load",function(){jQuery(this).removeClass("bwg_carousel_preload")}),jQuery(this).parent().hasClass("bwg_carousel_video")&&(jQuery(".bwg_carousel_video")[0].load(),jQuery(this).parent().parent().removeClass("bwg_carousel_preload")),jQuery(this).removeAttr("data-src")):(jQuery(this).css({"background-image":"url('"+jQuery(this).attr("data-background")+"')",height:"100%"}),jQuery(this).removeClass("bwg_carousel_preload"),jQuery(this).removeAttr("data-background"))})}function bwg_slideshow_ready(){jQuery(".bwg_slideshow").each(function(){var a=jQuery(this).data("bwg");if(jQuery("#bwg_slideshow_image_container_"+a).length){bwg_params[a]=JSON.parse(jQuery("#bwg_slideshow_image_container_"+a).attr("data-params")),bwg_params[a].event_stack=[],bwg_container_loaded(a);var e=bwg_params[a].data;void 0!==jQuery().swiperight&&jQuery.isFunction(jQuery().swiperight)&&jQuery("#bwg_container1_"+a).swiperight(function(){return bwg_change_image(parseInt(jQuery("#bwg_current_image_key_"+a).val()),0<=parseInt(jQuery("#bwg_current_image_key_"+a).val())-bwg_iterator(a)?(parseInt(jQuery("#bwg_current_image_key_"+a).val())-bwg_iterator(a))%e.length:e.length-1,e,"",a),!1}),void 0!==jQuery().swipeleft&&jQuery.isFunction(jQuery().swipeleft)&&jQuery("#bwg_container1_"+a).swipeleft(function(){return bwg_change_image(parseInt(jQuery("#bwg_current_image_key_"+a).val()),parseInt(jQuery("#bwg_current_image_key_"+a).val())+bwg_iterator(a)%e.length,e,"",a),!1});var t=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())?"touchend":"click";bwg_popup_resize(a),jQuery(".bwg_slideshow_watermark_"+a).css({display:"none"}),jQuery(".bwg_slideshow_title_text_"+a).css({display:"none"}),jQuery(".bwg_slideshow_description_text_"+a).css({display:"none"}),setTimeout(function(){bwg_change_watermark_container(a)},500),"horizontal"==bwg_params[a].filmstrip_direction?jQuery(".bwg_slideshow_image_container_"+a).height(jQuery(".bwg_slideshow_image_wrap_"+a).height()-bwg_params[a].slideshow_filmstrip_height):jQuery(".bwg_slideshow_image_container_"+a).width(jQuery(".bwg_slideshow_image_wrap_"+a).width()-bwg_params[a].slideshow_filmstrip_width);var i=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel";jQuery(".bwg_slideshow_filmstrip_"+a).bind(i,function(e){var t=window.event||e;return 0<((t=t.originalEvent?t.originalEvent:t).detail?-40*t.detail:t.wheelDelta)?jQuery(".bwg_slideshow_filmstrip_left_"+a).trigger("click"):jQuery(".bwg_slideshow_filmstrip_right_"+a).trigger("click"),!1}),jQuery(".bwg_slideshow_filmstrip_right_"+a).on(t,function(){jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).stop(!0,!1),"left"==bwg_params[a].left_or_top?"width"==bwg_params[a].width_or_height?(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).position().left>=-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).width()-jQuery(".bwg_slideshow_filmstrip_"+a).width())&&(jQuery(".bwg_slideshow_filmstrip_left_"+a).css({opacity:1,filter:"Alpha(opacity=100)"}),jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).position().left<-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).width()-jQuery(".bwg_slideshow_filmstrip_"+a).width()-(bwg_params[a].filmstrip_thumb_margin_hor+bwg_params[a].slideshow_filmstrip_width))?jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).animate({left:-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).width()-jQuery(".bwg_slideshow_filmstrip_"+a).width())},500,"linear"):jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).animate({left:jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).position().left-(bwg_params[a].filmstrip_thumb_margin_hor+bwg_params[a].slideshow_filmstrip_width)},500,"linear")),window.setTimeout(function(){jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).position().left==-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).width()-jQuery(".bwg_slideshow_filmstrip_"+a).width())&&jQuery(".bwg_slideshow_filmstrip_right_"+a).css({opacity:.3,filter:"Alpha(opacity=30)"})},500)):(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).position().left>=-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).height()-jQuery(".bwg_slideshow_filmstrip_"+a).height())&&(jQuery(".bwg_slideshow_filmstrip_left_"+a).css({opacity:1,filter:"Alpha(opacity=100)"}),jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).position().left<-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).height()-jQuery(".bwg_slideshow_filmstrip_"+a).height()-(bwg_params[a].filmstrip_thumb_margin_hor+bwg_params[a].slideshow_filmstrip_width))?jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).animate({left:-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).height()-jQuery(".bwg_slideshow_filmstrip_"+a).width())},500,"linear"):jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).animate({left:jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).position().left-(bwg_params[a].filmstrip_thumb_margin_hor+bwg_params[a].slideshow_filmstrip_width)},500,"linear")),window.setTimeout(function(){jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).position().left==-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).height()-jQuery(".bwg_slideshow_filmstrip_"+a).height())&&jQuery(".bwg_slideshow_filmstrip_right_"+a).css({opacity:.3,filter:"Alpha(opacity=30)"})},500)):"width"==bwg_params[a].width_or_height?(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).position().top>=-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).width()-jQuery(".bwg_slideshow_filmstrip_"+a).width())&&(jQuery(".bwg_slideshow_filmstrip_left_"+a).css({opacity:1,filter:"Alpha(opacity=100)"}),jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).position().top<-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).width()-jQuery(".bwg_slideshow_filmstrip_"+a).width()-bwg_params[a].filmstrip_thumb_margin_hor+bwg_params[a].slideshow_filmstrip_width)?jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).animate({top:-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).width()-jQuery(".bwg_slideshow_filmstrip_"+a).width())},500,"linear"):jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).animate({top:jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).position().top-bwg_params[a].filmstrip_thumb_margin_hor+bwg_params[a].slideshow_filmstrip_width},500,"linear")),window.setTimeout(function(){jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).position().top==-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).width()-jQuery(".bwg_slideshow_filmstrip_"+a).width())&&jQuery(".bwg_slideshow_filmstrip_right_"+a).css({opacity:.3,filter:"Alpha(opacity=30)"})},500)):(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).position().top>=-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).height()-jQuery(".bwg_slideshow_filmstrip_"+a).height())&&(jQuery(".bwg_slideshow_filmstrip_left_"+a).css({opacity:1,filter:"Alpha(opacity=100)"}),jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).position().top<-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).height()-jQuery(".bwg_slideshow_filmstrip_"+a).height()-(bwg_params[a].filmstrip_thumb_margin_hor+bwg_params[a].slideshow_filmstrip_width))?jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).animate({top:-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).height()-jQuery(".bwg_slideshow_filmstrip_"+a).width())},500,"linear"):jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).animate({top:jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).position().top-(bwg_params[a].filmstrip_thumb_margin_hor+bwg_params[a].slideshow_filmstrip_width)},500,"linear")),window.setTimeout(function(){jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).position().top==-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).height()-jQuery(".bwg_slideshow_filmstrip_"+a).height())&&jQuery(".bwg_slideshow_filmstrip_right_"+a).css({opacity:.3,filter:"Alpha(opacity=30)"})},500))}),jQuery(".bwg_slideshow_filmstrip_left_"+a).on(t,function(){jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).stop(!0,!1),"left"==bwg_params[a].left_or_top?(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).position().left<0&&(jQuery(".bwg_slideshow_filmstrip_right_"+a).css({opacity:1,filter:"Alpha(opacity=100)"}),jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).position().left>-(bwg_params[a].filmstrip_thumb_margin_hor+bwg_params[a].slideshow_filmstrip_width)?jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).animate({left:0},500,"linear"):jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).animate({left:jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).position().left+bwg_params[a].filmstrip_thumb_margin_hor+bwg_params[a].slideshow_filmstrip_width},500,"linear")),window.setTimeout(function(){0==jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).position().left&&jQuery(".bwg_slideshow_filmstrip_left_"+a).css({opacity:.3,filter:"Alpha(opacity=30)"})},500)):(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).position().top<0&&(jQuery(".bwg_slideshow_filmstrip_right_"+a).css({opacity:1,filter:"Alpha(opacity=100)"}),jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).position().top>-(bwg_params[a].filmstrip_thumb_margin_hor+bwg_params[a].slideshow_filmstrip_width)?jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).animate({top:0},500,"linear"):jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).animate({top:jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).position().top+bwg_params[a].filmstrip_thumb_margin_hor+bwg_params[a].slideshow_filmstrip_width},500,"linear")),window.setTimeout(function(){0==jQuery(".bwg_slideshow_filmstrip_thumbnails_"+a).position().top&&jQuery(".bwg_slideshow_filmstrip_left_"+a).css({opacity:.3,filter:"Alpha(opacity=30)"})},500))}),"width"==bwg_params[a].width_or_height?bwg_set_filmstrip_pos(jQuery(".bwg_slideshow_filmstrip_"+a).width(),a):bwg_set_filmstrip_pos(jQuery(".bwg_slideshow_filmstrip_"+a).height(),a),jQuery("#bwg_slideshow_play_pause_"+a).off(t).on(t,function(){jQuery(".bwg_ctrl_btn_"+a).hasClass("bwg-icon-play")?(bwg_play(bwg_params[a].data,a),jQuery(".bwg_slideshow_play_pause_"+a).attr("title",bwg_objectsL10n.pause),jQuery(".bwg_slideshow_play_pause_"+a).attr("class","bwg-icon-pause bwg_ctrl_btn_"+a+" bwg_slideshow_play_pause_"+a),1==bwg_params[a].enable_slideshow_music&&document.getElementById("bwg_audio_"+a).play()):(window.clearInterval(window["bwg_playInterval"+a]),jQuery(".bwg_slideshow_play_pause_"+a).attr("title","Play"),jQuery(".bwg_slideshow_play_pause_"+a).attr("class","bwg-icon-play bwg_ctrl_btn_"+a+" bwg_slideshow_play_pause_"+a),1==bwg_params[a].enable_slideshow_music&&document.getElementById("bwg_audio_"+a).pause())}),0!=bwg_params[a].enable_slideshow_autoplay&&(bwg_play(bwg_params[a].data,a),jQuery(".bwg_slideshow_play_pause_"+a).attr("title",bwg_objectsL10n.pause),jQuery(".bwg_slideshow_play_pause_"+a).attr("class","bwg-icon-pause bwg_ctrl_btn_"+a+" bwg_slideshow_play_pause_"+a),1==bwg_params[a].enable_slideshow_music&&jQuery("#bwg_audio_"+a).length&&document.getElementById("bwg_audio_"+a).play()),bwg_params[a].preload_images&&bwg_preload_images(parseInt(jQuery("#bwg_current_image_key_".$bwg).val()),a),jQuery(".bwg_slideshow_image_"+a).removeAttr("width"),jQuery(".bwg_slideshow_image_"+a).removeAttr("height")}})}function bwg_image_browser_resize(){jQuery(".bwg_image_browser").each(function(){var e=jQuery(this).attr("data-bwg");jQuery(".image_browser_images_conteiner_"+e).length&&(bwg_params_ib[e]=JSON.parse(jQuery("#bwg_container1_"+e+" .image_browser_images_conteiner_"+e).attr("data-params")),bwg_image_browser(e))})}function bwg_image_browser_ready(){jQuery(".bwg_image_browser").each(function(){var e=jQuery(this).attr("data-bwg");bwg_container_loaded(e),jQuery(".image_browser_images_conteiner_"+e).length&&(bwg_params_ib[e]=JSON.parse(jQuery(".image_browser_images_conteiner_"+e).attr("data-params")),setTimeout(function(){bwg_image_browser(e)},3))})}function bwg_search_focus(e){jQuery(e).parent().find(".bwg_search_input").focus(),jQuery(e).hide()}function bwg_key_press(e){jQuery(e).parent().find(".bwg_search_reset_container").removeClass("hidden"),jQuery(e).parent().find(".bwg_search_loupe_container1").removeClass("hidden")}function bwg_all_thumnails_loaded(t){var a=0,i=jQuery(t).find("img").length;return 0==i?bwg_all_thumbnails_loaded_callback(t):jQuery(t).find("img").each(function(){var e=jQuery(this).attr("src");jQuery("<img/>").attr("src",e).on("load error",function(){++a>=i&&bwg_all_thumbnails_loaded_callback(t)})}),0==i}function bwg_all_thumbnails_loaded_callback(e){jQuery(e).hasClass("bwg-thumbnails")&&bwg_thumbnail(e),jQuery(e).hasClass("bwg-masonry-thumbnails")&&bwg_thumbnail_masonry(e),jQuery(e).hasClass("bwg-album-extended")&&bwg_album_extended(e)}function bwg_container_loaded(e){jQuery("#gal_front_form_"+e).removeClass("bwg-hidden"),jQuery("#ajax_loading_"+e).addClass("bwg-hidden")}function bwg_album_thumbnail(e){bwg_container_loaded(jQuery(e).data("bwg"))}function bwg_album_extended(e){var t=jQuery(e).width(),a=jQuery(e).data("thumbnail-width"),i=jQuery(e).data("spacing"),r=jQuery(e).data("max-count"),o=parseInt(t/(2*a));o<1&&(o=1),r<o&&(o=r);var _=100/o,s=jQuery(e).find(".bwg-extended-item"),n=parseInt(s.css("margin-left")),l=parseInt(s.css("margin-right"));s.css({width:"calc("+_+"% - "+(n+l)+"px)"}),s.width()<a?s.find(".bwg-extended-item0, .bwg-extended-item1").css({width:"calc(100% - "+i+"px)"}):s.width()>2*a?(s.find(".bwg-extended-item0").css({width:"calc(50% - "+i+"px)"}),s.find(".bwg-extended-item1").css({width:"calc(100% - "+(a+2*i)+"px)"})):s.find(".bwg-extended-item0, .bwg-extended-item1").css({width:"calc(50% - "+i+"px)"}),jQuery(e).children(".bwg-extended-item").each(function(){var e=jQuery(this).find("img"),t=jQuery(this).find(".bwg-item0"),a=jQuery(this).find(".bwg-item2");a.width()/a.height()>e.width()/e.height()?a.width()>e.width()?e.css({width:"100%"}):e.css({maxWidth:"100%"}):a.height()>e.height()?e.css({height:"100%"}):e.css({maxHeight:"100%"}),jQuery(this).find(".bwg-item2").css({marginLeft:(t.width()-e.width())/2,marginTop:(t.height()-e.height())/2})}),bwg_container_loaded(jQuery(e).data("bwg"))}function bwg_thumbnail(e){var t=jQuery(e).width(),a=jQuery(e).data("thumbnail-width"),i=jQuery(e).data("max-count"),r=parseInt(t/a)+1;i<r&&(r=i);var o=100/r;jQuery(e).find(".bwg-item").css({width:o+"%"}),jQuery(e).children(".bwg-item").each(function(){var e=jQuery(this).find("img"),t=jQuery(this).find(".bwg-item2");t.width()/t.height()>e.width()/e.height()?t.width()>e.width()?e.css({width:"100%"}):e.css({maxWidth:"100%"}):t.height()>e.height()?e.css({height:"100%"}):e.css({maxHeight:"100%"}),jQuery(this).find(".bwg-item2").css({marginLeft:(t.width()-e.width())/2,marginTop:(t.height()-e.height())/2})}),bwg_container_loaded(jQuery(e).data("bwg"))}function bwg_thumbnail_masonry(e){var t=jQuery(e);if(t.find(".bwg-empty-item").remove(),"horizontal"==t.data("masonry-type")){var a=t.data("thumbnail-height"),r=t.data("max-count"),o=[];for(i=0;i<r;i++)o.push(0);t.find(".bwg-item").each(function(){var e=o.indexOf(Math.min.apply(Math,o));jQuery(this).css({height:a,order:e+1}),o[e]+=jQuery(this)[0].getBoundingClientRect().width});var _=Math.max.apply(Math,o);for(t.width(_),i=0;i<r;i++)o[i]<_&&t.append(jQuery('<div class="bwg-item bwg-empty-item"></div>').css({height:a,order:i+1,width:_-o[i]}))}else{t.removeAttr("style");_=t.width();var s=t.data("thumbnail-width"),n=(r=t.data("max-count"),parseInt(_/s)+("0"==t.data("resizable-thumbnails")?0:1));r<n&&(n=r);var l=t.find(".bwg-item").length;l<n&&(n=l);var g=100/n,u=[];for(i=0;i<n;i++)u.push(0);t.find(".bwg-item").each(function(){var e=u.indexOf(Math.min.apply(Math,u));jQuery(this).css({width:g+"%",order:e+1}),u[e]+=jQuery(this)[0].getBoundingClientRect().height});var c=Math.max.apply(Math,u);for(i=0;i<n;i++)u[i]<c&&t.append(jQuery('<div class="bwg-item bwg-empty-item"></div>').css({width:g+"%",order:i+1,height:c-u[i]}));t.outerWidth(n*s),t.height(c)}bwg_container_loaded(t.data("bwg"))}function bwg_thumbnail_mosaic(e){var t=jQuery(e),r=t.attr("data-bwg"),a=t.attr("data-block-id"),i=parseInt(t.attr("data-thumb-padding"))/2,o=parseInt(t.attr("data-thumb-border"))+i;if("horizontal"==t.attr("data-mosaic-direction")){var _=parseInt(t.attr("data-height"));if("1"==t.attr("data-resizable"))if(1920<=jQuery(window).width())var s=(1+jQuery(window).width()/1920)*_;else if(jQuery(window).width()<=640)s=jQuery(window).width()/640*_;else s=_;else s=_;(y=jQuery(".bwg_mosaic_thumb_"+r)).each(function(e){var t=y.get(e).naturalWidth,a=y.get(e).naturalHeight;t=t*s/a,y.eq(e).height(s),y.eq(e).width(t)});var n=jQuery("#bwg_mosaic_thumbnails_div_"+r).width()/100*parseInt(t.attr("data-total-width"));jQuery("#"+a).width(n);var l=s+2*o,g=0,u=[];u[0]=0;var c=[],d=c[0]=0;y.each(function(e){row_cum_width2=d+y.eq(e).width()+2*o,row_cum_width2-n<0?(d=row_cum_width2,u[e]=g,c[g]++):e!==y.length-1?Math.abs(d-n)>Math.abs(row_cum_width2-n)||Math.abs(d-n)<=Math.abs(row_cum_width2-n)&&0==c[g]?e!==y.length-2?(d=row_cum_width2,u[e]=g,c[g]++,c[++g]=0,d=0):(d=row_cum_width2,u[e]=g,c[g]++):(c[++g]=1,u[e]=g,d=row_cum_width2-d):(d=row_cum_width2,u[e]=g,c[g]++)});for(var h=[],b=[],p=0;p<=g;p++)h[p]=1,b[p]=l;for(p=0;p<=g;p++)d=0,y.each(function(e){u[e]==p&&(d+=y.eq(e).width())}),h[p]=k=(n-2*c[p]*o)/d,b[p]=(l-2*o)*h[p]+2*o;(M=[])[0]=0;var m=[],w=[];m[0]=0,w[0]=0;for(p=1;p<=g;p++)m[p]=m[0],w[p]=w[p-1]+b[p-1];y.each(function(e){var t=y.eq(e).width(),a=y.eq(e).height();y.eq(e).width(t*h[u[e]]),y.eq(e).height(a*h[u[e]]),y.eq(e).parent().css({top:w[u[e]],left:m[u[e]]}),m[u[e]]+=t*h[u[e]]+2*o,M[u[e]]=e}),jQuery("#"+a).height(w[g]+b[g]-w[0])}else{var y,f=parseInt(t.attr("data-width"));if("1"==t.attr("data-resizable"))if(1920<=jQuery(window).width())var j=(1+jQuery(window).width()/1920)*f;else if(jQuery(window).width()<=640)j=jQuery(window).width()/640*f;else j=f;else j=f;(y=jQuery(".bwg_mosaic_thumb_"+r)).each(function(e){var t=y.get(e).naturalWidth,a=y.get(e).naturalHeight;y.eq(e).height(a*j/t),y.eq(e).width(j)});n=jQuery("#bwg_mosaic_thumbnails_div_"+r).width()/100*parseInt(t.attr("data-total-width"));jQuery("#"+a).width(n);var Q=j+2*o<n?j:n-2*o,v=Math.floor(n/(Q+2*o)),x=[];x[0]=0;for(var C=[],S=[],k=0;k<v;k++)S[k]=0,C[k]=0;y.each(function(e){for(var t=0,a=S[0],i=0;i<v;i++)a>S[i]&&(a=S[i],t=i);x[e]=t,C[t]++,F=a,D=0+t*(Q+2*o),y.eq(e).parent().css({top:F,left:D}),S[t]+=y.eq(e).height()+2*o}),(h=[])[0]=1;var E=0,I=[],z=0,T=0;for(k=0;k<v;k++)E+=Q,I[k]=0,y.each(function(e){x[e]==k&&(I[k]+=y.eq(e).height())}),0!=I[k]&&(z+=Q/I[k],T+=Q*C[k]*2*o/I[k]);var O=0;0!=z&&(O=(E+T)/z);for(k=0;k<v;k++)0!=I[k]&&(h[k]=(O-2*C[k]*o)/I[k]);var M,D=[];D[0]=0;for(k=1;k<=v;k++)D[k]=D[k-1]+Q*h[k-1]+2*o;var F=[];for(k=0;k<v;k++)F[k]=0;(M=[])[0]=0,y.each(function(e){var t=y.eq(e).width(),a=y.eq(e).height();y.eq(e).width(t*h[x[e]]),y.eq(e).height(a*h[x[e]]),y.eq(e).parent().css({top:F[x[e]],left:D[x[e]]}),F[x[e]]+=a*h[x[e]]+2*o,M[x[e]]=e}),jQuery("#"+a).width(D[v]).height(F[0])}jQuery(".bwg_mosaic_thumbnails_"+r).css({visibility:"visible"}),jQuery(".tablenav-pages_"+r).css({visibility:"visible"}),bwg_container_loaded(r),jQuery(".bwg_mosaic_thumb_"+r).removeClass("bwg-hidden"),jQuery("#bwg_mosaic_thumbnails_div_"+r).removeClass("bwg-hidden"),"hover"==t.attr("data-image-title")&&bwg_mosaic_title_on_hover(r,t,o),"hover"==t.attr("data-ecommerce-icon")&&(jQuery(".bwg_mosaic_thumb_spun_"+r).on("mouseenter",function(){var e=jQuery(this).parents(".bwg-mosaic-thumb-span").children(".bwg_mosaic_thumb_"+r).width(),t=jQuery(this).parents(".bwg-mosaic-thumb-span").children(".bwg_mosaic_thumb_"+r).height();jQuery(this).children(".bwg_ecommerce_spun1_"+r).width(e);var a=jQuery(this).children(".bwg_ecommerce_spun1_"+r).width(),i=jQuery(this).children(".bwg_ecommerce_spun1_"+r).height();jQuery(this).children(".bwg_ecommerce_spun1_"+r).css({top:o+.5*t-.5*i,left:o+.5*e-.5*a,opacity:1,filter:"Alpha(opacity=100)"})}),jQuery(".bwg_mosaic_thumb_spun_"+r).on("mouseleave",function(){jQuery(this).children(".bwg_ecommerce_spun1_"+r).css({top:0,left:-1e4,opacity:0,filter:"Alpha(opacity=0)",padding:t.attr("data-title-margin")})}))}function bwg_mosaic_title_on_hover(r,e,o){jQuery(".bwg-mosaic-thumb-span").on("mouseenter",function(){var e=jQuery(this).children(".bwg_mosaic_thumb_"+r).width(),t=jQuery(this).children(".bwg_mosaic_thumb_"+r).height();jQuery(this).find(".bwg_mosaic_title_spun1_"+r).width(e);var a=jQuery(this).find(".bwg_mosaic_title_spun1_"+r).width(),i=jQuery(this).find(".bwg_mosaic_title_spun1_"+r).height();jQuery(this).find(".bwg_mosaic_title_spun1_"+r).css({top:o+.5*t-.5*i<0?o:o+.5*t-.5*i,left:o+.5*e-.5*a,opacity:1,filter:"Alpha(opacity=100)","max-height":"calc(100% - "+2*o+"px)",overflow:"hidden"})}),jQuery(".bwg-mosaic-thumb-span").on("mouseleave",function(){jQuery(this).find(".bwg_mosaic_title_spun1_"+r).css({top:0,left:-1e4,opacity:0,filter:"Alpha(opacity=0)",padding:e.attr("data-title-margin"),"max-height":"calc(100% - "+2*o+"px)",overflow:"hidden"})})}function bwg_mosaic_ajax(e,t){var a=0;jQuery(".bwg_mosaic_thumb_spun_"+e+" img").on("load",function(){++a>=t&&bwg_thumbnail_mosaic(jQuery(".bwg-mosaic-thumbnails[data-bwg="+e+"]"))}),jQuery(".bwg_mosaic_thumb_spun_"+e+" img").on("error",function(){jQuery(this).height(100),jQuery(this).width(100),++a>=t&&bwg_thumbnail_mosaic(jQuery(".bwg-mosaic-thumbnails[data-bwg="+e+"]"))})}function bwg_add_album(){var t=!1;jQuery(".bwg-album").off("click").on("click",function(){if(!t){var e=jQuery(this).attr("data-bwg");return t=!0,setTimeout(function(){t=!1},100),bwg_ajax("gal_front_form_"+e,e,jQuery(this).attr("data-container_id"),jQuery(this).attr("data-alb_gal_id"),jQuery(this).attr("data-album_gallery_id"),jQuery(this).attr("data-def_type"),"",jQuery(this).attr("data-title")),!1}}),jQuery(".bwg_description_more").on("click",function(){jQuery(this).hasClass("bwg_more")?(jQuery(this).parent().find(".bwg_description_full").show(),jQuery(this).addClass("bwg_hide").removeClass("bwg_more"),jQuery(this).html(jQuery(this).data("hide-msg"))):(jQuery(this).parent().find(".bwg_description_full").hide(),jQuery(this).addClass("bwg_more").removeClass("bwg_hide"),jQuery(this).html(jQuery(this).data("more-msg")))})}function bwg_add_lightbox(){var a=!1;jQuery(".bwg_lightbox .bwg-item0, .bwg_lightbox .bwg_slide, .bwg_lightbox .bwg-carousel-image").on("click",function(e){e.stopPropagation(),e.preventDefault();var t=jQuery(this).parent();if(!a)return a=!0,setTimeout(function(){a=!1},100),bwg_gallery_box(jQuery(t).attr("data-image-id"),jQuery(t).closest(".bwg_container")),!1}),jQuery(".bwg_lightbox .bwg_ecommerce").on("click",function(e){if(e.stopPropagation(),!a)return a=!0,setTimeout(function(){a=!1},100),bwg_gallery_box(jQuery(this).closest(".bwg_lightbox").attr("data-image-id"),jQuery(this).closest(".bwg_container"),!0),!1})}function bwg_filter_by_tag(e){var t="",a=jQuery(e).parent().parent(),i=a.find(".current_view").val(),r=a.find(".form_id").val(),o=a.find(".cur_gal_id").val(),_=a.find(".album_gallery_id").val(),s=a.find(".type").val();jQuery(e).parent().find(".opt.selected").each(function(){t=t+jQuery(e).text()+","}),""==(t=t.slice(0,-1))&&(t=bwg_objectsL10n.bwg_select_tag),jQuery(e).parent().find(".CaptionCont").attr("title",t),jQuery(e).parent().find(".CaptionCont .placeholder").html(t),jQuery("#bwg_tag_id_"+i).val(jQuery("#bwg_tag_id_"+o).val()),bwg_select_tag(i,r,o,_,s,!1)}function bwg_document_ready(){bwg_add_lightbox(),jQuery('div[id^="bwg_container1_"]').each(function(){var e=jQuery(this);e.data("right-click-protection")&&bwg_disable_right_click(e),jQuery(".SumoSelect > .CaptionCont > label > i").addClass("bwg-icon-angle-down closed");var t=e.find(".search_tags");t.length&&(t.SumoSelect({triggerChangeCombined:!0,placeholder:bwg_objectsL10n.bwg_select_tag,search:!0,searchText:bwg_objectsL10n.bwg_search,forceCustomRendering:!0,noMatch:bwg_objectsL10n.bwg_tag_no_match,captionFormatAllSelected:bwg_objectsL10n.bwg_all_tags_selected,captionFormat:"{0} "+bwg_objectsL10n.bwg_tags_selected,okCancelInMulti:!0,locale:[bwg_objectsL10n.ok,bwg_objectsL10n.cancel,bwg_objectsL10n.select_all]}),t.off("change").on("change",function(){bwg_filter_by_tag(this)}));var a=e.find(".bwg_order");a.length&&a.SumoSelect({triggerChangeCombined:!0,forceCustomRendering:!0}),""==jQuery(this).find(".bwg_search_input").val()?jQuery(this).find("search_placeholder_title").show():jQuery(this).find("search_placeholder_title").hide(),jQuery(".bwg_thumbnail .bwg_search_container_2").focusout(function(e){""==jQuery(this).find(".bwg_search_input").val()&&(jQuery(this).find(".search_placeholder_title").show(),jQuery(this).find(".bwg_search_loupe_container1").addClass("hidden"),jQuery(this).find(".bwg_search_reset_container").addClass("hidden"))})}),jQuery(".search_tags").on("sumo:opened",function(){0==jQuery(this).parent().find("ul li").length&&(jQuery(".no-match").html(bwg_objectsL10n.bwg_tag_no_match),jQuery(".no-match").show())}),jQuery(".bwg_thumbnail .SumoSelect").on("sumo:closed",function(){jQuery(this).find("label i").removeClass("bwg-icon-angle-up opened"),jQuery(this).find("label i").addClass("bwg-icon-angle-down closed")}),jQuery(".bwg_thumbnail .SumoSelect").on("sumo:opened",function(){jQuery(this).find("label i").removeClass("bwg-icon-angle-down closed"),jQuery(this).find("label i").addClass("bwg-icon-angle-up opened")}),bwg_add_album();var e=window.location.hash.substring(1);if(e&&"-1"!=e.indexOf("bwg")){bwg_hash_array=e.replace("bwg","").split("/");var t=jQuery(".bwg_container");t&&bwg_gallery_box(bwg_hash_array[1],t,!1,bwg_hash_array[0])}bwg_blog_style_ready(),bwg_image_browser_ready(),bwg_resize_search_line()}function bwg_clear_search_input(e){jQuery("#bwg_search_input_"+e).val(""),jQuery("#bwg_search_container_1_"+e+" .bwg_search_loupe_container1").addClass("hidden"),jQuery("#bwg_search_container_1_"+e+" .bwg_search_reset_container").addClass("hidden")}function bwg_check_search_input_enter(e,t){return 13!=(t.which||t.keyCode)||(jQuery(e).closest(".bwg_search_container_1").find(".bwg_search").trigger("click"),!1)}function bwg_ajax(t,a,i,e,r,o,_,s,n,l,g){jQuery("#ajax_loading_"+a).removeClass("bwg-hidden"),"function"==typeof bwg_scroll_load_action&&jQuery(window).off("scroll",bwg_scroll_load_action),jQuery(".bwg_thumbnail .search_tags").off("sumo:closed");var u=jQuery("#"+t).data("ajax-url"),c=0;if(void 0===l)l=!1;var d=jQuery("#page_number_"+a).val(),h={},b=jQuery("#bwg_album_breadcrumb_"+a).val();if(b&&!0!==l){var p=JSON.parse(b);if("back"==e){p.splice(-1,1);var m=p.slice(-1)[0];e=m.id,d=m.page,h["action_"+a]="back"}else"numeric"===l||_?(p.splice(-1,1),p.push({id:e,page:d})):(p.push({id:e,page:1}),d=1);h["bwg_album_breadcrumb_"+a]=JSON.stringify(p)}if(h.gallery_type=jQuery("#"+t).data("gallery-type"),h.gallery_id=jQuery("#"+t).data("gallery-id"),h.tag=jQuery("#"+t).data("tag"),h.album_id=jQuery("#"+t).data("album-id"),h.theme_id=jQuery("#"+t).data("theme-id"),h.shortcode_id=jQuery("#"+t).data("shortcode-id"),h.bwg=a,_&&(d=1),void 0===s||""==s)s="";if(void 0===g||""==g)g="";if(void 0===n||""==n)n=jQuery(".bwg_order_"+a).val();return h["page_number_"+a]=d,h["bwg_load_more_"+a]=jQuery("#bwg_load_more_"+a).val(),h["album_gallery_id_"+a]=e,h["type_"+a]=o,h["title_"+a]=s,h["description_"+a]=g,h["sortImagesByValue_"+a]=n,0<jQuery("#bwg_search_input_"+a).length&&(h["bwg_search_"+a]=jQuery("#bwg_search_input_"+a).val()),h["bwg_tag_id_"+i]=jQuery("#bwg_tag_id_"+i).val(),jQuery("#gal_front_form_"+a).addClass("bwg-hidden"),jQuery("#ajax_loading_"+a).removeClass("bwg-hidden"),jQuery.ajax({type:"POST",url:u,data:h,success:function(e){jQuery(e).find(".bwg_masonry_thumb_spun_"+a+" img").length,c=jQuery(e).find(".bwg_mosaic_thumb_spun_"+a+" img").length,!0===l?(i=="bwg_thumbnails_mosaic_"+a?jQuery("#"+i).append(jQuery(e).closest(".bwg-container-"+a).find("#"+i).html()):i=="bwg_album_compact_"+a?jQuery("#"+i).append(jQuery(e).closest(".bwg-album-thumbnails").html()):jQuery("#"+i).append(jQuery(e).closest(".bwg-container-"+a).html()),jQuery(".bwg_nav_cont_"+a).html(jQuery(e).closest(".bwg_nav_cont_"+a).html())):jQuery("#bwg_container3_"+a).html(e)},complete:function(){jQuery("div[id^='bwg_container1_'] img").each(function(){null!=jQuery(this).attr("data-lazy-src")&&""!=jQuery(this).attr("data-lazy-src")?jQuery(this).attr("src",jQuery(this).attr("data-lazy-src")):null!=jQuery(this).attr("data-src")&&""!=jQuery(this).attr("data-src")&&jQuery(this).attr("src",jQuery(this).attr("data-src"))}),jQuery(".blog_style_image_buttons_conteiner_"+a).find(jQuery(".bwg_blog_style_img_"+a)).on("load",function(){jQuery(".bwg_blog_style_img_"+a).closest(jQuery(".blog_style_image_buttons_conteiner_"+a)).show()}),jQuery("#bwg_tags_id_"+i).val(jQuery("#bwg_tag_id_"+i).val()),jQuery(".pagination-links_"+a).length&&jQuery("html, body").animate({scrollTop:jQuery("#"+t).offset().top-150},500),bwg_document_ready(),bwg_mosaic_ajax(a,c),bwg_all_thumnails_loaded(".bwg-container-"+a)&&bwg_container_loaded(a),jQuery(".blog_style_images_conteiner_"+a+" .bwg_embed_frame_16x9_"+a).each(function(e){jQuery(this).width(jQuery(this).parent().width()),jQuery(this).height(.5625*jQuery(this).width())}),jQuery(".blog_style_images_conteiner_"+a+" .bwg_embed_frame_instapost_"+a).each(function(e){jQuery(this).width(jQuery(this).parent().width()),jQuery(this).height((jQuery(this).width()-16)*jQuery(this).attr("data-height")/jQuery(this).attr("data-width")+96)}),jQuery("#bwg_embed_frame_16x9_"+a).width(jQuery("#bwg_embed_frame_16x9_"+a).parent().width()),jQuery("#bwg_embed_frame_16x9_"+a).height(.5625*jQuery("#bwg_embed_frame_16x9_"+a).width()),jQuery("#bwg_embed_frame_instapost_"+a).width(jQuery("#bwg_embed_frame_16x9_"+a).parent().width()),jQuery(".bwg_embed_frame_instapost_"+a).height((jQuery(".bwg_embed_frame_instapost_"+a).width()-16)*jQuery(".bwg_embed_frame_instapost_"+a).attr("data-height")/jQuery(".bwg_embed_frame_instapost_"+a).attr("data-width")+96),jQuery("#bwg_search_input_"+a).val(h["bwg_search_"+a]),""!=jQuery("#bwg_search_input_"+a).val()?(jQuery("#bwg_search_input_"+a).parent().find(".search_placeholder_title").hide(),jQuery("#bwg_search_input_"+a).parent().parent().find(".bwg_search_reset_container").show(),jQuery("#bwg_search_input_"+a).parent().parent().find(".bwg_search_loupe_container1").show()):jQuery("#bwg_search_input_"+a).parent().find(".search_placeholder_title").show();var e=jQuery("#bwg_container2_"+a+" .cur_gal_id").val();jQuery("#bwg_tag_id_"+a).val(jQuery("#bwg_tag_id_"+e).val())}}),!1}function bwg_select_tag(e,t,a,i,r,o){o&&jQuery("#bwg_tag_id_"+a).val(""),bwg_ajax(t,e,a,i,"",r,1,"")}function bwg_cube(e,t,a,i,r,o,_,s,n,l,g){var u,c=!1,d="";if(void 0!==g&&""!==g){c=!0,bwg_params[g].bwg_trans_in_progress=!0,d="_"+g,u=bwg_params[g].bwg_transition_duration;bwg_params[g].event_stack}else u=bwg_transition_duration;if(!bwg_testBrowser_cssTransitions(g))return bwg_fallback(s,n,l,g);if(!bwg_testBrowser_cssTransforms3d(g))return bwg_fallback3d(s,n,l,g);function h(){if(jQuery(s).removeAttr("style"),jQuery(n).removeAttr("style"),jQuery(".bwg_slider"+d).removeAttr("style"),jQuery(s).css({opacity:0,filter:"Alpha(opacity=0)","z-index":1}),jQuery(n).css({opacity:1,filter:"Alpha(opacity=100)","z-index":2}),jQuery(".bwg_image_info").show(),jQuery(s).html(""),c){bwg_change_watermark_container(g),bwg_params[g].bwg_trans_in_progress=!1;var e=bwg_params[g].data,t=bwg_params[g].event_stack}else{gallery_box_data.bwg_trans_in_progress=!1;t=gallery_box_data.event_stack}void 0!==t&&0<t.length&&(key=t[0].split("-"),t.shift(),bwg_change_image(key[0],key[1],e,!0,g)),bwg_change_watermark_container()}c?(jQuery(".bwg_slideshow_filmstrip_thumbnail_"+g).removeClass("bwg_slideshow_thumb_active_"+g).addClass("bwg_slideshow_thumb_deactive_"+g),jQuery("#bwg_filmstrip_thumbnail_"+bwg_params[g].bwg_current_key+"_"+g).removeClass("bwg_slideshow_thumb_deactive_"+g).addClass("bwg_slideshow_thumb_active_"+g),jQuery(".bwg_slideshow_dots_"+g).removeClass("bwg_slideshow_dots_active_"+g).addClass("bwg_slideshow_dots_deactive_"+g),jQuery("#bwg_dots_"+bwg_params[g].bwg_current_key+"_"+g).removeClass("bwg_slideshow_dots_deactive_"+g).addClass("bwg_slideshow_dots_active_"+g),jQuery(".bwg_slide_bg_"+g).css("perspective",1e3)):(gallery_box_data.bwg_trans_in_progress=!0,jQuery(".bwg_filmstrip_thumbnail").removeClass("bwg_thumb_active").addClass("bwg_thumb_deactive"),jQuery("#bwg_filmstrip_thumbnail_"+gallery_box_data.bwg_current_key).removeClass("bwg_thumb_deactive").addClass("bwg_thumb_active"),jQuery(".bwg_slide_bg").css("perspective",1e3)),jQuery(s).css({transform:"translateZ("+e+"px)",backfaceVisibility:"hidden"}),jQuery(n).css({opacity:1,filter:"Alpha(opacity=100)",backfaceVisibility:"hidden",transform:"translateY("+a+"px) translateX("+t+"px) rotateY("+r+"deg) rotateX("+i+"deg)"}),jQuery(".bwg_slider"+d).css({transform:"translateZ(-"+e+"px)",transformStyle:"preserve-3d"}),setTimeout(function(){jQuery(".bwg_slider"+d).css({transition:"all "+u+"ms ease-in-out",transform:"translateZ(-"+e+"px) rotateX("+o+"deg) rotateY("+_+"deg)"})},20),jQuery(".bwg_slider"+d).one("webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend",jQuery.proxy(h)),0==u&&h()}function bwg_cubeH(e,t,a,i){var r=jQuery(e).width()/2;"right"==a?bwg_cube(r,r,0,0,90,0,-90,e,t,a,i):"left"==a&&bwg_cube(r,-r,0,0,-90,0,90,e,t,a,i)}function bwg_cubeV(e,t,a,i){var r=jQuery(e).height()/2;"right"==a?bwg_cube(r,0,-r,90,0,-90,0,e,t,a,i):"left"==a&&bwg_cube(r,0,r,-90,0,90,0,e,t,a,i)}function bwg_fade(e,t,a,i){var r,o=!1;function _(){jQuery(".bwg_image_info").show(),bwg_change_watermark_container(i),o?bwg_params[i].bwg_trans_in_progress=!1:gallery_box_data.bwg_trans_in_progress=!1}r=void 0!==i&&""!==i?(o=!0,bwg_params[i].bwg_trans_in_progress=!0,bwg_params[i].bwg_transition_duration):(gallery_box_data.bwg_trans_in_progress=!0,gallery_box_data.bwg_transition_duration),o?(jQuery(".bwg_slideshow_filmstrip_thumbnail_"+i).removeClass("bwg_slideshow_thumb_active_"+i).addClass("bwg_slideshow_thumb_deactive_"+i),jQuery("#bwg_filmstrip_thumbnail_"+bwg_params[i].bwg_current_key+"_"+i).removeClass("bwg_slideshow_thumb_deactive_"+i).addClass("bwg_slideshow_thumb_active_"+i),jQuery(".bwg_slideshow_dots_"+i).removeClass("bwg_slideshow_dots_active_"+i).addClass("bwg_slideshow_dots_deactive_"+i),jQuery("#bwg_dots_"+bwg_params[i].bwg_current_key+"_"+i).removeClass("bwg_slideshow_dots_deactive_"+i).addClass("bwg_slideshow_dots_active_"+i)):(jQuery(".bwg_filmstrip_thumbnail").removeClass("bwg_thumb_active").addClass("bwg_thumb_deactive"),jQuery("#bwg_filmstrip_thumbnail_"+gallery_box_data.bwg_current_key).removeClass("bwg_thumb_deactive").addClass("bwg_thumb_active")),bwg_testBrowser_cssTransitions()?(jQuery(t).css("transition","opacity "+r+"ms linear"),jQuery(e).css({opacity:0,"z-index":1}),jQuery(t).css({opacity:1,"z-index":2}),jQuery(t).one("webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend",jQuery.proxy(_))):(jQuery(e).animate({opacity:0,"z-index":1},r),jQuery(t).animate({opacity:1,"z-index":2},{duration:r,complete:function(){o?bwg_params[i].bwg_trans_in_progress=!1:gallery_box_data.bwg_trans_in_progress=!1,jQuery(e).html(""),_()}}),jQuery(e).fadeTo(r,0),jQuery(t).fadeTo(r,1)),0==r&&_()}function bwg_grid(e,t,a,i,r,o,_,s,n,l,g){var u,c=!1,d="";if(event_stack=void 0!==g&&""!==g?(c=!0,bwg_params[g].bwg_trans_in_progress=!0,d="_"+g,u=bwg_params[g].bwg_transition_duration,data=bwg_params[g].data,bwg_params[g].event_stack):(u=bwg_transition_duration,gallery_box_data.bwg_trans_in_progress=!0,gallery_box_data.event_stack),!bwg_testBrowser_cssTransitions())return bwg_fallback(s,n,l);c?(jQuery(".bwg_slideshow_filmstrip_thumbnail_"+g).removeClass("bwg_slideshow_thumb_active_"+g).addClass("bwg_slideshow_thumb_deactive_"+g),jQuery("#bwg_filmstrip_thumbnail_"+bwg_params[g].bwg_current_key+d).removeClass("bwg_slideshow_thumb_deactive_"+g).addClass("bwg_slideshow_thumb_active_"+g),jQuery(".bwg_slideshow_dots_"+g).removeClass("bwg_slideshow_dots_active_"+g).addClass("bwg_slideshow_dots_deactive_"+g),jQuery("#bwg_dots_"+bwg_params[g].bwg_current_key+d).removeClass("bwg_slideshow_dots_deactive_"+g).addClass("bwg_slideshow_dots_active_"+g)):(jQuery(".bwg_filmstrip_thumbnail").removeClass("bwg_thumb_active").addClass("bwg_thumb_deactive"),jQuery("#bwg_filmstrip_thumbnail_"+gallery_box_data.bwg_current_key).removeClass("bwg_thumb_deactive").addClass("bwg_thumb_active"));var h=u/(e+t);var b=jQuery(s).find("img"),p=(jQuery(s).find("iframe").css("opacity",0),jQuery('<span style="display: block;" />').addClass("bwg_grid"+d));jQuery(s).prepend(p);var m,w,y,f,j,Q,v,x,C,S,k,E=jQuery(".bwg_slide_bg"+d),I=b.width(),z=b.height(),T=E.width(),O=E.height(),M=Math.floor(T/e),D=Math.floor(O/t),F=T-e*M,A=Math.ceil(F/e),B=O-t*D,H=Math.ceil(B/t),P=0,W=Math.ceil((jQuery(".bwg_slide_bg"+d).width()-b.width())/2),L=void 0===b.attr("src")?"":b.attr("src");i="min-auto"===(i="auto"===i?T:i)?-T:i,r="min-auto"===(r="auto"===r?O:r)?-O:r;for(var N=0;N<e;N++){var R=0,q=Math.floor((jQuery(".bwg_slide_bg"+d).height()-b.height())/2),V=M;if(0<F){var U=A<=F?A:F;V+=U,F-=U}for(var Y=0;Y<t;Y++){var X=D,J=B;0<J&&(X+=U=H<=J?H:B,J-=U),p.append((m=V,w=X,y=R,f=q,j=P,Q=W,v=L,x=I,C=z,S=g,void 0,k=(N+Y)*h,jQuery('<span class="bwg_gridlet'+d+'" />').css({display:"block",width:m,height:w,top:y,left:j,backgroundImage:'url("'+v+'")',backgroundColor:c?jQuery(".bwg_slideshow_image_wrap_"+S).css("background-color"):jQuery(".spider_popup_wrap").css("background-color"),backgroundRepeat:"no-repeat",backgroundPosition:Q+"px "+f+"px",backgroundSize:x+"px "+C+"px",transition:"all "+u+"ms ease-in-out "+k+"ms",transform:"none"}))),R+=X,q-=X}W-=V,P+=V}var G=p.children().last();function K(){if(jQuery(s).css({opacity:0,"z-index":1}),jQuery(n).css({opacity:1,"z-index":2}),b.css("opacity",1),p.remove(),c){bwg_params[g].bwg_trans_in_progress=!1;var e=bwg_params[g].event_stack}else{gallery_box_data.bwg_trans_in_progress=!1;e=gallery_box_data.event_stack}jQuery(".bwg_image_info").show(),jQuery(s).html(""),void 0!==e&&0<e.length&&(key=e[0].split("-"),e.shift(),bwg_change_image(key[0],key[1],data,!0,g)),c?bwg_change_watermark_container(g):bwg_change_watermark_container()}p.show(),b.css("opacity",0),p.children().first().addClass("rs-top-left"),p.children().last().addClass("rs-bottom-right"),p.children().eq(t-1).addClass("rs-bottom-left"),p.children().eq(-t).addClass("rs-top-right"),setTimeout(function(){p.children().css({opacity:_,transform:"rotate("+a+"deg) translateX("+i+"px) translateY("+r+"px) scale("+o+")"})},1),jQuery(n).css("opacity",1),jQuery(G).one("webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend",jQuery.proxy(K)),0==u&&K()}function bwg_sliceH(e,t,a,i){if("right"==a)var r="min-auto";else if("left"==a)r="auto";bwg_grid(1,8,0,r,0,1,0,e,t,a,i)}function bwg_sliceV(e,t,a,i){if("right"==a)var r="min-auto";else if("left"==a)r="auto";bwg_grid(10,1,0,0,r,1,0,e,t,a,i)}function bwg_slideV(e,t,a,i){if("right"==a)var r="auto";else if("left"==a)r="min-auto";bwg_grid(1,1,0,0,r,1,1,e,t,a,i)}function bwg_slideH(e,t,a,i){if("right"==a)var r="min-auto";else if("left"==a)r="auto";bwg_grid(1,1,0,r,0,1,1,e,t,a,i)}function bwg_scaleOut(e,t,a,i){bwg_grid(1,1,0,0,0,1.5,0,e,t,a,i)}function bwg_scaleIn(e,t,a,i){bwg_grid(1,1,0,0,0,.5,0,e,t,a,i)}function bwg_blockScale(e,t,a,i){bwg_grid(8,6,0,0,0,.6,0,e,t,a,i)}function bwg_kaleidoscope(e,t,a,i){bwg_grid(10,8,0,0,0,1,0,e,t,a,i)}function bwg_fan(e,t,a,i){if("right"==a)var r=45,o=100;else if("left"==a)r=-45,o=-100;bwg_grid(1,10,r,o,0,1,0,e,t,a,i)}function bwg_blindV(e,t,a,i){bwg_grid(1,8,0,0,0,.7,0,e,t,"",i)}function bwg_blindH(e,t,a,i){bwg_grid(10,1,0,0,0,.7,0,e,t,"",i)}function bwg_random(e,t,a,i){var r=["sliceH","sliceV","slideH","slideV","scaleOut","scaleIn","blockScale","kaleidoscope","fan","blindH","blindV"];this["bwg_"+r[Math.floor(Math.random()*r.length)]](e,t,a,i)}function bwg_change_watermark_container(t){jQuery(".bwg_slider"+(void 0!==t&&""!==t?"_"+t:"")).children().each(function(){if(2==jQuery(this).css("zIndex")){var e=jQuery(this).find("img");if(e.length)if(e.prop("complete"))bwg_change_each_watermark_container(e.width(),e.height(),t);else e.on("load",function(){bwg_change_each_watermark_container(e.width(),e.height(),t)});else(e=jQuery(this).find("iframe")).length||(e=jQuery(this).find("video")),bwg_change_each_watermark_container(e.width(),e.height(),t)}})}function bwg_change_each_watermark_container(e,t,a){var i=void 0!==a&&""!==a?"_"+a:"",r=void 0!==a&&""!==a?"_slideshow":"";if(jQuery(".bwg"+r+"_watermark_spun"+i).width(e),jQuery(".bwg"+r+"_watermark_spun"+i).height(t),jQuery(".bwg"+r+"_watermark"+i).css({display:""}),void 0===a||""===a){var o=0;(jQuery(".bwg_comment_container").hasClass("bwg_open")||jQuery(".bwg_ecommerce_container").hasClass("bwg_open"))&&(o=gallery_box_data.lightbox_comment_width),e<=jQuery(window).width()-o&&(jQuery(".bwg_watermark_image").css({width:(jQuery(".spider_popup_wrap").width()-o)*gallery_box_data.watermark_font_size/gallery_box_data.image_width}),jQuery(".bwg_watermark_text, .bwg_watermark_text:hover").css({fontSize:(jQuery(".spider_popup_wrap").width()-o)*gallery_box_data.watermark_font_size/gallery_box_data.image_width}))}else jQuery(".bwg"+r+"_title_spun"+i).width(e),jQuery(".bwg"+r+"_title_spun"+i).height(t),jQuery(".bwg"+r+"_description_spun"+i).width(e),jQuery(".bwg"+r+"_description_spun"+i).height(t);jQuery.trim(jQuery(".bwg"+r+"_title_text"+i).text())&&jQuery(".bwg_slideshow_title_text"+i).css({display:""}),jQuery.trim(jQuery(".bwg"+r+"_description_text"+i).text())&&jQuery(".bwg"+r+"_description_text"+i).css({display:""})}function bwg_set_filmstrip_pos(e,t,a){var i,r=void 0!==t&&""!==t?"_"+t:"",o=void 0!==t&&""!==t?"_slideshow":"";i=void 0!==t&&""!==t?bwg_params[t].left_or_top:gallery_box_data.left_or_top;var _=parseInt(jQuery(".bwg_filmstrip_thumbnails").attr("data-all-images-top-bottom-space")),s=parseInt(jQuery(".bwg_filmstrip_thumbnails").attr("data-all-images-right-left-space"));if(void 0===t||""===t){if("outerWidth"==gallery_box_data.outerWidth_or_outerHeight)var n=-bwg_current_filmstrip_pos-jQuery(".bwg_filmstrip_thumbnail").outerWidth(!0)/2;else if("outerHeight"==gallery_box_data.outerWidth_or_outerHeight)n=-bwg_current_filmstrip_pos-jQuery(".bwg_filmstrip_thumbnail").outerHeight(!0)/2;if("width"==gallery_box_data.width_or_height)var l=Math.min(0,Math.max(e-jQuery(".bwg_filmstrip_thumbnails").width(),n+e/2));else if("height"==gallery_box_data.width_or_height)l=Math.min(0,Math.max(e-jQuery(".bwg_filmstrip_thumbnails").height(),n+e/2))}else if("width"==bwg_params[t].width_or_height)n=-bwg_params[t].bwg_current_filmstrip_pos-(jQuery(".bwg_slideshow_filmstrip_thumbnail"+r).width()+bwg_params[t].filmstrip_thumb_margin_hor)/2,l=Math.min(0,Math.max(e-jQuery(".bwg_slideshow_filmstrip_thumbnails"+r).width(),n+e/2));else n=-bwg_params[t].bwg_current_filmstrip_pos-(jQuery(".bwg_slideshow_filmstrip_thumbnail"+r).height()+bwg_params[t].filmstrip_thumb_margin_hor)/2,l=Math.min(0,Math.max(e-jQuery(".bwg_slideshow_filmstrip_thumbnails"+r).height(),n+e/2));0<l+s&&(s=0),0<l+_&&(_=0),"left"==i?jQuery(".bwg"+o+"_filmstrip_thumbnails"+r).animate({left:l+s},{duration:500,complete:function(){bwg_filmstrip_arrows(t)}}):jQuery(".bwg"+o+"_filmstrip_thumbnails"+r).animate({top:l+_},{duration:500,complete:function(){bwg_filmstrip_arrows(t)}})}function bwg_filmstrip_arrows(e){var t=void 0!==e&&""!==e?"_"+e:"",a=void 0!==e&&""!==e?"_slideshow":"";if("width"==(void 0!==e&&""!==e?bwg_params[e].width_or_heigh:gallery_box_data.width_or_height))var i=jQuery(".bwg"+a+"_filmstrip_thumbnails"+t).width(),r=jQuery(".bwg"+a+"_filmstrip"+t).width();else i=jQuery(".bwg"+a+"_filmstrip_thumbnails"+t).height(),r=jQuery(".bwg"+a+"_filmstrip"+t).height();i<r?(jQuery(".bwg"+a+"_filmstrip_left"+t).hide(),jQuery(".bwg"+a+"_filmstrip_right"+t).hide()):(jQuery(".bwg"+a+"_filmstrip_left"+t).show(),jQuery(".bwg"+a+"_filmstrip_right"+t).show())}function bwg_move_filmstrip(e){var t,a,i,r,o,_,s=void 0!==e&&""!==e?"_"+e:"",n=void 0!==e&&""!==e?"_slideshow":"",l=void 0!==e&&""!==e?bwg_params[e].outerWidth_or_outerHeight:gallery_box_data.outerWidth_or_outerHeight,g=void 0!==e&&""!==e?bwg_params[e].left_or_top:gallery_box_data.left_or_top;a="outerWidth"==l?(t=jQuery(".bwg"+n+"_filmstrip"+s).outerWidth(!0),jQuery(".bwg"+n+"_filmstrip_thumbnails"+s).outerWidth(!0)):(t=jQuery(".bwg"+n+"_filmstrip"+s).outerHeight(!0),jQuery(".bwg"+n+"_filmstrip_thumbnails"+s).outerHeight(!0)),_="left"==g?(i=jQuery(".bwg"+n+"_thumb_active"+s).position().left,r="outerWidth"==l?jQuery(".bwg"+n+"_thumb_active"+s).position().left+jQuery(".bwg"+n+"_thumb_active"+s).outerWidth(!0):jQuery(".bwg"+n+"_thumb_active"+s).position().left+jQuery(".bwg"+n+"_thumb_active"+s).outerHeight(!0),o=jQuery(".bwg"+n+"_filmstrip_thumbnails"+s).position().left,Math.abs(jQuery(".bwg"+n+"_filmstrip_thumbnails"+s).position().left)+t):(i=jQuery(".bwg"+n+"_thumb_active"+s).position().top,r="outerWidth"==l?jQuery(".bwg"+n+"_thumb_active"+s).position().top+jQuery(".bwg"+n+"_thumb_active"+s).outerWidth(!0):jQuery(".bwg"+n+"_thumb_active"+s).position().top+jQuery(".bwg"+n+"_thumb_active"+s).outerHeight(!0),o=jQuery(".bwg"+n+"_filmstrip_thumbnails"+s).position().top,Math.abs(jQuery(".bwg"+n+"_filmstrip_thumbnails"+s).position().top)+t),a<t||(i<Math.abs(o)?"left"==g?jQuery(".bwg"+n+"_filmstrip_thumbnails"+s).animate({left:-i},{duration:500,complete:function(){bwg_filmstrip_arrows(e)}}):jQuery(".bwg"+n+"_filmstrip_thumbnails"+s).animate({top:-i},{duration:500,complete:function(){bwg_filmstrip_arrows(e)}}):_<r&&("left"==g?jQuery(".bwg"+n+"_filmstrip_thumbnails"+s).animate({left:-(r-t)},{duration:500,complete:function(){bwg_filmstrip_arrows(e)}}):jQuery(".bwg"+n+"_filmstrip_thumbnails"+s).animate({top:-(r-t)},{duration:500,complete:function(){bwg_filmstrip_arrows(e)}})))}function bwg_move_dots(e){var t=jQuery(".bwg_slideshow_dots_active_"+e).position().left,a=jQuery(".bwg_slideshow_dots_active_"+e).position().left+jQuery(".bwg_slideshow_dots_active_"+e).outerWidth(!0),i=jQuery(".bwg_slideshow_dots_container_"+e).outerWidth(!0),r=jQuery(".bwg_slideshow_dots_thumbnails_"+e).outerWidth(!1),o=jQuery(".bwg_slideshow_dots_thumbnails_"+e).position().left,_=Math.abs(jQuery(".bwg_slideshow_dots_thumbnails_"+e).position().left)+i;r<i||(t<Math.abs(o)?jQuery(".bwg_slideshow_dots_thumbnails_"+e).animate({left:-t},{duration:500,complete:function(){}}):_<a&&jQuery(".bwg_slideshow_dots_thumbnails_"+e).animate({left:-(a-i)},{duration:500,complete:function(){}}))}function bwg_testBrowser_cssTransitions(e){return bwg_testDom("Transition",e)}function bwg_testBrowser_cssTransforms3d(e){return bwg_testDom("Perspective",e)}function bwg_testDom(e,t){for(var a=["","Webkit","Moz","ms","O","Khtml"],i=a.length;i--;)if(void 0!==document.body.style[a[i]+e])return!0;return!1}function bwg_fallback(e,t,a,i){bwg_fade(e,t,a,i)}function bwg_fallback3d(e,t,a,i){bwg_sliceV(e,t,a,i)}function bwg_none(e,t,a,i){var r=void 0!==i&&""!==i?"_"+i:"";if(jQuery(e).css({opacity:0,"z-index":1}),jQuery(t).css({opacity:1,"z-index":2}),void 0!==i&&""!==i){var o=bwg_params[i].bwg_current_key;bwg_change_watermark_container(i),jQuery(".bwg_slideshow_filmstrip_thumbnail"+r).removeClass("bwg_slideshow_thumb_active"+r).addClass("bwg_slideshow_thumb_deactive"+r),jQuery("#bwg_filmstrip_thumbnail_"+o+r).removeClass("bwg_slideshow_thumb_deactive"+r).addClass("bwg_slideshow_thumb_active"+r),jQuery(".bwg_slideshow_dots"+r).removeClass("bwg_slideshow_dots_active"+r).addClass("bwg_slideshow_dots_deactive"+r),jQuery("#bwg_dots_"+o+r).removeClass("bwg_slideshow_dots_deactive"+r).addClass("bwg_slideshow_dots_active"+r)}else jQuery(".bwg_image_info").show(),gallery_box_data.bwg_trans_in_progress=!1,jQuery(e).html(""),bwg_change_watermark_container()}function bwg_iterator(e){var t=1;return void 0!==e&&""!==e&&void 0!==bwg_params[e]&&1==bwg_params[e].enable_slideshow_shuffle&&(t=Math.floor((bwg_params[e].data.length-1)*Math.random()+1)),t}function bwg_change_image_slideshow(e,t,a,i,r){a=bwg_params[r].data;if(jQuery("#bwg_slideshow_image_container_"+r).find("iframe").each(function(){jQuery(this)[0].contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*"),jQuery(this)[0].contentWindow.postMessage('{ "method": "pause" }',"*"),jQuery(this)[0].contentWindow.postMessage("pause","*")}),jQuery("#image_id_"+r+"_"+a[e].id).find(".bwg_fb_video").each(function(){jQuery(this).attr("src",jQuery(this).attr("src"))}),a[t]){if(jQuery(".bwg_ctrl_btn_"+r).hasClass("bwg-icon-pause")&&bwg_play(bwg_params[r].data,r),i||(jQuery("#bwg_current_image_key_"+r).val(t),"-1"==e?e=jQuery(".bwg_slideshow_thumb_active_"+r).children("img").attr("image_key"):"-2"==e&&(e=jQuery(".bwg_slideshow_dots_active_"+r).attr("image_key"))),bwg_params[r].bwg_trans_in_progress)return void bwg_params[r].event_stack.push(e+"-"+t);var o="right";if(t<e)o="left";else if(e==t)return;jQuery(".bwg_slideshow_watermark_"+r).css({display:"none"}),jQuery(".bwg_slideshow_title_text_"+r).css({display:"none"}),jQuery(".bwg_slideshow_description_text_"+r).css({display:"none"}),"width"==bwg_params[r].width_or_height?bwg_params[r].bwg_current_filmstrip_pos=t*(jQuery(".bwg_slideshow_filmstrip_thumbnail_"+r).width()+2+2*bwg_params[r].lightbox_filmstrip_thumb_border_width):bwg_params[r].bwg_current_filmstrip_pos=t*(jQuery(".bwg_slideshow_filmstrip_thumbnail_"+r).height()+2+2*bwg_params[r].lightbox_filmstrip_thumb_border_width),e=t,bwg_params[r].bwg_current_key=e,jQuery("#bwg_slideshow_image_"+r).attr("image_id",a[t].id),jQuery(".bwg_slideshow_title_text_"+r).html(jQuery('<span style="display: block;" />').html(a[t].alt).text()),jQuery(".bwg_slideshow_description_text_"+r).html(jQuery('<span style="display: block;" />').html(a[t].description).text());var _=2==jQuery(".bwg_slideshow_image_spun_"+r).css("zIndex")?".bwg_slideshow_image_spun_"+r:".bwg_slideshow_image_second_spun_"+r,s=_==".bwg_slideshow_image_second_spun_"+r?".bwg_slideshow_image_spun_"+r:".bwg_slideshow_image_second_spun_"+r,n=-1<a[t].filetype.indexOf("EMBED_"),l=-1<a[t].filetype.indexOf("INSTAGRAM_POST"),g=-1<a[t].filetype.indexOf("INSTAGRAM_VIDEO"),u=jQuery(_).height(),c=jQuery(_).width(),d='<span class="bwg_slideshow_image_spun1_'+r+'" style="display:  '+(n?"block":"table")+' ;width: inherit; height: inherit;"><span class="bwg_slideshow_image_spun2_'+r+'" style="display: '+(n?"block":"table-cell")+'; vertical-align: middle; text-align: center; ">';if(n){if(d+='<span style="height: '+u+"px; width: "+c+'px;" class="bwg_popup_embed bwg_popup_watermark">',g&&(d+='<span class="bwg_inst_play_btn_cont" onclick="bwg_play_instagram_video(this)"><span class="bwg_inst_play"></span></span>'),l){var h=0,b=0;u<c+88?h=(b=u)-88:b=(h=c)+88,d+=spider_display_embed(a[t].filetype,a[t].image_url,a[t].filename,{class:"bwg_embed_frame","data-width":a[t].image_width,"data-height":a[t].image_height,frameborder:"0",allowfullscreen:"allowfullscreen",style:"width:"+h+"px; height:"+b+"px; vertical-align:middle; display:inline-block; position:relative;"})}else d+=spider_display_embed(a[t].filetype,a[t].image_url,a[t].filename,{class:"bwg_embed_frame",frameborder:"0",allowfullscreen:"allowfullscreen",style:"width:inherit; height:inherit; vertical-align:middle; display:table-cell;"});d+="</span>"}else{if("do_nothing"!=bwg_params[r].thumb_click_action){var p="";"open_lightbox"==bwg_params[r].thumb_click_action?p+=' class="bwg_lightbox" data-image-id="'+a[t].id+'"':"redirect_to_url"==bwg_params[r].thumb_click_action&&a[t].redirect_url&&(p+='href="'+a[t].redirect_url+'"'+(bwg_params[r].thumb_link_target&&1==bwg_params[r].thumb_link_target?' target="_blank"':"")),d+="<a "+p+">"}d+='<img style="max-height: '+u+"px !important; max-width: "+c+'px !important; display:inline-block;" ',d+=' class="bwg_slide bwg_slideshow_image_'+r+'" ',d+=' id="bwg_slideshow_image_'+r+'" ',d+=' src="'+bwg_params[r].upload_url+jQuery("<span style='display: block;' />").html(a[t].image_url).text()+'" alt="'+a[t].alt+'" image_id="'+a[t].id+'" /></a>'}d+="</span></span>",jQuery(s).html(d),bwg_params[r].preload_images&&bwg_preload_images(t,r),window["bwg_"+bwg_params[r].slideshow_effect](_,s,o,r),0<bwg_params[r].enable_slideshow_filmstrip?bwg_move_filmstrip(r):bwg_move_dots(r),a[t].is_embed_video?jQuery("#bwg_slideshow_play_pause_"+r).css({display:"none"}):jQuery("#bwg_slideshow_play_pause_"+r).css({display:""})}bwg_add_lightbox()}function bwg_preload_images_slideshow(e,t){var a=bwg_params[t].data;count=bwg_params[t].preload_images_count/2;var i=a.length;if(i<bwg_params[t].preload_images_count&&(count=0),0!=count)for(var r=e-count;r<e+count;r++){var o=parseInt((r+i)%i),_=-1<a[o].filetype.indexOf("EMBED_");void 0!==a[o]&&(_||jQuery("<img/>").attr("src",bwg_params[t].upload_url+jQuery('<span style="display: block;" />').html(a[o].image_url).text()))}else for(r=0;r<a.length;r++){_=-1<a[r].filetype.indexOf("EMBED_");void 0!==a[r]&&(_||jQuery("<img/>").attr("src",bwg_params[t].upload_url+jQuery('<span style="display: block;" />').html(a[r].image_url).text()))}}function bwg_preload_images(e,t){void 0!==t&&""!==t?bwg_preload_images_slideshow(e,t):bwg_preload_images_lightbox(e)}function bwg_popup_resize_slidshow(e){var t=jQuery(".bwg_slideshow_image_wrap_"+e).parent().width(),a=bwg_params[e].data;if(t>=bwg_params[e].image_width){jQuery(".bwg_slideshow_image_wrap_"+e).css({width:bwg_params[e].image_width}),jQuery(".bwg_slideshow_image_wrap_"+e).css({height:bwg_params[e].image_height}),jQuery(".bwg_slideshow_image_container_"+e).css({width:"horizontal"==bwg_params[e].filmstrip_direction?bwg_params[e].image_width:bwg_params[e].image_width-bwg_params[e].slideshow_filmstrip_width}),jQuery(".bwg_slideshow_image_container_"+e).css({height:"horizontal"==bwg_params[e].filmstrip_direction?bwg_params[e].image_height-bwg_params[e].slideshow_filmstrip_height:bwg_params[e].image_height}),jQuery(".bwg_slideshow_image_"+e).css({cssText:(bwg_params[e].filmstrip_direction,bwg_params[e].image_width)}),jQuery(".bwg_slideshow_embed_"+e).css({cssText:(bwg_params[e].filmstrip_direction,bwg_params[e].image_width)}),bwg_resize_instagram_post(e),bwg_change_watermark_container(e);var i="horizontal"==bwg_params[e].filmstrip_direction?"width: "+bwg_params[e].image_width:"height: "+bwg_params[e].image_height,r="horizontal"==bwg_params[e].filmstrip_direction?"width: "+(bwg_params[e].image_width-40):"height: "+(bwg_params[e].image_height-40);jQuery(".bwg_slideshow_filmstrip_container_"+e).css({cssText:i}),jQuery(".bwg_slideshow_filmstrip_"+e).css({cssText:r}),jQuery(".bwg_slideshow_dots_container_"+e).css({width:bwg_params[e].image_width}),jQuery("#bwg_slideshow_play_pause-ico_"+e).css({fontSize:bwg_params[e].slideshow_play_pause_btn_size}),"image"==bwg_params[e].watermark_type&&jQuery(".bwg_slideshow_watermark_image_"+e).css({maxWidth:bwg_params[e].watermark_width,maxHeight:bwg_params[e].watermark_height}),"text"==bwg_params[e].watermark_type&&jQuery(".bwg_slideshow_watermark_text_"+e+", .bwg_slideshow_watermark_text_"+e+" : hover").css({fontSize:bwg_params[e].watermark_font_size}),jQuery(".bwg_slideshow_title_text_"+e).css({fontSize:2*bwg_params[e].slideshow_title_font_size}),jQuery(".bwg_slideshow_description_text_"+e).css({fontSize:2*bwg_params[e].slideshow_description_font_size})}else jQuery(".bwg_slideshow_image_wrap_"+e).css({width:t}),jQuery(".bwg_slideshow_image_wrap_"+e).css({height:t*bwg_params[e].image_height/bwg_params[e].image_width}),jQuery(".bwg_slideshow_image_container_"+e).css({width:t-("horizontal"==bwg_params[e].filmstrip_direction?0:bwg_params[e].slideshow_filmstrip_width)}),jQuery(".bwg_slideshow_image_container_"+e).css({height:t*bwg_params[e].image_height/bwg_params[e].image_width-("horizontal"==bwg_params[e].filmstrip_direction?bwg_params[e].slideshow_filmstrip_height:0)}),jQuery(".bwg_slideshow_image_"+e).css({cssText:"max-width: "+(t-("horizontal"==bwg_params[e].filmstrip_direction?0:bwg_params[e].slideshow_filmstrip_width))+"px !important; max-height: "+(t*(bwg_params[e].image_height/bwg_params[e].image_width)-("horizontal"==bwg_params[e].filmstrip_direction?bwg_params[e].slideshow_filmstrip_height:0)-1)+"px !important;"}),jQuery(".bwg_slideshow_embed_"+e).css({cssText:"width: "+(t-("horizontal"==bwg_params[e].filmstrip_direction?0:bwg_params[e].slideshow_filmstrip_width))+"px !important; height: "+(t*(bwg_params[e].image_height/bwg_params[e].image_width)-("horizontal"==bwg_params[e].filmstrip_direction?bwg_params[e].slideshow_filmstrip_height:0)-1)+"px !important;"}),bwg_resize_instagram_post(e),bwg_change_watermark_container(e),"horizontal"==bwg_params[e].filmstrip_direction?(jQuery(".bwg_slideshow_filmstrip_container_"+e).css({width:t}),jQuery(".bwg_slideshow_filmstrip_"+e).css({width:t-40})):(jQuery(".bwg_slideshow_filmstrip_container_"+e).css({height:t*bwg_params[e].image_height/bwg_params[e].image_width}),jQuery(".bwg_slideshow_filmstrip_"+e).css({height:t*bwg_params[e].image_height/bwg_params[e].image_width-40})),jQuery(".bwg_slideshow_dots_container_"+e).css({width:t}),jQuery("#bwg_slideshow_play_pause-ico_"+e).css({fontSize:t*bwg_params[e].slideshow_play_pause_btn_size/bwg_params[e].image_width}),jQuery(".bwg_slideshow_watermark_image_"+e).css({maxWidth:t*bwg_params[e].watermark_width/bwg_params[e].image_width,maxHeight:t*bwg_params[e].watermark_height/bwg_params[e].image_width}),jQuery(".bwg_slideshow_watermark_text_"+e+", .bwg_slideshow_watermark_text_"+e+":hover").css({fontSize:t*bwg_params[e].watermark_font_size/bwg_params[e].image_width}),jQuery(".bwg_slideshow_title_text_"+e).css({fontSize:2*t*bwg_params[e].slideshow_title_font_size/bwg_params[e].image_width}),jQuery(".bwg_slideshow_description_text_"+e).css({fontSize:2*t*bwg_params[e].slideshow_description_font_size/bwg_params[e].image_width}),jQuery(".bwg_slideshow_image_"+e).css({display:"inline-block"});a[parseInt(jQuery("#bwg_current_image_key_"+e).val())].is_embed_video?jQuery("#bwg_slideshow_play_pause_"+e).css({display:"none"}):jQuery("#bwg_slideshow_play_pause_"+e).css({display:""})}function bwg_popup_resize(e){void 0!==e&&""!==e?bwg_popup_resize_slidshow(e):bwg_popup_resize_lightbox()}function bwg_change_image(e,t,a,i,r){void 0!==r&&""!==r?bwg_change_image_slideshow(e,t,a,i,r):bwg_change_image_lightbox(e,t,a,i)}function bwg_resize_instagram_post(e){if(void 0!==e&&""!==e){if(jQuery(".inner_instagram_iframe_bwg_embed_frame_"+e).length){var t=jQuery(".bwg_slideshow_embed_"+e).width(),a=jQuery(".bwg_slideshow_embed_").height();jQuery(".inner_instagram_iframe_bwg_embed_frame_"+e).each(function(){var e=jQuery(this).parent();a/(parseInt(e.attr("data-height"))+96)<t/parseInt(e.attr("data-width"))?(e.height(a),e.width((e.height()-96)*e.attr("data-width")/e.attr("data-height")+16)):(e.width(t),e.height((e.width()-16)*e.attr("data-height")/e.attr("data-width")+96))}),bwg_change_watermark_container(e)}}else if(jQuery(".inner_instagram_iframe_bwg_embed_frame").length){t=jQuery(".bwg_image_container").width(),a=jQuery(".bwg_image_container").height();jQuery(".inner_instagram_iframe_bwg_embed_frame").each(function(){var e=jQuery(this).parent();a/(parseInt(e.attr("data-height"))+176)<t/parseInt(e.attr("data-width"))?(e.height(a),e.width((e.height()-176)*e.attr("data-width")/e.attr("data-height")+16)):(e.width(t),e.height((e.width()-16)*e.attr("data-height")/e.attr("data-width")+96)),e.css({top:.5*(a-e.height())})}),bwg_change_watermark_container()}}function bwg_play(t,a){if(void 0!==a&&""!==a)t=bwg_params[a].data;void 0!==a&&""!==a?(window.clearInterval(window["bwg_playInterval"+a]),window["bwg_playInterval"+a]=setInterval(function(){var e=1;1==bwg_params[a].enable_slideshow_shuffle&&(e=Math.floor((t.length-1)*Math.random()+1)),bwg_change_image(parseInt(jQuery("#bwg_current_image_key_"+a).val()),(parseInt(jQuery("#bwg_current_image_key_"+a).val())+e)%t.length,t,"",a)},1e3*bwg_params[a].slideshow_interval)):(window.clearInterval(gallery_box_data.bwg_playInterval),gallery_box_data.bwg_playInterval=setInterval(function(){jQuery(".bwg_comment_container").hasClass("bwg_open")||jQuery(".bwg_play_pause").length&&jQuery(".bwg_play_pause").hasClass("bwg-icon-play")||(void 0===t||void 0!==t[parseInt(jQuery("#bwg_current_image_key").val())+1]?bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),parseInt(jQuery("#bwg_current_image_key").val())+1,t):1==gallery_box_data.enable_loop&&bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),0,t))},1e3*gallery_box_data.slideshow_interval))}function bwg_image_browser(e){if(jQuery("#bwg_embed_frame_16x9_"+e).width(jQuery("#bwg_embed_frame_16x9_"+e).parents(".image_browser_image_buttons_"+e).width()),jQuery("#bwg_embed_frame_16x9_"+e).height(.5625*jQuery("#bwg_embed_frame_16x9_"+e).width()),jQuery("#bwg_embed_frame_instapost_"+e).width(jQuery("#bwg_embed_frame_16x9_"+e).parents(".image_browser_image_buttons_"+e).width()),jQuery(".image_browser_images_conteiner_"+e).find(".fluid-width-video-wrapper").length){var t=jQuery(".image_browser_images_conteiner_"+e).find(".fluid-width-video-wrapper").contents();jQuery(".image_browser_images_conteiner_"+e).find(".fluid-width-video-wrapper").replaceWith(t)}jQuery(".bwg_embed_frame_instapost_"+e).height((jQuery(".bwg_embed_frame_instapost_"+e).width()-16)*jQuery(".bwg_embed_frame_instapost_"+e).attr("data-height")/jQuery(".bwg_embed_frame_instapost_"+e).attr("data-width")+96);var a=jQuery(".image_browser_images_"+e).width();a<=108?jQuery(".paging-input_"+e).css("display","none"):(a<=200?(jQuery(".paging-input_"+e).css("margin","0% 0% 0% 0%"),jQuery(".paging-input_"+e).css("display","inline")):a<=580?(jQuery(".paging-input_"+e).css("display","inline"),jQuery(".tablenav-pages_"+e+" a").css("font-size","13px"),jQuery(".paging-input_"+e).css("margin","0% 7% 0% 7%")):(jQuery(".tablenav-pages_"+e+" a").css("font-size","15px"),jQuery(".paging-input_"+e).css("margin","0%  14% 0%  14%"),jQuery(".paging-input_"+e).css("display","inline")),jQuery(".tablenav-pages_"+e+" .next-page").css("margin","0% 0% 0% 0%"),jQuery(".tablenav-pages_"+e+" .prev-page").css("margin","0% 0% 0% 0%"))}function bwg_disable_right_click(e){e.bind("contextmenu",function(){return!1}),e.css("webkitTouchCallout","none")}jQuery.fn.extend({hideShow:function(e){return this.checkForVisiblilityChange(e),this},checkForVisiblilityChange:function(e){if(this.length>>>0){for(var t,a,i,r=0;t=this[r++];){var o=jQuery(t).is(":visible");void 0===t.lastVisibility&&(t.lastVisibility=o),o!==t.lastVisibility&&(t.lastVisibility=o,"function"==typeof e&&e.apply(this,[new jQuery.Event("visibilityChanged"),o?"shown":"hidden"]),function(e,t){setTimeout(function(){jQuery(e).trigger("visibilityChanged",[t?"shown":"hidden"])},10)}(t,o))}a=this,i=arguments,setTimeout(function(){a.checkForVisiblilityChange.apply(a,i)},10)}}}),jQuery(document).ajaxComplete(function(){setTimeout(function(){bwg_main_ready()})}),jQuery(document).ready(function(){document.addEventListener("visibilitychange",function(){var e=!1;jQuery(".bwg_container").each(function(){0<jQuery(this).find(".wd_error").length&&(e=!0)}),e||("visible"==document.visibilityState&&bwg_slideshow_focus(),"hidden"==document.visibilityState&&bwg_slideshow_blur())}),bwg_main_ready(),jQuery(this).hideShow(function(e,t){"shown"==t&&bwg_main_ready()})}),jQuery(window).on("resize",function(){var e=!1;jQuery(".bwg_container").each(function(){0<jQuery(this).find(".wd_error").length&&(e=!0)}),e||(jQuery(".bwg-thumbnails, .bwg-masonry-thumbnails, .bwg-album-thumbnails").each(function(){bwg_all_thumnails_loaded(this)}),bwg_slideshow_resize(),bwg_image_browser_resize(),bwg_carousel_resize(),bwg_blog_style_resize(),jQuery(".bwg-mosaic-thumbnails").each(function(){bwg_thumbnail_mosaic(this)})),bwg_resize_search_line()}),jQuery(window).on("load",function(){var e=!1;jQuery(".bwg_container").each(function(){0<jQuery(this).find(".wd_error").length&&(e=!0)}),e||(bwg_blog_style_onload(),jQuery(".bwg-mosaic-thumbnails").each(function(){bwg_thumbnail_mosaic(this)}))}),jQuery(".bwg-masonry-thumb-span img, .bwg-mosaic-thumb-span img").on("error",function(){jQuery(this).height(100),jQuery(this).width(100)});