// source --> https://onepairofshoes.com/wp-content/plugins/photo-gallery/js/scripts.min.js?ver=1.8.42 
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,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(),1==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(function(){bwg_load_visible_images(key,preloadCount,total_thumbnail_count),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");void 0!==e&&bwg_rating((e=JSON.parse(e)).current_rate,e.current_rate_count,e.current_avg_rating,e.current_image_key)}),1==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,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())&&parseInt(jQuery(".spider_popup_close").css("right"))<0&&jQuery(".spider_popup_close").attr("class","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")||("ArrowRight"==e.key?parseInt(jQuery("#bwg_current_image_key").val())==gallery_box_data.data.length-1?bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),0):bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),parseInt(jQuery("#bwg_current_image_key").val())+1):"ArrowLeft"==e.key?0==parseInt(jQuery("#bwg_current_image_key").val())?bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),gallery_box_data.data.length-1):bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),parseInt(jQuery("#bwg_current_image_key").val())-1):"Escape"==e.key?spider_destroypopup(1e3):"Space"==e.key&&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,_=gallery_box_data.image_height;1==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 i=window.location.hash;i&&"-1"!=i.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)),1==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()}),jQuery("#spider_popup_wrap .bwg_image_wrap").on("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),!1}),jQuery("#spider_popup_wrap .bwg_image_wrap").on("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),!1}),bwg_reset_zoom();var a=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())?"touchend":"click";jQuery("#spider_popup_left").on(a,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),!1}),jQuery("#spider_popup_right").on(a,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),!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,.bwg_ecommerce_panel, .bwg_image_info").mCustomScrollbar({scrollInertia:150,theme:"dark-thick",advanced:{updateOnContentResize:!0}});var s=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel";jQuery(".bwg_filmstrip").on(s,function(e){var t=window.event||e,i=(t=t.originalEvent?t.originalEvent:t).detail?-40*t.detail:t.wheelDelta,a=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase());0<i?jQuery(".bwg_filmstrip_left").trigger(a?"touchend":"click"):jQuery(".bwg_filmstrip_right").trigger(a?"touchend":"click")}),jQuery(".bwg_filmstrip_right").on(a,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}),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",function(){bwg_disable_lightbox_filmstrip_right_arrow(gallery_box_data)}):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",function(){bwg_disable_lightbox_filmstrip_right_arrow(gallery_box_data)})):jQuery(".bwg_filmstrip_thumbnails").position().left>=-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height())&&(jQuery(".bwg_filmstrip_left").css({opacity:1}),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",function(){bwg_disable_lightbox_filmstrip_right_arrow(gallery_box_data)}):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",function(){bwg_disable_lightbox_filmstrip_right_arrow(gallery_box_data)})):"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}),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",function(){bwg_disable_lightbox_filmstrip_right_arrow(gallery_box_data)}):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",function(){bwg_disable_lightbox_filmstrip_right_arrow(gallery_box_data)})):jQuery(".bwg_filmstrip_thumbnails").position().top>=-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height())&&(jQuery(".bwg_filmstrip_left").css({opacity:1}),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",function(){bwg_disable_lightbox_filmstrip_right_arrow(gallery_box_data)}):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",function(){bwg_disable_lightbox_filmstrip_right_arrow(gallery_box_data)}))}),"left"==gallery_box_data.left_or_top?jQuery(".bwg_filmstrip_left").on(a,function(){jQuery(".bwg_filmstrip_thumbnails").stop(!0,!1),jQuery(".bwg_filmstrip_thumbnails").position().left<0&&(jQuery(".bwg_filmstrip_right").css({opacity:1}),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",function(){bwg_disable_lightbox_filmstrip_left_arrow(gallery_box_data)}):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",function(){bwg_disable_lightbox_filmstrip_left_arrow(gallery_box_data)}))}):jQuery(".bwg_filmstrip_left").on(a,function(){jQuery(".bwg_filmstrip_thumbnails").stop(!0,!1),jQuery(".bwg_filmstrip_thumbnails").position().top<0&&(jQuery(".bwg_filmstrip_right").css({opacity:1}),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",function(){bwg_disable_lightbox_filmstrip_left_arrow(gallery_box_data)}):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",function(){bwg_disable_lightbox_filmstrip_left_arrow(gallery_box_data)}))}),"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(a,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);jQuery(".bwg_ctrl_btn_container").length&&jQuery(".bwg_ctrl_btn_container").height();jQuery(".bwg_image_info").css("height","auto"),bwg_info_height_set()}else jQuery(".bwg_image_info_container1").css("display","none"),jQuery(".bwg_info").attr("title",bwg_objectsL10n.bwg_show_info)}),jQuery(".bwg_rate").on(a,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_zoom").on(a,function(){var e=["mousemove","touchmove"];jQuery("figure.bwg_popup_image").each(function(){var i=jQuery(this);i.hasClass("zoom")?jQuery.each(e,function(e,t){i.removeClass("zoom"),i.off(t)}):jQuery.each(e,function(e,t){i.addClass("zoom"),i.on(t,function(e){var t,i,a,r;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");var _=e.target,s=_.getBoundingClientRect();e.targetTouches&&(a=e.targetTouches[0].clientX-s.left,r=e.targetTouches[0].clientY-s.top),t=e.offsetX?e.offsetX:e.targetTouches?a:_.offsetHeight,i=e.offsetY?e.offsetY:e.targetTouches?r:_.offsetWidth,x=t/_.offsetWidth*100,y=i/_.offsetHeight*100,_.parentNode.style.backgroundPosition=x+"% "+y+"%"})})})}),jQuery(".bwg_comment, .bwg_comments_close_btn").on(a,function(){bwg_comment()}),jQuery(".bwg_ecommerce, .bwg_ecommerce_close_btn").on(a,function(){bwg_ecommerce()}),jQuery(".bwg_toggle_container").on(a,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";jQuery(".bwg_toggle_container i").hasClass(e)?(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).addClass("closed"),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).addClass("closed"),jQuery(".bwg_toggle_container").animate({top:0},{duration:500,complete:function(){jQuery(".bwg_toggle_container i").attr("class","bwg_toggle_btn "+t)}}))):(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).removeClass("closed"),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).removeClass("closed"),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)}}))),bwg_info_position(!0)});var o=window.innerHeight;jQuery(".bwg_resize-full").on(a,function(){bwg_resize_full()}),jQuery(".bwg_fullscreen").on(a,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=o,jQuery(window).width()>gallery_box_data.image_width&&(r=gallery_box_data.image_width),window.innerHeight>gallery_box_data.image_height&&(_=gallery_box_data.image_height),gallery_box_data.open_with_fullscreen&&(r=jQuery(window).width(),_=e),jQuery("#spider_popup_wrap").on("fscreenclose",function(){jQuery("#spider_popup_wrap").css({width:r,height:_,left:"50%",top:"50%",marginLeft:-r/2,marginTop:-_/2,zIndex:1e5}),jQuery(".bwg_image_wrap").css({width:r-t}),jQuery(".bwg_image_container").css({height:_-("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_image_info").css("height","auto"),bwg_info_height_set(),jQuery(".bwg_popup_image").css({maxWidth:r-t-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:_-("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:_-("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)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())}),bwg_set_filmstrip_pos(r-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data)):(jQuery(".bwg_filmstrip_container").css({height:_-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)}),jQuery(".bwg_filmstrip").css({height:_-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())}),bwg_set_filmstrip_pos(_-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data),"horizontal"!=gallery_box_data.filmstrip_direction&&jQuery(".bwg_filmstrip_right").css({top:_-jQuery(".bwg_filmstrip_right").height()})),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 i=screen.width,a=screen.height;jQuery("#spider_popup_wrap").css({width:i,height:a,left:0,top:0,margin:0,zIndex:1e5}),jQuery(".bwg_image_wrap").css({width:i-t}),jQuery(".bwg_image_container").css({height:a-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0),width:i-t-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)}),jQuery(".bwg_image_info").css("height","auto"),bwg_info_height_set(),jQuery(".bwg_popup_image").css({maxWidth:i-t-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:a-("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:i-t-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:a-("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:i-("horizontal"==gallery_box_data.filmstrip_direction?t:0)},500),jQuery(".bwg_filmstrip").css({width:i-("horizontal"==gallery_box_data.filmstrip_direction?t:0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())},500),bwg_set_filmstrip_pos(i-("horizontal"==gallery_box_data.filmstrip_direction?t:0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data)):(jQuery(".bwg_filmstrip_container").css({height:a-("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)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())}),bwg_set_filmstrip_pos(a-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data),"horizontal"!=gallery_box_data.filmstrip_direction&&jQuery(".bwg_filmstrip_right").css({top:a-jQuery(".bwg_filmstrip_right").height()})),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","spider_popup_close_fullscreen")}return!1}),jQuery(".bwg_play_pause").on(a,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),1==gallery_box_data.open_comment&&bwg_comment()}function spider_createpopup(e,t,a,r,_,s,o,l){e=e.replace(/&#038;/g,"&"),isPopUpOpened||(isPopUpOpened=!0,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:"+r+"px; margin-top:-"+r/2+"px; margin-left: -"+a/2+'px; ">'+e+"</div>").hide().appendTo("body");if(gallery_box_ready(),spider_showpopup(s,o,t,_,l),"undefined"!=typeof addthis){jQuery(".addthis-smartlayers").show();var i=setInterval(function(){void 0!==addthis.layers.refresh&&(clearInterval(i),addthis.layers.refresh())},100)}},beforeSend:function(){},complete:function(){}})))}function spider_showpopup(e,t,i,a,r){var _=gallery_box_data.data,s=parseInt(jQuery("#bwg_current_image_key").val());if(void 0!==_[s]&&(isPopUpOpened=!0,-1<_[s].filetype.indexOf("EMBED_")?bwg_first_image_load(i,r):jQuery("#spider_popup_wrap .bwg_popup_image_spun img").prop("complete")?bwg_first_image_load(i,r):jQuery("#spider_popup_wrap .bwg_popup_image_spun img").on("load error",function(){bwg_first_image_load(i,r)}),"EMBED_OEMBED_INSTAGRAM_POST"==_[s].filetype&&"undefined"!=typeof instgrm&&void 0!==instgrm.Embeds)){instgrm.Embeds.process();var o=parseInt(jQuery("#bwg_image_container").height());jQuery(".bwg_embed_frame .instagram-media").css({"max-height":o+"px"})}}function bwg_first_image_load(e,t){e.show(),""==gallery_box_data.data[key].alt&&""==gallery_box_data.data[key].description?jQuery(".bwg_info").hide():jQuery(".bwg_info").show();var i=jQuery(".bwg_ctrl_btn_container").height();"bottom"==t?jQuery(".bwg_toggle_container").css("bottom",i+"px"):"top"==t&&jQuery(".bwg_toggle_container").css("top",i+"px"),jQuery(".bwg_spider_popup_loading").hide(),1==gallery_box_data.preload_images&&bwg_preload_images(parseInt(jQuery("#bwg_current_image_key").val())),bwg_load_filmstrip(),bwg_info_height_set()}function spider_isunsupporteduseragent(){return!window.XMLHttpRequest}function spider_destroypopup(e){jQuery(".addthis-smartlayers").hide(),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()),i=document.querySelector('meta[name="viewport"]');t&&i&&(i.content="width=device-width, initial-scale=1");var a=jQuery(document).scrollTop();history.pushState(history.state,null,window.location.origin+window.location.pathname+window.location.search),jQuery(document).scrollTop(a),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")),jQuery("#ecommerce_opacity_div").css("display","block"),jQuery("#ecommerce_loading_div").css("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 i=jQuery(e).find(".downloads").html();jQuery(".downloads").html(i);var a=jQuery(e).find(".pge_options").html();jQuery(".pge_options").html(a);var r=jQuery(e).find(".pge_add_to_cart").html();jQuery(".pge_add_to_cart").html(r)},beforeSend:function(){},complete:function(){jQuery("#ecommerce_opacity_div").css("display","none"),jQuery("#ecommerce_loading_div").css("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){jQuery(".bwg_comments").mCustomScrollbar("destroy");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,theme:"dark-thick",advanced:{updateOnContentResize:!0}}),jQuery(".bwg_comments_close_btn").click(bwg_comment),bwg_captcha_refresh("bwg_captcha")}}),!1}function spider_rate_ajax_save(i,e){var t={};t.image_id=jQuery("#rate_image_id").val(),t.rate=void 0!==e?e:jQuery("#"+i+" input[name='score']").val(),t.ajax_task=jQuery("#rate_ajax_task").val();var a=jQuery("#bwg_image_container").data("action");return jQuery.ajax({type:"POST",url:a,data:t,success:function(e){var t=jQuery(e).find("#"+i).html();jQuery("#"+i).html(t)},beforeSend:function(){},complete:function(){}})}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"),i={ajax_task:"add_comment"};return i.comment_name=t.find("#bwg_name").val(),i.comment_email=t.find("#bwg_email").val(),i.comment_text=t.find("#bwg_comment").val(),i.comment_captcha=t.find("#bwg_captcha_input").val(),i.popup_enable_captcha=t.find("#bwg_popup_enable_captcha").val(),i.privacy_policy=t.find("#bwg_comment_privacy_policy").is(":checked")?1:0,i.comment_image_id=jQuery("#bwg_popup_image").attr("image_id"),i.comment_moderation=t.find("#bwg_comment_moderation").val(),jQuery(".bwg_spider_ajax_loading").hide(),jQuery.ajax({url:e,type:"POST",dataType:"json",data:i,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"),i={ajax_task:"delete_comment"};return i.id_image=jQuery("#bwg_popup_image").attr("image_id"),i.id_comment=t,jQuery.ajax({url:e,type:"POST",dataType:"json",data:i,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,i,a){jQuery(".bwg-validate").each(function(){jQuery(this).on("keypress change",function(){jQuery(this).parent().next().find(".bwg_comment_error").html("")})}),void 0===i&&(i=!1);var r,_=t.data("bwg");r=t.find(".bwg-container").data("lightbox-url")?t.find(".bwg-container").data("lightbox-url"):t.data("lightbox-url");var s=t.find(".cur_gal_id").val(),o=jQuery("#bwg_tag_id_"+s).val();o=o||0;var l=1==i?"&open_ecommerce=1":"",n=jQuery("#bwg_search_input_"+_).val(),g=jQuery("#bwg_order_"+_).val()?"&filtersortby="+jQuery("#bwg_order_"+_).val():"";n=n||"",void 0!==a&&(r+="&gallery_id="+a);var b="",w=jQuery("#bwg_blog_style_share_buttons_"+e).attr("data-open-comment");void 0!==w&&!1!==w&&(b="&open_comment=1");var d=parseInt(jQuery("#bwg_random_seed_"+_).val());spider_createpopup(r+"&bwg_gallery_type="+t.data("gallery-type")+"&bwg_random_seed="+d+"&image_id="+e+"&filter_tag="+o+l+b+"&filter_search_name="+n+g,_,t.data("popup-width"),t.data("popup-height"),1,"testpopup",5,t.data("buttons-position"))}function bwg_change_image_lightbox(e,a,r,t){if(jQuery("#rate_image_id").val(r[a].id),bwg_current_key=gallery_box_data.bwg_current_key,""==gallery_box_data.data[a].alt&&""==gallery_box_data.data[a].description?jQuery(".bwg_info").hide():jQuery(".bwg_info").show(),jQuery(".bwg_image_info").css("height","auto"),setTimeout(function(){bwg_info_height_set(),jQuery(".bwg_image_description").height()>jQuery(".bwg_image_info").height()&&jQuery(".mCSB_container").hasClass("mCS_no_scrollbar")&&jQuery(".bwg_image_info").mCustomScrollbar("destroy"),jQuery(".bwg_image_info").hasClass("mCustomScrollbar")||void 0!==jQuery().mCustomScrollbar&&jQuery.isFunction(jQuery().mCustomScrollbar)&&jQuery(".bwg_image_info").mCustomScrollbar({scrollInertia:150,theme:"dark-thick",advanced:{updateOnContentResize:!0}})},200),jQuery("#spider_popup_left").show(),jQuery("#spider_popup_right").show(),jQuery(".bwg_image_info").hide(),0==gallery_box_data.enable_loop&&(a==parseInt(r.length)-1&&jQuery("#spider_popup_right").hide(),0==a&&jQuery("#spider_popup_left").hide()),1==gallery_box_data.ecommerceACtive&&1==gallery_box_data.enable_image_ecommerce)if(0==gallery_box_data.data[a].pricelist)jQuery(".bwg_ecommerce").hide();else{jQuery(".bwg_ecommerce").show(),jQuery(".pge_tabs li").hide(),jQuery("#downloads").hide(),jQuery("#manual").hide();var i=gallery_box_data.data[a].pricelist_sections.split(",");if(i)if(jQuery("#"+i[0]).show(),jQuery("[name=type]").val(i[0]),1<i.length)for(jQuery(".pge_tabs").show(),k=0;k<i.length;k++)jQuery("#"+i[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[a]&&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(a),gallery_box_data.bwg_trans_in_progress)return void gallery_box_data.event_stack.push(e+"-"+a);var _="right";if(bwg_current_key>a)_="left";else if(bwg_current_key==a)return;jQuery(".bwg_image_count").html(r[a].number),jQuery(".bwg_watermark").css({display:"none"}),"width"==gallery_box_data.width_or_height?bwg_current_filmstrip_pos=a*(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=a*(jQuery(".bwg_filmstrip_thumbnail").height()+2+2*gallery_box_data.lightbox_filmstrip_thumb_border_width)),gallery_box_data.bwg_current_key=a,location.replace("#bwg"+gallery_box_data.gallery_id+"/"+r[a].id),history.replaceState(void 0,void 0,"#bwg"+gallery_box_data.gallery_id+"/"+r[a].id),jQuery("#rate_image_id").val(r[a].id),spider_set_input_value("rate_ajax_task","save_hit_count"),spider_rate_ajax_save("bwg_rate_form"),gallery_box_data.popup_enable_rate&&(jQuery("#bwg_star").attr("data-score",r[a].avg_rating),jQuery("#bwg_star").removeAttr("title"),r[a].cur_key=a,bwg_rating(r[a].rate,r[a].rate_count,r[a].avg_rating,a)),jQuery(".bwg_image_hits span").html(++r[a].hit_count),jQuery("#bwg_popup_image").attr("image_id",r[a].id),jQuery(".bwg_image_title").html(jQuery("<span />").html(r[a].alt).text()),jQuery(".bwg_image_description").html(jQuery("<span />").html(r[a].description).text()),jQuery(".bwg_filmstrip_thumbnail").removeClass("bwg_thumb_active").addClass("bwg_thumb_deactive"),jQuery("#bwg_filmstrip_thumbnail_"+a).removeClass("bwg_thumb_deactive").addClass("bwg_thumb_active"),jQuery(".bwg_image_info").css("opacity",1),""==r[a].alt.trim()&&""==r[a].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 s=2==jQuery(".bwg_popup_image_spun").css("zIndex")?".bwg_popup_image_spun":".bwg_popup_image_second_spun",o=".bwg_popup_image_second_spun"==s?".bwg_popup_image_spun":".bwg_popup_image_second_spun",l=-1<r[a].filetype.indexOf("EMBED_"),n=-1<r[a].filetype.indexOf("INSTAGRAM_POST"),g=-1<r[a].filetype.indexOf("INSTAGRAM_VIDEO"),b=-1!==jQuery.inArray(r[a].filetype,["EMBED_OEMBED_YOUTUBE_VIDEO","EMBED_OEMBED_VIMEO_VIDEO","EMBED_OEMBED_FACEBOOK_VIDEO","EMBED_OEMBED_DAILYMOTION_VIDEO"]),w=jQuery(s).height(),d=jQuery(s).width(),u='<span class="bwg_popup_image_spun1" style="display: '+(l?"block":"table")+'; width: inherit; height: inherit;"><span class="bwg_popup_image_spun2" style="display:'+(l?"block":"table-cell")+'; vertical-align: middle;text-align: center;height: 100%;">';if(l){if(jQuery("#bwg_download").addClass("bwg-hidden"),u+='<span class="bwg_popup_embed bwg_popup_watermark" style="display: '+(b?"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>':" "),n){var h=jQuery(".instagram-media"),m=jQuery(".bwg_embed_frame"),c=jQuery(".bwg_image_container").width()-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),p=jQuery(".bwg_image_container").height()-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0),y=r[a].image_width,f=r[a].image_height,j=bwg_resizing_ratio(y,f,c,p);m.attr("data-width",c),m.attr("data-height",p);var Q=j.width,v=j.height;Q<v?Q-=109:Q+=109,u+=spider_display_embed(r[a].filetype,r[a].image_url,r[a].filename,{class:"bwg_embed_frame","data-width":c,"data-height":p,"data-instagram-width":y,"data-instagram-height":f,style:"width:"+Q+"px; height:"+v+"px; vertical-align:middle; display:inline-block; position:relative;"}),h.css({"max-height":v+"px","min-width":Q+"px !important"})}else u+=spider_display_embed(r[a].filetype,r[a].image_url,r[a].filename,{class:"bwg_embed_frame",frameborder:"0",allowfullscreen:"allowfullscreen",style:"display:"+(b?"block":"table-cell")+"; width:inherit; height:inherit; vertical-align:middle;"});u+="</span>"}else{jQuery(".bwg-loading").removeClass("bwg-hidden"),jQuery("#bwg_download").removeClass("bwg-hidden");var x="'"+(gallery_box_data.site_url+jQuery("<span />").html(decodeURIComponent(r[a].image_url)).text()).split("?bwg")[0]+"'";gallery_box_data.popup_enable_zoom&&(u+='<figure style="max-height: '+w+"px; max-width: "+d+"px; background-image: url("+x+'); background-repeat: no-repeat" class="bwg_popup_image bwg_popup_watermark" alt="'+r[a].alt+'" />'),u+='<img style="max-height: '+w+"px; max-width: "+d+'px;" class="bwg_popup_image bwg_popup_watermark" src="'+gallery_box_data.site_url+jQuery("<span />").html(decodeURIComponent(r[a].image_url)).text()+'" alt="'+r[a].alt+'" />'}function z(){gallery_box_data.preload_images&&bwg_preload_images(a),window["bwg_"+gallery_box_data.bwg_image_effect](s,o,_),jQuery(s).find(".bwg_fb_video").each(function(){jQuery(this).attr("src","")}),l?jQuery("#bwg_fullsize_image").attr("href",decodeURIComponent(r[a].image_url)):(jQuery("#bwg_fullsize_image").attr("href",gallery_box_data.site_url+decodeURIComponent(r[a].image_url)),jQuery("#bwg_download").attr("href",gallery_box_data.site_url+decodeURIComponent(r[a].thumb_url).replace("/thumb/","/.original/")));var e=decodeURIComponent(r[a].image_url).split("/");jQuery("#bwg_download").attr("download",e[e.length-1].replace(/\?bwg=(\d+)$/,""));var t=encodeURIComponent(gallery_box_data.bwg_share_url.replace("image_id","image_id="+ +r[a].id));if(l)var i=encodeURIComponent(r[a].thumb_url);else i=gallery_box_data.bwg_share_image_url+encodeURIComponent(encodeURIComponent(r[a].pure_image_url));i=i.replace(/%252F|%25252F/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/intent/tweet?url="+t),jQuery("#bwg_pinterest_a").attr("href","http://pinterest.com/pin/create/button/?s=100&url="+t+"&media="+i+"&description="+r[a].alt+"%0A"+r[a].description),jQuery("#bwg_tumblr_a").attr("href","https://www.tumblr.com/share/photo?source="+i+"&caption="+r[a].alt+"&clickthru="+t),jQuery(".bwg_comment_container").hasClass("bwg_open")&&(jQuery(".bwg_comments .mCSB_container").css("top","0"),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[a].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_slideshow_filmstrip_fix_dimension(),setTimeout(function(){bwg_disable_lightbox_filmstrip_left_right_arrow(gallery_box_data)},100)),bwg_resize_instagram_post()}if(gallery_box_data.popup_enable_zoom?u+="</figure></span></span>":u+="</span></span>",jQuery(o).html(u),jQuery(o).find("img").on("load error",function(){jQuery(".bwg-loading").addClass("bwg-hidden")}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxWidth:d,maxHeight:w,height:"auto"}),l)z();else jQuery(o).find("img").one("load",function(){z()}).each(function(){this.complete&&jQuery(this).load()});"undefined"!=typeof instgrm&&void 0!==instgrm.Embeds&&(jQuery(".instagram-media").hide(),instgrm.Embeds.process(),jQuery(".instagram-media").show())}}function bwg_preload_images_lightbox(e){for(var t=gallery_box_data.data,i=t.length,a=0==gallery_box_data.preload_images_count||gallery_box_data.preload_images_count>=i?i:gallery_box_data.preload_images_count,r=0,_=1;r<a;_++){var s=1;do{var o=(e+_*s+i)%i;if(void 0!==t[o])-1<t[o].filetype.indexOf("EMBED_")||jQuery("<img/>").attr("src",gallery_box_data.site_url+jQuery("<span />").html(decodeURIComponent(t[o].image_url)).text());s*=-1,r++}while(1!=s)}}function bwg_popup_sidebar_open(e){var t=gallery_box_data.lightbox_comment_width,i=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 a=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase());jQuery(".bwg_play_pause").trigger(a?"touchend":"click")}}else jQuery(".spider_popup_close_fullscreen").show();"left"==i?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.current_image_key&&0!=gallery_box_data.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("update",{scrollInertia:150,theme:"dark-thick",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()-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())},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()-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())},100)),bwg_set_filmstrip_pos(jQuery(".spider_popup_wrap").width()-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",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()-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())},100),bwg_set_filmstrip_pos(jQuery(".bwg_filmstrip_container").width()-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",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)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())}),bwg_set_filmstrip_pos(jQuery(window).width()-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",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)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())}),bwg_set_filmstrip_pos(window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",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","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)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())},500),bwg_set_filmstrip_pos(bwg_popup_current_width-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",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)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())},500),bwg_set_filmstrip_pos(bwg_popup_current_height-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data),"horizontal"!=gallery_box_data.filmstrip_direction&&jQuery(".bwg_filmstrip_right").css({top:bwg_popup_current_height-jQuery(".bwg_filmstrip_right").height()})),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),setTimeout(function(){bwg_info_height_set()},500)):(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)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())},500),bwg_set_filmstrip_pos(jQuery(window).width()-("horizontal"==gallery_box_data.filmstrip_direction?e:0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",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)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())},500),bwg_set_filmstrip_pos(window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?e:0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data),"horizontal"!=gallery_box_data.filmstrip_direction&&jQuery(".bwg_filmstrip_right").css({top:window.innerHeight-jQuery(".bwg_filmstrip_right").height()})),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","spider_popup_close_fullscreen")),setTimeout(function(){bwg_info_height_set()},500)}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_image_info").css("height","auto"),bwg_info_height_set(),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-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())})),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_image_info").css("height","auto"),bwg_info_height_set(),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-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())})),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_image_info").css("height","auto"),bwg_info_height_set(),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-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())})),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-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())})),bwg_popup_current_width=jQuery(window).width()),bwg_resize_instagram_post(),bwg_change_watermark_container(),1!=gallery_box_data.open_with_fullscreen&&(gallery_box_data.lightbox_close_btn_right<0&&jQuery("#spider_popup_wrap").width()-2*gallery_box_data.lightbox_close_btn_right>=jQuery(window).width()||gallery_box_data.lightbox_close_btn_top<0&&jQuery("#spider_popup_wrap").height()-2*gallery_box_data.lightbox_close_btn_top>=jQuery(window).height()?jQuery(".spider_popup_close").attr("class","spider_popup_close_fullscreen"):jQuery(".spider_popup_close_fullscreen").attr("class","spider_popup_close"));var t=jQuery(".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,i,a){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.";if(0!=i&&""!=i&&(r=parseFloat(i).toFixed(1)+"\n Votes: "+t),void 0!==jQuery().raty&&jQuery.isFunction(jQuery().raty)){var _=parseFloat(jQuery("#bwg_star").attr("data-score"));jQuery("#bwg_star").removeAttr("data-score").html("");var s={starType:"i",number:lightbox_rate_stars_count,size:lightbox_rate_size,noRatedMsg:"Not rated yet.",readOnly:!1,score:_,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(i).toFixed(1)+"\nYou have already rated.\nVotes: "+t};e||(s.click=function(e,t){jQuery("#bwg_star").hide(),jQuery("#bwg_rated").show(),spider_set_input_value("rate_ajax_task","save_rate"),jQuery.when(spider_rate_ajax_save("bwg_rate_form",e)).then(function(){gallery_box_data.data[a].rate=e,++gallery_box_data.data[a].rate_count,gallery_box_data.data[a].avg_rating=_?((_+e)/2).toFixed(1):e.toFixed(1),bwg_rating(gallery_box_data.data[a].rate,gallery_box_data.data[a].rate_count,gallery_box_data.data[a].avg_rating,gallery_box_data.current_image_key)})}),jQuery("#bwg_star").raty(s),jQuery(".bwg_image_rate_disabled").hide(),e&&jQuery(".bwg_image_rate_disabled").show()}}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()),i=Number(jQuery(".product_manual_price").attr("data-actual-price"));i=(i*=t).toFixed(2).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,"),jQuery(".product_manual_price").html(i)}function onSelectableParametersChange(e){var t=0,i=gallery_box_data.data[jQuery("#bwg_current_image_key").val()].pricelist_manual_price?gallery_box_data.data[jQuery("#bwg_current_image_key").val()].pricelist_manual_price:"0";i=parseFloat(i.replace(",",""));var a=jQuery(e).closest(".image_selected_parameter").attr("data-parameter-type"),r=jQuery(e).val();r=r.split("*");var _=parseFloat(r[1]),s=r[0],o=Number(jQuery(e).closest(".image_selected_parameter").find(".already_selected_values").val());if("4"==a||"5"==a){var l=parseFloat(s+_);jQuery(e).closest(".image_selected_parameter").find(".already_selected_values").val(l)}else if("6"==a){if(0==jQuery(e).is(":checked"))var n=o-parseFloat(s+_);else n=o+parseFloat(s+_);jQuery(e).closest(".image_selected_parameter").find(".already_selected_values").val(n)}jQuery(".already_selected_values").each(function(){t+=Number(jQuery(this).val())}),i+=t,jQuery(".product_manual_price").attr("data-actual-price",i),i=(i*=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(i)}function onBtnClickAddToCart(){var e=jQuery("[name=type]").val();if(""!=e){var t={};if("manual"==e){var i=jQuery(".image_count").val(),a={};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 i=[];jQuery(this).find("[type=checkbox]:checked").each(function(){i.push(jQuery(this).val())}),t=i}a[e]=t}),t.count=i,t.parameters=a,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 _=jQuery("#ajax_url").val(),s={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:_,data:s,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 bwg_load_visible_images(e,t,i){0<=e-t&&(startPoint=e-t),i<e+t&&(endPoint=i);for(var a=startPoint;a<=endPoint;a++){var r=jQuery("#bwg_filmstrip_thumbnail_"+a+" img");r.removeClass("bwg-hidden"),r.attr("src",r.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("bwg-hidden"),t.attr("src",t.data("url"));if(0<=leftIndex)(t=jQuery("#bwg_filmstrip_thumbnail_"+leftIndex+" img")).removeClass("bwg-hidden"),t.attr("src",t.data("url"))}jQuery(".bwg_filmstrip_thumbnail").each(function(){var e=jQuery(this).find("img");void 0===e.attr("style")&&(0==e.width()?e.on("load",function(){jQuery(this).find(".bwg_filmstrip_thumbnail_img_wrap"),bwg_filmstrip_thumb_view(e)}):(jQuery(this).find(".bwg_filmstrip_thumbnail_img_wrap"),bwg_filmstrip_thumb_view(e)))})}function bwg_filmstrip_thumb_view(e){var t=gallery_box_data.image_filmstrip_height,i=gallery_box_data.image_filmstrip_width,a=i-gallery_box_data.filmstrip_thumb_right_left_space,r=t,_=Math.max(i/e.width(),t/e.height()),s=e.width()*_,o=e.height()*_;e.css({width:s,height:o,marginLeft:(a-s)/2,marginTop:(r-o)/2})}function bwg_info_height_set(){bwg_info_position(!1),jQuery(".mCustomScrollBox").length&&jQuery(".bwg_image_info_container1").height()<jQuery(".mCustomScrollBox").height()+jQuery(".bwg_toggle_container").height()+bwg_image_info_pos+2*parseInt(gallery_box_data.lightbox_info_margin)&&jQuery(".bwg_image_info").css({height:jQuery(".bwg_image_info_container1").height()-jQuery(".bwg_toggle_container").height()-bwg_image_info_pos-2*parseInt(gallery_box_data.lightbox_info_margin)})}function bwg_info_position(e){var t=0,i="none";"top"==gallery_box_data.lightbox_ctrl_btn_pos?"top"==gallery_box_data.lightbox_info_pos&&(i="top"):"bottom"==gallery_box_data.lightbox_info_pos&&(i="bottom"),jQuery(".bwg_ctrl_btn_container").hasClass("closed")||("top"==gallery_box_data.lightbox_ctrl_btn_pos?"top"==gallery_box_data.lightbox_info_pos&&(t=jQuery(".bwg_ctrl_btn_container").height()):"bottom"==gallery_box_data.lightbox_info_pos&&(t=jQuery(".bwg_ctrl_btn_container").height())),"top"==i?0==e?jQuery(".bwg_image_info").css("top",t):jQuery(".bwg_image_info").animate({top:t+"px"},500):"bottom"==i&&(0==e?jQuery(".bwg_image_info").css("bottom",t):jQuery(".bwg_image_info").animate({bottom:t+"px"},500))}function bwg_disable_lightbox_filmstrip_left_arrow(e){"left"==e.left_or_top?0==parseInt(jQuery(".bwg_filmstrip_thumbnails").position().left)&&jQuery(".bwg_filmstrip_left").css({opacity:.3}):0==jQuery(".bwg_filmstrip_thumbnails").position().top&&jQuery(".bwg_filmstrip_left").css({opacity:.3})}function bwg_disable_lightbox_filmstrip_right_arrow(e){"left"==e.left_or_top?"width"==e.width_or_height?parseInt(jQuery(".bwg_filmstrip_thumbnails").position().left)<=jQuery(".bwg_filmstrip").width()-jQuery(".bwg_filmstrip_thumbnails").width()+e.filmstrip_thumb_right_left_space+e.all_images_right_left_space&&jQuery(".bwg_filmstrip_right").css({opacity:.3}):jQuery(".bwg_filmstrip_thumbnails").position().left==-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height())&&jQuery(".bwg_filmstrip_right").css({opacity:.3}):"width"==e.width_or_height?jQuery(".bwg_filmstrip_thumbnails").position().left==-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width())&&jQuery(".bwg_filmstrip_right").css({opacity:.3}):parseInt(jQuery(".bwg_filmstrip_thumbnails").position().top)<=jQuery(".bwg_filmstrip").height()-jQuery(".bwg_filmstrip_thumbnails").height()+gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.all_images_right_left_space&&jQuery(".bwg_filmstrip_right").css({opacity:.3})}function bwg_disable_lightbox_filmstrip_left_right_arrow(e){var t=jQuery(".bwg_filmstrip_thumbnails").position().left,i=jQuery(".bwg_filmstrip").width()>jQuery(".bwg_filmstrip_thumbnails").width();"top"==e.left_or_top&&(t=jQuery(".bwg_filmstrip_thumbnails").position().top,i=jQuery(".bwg_filmstrip").height()>jQuery(".bwg_filmstrip_thumbnails").height()),jQuery(".bwg_filmstrip_container .bwg_filmstrip_left").css({opacity:"1"}),jQuery(".bwg_filmstrip_container .bwg_filmstrip_right").css({opacity:"1"}),jQuery(".bwg_filmstrip_thumbnails .bwg_filmstrip_thumbnail:first-child").index()!=jQuery(".bwg_filmstrip_thumbnails .bwg_filmstrip_thumbnail.bwg_thumb_active").index()&&0!=t||jQuery(".bwg_filmstrip_container .bwg_filmstrip_left").css({opacity:"0.3"}),jQuery(".bwg_filmstrip_thumbnails .bwg_filmstrip_thumbnail:last-child").index()==jQuery(".bwg_filmstrip_thumbnails .bwg_filmstrip_thumbnail.bwg_thumb_active").index()&&jQuery(".bwg_filmstrip_container .bwg_filmstrip_right").css({opacity:"0.3"}),jQuery(".bwg_filmstrip").width()>jQuery(".bwg_filmstrip_thumbnails").width()&&jQuery(".bwg_filmstrip_container .bwg_filmstrip_left, .bwg_filmstrip_container .bwg_filmstrip_right").css({opacity:"0.3"}),i&&jQuery(".bwg_filmstrip_container .bwg_filmstrip_left, .bwg_filmstrip_container .bwg_filmstrip_right").css({opacity:"0.3"})}function spider_display_embed(e,t,i,a){var r="";switch(e){case"EMBED_OEMBED_YOUTUBE_VIDEO":var _="<iframe ";for(attr in""!=i&&(_+=' src="//www.youtube.com/embed/'+(i=i.replace("?t","?start"))+(-1!==i.indexOf("?")?"&":"?")+'enablejsapi=1&wmode=transparent"'),a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(_+=" "+attr+'="'+a[attr]+'"');r+=_+=" ></iframe>";break;case"EMBED_OEMBED_VIMEO_VIDEO":var s="<iframe ";for(attr in""!=i&&(s+=' src="//player.vimeo.com/video/'+i+'?enablejsapi=1"'),a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(s+=" "+attr+'="'+a[attr]+'"');r+=s+=" ></iframe>";break;case"EMBED_OEMBED_FLICKR_IMAGE":var o="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(o+=" "+attr+'="'+a[attr]+'"');o+=" >",""!=i&&(o+='<img src="'+i+'" style="max-width:100% !important; max-height:100% !important; width:auto !important; height:auto !important;">'),r+=o+="</div>";break;case"EMBED_OEMBED_FLICKR_VIDEO":break;case"EMBED_OEMBED_INSTAGRAM_VIDEO":var l="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(l+=" "+attr+'="'+a[attr]+'"');l+=" >",""!=t&&(l+='<video style="width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;" controls><source src="'+decodeURIComponent(t)+'" type="video/mp4"> Your browser does not support the video tag. </video>'),r+=l+="</div>";break;case"EMBED_OEMBED_INSTAGRAM_IMAGE":var n=a["data-max-width"],g=a["data-max-height"];l="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(l+=" "+attr+'="'+a[attr]+'"');l+=" >",""!=t&&(l+='<img src="'+decodeURIComponent(t)+'" style="max-width:'+n+"px; max-height:"+g+'px; width: auto; height: auto">'),r+=l+="</div>";break;case"EMBED_OEMBED_INSTAGRAM_POST":l="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(l+=" "+attr+'="'+a[attr]+'"',"CLASS"!=attr&&"class"!=attr&&"Class"!=attr||(obj_class=a[attr]));l+=">",""!=t&&(l+='<div class="inner_instagram_iframe_'+obj_class+'" style="max-width: 100% !important; max-height: 100% !important; width: 100%; height: 100%; margin:0; vertical-align:middle;">'+atob(t)+"</div>"),r+=l+="</div>";break;case"EMBED_OEMBED_FACEBOOK_IMAGE":var b="<span ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(b+=" "+attr+'="'+a[attr]+'"');b+=" >",""!=i&&(b+='<img src="'+t+'" style=" max-width:100% !important; max-height:100% !important; width:auto; height:100%;">'),r+=b+="</span>";break;case"EMBED_OEMBED_FACEBOOK_VIDEO":var w="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(w+=" "+attr+'="'+a[attr]+'"');w+=" >",""!=i&&(w+='<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+=w+="</div>";break;case"EMBED_OEMBED_DAILYMOTION_VIDEO":var d="<iframe ";for(attr in""!=i&&(d+=' src="//www.dailymotion.com/embed/video/'+i+'?api=postMessage"'),a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(d+=" "+attr+'="'+a[attr]+'"');r+=d+=" ></iframe>";break;case"EMBED_OEMBED_IMGUR":var u="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(l+=" "+attr+'="'+a[attr]+'"');u+=" >",""!=i&&(u+='<img src="'+i+'" style="max-width:100% !important; max-height:100% !important; width:auto; height:auto !important;">'),r+=u+="</div>";break;case"EMBED_OEMBED_GOOGLE_PHOTO_IMAGE":var h="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(h+=" "+attr+'="'+a[attr]+'"');h+=" >",""!=i&&(h+='<img src="'+t+'" style=" max-width:100% !important; max-height:100% !important; width:auto; height:auto;">'),r+=h+="</div>";break;default:var m={content:""};jQuery(document).trigger("bwg_display_embed",[m,e,t,i,a]),r=m.content}return r}function bwg_add_instagram_gallery(e,s){if(!0===(s=void 0!==s&&s)){if(bwg_check_instagram_gallery_input(e,s))return!1;var t="0";1==jQuery("input[name=popup_instagram_post_gallery]:checked").val()&&(t="1");var i=encodeURI(jQuery("#popup_instagram_gallery_source").val()),a=encodeURI(jQuery("#popup_instagram_image_number").val())}else{if(bwg_check_instagram_gallery_input(e,s))return!1;if(!bwg_check_gallery_empty(!1,!0))return!1;t="0";1==jQuery("input[name=instagram_post_gallery]:checked").val()&&(t="1");i=encodeURI(jQuery("#gallery_source").val());var r=jQuery("input[name=update_flag]:checked").val();a=encodeURI(jQuery("#autogallery_image_number").val())}jQuery("#bulk_embed").hide(),jQuery("#loading_div").show();var o=[],_={action:"addInstagramGallery",instagram_user:i,instagram_access_token:e,whole_post:t,autogallery_image_number:a,update_flag:r,async:!0};jQuery.post(bwg_ajax_url_nonce,_,function(e){if(0==e)return alert("Error: cannot get response from the server."),jQuery("#loading_div").hide(),s&&jQuery("#bulk_embed").show(),!1;var t=e.indexOf("WD_delimiter_start"),i=e.indexOf("WD_delimiter_end");if(-1==t||-1==i)return jQuery("#loading_div").hide(),s&&jQuery("#bulk_embed").show(),!1;if(e=e.substring(t+18,i),response_JSON=JSON.parse(e),response_JSON){if("error"==response_JSON[0])return alert("Error: "+JSON.parse(e)[1]),jQuery("#loading_div").hide(),s&&jQuery("#bulk_embed").show(),!1;for(var a=response_JSON.length,r=1;r<=a;r++)if(0!=response_JSON[a-r]){var _=response_JSON[a-r];o.push(_)}return bwg_add_image(o,"instagram"),s||(bwg_gallery_update_flag(),jQuery("#tr_instagram_gallery_add_button").hide()),jQuery("#loading_div").hide(),s&&jQuery(".opacity_bulk_embed").hide(),"ok"}return alert("There is some error. Cannot add Instagram gallery."),jQuery("#loading_div").hide(),s&&jQuery("#bulk_embed").show(),!1})}var bwg=0,isMobile=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()),bwg_click=isMobile?"touchend":"click",bwg_slideshow_filmstrip_thumbnail_timer=!1;window.bwg_slideshow_filmstrip_thumb={};var bwg_params=[],bwg_params_ib=[],bwg_params_carousel=[];function bwg_remove_lazy_loader_icon(){1==bwg_objectsL10n.lazy_load&&jQuery("img.bwg_lazyload").Lazy({afterLoad:function(){jQuery(".lazy_loader").removeClass("lazy_loader")},onFinishedAll:function(){jQuery(".lazy_loader").removeClass("lazy_loader")}})}function bwg_main_ready(e){var t=e.data("bwg");1===e.data("scroll")&&(form_id="gal_front_form_"+t,jQuery("html, body").animate({scrollTop:jQuery("#"+form_id).offset().top-150},500)),bwg_remove_lazy_loader_icon(),0<e.find(".wd_error").length&&bwg_container_loaded(t);var i=e.find(".bwg-container");if("album"===e.data("is-album")&&i.hasClass("bwg-thumbnails"))var a="thumbnails";else a=e.data("gallery-type");switch(bwg_document_ready(e),a){case"thumbnails":case"thumbnails_masonry":case"album_compact_preview":case"album_masonry_preview":case"album_extended_preview":bwg_all_thumnails_loaded(i);break;case"thumbnails_mosaic":bwg_thumbnail_mosaic(i);break;case"slideshow":bwg_slideshow_ready(t);break;case"carousel":bwg_carousel_ready(t),bwg_carousel_onload(e);break;case"image_browser":bwg_image_browser_ready(e);break;case"blog_style":bwg_blog_style_ready(e)}}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_tags_button_section_visibility(){jQuery('div[id^="bwg_container1_"]').each(function(){var e=jQuery(this),t=e.find(".current_view").val(),i=e.find(".show_bottom_tag").val(),a=e.find(".bwg_tags_container_"+t+" .bwg_tag_button_view_container");if(a.length)var r=a[0].scrollHeight;var _=a.find(".bwg_tags_filter_buttons").outerHeight(!0),s=parseInt(2*a.find(".bwg_tags_filter_buttons").outerHeight(!0)+3);s<r?(0===jQuery(this).find(".see_all_tags.bwg_hide").length&&a.css({"min-height":_,"max-height":s,overflow:"hidden"}),a.next(".bwg_tag_button_see_all").show()):(a.css({"min-height":"auto","max-height":"100%",height:"auto",overflow:"visible"}),a.next(".bwg_tag_button_see_all").hide());var o=a.next().find(".see_all_tags").width()/2;a.next().find(".see_all_tags").attr("style","margin-left: -"+o+"px"),a.next().find(".see_all_tags").off("click").on("click",function(){jQuery(this).hasClass("bwg_show")?(jQuery(this).removeClass("bwg_show").addClass("bwg_hide").html("<span>&#8722;</span>"+bwg_objectsL10n.bwg_tag_see_less),a.css({"min-height":"auto","max-height":"100%",height:"auto",overflow:"visible"})):jQuery(this).hasClass("bwg_hide")&&(jQuery(this).removeClass("bwg_hide").addClass("bwg_show").html("<span>&#43;</span>"+bwg_objectsL10n.bwg_tag_see_all),a.css({"min-height":_,"max-height":s,overflow:"hidden"}))}),1==i&&(jQuery(this).find(".see_all_tags").removeClass("bwg_show").addClass("bwg_hide").html("<span>&#8722;</span>"+bwg_objectsL10n.bwg_tag_see_less),a.css({"min-height":"auto","max-height":"100%",height:"auto",overflow:"visible"}))})}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());var t=(jQuery(this).width()-16)*jQuery(this).attr("data-height")/jQuery(this).attr("data-width")+96;jQuery(this).height(t),jQuery(this).find('iframe[id^="instagram-embed-"]').css({"max-height":t+"px"})})})}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());var t=(jQuery(this).width()-16)*jQuery(this).attr("data-height")/jQuery(this).attr("data-width")+96;jQuery(this).height(t),jQuery(this).find('iframe[id^="instagram-embed-"]').css({"max-height":t+"px"})}),bwg_container_loaded(bwg)})}function bwg_blog_style_ready(t){var e=t.data("bwg");bwg_container_loaded(e),"undefined"!=typeof instgrm&&void 0!==instgrm.Embeds&&instgrm.Embeds.process();var i=!1;t.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"),!i)return i=!0,setTimeout(function(){i=!1},100),bwg_gallery_box(e,t.closest(".bwg_container")),!1}),jQuery(".bwg_lightbox_"+e+" .bwg_ecommerce").on("click",function(e){if(e.stopPropagation(),!i)return i=!0,setTimeout(function(){i=!1},100),bwg_gallery_box(t.attr("data-image-id"),t.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).data("bwg"),jQuery(".bwg_slideshow[data-bwg="+bwg+"]")[0].offsetHeight&&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_carousel_focus(){jQuery(".bwg_carousel").each(function(){bwg=jQuery(this).data("bwg"),jQuery(".bwg_carousel[data-bwg="+bwg+"]")[0].offsetHeight&&jQuery(".bwg_carousel_image_container_"+bwg).length&&jQuery(".bwg_ctrl_btn_"+bwg).hasClass("bwg-icon-pause")&&bwg_params_carousel[bwg].carousel.start()})}function bwg_slideshow_blur(e){jQuery(".bwg_slideshow").each(function(){bwg=jQuery(this).data("bwg"),!e&&jQuery(".bwg_slideshow[data-bwg="+bwg+"]")[0].offsetHeight||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_blur(e){jQuery(".bwg_carousel").each(function(){bwg=jQuery(this).data("bwg"),!e&&jQuery(".bwg_carousel[data-bwg="+bwg+"]")[0].offsetHeight||jQuery(".bwg_carousel_image_container_"+bwg).length&&void 0!==bwg_params_carousel[bwg]&&bwg_params_carousel[bwg].carousel.pause()})}function bwg_carousel_ready(t){if(bwg_params_carousel[t]=[],bwg_params_carousel[t].bwg_currentCenterNum=1,bwg_params_carousel[t].bwg_currentlyMoving=!1,bwg_params_carousel[t].data=[],"undefined"!=typeof instgrm&&void 0!==instgrm.Embeds){var e=jQuery(".bwg_embed_frame_"+t),i=e.data("height");e.css({display:"none"}),instgrm.Embeds.process(),jQuery(".bwg_embed_frame_"+t+" #instagram-embed-"+t).css({"max-height":i+"px"}),e.css({display:"inline-block"})}jQuery("#spider_carousel_left-ico_"+t).on("click",function(e){bwg_params_carousel[t].carousel.prev(),e.stopPropagation(),e.stopImmediatePropagation()}),jQuery("#spider_carousel_right-ico_"+t).on("click",function(e){bwg_params_carousel[t].carousel.next(),e.stopPropagation(),e.stopImmediatePropagation()}),parseInt(bwg_params_carousel[t].carousel_enable_autoplay)&&(jQuery(".bwg_carousel_play_pause_"+t).attr("title",bwg_objectsL10n.pause),jQuery(".bwg_carousel_play_pause_"+t).attr("class","bwg-icon-pause bwg_ctrl_btn_"+t+" bwg_carousel_play_pause_"+t)),jQuery(".bwg_carousel_play_pause_"+t).on(bwg_click,function(e){jQuery(".bwg_ctrl_btn_"+t).hasClass("bwg-icon-play")?(jQuery(".bwg_carousel_play_pause_"+t).attr("title",bwg_objectsL10n.pause),jQuery(".bwg_carousel_play_pause_"+t).attr("class","bwg-icon-pause bwg_ctrl_btn_"+t+" bwg_carousel_play_pause_"+t),bwg_params_carousel[t].carousel.start()):(jQuery(".bwg_carousel_play_pause_"+t).attr("title",bwg_objectsL10n.play),jQuery(".bwg_carousel_play_pause_"+t).attr("class","bwg-icon-play bwg_ctrl_btn_"+t+" bwg_carousel_play_pause_"+t),bwg_params_carousel[t].carousel.pause()),e.stopPropagation(),e.stopImmediatePropagation()}),jQuery("#bwg_container1_"+t).on("swiperight",function(){bwg_params_carousel[t].carousel.prev()}),jQuery("#bwg_container1_"+t).on("swipeleft",function(){bwg_params_carousel[t].carousel.next()})}function bwg_carousel_resize(){jQuery(".bwg-carousel").each(function(){var e=jQuery(this).data("bwg");jQuery(".bwg_carousel-container"+e).length&&(bwg_carousel_params(e,!0),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(e){var t=e.data("bwg"),i=e.find(".bwg_carousel-container"+t);i.length&&(bwg_params_carousel[t]=i.data("params"),bwg_params_carousel[t].parent_width=0,bwg_carousel_watermark(t),bwg_carousel_params(t,!1),bwg_container_loaded(t))}function bwg_carousel_params(t,e){var i=jQuery("#bwg_container1_"+t).parent();i.hasClass("elementor-tab-content")&&i.width(i.closest(".elementor-widget-wrap").width());var a=i.width(),r=1;a<bwg_params_carousel[t].carousel_r_width?r=a/bwg_params_carousel[t].carousel_r_width:a=bwg_params_carousel[t].carousel_r_width,bwg_params_carousel[t].parent_width!=a&&(bwg_params_carousel[t].parent_width=a,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*r),e.width((e.height()-96)*e.attr("data-width")/e.attr("data-height")+16)):(e.width(bwg_params_carousel[t].image_width*r),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*r,height:bwg_params_carousel[t].image_height*r}),jQuery(".bwg_carousel_watermark_text_"+t+", .bwg_carousel_watermark_text_"+t+":hover").css({fontSize:a*(bwg_params_carousel[t].watermark_font_size/bwg_params_carousel[t].image_width)*r}),jQuery(".bwg_carousel-image "+t).css({width:bwg_params_carousel[t].image_width*r,height:bwg_params_carousel[t].image_height*r}),jQuery(".bwg_carousel_watermark_container_"+t).css({width:bwg_params_carousel[t].image_width*r,height:bwg_params_carousel[t].image_height*r}),jQuery(".bwg_carousel_embed_video_"+t).css({width:bwg_params_carousel[t].image_width*r,height:bwg_params_carousel[t].image_height*r}),jQuery(".bwg_carousel_watermark_spun_"+t).css({width:bwg_params_carousel[t].image_width*r,height:bwg_params_carousel[t].image_height*r}),jQuery(".bwg_carousel-container"+t).css({width:a,height:bwg_params_carousel[t].image_height*r}),jQuery(".bwg_video_hide"+t).css({width:bwg_params_carousel[t].image_width*r,height:bwg_params_carousel[t].image_height*r}),bwg_params_carousel[t].carousel&&!e||(e&&bwg_params_carousel[t].carousel&&bwg_params_carousel[t].carousel.pause(),bwg_params_carousel[t].carousel=jQuery("#bwg_carousel"+t).featureCarousel({containerWidth:a*r,containerHeight:bwg_params_carousel[t].image_height*r,fit_containerWidth:bwg_params_carousel[t].carousel_fit_containerWidth,largeFeatureWidth:bwg_params_carousel[t].image_width*r,largeFeatureHeight:bwg_params_carousel[t].image_height*r,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,i=jQuery("#bwg_container1_"+e).parent().width();if(i<bwg_params_carousel[e].carousel_r_width&&(t=i/bwg_params_carousel[e].carousel_r_width),i>=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 a=bwg_params_carousel[e].image_width/t;bwg_carousel_change_watermark_container(e),jQuery(".bwg_carousel_watermark_image_"+e).css({maxWidth:i*bwg_params_carousel[e].watermark_width/a,maxHeight:i*bwg_params_carousel[e].watermark_height/a}),jQuery(".bwg_carousel_watermark_text_"+e+", .bwg_carousel_watermark_text_"+e+":hover").css({fontSize:i*bwg_params_carousel[e].watermark_font_size/a})}}function bwg_carousel_change_watermark_container(a){jQuery(".bwg_carousel"+a).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(),i=e.height();jQuery(".bwg_carousel_watermark_spun_"+a).width(t),jQuery(".bwg_carousel_watermark_spun_"+a).height(i),jQuery(".bwg_carousel_title_spun_"+a).width(t),jQuery(".bwg_carouel_title_spun_"+a).height(i),jQuery(".bwg_carousel_watermark_"+a).css({display:"none"})}})}function bwg_carousel_preload(e,t){var i=jQuery(".bwg_carousel_preload").get();t||i.reverse();var a=0;jQuery(i).each(function(){if(1<++a)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(r){if(jQuery("#bwg_slideshow_image_container_"+r).length){bwg_params[r]=JSON.parse(jQuery("#bwg_slideshow_image_container_"+r).attr("data-params")),bwg_params[r].event_stack=[];var e=".bwg_slideshow_filmstrip_"+r,t="bwg_slideshow_filmstrip_thumbnail_"+r;bwg_slideshow_filmstrip_thumb[t]={},bwg_slideshow_filmstrip_thumb[t].next_prev_index=0;var i=!1;2==bwg_params[r].slideshow_filmstrip_type&&(i=!0,e=".bwg_slideshow_filmstrip_fix_count_"+r),bwg_container_loaded(r);var a=bwg_params[r].data;jQuery("#bwg_container1_"+r).on("swiperight",function(){return bwg_change_image(parseInt(jQuery("#bwg_current_image_key_"+r).val()),0<=parseInt(jQuery("#bwg_current_image_key_"+r).val())-bwg_iterator(r)?(parseInt(jQuery("#bwg_current_image_key_"+r).val())-bwg_iterator(r))%a.length:a.length-1,a,"",r),!1}),jQuery("#bwg_container1_"+r).on("swipeleft",function(){return bwg_change_image(parseInt(jQuery("#bwg_current_image_key_"+r).val()),parseInt(jQuery("#bwg_current_image_key_"+r).val())+bwg_iterator(r)%a.length,a,"",r),!1});var _=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())?"touchend":"click";bwg_popup_resize(r),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"}),setTimeout(function(){bwg_change_watermark_container(r)},500),1==bwg_params[r].slideshow_filmstrip_type&&("horizontal"==bwg_params[r].filmstrip_direction?jQuery(".bwg_slideshow_image_container_"+r).height(jQuery(".bwg_slideshow_image_wrap_"+r).height()-bwg_params[r].slideshow_filmstrip_height):jQuery(".bwg_slideshow_image_container_"+r).width(jQuery(".bwg_slideshow_image_wrap_"+r).width()-bwg_params[r].slideshow_filmstrip_width));var s=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel";jQuery(e).bind(s,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_"+r).trigger("click"):jQuery(".bwg_slideshow_filmstrip_right_"+r).trigger("click"),!1});var o={bwg:r,params:bwg_params[r],slideshow_filmstrip_class_name:e};if(jQuery(".bwg_slideshow_filmstrip_right_"+r).on(_,function(){1==i?!1===bwg_slideshow_filmstrip_thumbnail_timer&&(bwg_slideshow_filmstrip_thumbnail_timer=!0,bwg_slideshow_filmstrip_next(o),setTimeout(function(){bwg_slideshow_filmstrip_thumbnail_timer=!1},505)):bwg_slideshow_filmstrip_next(o)}),jQuery(".bwg_slideshow_filmstrip_left_"+r).on(_,function(){1==i?!1===bwg_slideshow_filmstrip_thumbnail_timer&&(bwg_slideshow_filmstrip_thumbnail_timer=!0,bwg_slideshow_filmstrip_prev(o),setTimeout(function(){bwg_slideshow_filmstrip_thumbnail_timer=!1},505)):bwg_slideshow_filmstrip_prev(o)}),"width"==bwg_params[r].width_or_height?bwg_set_filmstrip_pos(jQuery(e).width(),r):bwg_set_filmstrip_pos(jQuery(e).height(),r),jQuery("#bwg_slideshow_play_pause_"+r).off(_).on(_,function(){jQuery(".bwg_ctrl_btn_"+r).hasClass("bwg-icon-play")?(bwg_play(bwg_params[r].data,r),jQuery(".bwg_slideshow_play_pause_"+r).attr("title",bwg_objectsL10n.pause),jQuery(".bwg_slideshow_play_pause_"+r).attr("class","bwg-icon-pause bwg_ctrl_btn_"+r+" bwg_slideshow_play_pause_"+r),1==bwg_params[r].enable_slideshow_music&&document.getElementById("bwg_audio_"+r).play()):(window.clearInterval(window["bwg_playInterval"+r]),jQuery(".bwg_slideshow_play_pause_"+r).attr("title","Play"),jQuery(".bwg_slideshow_play_pause_"+r).attr("class","bwg-icon-play bwg_ctrl_btn_"+r+" bwg_slideshow_play_pause_"+r),1==bwg_params[r].enable_slideshow_music&&document.getElementById("bwg_audio_"+r).pause())}),0!=bwg_params[r].enable_slideshow_autoplay&&(bwg_play(bwg_params[r].data,r),jQuery(".bwg_slideshow_play_pause_"+r).attr("title",bwg_objectsL10n.pause),jQuery(".bwg_slideshow_play_pause_"+r).attr("class","bwg-icon-pause bwg_ctrl_btn_"+r+" bwg_slideshow_play_pause_"+r),1==bwg_params[r].enable_slideshow_music&&jQuery("#bwg_audio_"+r).length&&document.getElementById("bwg_audio_"+r).play()),bwg_params[r].preload_images&&bwg_preload_images(parseInt(jQuery("#bwg_current_image_key_".$bwg).val()),r),jQuery(".bwg_slideshow_image_"+r).removeAttr("width"),jQuery(".bwg_slideshow_image_"+r).removeAttr("height"),jQuery("#instagram-embed-"+r).hide(),"undefined"!=typeof instgrm&&void 0!==instgrm.Embeds){var l=jQuery(".bwg_embed_frame_"+r),n=l.data("height");l.css({display:"none"}),instgrm.Embeds.process(),jQuery(".bwg_embed_frame_"+r+" #instagram-embed-"+r).css({"max-height":n+"px"}),l.css({display:"inline-block"})}if(0<jQuery(".elementor-editor-active .bwg_embed_frame_"+r).length){!function e(){var t=jQuery(document).find(".bwg_embed_frame_"+r+" iframe");if(0<t.length){var i=jQuery(".bwg_embed_frame_"+r),a=i.data("height");return void t.css({"max-height":a+"px"})}window.setTimeout(e,500)}()}}}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(e){var t=e.data("bwg");bwg_container_loaded(t),"undefined"!=typeof instgrm&&void 0!==instgrm.Embeds&&instgrm.Embeds.process(),jQuery(".image_browser_images_conteiner_"+t).length&&(bwg_params_ib[t]=JSON.parse(jQuery(".image_browser_images_conteiner_"+t).attr("data-params")),setTimeout(function(){bwg_image_browser(t)},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("bwg-hidden"),jQuery(e).parent().find(".bwg_search_loupe_container1").removeClass("bwg-hidden")}function bwg_all_thumnails_loaded(t){var i=0,a=jQuery(t).find("img").length;return 0==a?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(){++i>=a&&bwg_all_thumbnails_loaded_callback(t)})}),jQuery(".bwg_container").each(function(){var e=jQuery(this).data("bwg");0<jQuery(this).find(".wd_error").length&&bwg_container_loaded(e)}),0==a}function bwg_all_thumbnails_loaded_callback(e){jQuery(e).hasClass("bwg-thumbnails")&&!jQuery(e).hasClass("bwg-masonry-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_album_thumbnail(e){bwg_container_loaded(jQuery(e).data("bwg"))}function bwg_album_extended(e){var t=jQuery(e).width(),i=jQuery(e).data("thumbnail-width"),a=jQuery(e).data("spacing"),r=jQuery(e).data("max-count"),_=parseInt(t/(2*i));_<1&&(_=1),r<_&&(_=r);var s=100/_,o=jQuery(e).find(".bwg-extended-item"),l=parseInt(o.css("margin-left")),n=parseInt(o.css("margin-right"));o.css({width:"calc("+s+"% - "+(l+n)+"px)"}),o.width()<i?o.find(".bwg-extended-item0, .bwg-extended-item1").css({width:"calc(100% - "+a+"px)"}):o.width()>2*i?(o.find(".bwg-extended-item0").css({width:"calc(50% - "+a+"px)"}),o.find(".bwg-extended-item1").css({width:"calc(100% - "+(i+2*a)+"px)"})):o.find(".bwg-extended-item0, .bwg-extended-item1").css({width:"calc(50% - "+a+"px)"}),jQuery(e).children(".bwg-extended-item").each(function(){var e=jQuery(this).find("img"),t=jQuery(this).find(".bwg-item0"),i=jQuery(this).find(".bwg-item2"),a=e.data("width"),r=e.data("height");""!=a&&""!=r||(a=e.width(),r=e.height());var _=a/r;i.width()/i.height()>a/r?(i.width()>a?e.css({width:"100%",height:i.width()/_}):e.css({maxWidth:"100%",height:i.width()/_}),a=i.width(),r=i.width()/_):(i.height()>r?e.css({height:"100%",width:i.height()*_,maxWidth:"initial"}):e.css({maxHeight:"100%",width:i.height()*_,maxWidth:"initial"}),r=i.height(),a=i.height()*_),jQuery(this).find(".bwg-item2").css({marginLeft:(t.width()-a)/2,marginTop:(t.height()-r)/2})}),bwg_container_loaded(jQuery(e).data("bwg"))}function bwg_thumbnail(e){var t=jQuery(e).width(),i=jQuery(e).data("thumbnail-width"),a=jQuery(e).data("max-count"),r=parseInt(t/i)+1;a<r&&(r=a);var _=100/r;jQuery(e).find(".bwg-item").css({width:_+"%"}),jQuery(e).children(".bwg-item").each(function(){var e=jQuery(this).find("img"),t=jQuery(this).find(".bwg-item2"),i=jQuery(this).find(".bwg-item1"),a=0<t.width()?t.width():i.width(),r=0<t.height()?t.height():i.height(),_=e.data("width"),s=e.data("height");""!=_&&""!=s&&void 0!==_&&void 0!==s||(_=e.width(),s=e.height());var o=_/s;e.removeAttr("style"),o<a/r?(_<a?e.css({width:"100%",height:a/o}):e.css({maxWidth:"100%",height:Math.ceil(a/o)}),s=(_=a)/o):(r>e.height()?e.css({height:"100%",width:r*o,maxWidth:"initial"}):e.css({maxHeight:"100%",width:r*o,maxWidth:"initial"}),_=(s=r)*o),jQuery(this).find(".bwg-item2").css({marginLeft:(a-_)/2,marginTop:(r-s)/2})}),bwg_container_loaded(jQuery(e).data("bwg"))}function bwg_thumbnail_masonry(e){var t="#bwg_thumbnails_masonry_"+(bwg=jQuery(e).attr("data-bwg"));jQuery("#bwg_album_masonry_"+bwg).length&&(t="#bwg_album_masonry_"+bwg),0===jQuery(".bwg-container-temp"+bwg).length&&(jQuery(t).clone().appendTo("#bwg_container3_"+bwg).removeAttr("id").removeClass("bwg-container-"+bwg).addClass("bwg-container-temp"+bwg),jQuery(".bwg-container-temp"+bwg).empty());var a=jQuery(".bwg-container-temp"+bwg),r=jQuery(t),_=a;if(a.prepend(r.html()),_.find(".bwg-empty-item").remove(),"horizontal"==_.data("masonry-type")){var s=_.data("thumbnail-height"),o=_.data("max-count"),l=[];for(i=0;i<o;i++)l.push(0);_.find(".bwg-item").each(function(){var e=l.indexOf(Math.min.apply(Math,l));jQuery(this).css({height:s,order:e+1}),l[e]+=jQuery(this)[0].getBoundingClientRect().width});var n=Math.max.apply(Math,l);for(_.width(n),i=0;i<o;i++)l[i]<n&&_.append(jQuery('<div class="bwg-item bwg-empty-item"></div>').css({height:s,order:i+1,width:n-l[i]}))}else{_.removeAttr("style");n=_.width();var g=_.data("thumbnail-width"),b=_.data("thumbnail-border"),w=(_.data("thumbnail-padding"),o=_.data("max-count"),parseInt(n/g)+("0"==_.data("resizable-thumbnails")?0:1));o<w&&(w=o);var d=_.find(".bwg-item").length;d<w&&(w=d);var u,h,m=100/w,c=[];for(i=0;i<w;i++)c.push(0);_.find(".bwg-item").each(function(){var e=c.indexOf(Math.min.apply(Math,c)),t=jQuery(this).find("img");if(jQuery(this).css({width:m+"%",order:e+1}),void 0!==t.data("src")&&-1===t.data("src").indexOf("svg")&&0<t.attr("data-width").length&&0<t.attr("data-height").length){h=parseInt(t.data("width"))/parseInt(t.data("height")),u=t.width()/h;var i=(this.querySelector("a .bwg-zoom-effect-overlay .bwg-title2")||!this.querySelector("a .bwg-title1 .bwg-title2")?0:this.querySelector("a .bwg-title1 .bwg-title2").getClientRects()[0].height)+(0<jQuery(this).find(".bwg-masonry-thumb-description").length?jQuery(this).find(".bwg-masonry-thumb-description").height():0);jQuery(this).height(Math.floor(u+i+2*b))}c[e]+=jQuery(this)[0].getBoundingClientRect().height});var p=Math.max.apply(Math,c);for(i=0;i<w;i++)c[i]<p&&_.append(jQuery('<div class="bwg-item bwg-empty-item"></div>').css({width:m+"%",order:i+1,height:p-c[i]}));_.outerWidth(w*(g+2*b)),_.height(p)}if(""!=a.html()){r.outerWidth(w*(g+2*b)),"0"!=p?(r.css("opacity","1"),r.height(p)):r.css("opacity","0"),r.empty();var y=a.html();r.append(y),r.find(".bwg_lazyload").each(function(){null!=jQuery(this).data("src")&&""!=jQuery(this).data("src")&&(jQuery(this).attr("src",jQuery(this).data("src")),jQuery(this).on("load",function(){jQuery(this).removeClass("lazy_loader")}))}),a.empty().hide()}bwg_container_loaded(_.data("bwg"))}function bwg_container_loaded(e){jQuery("#gal_front_form_"+e).removeClass("bwg-hidden"),jQuery("#ajax_loading_"+e).addClass("bwg-hidden"),jQuery(".bwg_container img").removeAttr("width").removeAttr("height")}function bwg_thumbnail_mosaic_logic(e){var t=e.attr("data-bwg"),i=e.attr("data-block-id"),a=parseInt(e.attr("data-thumb-padding"))/2,_=parseInt(e.attr("data-thumb-border"))+a;if("horizontal"==e.attr("data-mosaic-direction")){var r=parseInt(e.attr("data-height"));if("1"==e.attr("data-resizable"))if(1920<=jQuery(window).width())var s=(1+jQuery(window).width()/1920)*r;else if(jQuery(window).width()<=640)s=jQuery(window).width()/640*r;else s=r;else s=r;(p=jQuery(".bwg_mosaic_thumb_"+t)).each(function(e){var t=jQuery(this).data("width"),i=jQuery(this).data("height");""!=t&&""!=i&&void 0!==t&&void 0!==i||(t=p.get(e).naturalWidth,i=p.get(e).naturalHeight),t=t*s/i,p.eq(e).css({cssText:"width:"+t+"px !important; height:"+s+"px !important;"})});var o=jQuery("#bwg_mosaic_thumbnails_div_"+t).width()/100*parseInt(e.attr("data-total-width"));jQuery("#"+i).width(o);var l=s+2*_,n=0,g=[];g[0]=0;var b=[],w=b[0]=0;p.each(function(e){row_cum_width2=w+p.eq(e).width()+2*_,row_cum_width2-o<0?(w=row_cum_width2,g[e]=n,b[n]++):e!==p.length-1?Math.abs(w-o)>Math.abs(row_cum_width2-o)||Math.abs(w-o)<=Math.abs(row_cum_width2-o)&&0==b[n]?e!==p.length-2?(w=row_cum_width2,g[e]=n,b[n]++,b[++n]=0,w=0):(w=row_cum_width2,g[e]=n,b[n]++):(b[++n]=1,g[e]=n,w=row_cum_width2-w):(w=row_cum_width2,g[e]=n,b[n]++)});for(var d=[],u=[],h=0;h<=n;h++)w=0,p.each(function(e){g[e]==h&&(w+=p.eq(e).width())}),d[h]=C=(o-2*b[h]*_)/w,u[h]=(l-2*_)*d[h]+2*_;if(0==n)for(h=0;h<=n;h++)u[h]>s&&(d[h]=1,u[h]=l);(T=[])[0]=0;var m=[],c=[];m[0]=0,c[0]=0;for(h=1;h<=n;h++)m[h]=m[0],c[h]=c[h-1]+u[h-1];p.each(function(e){var t=p.eq(e).width(),i=p.eq(e).height(),a=t*d[g[e]],r=i*d[g[e]];p.eq(e).css({cssText:"width:"+a+"px !important; height:"+r+"px !important;"}),p.eq(e).parent().css({top:c[g[e]],left:m[g[e]]}),m[g[e]]+=t*d[g[e]]+2*_,T[g[e]]=e}),jQuery("#"+i).height(c[n]+u[n]-c[0])}else{var p,y=parseInt(e.attr("data-width"));if("1"==e.attr("data-resizable")){if(1920<=jQuery(window).width())var f=(1+jQuery(window).width()/1920)*y;else if(jQuery(window).width()<=640)f=jQuery(window).width()/640*y;else f=y;if(0<jQuery(".header-content-with_tab").length)f=jQuery(".header-content-with_tab").width()/4-10}else{f=y;var j=jQuery(".bwg_container").width();void 0!==j&&j<y&&(f=j)}(p=jQuery(".bwg_mosaic_thumb_"+t)).each(function(e){jQuery(this).removeAttr("style"),jQuery(this).parent().removeAttr("style");var t=jQuery(this).data("width"),i=jQuery(this).data("height");""!=t&&""!=i&&void 0!==t&&void 0!==i||(t=p.get(e).naturalWidth,0!==(i=p.get(e).naturalHeight)&&""!==i||(i=f),0!==t&&""!==t||(t=f)),p.eq(e).css({cssText:"width:"+f+"px !important; height:"+i*f/t+"px !important;"})});o=jQuery("#bwg_mosaic_thumbnails_div_"+t).width()/100*parseInt(e.attr("data-total-width"));jQuery("#"+i).width(o);var Q=f+2*_<o?f:o-2*_,v=Math.min(Math.floor(o/(Q+2*_)),p.length),x=[];x[0]=0;for(var k=[],z=[],C=0;C<v;C++)z[C]=0,k[C]=0;p.each(function(e){for(var t=0,i=z[0],a=0;a<v;a++)i>z[a]&&(i=z[a],t=a);x[e]=t,k[t]++,A=i,H=0+t*(Q+2*_),p.eq(e).parent().css({top:A,left:H}),z[t]+=p.eq(e).height()+2*_}),(d=[])[0]=1;var I=0,E=[],M=0,S=0;for(C=0;C<v;C++)I+=Q,E[C]=0,p.each(function(e){x[e]==C&&(E[C]+=p.eq(e).height())}),0!=E[C]&&(M+=Q/E[C],S+=Q*k[C]*2*_/E[C]);var O=0;0!=M&&(O=(I+S)/M);for(C=0;C<v;C++)0!=E[C]&&(d[C]=(O-2*k[C]*_)/E[C]);var T,H=[];H[0]=0;for(C=1;C<=v;C++)H[C]=H[C-1]+Q*d[C-1]+2*_;var A=[];for(C=0;C<v;C++)A[C]=0;(T=[])[0]=0,p.each(function(e){var t=p.eq(e).width(),i=p.eq(e).height(),a=t*d[x[e]],r=i*d[x[e]];p.eq(e).css({cssText:"width:"+a+"px !important; height:"+r+"px !important;"}),p.eq(e).parent().css({top:A[x[e]],left:H[x[e]]}),A[x[e]]+=i*d[x[e]]+2*_,T[x[e]]=e}),jQuery("#"+i).width(H[v]).height(A[0])}}function bwg_thumbnail_mosaic(e){var t=jQuery(e),i=jQuery.Deferred();if(i.done([bwg_thumbnail_mosaic_logic]).done(function(e){"1"!=e.data("mosaic-thumb-transition")&&jQuery(".bwg_mosaic_thumb_spun_"+t).css({transition:"all 0.3s ease 0s","-webkit-transition":"all 0.3s ease 0s"});var t=e.data("bwg");jQuery(".bwg_mosaic_thumbnails_"+t).css({visibility:"visible"}),jQuery(".tablenav-pages_"+t).css({visibility:"visible"}),bwg_container_loaded(t),jQuery(".bwg_mosaic_thumb_"+t).removeClass("bwg-hidden"),jQuery("#bwg_mosaic_thumbnails_div_"+t).removeClass("bwg-hidden")}),i.resolve(t),"hover"==t.attr("data-image-title")){var a=parseInt(t.attr("data-thumb-padding"))/2,r=parseInt(t.attr("data-thumb-border"))+a;bwg_mosaic_title_on_hover(t.data("bwg"),t,r)}"hover"==t.attr("data-ecommerce-icon")&&(jQuery(".bwg_mosaic_thumb_spun_"+bwg).on("mouseenter",function(){var e=jQuery(this).parents(".bwg-mosaic-thumb-span").children(".bwg_mosaic_thumb_"+bwg).width(),t=jQuery(this).parents(".bwg-mosaic-thumb-span").children(".bwg_mosaic_thumb_"+bwg).height();jQuery(this).children(".bwg_ecommerce_spun1_"+bwg).width(e);var i=jQuery(this).children(".bwg_ecommerce_spun1_"+bwg).width(),a=jQuery(this).children(".bwg_ecommerce_spun1_"+bwg).height();jQuery(this).children(".bwg_ecommerce_spun1_"+bwg).css({top:r+.5*t-.5*a,left:r+.5*e-.5*i,opacity:1})}),jQuery(".bwg_mosaic_thumb_spun_"+bwg).on("mouseleave",function(){jQuery(this).children(".bwg_ecommerce_spun1_"+bwg).css({top:0,left:-1e4,opacity:0,padding:t.attr("data-title-margin")})}))}function bwg_mosaic_title_on_hover(t,e,i){jQuery(".bwg-mosaic-thumb-span").on("mouseenter",function(){var e=jQuery(this).children(".bwg_mosaic_thumb_"+t).width();jQuery(this).find(".bwg_mosaic_title_spun1_"+t).width(e),jQuery(this).find(".bwg_mosaic_title_spun1_"+t).css({opacity:1,"max-height":"calc(100% - "+2*i+"px)",overflow:"hidden"})}),jQuery(".bwg-mosaic-thumb-span").on("mouseleave",function(){jQuery(this).find(".bwg_mosaic_title_spun1_"+t).css({opacity:0,padding:e.attr("data-title-margin"),"max-height":"calc(100% - "+2*i+"px)",overflow:"hidden"})})}function bwg_mosaic_ajax(e,t){var i=0;jQuery(".bwg_mosaic_thumb_spun_"+e+" img").on("load",function(){++i>=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),++i>=t&&bwg_thumbnail_mosaic(jQuery(".bwg-mosaic-thumbnails[data-bwg="+e+"]"))}),jQuery(".bwg_container").each(function(){var e=jQuery(this).data("bwg");0<jQuery(this).find(".wd_error").length&&bwg_container_loaded(e)})}function bwg_add_album(){var t=!1;"1"!=bwg_objectsL10n.front_ajax&&jQuery(document).off("click",".bwg-album").on("click",".bwg-album",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 i=!1;jQuery(document).on("click",".bwg_lightbox .bwg-item0, .bwg_lightbox .bwg_slide, .bwg_lightbox .bwg-carousel-image, .bwg_lightbox .bwg-title1",function(e){e.stopPropagation(),e.preventDefault();var t=jQuery(this).closest("a");if(!i)return i=!0,setTimeout(function(){i=!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(),!i)return i=!0,setTimeout(function(){i=!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,i="",a="",r=(a=jQuery(e).parent().parent().hasClass("bwg_tag_buttons_view")?jQuery(e).parent().parent():jQuery(e).parent().parent().parent()).find(".current_view").val(),_=a.find(".form_id").val(),s=a.find(".cur_gal_id").val(),o=a.find(".album_gallery_id").val(),l=a.find(".type").val();jQuery(e).parent().find(".opt.selected").each(function(){i=i+jQuery(e).text()+","}),""==(i=i.slice(0,-1))&&(i=bwg_objectsL10n.bwg_select_tag),jQuery(e).parent().find(".CaptionCont").attr("title",i),jQuery(e).parent().find(".CaptionCont .placeholder").html(i);var n=jQuery(".bwg_tags_container_"+r+" #bwg_tag_id_"+s).val();t="string"==typeof n&&""!==n?n.split(","):[],"object"==typeof n&&(t=n),jQuery(".bwg_tags_container_"+r+" #bwg_tag_id_"+r).val(t),bwg_select_tag(r,_,s,o,l,!1)}function bwg_document_ready(i){bwg_add_lightbox(),i.data("right-click-protection")&&bwg_disable_right_click(i);var e=i.find(".search_tags");if("1"==bwg_objectsL10n.front_ajax&&e.length)for(var t=0;t<e[0].length;t++)void 0===e[0][t].attributes.selected&&(e[0][t].selected=!1);e.length&&(e.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]}),e.off("change").on("change",function(){bwg_filter_by_tag(this)})),bwg_search_tag_init(i);var a=i.find(".cur_gal_id").val(),r=i.find(".current_view").val(),_=i.find(".bwg_tags_container_"+r+" .bwg_tag_button_view_container"),s=i.find("#bwg_tag_id_"+a),o=parseInt(2*_.find(".bwg_tags_filter_buttons").outerHeight(!0));_.length&&(_.find(".bwg_tags_filter_buttons").off("click").on("click",function(){if(!jQuery(this).hasClass("active")){var e=jQuery(this).position().top;o<e&&i.find(".show_bottom_tag").val("1"),""==s.val()?s.val(jQuery(this).val()):s.val(s.val()+","+jQuery(this).val()),bwg_filter_by_tag(this)}return!1}),_.find(".bwg_all_tags").off("click").on("click",function(){return jQuery(this).hasClass("active")||(s.val(""),bwg_filter_by_tag(this)),!1}),""!=s.val()&&_.find(".bwg_all_tags").removeClass("active"),s.val().split(",").forEach(function(t){_.find(".bwg_tags_filter_buttons").each(function(){if(jQuery(this).val()==t){var e=jQuery(this).position().top;o<e&&i.find(".show_bottom_tag").val("1")}})}),bwg_tags_button_section_visibility());var l=i.find(".bwg_order");l.length&&l.SumoSelect({triggerChangeCombined:!0,forceCustomRendering:!0}),jQuery(".SumoSelect > .CaptionCont > label > i").addClass("bwg-icon-angle-down closed"),jQuery(this).find("search_placeholder_title").hide(),""==jQuery(this).find(".bwg_search_input").val()&&jQuery(this).find("search_placeholder_title").show(),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("bwg-hidden"),jQuery(this).find(".bwg_search_reset_container").addClass("bwg-hidden"))}),jQuery(".search_tags").on("sumo:opened",function(){var e=jQuery(this).parents(".bwg_container").height(),t=(jQuery(this).parents(".bwg_container").find(".wd_error").length,jQuery(this).parent(".SumoSelect").find(".optWrapper>.options"));void 0!==t&&(e-50<t.height()&&t.css("max-height",e-50));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 n=window.location.hash.substring(1);if(n&&"-1"!=n.indexOf("bwg")){bwg_hash_array=n.replace("bwg","").split("/");var g=jQuery(".bwg_container");g&&bwg_gallery_box(bwg_hash_array[1],g,!1,bwg_hash_array[0])}bwg_resize_search_line()}function bwg_search_tag_init(e){var t=e.find(".search_tags");if("1"==bwg_objectsL10n.front_ajax&&t.length)for(var i=0;i<t[0].length;i++)void 0===t[0][i].attributes.selected&&(t[0][i].selected=!1);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)}))}function bwg_clear_search_input(e){if("1"!=bwg_objectsL10n.front_ajax)jQuery("#bwg_search_input_"+e).val(""),jQuery("#bwg_search_container_1_"+e+" .bwg_search_loupe_container1").addClass("bwg-hidden"),jQuery("#bwg_search_container_1_"+e+" .bwg_search_reset_container").addClass("bwg-hidden");else{var t=window.location.href,i=bwg_remove_url_parameter("bwg_search_"+e,t,t);window.location.replace(i)}}function bwg_check_search_input_enter(e,t){return"Enter"!=t.key||(jQuery(e).closest(".bwg_search_container_1").find(".bwg_search").trigger("click"),!1)}function bwg_ajax(t,i,a,r,e,_,s,o,l,n,g,b){if("1"==bwg_objectsL10n.front_ajax&&!0!==n){if("back"===r)return-1==document.referrer.indexOf(window.location.host)?(str=jQuery(location).attr("href"),void window.location.replace(str.substring(0,str.indexOf("type_0")))):void window.history.back();var w=jQuery("#bwg_search_input_"+i).val(),d=jQuery(".bwg_tags_container_"+i+" .cur_gal_id").val(),u=window.location.href,h="",m=jQuery(".bwg_tags_container_"+i+" #bwg_tag_id_"+d).val();if("#"==u.substr(-1)&&(u=u.slice(0,-1)),""!==w&&void 0!==w?!1!==(h=bwg_add_url_parameter(h=bwg_remove_url_parameter("page_number_"+i,u),"bwg_search_"+i,w))&&(u=h):!1!==(h=bwg_remove_url_parameter("bwg_search_"+i,u))&&(u=h),void 0!==l&&""!==l&&!1!==(h=bwg_add_url_parameter(u,"sort_by_"+i,l))&&(u=h),null!=m&&0<m.length){var c="";jQuery(".bwg_tags_container_"+i).parent().hasClass("bwg_tag_select_view")&&(m=m.toString());var p=m.split(",");jQuery.each(p,function(e){var t=",";e===p.length-1&&(t=""),c+=p[e]+t}),""!==c&&!1!==(h=bwg_add_url_parameter(u,"filter_tag_"+i,c))&&(u=h)}else!1!==(h=bwg_remove_url_parameter("filter_tag_"+i,h))&&(u=h);return s&&!1!==(h=bwg_remove_url_parameter("page_number_"+i,h))&&(u=h),void(window.location.href=u)}n?(jQuery(".bwg_loading_div_1").addClass("bwg_load_more_ajax_loading").removeClass("bwg_loading_div_1"),jQuery(".bwg_load_more_ajax_loading").css({top:jQuery("#bwg_container1_"+bwg).height()-jQuery(".bwg_load_more_ajax_loading").height()})):jQuery(".bwg_load_more_ajax_loading").addClass("bwg_loading_div_1").removeClass("bwg_load_more_ajax_loading").removeAttr("style"),jQuery("#ajax_loading_"+i).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 y=jQuery("#"+t).data("ajax-url"),f=0;if(void 0===n)n=!1;var j,Q=jQuery("#page_number_"+i).val(),v=jQuery("#bwg_search_input_"+i).val(),x={},k=jQuery("#bwg_album_breadcrumb_"+i).val();if(k&&!0!==n){var z=JSON.parse(k);if("back"==r){z.splice(-1,1);var C=z.slice(-1)[0];r=C.id,Q=C.page,x["action_"+i]="back"}else"numeric"===n||s?(z.splice(-1,1),z.push({id:r,page:Q,search:v})):(z.push({id:r,page:1}),Q=1);x["bwg_album_breadcrumb_"+i]=JSON.stringify(z)}if(x["bwg-preview-type"]=jQuery("#"+t).data("gallery-type"),x.gallery_type=jQuery("#"+t).data("gallery-type"),x.gallery_id=jQuery("#"+t).data("gallery-id"),x.tag=jQuery("#"+t).data("tag"),x.album_id=jQuery("#"+t).data("album-id"),x.theme_id=jQuery("#"+t).data("theme-id"),x.shortcode_id=jQuery("#"+t).data("shortcode-id"),x.bwg=i,x.current_url=encodeURI(jQuery("#bwg_container1_"+i).data("current-url")),s&&(Q=1),void 0===o||""==o)o="";if(void 0===g||""==g)g="";if(void 0===l||""==l)l=jQuery(".bwg_order_"+i).val();if(void 0===b)b=!0;if(1==b&&jQuery("html, body").animate({scrollTop:jQuery("#"+t).offset().top-150},500),x["page_number_"+i]=Q,x["bwg_load_more_"+i]=jQuery("#bwg_load_more_"+i).val(),x["album_gallery_id_"+i]=r,x["type_"+i]=_,x["title_"+i]=o,x["description_"+i]=g,x["sortImagesByValue_"+i]=l,x["bwg_random_seed_"+i]=parseInt(jQuery("#bwg_random_seed_"+i).val()),0<jQuery("#bwg_search_input_"+i).length&&(x["bwg_search_"+i]=jQuery("#bwg_search_input_"+i).val()),void 0!==x["bwg_album_breadcrumb_"+i]){var I=JSON.parse(x["bwg_album_breadcrumb_"+i]);jQuery.each(I,function(e,t){x["bwg_search_"+i]="",r==t.id&&(x["bwg_search_"+i]=t.search)})}var E=jQuery(".bwg_tags_container_"+i+" #bwg_tag_id_"+a).val();return j="string"==typeof E&&""!==E?E.split(","):[],"object"==typeof E&&(j=E),x["bwg_tag_id_"+a]=j,n?(jQuery(".bwg_loading_div_1").addClass("bwg_load_more_ajax_loading").removeClass("bwg_loading_div_1"),jQuery(".bwg_load_more_ajax_loading").css({top:jQuery("#bwg_container1_"+bwg).height()-jQuery(".bwg_load_more_ajax_loading").height()})):jQuery(".bwg_load_more_ajax_loading").addClass("bwg_loading_div_1").removeClass("bwg_load_more_ajax_loading").removeAttr("style"),jQuery("#ajax_loading_"+i).removeClass("bwg-hidden"),jQuery.ajax({type:"POST",url:y,data:x,success:function(e){jQuery(e).find(".bwg_masonry_thumb_spun_"+i+" img").length,f=jQuery(e).find(".bwg_mosaic_thumb_spun_"+i+" img").length,!0===n?(a=="bwg_thumbnails_mosaic_"+i?jQuery("#"+a).append(jQuery(e).closest(".bwg-container-"+i).find("#"+a).html()):a=="bwg_album_compact_"+i?jQuery("#"+a).append(jQuery(e).closest(".bwg-album-thumbnails").html()):a=="bwg_thumbnails_masonry_"+i?jQuery(".bwg-container-temp"+i).append(jQuery(e).closest(".bwg-container-"+i).html()):jQuery("#"+a).append(jQuery(e).closest(".bwg-container-"+i).html()),jQuery(".bwg_nav_cont_"+i).html(jQuery(e).closest(".bwg_nav_cont_"+i).html())):jQuery("#bwg_container3_"+i).html(e),bwg_remove_lazy_loader_icon()},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_"+i).find(jQuery(".bwg_blog_style_img_"+i)).on("load",function(){jQuery(".bwg_blog_style_img_"+i).closest(jQuery(".blog_style_image_buttons_conteiner_"+i)).show()}),""!=j&&null!==j||(j=[]),jQuery(".bwg_tags_container_"+i+" #bwg_tag_id_"+a).val(j),j.forEach(function(t){jQuery(".bwg_tags_container_"+i+" .bwg_tags_filter_buttons").each(function(){var e=parseInt(2*jQuery(this).outerHeight(!0));jQuery(this).val()==t&&(jQuery(this).addClass("active"),e<jQuery(this).position().top&&jQuery(".bwg_tags_container_"+i+" .show_bottom_tag").val("1"),jQuery(".bwg_tags_container_"+i+" .bwg_all_tags").removeClass("active"))})}),jQuery(".pagination-links_"+i).length&&jQuery("html, body").animate({scrollTop:jQuery("#"+t).offset().top-150},500),bwg_document_ready(jQuery("#bwg_container1_"+i));var e=jQuery("#bwg_container1_"+i).data("gallery-view-type");if(jQuery("#bwg_container1_"+i+" .bwg-album-thumbnails").length){bwg_all_thumnails_loaded(".bwg-container-"+i)&&bwg_container_loaded(i)}else{switch(e){case"thumbnails":case"thumbnail":case"masonry":case"mosaic":case"thumbnails_masonry":case"album_compact_preview":case"album_masonry_preview":case"album_extended_preview":bwg_all_thumnails_loaded(".bwg-container-"+i);break;case"slideshow":bwg_slideshow_ready(i);break;case"carousel":bwg_carousel_ready(i),bwg_carousel_onload(jQuery("#bwg_container1_"+i));break;case"image_browser":bwg_image_browser_ready(jQuery("#bwg_container1_"+i));break;case"blog_style":bwg_blog_style_ready(jQuery("#bwg_container1_"+i))}bwg_mosaic_ajax(i,f)}jQuery(".blog_style_images_conteiner_"+i+" .bwg_embed_frame_16x9_"+i).each(function(e){jQuery(this).width(jQuery(this).parent().width()),jQuery(this).height(.5625*jQuery(this).width())}),jQuery(".blog_style_images_conteiner_"+i+" .bwg_embed_frame_instapost_"+i).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_"+i).width(jQuery("#bwg_embed_frame_16x9_"+i).parent().width()),jQuery("#bwg_embed_frame_16x9_"+i).height(.5625*jQuery("#bwg_embed_frame_16x9_"+i).width()),jQuery("#bwg_embed_frame_instapost_"+i).width(jQuery("#bwg_embed_frame_16x9_"+i).parent().width()),jQuery(".bwg_embed_frame_instapost_"+i).height((jQuery(".bwg_embed_frame_instapost_"+i).width()-16)*jQuery(".bwg_embed_frame_instapost_"+i).attr("data-height")/jQuery(".bwg_embed_frame_instapost_"+i).attr("data-width")+96),jQuery("#bwg_search_input_"+i).val(x["bwg_search_"+i]),""!=jQuery("#bwg_search_input_"+i).val()?(jQuery("#bwg_search_input_"+i).parent().find(".search_placeholder_title").hide(),jQuery("#bwg_search_input_"+i).parent().parent().find(".bwg_search_reset_container").show(),jQuery("#bwg_search_input_"+i).parent().parent().find(".bwg_search_loupe_container1").show()):jQuery("#bwg_search_input_"+i).parent().find(".search_placeholder_title").show();jQuery("#bwg_container2_"+i+" .cur_gal_id").val();""!=j&&null!==j||(j=[]),jQuery(".bwg_tags_container_"+i+" #bwg_tag_id_"+i).val(j)}}),!1}function bwg_add_url_parameter(e,t,i){var a=new RegExp("([?&])"+t+"=.*?(&|$)","i"),r=-1!==e.indexOf("?")?"&":"?";return e.match(a)?e.replace(a,"$1"+t+"="+i+"$2"):e+r+t+"="+i}function bwg_remove_url_parameter(e,t){var i=t.split("?"),a=i[0]+"?",r="";if(void 0!==i[1]&&(r=i[1]),""===r)return t;var _,s,o=decodeURIComponent(r).split("&");for(s=0;s<o.length;s++)(_=o[s].split("="))[0]!=e&&(a=a+_[0]+"="+_[1]+"&");return a.substring(0,a.length-1)}function bwg_select_tag(e,t,i,a,r,_){_&&jQuery(".bwg_tags_container_"+e+" #bwg_tag_id_"+i).val(""),bwg_ajax(t,e,i,a,"",r,1,"")}function bwg_cube(e,t,i,a,r,_,s,o,l,n,g){var b,w=!1,d="";if(void 0!==g&&""!==g){w=!0,bwg_params[g].bwg_trans_in_progress=!0,d="_"+g,b=bwg_params[g].bwg_transition_duration;bwg_params[g].event_stack}else b=bwg_transition_duration;if(!bwg_testBrowser_cssTransitions(g))return bwg_fallback(o,l,n,g);if(!bwg_testBrowser_cssTransforms3d(g))return bwg_fallback3d(o,l,n,g);function u(){if(jQuery(o).removeAttr("style"),jQuery(l).removeAttr("style"),jQuery(".bwg_slider"+d).removeAttr("style"),jQuery(o).css({opacity:0,"z-index":1}),jQuery(l).css({opacity:1,"z-index":2}),jQuery(".bwg_image_info").show(),jQuery(o).html(""),w){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{e="";gallery_box_data.bwg_trans_in_progress=!1;t=gallery_box_data.event_stack}if(void 0!==t&&0<t.length){var i=t[0].split("-");t.shift(),bwg_change_image(i[0],i[1],e,!0,g)}bwg_change_watermark_container()}w?(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(o).css({transform:"translateZ("+e+"px)",backfaceVisibility:"hidden"}),jQuery(l).css({opacity:1,backfaceVisibility:"hidden",transform:"translateY("+i+"px) translateX("+t+"px) rotateY("+r+"deg) rotateX("+a+"deg)"}),jQuery(".bwg_slider"+d).css({transform:"translateZ(-"+e+"px)",transformStyle:"preserve-3d"}),setTimeout(function(){jQuery(".bwg_slider"+d).css({transition:"all "+b+"ms ease-in-out",transform:"translateZ(-"+e+"px) rotateX("+_+"deg) rotateY("+s+"deg)"})},20),jQuery(".bwg_slider"+d).one("webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend",jQuery.proxy(u)),0==b&&u()}function bwg_cubeH(e,t,i,a){var r=jQuery(e).width()/2;"right"==i?bwg_cube(r,r,0,0,90,0,-90,e,t,i,a):"left"==i&&bwg_cube(r,-r,0,0,-90,0,90,e,t,i,a)}function bwg_cubeV(e,t,i,a){var r=jQuery(e).height()/2;"right"==i?bwg_cube(r,0,-r,90,0,-90,0,e,t,i,a):"left"==i&&bwg_cube(r,0,r,-90,0,90,0,e,t,i,a)}function bwg_fade(e,t,i,a){var r,_=!1;function s(){jQuery(".bwg_image_info").show(),bwg_change_watermark_container(a),_?bwg_params[a].bwg_trans_in_progress=!1:gallery_box_data.bwg_trans_in_progress=!1}r=void 0!==a&&""!==a?(_=!0,bwg_params[a].bwg_trans_in_progress=!0,bwg_params[a].bwg_transition_duration):(gallery_box_data.bwg_trans_in_progress=!0,gallery_box_data.bwg_transition_duration),_?(jQuery(".bwg_slideshow_filmstrip_thumbnail_"+a).removeClass("bwg_slideshow_thumb_active_"+a).addClass("bwg_slideshow_thumb_deactive_"+a),jQuery("#bwg_filmstrip_thumbnail_"+bwg_params[a].bwg_current_key+"_"+a).removeClass("bwg_slideshow_thumb_deactive_"+a).addClass("bwg_slideshow_thumb_active_"+a),jQuery(".bwg_slideshow_dots_"+a).removeClass("bwg_slideshow_dots_active_"+a).addClass("bwg_slideshow_dots_deactive_"+a),jQuery("#bwg_dots_"+bwg_params[a].bwg_current_key+"_"+a).removeClass("bwg_slideshow_dots_deactive_"+a).addClass("bwg_slideshow_dots_active_"+a)):(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("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(s))):(jQuery(e).animate({opacity:0,"z-index":1},r),jQuery(t).animate({opacity:1,"z-index":2},{duration:r,complete:function(){_?bwg_params[a].bwg_trans_in_progress=!1:gallery_box_data.bwg_trans_in_progress=!1,jQuery(e).html(""),s()}}),jQuery(e).fadeTo(r,0),jQuery(t).fadeTo(r,1)),0==r&&s()}function bwg_grid(e,t,i,a,r,_,s,o,l,n,g){var b,w=!1,d="";if(event_stack=void 0!==g&&""!==g?(w=!0,bwg_params[g].bwg_trans_in_progress=!0,d="_"+g,b=bwg_params[g].bwg_transition_duration,bwg_params[g].event_stack):(b=bwg_transition_duration,gallery_box_data.bwg_trans_in_progress=!0,gallery_box_data.event_stack),!bwg_testBrowser_cssTransitions())return bwg_fallback(o,l,n);w?(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 u=b/(e+t);var h=jQuery(o).find("img"),m=jQuery(o).find("figure"),c=(jQuery(o).find("iframe").css("opacity",0),jQuery('<span style="display: block;" />').addClass("bwg_grid"+d));jQuery(o).prepend(c);var p,y,f,j,Q,v,x,k,z,C,I,E=jQuery(".bwg_slide_bg"+d),M=h.width(),S=h.height(),O=E.width(),T=E.height(),H=Math.floor(O/e),A=Math.floor(T/t),L=O-e*H,B=Math.ceil(L/e),W=T-t*A,D=Math.ceil(W/t),R=0,F=Math.ceil((jQuery(".bwg_slide_bg"+d).width()-h.width())/2),N=void 0===h.attr("src")?"":h.attr("src");a="min-auto"===(a="auto"===a?O:a)?-O:a,r="min-auto"===(r="auto"===r?T:r)?-T:r;for(var P=0;P<e;P++){var U=0,V=Math.floor((jQuery(".bwg_slide_bg"+d).height()-h.height())/2),q=H;if(0<L){var J=B<=L?B:L;q+=J,L-=J}for(var G=0;G<t;G++){var Y=A,$=W;0<$&&(Y+=J=D<=$?D:W,$-=J),c.append((p=q,y=Y,f=U,j=V,Q=R,v=F,x=N,k=M,z=S,C=g,void 0,I=(P+G)*u,jQuery('<span class="bwg_gridlet'+d+'" />').css({display:"block",width:p,height:y,top:f,left:Q,backgroundImage:'url("'+x+'")',backgroundColor:w?jQuery(".bwg_slideshow_image_wrap_"+C).css("background-color"):jQuery(".spider_popup_wrap").css("background-color"),backgroundRepeat:"no-repeat",backgroundPosition:v+"px "+j+"px",backgroundSize:k+"px "+z+"px",transition:"all "+b+"ms ease-in-out "+I+"ms",transform:"none"}))),U+=Y,V-=Y}F-=q,R+=q}var X=c.children().last();function K(){if(jQuery(o).css({opacity:0,"z-index":1}),jQuery(l).css({opacity:1,"z-index":2}),h.css("opacity",1),m.css("opacity",1),c.remove(),w){bwg_params[g].bwg_trans_in_progress=!1;var e=bwg_params[g].event_stack,t=bwg_params[g].data}else{gallery_box_data.bwg_trans_in_progress=!1;e=gallery_box_data.event_stack,t=""}if(jQuery(".bwg_image_info").show(),jQuery(o).html(""),void 0!==e&&0<e.length){var i=e[0].split("-");e.shift(),bwg_change_image(i[0],i[1],t,!0,g)}w?bwg_change_watermark_container(g):bwg_change_watermark_container()}c.show(),h.css("opacity",0),m.css("opacity",0),c.children().first().addClass("rs-top-left"),c.children().last().addClass("rs-bottom-right"),c.children().eq(t-1).addClass("rs-bottom-left"),c.children().eq(-t).addClass("rs-top-right"),setTimeout(function(){c.children().css({opacity:s,transform:"rotate("+i+"deg) translateX("+a+"px) translateY("+r+"px) scale("+_+")"})},1),jQuery(l).css("opacity",1),jQuery(X).one("webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend",jQuery.proxy(K)),0==b&&K()}function bwg_sliceH(e,t,i,a){if("right"==i)var r="min-auto";else if("left"==i)r="auto";bwg_grid(1,8,0,r,0,1,0,e,t,i,a)}function bwg_sliceV(e,t,i,a){if("right"==i)var r="min-auto";else if("left"==i)r="auto";bwg_grid(10,1,0,0,r,1,0,e,t,i,a)}function bwg_slideV(e,t,i,a){if("right"==i)var r="auto";else if("left"==i)r="min-auto";bwg_grid(1,1,0,0,r,1,1,e,t,i,a)}function bwg_slideH(e,t,i,a){if("right"==i)var r="min-auto";else if("left"==i)r="auto";bwg_grid(1,1,0,r,0,1,1,e,t,i,a)}function bwg_scaleOut(e,t,i,a){bwg_grid(1,1,0,0,0,1.5,0,e,t,i,a)}function bwg_scaleIn(e,t,i,a){bwg_grid(1,1,0,0,0,.5,0,e,t,i,a)}function bwg_blockScale(e,t,i,a){bwg_grid(8,6,0,0,0,.6,0,e,t,i,a)}function bwg_kaleidoscope(e,t,i,a){bwg_grid(10,8,0,0,0,1,0,e,t,i,a)}function bwg_fan(e,t,i,a){if("right"==i)var r=45,_=100;else if("left"==i)r=-45,_=-100;bwg_grid(1,10,r,_,0,1,0,e,t,i,a)}function bwg_blindV(e,t,i,a){bwg_grid(1,8,0,0,0,.7,0,e,t,"",a)}function bwg_blindH(e,t,i,a){bwg_grid(10,1,0,0,0,.7,0,e,t,"",a)}function bwg_random(e,t,i,a){var r=["sliceH","sliceV","slideH","slideV","scaleOut","scaleIn","blockScale","kaleidoscope","fan","blindH","blindV"];this["bwg_"+r[Math.floor(Math.random()*r.length)]](e,t,i,a)}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,i){var a=void 0!==i&&""!==i?"_"+i:"",r=void 0!==i&&""!==i?"_slideshow":"";if(jQuery(".bwg"+r+"_watermark_spun"+a).width(e),jQuery(".bwg"+r+"_watermark_spun"+a).height(t),jQuery(".bwg"+r+"_watermark"+a).css({display:""}),void 0===i||""===i){var _=0;(jQuery(".bwg_comment_container").hasClass("bwg_open")||jQuery(".bwg_ecommerce_container").hasClass("bwg_open"))&&(_=gallery_box_data.lightbox_comment_width),e<=jQuery(window).width()-_&&(jQuery(".bwg_watermark_image").css({width:(jQuery(".spider_popup_wrap").width()-_)*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()-_)*gallery_box_data.watermark_font_size/gallery_box_data.image_width}))}else jQuery(".bwg"+r+"_title_spun"+a).width(e),jQuery(".bwg"+r+"_title_spun"+a).height(t),jQuery(".bwg"+r+"_description_spun"+a).width(e),jQuery(".bwg"+r+"_description_spun"+a).height(t);jQuery.trim(jQuery(".bwg"+r+"_title_text"+a).text())&&jQuery(".bwg_slideshow_title_text"+a).css({display:""}),jQuery.trim(jQuery(".bwg"+r+"_description_text"+a).text())&&jQuery(".bwg"+r+"_description_text"+a).css({display:""})}function bwg_set_filmstrip_pos(e,t,i){var a,r=void 0!==t&&""!==t?"_"+t:"",_=void 0!==t&&""!==t?"_slideshow":"";a=void 0!==t&&""!==t?bwg_params[t].left_or_top:gallery_box_data.left_or_top;var s=parseInt(jQuery(".bwg_filmstrip_thumbnails").attr("data-all-images-top-bottom-space")),o=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 l=-bwg_current_filmstrip_pos-jQuery(".bwg_filmstrip_thumbnail").outerWidth(!0)/2;else if("outerHeight"==gallery_box_data.outerWidth_or_outerHeight)l=-bwg_current_filmstrip_pos-jQuery(".bwg_filmstrip_thumbnail").outerHeight(!0)/2;if("width"==gallery_box_data.width_or_height)var n=Math.min(0,Math.max(e-jQuery(".bwg_filmstrip_thumbnails").width(),l+e/2));else if("height"==gallery_box_data.width_or_height)n=Math.min(0,Math.max(e-jQuery(".bwg_filmstrip_thumbnails").height(),l+e/2))}else if("width"==bwg_params[t].width_or_height)l=-bwg_params[t].bwg_current_filmstrip_pos-(jQuery(".bwg_slideshow_filmstrip_thumbnail"+r).width()+bwg_params[t].filmstrip_thumb_margin_hor)/2,n=Math.min(0,Math.max(e-jQuery(".bwg_slideshow_filmstrip_thumbnails"+r).width(),l+e/2));else l=-bwg_params[t].bwg_current_filmstrip_pos-(jQuery(".bwg_slideshow_filmstrip_thumbnail"+r).height()+bwg_params[t].filmstrip_thumb_margin_hor)/2,n=Math.min(0,Math.max(e-jQuery(".bwg_slideshow_filmstrip_thumbnails"+r).height(),l+e/2));0<n+o&&(o=0),0<n+s&&(s=0),"left"==a?jQuery(".bwg"+_+"_filmstrip_thumbnails"+r).animate({left:n+o},{duration:500,complete:function(){void 0!==i&&bwg_disable_lightbox_filmstrip_left_right_arrow(i)}}):jQuery(".bwg"+_+"_filmstrip_thumbnails"+r).animate({top:n+s},{duration:500,complete:function(){void 0!==i&&bwg_disable_lightbox_filmstrip_left_right_arrow(i)}})}function bwg_slideshow_filmstrip_fix_dimension(e){var t,i,a,r,_,s,o=void 0!==e&&""!==e?"_"+e:"",l=void 0!==e&&""!==e?"_slideshow":"",n=void 0!==e&&""!==e&&void 0!==bwg_params[e].outerWidth_or_outerHeight?bwg_params[e].outerWidth_or_outerHeight:gallery_box_data.outerWidth_or_outerHeight,g=void 0!==e&&""!==e&&void 0!==bwg_params[e].left_or_top?bwg_params[e].left_or_top:gallery_box_data.left_or_top;i="outerWidth"==n?(t=jQuery(".bwg"+l+"_filmstrip"+o).outerWidth(!0),jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).outerWidth(!0)):(t=jQuery(".bwg"+l+"_filmstrip"+o).outerHeight(!0),jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).outerHeight(!0)),s="left"==g?(a=jQuery(".bwg"+l+"_thumb_active"+o).position().left,r="outerWidth"==n?jQuery(".bwg"+l+"_thumb_active"+o).position().left+jQuery(".bwg"+l+"_thumb_active"+o).outerWidth(!0):jQuery(".bwg"+l+"_thumb_active"+o).position().left+jQuery(".bwg"+l+"_thumb_active"+o).outerHeight(!0),_=jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).position().left,Math.abs(jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).position().left)+t):(a=jQuery(".bwg"+l+"_thumb_active"+o).position().top,r="outerWidth"==n?jQuery(".bwg"+l+"_thumb_active"+o).position().top+jQuery(".bwg"+l+"_thumb_active"+o).outerWidth(!0):jQuery(".bwg"+l+"_thumb_active"+o).position().top+jQuery(".bwg"+l+"_thumb_active"+o).outerHeight(!0),_=jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).position().top,Math.abs(jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).position().top)+t),i<t||(a<Math.abs(_)?"left"==g?jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).animate({left:-a},{duration:500}):jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).animate({top:-a},{duration:500}):s<r&&("left"==g?jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).animate({left:-(r-t)},{duration:500}):jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).animate({top:-(r-t)},{duration:500})))}function bwg_slideshow_filmstrip_fix_count(e){var t,i,a,r,_,s,o=void 0!==e&&""!==e?"_"+e:"",l=void 0!==e&&""!==e?"_slideshow":"",n=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;i="outerWidth"==n?(t=jQuery(".bwg"+l+"_filmstrip_fix_count"+o).outerWidth(!0),jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).outerWidth(!0)):(t=jQuery(".bwg"+l+"_filmstrip_fix_count"+o).outerHeight(!0),jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).outerHeight(!0)),s="left"==g?(a=jQuery(".bwg"+l+"_thumb_active"+o).position().left,r="outerWidth"==n?jQuery(".bwg"+l+"_thumb_active"+o).position().left+jQuery(".bwg"+l+"_thumb_active"+o).outerWidth(!0):jQuery(".bwg"+l+"_thumb_active"+o).position().left+jQuery(".bwg"+l+"_thumb_active"+o).outerHeight(!0),_=jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).position().left,Math.abs(jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).position().left)+t):(a=jQuery(".bwg"+l+"_thumb_active"+o).position().top,r="outerWidth"==n?jQuery(".bwg"+l+"_thumb_active"+o).position().top+jQuery(".bwg"+l+"_thumb_active"+o).outerWidth(!0):jQuery(".bwg"+l+"_thumb_active"+o).position().top+jQuery(".bwg"+l+"_thumb_active"+o).outerHeight(!0),_=jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).position().top,Math.abs(jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).position().top)+t),i<t||(a<Math.abs(_)?"left"==g?jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).animate({left:-a},{duration:500}):jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).animate({top:-a},{duration:500}):s<r&&("left"==g?jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).animate({left:-(r-t)},{duration:500}):jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).animate({top:-(r-t)},{duration:500})))}function bwg_resize_slideshow_filmstrip_fix_count(e){var _=e.bwg,t=e.parent_width,i=e.params,a=i.filmstrip_direction,r=i.data,s=i.filmstrip_thumb_margin_hor,o=jQuery(window).width()<=767&&5<i.slideshow_thumbnails_count,l=o?5:i.slideshow_thumbnails_count,n="#bwg_container1_"+_+" #bwg_container2_"+_+" .bwg_slideshow_filmstrip_container_"+_,g="#bwg_container1_"+_+" #bwg_container2_"+_+" .bwg_slideshow_filmstrip_fix_count_"+_,b="#bwg_container1_"+_+" #bwg_container2_"+_+" .bwg_slideshow_filmstrip_fix_count_"+_+" .bwg_slideshow_filmstrip_thumbnails_"+_,w="#bwg_container1_"+_+" #bwg_container2_"+_+" .bwg_slideshow_filmstrip_fix_count_"+_+" .bwg_slideshow_filmstrip_thumbnails_"+_+" .bwg_slideshow_filmstrip_thumbnail_"+_,d="#bwg_container1_"+_+" #bwg_container2_"+_+" .bwg_slideshow_image_container_"+_,u=jQuery(d).data("filmstrip-position"),h=(jQuery(d).data("filmstrip-size"),i.slideshow_filmstrip_rl_btn_size);if(jQuery("#bwg_container1_"+_).css({width:"100%"}),jQuery("#bwg_container1_"+_+" #bwg_container2_"+_).css({width:t}),"undefined"==typeof resize_in_progress||!1===resize_in_progress){window.resize_in_progress=!0,void 0!==m&&clearTimeout(m);var m=setTimeout(function(){resize_in_progress=!1;var e={};"bottom"==u||"top"==u?e.left=0:e.top=0,jQuery(b).css(e);var t="horizontal"==a?"table-cell":"block";jQuery(n).find(".bwg_slideshow_filmstrip_left_"+_).css({display:"none"}),jQuery(n).find(".bwg_slideshow_filmstrip_left_disabled_"+_).css({display:t}),jQuery(n).find(".bwg_slideshow_filmstrip_right_"+_).css({display:t}),jQuery(n).find(".bwg_slideshow_filmstrip_right_disabled_"+_).css({display:"none"})},500)}if(bwg_resize_instagram_post(_),bwg_change_watermark_container(_),"horizontal"==a){var c=i.image_height/i.image_width,p=t-40,y=Math.round(c*p),f=(p-s*l)/l,j=Math.round(c*f);jQuery(n).css({width:t,height:j}),jQuery(g).css({width:p,height:j}),jQuery(w).css({width:f,height:j}),jQuery.each(r,function(e,t){var i=f,a=j;if(""!=t.image_width&&""!=t.image_height){var r=Math.max(f/t.image_width,j/t.image_height);i=t.image_width*r,a=t.thumb_height*r}""!=t.thumb_width&&""!=t.thumb_height&&(i=t.thumb_width,a=t.thumb_height);i*=r=Math.max(f/i,j/a),a*=r;jQuery(".bwg_slideshow_filmstrip_fix_count_"+_+" .bwg_slideshow_filmstrip_thumbnail_"+_+" .bwg_slideshow_filmstrip_thumbnail_img_"+_).css({width:f,height:j,"margin-left":0,"margin-top":0})}),jQuery(b).css({width:f*r.length+s*r.length,height:j}),jQuery(".bwg_slideshow_image_wrap_"+_).css({width:t,height:t*i.image_height/i.image_width}),(Q={width:t,height:t*(i.image_height/i.image_width)-j})[u]=j,jQuery(".bwg_slideshow_image_container_"+_).css(Q),jQuery(".bwg_slideshow_image_"+_).css({cssText:"max-width:"+t+"px !important; max-height:"+(t*(i.image_height/i.image_width)-j)+"px !important;"}),jQuery(".bwg_slideshow_embed_"+_).css({cssText:"width:"+t+"px !important; height:"+(t*(i.image_height/i.image_width)-j)+"px !important;"}),jQuery(".bwg_embed_frame_"+_).css({"max-width":t+"px","max-height":t*(i.image_height/i.image_width)-j+"px"}),jQuery(".bwg_embed_frame_"+_).attr("data-width",t),jQuery(".bwg_embed_frame_"+_).attr("data-height",t*(i.image_height/i.image_width)-j),j<h&&(h=j),jQuery(n).find(".bwg-icon-angle-left").css({"font-size":h}),jQuery(n).find(".bwg-icon-angle-right").css({"font-size":h})}else{var Q,v=t*i.image_height/i.image_width;c=i.image_width/i.image_height,y=v-40,p=Math.round(c*y),j=(y-s*l)/l,f=Math.round(c*j);jQuery.each(r,function(e,t){var i=f,a=j;if(""!=t.image_width&&""!=t.image_height){var r=Math.max(f/t.image_width,j/t.image_height);i=t.image_width*r,a=t.thumb_height*r}""!=t.thumb_width&&""!=t.thumb_height&&(i=t.thumb_width,a=t.thumb_height);r=Math.max(f/i,j/a),i*=r,a*=r;jQuery(".bwg_slideshow_filmstrip_fix_count_"+_+" .bwg_slideshow_filmstrip_thumbnail_"+_+" .bwg_slideshow_filmstrip_thumbnail_img_"+_).css({width:f,height:j,"margin-left":0,"margin-top":0})}),jQuery(n).css({width:f,height:v}),jQuery(g).css({width:f,height:y}),jQuery(b).css({width:f,height:j*r.length+s*r.length}),jQuery(w).css({width:f,height:j}),jQuery(".bwg_slideshow_image_wrap_"+_).css({width:t,height:v}),(Q={width:t-f,height:v})[u]=f,jQuery(d).css(Q),jQuery(".bwg_slideshow_image_"+_).css({cssText:"max-width:"+(t-f)+"px !important; max-height:"+v+"px !important;"}),jQuery(".bwg_slideshow_embed_"+_).css({cssText:"width:"+(t-f)+"px !important; height:"+v+"px !important;"}),jQuery(".bwg_embed_frame_"+_).css({"max-width":t-f+"px","max-height":v+"px"}),jQuery(".bwg_embed_frame_"+_).attr("data-width",t-f),jQuery(".bwg_embed_frame_"+_).attr("data-height",v),f<h&&(h=f),jQuery(n).find(".bwg-icon-angle-up").css({"font-size":h}),jQuery(n).find(".bwg-icon-angle-down").css({"font-size":h})}o&&(jQuery(n).find(".bwg-icon-angle-left").removeAttr("style"),jQuery(n).find(".bwg-icon-angle-right").removeAttr("style"),jQuery(n).find(".bwg-icon-angle-up").removeAttr("style"),jQuery(n).find(".bwg-icon-angle-down").removeAttr("style"))}function bwg_resize_slideshow_filmstrip_fix_dimension(e){var t=e.bwg,i=e.parent_width,a=e.params,r=a.filmstrip_direction,_=a.slideshow_filmstrip_width,s=a.slideshow_filmstrip_height,o="#bwg_container1_"+t+" #bwg_container2_"+t,l=o+" .bwg_slideshow_image_wrap_"+t,n=o+" .bwg_slideshow_image_container_"+t,g=o+" .bwg_slideshow_image_"+t,b=o+" .bwg_slideshow_embed_"+t,w=l+" .bwg_slideshow_filmstrip_container_"+t,d=w+" .bwg_slideshow_filmstrip_"+t,u=i,h=u*(a.image_height/a.image_width);jQuery(l).css({width:u,height:h}),jQuery(n).css({width:u-("horizontal"==r?0:_),height:h-("horizontal"==r?s:0)}),jQuery(g).css({display:"inline-block","max-width":u-("horizontal"==r?0:_),"max-height":h-("horizontal"==r?s:0)}),jQuery(b).css({cssText:"width: "+(u-("horizontal"==r?0:_))+"px !important; height: "+(h-("horizontal"==r?s:0)-1)+"px !important;"}),bwg_resize_instagram_post(t),bwg_change_watermark_container(t),"horizontal"==r?(jQuery(w).css({width:u}),jQuery(d).css({width:u-40})):(jQuery(w).css({height:h}),jQuery(d).css({height:h-40}))}function bwg_calculate_slideshow_filmstrip_thumbnail_size(e){var t=e.bwg,i=e.params,a=i.slideshow_filmstrip_width;if(2==i.slideshow_filmstrip_type){var r="#bwg_container1_"+t+" #bwg_container2_"+t+" .bwg_slideshow_filmstrip_fix_count_"+t+" .bwg_slideshow_filmstrip_thumbnail_"+t;a=(i.left_or_top,"width"==i.width_or_height?jQuery(r).width():jQuery(r).height())}return parseFloat(a)}function bwg_move_dots(e){var t=jQuery(".bwg_slideshow_dots_active_"+e).position().left,i=jQuery(".bwg_slideshow_dots_active_"+e).position().left+jQuery(".bwg_slideshow_dots_active_"+e).outerWidth(!0),a=jQuery(".bwg_slideshow_dots_container_"+e).outerWidth(!0),r=jQuery(".bwg_slideshow_dots_thumbnails_"+e).outerWidth(!1),_=jQuery(".bwg_slideshow_dots_thumbnails_"+e).position().left,s=Math.abs(jQuery(".bwg_slideshow_dots_thumbnails_"+e).position().left)+a;r<a||(t<Math.abs(_)?jQuery(".bwg_slideshow_dots_thumbnails_"+e).animate({left:-t},{duration:500}):s<i&&jQuery(".bwg_slideshow_dots_thumbnails_"+e).animate({left:-(i-a)},{duration:500}))}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 i=["","Webkit","Moz","ms","O","Khtml"],a=i.length;a--;)if(void 0!==document.body.style[i[a]+e])return!0;return!1}function bwg_fallback(e,t,i,a){bwg_fade(e,t,i,a)}function bwg_fallback3d(e,t,i,a){bwg_sliceV(e,t,i,a)}function bwg_none(e,t,i,a){var r=void 0!==a&&""!==a?"_"+a:"";if(jQuery(e).css({opacity:0,"z-index":1}),jQuery(t).css({opacity:1,"z-index":2}),void 0!==a&&""!==a){var _=bwg_params[a].bwg_current_key;bwg_change_watermark_container(a),jQuery(".bwg_slideshow_filmstrip_thumbnail"+r).removeClass("bwg_slideshow_thumb_active"+r).addClass("bwg_slideshow_thumb_deactive"+r),jQuery("#bwg_filmstrip_thumbnail_"+_+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_"+_+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,i,a,r){i=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+"_"+i[e].id).find(".bwg_fb_video").each(function(){jQuery(this).attr("src",jQuery(this).attr("src"))}),i[t]){if(jQuery(".bwg_ctrl_btn_"+r).hasClass("bwg-icon-pause")&&bwg_play(bwg_params[r].data,r),a||(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 _="right";if(t<e)_="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",i[t].id),jQuery(".bwg_slideshow_title_text_"+r).html(jQuery('<span style="display: block;" />').html(i[t].alt).text()),jQuery(".bwg_slideshow_description_text_"+r).html(jQuery('<span style="display: block;" />').html(i[t].description).text());var s=2==jQuery(".bwg_slideshow_image_spun_"+r).css("zIndex")?".bwg_slideshow_image_spun_"+r:".bwg_slideshow_image_second_spun_"+r,o=s==".bwg_slideshow_image_second_spun_"+r?".bwg_slideshow_image_spun_"+r:".bwg_slideshow_image_second_spun_"+r,l=-1<i[t].filetype.indexOf("EMBED_"),n=-1<i[t].filetype.indexOf("INSTAGRAM_POST"),g=-1<i[t].filetype.indexOf("INSTAGRAM_VIDEO"),b=jQuery(s).height(),w=jQuery(s).width(),d='<span class="bwg_slideshow_image_spun1_'+r+'" style="display:  '+(l?"block":"table")+' ;width: inherit; height: inherit;"><span class="bwg_slideshow_image_spun2_'+r+'" style="display: '+(l?"block":"table-cell")+'; vertical-align: middle; text-align: center; ">';if(l){if(d+='<span style="height: '+b+"px; width: "+w+'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>'),n){var u=jQuery(".bwg_embed_frame"),h=jQuery(".bwg_slideshow_image_container_"+r).width(),m=jQuery(".bwg_slideshow_image_container_"+r).height(),c=i[t].image_width,p=i[t].image_height,y=bwg_resizing_ratio(c,p,h,m);u.attr("data-width",h),u.attr("data-height",m);var f=y.width,j=y.height;f<j?f-=109:f+=109,d+=spider_display_embed(i[t].filetype,decodeURIComponent(i[t].image_url),i[t].filename,{class:"bwg_embed_frame","data-width":h,"data-height":m,"data-instagram-width":c,"data-instagram-height":p,style:"width: 100%; height: 100%; max-width: 100%; max-height: 100%; vertical-align:middle; display:inline-block; position:relative;"})}else d+=spider_display_embed(i[t].filetype,decodeURIComponent(i[t].image_url),i[t].filename,{class:"bwg_embed_frame",frameborder:"0",allowfullscreen:"allowfullscreen","data-max-width":w,"data-max-height":b,style:"width:inherit; height:inherit; vertical-align:middle; display:table-cell;"});d+="</span>"}else{if("do_nothing"!=bwg_params[r].thumb_click_action){var Q="";"open_lightbox"==bwg_params[r].thumb_click_action?Q+=' class="bwg_lightbox" data-image-id="'+i[t].id+'" data-elementor-open-lightbox="no"':"redirect_to_url"==bwg_params[r].thumb_click_action&&i[t].redirect_url&&(Q+='href="'+i[t].redirect_url+'"'+(bwg_params[r].thumb_link_target&&1==bwg_params[r].thumb_link_target?' target="_blank"':"")),d+="<a "+Q+">"}d+='<img style="max-height: '+b+"px !important; max-width: "+w+'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(decodeURIComponent(i[t].image_url)).text()+'" alt="'+i[t].alt+'" image_id="'+i[t].id+'" /></a>'}d+="</span></span>",jQuery(o).html(d),bwg_params[r].preload_images&&bwg_preload_images(t,r),window["bwg_"+bwg_params[r].slideshow_effect](s,o,_,r),1==bwg_params[r].slideshow_filmstrip_type?bwg_slideshow_filmstrip_fix_dimension(r):2==bwg_params[r].slideshow_filmstrip_type?bwg_slideshow_filmstrip_fix_count(r):bwg_move_dots(r),i[t].is_embed_video?jQuery("#bwg_slideshow_play_pause_"+r).css({display:"none"}):jQuery("#bwg_slideshow_play_pause_"+r).css({display:""})}bwg_add_lightbox();var v="horizontal"==bwg_params[r].filmstrip_direction?"table-cell":"block",x=jQuery(".bwg_slideshow_filmstrip_thumbnails_"+r+" .bwg_slideshow_thumb_active_"+r).prev(),k=jQuery(".bwg_slideshow_filmstrip_thumbnails_"+r+" .bwg_slideshow_thumb_active_"+r).next(),z=jQuery(".bwg_slideshow_filmstrip_container_"+r+" .bwg_slideshow_filmstrip_left_"+r),C=jQuery(".bwg_slideshow_filmstrip_container_"+r+" .bwg_slideshow_filmstrip_left_disabled_"+r),I=jQuery(".bwg_slideshow_filmstrip_container_"+r+" .bwg_slideshow_filmstrip_right_"+r),E=jQuery(".bwg_slideshow_filmstrip_container_"+r+" .bwg_slideshow_filmstrip_right_disabled_"+r);x.length?(z.css({display:v}),C.css({display:"none"})):(z.css({display:"none"}),C.css({display:v}),I.css({display:v}),E.css({display:"none"})),k.length?(I.css({display:v}),E.css({display:"none"})):(I.css({display:"none"}),E.css({display:v}),z.css({display:v}),C.css({display:"none"})),void 0!==i[t]&&"EMBED_OEMBED_INSTAGRAM_POST"==i[t].filetype&&"undefined"!=typeof instgrm&&void 0!==instgrm.Embeds&&(jQuery(".instagram-media").hide(),instgrm.Embeds.process(),jQuery(".instagram-media").css({"max-height":j+"px","min-width":f+"px !important"}),jQuery(".instagram-media").show())}function bwg_preload_images_slideshow(e,t){var i=bwg_params[t].data;count=bwg_params[t].preload_images_count/2;var a=i.length;if(a<bwg_params[t].preload_images_count&&(count=0),0!=count)for(var r=e-count;r<e+count;r++){var _=parseInt((r+a)%a),s=-1<i[_].filetype.indexOf("EMBED_");void 0!==i[_]&&(s||jQuery("<img/>").attr("src",bwg_params[t].upload_url+jQuery('<span style="display: block;" />').html(decodeURIComponent(i[_].image_url)).text()))}else for(r=0;r<i.length;r++){s=-1<i[r].filetype.indexOf("EMBED_");void 0!==i[r]&&(s||jQuery("<img/>").attr("src",bwg_params[t].upload_url+jQuery('<span style="display: block;" />').html(decodeURIComponent(i[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=".bwg_slideshow_filmstrip_"+e;2==bwg_params[e].slideshow_filmstrip_type&&(t=".bwg_slideshow_filmstrip_fix_count_"+e);var i=jQuery("#bwg_container1_"+e).parent();i.hasClass("content-area")&&i.width(i.closest(".content-area").width()),i.hasClass("elementor-tab-content")&&i.width(i.closest(".elementor-widget-wrap").width());var a=i.width(),r=bwg_params[e].data;if(a>=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 _="horizontal"==bwg_params[e].filmstrip_direction?"width: "+bwg_params[e].image_width:"height: "+bwg_params[e].image_height,s="horizontal"==bwg_params[e].filmstrip_direction?"width: "+(bwg_params[e].image_width-40):"height: "+(bwg_params[e].image_height-40);if(jQuery(".bwg_slideshow_filmstrip_container_"+e).css({cssText:_}),jQuery(t).css({cssText:s}),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}),2==bwg_params[e].slideshow_filmstrip_type){var o=bwg_params[e].filmstrip_direction,l="#bwg_container1_"+e+" #bwg_container2_"+e;jQuery(l).removeAttr("style");var n=l+" .bwg_slideshow_filmstrip_container_"+e,g=bwg_params[e].slideshow_filmstrip_rl_btn_size,b=jQuery(".bwg_slideshow_filmstrip_fix_count_"+e).width();"horizontal"==o&&(b=jQuery(".bwg_slideshow_filmstrip_fix_count_"+e).height());var w="horizontal"==o?"table-cell":"block";jQuery(n).find(".bwg_slideshow_filmstrip_left_"+e).css({display:"none"}),jQuery(n).find(".bwg_slideshow_filmstrip_left_disabled_"+e).css({display:w}),jQuery(n).find(".bwg_slideshow_filmstrip_right_"+e).css({display:w}),jQuery(n).find(".bwg_slideshow_filmstrip_right_disabled_"+e).css({display:"none"}),b<g?(g=b,jQuery(n).find(".bwg-icon-angle-left").css({"font-size":g}),jQuery(n).find(".bwg-icon-angle-right").css({"font-size":g}),jQuery(n).find(".bwg-icon-angle-up").css({"font-size":g}),jQuery(n).find(".bwg-icon-angle-down").css({"font-size":g})):(jQuery(n).find(".bwg-icon-angle-left").removeAttr("style"),jQuery(n).find(".bwg-icon-angle-right").removeAttr("style"),jQuery(n).find(".bwg-icon-angle-up").removeAttr("style"),jQuery(n).find(".bwg-icon-angle-down").removeAttr("style"));var d=l+" .bwg_slideshow_filmstrip_thumbnails_"+e;jQuery(d).removeAttr("style"),jQuery(d+" .bwg_slideshow_filmstrip_thumbnail_"+e).each(function(e,t){jQuery(t).attr("style",jQuery(t).attr("data-style")),jQuery(t).find("img").attr("style",jQuery(t).attr("data-style"))});var u="#bwg_container1_"+e+" #bwg_container2_"+e+" .bwg_slideshow_image_container_"+e,h=(jQuery(u).data("filmstrip-position"),jQuery(u).data("filmstrip-size"));jQuery(u).css({filmstrip_position:h});var m="bwg_slideshow_filmstrip_thumbnail_"+e;window.bwg_slideshow_filmstrip_thumb[m].next_prev_index&&(window.bwg_slideshow_filmstrip_thumb[m].next_prev_index=0)}}else 1==bwg_params[e].slideshow_filmstrip_type&&bwg_resize_slideshow_filmstrip_fix_dimension({bwg:e,params:bwg_params[e],parent_width:a}),2==bwg_params[e].slideshow_filmstrip_type&&bwg_resize_slideshow_filmstrip_fix_count({bwg:e,params:bwg_params[e],parent_width:a}),0==bwg_params[e].slideshow_filmstrip_type&&(jQuery(".bwg_slideshow_image_wrap_"+e).css({width:a,height:a*bwg_params[e].image_height/bwg_params[e].image_width}),jQuery(".bwg_slideshow_image_container_"+e).css({width:a-("horizontal"==bwg_params[e].filmstrip_direction?0:bwg_params[e].slideshow_filmstrip_width),height:a*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: "+(a-("horizontal"==bwg_params[e].filmstrip_direction?0:bwg_params[e].slideshow_filmstrip_width))+"px !important; max-height: "+(a*(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_embed_frame_"+e+", .bwg_slideshow_embed_"+e).css({"max-width":a+"px","max-height":a*(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"}),jQuery(".bwg_embed_frame_"+e).attr("data-width",a),jQuery(".bwg_embed_frame_"+e).attr("data-height",a*(bwg_params[e].image_height/bwg_params[e].image_width)-("horizontal"==bwg_params[e].filmstrip_direction?bwg_params[e].slideshow_filmstrip_height:0)-1)),jQuery(".bwg_slideshow_dots_container_"+e).css({width:a}),jQuery("#bwg_slideshow_play_pause-ico_"+e).css({fontSize:a*(bwg_params[e].slideshow_play_pause_btn_size/bwg_params[e].image_width)}),jQuery(".bwg_slideshow_watermark_image_"+e).css({maxWidth:a*(bwg_params[e].watermark_width/bwg_params[e].image_width),maxHeight:a*(bwg_params[e].watermark_height/bwg_params[e].image_width)}),jQuery(".bwg_slideshow_watermark_text_"+e+", .bwg_slideshow_watermark_text_"+e+":hover").css({fontSize:a*(bwg_params[e].watermark_font_size/bwg_params[e].image_width)}),jQuery(".bwg_slideshow_title_text_"+e).css({fontSize:2*a*bwg_params[e].slideshow_title_font_size/bwg_params[e].image_width}),jQuery(".bwg_slideshow_description_text_"+e).css({fontSize:2*a*bwg_params[e].slideshow_description_font_size/bwg_params[e].image_width});var c=jQuery(".bwg_slide_container_"+e),p=c.width(),y=c.height();jQuery(".bwg_popup_embed").css({width:p+"px",height:y+"px"}),r[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,i,a,r){void 0!==r&&""!==r?bwg_change_image_slideshow(e,t,i,a,r):bwg_change_image_lightbox(e,t,i=gallery_box_data.data,a)}function bwg_resize_instagram_post(e){var t=!1;if(void 0!==e&&""!==e){if(jQuery(".inner_instagram_iframe_bwg_embed_frame_"+e).length){t=!0;var i=jQuery("#instagram-embed-"+e),a=jQuery(".bwg_slideshow_embed_"+e),r=jQuery(".bwg_embed_frame_"+e),_=void 0!==a.width()?a.width():jQuery(".bwg_slideshow_embed_"+e).width(),s=void 0!==a.height()?a.height():jQuery(".bwg_slideshow_embed_"+e).height(),o=r.data("instagram-width"),l=r.data("instagram-height");bwg_change_watermark_container(e)}}else if(jQuery(".inner_instagram_iframe_bwg_embed_frame").length){t=!0;i=jQuery(".instagram-media"),r=jQuery(".bwg_embed_frame"),_=jQuery(".bwg_image_container").width(),s=jQuery(".bwg_image_container").height(),o=r.data("instagram-width"),l=r.data("instagram-height");bwg_change_watermark_container()}if(!0===t){var n=bwg_resizing_ratio(o,l,_,s);r.attr("data-width",_),r.attr("data-height",s);var g=n.width;g<n.height?g-=109:g+=109,r.css({width:"100%",height:"100%","max-width":_,"max-height":s}),i.css({"min-width":g+"px !important","max-height":s+"px"})}}function bwg_play(t,i){if(void 0!==i&&""!==i)t=bwg_params[i].data;void 0!==i&&""!==i?(window.clearInterval(window["bwg_playInterval"+i]),window["bwg_playInterval"+i]=setInterval(function(){var e=1;1==bwg_params[i].enable_slideshow_shuffle&&(e=Math.floor((t.length-1)*Math.random()+1)),bwg_change_image(parseInt(jQuery("#bwg_current_image_key_"+i).val()),(parseInt(jQuery("#bwg_current_image_key_"+i).val())+e)%t.length,t,"",i)},1e3*bwg_params[i].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):1==gallery_box_data.enable_loop&&bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),0))},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)}var i=(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;jQuery(".bwg_embed_frame_instapost_"+e).height(i),jQuery(".inner_instagram_iframe_bwg_embed_frame_instapost_"+e).find('iframe[id^="instagram-embed-"]').css({"max-height":i+"px"});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")}function bwg_resizing_ratio(e,t,i,a){var r=[i/e,a/t];return{width:e*(r=Math.min(r[0],r[1])),height:t*r}}function bwg_slideshow_filmstrip_next(e){var t=e.bwg,i=e.params,a=e.slideshow_filmstrip_class_name,r=bwg_calculate_slideshow_filmstrip_thumbnail_size({bwg:t,params:i}),_="bwg_slideshow_filmstrip_thumbnail_"+t,s="#bwg_container1_"+t+" #bwg_container2_"+t+" .bwg_slideshow_filmstrip_left_"+t,o="#bwg_container1_"+t+" #bwg_container2_"+t+" .bwg_slideshow_filmstrip_left_disabled_"+t,l="#bwg_container1_"+t+" #bwg_container2_"+t+" .bwg_slideshow_filmstrip_right_"+t,n="#bwg_container1_"+t+" #bwg_container2_"+t+" .bwg_slideshow_filmstrip_right_disabled_"+t,g="horizontal"==i.filmstrip_direction?"table-cell":"block";"left"==i.left_or_top?"width"==i.width_or_height?(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).position().left>=-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).width()-jQuery(a).width())&&(jQuery(s).css({display:g}),jQuery(o).css({display:"none"}),jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).position().left<-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).width()-jQuery(a).width()-(parseInt(i.filmstrip_thumb_margin_hor)+r))?jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).animate({left:-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).width()-jQuery(a).width())},500,"linear"):jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).animate({left:jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).position().left-(parseInt(i.filmstrip_thumb_margin_hor)+r)},500,"linear")),window.setTimeout(function(){parseInt(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).position().left)==-parseInt(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).width()-jQuery(a).width())?(jQuery(l).css({display:"none"}),jQuery(n).css({display:g})):(jQuery(l).css({display:g}),jQuery(n).css({display:"none"}))},510)):(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).position().left>=-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).height()-jQuery(a).height())&&(jQuery(s).css({display:g}),jQuery(o).css({display:"none"}),jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).position().left<-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).height()-jQuery(a).height()-(parseInt(i.filmstrip_thumb_margin_hor)+r))?jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).animate({left:-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).height()-jQuery(a).height())},500,"linear"):jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).animate({left:jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).position().left-(parseInt(i.filmstrip_thumb_margin_hor)+r)},500,"linear")),window.setTimeout(function(){parseInt(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).position().left)==-parseInt(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).height()-jQuery(a).height())?(jQuery(l).css({display:"none"}),jQuery(n).css({display:g})):(jQuery(l).css({display:g}),jQuery(n).css({display:"none"}))},510)):"width"==i.width_or_height?(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).position().top>=-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).width()-jQuery(a).width())&&(jQuery(s).css({display:g}),jQuery(o).css({display:"none"}),jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).position().top<-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).width()-jQuery(a).width()-parseInt(i.filmstrip_thumb_margin_hor)+r)?jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).animate({top:-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).width()-jQuery(a).width())},500,"linear"):jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).animate({top:jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).position().top-parseInt(i.filmstrip_thumb_margin_hor)+r},500,"linear")),window.setTimeout(function(){parseInt(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).position().top)==-parseInt(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).width()-jQuery(a).width())?(jQuery(l).css({display:"none"}),jQuery(n).css({display:g})):(jQuery(l).css({display:g}),jQuery(n).css({display:"none"}))},510)):(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).position().top>=-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).height()-jQuery(a).height())&&(jQuery(s).css({display:g}),jQuery(o).css({display:"none"}),jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).position().top<-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).height()-jQuery(a).height()-(parseInt(i.filmstrip_thumb_margin_hor)+r))?jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).animate({top:-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).height()-jQuery(a).height())},500,"linear"):jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).animate({top:jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).position().top-(parseInt(i.filmstrip_thumb_margin_hor)+r)},500,"linear")),window.setTimeout(function(){parseInt(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).position().top)==-parseInt(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).height()-jQuery(a).height())?(jQuery(l).css({display:"none"}),jQuery(n).css({display:g})):(jQuery(l).css({display:g}),jQuery(n).css({display:"none"}))},510)),bwg_slideshow_filmstrip_thumb[_].next_prev_index=bwg_slideshow_filmstrip_thumb[_].next_prev_index+1}function bwg_slideshow_filmstrip_prev(e){var t=e.bwg,i=e.params,a=bwg_calculate_slideshow_filmstrip_thumbnail_size({bwg:t,params:i}),r="bwg_slideshow_filmstrip_thumbnail_"+t,_="#bwg_container1_"+t+" #bwg_container2_"+t+" .bwg_slideshow_filmstrip_left_"+t,s="#bwg_container1_"+t+" #bwg_container2_"+t+" .bwg_slideshow_filmstrip_left_disabled_"+t,o="#bwg_container1_"+t+" #bwg_container2_"+t+" .bwg_slideshow_filmstrip_right_"+t,l="#bwg_container1_"+t+" #bwg_container2_"+t+" .bwg_slideshow_filmstrip_right_disabled_"+t,n="horizontal"==i.filmstrip_direction?"table-cell":"block";"left"==i.left_or_top?(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).position().left<0&&(jQuery(o).css({display:n}),jQuery(l).css({display:"none"}),jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).position().left>-(i.filmstrip_thumb_margin_hor+a)?jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).animate({left:0},500,"linear"):jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).animate({left:jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).position().left+parseInt(i.filmstrip_thumb_margin_hor)+a},500,"linear")),window.setTimeout(function(){0==parseInt(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).position().left)?(jQuery(_).css({display:"none"}),jQuery(s).css({display:n})):(jQuery(_).css({display:n}),jQuery(s).css({display:"none"}))},510)):(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).position().top<0&&(jQuery(o).css({display:n}),jQuery(l).css({display:"none"}),jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).position().top>-(i.filmstrip_thumb_margin_hor+a)?jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).animate({top:0},500,"linear"):jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).animate({top:jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).position().top+parseInt(i.filmstrip_thumb_margin_hor)+a},500,"linear")),window.setTimeout(function(){0==parseInt(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+t).position().top)?(jQuery(_).css({display:"none"}),jQuery(s).css({display:n})):(jQuery(_).css({display:n}),jQuery(s).css({display:"none"}))},510)),bwg_slideshow_filmstrip_thumb[r].next_prev_index=bwg_slideshow_filmstrip_thumb[r].next_prev_index-1}jQuery(function(){isMobile&&(jQuery(".bwg-container.bwg-standard-thumbnails .bwg-title1, .bwg-container.bwg-masonry-thumbnails .bwg-title1, .bwg-mosaic-thumbnails").css("opacity","1"),jQuery(".bwg-zoom-effect .bwg-zoom-effect-overlay, .bwg-zoom-effect-overlay > span").css({opacity:1,"background-color":"unset"}))}),jQuery(function(){function i(e){bwg_slideshow_blur(e),bwg_carousel_blur(e),0<jQuery(".bwg_play_pause").length&&window.clearInterval(gallery_box_data.bwg_playInterval)}function a(e){e&&bwg_main_ready(e),bwg_slideshow_focus(),bwg_carousel_focus(),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)}var r=!1;jQuery(".bwg_container").each(function(){if(0<jQuery(this).find(".wd_error").length&&(r=!0),!r){var e=jQuery(this);if(e[0].offsetHeight)var t=0;else t=1;setInterval(function(){e[0].offsetHeight?1==t&&(t=0,a(e)):0==t&&i(!(t=1))},200)}}),r||jQuery(window).focus(function(){a()}).blur(function(){i(!0)})}),jQuery(window).on("resize",function(){setTimeout(function(){var e=!1;jQuery(".bwg_container").each(function(){0<jQuery(this).find(".wd_error").length&&(e=!0)}),bwg_tags_button_section_visibility(),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()},0)}),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)});
// source --> https://onepairofshoes.com/wp-content/plugins/wonderplugin-gallery/engine/wonderplugingallery.js?ver=1.5 
/** Wonderplugin Gallery - WordPress Photo Video Gallery Plugin
 * Copyright 2013 Magic Hills Pty Ltd All Rights Reserved
 * Website: http://www.wonderplugin.com
 * Version 1.5 
 */
(function(){var scripts=document.getElementsByTagName("script");var jsFolder="";for(var i=0;i<scripts.length;i++)if(scripts[i].src&&scripts[i].src.match(/wonderplugingallery\.js/i))jsFolder=scripts[i].src.substr(0,scripts[i].src.lastIndexOf("/")+1);var loadjQuery=false;if(typeof jQuery=="undefined")loadjQuery=true;else{var jVersion=jQuery.fn.jquery.split(".");if(jVersion[0]<1||jVersion[0]==1&&jVersion[1]<6)loadjQuery=true}if(loadjQuery){var head=document.getElementsByTagName("head")[0];var script=
document.createElement("script");script.setAttribute("type","text/javascript");if(script.readyState)script.onreadystatechange=function(){if(script.readyState=="loaded"||script.readyState=="complete"){script.onreadystatechange=null;loadHtml5Gallery(jsFolder)}};else script.onload=function(){loadHtml5Gallery(jsFolder)};script.setAttribute("src",jsFolder+"jquery.js");head.appendChild(script)}else loadHtml5Gallery(jsFolder)})();
function loadHtml5Gallery(jsFolder){jQuery.easing["jswing"]=jQuery.easing["swing"];jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d)},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*(--t*(t-2)-1)+b},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b},easeOutCubic:function(x,t,b,c,d){return c*
((t=t/d-1)*t*t+1)+b},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b},easeInOutQuint:function(x,t,b,c,d){if((t/=
d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b},easeInExpo:function(x,t,b,c,d){return t==0?b:c*Math.pow(2,10*(t/d-1))+b},easeOutExpo:function(x,t,b,c,d){return t==d?b+c:c*(-Math.pow(2,-10*t/d)+1)+b},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=
d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*0.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=
p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*2*Math.PI/p))+b},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*0.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*2*Math.PI/p)+c+b},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*0.3*1.5;if(a<Math.abs(c)){a=c;var s=
p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-0.5*a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*2*Math.PI/p)+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*2*Math.PI/p)*0.5+c+b},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*t*t*(((s*=1.525)+1)*t-s)+b;return c/
2*((t-=2)*t*(((s*=1.525)+1)*t+s)+2)+b},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b},easeOutBounce:function(x,t,b,c,d){if((t/=d)<1/2.75)return c*7.5625*t*t+b;else if(t<2/2.75)return c*(7.5625*(t-=1.5/2.75)*t+0.75)+b;else if(t<2.5/2.75)return c*(7.5625*(t-=2.25/2.75)*t+0.9375)+b;else return c*(7.5625*(t-=2.625/2.75)*t+0.984375)+b},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*0.5+b;return jQuery.easing.easeOutBounce(x,
t*2-d,0,c,d)*0.5+c*0.5+b}});(function($){$.fn.touchSwipe=function(options){var defaults={preventWebBrowser:false,swipeLeft:null,swipeRight:null,swipeTop:null,swipeBottom:null};if(options)$.extend(defaults,options);return this.each(function(){var startX=-1,startY=-1;var curX=-1,curY=-1;function touchStart(event){var e=event.originalEvent;if(e.targetTouches.length>=1){startX=e.targetTouches[0].pageX;startY=e.targetTouches[0].pageY}else touchCancel(event)}function touchMove(event){if(defaults.preventWebBrowser)event.preventDefault();
var e=event.originalEvent;if(e.targetTouches.length>=1){curX=e.targetTouches[0].pageX;curY=e.targetTouches[0].pageY}else touchCancel(event)}function touchEnd(event){if(curX>0||curY>0){triggerHandler();touchCancel(event)}else touchCancel(event)}function touchCancel(event){startX=-1;startY=-1;curX=-1;curY=-1}function triggerHandler(){if(Math.abs(curX-startX)>100)if(curX>startX){if(defaults.swipeRight)defaults.swipeRight.call()}else if(defaults.swipeLeft)defaults.swipeLeft.call();if(Math.abs(curY-startY)>
100)if(curY>startY){if(defaults.swipeBottom)defaults.swipeBottom.call()}else if(defaults.swipeTop)defaults.swipeTop.call()}try{$(this).bind("touchstart",touchStart);$(this).bind("touchmove",touchMove);$(this).bind("touchend",touchEnd);$(this).bind("touchcancel",touchCancel)}catch(e){}})}})(jQuery);(function($){$.fn.drag=function(str,arg,opts){var type=typeof str=="string"?str:"",fn=$.isFunction(str)?str:$.isFunction(arg)?arg:null;if(type.indexOf("drag")!==0)type="drag"+type;opts=(str==fn?arg:opts)||
{};return fn?this.bind(type,opts,fn):this.trigger(type)};var $event=$.event;var $special=$event.special;var drag=null;drag=$special.drag={defaults:{which:1,distance:0,not:":input",handle:null,relative:false,drop:true,click:false},datakey:"dragdata",livekey:"livedrag",add:function(obj){var data=$.data(this,drag.datakey),opts=obj.data||{};data.related+=1;if(!data.live&&obj.selector){data.live=true;$event.add(this,"draginit."+drag.livekey,drag.delegate)}$.each(drag.defaults,function(key,def){if(opts[key]!==
undefined)data[key]=opts[key]})},remove:function(){$.data(this,drag.datakey).related-=1},setup:function(){if($.data(this,drag.datakey))return;var data=$.extend({related:0},drag.defaults);$.data(this,drag.datakey,data);$event.add(this,"mousedown",drag.init,data);if(this.attachEvent)this.attachEvent("ondragstart",drag.dontstart)},teardown:function(){if($.data(this,drag.datakey).related)return;$.removeData(this,drag.datakey);$event.remove(this,"mousedown",drag.init);$event.remove(this,"draginit",drag.delegate);
drag.textselect(true);if(this.detachEvent)this.detachEvent("ondragstart",drag.dontstart)},init:function(event){var dd=event.data,results;if(dd.which>0&&event.which!=dd.which)return;if($(event.target).is(dd.not))return;if(dd.handle&&!$(event.target).closest(dd.handle,event.currentTarget).length)return;dd.propagates=1;dd.interactions=[drag.interaction(this,dd)];dd.target=event.target;dd.pageX=event.pageX;dd.pageY=event.pageY;dd.dragging=null;results=drag.hijack(event,"draginit",dd);if(!dd.propagates)return;
results=drag.flatten(results);if(results&&results.length){dd.interactions=[];$.each(results,function(){dd.interactions.push(drag.interaction(this,dd))})}dd.propagates=dd.interactions.length;if(dd.drop!==false&&$special.drop)$special.drop.handler(event,dd);drag.textselect(false);$event.add(document,"mousemove mouseup",drag.handler,dd);return false},interaction:function(elem,dd){return{drag:elem,callback:new drag.callback,droppable:[],offset:$(elem)[dd.relative?"position":"offset"]()||{top:0,left:0}}},
handler:function(event){var dd=event.data;switch(event.type){case !dd.dragging&&"mousemove":if(Math.pow(event.pageX-dd.pageX,2)+Math.pow(event.pageY-dd.pageY,2)<Math.pow(dd.distance,2))break;event.target=dd.target;drag.hijack(event,"dragstart",dd);if(dd.propagates)dd.dragging=true;case "mousemove":if(dd.dragging){drag.hijack(event,"drag",dd);if(dd.propagates){if(dd.drop!==false&&$special.drop)$special.drop.handler(event,dd);break}event.type="mouseup"}case "mouseup":$event.remove(document,"mousemove mouseup",
drag.handler);if(dd.dragging){if(dd.drop!==false&&$special.drop)$special.drop.handler(event,dd);drag.hijack(event,"dragend",dd)}drag.textselect(true);if(dd.click===false&&dd.dragging){jQuery.event.triggered=true;setTimeout(function(){jQuery.event.triggered=false},20);dd.dragging=false}break}},delegate:function(event){var elems=[],target,events=$.data(this,"events")||{};$.each(events.live||[],function(i,obj){if(obj.preType.indexOf("drag")!==0)return;target=$(event.target).closest(obj.selector,event.currentTarget)[0];
if(!target)return;$event.add(target,obj.origType+"."+drag.livekey,obj.origHandler,obj.data);if($.inArray(target,elems)<0)elems.push(target)});if(!elems.length)return false;return $(elems).bind("dragend."+drag.livekey,function(){$event.remove(this,"."+drag.livekey)})},hijack:function(event,type,dd,x,elem){if(!dd)return;var orig={event:event.originalEvent,type:event.type},mode=type.indexOf("drop")?"drag":"drop",result,i=x||0,ia,callback,len=!isNaN(x)?x:dd.interactions.length;event.type=type;event.originalEvent=
null;dd.results=[];do if(ia=dd.interactions[i]){if(type!=="dragend"&&ia.cancelled)continue;callback=drag.properties(event,dd,ia);ia.results=[];$(elem||ia[mode]||dd.droppable).each(function(p,subject){callback.target=subject;result=subject?$event.handle.call(subject,event,callback):null;if(result===false){if(mode=="drag"){ia.cancelled=true;dd.propagates-=1}if(type=="drop")ia[mode][p]=null}else if(type=="dropinit")ia.droppable.push(drag.element(result)||subject);if(type=="dragstart")ia.proxy=$(drag.element(result)||
ia.drag)[0];ia.results.push(result);delete event.result;if(type!=="dropinit")return result});dd.results[i]=drag.flatten(ia.results);if(type=="dropinit")ia.droppable=drag.flatten(ia.droppable);if(type=="dragstart"&&!ia.cancelled)callback.update()}while(++i<len);event.type=orig.type;event.originalEvent=orig.event;return drag.flatten(dd.results)},properties:function(event,dd,ia){var obj=ia.callback;obj.drag=ia.drag;obj.proxy=ia.proxy||ia.drag;obj.startX=dd.pageX;obj.startY=dd.pageY;obj.deltaX=event.pageX-
dd.pageX;obj.deltaY=event.pageY-dd.pageY;obj.originalX=ia.offset.left;obj.originalY=ia.offset.top;obj.offsetX=event.pageX-(dd.pageX-obj.originalX);obj.offsetY=event.pageY-(dd.pageY-obj.originalY);obj.drop=drag.flatten((ia.drop||[]).slice());obj.available=drag.flatten((ia.droppable||[]).slice());return obj},element:function(arg){if(arg&&(arg.jquery||arg.nodeType==1))return arg},flatten:function(arr){return $.map(arr,function(member){return member&&member.jquery?$.makeArray(member):member&&member.length?
drag.flatten(member):member})},textselect:function(bool){$(document)[bool?"unbind":"bind"]("selectstart",drag.dontstart).attr("unselectable",bool?"off":"on").css("MozUserSelect",bool?"":"none")},dontstart:function(){return false},callback:function(){}};drag.callback.prototype={update:function(){if($special.drop&&this.available.length)$.each(this.available,function(i){$special.drop.locate(this,i)})}};$special.draginit=$special.dragstart=$special.dragend=drag})(jQuery);(function($){$.fn.html5boxTransition=
function(id,$prev,$next,transition,callback){$parent=this;var effects=transition.effect;var easing=transition.easing;var duration=transition.duration;var direction=transition.direction;var effect=null;if(effects){effects=effects.split(",");effect=effects[Math.floor(Math.random()*effects.length)];effect=$.trim(effect.toLowerCase())}if(effect&&transition[effect]){if(transition[effect].duration)duration=transition[effect].duration;if(transition[effect].easing)easing=transition[effect].easing}if(effect==
"fade"){$next.show();$prev.fadeOut(duration,easing,function(){$prev.remove();callback()})}else if(effect=="crossfade"||effect=="fadeout"){$next.hide();$prev.fadeOut(duration/2,easing,function(){$next.fadeIn(duration/2,easing,function(){$prev.remove();callback()})})}else if(effect=="slide"){$parent.css({overflow:"hidden"});if(direction){$next.css({left:"100%"});$next.animate({left:"0%"},duration,easing);$prev.animate({left:"-100%"},duration,easing,function(){$prev.remove();callback()})}else{$next.css({left:"-100%"});
$next.animate({left:"0%"},duration,easing);$prev.animate({left:"100%"},duration,easing,function(){$prev.remove();callback()})}}else{$next.show();$prev.remove();callback()}}})(jQuery);(function($){$.fn.addHTML5VideoControls=function(skinFolder,parentInst){var isTouch="ontouchstart"in window;var eStart=isTouch?"touchstart":"mousedown";var eMove=isTouch?"touchmove":"mousemove";var eCancel=isTouch?"touchcancel":"mouseup";var eClick=isTouch?"touchstart":"click";var BUTTON_SIZE=32;var BAR_HEIGHT=isTouch?
48:36;var hideControlsTimerId=null;var hideVolumeBarTimeoutId=null;var sliderDragging=false;var isFullscreen=false;var userActive=true;var isIPhone=navigator.userAgent.match(/iPod/i)!=null||navigator.userAgent.match(/iPhone/i)!=null;var isHd=$(this).data("ishd");var hd=$(this).data("hd");var src=$(this).data("src");var $videoObj=$(this);$videoObj.get(0).removeAttribute("controls");if(isIPhone){var h=$videoObj.height()-BAR_HEIGHT;$videoObj.css({height:h})}var $videoPlay=$("<div class='html5boxVideoPlay'></div>");
if(!isIPhone){$videoObj.after($videoPlay);$videoPlay.css({position:"absolute",top:"50%",left:"50%",display:"block",cursor:"pointer",width:64,height:64,"margin-left":-32,"margin-top":-32,"background-image":"url('"+skinFolder+"html5boxplayer_playvideo.png"+"')","background-position":"center center","background-repeat":"no-repeat"}).bind(eClick,function(){$videoObj.get(0).play()})}var $videoFullscreenBg=$("<div class='html5boxVideoFullscreenBg'></div>");var $videoControls=$("<div class='html5boxVideoControls'>"+
"<div class='html5boxVideoControlsBg'></div>"+"<div class='html5boxPlayPause'>"+"<div class='html5boxPlay'></div>"+"<div class='html5boxPause'></div>"+"</div>"+"<div class='html5boxTimeCurrent'>--:--</div>"+"<div class='html5boxFullscreen'></div>"+"<div class='html5boxHD'></div>"+"<div class='html5boxVolume'>"+"<div class='html5boxVolumeButton'></div>"+"<div class='html5boxVolumeBar'>"+"<div class='html5boxVolumeBarBg'>"+"<div class='html5boxVolumeBarActive'></div>"+"</div>"+"</div>"+"</div>"+"<div class='html5boxTimeTotal'>--:--</div>"+
"<div class='html5boxSeeker'>"+"<div class='html5boxSeekerBuffer'></div>"+"<div class='html5boxSeekerPlay'></div>"+"<div class='html5boxSeekerHandler'></div>"+"</div>"+"<div style='clear:both;'></div>"+"</div>");$videoObj.after($videoControls);$videoObj.after($videoFullscreenBg);$videoFullscreenBg.css({display:"none",position:"fixed",left:0,top:0,bottom:0,right:0,"z-index":2147483647});$videoControls.css({display:"block",position:"absolute",width:"100%",height:BAR_HEIGHT,left:0,bottom:0});var userActivate=
function(){userActive=true};$videoObj.bind(eClick,function(){userActive=true}).hover(function(){userActive=true},function(){userActive=false});setInterval(function(){if(userActive){$videoControls.show();userActive=false;clearTimeout(hideControlsTimerId);hideControlsTimerId=setTimeout(function(){if(!$videoObj.get(0).paused)$videoControls.fadeOut()},5E3)}},250);$(".html5boxVideoControlsBg",$videoControls).css({display:"block",position:"absolute",width:"100%",height:"100%",left:0,top:0,"background-color":"#000000",
opacity:0.7,filter:"alpha(opacity=70)"});$(".html5boxPlayPause",$videoControls).css({display:"block",position:"relative",width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",margin:Math.floor((BAR_HEIGHT-BUTTON_SIZE)/2),"float":"left"});var $videoBtnPlay=$(".html5boxPlay",$videoControls);var $videoBtnPause=$(".html5boxPause",$videoControls);$videoBtnPlay.css({display:"block",position:"absolute",top:0,left:0,width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",cursor:"pointer","background-image":"url('"+skinFolder+
"html5boxplayer_playpause.png"+"')","background-position":"top left"}).hover(function(){$(this).css({"background-position":"bottom left"})},function(){$(this).css({"background-position":"top left"})}).bind(eClick,function(){$videoObj.get(0).play()});$videoBtnPause.css({display:"none",position:"absolute",top:0,left:0,width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",cursor:"pointer","background-image":"url('"+skinFolder+"html5boxplayer_playpause.png"+"')","background-position":"top right"}).hover(function(){$(this).css({"background-position":"bottom right"})},
function(){$(this).css({"background-position":"top right"})}).bind(eClick,function(){$videoObj.get(0).pause()});var $videoTimeCurrent=$(".html5boxTimeCurrent",$videoControls);var $videoTimeTotal=$(".html5boxTimeTotal",$videoControls);var $videoSeeker=$(".html5boxSeeker",$videoControls);var $videoSeekerPlay=$(".html5boxSeekerPlay",$videoControls);var $videoSeekerBuffer=$(".html5boxSeekerBuffer",$videoControls);var $videoSeekerHandler=$(".html5boxSeekerHandler",$videoControls);$videoTimeCurrent.css({display:"block",
position:"relative","float":"left","line-height":BAR_HEIGHT+"px","font-weight":"normal","font-size":"12px",margin:"0 8px","font-family":"Arial, Helvetica, sans-serif",color:"#fff"});$videoTimeTotal.css({display:"block",position:"relative","float":"right","line-height":BAR_HEIGHT+"px","font-weight":"normal","font-size":"12px",margin:"0 8px","font-family":"Arial, Helvetica, sans-serif",color:"#fff"});$videoSeeker.css({display:"block",cursor:"pointer",overflow:"hidden",position:"relative",height:"10px",
"background-color":"#222",margin:Math.floor((BAR_HEIGHT-10)/2)+"px 4px"}).bind(eStart,function(e){var e0=isTouch?e.originalEvent.touches[0]:e;var pos=e0.pageX-$videoSeeker.offset().left;$videoSeekerPlay.css({width:pos});$videoObj.get(0).currentTime=pos*$videoObj.get(0).duration/$videoSeeker.width();$videoSeeker.bind(eMove,function(e){var e0=isTouch?e.originalEvent.touches[0]:e;var pos=e0.pageX-$videoSeeker.offset().left;$videoSeekerPlay.css({width:pos});$videoObj.get(0).currentTime=pos*$videoObj.get(0).duration/
$videoSeeker.width()})}).bind(eCancel,function(){$videoSeeker.unbind(eMove)});$videoSeekerBuffer.css({display:"block",position:"absolute",left:0,top:0,height:"100%","background-color":"#444"});$videoSeekerPlay.css({display:"block",position:"absolute",left:0,top:0,height:"100%","background-color":"#fcc500"});if(!isIPhone&&($videoObj.get(0).requestFullscreen||$videoObj.get(0).webkitRequestFullScreen||$videoObj.get(0).mozRequestFullScreen||$videoObj.get(0).webkitEnterFullScreen||$videoObj.get(0).msRequestFullscreen)){var switchScreen=
function(fullscreen){if(fullscreen){if($videoObj.get(0).requestFullscreen)$videoObj.get(0).requestFullscreen();else if($videoObj.get(0).webkitRequestFullScreen)$videoObj.get(0).webkitRequestFullScreen();else if($videoObj.get(0).mozRequestFullScreen)$videoObj.get(0).mozRequestFullScreen();else if($videoObj.get(0).webkitEnterFullScreen)$videoObj.get(0).webkitEnterFullScreen();if($videoObj.get(0).msRequestFullscreen)$videoObj.get(0).msRequestFullscreen()}else if(document.cancelFullScreen)document.cancelFullScreen();
else if(document.mozCancelFullScreen)document.mozCancelFullScreen();else if(document.webkitCancelFullScreen)document.webkitCancelFullScreen();else if(document.webkitExitFullscreen)document.webkitExitFullscreen();else if(document.msExitFullscreen)document.msExitFullscreen()};var switchScreenCSS=function(fullscreen){$videoControls.css({position:fullscreen?"fixed":"absolute"});var backgroundPosY=$videoFullscreen.css("background-position")?$videoFullscreen.css("background-position").split(" ")[1]:$videoFullscreen.css("background-position-y");
$videoFullscreen.css({"background-position":(fullscreen?"right":"left")+" "+backgroundPosY});$videoFullscreenBg.css({display:fullscreen?"block":"none"});if(fullscreen){$(document).bind("mousemove",userActivate);$videoControls.css({"z-index":2147483647})}else{$(document).unbind("mousemove",userActivate);$videoControls.css({"z-index":""})}};document.addEventListener("fullscreenchange",function(){isFullscreen=document.fullscreen;switchScreenCSS(document.fullscreen)},false);document.addEventListener("mozfullscreenchange",
function(){isFullscreen=document.mozFullScreen;switchScreenCSS(document.mozFullScreen)},false);document.addEventListener("webkitfullscreenchange",function(){isFullscreen=document.webkitIsFullScreen;switchScreenCSS(document.webkitIsFullScreen)},false);$videoObj.get(0).addEventListener("webkitbeginfullscreen",function(){isFullscreen=true},false);$videoObj.get(0).addEventListener("webkitendfullscreen",function(){isFullscreen=false},false);$("head").append("<style type='text/css'>video::-webkit-media-controls { display:none !important; }</style>");
var $videoFullscreen=$(".html5boxFullscreen",$videoControls);$videoFullscreen.css({display:"block",position:"relative","float":"right",width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",margin:Math.floor((BAR_HEIGHT-BUTTON_SIZE)/2),cursor:"pointer","background-image":"url('"+skinFolder+"html5boxplayer_fullscreen.png"+"')","background-position":"left top"}).hover(function(){var backgroundPosX=$(this).css("background-position")?$(this).css("background-position").split(" ")[0]:$(this).css("background-position-x");
$(this).css({"background-position":backgroundPosX+" bottom"})},function(){var backgroundPosX=$(this).css("background-position")?$(this).css("background-position").split(" ")[0]:$(this).css("background-position-x");$(this).css({"background-position":backgroundPosX+" top"})}).bind(eClick,function(){isFullscreen=!isFullscreen;switchScreen(isFullscreen)})}if(hd){var $videoHD=$(".html5boxHD",$videoControls);$videoHD.css({display:"block",position:"relative","float":"right",width:BUTTON_SIZE+"px",height:BUTTON_SIZE+
"px",margin:Math.floor((BAR_HEIGHT-BUTTON_SIZE)/2),cursor:"pointer","background-image":"url('"+skinFolder+"html5boxplayer_hd.png"+"')","background-position":(isHd?"right":"left")+" center"}).bind(eClick,function(){isHd=!isHd;$(this).css({"background-position":(isHd?"right":"left")+" center"});parentInst.isHd=isHd;var isPaused=$videoObj.get(0).isPaused;$videoObj.get(0).setAttribute("src",(isHd?hd:src)+"#t="+$videoObj.get(0).currentTime);if(!isPaused)$videoObj.get(0).play();else if(!isIPhone)$videoObj.get(0).pause()})}var volume=
$videoObj.get(0).volume;$videoObj.get(0).volume=volume/2+0.1;if($videoObj.get(0).volume===volume/2+0.1){$videoObj.get(0).volume=volume;var $videoVolume=$(".html5boxVolume",$videoControls);var $videoVolumeButton=$(".html5boxVolumeButton",$videoControls);var $videoVolumeBar=$(".html5boxVolumeBar",$videoControls);var $videoVolumeBarBg=$(".html5boxVolumeBarBg",$videoControls);var $videoVolumeBarActive=$(".html5boxVolumeBarActive",$videoControls);$videoVolume.css({display:"block",position:"relative","float":"right",
width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",margin:Math.floor((BAR_HEIGHT-BUTTON_SIZE)/2)}).hover(function(){clearTimeout(hideVolumeBarTimeoutId);var volume=$videoObj.get(0).volume;$videoVolumeBarActive.css({height:Math.round(volume*100)+"%"});$videoVolumeBar.show()},function(){clearTimeout(hideVolumeBarTimeoutId);hideVolumeBarTimeoutId=setTimeout(function(){$videoVolumeBar.hide()},1E3)});$videoVolumeButton.css({display:"block",position:"absolute",top:0,left:0,width:BUTTON_SIZE+"px",height:BUTTON_SIZE+
"px",cursor:"pointer","background-image":"url('"+skinFolder+"html5boxplayer_volume.png"+"')","background-position":"top left"}).hover(function(){var backgroundPosX=$(this).css("background-position")?$(this).css("background-position").split(" ")[0]:$(this).css("background-position-x");$(this).css({"background-position":backgroundPosX+" bottom"})},function(){var backgroundPosX=$(this).css("background-position")?$(this).css("background-position").split(" ")[0]:$(this).css("background-position-x");$(this).css({"background-position":backgroundPosX+
" top"})}).bind(eClick,function(){var volume=$videoObj.get(0).volume;if(volume>0){volumeSaved=volume;volume=0}else volume=volumeSaved;var backgroundPosY=$(this).css("background-position")?$(this).css("background-position").split(" ")[1]:$(this).css("background-position-y");$videoVolumeButton.css({"background-position":(volume>0?"left":"right")+" "+backgroundPosY});$videoObj.get(0).volume=volume;$videoVolumeBarActive.css({height:Math.round(volume*100)+"%"})});$videoVolumeBar.css({display:"none",position:"absolute",
left:4,bottom:"100%",width:24,height:80,"margin-bottom":Math.floor((BAR_HEIGHT-BUTTON_SIZE)/2),"background-color":"#000000",opacity:0.7,filter:"alpha(opacity=70)"});$videoVolumeBarBg.css({display:"block",position:"relative",width:10,height:68,margin:7,cursor:"pointer","background-color":"#222"});$videoVolumeBarActive.css({display:"block",position:"absolute",bottom:0,left:0,width:"100%",height:"100%","background-color":"#fcc500"});$videoVolumeBarBg.bind(eStart,function(e){var e0=isTouch?e.originalEvent.touches[0]:
e;var vol=1-(e0.pageY-$videoVolumeBarBg.offset().top)/$videoVolumeBarBg.height();vol=vol>1?1:vol<0?0:vol;$videoVolumeBarActive.css({height:Math.round(vol*100)+"%"});$videoVolumeButton.css({"background-position":"left "+(vol>0?"top":"bottom")});$videoObj.get(0).volume=vol;$videoVolumeBarBg.bind(eMove,function(e){var e0=isTouch?e.originalEvent.touches[0]:e;var vol=1-(e0.pageY-$videoVolumeBarBg.offset().top)/$videoVolumeBarBg.height();vol=vol>1?1:vol<0?0:vol;$videoVolumeBarActive.css({height:Math.round(vol*
100)+"%"});$videoVolumeButton.css({"background-position":"left "+(vol>0?"top":"bottom")});$videoObj.get(0).volume=vol})}).bind(eCancel,function(){$videoVolumeBarBg.unbind(eMove)})}var calcTimeFormat=function(seconds){var h0=Math.floor(seconds/3600);var h=h0<10?"0"+h0:h0;var m0=Math.floor((seconds-h0*60)/60);var m=m0<10?"0"+m0:m0;var s0=Math.floor(seconds-(h0*3600+m0*60));var s=s0<10?"0"+s0:s0;var r=m+":"+s;if(h0>0)r=h+":"+r;return r};var onVideoPlay=function(){$videoPlay.hide();$videoBtnPlay.hide();
$videoBtnPause.show()};var onVideoPause=function(){$videoControls.show();clearTimeout(hideControlsTimerId);$videoPlay.show();$videoBtnPlay.show();$videoBtnPause.hide()};var onVideoUpdate=function(){var curTime=$videoObj.get(0).currentTime;if(curTime){$videoTimeCurrent.text(calcTimeFormat(curTime));var duration=$videoObj.get(0).duration;if(duration){$videoTimeTotal.text(calcTimeFormat(duration));if(!sliderDragging){var sliderW=$videoSeeker.width();var pos=Math.round(sliderW*curTime/duration);$videoSeekerPlay.css({width:pos});
$videoSeekerHandler.css({left:pos})}}}};var onVideoProgress=function(){if($videoObj.get(0).buffered&&$videoObj.get(0).buffered.length>0&&!isNaN($videoObj.get(0).buffered.end(0))&&!isNaN($videoObj.get(0).duration)){var sliderW=$videoSeeker.width();$videoSeekerBuffer.css({width:Math.round(sliderW*$videoObj.get(0).buffered.end(0)/$videoObj.get(0).duration)})}};try{$videoObj.bind("play",onVideoPlay);$videoObj.bind("pause",onVideoPause);$videoObj.bind("ended",onVideoPause);$videoObj.bind("timeupdate",
onVideoUpdate);$videoObj.bind("progress",onVideoProgress)}catch(e){}}})(jQuery);(function($){var ELEM_ID=0,ELEM_THUMBNAIL=1,ELEM_SRC=2,ELEM_SRC_OGG=3,ELEM_SRC_WEBM=4,ELEM_LINK=5,ELEM_LINKTARGET=6,ELEM_TITLE=7,ELEM_INFORMATION=8,ELEM_TYPE=9,ELEM_WIDTH=10,ELEM_HEIGHT=11,ELEM_POSTER=12,ELEM_HD=13,ELEM_HD_OGG=14,ELEM_HD_WEBM=15;var TYPE_IMAGE=1,TYPE_SWF=2,TYPE_MP3=3,TYPE_PDF=4,TYPE_VIDEO_FLASH=5,TYPE_VIDEO_MP4=6,TYPE_VIDEO_OGG=7,TYPE_VIDEO_WEBM=8,TYPE_VIDEO_YOUTUBE=9,TYPE_VIDEO_VIMEO=10;var html5GalleryId=
0;$.fn.wonderplugingallery=function(options){var Html5Gallery=function(container,options,id){this.container=container;this.options=options;this.id=id;if(this.options.googlefonts&&this.options.googlefonts.length>0){var fontRef=("https:"==document.location.protocol?"https":"http")+"://fonts.googleapis.com/css?family="+this.options.googlefonts;var fontLink=document.createElement("link");fontLink.setAttribute("rel","stylesheet");fontLink.setAttribute("type","text/css");fontLink.setAttribute("href",fontRef);
document.getElementsByTagName("head")[0].appendChild(fontLink)}this.options.flashInstalled=false;try{if(new ActiveXObject("ShockwaveFlash.ShockwaveFlash"))this.options.flashInstalled=true}catch(e){if(navigator.mimeTypes["application/x-shockwave-flash"])this.options.flashInstalled=true}this.options.html5VideoSupported=!!document.createElement("video").canPlayType;this.options.isChrome=navigator.userAgent.match(/Chrome/i)!=null;this.options.isFirefox=navigator.userAgent.match(/Firefox/i)!=null;this.options.isOpera=
navigator.userAgent.match(/Opera/i)!=null||navigator.userAgent.match(/OPR\//i)!=null;this.options.isSafari=navigator.userAgent.match(/Safari/i)!=null;this.options.isIE11=navigator.userAgent.match(/Trident\/7/)!=null&&navigator.userAgent.match(/rv:11/)!=null;this.options.isIE=navigator.userAgent.match(/MSIE/i)!=null&&!this.options.isOpera;this.options.isIE10=navigator.userAgent.match(/MSIE 10/i)!=null&&!this.options.isOpera;this.options.isIE9=navigator.userAgent.match(/MSIE 9/i)!=null&&!this.options.isOpera;
this.options.isIE8=navigator.userAgent.match(/MSIE 8/i)!=null&&!this.options.isOpera;this.options.isIE7=navigator.userAgent.match(/MSIE 7/i)!=null&&!this.options.isOpera;this.options.isIE6=navigator.userAgent.match(/MSIE 6/i)!=null&&!this.options.isOpera;this.options.isIE678=this.options.isIE6||this.options.isIE7||this.options.isIE8;this.options.isIE6789=this.options.isIE6||this.options.isIE7||this.options.isIE8||this.options.isIE9;this.options.isAndroid=navigator.userAgent.match(/Android/i)!=null;
this.options.isIPad=navigator.userAgent.match(/iPad/i)!=null;this.options.isIPhone=navigator.userAgent.match(/iPod/i)!=null||navigator.userAgent.match(/iPhone/i)!=null;this.options.isIOS=this.options.isIPad||this.options.isIPhone;this.options.isMobile=this.options.isAndroid||this.options.isIPad||this.options.isIPhone;this.options.isIOSLess5=this.options.isIPad&&this.options.isIPhone&&(navigator.userAgent.match(/OS 4/i)!=null||navigator.userAgent.match(/OS 3/i)!=null);this.options.supportCSSPositionFixed=
!this.options.isIE6&&!this.options.isIOSLess5;this.isTouch="ontouchstart"in window;this.eStart=this.isTouch?"touchstart":"mousedown";this.eMove=this.isTouch?"touchmove":"mousemove";this.eCancel=this.isTouch?"touchcancel":"mouseup";this.eClick=this.isTouch?"touchstart":"click";this.slideshowTimeout=null;this.slideTimer=null;this.slideTimerCount=0;this.looptimes=0;this.updateCarouselTimeout=null;this.disableupdatecarousel=false;this.isHd=this.options.hddefault;this.isHTML5=false;this.elemArray=[];this.container.children().hide();
this.container.css({"display":"block","position":"relative"});this.initData(this.init)};Html5Gallery.prototype={getParams:function(){var result={};var params=window.location.search.substring(1).split("&");for(var i=0;i<params.length;i++){var value=params[i].split("=");if(value&&value.length==2)result[value[0].toLowerCase()]=unescape(value[1])}return result},init:function(instance){if(instance.options.random)for(var i=instance.elemArray.length-1;i>0;i--){var index=Math.floor(Math.random()*i);var t=
instance.elemArray[i];instance.elemArray[i]=instance.elemArray[index];instance.elemArray[index]=t}instance.initYoutubeApi();instance.options.showcarousel=instance.elemArray.length>1&&instance.options.showcarousel;instance.options.watermarkcode="";if(instance.options.fv)instance.options.watermarkcode="<a style='text-decoration:none;' target='_blank' href='"+instance.options.freelink+"' >";else if(instance.options.watermarklink.length>0)instance.options.watermarkcode="<a style='text-decoration:none;' target='_blank' href='"+
instance.options.watermarklink+"' >";var freeCss;if(instance.options.fv)freeCss="display:block;position:absolute;top:10px;left:10px;width:130px;height:18px;line-height:18px;text-align:center;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;background-color:#fff;color:#333;font-size:12px;font-family:Armata,sans-serif,Arial;";else if(instance.options.watermark.length>0)freeCss="display:block;position:absolute;top:0px;left:0px;";else freeCss="display:none;";instance.options.watermarkcode+=
"<div "+(instance.options.fv?"":"class='html5gallery-watermark-"+instance.id+"' ")+"style='"+freeCss+"' >";if(instance.options.fv)instance.options.watermarkcode+=instance.options.fvm;else if(instance.options.watermark.length>0)instance.options.watermarkcode+="<img src='"+instance.options.watermark+"' />";instance.options.watermarkcode+="</div>";if(instance.options.fv||instance.options.watermarklink.length>0)instance.options.watermarkcode+="</a>";instance.createStyle();instance.createMarkup();instance.createImageToolbox();
if(instance.elemArray.length<=0)return;instance.createEvents();instance.loadCarousel();instance.savedElem=-1;instance.curElem=-1;instance.nextElem=-1;instance.prevElem=-1;instance.isPaused=!instance.options.autoslide;instance.isFullscreen=false;instance.showingPoster=false;instance.disableTouchSwipe=false;var params=instance.getParams();instance.slideRun(params["html5galleryid"]&&params["html5galleryid"]in instance.elemArray?params["html5galleryid"]:0);if(instance.options.responsive){instance.resizeGallery();
$(window).resize(function(){instance.resizeGallery()})}},resizeGallery:function(){switch(this.options.skin){case "vertical":case "showcase":this.resizeStyleVertical();break;case "light":case "horizontal":case "darkness":case "gallery":default:this.resizeStyleDefault()}this.resizeImageToolbox()},initData:function(onSuccess){this.elemArray=[];if(this.options.src&&this.options.src.length>0){var mediaType=this.options.mediatype?this.options.mediatype:this.checkType(this.options.src);this.elemArray.push(new Array(0,
"",this.options.src,this.options.webm,this.options.ogg,"","",this.options.title?this.options.title:"",this.options.title?this.options.title:"",mediaType,this.options.width,this.options.height,this.options.poster,this.options.hd,this.options.hdogg,this.options.hdwebm));this.readTags();onSuccess(this)}else if(this.options.xml&&this.options.xml.length>0){if(this.options.xmlnocache){this.options.xml+=this.options.xml.indexOf("?")<0?"?":"&";this.options.xml+=Math.random()}var instance=this;$.ajax({type:"GET",
url:this.options.xml,dataType:"xml",success:function(xmldata){$(xmldata).find("slide").each(function(index,value){var title=$(this).find("title").text();var information=$(this).find("description").text()?$(this).find("description").text():$(this).find("information").text();if(!title)title="";if(!information)information="";var mediaType=$(this).find("mediatype").text()?$(this).find("mediatype").text():instance.checkType($(this).find("file").text());instance.elemArray.push(new Array($(this).find("id").length?
$(this).find("id").text():index,$(this).find("thumbnail").text(),$(this).find("file").text(),$(this).find("file-ogg").text(),$(this).find("file-webm").text(),$(this).find("link").text(),$(this).find("linktarget").text(),title,information,mediaType,$(this).find("width").length&&!isNaN(parseInt($(this).find("width").text()))?parseInt($(this).find("width").text()):instance.options.width,$(this).find("height").length&&!isNaN(parseInt($(this).find("height").text()))?parseInt($(this).find("height").text()):
instance.options.height,$(this).find("poster").text(),$(this).find("hd").text(),$(this).find("hdogg").text(),$(this).find("hdwebm").text()))});instance.readTags();onSuccess(instance)}})}else if(this.options.remote&&this.options.remote.length>0){var instance=this;$.getJSON(this.options.remote,function(data){for(var i=0;i<data.length;i++){var mediaType=data[i].mediatype?data[i].mediatype:instance.checkType(data[i].file);instance.elemArray.push(new Array(i,data[i].thumbnail,data[i].file,data[i].fileogg,
data[i].filewebm,data[i].link,data[i].linktarget,data[i].title,data[i].description,mediaType,data[i].width&&!isNaN(parseInt(data[i].width))?parseInt(data[i].width):instance.options.width,data[i].height&&!isNaN(parseInt(data[i].height))?parseInt(data[i].height):instance.options.height,data[i].poster,data[i].hd,data[i].hdogg,data[i].hdwebm))}instance.readTags();onSuccess(instance)})}else if(this.options.youtubechannel){var base="https://gdata.youtube.com/feeds/api/videos?";var params={alt:"json",v:2,
"orderby":this.options.youtubechannel.orderby?this.options.youtubechannel.orderby:"published","start-index":this.options.youtubechannel["start-index"]?this.options.youtubechannel["start-index"]:1,"max-results":this.options.youtubechannel["max-results"]?this.options.youtubechannel["max-results"]:10};if(this.options.youtubechannel.author)params.author=this.options.youtubechannel.author;else if(this.options.youtubechannel.q)params.q=this.options.youtubechannel.q;base+=$.param(params);var instance=this;
$.getJSON(base,function(data){if(data&&data.feed&&data.feed.entry)for(var i=0;i<data.feed.entry.length;i++)instance.elemArray.push(new Array(i,"http://img.youtube.com/vi/"+data.feed.entry[i].media$group.yt$videoid.$t+"/0.jpg",data.feed.entry[i].media$group.media$player.url,null,null,null,null,data.feed.entry[i].media$group.media$title.$t,data.feed.entry[i].media$group.media$description.$t,TYPE_VIDEO_YOUTUBE,640,480,"http://img.youtube.com/vi/"+data.feed.entry[i].media$group.yt$videoid.$t+"/0.jpg",
null,null,null));instance.readTags();onSuccess(instance)})}else{this.readTags();onSuccess(this)}},readTags:function(){var instance=this;$("img",this.container).each(function(index,value){var src=$(this).attr("src");var title=$(this).attr("alt");var information=$(this).data("description")?$(this).data("description"):$(this).data("information");if(!title)title="";if(!information)information="";var width=instance.options.width;var height=instance.options.height;var videoOgg=null,videoWebm=null;var link=
null,linktarget=null;var poster=null;var hd=null,hdogg=null,hdwebm=null;if($(this).parent().is("a")){src=$(this).parent().attr("href");videoOgg=$(this).parent().data("ogg");videoWebm=$(this).parent().data("webm");link=$(this).parent().data("link");linktarget=$(this).parent().data("linktarget");poster=$(this).parent().data("poster");if(!isNaN($(this).parent().data("width")))width=$(this).parent().data("width");if(!isNaN($(this).parent().data("height")))height=$(this).parent().data("height");hd=$(this).parent().data("hd");
hdogg=$(this).parent().data("hdogg");hdwebm=$(this).parent().data("hdwebm")}var mediaType=$(this).parent().data("mediatype")?$(this).parent().data("mediatype"):instance.checkType(src);instance.elemArray.push(new Array(instance.elemArray.length,$(this).attr("src"),src,videoOgg,videoWebm,link,linktarget,title,information,mediaType,width,height,poster,hd,hdogg,hdwebm))})},createMarkup:function(){this.$gallery=jQuery(""+"<div class='html5gallery-container-"+this.id+"'>"+"<div class='html5gallery-box-"+
this.id+"'>"+"<div class='html5gallery-elem-"+this.id+"'></div>"+"<div class='html5gallery-title-"+this.id+"'></div>"+"<div class='html5gallery-timer-"+this.id+"'></div>"+"<div class='html5gallery-viral-"+this.id+"'></div>"+"<div class='html5gallery-toolbox-"+this.id+"'>"+"<div class='html5gallery-toolbox-bg-"+this.id+"'></div>"+"<div class='html5gallery-toolbox-buttons-"+this.id+"'>"+"<div class='html5gallery-play-"+this.id+"'></div>"+"<div class='html5gallery-pause-"+this.id+"'></div>"+"<div class='html5gallery-left-"+
this.id+"'></div>"+"<div class='html5gallery-right-"+this.id+"'></div>"+"<div class='html5gallery-lightbox-"+this.id+"'></div>"+"</div>"+"</div>"+"</div>"+"<div class='html5gallery-car-"+this.id+"'>"+"<div class='html5gallery-car-list-"+this.id+"'>"+"<div class='html5gallery-car-mask-"+this.id+"'>"+"<div class='html5gallery-thumbs-"+this.id+"'></div>"+"</div>"+"<div class='html5gallery-car-slider-bar-"+this.id+"'>"+"<div class='html5gallery-car-slider-bar-top-"+this.id+"'></div>"+"<div class='html5gallery-car-slider-bar-middle-"+
this.id+"'></div>"+"<div class='html5gallery-car-slider-bar-bottom-"+this.id+"'></div>"+"</div>"+"<div class='html5gallery-car-left-"+this.id+"'></div>"+"<div class='html5gallery-car-right-"+this.id+"'></div>"+"<div class='html5gallery-car-slider-"+this.id+"'></div>"+"</div>"+"</div>"+"</div>");this.$gallery.appendTo(this.container);if(!this.options.socialurlforeach)this.createSocialMedia();if(this.options.googleanalyticsaccount&&!window._gaq){window._gaq=window._gaq||[];window._gaq.push(["_setAccount",
this.options.googleanalyticsaccount]);window._gaq.push(["_trackPageview"]);$.getScript(("https:"==document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js")}},createSocialMedia:function(){$(".html5gallery-viral-"+this.id,this.$gallery).empty();var elemUrl=window.location.href;if(this.options.socialurlforeach)elemUrl+=(window.location.href.indexOf("?")<0?"?":"&")+"html5galleryid="+this.elemArray[this.curElem][ELEM_ID];if(this.options.showsocialmedia&&this.options.showfacebooklike){var facebook=
"<div style='display:block; float:left; width:110px; height:21px;'><iframe src='http://www.facebook.com/plugins/like.php?href=";if(this.options.facebooklikeurl&&this.options.facebooklikeurl.length>0)facebook+=encodeURIComponent(this.options.facebooklikeurl);else facebook+=elemUrl;facebook+="&amp;send=false&amp;layout=button_count&amp;width=450&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21' scrolling='no' frameborder='0' style='border:none;;overflow:hidden; width:110px; height:21px;' allowTransparency='true'></iframe></div>";
$(".html5gallery-viral-"+this.id,this.$gallery).append(facebook)}if(this.options.showsocialmedia&&this.options.showtwitter){var twitter="<div style='display:block; float:left; width:110px; height:21px;'><a href='https://twitter.com/share' class='twitter-share-button'";if(this.options.twitterurl&&this.options.twitterurl.length>0)twitter+=" data-url='"+this.options.twitterurl+"'";else twitter+=" data-url='"+elemUrl+"'";if(this.options.twitterusername&&this.options.twitterusername.length>0)twitter+=
" data-via='"+this.options.twittervia+"' data-related='"+this.options.twitterusername+"'";twitter+=">Tweet</a></div>";$(".html5gallery-viral-"+this.id,this.$gallery).append(twitter);$.getScript("http://platform.twitter.com/widgets.js")}if(this.options.showsocialmedia&&this.options.showgoogleplus){var googlePlus="<div style='display:block; float:left; width:100px; height:21px;'><div class='g-plusone' data-size='medium'";if(this.options.googleplusurl&&this.options.googleplusurl.length>0)googlePlus+=
" data-href='"+this.options.googleplusurl+"'";else googlePlus+=" data-href='"+elemUrl+"'";googlePlus+="></div></div>";$(".html5gallery-viral-"+this.id,this.$gallery).append(googlePlus);$.getScript("https://apis.google.com/js/plusone.js")}},playGallery:function(){var instance=this;$(".html5gallery-play-"+instance.id,instance.$gallery).hide();$(".html5gallery-pause-"+instance.id,instance.$gallery).show();instance.isPaused=false;instance.slideshowTimeout=setTimeout(function(){instance.slideRun(-1)},
instance.options.slideshowinterval);$(".html5gallery-timer-"+instance.id,instance.$gallery).css({width:0});instance.slideTimerCount=0;if(instance.options.showtimer)instance.slideTimer=setInterval(function(){instance.showSlideTimer()},50)},pauseGallery:function(){var instance=this;$(".html5gallery-play-"+instance.id,instance.$gallery).show();$(".html5gallery-pause-"+instance.id,instance.$gallery).hide();instance.isPaused=true;clearTimeout(instance.slideshowTimeout);$(".html5gallery-timer-"+instance.id,
instance.$gallery).css({width:0});clearInterval(instance.slideTimer);instance.slideTimerCount=0},createEvents:function(){var instance=this;$(".html5gallery-play-"+this.id,this.$gallery).click(function(){instance.playGallery()});$(".html5gallery-pause-"+this.id,this.$gallery).click(function(){instance.pauseGallery()});$(".html5gallery-lightbox-"+this.id,this.$gallery).click(function(){instance.goFullscreen()});$(".html5gallery-left-"+this.id,this.$gallery).click(function(){instance.slideRun(-2,true)});
$(".html5gallery-right-"+this.id,this.$gallery).click(function(){instance.slideRun(-1,true)});if(instance.options.enabletouchswipe){var preventBrowser=instance.options.isAndroid&&instance.options.enabletouchswipeonandroid?true:false;$(".html5gallery-box-"+this.id,this.$gallery).touchSwipe({preventWebBrowser:preventBrowser,swipeLeft:function(){if(!instance.disableTouchSwipe)instance.slideRun(-1,true)},swipeRight:function(){if(!instance.disableTouchSwipe)instance.slideRun(-2,true)}})}$(".html5gallery-box-"+
this.id,this.$gallery).hover(function(){instance.onSlideshowOver();if(instance.options.imagetoolboxmode=="mouseover"){var type=instance.elemArray[instance.curElem][ELEM_TYPE];if(instance.options.showimagetoolbox=="always"||instance.options.showimagetoolbox=="image"&&type==TYPE_IMAGE)instance.showimagetoolbox(type)}},function(){if(instance.options.imagetoolboxmode=="mouseover")instance.hideimagetoolbox()});$(".html5gallery-container-"+this.id).hover(function(){if(instance.options.titleoverlay&&instance.options.titleautohide)$(".html5gallery-title-"+
instance.id,instance.$gallery).fadeIn()},function(){if(instance.options.titleoverlay&&instance.options.titleautohide)$(".html5gallery-title-"+instance.id,instance.$gallery).fadeOut()});$(".html5gallery-car-left-"+this.id,this.$gallery).css({"background-position":"-64px 0px",cursor:""});$(".html5gallery-car-left-"+this.id,this.$gallery).data("disabled",true);$(".html5gallery-car-right-"+this.id,this.$gallery).css({"background-position":"0px 0px"});$(".html5gallery-car-left-"+this.id,this.$gallery).click(function(){if(!$(this).data("disabled")){instance.disableupdatecarousel=
true;instance.updateCarouselTimeout=setTimeout(function(){instance.enableUpdateCarousel()},instance.options.updatecarouselinterval);instance.carouselPrev()}});$(".html5gallery-car-right-"+this.id,this.$gallery).click(function(){if(!$(this).data("disabled")){instance.disableupdatecarousel=true;instance.updateCarouselTimeout=setTimeout(function(){instance.enableUpdateCarousel()},instance.options.updatecarouselinterval);instance.carouselNext()}});$(".html5gallery-car-slider-"+this.id,this.$gallery).bind("drag",
function(event,data){instance.disableupdatecarousel=true;instance.updateCarouselTimeout=setTimeout(function(){instance.enableUpdateCarousel()},instance.options.updatecarouselinterval);instance.carouselSliderDrag(event,data)});$(".html5gallery-car-slider-bar-"+this.id,this.$gallery).click(function(event){instance.disableupdatecarousel=true;instance.updateCarouselTimeout=setTimeout(function(){instance.enableUpdateCarousel()},instance.options.updatecarouselinterval);instance.carouselBarClicked(event)});
$(".html5gallery-car-left-"+this.id,this.$gallery).hover(function(){if(!$(this).data("disabled"))$(this).css({"background-position":"-32px 0px"})},function(){if(!$(this).data("disabled"))$(this).css({"background-position":"0px 0px"})});$(".html5gallery-car-right-"+this.id,this.$gallery).hover(function(){if(!$(this).data("disabled"))$(this).css({"background-position":"-32px 0px"})},function(){if(!$(this).data("disabled"))$(this).css({"background-position":"0px 0px"})})},createStyle:function(){switch(this.options.skin){case "vertical":case "showcase":this.createStyleVertical();
break;case "light":case "horizontal":case "darkness":case "gallery":case "mediapage":default:this.createStyleDefault()}},resizeStyleVertical:function(){if(!this.container.parent()||!this.container.parent().width())return;this.options.containerWidth=this.container.parent().width();this.options.totalWidth=this.options.containerWidth;if(this.options.carouselposition=="bottom")this.options.width=this.options.totalWidth-2*this.options.padding;else{this.options.width=this.options.totalWidth-2*this.options.padding;
if(this.options.carouselWidth+this.options.carouselmargin>0)this.options.width-=this.options.carouselWidth+this.options.carouselmargin}if(this.options.responsivefullscreen&&this.container.parent().height()>0){this.options.containerHeight=this.container.parent().height();this.options.totalHeight=this.options.containerHeight;if(this.options.carouselposition=="bottom")this.options.height=this.options.totalHeight-(this.options.headerHeight+2*this.options.padding+this.options.carouselheight);else this.options.height=
this.options.totalHeight-(this.options.headerHeight+2*this.options.padding)}else{this.options.height=Math.round(this.options.width*this.options.originalHeight/this.options.originalWidth);if(this.options.carouselposition=="bottom")this.options.totalHeight=this.options.height+this.options.headerHeight+2*this.options.padding+this.options.carouselmargin+this.options.carouselHeight;else this.options.totalHeight=this.options.height+this.options.headerHeight+2*this.options.padding;this.options.containerHeight=
this.options.totalHeight}this.container.css({"width":this.options.containerWidth,"height":this.options.containerHeight});this.options.boxWidth=this.options.width;this.options.boxHeight=this.options.height+this.options.headerHeight;if(this.options.showcarousel)if(this.options.carouselposition=="bottom"){this.options.carouselWidth=this.options.width;this.options.carouselHeight=this.options.carouselheight;this.options.carouselLeft=this.options.padding;this.options.carouselTop=this.options.height+this.options.headerHeight+
2*this.options.padding;this.options.carAreaLength=this.options.carouselHeight;this.options.carouselSlider=Math.floor(this.options.carAreaLength/(this.options.thumbheight+this.options.thumbgap))<this.elemArray.length;this.options.thumbwidth=this.options.width;if(this.options.carouselSlider)this.options.thumbwidth-=20;$(".html5gallery-car-mask-"+this.id).css({width:this.options.thumbwidth+"px"});$(".html5gallery-tn-"+this.id).css({width:this.options.thumbwidth+"px"});$(".html5gallery-tn-selected-"+
this.id).css({width:this.options.thumbwidth+"px"});$(".html5gallery-car-slider-bar-"+this.id).css({left:String(this.options.thumbwidth+6)+"px"});if(this.options.isMobile){$(".html5gallery-car-left-"+this.id).css({left:String(this.options.thumbwidth+5)+"px"});$(".html5gallery-car-right-"+this.id).css({left:String(this.options.thumbwidth+5)+"px"})}else $(".html5gallery-car-slider-"+this.id).css({left:String(this.options.thumbwidth+5)+"px"});var titleWidth=this.options.thumbwidth-3*this.options.thumbmargin;
if(this.options.thumbshowimage)titleWidth-=this.options.thumbimagewidth+2*this.options.thumbimageborder;if(this.options.thumbshowtitle)$("head").append("<style type='text/css' data-creator='html5gallery'>.html5gallery-tn-title-"+this.id+" {width: "+titleWidth+"px;}</style>")}else{this.options.carouselWidth=this.options.thumbwidth;this.options.carouselHeight=this.options.height+this.options.headerHeight;this.options.carTop=0;this.options.carBottom=0;this.options.carAreaLength=this.options.carouselHeight-
this.options.carTop-this.options.carBottom;this.options.carouselSlider=Math.floor(this.options.carAreaLength/(this.options.thumbheight+this.options.thumbgap))<this.elemArray.length;if(this.options.carouselSlider)this.options.carouselWidth+=20;if(this.options.carouselposition=="left"){this.options.boxLeft=this.options.padding+this.options.carouselWidth+this.options.carouselmargin;this.options.carouselLeft=this.options.padding}else this.options.carouselLeft=this.options.padding+this.options.width+this.options.carouselmargin;
this.options.carouselTop=this.options.padding}$(".html5gallery-container-"+this.id).css({width:this.options.totalWidth+"px",height:this.options.totalHeight+"px"});$(".html5gallery-box-"+this.id).css({width:this.options.boxWidth+"px",height:this.options.boxHeight+"px"});var type=this.elemArray[this.curElem][ELEM_TYPE];if(type==TYPE_IMAGE||this.showingPoster){var imageWidth=this.elemArray[this.curElem][ELEM_WIDTH];var imageHeight=this.elemArray[this.curElem][ELEM_HEIGHT];var scale;if(this.isFullscreen){scale=
Math.min(this.fullscreenWidth/imageWidth,this.fullscreenHeight/imageHeight);scale=scale>1?1:scale}else if(this.options.resizemode=="fill")scale=Math.max(this.options.width/imageWidth,this.options.height/imageHeight);else scale=Math.min(this.options.width/imageWidth,this.options.height/imageHeight);var w=Math.round(scale*imageWidth);var h=Math.round(scale*imageHeight);var w1=this.isFullscreen?w:this.options.width;var h1=this.isFullscreen?h:this.options.height;var l=Math.round(w1/2-w/2);var t=Math.round(h1/
2-h/2);if(this.isFullscreen)this.adjustFullscreen(w1,h1,true);$(".html5gallery-elem-"+this.id).css({"width":w1+"px","height":h1+"px"});$(".html5gallery-elem-img-"+this.id).css({width:w1+"px",height:h1+"px"});$(".html5gallery-elem-image-"+this.id).css({width:w+"px",height:h+"px",top:t+"px",left:l+"px"})}else if(type==TYPE_VIDEO_FLASH||type==TYPE_VIDEO_MP4||type==TYPE_VIDEO_OGG||type==TYPE_VIDEO_WEBM||type==TYPE_VIDEO_YOUTUBE||type==TYPE_VIDEO_VIMEO){var dataW=this.elemArray[this.curElem][ELEM_WIDTH];
var dataH=this.elemArray[this.curElem][ELEM_HEIGHT];var w1,h1;if(this.isFullscreen){scale=Math.min(this.fullscreenWidth/dataW,this.fullscreenHeight/dataH);scale=scale>1?1:scale;w1=Math.round(scale*dataW);h1=Math.round(scale*dataH);this.adjustFullscreen(w1,h1,true)}else{w1=this.options.width;h1=this.options.height}$(".html5gallery-elem-"+this.id).css({"width":w1+"px","height":h1+"px"});$(".html5gallery-elem-video-"+this.id).css({"width":w1+"px","height":h1+"px"});$(".html5gallery-elem-video-container-"+
this.id).css({"width":w1+"px","height":h1+"px"});var h2=this.options.isIPhone?h1-48:h1;$(".html5gallery-elem-video-container-"+this.id).find("video").css({"width":w1+"px","height":h2+"px"});$("#html5gallery-elem-video-"+this.id).css({"width":w1+"px","height":h1+"px"})}else if(type==TYPE_SWF);var titleTop=0;var socialTop=0;if(this.options.headerpos=="bottom"){titleTop=this.options.titleoverlay?this.options.height-this.options.titleheight:this.options.height;socialTop=this.options.titleoverlay?this.options.height:
this.options.height+this.options.titleheight}$(".html5gallery-title-"+this.id).css({width:this.options.boxWidth+"px"});if(!this.options.titleoverlay)$(".html5gallery-title-"+this.id).css({top:titleTop+"px"});$(".html5gallery-viral-"+this.id).css({top:socialTop+"px"});$(".html5gallery-timer-"+this.id).css({top:String(this.options.elemTop+this.options.height-2)+"px"});if(this.options.showcarousel){$(".html5gallery-car-"+this.id).css({width:this.options.carouselWidth+"px",height:this.options.carouselHeight+
"px",top:this.options.carouselTop+"px",left:this.options.carouselLeft+"px",top:this.options.carouselTop+"px"});$(".html5gallery-car-list-"+this.id).css({top:this.options.carTop+"px",height:String(this.options.carAreaLength)+"px",width:this.options.carouselWidth+"px"});this.options.thumbShowNum=Math.floor(this.options.carAreaLength/(this.options.thumbheight+this.options.thumbgap));this.options.thumbMaskHeight=this.options.thumbShowNum*this.options.thumbheight+(this.options.thumbShowNum-1)*this.options.thumbgap;
this.options.thumbTotalHeight=this.elemArray.length*this.options.thumbheight+(this.elemArray.length-1)*this.options.thumbgap;if(this.options.carouselSlider){this.options.carouselSliderMin=0;this.options.carouselSliderMax=this.options.thumbMaskHeight-54;$(".html5gallery-car-slider-bar-"+this.id).css({height:this.options.thumbMaskHeight+"px"});$(".html5gallery-car-slider-bar-middle-"+this.id).css({height:String(this.options.thumbMaskHeight-32)+"px"});if(this.options.isMobile)$(".html5gallery-car-right-"+
this.id).css({top:String(this.options.thumbMaskHeight-35)+"px"});$(".html5gallery-car-slider-bar-"+this.id).css({display:"block"});$(".html5gallery-car-left-"+this.id).css({display:"block"});$(".html5gallery-car-right-"+this.id).css({display:"block"});$(".html5gallery-car-slider-"+this.id).css({display:"block"})}var maskTop=0;if(this.options.carouselNavButton)maskTop=Math.round(this.options.carAreaLength/2-this.options.thumbMaskHeight/2);$(".html5gallery-car-mask-"+this.id).css({top:maskTop+"px",
height:this.options.thumbMaskHeight+"px"});this.carouselHighlight(this.curElem)}},createStyleVertical:function(){if(this.options.thumbshowtitle)this.options.thumbimagewidth=this.options.thumbheight-2*this.options.thumbimageborder-4;else this.options.thumbimagewidth=this.options.thumbwidth-2*this.options.thumbimageborder-4;this.options.thumbimageheight=this.options.thumbheight-2*this.options.thumbimageborder-4;if(!this.options.showtitle)this.options.titleheight=0;if(!this.options.showsocialmedia||
!this.options.showfacebooklike&&!this.options.showtwitter&&!this.options.showgoogleplus)this.options.socialheight=0;this.options.headerHeight=this.options.titleoverlay?this.options.socialheight:this.options.titleheight+this.options.socialheight;this.options.boxWidth=this.options.width;this.options.boxHeight=this.options.height+this.options.headerHeight;this.options.boxLeft=this.options.padding;this.options.boxTop=this.options.padding;if(this.options.showcarousel)if(this.options.carouselposition==
"bottom"){this.options.carouselWidth=this.options.width;this.options.carouselHeight=this.options.carouselheight;this.options.carouselLeft=this.options.padding;this.options.carouselTop=this.options.height+this.options.headerHeight+2*this.options.padding;this.options.carAreaLength=this.options.carouselHeight;this.options.carouselSlider=Math.floor(this.options.carAreaLength/(this.options.thumbheight+this.options.thumbgap))<this.elemArray.length;this.options.thumbwidth=this.options.width;if(this.options.carouselSlider)this.options.thumbwidth-=
20}else{this.options.carouselWidth=this.options.thumbwidth;this.options.carouselHeight=this.options.height+this.options.headerHeight;this.options.carTop=0;this.options.carBottom=0;this.options.carAreaLength=this.options.carouselHeight-this.options.carTop-this.options.carBottom;this.options.carouselSlider=Math.floor(this.options.carAreaLength/(this.options.thumbheight+this.options.thumbgap))<this.elemArray.length;if(this.options.carouselSlider)this.options.carouselWidth+=20;if(this.options.carouselposition==
"left"){this.options.boxLeft=this.options.padding+this.options.carouselWidth+this.options.carouselmargin;this.options.carouselLeft=this.options.padding}else this.options.carouselLeft=this.options.padding+this.options.width+this.options.carouselmargin;this.options.carouselTop=this.options.padding}else{this.options.carouselWidth=0;this.options.carouselHeight=0;this.options.carouselLeft=0;this.options.carouselTop=0;this.options.carouselmargin=0}if(this.options.carouselposition=="bottom"){this.options.totalWidth=
this.options.width+2*this.options.padding;this.options.totalHeight=this.options.height+this.options.headerHeight+2*this.options.padding+this.options.carouselmargin+this.options.carouselHeight}else{this.options.totalWidth=this.options.width+this.options.carouselWidth+this.options.carouselmargin+2*this.options.padding;this.options.totalHeight=this.options.height+this.options.headerHeight+2*this.options.padding}this.options.containerWidth=this.options.totalWidth;this.options.containerHeight=this.options.totalHeight;
if(this.options.responsive){this.options.originalWidth=this.options.width;this.options.originalHeight=this.options.height;this.container.css({"max-width":"100%"})}else this.container.css({"width":this.options.containerWidth,"height":this.options.containerHeight});var titleTop=0;var socialTop=0;this.options.elemTop=0;if(this.options.headerpos=="top"){socialTop=0;titleTop=this.options.socialheight;this.options.elemTop=this.options.headerHeight}else if(this.options.headerpos=="bottom"){this.options.elemTop=
0;titleTop=this.options.titleoverlay?this.options.height-this.options.titleheight:this.options.height;socialTop=this.options.titleoverlay?this.options.height:this.options.height+this.options.titleheight}var styleCss=" .html5gallery-container-"+this.id+" { display:block; position:absolute; left:0px; top:0px; width:"+this.options.totalWidth+"px; height:"+this.options.totalHeight+"px; background:url('"+this.options.skinfolder+this.options.bgimage+"') center top; background-color:"+this.options.bgcolor+
";}";if(this.options.galleryshadow)styleCss+=" .html5gallery-container-"+this.id+" { -moz-box-shadow: 0px 2px 5px #aaa; -webkit-box-shadow: 0px 2px 5px #aaa; box-shadow: 0px 2px 5px #aaa;}";styleCss+=" .html5gallery-box-"+this.id+" {display:block; position:absolute; text-align:center; left:"+this.options.boxLeft+"px; top:"+this.options.boxTop+"px; width:"+this.options.boxWidth+"px; height:"+this.options.boxHeight+"px; }";var viralPaddingTop=Math.round(this.options.socialheight/2-12);styleCss+=" .html5gallery-title-text-"+
this.id+" "+this.options.titlecss+" .html5gallery-title-text-"+this.id+" "+this.options.titlecsslink+" .html5gallery-error-"+this.id+" "+this.options.errorcss;styleCss+=" .html5gallery-description-text-"+this.id+" "+this.options.descriptioncss+" .html5gallery-description-text-"+this.id+" "+this.options.descriptioncsslink;styleCss+=" .html5gallery-fullscreen-title-"+this.id+""+this.options.titlefullscreencss+" .html5gallery-fullscreen-title-"+this.id+""+this.options.titlefullscreencsslink;styleCss+=
" .html5gallery-viral-"+this.id+" {display:block; overflow:hidden; position:absolute; text-align:left; top:"+socialTop+"px; left:0px; width:"+this.options.boxWidth+"px; height:"+this.options.socialheight+"px; padding-top:"+viralPaddingTop+"px;}";styleCss+=" .html5gallery-title-"+this.id+" {display:"+(this.options.titleoverlay&&this.options.titleautohide?"none":"block")+"; overflow:hidden; position:absolute; left:0px; width:"+this.options.boxWidth+"px; ";if(!this.options.titleoverlay)styleCss+="top:"+
titleTop+"px; height:"+this.options.titleheight+"px; }";else if(this.options.headerpos=="top")styleCss+="top:0px; height:auto; }";else styleCss+="bottom:0px; height:auto; }";styleCss+=" .html5gallery-timer-"+this.id+" {display:block; position:absolute; top:"+String(this.options.elemTop+this.options.height-2)+"px; left:0px; width:0px; height:2px; background-color:#ccc; filter:alpha(opacity=60); opacity:0.6; }";styleCss+=" .html5gallery-elem-"+this.id+" {display:block; overflow:hidden; position:absolute; top:"+
this.options.elemTop+"px; left:0px; width:"+this.options.boxWidth+"px; height:"+this.options.height+"px;}";if(this.options.isIE7||this.options.isIE6){styleCss+=" .html5gallery-loading-"+this.id+" {display:none; }";styleCss+=" .html5gallery-loading-center-"+this.id+" {display:none; }"}else{styleCss+=" .html5gallery-loading-"+this.id+" {display:block; position:absolute; top:4px; right:4px; width:100%; height:100%; background:url('"+this.options.skinfolder+"loading.gif') no-repeat top right;}";styleCss+=
" .html5gallery-loading-center-"+this.id+" {display:block; position:absolute; top:0px; left:0px; width:100%; height:100%; background:url('"+this.options.skinfolder+"loading_center.gif') no-repeat center center;}"}if(this.options.borderradius>0)styleCss+=" .html5gallery-elem-"+this.id+" { overflow:hidden; border-radius:"+this.options.borderradius+"px; -moz-border-radius:"+this.options.borderradius+"px; -webkit-border-radius:"+this.options.borderradius+"px;}";if(this.options.slideshadow){styleCss+=
" .html5gallery-title-"+this.id+" { padding:4px;}";styleCss+=" .html5gallery-timer-"+this.id+" { margin:4px;}";styleCss+=" .html5gallery-elem-"+this.id+" { overflow:hidden; padding:4px; -moz-box-shadow: 0px 2px 5px #aaa; -webkit-box-shadow: 0px 2px 5px #aaa; box-shadow: 0px 2px 5px #aaa;}"}if(this.options.showcarousel){styleCss+=" .html5gallery-car-"+this.id+" { position:absolute; display:block; overflow:hidden; width:"+this.options.carouselWidth+"px; height:"+this.options.carouselHeight+"px; left:"+
this.options.carouselLeft+"px; top:"+this.options.carouselTop+"px; }";styleCss+=" .html5gallery-car-list-"+this.id+" { position:absolute; display:block; overflow:hidden; top:"+this.options.carTop+"px; height:"+String(this.options.carAreaLength)+"px; left:0px; width:"+this.options.carouselWidth+"px; "+"}";styleCss+=".html5gallery-thumbs-"+this.id+" {margin-top:0px; height:"+String(this.elemArray.length*(this.options.thumbheight+this.options.thumbgap))+"px;}";this.options.thumbShowNum=Math.floor(this.options.carAreaLength/
(this.options.thumbheight+this.options.thumbgap));this.options.thumbMaskHeight=this.options.thumbShowNum*this.options.thumbheight+(this.options.thumbShowNum-1)*this.options.thumbgap;this.options.thumbTotalHeight=this.elemArray.length*this.options.thumbheight+(this.elemArray.length-1)*this.options.thumbgap;this.options.carouselSliderMin=0;this.options.carouselSliderMax=this.options.thumbMaskHeight-54;styleCss+=" .html5gallery-car-slider-bar-"+this.id+" { position:absolute; display:"+(this.options.carouselSlider?
"block":"none")+"; overflow:hidden; top:0px; height:"+this.options.thumbMaskHeight+"px; left:"+String(this.options.thumbwidth+6)+"px; width:14px;}";styleCss+=" .html5gallery-car-slider-bar-top-"+this.id+" { position:absolute; display:block; top:0px; left:0px; width:14px; height:16px; background:url('"+this.options.skinfolder+"bartop.png')}";styleCss+=" .html5gallery-car-slider-bar-middle-"+this.id+" { position:absolute; display:block; top:16px; left:0px; width:14px; height:"+String(this.options.thumbMaskHeight-
32)+"px; background:url('"+this.options.skinfolder+"bar.png')}";styleCss+=" .html5gallery-car-slider-bar-bottom-"+this.id+" { position:absolute; display:block; bottom:0px; left:0px; width:14px; height:16px; background:url('"+this.options.skinfolder+"barbottom.png')}";if(this.options.isMobile)styleCss+=" .html5gallery-car-left-"+this.id+" { position:absolute; display:"+(this.options.carouselSlider?"block":"none")+"; cursor:pointer; overflow:hidden; width:16px; height:35px; left:"+String(this.options.thumbwidth+
5)+"px; top:0px; background:url('"+this.options.skinfolder+"slidertop.png')} "+" .html5gallery-car-right-"+this.id+" { position:absolute; display:"+(this.options.carouselSlider?"block":"none")+"; cursor:pointer; overflow:hidden; width:16px; height:35px; left:"+String(this.options.thumbwidth+5)+"px; top:"+String(this.options.thumbMaskHeight-35)+"px; background:url('"+this.options.skinfolder+"sliderbottom.png')} ";else styleCss+=" .html5gallery-car-slider-"+this.id+" { position:absolute; display:"+
(this.options.carouselSlider?"block":"none")+"; overflow:hidden; cursor:pointer; top:0px; height:54px; left:"+String(this.options.thumbwidth+5)+"px; width:16px; background:url('"+this.options.skinfolder+"slider.png');}";var maskTop=0;if(this.options.carouselNavButton)maskTop=Math.round(this.options.carAreaLength/2-this.options.thumbMaskHeight/2);styleCss+=" .html5gallery-car-mask-"+this.id+" { position:absolute; display:block; overflow:hidden; top:"+maskTop+"px; height:"+this.options.thumbMaskHeight+
"px; left:0px; width:"+this.options.thumbwidth+"px;} ";var tabHeight=this.options.thumbheight;if(!this.options.isIE)tabHeight=this.options.thumbheight-2;styleCss+=" .html5gallery-tn-"+this.id+" { display:block; margin-bottom:"+this.options.thumbgap+"px; text-align:center; cursor:pointer; width:"+this.options.thumbwidth+"px;height:"+tabHeight+"px;overflow:hidden;";if(this.options.carouselbgtransparent)styleCss+="background-color:transparent;";else{if(!this.options.isIE)styleCss+="border-top:1px solid "+
this.options.carouseltopborder+"; border-bottom:1px solid "+this.options.carouselbottomborder+";";styleCss+="background-color: "+this.options.carouselbgcolorend+"; "+"background: "+this.options.carouselbgcolorend+" -webkit-gradient(linear, left top, left bottom, from("+this.options.carouselbgcolorstart+"), to("+this.options.carouselbgcolorend+")) no-repeat; "+"background: "+this.options.carouselbgcolorend+" -moz-linear-gradient(top, "+this.options.carouselbgcolorstart+", "+this.options.carouselbgcolorend+
") no-repeat; "+"filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="+this.options.carouselbgcolorstart+", endColorstr="+this.options.carouselbgcolorend+") no-repeat; "+"-ms-filter: 'progid:DXImageTransform.Microsoft.gradient(startColorstr="+this.options.carouselbgcolorstart+", endColorstr="+this.options.carouselbgcolorend+")' no-repeat;"}if(this.options.carouselbgimage)styleCss+="background:url('"+this.options.skinfolder+this.options.carouselbgimage+"') center top;";styleCss+="}";styleCss+=
" .html5gallery-tn-selected-"+this.id+" { display:block; margin-bottom:"+this.options.thumbgap+"px;text-align:center; cursor:pointer; width:"+this.options.thumbwidth+"px;height:"+tabHeight+"px;overflow:hidden;";if(this.options.carouselbgtransparent)styleCss+="background-color:transparent;";else{if(!this.options.isIE)styleCss+="border-top:1px solid "+this.options.carouselhighlighttopborder+"; border-bottom:1px solid "+this.options.carouselhighlightbottomborder+";";styleCss+="background-color: "+this.options.carouselhighlightbgcolorend+
"; "+"background: "+this.options.carouselhighlightbgcolorend+" -webkit-gradient(linear, left top, left bottom, from("+this.options.carouselhighlightbgcolorstart+"), to("+this.options.carouselhighlightbgcolorend+")) no-repeat; "+"background: "+this.options.carouselhighlightbgcolorend+" -moz-linear-gradient(top, "+this.options.carouselhighlightbgcolorstart+", "+this.options.carouselhighlightbgcolorend+") no-repeat; "+"filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="+this.options.carouselhighlightbgcolorstart+
", endColorstr="+this.options.carouselhighlightbgcolorend+") no-repeat; "+"-ms-filter: 'progid:DXImageTransform.Microsoft.gradient(startColorstr="+this.options.carouselhighlightbgcolorstart+", endColorstr="+this.options.carouselhighlightbgcolorend+")' no-repeat;"}if(this.options.carouselbgimage)styleCss+="background:url('"+this.options.skinfolder+this.options.carouselbgimage+"') center top;";styleCss+="}";styleCss+=" .html5gallery-tn-selected-"+this.id+" .html5gallery-tn-img-"+this.id+" {background-color:"+
this.options.thumbimagebordercolor+";}"+" .html5gallery-tn-"+this.id+" { filter:alpha(opacity="+Math.round(this.options.thumbopacity*100)+"); opacity:"+this.options.thumbopacity+"; } "+" .html5gallery-tn-selected-"+this.id+" { filter:alpha(opacity=100); opacity:1; } ";var titleWidth=this.options.thumbwidth-3*this.options.thumbmargin;if(this.options.thumbshowimage){titleWidth-=this.options.thumbimagewidth+2*this.options.thumbimageborder;var imgLeft;if(this.options.thumbshowtitle)imgLeft=this.options.thumbmargin;
else imgLeft=this.options.thumbwidth/2-(this.options.thumbimagewidth+2*this.options.thumbimageborder)/2;var imgTop=Math.round((this.options.thumbheight-2)/2-(this.options.thumbimageheight+2*this.options.thumbimageborder)/2);styleCss+=" .html5gallery-tn-img-"+this.id+" {display:block; overflow:hidden; float:left; margin-top:"+imgTop+"px; margin-left:"+imgLeft+"px; width:"+String(this.options.thumbimagewidth+2*this.options.thumbimageborder)+"px;height:"+String(this.options.thumbimageheight+2*this.options.thumbimageborder)+
"px;}"}else styleCss+=" .html5gallery-tn-img-"+this.id+" {display:none;}";if(this.options.thumbshowtitle){styleCss+=" .html5gallery-tn-title-"+this.id+" {display:block; overflow:hidden; float:left; margin-top:0px; margin-left:"+this.options.thumbmargin+"px; width:"+titleWidth+"px;height:"+String(this.options.thumbheight-2)+"px;"+(this.options.thumbshowdescription?"":"line-height:"+String(this.options.thumbheight-2)+"px;")+"}";styleCss+=" .html5gallery-tn-title-"+this.id+this.options.thumbtitlecss;
styleCss+=" .html5gallery-tn-description-"+this.id+this.options.thumbdescriptioncss}else{styleCss+=" .html5gallery-tn-title-"+this.id+" {display:none;}";styleCss+=" .html5gallery-tn-description-"+this.id+" {display:none;}"}this.carouselHighlight=function(index){$("#html5gallery-tn-"+this.id+"-"+index,this.$gallery).removeClass("html5gallery-tn-"+this.id).addClass("html5gallery-tn-selected-"+this.id);if(this.options.thumbShowNum>=this.elemArray.length)return;var pos=Math.floor(index/this.options.thumbShowNum)*
this.options.thumbShowNum*(this.options.thumbheight+this.options.thumbgap);if(pos>=this.options.thumbTotalHeight-this.options.thumbMaskHeight)pos=this.options.thumbTotalHeight-this.options.thumbMaskHeight;var m1=pos/(this.elemArray.length*(this.options.thumbheight+this.options.thumbgap)-this.options.thumbMaskHeight);m1=m1*(this.options.carouselSliderMax-this.options.carouselSliderMin);$(".html5gallery-car-slider-"+this.id,this.$gallery).stop(true).animate({top:m1},300);$(".html5gallery-thumbs-"+this.id,
this.$gallery).stop(true).animate({marginTop:-1*pos},300);this.updateCarouseButtons(-pos)};this.carouselBarClicked=function(event){var $thumbContainer=$(".html5gallery-thumbs-"+this.id,this.$gallery);var pos;if(event.pageY>$(".html5gallery-car-slider-"+this.id,this.$gallery).offset().top){pos=-1*parseInt($thumbContainer.css("margin-top"))+this.options.thumbShowNum*(this.options.thumbheight+this.options.thumbgap);if(pos>=this.options.thumbTotalHeight-this.options.thumbMaskHeight)pos=this.options.thumbTotalHeight-
this.options.thumbMaskHeight}else{pos=-1*parseInt($thumbContainer.css("margin-top"))-this.options.thumbShowNum*(this.options.thumbheight+this.options.thumbgap);if(pos<0)pos=0}$thumbContainer.stop(true).animate({marginTop:-pos},500);this.updateCarouseButtons(-pos);var m1=this.elemArray.length*(this.options.thumbheight+this.options.thumbgap)-this.options.thumbMaskHeight;pos=pos*(this.options.carouselSliderMax-this.options.carouselSliderMin)/m1;if(pos<this.options.carouselSliderMin)pos=this.options.carouselSliderMin;
if(pos>this.options.carouselSliderMax)pos=this.options.carouselSliderMax;$(".html5gallery-car-slider-"+this.id,this.$gallery).stop(true).animate({top:pos},500)};this.carouselSliderDrag=function(event,data){var pos=data.offsetY-$(".html5gallery-car-slider-bar-"+this.id,this.$gallery).offset().top;if(pos<this.options.carouselSliderMin)pos=this.options.carouselSliderMin;if(pos>this.options.carouselSliderMax)pos=this.options.carouselSliderMax;$(".html5gallery-car-slider-"+this.id,this.$gallery).css({top:pos});
var m1=this.elemArray.length*(this.options.thumbheight+this.options.thumbgap)-this.options.thumbMaskHeight;m1=m1*pos/(this.options.carouselSliderMax-this.options.carouselSliderMin);m1=Math.round(m1/(this.options.thumbheight+this.options.thumbgap));m1=-1*m1*(this.options.thumbheight+this.options.thumbgap);$(".html5gallery-thumbs-"+this.id,this.$gallery).stop(true).animate({marginTop:m1},300)};this.carouselPrev=function(){var $thumbContainer=$(".html5gallery-thumbs-"+this.id,this.$gallery);if(parseInt($thumbContainer.css("margin-top"))==
0)return;else{var pos=-1*parseInt($thumbContainer.css("margin-top"))-this.options.thumbShowNum*(this.options.thumbheight+this.options.thumbgap);if(pos<0)pos=0;$thumbContainer.animate({marginTop:-pos},500,this.options.carouseleasing);this.updateCarouseButtons(-pos)}};this.carouselNext=function(){var $thumbContainer=$(".html5gallery-thumbs-"+this.id,this.$gallery);if(parseInt($thumbContainer.css("margin-top"))==-(this.options.thumbTotalHeight-this.options.thumbMaskHeight))return;else{var pos=-1*parseInt($thumbContainer.css("margin-top"))+
this.options.thumbShowNum*(this.options.thumbheight+this.options.thumbgap);if(pos>=this.options.thumbTotalHeight-this.options.thumbMaskHeight)pos=this.options.thumbTotalHeight-this.options.thumbMaskHeight;$thumbContainer.animate({marginTop:-pos},500,this.options.carouseleasing);this.updateCarouseButtons(-pos)}};this.updateCarouseButtons=function(pos){var $leftButton=$(".html5gallery-car-left-"+this.id,this.$gallery);var $rightButton=$(".html5gallery-car-right-"+this.id,this.$gallery);var rightMost=
-1*(this.options.thumbTotalHeight-this.options.thumbMaskHeight);if(pos==0){$leftButton.css({"background-position":"-64px 0px",cursor:""});$leftButton.data("disabled",true)}else if($leftButton.data("disabled")){$leftButton.css({"background-position":"0px 0px",cursor:"pointer"});$leftButton.data("disabled",false)}if(pos==rightMost){$rightButton.css({"background-position":"-64px 0px",cursor:""});$rightButton.data("disabled",true)}else if($rightButton.data("disabled")){$rightButton.css({"background-position":"0px 0px",
cursor:"pointer"});$rightButton.data("disabled",false)}}}else styleCss+=" .html5gallery-car-"+this.id+" { display:none; }";styleCss+=".html5gallery-container-"+this.id+" div {box-sizing:content-box;}";$("head").append("<style type='text/css' data-creator='html5gallery'>"+styleCss+"</style>")},resizeImageToolbox:function(){if(this.options.imagetoolboxstyle!="center"){var buttonT=Math.round((this.options.headerpos=="bottom"?0:this.options.headerHeight)+this.options.height/2-24);var buttonB=buttonT+
Math.round(this.options.height/2)-32;var buttonR=this.options.width-54;var buttonR1=buttonR;var buttonR2=this.options.showfullscreenbutton?buttonR1-48:buttonR1;$(".html5gallery-play-"+this.id).css({"top":buttonB+"px","left":buttonR2+"px"});$(".html5gallery-pause-"+this.id).css({"top":buttonB+"px","left":buttonR2+"px"});$(".html5gallery-left-"+this.id).css({"top":buttonT+"px"});$(".html5gallery-right-"+this.id).css({"top":buttonT+"px","left":buttonR1+"px"});$(".html5gallery-lightbox-"+this.id).css({"top":buttonB+
"px","left":buttonR1+"px"})}},createImageToolbox:function(){if(this.elemArray.length<=1)this.options.showplaybutton=this.options.showprevbutton=this.options.shownextbutton=false;if(this.options.showimagetoolbox!="never"){var styleCss;if(this.options.imagetoolboxstyle=="center"){var toolboxH=40;styleCss=" .html5gallery-toolbox-"+this.id+" {display:"+(this.options.imagetoolboxmode=="show"?"block":"none")+"; overflow:hidden; position:relative; margin:0px auto; text-align:center; height:"+toolboxH+"px;}";
styleCss+=" .html5gallery-toolbox-bg-"+this.id+" {display:block; left:0px; top:0px; width:100%; height:100%; position:absolute; filter:alpha(opacity=60); opacity:0.6; background-color:#222222; }";styleCss+=" .html5gallery-toolbox-buttons-"+this.id+" {display:block; margin:0px auto; height:100%;}";styleCss+=" .html5gallery-play-"+this.id+" { position:relative; float:left; display:"+(this.options.imagetoolboxmode=="show"?"block":"none")+"; cursor:pointer; overflow:hidden; width:32px; height:32px; margin-left:2px; margin-right:2px; margin-top:"+
Math.round(toolboxH/2-16)+"px; background:url('"+this.options.skinfolder+"play.png') no-repeat top left; } ";styleCss+=" .html5gallery-pause-"+this.id+" { position:relative; float:left; display:"+(this.options.imagetoolboxmode=="show"?"block":"none")+"; cursor:pointer; overflow:hidden; width:32px; height:32px; margin-left:2px; margin-right:2px; margin-top:"+Math.round(toolboxH/2-16)+"px; background:url('"+this.options.skinfolder+"pause.png') no-repeat top left; } ";styleCss+=" .html5gallery-left-"+
this.id+" { position:relative; float:left; display:"+(this.options.imagetoolboxmode=="show"?"block":"none")+"; cursor:pointer; overflow:hidden; width:32px; height:32px; margin-left:2px; margin-right:2px; margin-top:"+Math.round(toolboxH/2-16)+"px; background:url('"+this.options.skinfolder+"prev.png') no-repeat top left; } ";styleCss+=" .html5gallery-right-"+this.id+" { position:relative; float:left; display:"+(this.options.imagetoolboxmode=="show"?"block":"none")+"; cursor:pointer; overflow:hidden; width:32px; height:32px; margin-left:2px; margin-right:2px; margin-top:"+
Math.round(toolboxH/2-16)+"px; background:url('"+this.options.skinfolder+"next.png') no-repeat top left; } ";styleCss+=" .html5gallery-lightbox-"+this.id+" {position:relative; float:left; display:"+(this.options.imagetoolboxmode=="show"?"block":"none")+"; cursor:pointer; overflow:hidden; width:32px; height:32px; margin-left:2px; margin-right:2px; margin-top:"+Math.round(toolboxH/2-16)+"px; background:url('"+this.options.skinfolder+"lightbox.png') no-repeat top left; } "}else{var buttonT=Math.round((this.options.headerpos==
"bottom"?0:this.options.headerHeight)+this.options.height/2-24);var buttonB=buttonT+Math.round(this.options.height/2)-32;var buttonR=this.options.width-54;var buttonR1=buttonR;var buttonR2=this.options.showfullscreenbutton?buttonR1-48:buttonR1;styleCss=" .html5gallery-toolbox-"+this.id+" {display:"+(this.options.imagetoolboxmode=="show"?"block":"none")+";}";styleCss+=" .html5gallery-toolbox-bg-"+this.id+" {display:none;}";styleCss+=" .html5gallery-toolbox-buttons-"+this.id+" {display:block;}";styleCss+=
" .html5gallery-play-"+this.id+" { position:absolute; display:"+(this.options.imagetoolboxmode=="show"?"block":"none")+"; cursor:pointer; top:"+buttonB+"px; left:"+buttonR2+"px; width:48px; height:48px; background:url('"+this.options.skinfolder+"side_play.png') no-repeat top left;} ";styleCss+=" .html5gallery-pause-"+this.id+" { position:absolute; display:"+(this.options.imagetoolboxmode=="show"?"block":"none")+"; cursor:pointer; top:"+buttonB+"px; left:"+buttonR2+"px; width:48px; height:48px; background:url('"+
this.options.skinfolder+"side_pause.png') no-repeat top left;} ";styleCss+=" .html5gallery-left-"+this.id+" { position:absolute; display:"+(this.options.imagetoolboxmode=="show"?"block":"none")+"; cursor:pointer; top:"+buttonT+"px; left:0px; width:48px; height:48px; background:url('"+this.options.skinfolder+"side_prev.png') no-repeat center center;} ";styleCss+=" .html5gallery-right-"+this.id+" { position:absolute; display:"+(this.options.imagetoolboxmode=="show"?"block":"none")+"; cursor:pointer; top:"+
buttonT+"px; left:"+buttonR1+"px; width:48px; height:48px; background:url('"+this.options.skinfolder+"side_next.png')  no-repeat center center;} ";styleCss+=" .html5gallery-lightbox-"+this.id+" {position:absolute; display:"+(this.options.imagetoolboxmode=="show"?"block":"none")+"; cursor:pointer; top:"+buttonB+"px; left:"+buttonR1+"px; width:48px; height:48px; background:url('"+this.options.skinfolder+"side_lightbox.png') no-repeat top left;} "}$(".html5gallery-play-"+this.id,this.$gallery).hover(function(){$(this).css({"background-position":"right top"})},
function(){$(this).css({"background-position":"left top"})});$(".html5gallery-pause-"+this.id,this.$gallery).hover(function(){$(this).css({"background-position":"right top"})},function(){$(this).css({"background-position":"left top"})});$(".html5gallery-left-"+this.id,this.$gallery).hover(function(){$(this).css({"background-position":"right top"})},function(){$(this).css({"background-position":"left top"})});$(".html5gallery-right-"+this.id,this.$gallery).hover(function(){$(this).css({"background-position":"right top"})},
function(){$(this).css({"background-position":"left top"})});$(".html5gallery-lightbox-"+this.id,this.$gallery).hover(function(){$(this).css({"background-position":"right top"})},function(){$(this).css({"background-position":"left top"})});$("head").append("<style type='text/css' data-creator='html5gallery'>"+styleCss+"</style>")}this.showimagetoolbox=function(type){if(!this.options.showplaybutton&&!this.options.showprevbutton&&!this.options.shownextbutton&&!this.options.showfullscreenbutton)return;
if(this.options.imagetoolboxstyle=="center"){var toolboxT=Math.round((this.options.headerpos=="bottom"?0:this.options.headerHeight)+this.options.height/2);if(type==TYPE_VIDEO_MP4||type==TYPE_VIDEO_OGG||type==TYPE_VIDEO_WEBM||type==TYPE_VIDEO_YOUTUBE||type==TYPE_VIDEO_VIMEO)toolboxT+=45;$(".html5gallery-toolbox-"+this.id,this.$gallery).css({"top":toolboxT});var toolboxW=0;if(this.options.showplaybutton&&type==TYPE_IMAGE){toolboxW+=36;if(this.isPaused){$(".html5gallery-play-"+this.id,this.$gallery).show();
$(".html5gallery-pause-"+this.id,this.$gallery).hide()}else{$(".html5gallery-play-"+this.id,this.$gallery).hide();$(".html5gallery-pause-"+this.id,this.$gallery).show()}}else{$(".html5gallery-play-"+this.id,this.$gallery).hide();$(".html5gallery-pause-"+this.id,this.$gallery).hide()}if(this.options.showprevbutton){toolboxW+=36;$(".html5gallery-left-"+this.id,this.$gallery).show()}else $(".html5gallery-left-"+this.id,this.$gallery).hide();if(this.options.shownextbutton){toolboxW+=36;$(".html5gallery-right-"+
this.id,this.$gallery).show()}else $(".html5gallery-right-"+this.id,this.$gallery).hide();if(this.options.showfullscreenbutton&&type==TYPE_IMAGE){toolboxW+=36;$(".html5gallery-lightbox-"+this.id,this.$gallery).show()}else $(".html5gallery-lightbox-"+this.id,this.$gallery).hide();$(".html5gallery-toolbox-"+this.id,this.$gallery).css({width:toolboxW+16});$(".html5gallery-toolbox-buttons-"+this.id,this.$gallery).css({width:toolboxW})}else{if(this.options.showplaybutton&&type==TYPE_IMAGE)if(this.isPaused){$(".html5gallery-play-"+
this.id,this.$gallery).show();$(".html5gallery-pause-"+this.id,this.$gallery).hide()}else{$(".html5gallery-play-"+this.id,this.$gallery).hide();$(".html5gallery-pause-"+this.id,this.$gallery).show()}else{$(".html5gallery-play-"+this.id,this.$gallery).hide();$(".html5gallery-pause-"+this.id,this.$gallery).hide()}if(this.options.showprevbutton)$(".html5gallery-left-"+this.id,this.$gallery).show();else $(".html5gallery-left-"+this.id,this.$gallery).hide();if(this.options.shownextbutton)$(".html5gallery-right-"+
this.id,this.$gallery).show();else $(".html5gallery-right-"+this.id,this.$gallery).hide();if(this.options.showfullscreenbutton&&type==TYPE_IMAGE)$(".html5gallery-lightbox-"+this.id,this.$gallery).show();else $(".html5gallery-lightbox-"+this.id,this.$gallery).hide()}if(this.options.isIE678)$(".html5gallery-toolbox-"+this.id,this.$gallery).show();else $(".html5gallery-toolbox-"+this.id,this.$gallery).fadeIn()};this.hideimagetoolbox=function(){if(this.options.isIE678)$(".html5gallery-toolbox-"+this.id,
this.$gallery).hide();else $(".html5gallery-toolbox-"+this.id,this.$gallery).fadeOut()}},resizeStyleDefault:function(){if(!this.container.parent()||!this.container.parent().width())return;this.options.containerWidth=this.container.parent().width();this.options.totalWidth=this.options.containerWidth;this.options.width=this.options.totalWidth-2*this.options.padding;if(this.options.showcarousel){this.options.carouselHeight=this.options.thumbheight+2*this.options.thumbmargin;if(this.options.carouselmultirows)this.options.carouselHeight=
Math.ceil(this.elemArray.length/Math.floor(this.options.width/(this.options.thumbwidth+this.options.thumbgap)))*(this.options.thumbheight+this.options.thumbrowgap)}if(this.options.responsivefullscreen&&this.container.parent().height()>0){this.options.containerHeight=this.container.parent().height();this.options.totalHeight=this.options.containerHeight;this.options.height=this.options.totalHeight-(this.options.headerHeight+2*this.options.padding);if(this.options.carouselHeight+this.options.carouselmargin>
0)this.options.height-=this.options.carouselHeight+this.options.carouselmargin}else{this.options.height=Math.round(this.options.width*this.options.originalHeight/this.options.originalWidth);this.options.totalHeight=this.options.height+this.options.carouselHeight+this.options.carouselmargin+this.options.headerHeight+2*this.options.padding;this.options.containerHeight=this.options.totalHeight}this.container.css({"width":this.options.containerWidth,"height":this.options.containerHeight});this.options.boxWidth=
this.options.width;this.options.boxHeight=this.options.height+this.options.headerHeight;if(this.options.showcarousel){this.options.carouselWidth=this.options.width;this.options.carouselLeft=this.options.padding;this.options.carouselTop=this.options.padding+this.options.boxHeight+this.options.carouselmargin}$(".html5gallery-container-"+this.id).css({width:this.options.totalWidth+"px",height:this.options.totalHeight+"px"});$(".html5gallery-box-"+this.id).css({width:this.options.boxWidth+"px",height:this.options.boxHeight+
"px"});var type=this.elemArray[this.curElem][ELEM_TYPE];if(type==TYPE_IMAGE||this.showingPoster){var imageWidth=this.elemArray[this.curElem][ELEM_WIDTH];var imageHeight=this.elemArray[this.curElem][ELEM_HEIGHT];var scale;if(this.isFullscreen){scale=Math.min(this.fullscreenWidth/imageWidth,this.fullscreenHeight/imageHeight);scale=scale>1?1:scale}else if(this.options.resizemode=="fill")scale=Math.max(this.options.width/imageWidth,this.options.height/imageHeight);else scale=Math.min(this.options.width/
imageWidth,this.options.height/imageHeight);var w=Math.round(scale*imageWidth);var h=Math.round(scale*imageHeight);var w1=this.isFullscreen?w:this.options.width;var h1=this.isFullscreen?h:this.options.height;var l=Math.round(w1/2-w/2);var t=Math.round(h1/2-h/2);if(this.isFullscreen)this.adjustFullscreen(w1,h1,true);$(".html5gallery-elem-"+this.id).css({"width":w1+"px","height":h1+"px"});$(".html5gallery-elem-img-"+this.id).css({width:w1+"px",height:h1+"px"});$(".html5gallery-elem-image-"+this.id).css({width:w+
"px",height:h+"px",top:t+"px",left:l+"px"})}else if(type==TYPE_VIDEO_FLASH||type==TYPE_VIDEO_MP4||type==TYPE_VIDEO_OGG||type==TYPE_VIDEO_WEBM||type==TYPE_VIDEO_YOUTUBE||type==TYPE_VIDEO_VIMEO){var dataW=this.elemArray[this.curElem][ELEM_WIDTH];var dataH=this.elemArray[this.curElem][ELEM_HEIGHT];var w1,h1;if(this.isFullscreen){scale=Math.min(this.fullscreenWidth/dataW,this.fullscreenHeight/dataH);scale=scale>1?1:scale;w1=Math.round(scale*dataW);h1=Math.round(scale*dataH);this.adjustFullscreen(w1,h1,
true)}else{w1=this.options.width;h1=this.options.height}$(".html5gallery-elem-"+this.id).css({"width":w1+"px","height":h1+"px"});$(".html5gallery-elem-video-"+this.id).css({"width":w1+"px","height":h1+"px"});$(".html5gallery-elem-video-container-"+this.id).css({"width":w1+"px","height":h1+"px"});var h2=this.options.isIPhone?h1-48:h1;$(".html5gallery-elem-video-container-"+this.id).find("video").css({"width":w1+"px","height":h2+"px"});$("#html5gallery-elem-video-"+this.id).css({"width":w1+"px","height":h1+
"px"})}else if(type==TYPE_SWF);var titleTop=0;var socialTop=0;if(this.options.headerpos=="bottom"){titleTop=this.options.titleoverlay?this.options.height-this.options.titleheight:this.options.height;socialTop=this.options.titleoverlay?this.options.height:this.options.height+this.options.titleheight}$(".html5gallery-title-"+this.id).css({width:this.options.boxWidth+"px"});if(!this.options.titleoverlay)$(".html5gallery-title-"+this.id).css({top:titleTop+"px"});$(".html5gallery-viral-"+this.id).css({top:socialTop+
"px"});$(".html5gallery-timer-"+this.id).css({top:String(this.options.elemTop+this.options.height-2)+"px"});if(this.options.showcarousel){$(".html5gallery-car-"+this.id).css({width:this.options.width+"px",top:this.options.carouselTop+"px"});var carLeft=4;var carRight=4;if(this.options.slideshadow)carLeft+=12;$(".html5gallery-car-list-"+this.id).css({width:String(this.options.width-carLeft-carRight)+"px"});var carButtonW=0;if(this.options.carouselNavButton)carButtonW=72;this.options.thumbShowNum=Math.floor((this.options.width-
carLeft-carRight-carButtonW)/(this.options.thumbwidth+this.options.thumbgap));this.options.thumbMaskWidth=this.options.thumbShowNum*this.options.thumbwidth+this.options.thumbShowNum*this.options.thumbgap;this.options.thumbTotalWidth=this.elemArray.length*this.options.thumbwidth+(this.elemArray.length-1)*this.options.thumbgap;var marginL=0;if(this.options.carouselmultirows){var column=Math.floor(this.options.width/(this.options.thumbwidth+this.options.thumbgap));marginL=(this.options.width-column*
this.options.thumbwidth-(column-1)*this.options.thumbgap)/2;$(".html5gallery-thumbs-"+this.id).css({"margin-left":marginL+"px",width:this.options.width+"px"})}else{if(this.options.thumbMaskWidth>this.options.thumbTotalWidth)marginL=this.options.thumbMaskWidth/2-this.options.thumbTotalWidth/2-this.options.thumbgap/2;$(".html5gallery-thumbs-"+this.id).css({"margin-left":marginL+"px",width:String(this.elemArray.length*(this.options.thumbwidth+this.options.thumbgap))+"px"})}var maskLeft=Math.round((this.options.width-
carLeft-carRight)/2-this.options.thumbMaskWidth/2);$(".html5gallery-car-mask-"+this.id).css({left:maskLeft+"px",width:this.options.thumbMaskWidth+"px"});this.carouselHighlight(this.curElem,true)}},createStyleDefault:function(){this.options.thumbimagewidth=this.options.thumbwidth-2*this.options.thumbimageborder;this.options.thumbimageheight=this.options.thumbheight-2*this.options.thumbimageborder;if(this.options.thumbshowtitle)this.options.thumbheight+=this.options.thumbtitleheight;if(!this.options.showtitle)this.options.titleheight=
0;if(!this.options.showsocialmedia||!this.options.showfacebooklike&&!this.options.showtwitter&&!this.options.showgoogleplus)this.options.socialheight=0;this.options.headerHeight=this.options.titleoverlay?this.options.socialheight:this.options.titleheight+this.options.socialheight;this.options.boxWidth=this.options.width;this.options.boxHeight=this.options.height+this.options.headerHeight;this.options.boxLeft=this.options.padding;this.options.boxTop=this.options.padding;if(this.options.slideshadow){this.options.boxLeft-=
4;this.options.boxTop-=4}if(this.options.showcarousel){this.options.carouselWidth=this.options.width;this.options.carouselHeight=this.options.thumbheight+2*this.options.thumbmargin;this.options.carouselLeft=this.options.padding;this.options.carouselTop=this.options.padding+this.options.boxHeight+this.options.carouselmargin;if(this.options.carouselmultirows)this.options.carouselHeight=Math.ceil(this.options.width/(this.options.thumbwidth+this.options.thumbgap))*(this.options.thumbheight+this.options.thumbrowgap)}else{this.options.carouselWidth=
0;this.options.carouselHeight=0;this.options.carouselLeft=0;this.options.carouselTop=0;this.options.carouselmargin=0}this.options.totalWidth=this.options.width+2*this.options.padding;this.options.totalHeight=this.options.height+this.options.carouselHeight+this.options.carouselmargin+this.options.headerHeight+2*this.options.padding;this.options.containerWidth=this.options.totalWidth;this.options.containerHeight=this.options.totalHeight;if(this.options.responsive){this.options.originalWidth=this.options.width;
this.options.originalHeight=this.options.height;this.container.css({"max-width":"100%"})}else this.container.css({"width":this.options.containerWidth,"height":this.options.containerHeight});var titleTop=0;var socialTop=0;this.options.elemTop=0;if(this.options.headerpos=="top"){socialTop=0;titleTop=this.options.socialheight;this.options.elemTop=this.options.headerHeight}else if(this.options.headerpos=="bottom"){this.options.elemTop=0;titleTop=this.options.titleoverlay?this.options.height-this.options.titleheight:
this.options.height;socialTop=this.options.titleoverlay?this.options.height:this.options.height+this.options.titleheight}var styleCss=" .html5gallery-container-"+this.id+" { display:block; position:absolute; left:0px; top:0px; width:"+this.options.totalWidth+"px; height:"+this.options.totalHeight+"px; background:url('"+this.options.skinfolder+this.options.bgimage+"') center top; background-color:"+this.options.bgcolor+";}";if(this.options.galleryshadow)styleCss+=" .html5gallery-container-"+this.id+
" { -moz-box-shadow: 0px 2px 5px #aaa; -webkit-box-shadow: 0px 2px 5px #aaa; box-shadow: 0px 2px 5px #aaa;}";styleCss+=" .html5gallery-box-"+this.id+" {display:block; position:absolute; text-align:center; left:"+this.options.boxLeft+"px; top:"+this.options.boxTop+"px; width:"+this.options.boxWidth+"px; height:"+this.options.boxHeight+"px;}";var viralPaddingTop=Math.round(this.options.socialheight/2-12);styleCss+=" .html5gallery-title-text-"+this.id+" "+this.options.titlecss+" .html5gallery-title-text-"+
this.id+" "+this.options.titlecsslink+" .html5gallery-error-"+this.id+" "+this.options.errorcss;styleCss+=" .html5gallery-description-text-"+this.id+" "+this.options.descriptioncss+" .html5gallery-description-text-"+this.id+" "+this.options.descriptioncsslink;styleCss+=" .html5gallery-fullscreen-title-"+this.id+""+this.options.titlefullscreencss+" .html5gallery-fullscreen-title-"+this.id+""+this.options.titlefullscreencsslink;styleCss+=" .html5gallery-viral-"+this.id+" {display:block; overflow:hidden; position:absolute; text-align:left; top:"+
socialTop+"px; left:0px; width:"+this.options.boxWidth+"px; height:"+this.options.socialheight+"px; padding-top:"+viralPaddingTop+"px;}";styleCss+=" .html5gallery-title-"+this.id+" {display:"+(this.options.titleoverlay&&this.options.titleautohide?"none":"block")+"; overflow:hidden; position:absolute; left:0px; width:"+this.options.boxWidth+"px; ";if(!this.options.titleoverlay)styleCss+="top:"+titleTop+"px; height:"+this.options.titleheight+"px; }";else if(this.options.headerpos=="top")styleCss+="top:0px; height:auto; }";
else styleCss+="bottom:0px; height:auto; }";styleCss+=" .html5gallery-timer-"+this.id+" {display:block; position:absolute; top:"+String(this.options.elemTop+this.options.height-2)+"px; left:0px; width:0px; height:2px; background-color:#ccc; filter:alpha(opacity=60); opacity:0.6; }";styleCss+=" .html5gallery-elem-"+this.id+" {display:block; overflow:hidden; position:absolute; top:"+this.options.elemTop+"px; left:0px; width:"+this.options.width+"px; height:"+this.options.height+"px;}";if(this.options.isIE7||
this.options.isIE6){styleCss+=" .html5gallery-loading-"+this.id+" {display:none; }";styleCss+=" .html5gallery-loading-center-"+this.id+" {display:none; }"}else{styleCss+=" .html5gallery-loading-"+this.id+" {display:block; position:absolute; top:4px; right:4px; width:100%; height:100%; background:url('"+this.options.skinfolder+"loading.gif') no-repeat top right;}";styleCss+=" .html5gallery-loading-center-"+this.id+" {display:block; position:absolute; top:0px; left:0px; width:100%; height:100%; background:url('"+
this.options.skinfolder+"loading_center.gif') no-repeat center center;}"}if(this.options.borderradius>0)styleCss+=" .html5gallery-elem-"+this.id+" {overflow:hidden; border-radius:"+this.options.borderradius+"px; -moz-border-radius:"+this.options.borderradius+"px; -webkit-border-radius:"+this.options.borderradius+"px;}";if(this.options.slideshadow){styleCss+=" .html5gallery-title-"+this.id+" { padding:4px;}";styleCss+=" .html5gallery-timer-"+this.id+" { margin:4px;}";styleCss+=" .html5gallery-elem-"+
this.id+" { overflow:hidden; padding:4px; -moz-box-shadow: 0px 2px 5px #aaa; -webkit-box-shadow: 0px 2px 5px #aaa; box-shadow: 0px 2px 5px #aaa;}"}if(this.options.showcarousel&&this.options.carouselmultirows){styleCss+=" .html5gallery-car-"+this.id+" { position:absolute; display:block; overflow:hidden; left:"+this.options.carouselLeft+"px; top:"+this.options.carouselTop+"px; width:"+this.options.width+"px;";if(this.options.carouselbgtransparent)styleCss+="background-color:transparent;";else styleCss+=
"border-top:1px solid "+this.options.carouseltopborder+";"+"border-bottom:1px solid "+this.options.carouselbottomborder+";"+"background-color: "+this.options.carouselbgcolorend+"; "+"background: "+this.options.carouselbgcolorend+" -webkit-gradient(linear, left top, left bottom, from("+this.options.carouselbgcolorstart+"), to("+this.options.carouselbgcolorend+")) no-repeat; "+"background: "+this.options.carouselbgcolorend+" -moz-linear-gradient(top, "+this.options.carouselbgcolorstart+", "+this.options.carouselbgcolorend+
") no-repeat; "+"filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="+this.options.carouselbgcolorstart+", endColorstr="+this.options.carouselbgcolorend+") no-repeat; "+"-ms-filter: 'progid:DXImageTransform.Microsoft.gradient(startColorstr="+this.options.carouselbgcolorstart+", endColorstr="+this.options.carouselbgcolorend+")' no-repeat;";if(this.options.carouselbgimage)styleCss+="background:url('"+this.options.skinfolder+this.options.carouselbgimage+"') center top;";styleCss+="}";var column=
Math.floor(this.options.width/(this.options.thumbwidth+this.options.thumbgap));var marginL=(this.options.width-column*this.options.thumbwidth-(column-1)*this.options.thumbgap)/2;styleCss+=".html5gallery-thumbs-"+this.id+" { position:relative; display:block; margin-left:"+marginL+"px; width:"+this.options.width+"px; top:0px; }";styleCss+=" .html5gallery-tn-"+this.id+" { display:block; float:left; margin-left:0px; margin-right:"+this.options.thumbgap+"px; margin-bottom:"+this.options.thumbrowgap+"px; text-align:center; cursor:pointer; width:"+
this.options.thumbwidth+"px;height:"+this.options.thumbheight+"px;overflow:hidden;}";if(this.options.thumbshadow)styleCss+=" .html5gallery-tn-"+this.id+" { -moz-box-shadow: 0px 2px 5px #aaa; -webkit-box-shadow: 0px 2px 5px #aaa; box-shadow: 0px 2px 5px #aaa;}";styleCss+=" .html5gallery-tn-selected-"+this.id+" { display:block; float:left; margin-left:0px; margin-right:"+this.options.thumbgap+"px; margin-bottom:"+this.options.thumbrowgap+"px; text-align:center; cursor:pointer; width:"+this.options.thumbwidth+
"px;height:"+this.options.thumbheight+"px;overflow:hidden;}";if(this.options.thumbshadow)styleCss+=" .html5gallery-tn-selected-"+this.id+" { -moz-box-shadow: 0px 2px 5px #aaa; -webkit-box-shadow: 0px 2px 5px #aaa; box-shadow: 0px 2px 5px #aaa;}";styleCss+=" .html5gallery-tn-"+this.id+" {background-color:"+this.options.thumbimagebordercolor+";}"+" .html5gallery-tn-"+this.id+" { filter:alpha(opacity="+Math.round(this.options.thumbopacity*100)+"); opacity:"+this.options.thumbopacity+"; } "+" .html5gallery-tn-selected-"+
this.id+" { filter:alpha(opacity=100); opacity:1; } ";styleCss+=" .html5gallery-tn-img-"+this.id+" {display:block; overflow:hidden; width:"+String(this.options.thumbimagewidth+2*this.options.thumbimageborder)+"px;height:"+String(this.options.thumbimageheight+2*this.options.thumbimageborder)+"px;}";if(this.options.thumbunselectedimagebordercolor)styleCss+=" .html5gallery-tn-selected-"+this.id+" {background-color:"+this.options.thumbunselectedimagebordercolor+";}";if(this.options.thumbshowtitle){styleCss+=
" .html5gallery-tn-title-"+this.id+" {display:block; overflow:hidden; float:top; height:"+this.options.thumbtitleheight+"px;width:"+String(this.options.thumbwidth-2)+"px;line-height:"+this.options.thumbtitleheight+"px;}";styleCss+=" .html5gallery-tn-title-"+this.id+this.options.thumbtitlecss}else styleCss+=" .html5gallery-tn-title-"+this.id+" {display:none;}";this.carouselHighlight=function(index,nonanimation){}}else if(this.options.showcarousel){styleCss+=" .html5gallery-car-"+this.id+" { position:absolute; display:block; overflow:hidden; left:"+
this.options.carouselLeft+"px; top:"+this.options.carouselTop+"px; width:"+this.options.width+"px; height:"+this.options.carouselHeight+"px;";if(this.options.carouselbgtransparent)styleCss+="background-color:transparent;";else styleCss+="border-top:1px solid "+this.options.carouseltopborder+";"+"border-bottom:1px solid "+this.options.carouselbottomborder+";"+"background-color: "+this.options.carouselbgcolorend+"; "+"background: "+this.options.carouselbgcolorend+" -webkit-gradient(linear, left top, left bottom, from("+
this.options.carouselbgcolorstart+"), to("+this.options.carouselbgcolorend+")) no-repeat; "+"background: "+this.options.carouselbgcolorend+" -moz-linear-gradient(top, "+this.options.carouselbgcolorstart+", "+this.options.carouselbgcolorend+") no-repeat; "+"filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="+this.options.carouselbgcolorstart+", endColorstr="+this.options.carouselbgcolorend+") no-repeat; "+"-ms-filter: 'progid:DXImageTransform.Microsoft.gradient(startColorstr="+this.options.carouselbgcolorstart+
", endColorstr="+this.options.carouselbgcolorend+")' no-repeat;";if(this.options.carouselbgimage)styleCss+="background:url('"+this.options.skinfolder+this.options.carouselbgimage+"') center top;";styleCss+="}";var carLeft=4;var carRight=4;if(this.options.slideshadow)carLeft+=12;styleCss+=" .html5gallery-car-list-"+this.id+" { position:absolute; display:block; overflow:hidden; left:"+carLeft+"px; width:"+String(this.options.width-carLeft-carRight)+"px; top:0px; height:"+this.options.carouselHeight+
"px; "+"}";var carButtonW=0;this.options.carouselNavButton=false;if(Math.floor((this.options.width-carLeft-carRight)/(this.options.thumbwidth+this.options.thumbgap))<this.elemArray.length)this.options.carouselNavButton=true;if(this.options.carouselNavButton){styleCss+=" .html5gallery-car-left-"+this.id+" { position:absolute; display:block; overflow:hidden; width:32px; height:32px; left:0px; top:"+String(this.options.carouselHeight/2-16)+"px; background:url('"+this.options.skinfolder+"carousel_left.png') no-repeat 0px 0px;} "+
" .html5gallery-car-right-"+this.id+" { position:absolute; display:block; overflow:hidden; width:32px; height:32px; right:0px; top:"+String(this.options.carouselHeight/2-16)+"px; background:url('"+this.options.skinfolder+"carousel_right.png') no-repeat 0px 0px;} ";carButtonW=72}this.options.thumbShowNum=Math.floor((this.options.width-carLeft-carRight-carButtonW)/(this.options.thumbwidth+this.options.thumbgap));this.options.thumbMaskWidth=this.options.thumbShowNum*this.options.thumbwidth+this.options.thumbShowNum*
this.options.thumbgap;this.options.thumbTotalWidth=this.elemArray.length*this.options.thumbwidth+(this.elemArray.length-1)*this.options.thumbgap;var marginL=0;if(this.options.thumbMaskWidth>this.options.thumbTotalWidth)marginL=this.options.thumbMaskWidth/2-this.options.thumbTotalWidth/2-this.options.thumbgap/2;styleCss+=".html5gallery-thumbs-"+this.id+" { position:relative; display:block; margin-left:"+marginL+"px; width:"+String(this.elemArray.length*(this.options.thumbwidth+this.options.thumbgap))+
"px; top:"+Math.round(this.options.carouselHeight/2-this.options.thumbheight/2)+"px; }";var maskLeft=Math.round((this.options.width-carLeft-carRight)/2-this.options.thumbMaskWidth/2);styleCss+=" .html5gallery-car-mask-"+this.id+" { position:absolute; display:block; text-align:left; overflow:hidden; left:"+maskLeft+"px; width:"+this.options.thumbMaskWidth+"px; top:0px; height:"+this.options.carouselHeight+"px;} ";styleCss+=" .html5gallery-tn-"+this.id+" { display:block; float:left; margin-left:"+Math.round(this.options.thumbgap/
2)+"px; margin-right:"+Math.round(this.options.thumbgap/2)+"px; text-align:center; cursor:pointer; width:"+this.options.thumbwidth+"px;height:"+this.options.thumbheight+"px;overflow:hidden;}";if(this.options.thumbshadow)styleCss+=" .html5gallery-tn-"+this.id+" { -moz-box-shadow: 0px 2px 5px #aaa; -webkit-box-shadow: 0px 2px 5px #aaa; box-shadow: 0px 2px 5px #aaa;}";styleCss+=" .html5gallery-tn-selected-"+this.id+" { display:block; float:left; margin-left:"+Math.round(this.options.thumbgap/2)+"px; margin-right:"+
Math.round(this.options.thumbgap/2)+"px;text-align:center; cursor:pointer; width:"+this.options.thumbwidth+"px;height:"+this.options.thumbheight+"px;overflow:hidden;}";if(this.options.thumbshadow)styleCss+=" .html5gallery-tn-selected-"+this.id+" { -moz-box-shadow: 0px 2px 5px #aaa; -webkit-box-shadow: 0px 2px 5px #aaa; box-shadow: 0px 2px 5px #aaa;}";styleCss+=" .html5gallery-tn-"+this.id+" {background-color:"+this.options.thumbimagebordercolor+";}"+" .html5gallery-tn-"+this.id+" { filter:alpha(opacity="+
Math.round(this.options.thumbopacity*100)+"); opacity:"+this.options.thumbopacity+"; } "+" .html5gallery-tn-selected-"+this.id+" { filter:alpha(opacity=100); opacity:1; } ";styleCss+=" .html5gallery-tn-img-"+this.id+" {display:block; overflow:hidden; width:"+String(this.options.thumbimagewidth+2*this.options.thumbimageborder)+"px;height:"+String(this.options.thumbimageheight+2*this.options.thumbimageborder)+"px;}";if(this.options.thumbunselectedimagebordercolor)styleCss+=" .html5gallery-tn-selected-"+
this.id+" {background-color:"+this.options.thumbunselectedimagebordercolor+";}";if(this.options.thumbshowtitle){styleCss+=" .html5gallery-tn-title-"+this.id+" {display:block; overflow:hidden; float:top; height:"+this.options.thumbtitleheight+"px;width:"+String(this.options.thumbwidth-2)+"px;line-height:"+this.options.thumbtitleheight+"px;}";styleCss+=" .html5gallery-tn-title-"+this.id+this.options.thumbtitlecss}else styleCss+=" .html5gallery-tn-title-"+this.id+" {display:none;}";this.carouselHighlight=
function(index,nonanimation){$("#html5gallery-tn-"+this.id+"-"+index,this.$gallery).removeClass("html5gallery-tn-"+this.id).addClass("html5gallery-tn-selected-"+this.id);if(this.options.thumbShowNum>=this.elemArray.length){$(".html5gallery-car-left-"+this.id,this.$gallery).css({"background-position":"-64px 0px",cursor:""});$(".html5gallery-car-left-"+this.id,this.$gallery).data("disabled",true);$(".html5gallery-car-right-"+this.id,this.$gallery).css({"background-position":"-64px 0px",cursor:""});
$(".html5gallery-car-right-"+this.id,this.$gallery).data("disabled",true);return}var pos=Math.floor(index/this.options.thumbShowNum)*this.options.thumbShowNum*(this.options.thumbwidth+this.options.thumbgap);if(pos>=this.options.thumbTotalWidth-this.options.thumbMaskWidth+this.options.thumbgap)pos=this.options.thumbTotalWidth-this.options.thumbMaskWidth+this.options.thumbgap;pos=-pos;if(nonanimation)$(".html5gallery-thumbs-"+this.id,this.$gallery).css({marginLeft:pos});else $(".html5gallery-thumbs-"+
this.id,this.$gallery).animate({marginLeft:pos},500);this.updateCarouseButtons(pos)};this.carouselPrev=function(){var $thumbContainer=$(".html5gallery-thumbs-"+this.id,this.$gallery);if(parseInt($thumbContainer.css("margin-left"))==0)return;else{var pos=-1*parseInt($thumbContainer.css("margin-left"))-this.options.thumbShowNum*(this.options.thumbwidth+this.options.thumbgap);if(pos<0)pos=0;$thumbContainer.animate({marginLeft:-pos},500,this.options.carouseleasing);this.updateCarouseButtons(-pos)}};this.carouselNext=
function(){var $thumbContainer=$(".html5gallery-thumbs-"+this.id,this.$gallery);if(parseInt($thumbContainer.css("margin-left"))==-(this.options.thumbTotalWidth-this.options.thumbMaskWidth+this.options.thumbgap))return;else{var pos=-1*parseInt($thumbContainer.css("margin-left"))+this.options.thumbShowNum*(this.options.thumbwidth+this.options.thumbgap);if(pos>=this.options.thumbTotalWidth-this.options.thumbMaskWidth+this.options.thumbgap)pos=this.options.thumbTotalWidth-this.options.thumbMaskWidth+
this.options.thumbgap;$thumbContainer.animate({marginLeft:-pos},500,this.options.carouseleasing);this.updateCarouseButtons(-pos)}};this.updateCarouseButtons=function(pos){var $leftButton=$(".html5gallery-car-left-"+this.id,this.$gallery);var $rightButton=$(".html5gallery-car-right-"+this.id,this.$gallery);var rightMost=-1*(this.options.thumbTotalWidth-this.options.thumbMaskWidth+this.options.thumbgap);if(pos==0){$leftButton.css({"background-position":"-64px 0px",cursor:""});$leftButton.data("disabled",
true)}else if($leftButton.data("disabled")){$leftButton.css({"background-position":"0px 0px",cursor:"pointer"});$leftButton.data("disabled",false)}if(pos==rightMost){$rightButton.css({"background-position":"-64px 0px",cursor:""});$rightButton.data("disabled",true)}else if($rightButton.data("disabled")){$rightButton.css({"background-position":"0px 0px",cursor:"pointer"});$rightButton.data("disabled",false)}}}else styleCss+=" .html5gallery-car-"+this.id+" { display:none; }";styleCss+=".html5gallery-container-"+
this.id+" div {box-sizing:content-box;}";$("head").append("<style type='text/css' data-creator='html5gallery'>"+styleCss+"</style>")},loadCarousel:function(){var instance=this;var $thumbContainer=$(".html5gallery-thumbs-"+this.id,this.$gallery);$thumbContainer.empty();for(var i=0;i<this.elemArray.length;i++){var $thumb=$("<div id='html5gallery-tn-"+this.id+"-"+i+"' class='html5gallery-tn-"+this.id+"' data-index="+i+" ></div>");$thumb.appendTo($thumbContainer);$thumb.unbind("click").click(function(event){instance.slideRun($(this).data("index"),
true,true);event.preventDefault()});$thumb.hover(function(){instance.onThumbOver();$(this).removeClass("html5gallery-tn-"+instance.id).addClass("html5gallery-tn-selected-"+instance.id)},function(){if($(this).data("index")!==instance.curElem)$(this).removeClass("html5gallery-tn-selected-"+instance.id).addClass("html5gallery-tn-"+instance.id)});var imgLoader=new Image;imgLoader.data=i;$(imgLoader).load(function(){var scale=Math.max(instance.options.thumbimagewidth/this.width,instance.options.thumbimageheight/
this.height);var w=Math.round(scale*this.width);var h=Math.round(scale*this.height);var videoPlay=instance.options.thumbshowplayonvideo&&instance.elemArray[this.data][ELEM_TYPE]!=1?"<div class='html5gallery-tn-img-play-"+instance.id+"' style='display:block; overflow:hidden; position:absolute; width:"+instance.options.thumbimagewidth+"px;height:"+instance.options.thumbimageheight+"px; top:"+instance.options.thumbimageborder+"px; left:"+instance.options.thumbimageborder+'px;background:url("'+instance.options.skinfolder+
"playvideo.png\") no-repeat center center;'></div>":"";$("#html5gallery-tn-"+instance.id+"-"+this.data,$thumbContainer).append("<div class='html5gallery-tn-img-"+instance.id+"' style='position:relative;'><div style='display:block; overflow:hidden; position:absolute; width:"+instance.options.thumbimagewidth+"px;height:"+instance.options.thumbimageheight+"px; top:"+instance.options.thumbimageborder+"px; left:"+instance.options.thumbimageborder+"px;'><img class='html5gallery-tn-image-"+instance.id+"' style='border:none !important; padding:0px !important; margin:0px !important; max-width:none !important; max-height:none !important; width:"+
w+"px !important; height:"+h+"px !important;' src='"+instance.elemArray[this.data][ELEM_THUMBNAIL]+"' /></div>"+videoPlay+"</div><div class='html5gallery-tn-title-"+instance.id+"'>"+instance.elemArray[this.data][ELEM_TITLE]+(instance.options.thumbshowdescription?"<br /><span class='html5gallery-tn-description-"+instance.id+"'>"+instance.elemArray[this.data][ELEM_INFORMATION]+"</span>":"")+"</div>")});imgLoader.src=this.elemArray[i][ELEM_THUMBNAIL]}if(this.options.carouselmultirows)$thumbContainer.append("<div style='clear:both;'></div>")},
goNormal:function(){clearTimeout(this.slideshowTimeout);$(document).unbind("keyup.html5gallery");$(".html5gallery-timer-"+this.id,this.$gallery).css({width:0});clearInterval(this.slideTimer);this.slideTimerCount=0;this.isFullscreen=false;var $elem=$(".html5gallery-elem-"+this.id,this.$fullscreen).empty().css({top:this.options.elemTop});$(".html5gallery-box-"+this.id,this.$gallery).prepend($elem);this.slideRun(this.curElem);this.$fullscreen.remove();if(this.options.imagetoolboxmode=="show")this.showimagetoolbox(this.elemArray[this.curElem][ELEM_TYPE]);
else this.hideimagetoolbox()},goFullscreen:function(){this.hideimagetoolbox();clearTimeout(this.slideshowTimeout);$(".html5gallery-fullscreen-timer-"+this.id,this.$fullscreen).css({width:0});clearInterval(this.slideTimer);this.slideTimerCount=0;this.isFullscreen=true;this.fullscreenInitial=20;this.fullscreenMargin=this.options.lightboxborder;this.fullscreenBarH=this.options.lightboxtextheight;this.fullscreenOutsideMargin=this.options.lightboxmargin;var fullW=this.options.isMobile?Math.max($(window).width(),
$(document).width()):$(window).width();var w=this.elemArray[this.curElem][ELEM_WIDTH],h=this.elemArray[this.curElem][ELEM_HEIGHT];this.fullscreenWidth=fullW-2*this.fullscreenMargin-2*this.fullscreenOutsideMargin;var winH=window.innerHeight?window.innerHeight:$(window).height();this.fullscreenHeight=winH-2*this.fullscreenMargin-this.fullscreenBarH-2*this.fullscreenOutsideMargin;var fullH=Math.max(winH,$(document).height());var scale=Math.min(this.fullscreenWidth/w,this.fullscreenHeight/h);if(scale<
1)w*=scale,h*=scale;var marginT=$(window).scrollTop()+Math.round((winH-(h+2*this.fullscreenMargin+this.fullscreenBarH))/2);this.$fullscreen=$("<div class='html5gallery-fullscreen-"+this.id+"' style='position:absolute;top:0px;left:0px;width:"+fullW+"px;height:"+fullH+"px;text-align:center;z-index:99999;'>"+"<div class='html5gallery-fullscreen-overlay-"+this.id+"' style='display:block;position:absolute;top:0px;left:0px;width:100%;height:100%;background-color:#000000;opacity:0.9;filter:alpha(opacity=80);'></div>"+
"<div class='html5gallery-fullscreen-box-"+this.id+"' style='display:block;overflow:hidden;position:relative;margin:0px auto;top:"+marginT+"px;width:"+this.fullscreenInitial+"px;height:"+this.fullscreenInitial+"px;background-color:"+this.options.lightboxbgcolor+";'>"+"<div class='html5gallery-fullscreen-elem-"+this.id+"' style='display:block;position:absolute;overflow:hidden;width:"+w+"px;height:"+h+"px;left:"+this.fullscreenMargin+"px;top:"+this.fullscreenMargin+"px;'>"+"<div class='html5gallery-fullscreen-timer-"+
this.id+"' style='display:block; position:absolute; top:"+String(h-4)+"px; left:0px; width:0px; height:4px; background-color:#666; filter:alpha(opacity=60); opacity:0.6;'></div>"+"</div>"+"<div class='html5gallery-fullscreen-bar-"+this.id+"' style='display:block;position:absolute;padding-top:8px;width:"+w+"px;height:"+this.fullscreenBarH+"px;left:"+this.fullscreenMargin+"px;top:"+String(h+this.fullscreenMargin)+"px;'>"+"<div class='html5gallery-fullscreen-close-"+this.id+"' style='display:block;position:relative;float:right;cursor:pointer;width:32px;height:32px;top:8px;background-image:url(\""+
this.options.skinfolder+"lightbox_close.png\");'></div>"+"<div class='html5gallery-fullscreen-play-"+this.id+"' style='display:"+(this.isPaused&&this.elemArray.length>1&&this.elemArray[this.curElem][ELEM_TYPE]==1?"block":"none")+';position:relative;float:right;cursor:pointer;width:32px;height:32px;top:8px;background-image:url("'+this.options.skinfolder+"lightbox_play.png\");'></div>"+"<div class='html5gallery-fullscreen-pause-"+this.id+"' style='display:"+(this.isPaused||this.elemArray.length<=1||
this.elemArray[this.curElem][ELEM_TYPE]!=1?"none":"block")+';position:relative;float:right;cursor:pointer;width:32px;height:32px;top:8px;background-image:url("'+this.options.skinfolder+"lightbox_pause.png\");'></div>"+"<div class='html5gallery-fullscreen-title-"+this.id+"' style='display:block;position:relative;float:left;width:"+String(w-72)+"px;height:"+this.fullscreenBarH+"px;top:0px;left:0px;text-align:left;'></div>"+"</div>"+"<div class='html5gallery-fullscreen-next-"+this.id+"' style='display:none;position:absolute;cursor:pointer;width:48px;height:48px;right:"+
this.fullscreenMargin+"px;top:"+Math.round(h/2)+'px;background-image:url("'+this.options.skinfolder+"lightbox_next.png\");'></div>"+"<div class='html5gallery-fullscreen-prev-"+this.id+"' style='display:none;position:absolute;cursor:pointer;width:48px;height:48px;left:"+this.fullscreenMargin+"px;top:"+Math.round(h/2)+'px;background-image:url("'+this.options.skinfolder+"lightbox_prev.png\");'></div>"+"</div>"+"</div>");this.$fullscreen.appendTo("body");var instance=this;$(window).scroll(function(){var $box=
$(".html5gallery-fullscreen-box-"+instance.id,instance.$fullscreen);var winH=window.innerHeight?window.innerHeight:$(window).height();var marginT=$(window).scrollTop()+Math.round((winH-$box.height())/2);$box.css({"top":marginT})});var $elem=$(".html5gallery-elem-"+this.id,this.$gallery).empty().css({top:0});$(".html5gallery-fullscreen-box-"+this.id,this.$fullscreen).animate({height:h+2*this.fullscreenMargin},"slow",function(){$(this).animate({width:w+2*instance.fullscreenMargin},"slow",function(){$(this).animate({height:"+="+
instance.fullscreenBarH},"slow",function(){$(".html5gallery-fullscreen-elem-"+instance.id,instance.$fullscreen).prepend($elem);instance.slideRun(instance.curElem)})})});$(".html5gallery-fullscreen-overlay-"+this.id,this.$fullscreen).click(function(){instance.goNormal()});$(".html5gallery-fullscreen-box-"+this.id,this.$fullscreen).hover(function(){if(instance.elemArray.length>1){$(".html5gallery-fullscreen-next-"+instance.id,instance.$fullscreen).fadeIn();$(".html5gallery-fullscreen-prev-"+instance.id,
instance.$fullscreen).fadeIn()}},function(){$(".html5gallery-fullscreen-next-"+instance.id,instance.$fullscreen).fadeOut();$(".html5gallery-fullscreen-prev-"+instance.id,instance.$fullscreen).fadeOut()});$(".html5gallery-fullscreen-box-"+this.id,this.$fullscreen).touchSwipe({preventWebBrowser:true,swipeLeft:function(){if(!instance.disableTouchSwipe)instance.slideRun(-1)},swipeRight:function(){if(!instance.disableTouchSwipe)instance.slideRun(-2)}});$(".html5gallery-fullscreen-close-"+this.id,this.$fullscreen).click(function(){instance.goNormal()});
$(".html5gallery-fullscreen-next-"+this.id,this.$fullscreen).click(function(){instance.slideRun(-1)});$(".html5gallery-fullscreen-prev-"+this.id,this.$fullscreen).click(function(){instance.slideRun(-2)});$(".html5gallery-fullscreen-play-"+this.id,this.$fullscreen).click(function(){$(".html5gallery-fullscreen-play-"+instance.id,instance.$fullscreen).hide();$(".html5gallery-fullscreen-pause-"+instance.id,instance.$fullscreen).show();instance.isPaused=false;instance.slideshowTimeout=setTimeout(function(){instance.slideRun(-1)},
instance.options.slideshowinterval);$(".html5gallery-fullscreen-timer-"+instance.id,instance.$fullscreen).css({width:0});instance.slideTimerCount=0;if(instance.options.showtimer)instance.slideTimer=setInterval(function(){instance.showSlideTimer()},50)});$(".html5gallery-fullscreen-pause-"+this.id,this.$fullscreen).click(function(){$(".html5gallery-fullscreen-play-"+instance.id,instance.$fullscreen).show();$(".html5gallery-fullscreen-pause-"+instance.id,instance.$fullscreen).hide();instance.isPaused=
true;clearTimeout(instance.slideshowTimeout);$(".html5gallery-fullscreen-timer-"+instance.id,instance.$fullscreen).css({width:0});clearInterval(instance.slideTimer);instance.slideTimerCount=0});$(document).bind("keyup.html5gallery",function(e){if(e.keyCode==27)instance.goNormal();else if(e.keyCode==39)instance.slideRun(-1);else if(e.keyCode==37)instance.slideRun(-2)})},calcIndex:function(index){this.savedElem=this.curElem;if(index==-2){this.nextElem=this.curElem;this.curElem=this.prevElem;this.prevElem=
this.curElem-1<0?this.elemArray.length-1:this.curElem-1}else if(index==-1){this.prevElem=this.curElem;this.curElem=this.nextElem;this.nextElem=this.curElem+1>=this.elemArray.length?0:this.curElem+1}else if(index>=0){this.curElem=index;this.prevElem=this.curElem-1<0?this.elemArray.length-1:this.curElem-1;this.nextElem=this.curElem+1>=this.elemArray.length?0:this.curElem+1}},showSlideTimer:function(){this.slideTimerCount++;if(this.isFullscreen)$(".html5gallery-fullscreen-timer-"+this.id,this.$fullscreen).width(Math.round($(".html5gallery-fullscreen-elem-"+
this.id,this.$fullscreen).width()*50*(this.slideTimerCount+1)/this.options.slideshowinterval));else $(".html5gallery-timer-"+this.id,this.$gallery).width(Math.round(this.options.boxWidth*50*(this.slideTimerCount+1)/this.options.slideshowinterval))},setHd:function(isHd,switching){var type=this.elemArray[this.curElem][ELEM_TYPE];var toSwitch=this.isHd!=isHd&&switching&&(type==TYPE_VIDEO_FLASH||type==TYPE_VIDEO_MP4||type==TYPE_VIDEO_OGG||type==TYPE_VIDEO_WEBM);this.isHd=isHd;if(toSwitch)this.slideRun(this.curElem,
false,false,true)},enableUpdateCarousel:function(){this.disableupdatecarousel=false},slideRun:function(index,navClicked,thumbClicked,videoSwitching){clearTimeout(this.slideshowTimeout);if(this.isFullscreen)$(".html5gallery-fullscreen-timer-"+this.id,this.$fullscreen).css({width:0});else $(".html5gallery-timer-"+this.id,this.$gallery).css({width:0});clearInterval(this.slideTimer);this.slideTimerCount=0;if(this.options.showcarousel&&this.curElem>=0)$("#html5gallery-tn-"+this.id+"-"+this.curElem,this.$gallery).removeClass("html5gallery-tn-selected-"+
this.id).addClass("html5gallery-tn-"+this.id);this.calcIndex(index);if(this.options.socialurlforeach)this.createSocialMedia();if(!this.isFullscreen&&this.options.showcarousel){$("#html5gallery-tn-"+this.id+"-"+this.curElem,this.$gallery).removeClass("html5gallery-tn-"+this.id).addClass("html5gallery-tn-selected-"+this.id);if(!this.options.notupdatecarousel&&!this.disableupdatecarousel)this.carouselHighlight(this.curElem)}if(this.options.showtitle){var title=this.elemArray[this.curElem][ELEM_TITLE];
var description=this.elemArray[this.curElem][ELEM_INFORMATION];if(this.options.shownumbering)title=this.options.numberingformat.replace("%NUM",this.curElem+1).replace("%TOTAL",this.elemArray.length)+" "+title;if(this.isFullscreen)$(".html5gallery-fullscreen-title-"+this.id,this.$fullscreen).html(title);else{var titleHtml="<div class='html5gallery-title-text-"+this.id+"'>"+title+"</div>";if(this.options.showdescription&&description)titleHtml+="<div class='html5gallery-description-text-"+this.id+"'>"+
description+"</div>";$(".html5gallery-title-"+this.id,this.$gallery).html(titleHtml)}}var type=this.elemArray[this.curElem][ELEM_TYPE];if(type<0)return;if(!this.isFullscreen&&navClicked)if(this.options.showimagetoolbox=="always"){if(this.options.imagetoolboxmode=="mouseover"||this.options.imagetoolboxmode=="show")this.showimagetoolbox(type)}else{if(this.options.showimagetoolbox=="image"&&type!=TYPE_IMAGE)this.hideimagetoolbox()}else if(this.options.imagetoolboxmode=="show")this.showimagetoolbox(type);
else this.hideimagetoolbox();this.onChange();var $elem=$(".html5gallery-elem-"+this.id,parent);$elem.find("iframe").each(function(){$(this).attr("src","")});$elem.find("video").each(function(){$(this).attr("src","")});this.disableTouchSwipe=false;var playVideo=this.options.autoplayvideo||this.options.playvideoonclick&&thumbClicked||videoSwitching;var parent=this.isFullscreen?this.$fullscreen:this.$gallery;this.showingPoster=false;if((type==TYPE_VIDEO_FLASH||type==TYPE_VIDEO_MP4||type==TYPE_VIDEO_OGG||
type==TYPE_VIDEO_WEBM||type==TYPE_VIDEO_YOUTUBE||type==TYPE_VIDEO_VIMEO)&&!playVideo&&this.elemArray[this.curElem][ELEM_POSTER]){this.showingPoster=true;this.showPoster()}else{if($(".html5gallery-video-play-"+this.id,parent).length)$(".html5gallery-video-play-"+this.id,parent).remove();if(type==TYPE_IMAGE)this.showImage();else if(type==TYPE_VIDEO_FLASH||type==TYPE_VIDEO_MP4||type==TYPE_VIDEO_OGG||type==TYPE_VIDEO_WEBM)this.showVideo(playVideo,videoSwitching);else if(type==TYPE_VIDEO_YOUTUBE)this.showYoutube(playVideo);
else if(type==TYPE_VIDEO_VIMEO)this.showVimeo(playVideo);else if(type==TYPE_SWF)this.showSWF()}if(this.prevElem in this.elemArray&&this.elemArray[this.prevElem][ELEM_TYPE]==1)(new Image).src=this.elemArray[this.prevElem][ELEM_SRC];if(this.nextElem in this.elemArray&&this.elemArray[this.nextElem][ELEM_TYPE]==1)(new Image).src=this.elemArray[this.nextElem][ELEM_SRC];if(this.prevElem in this.elemArray&&!this.options.autoplayvideo&&this.elemArray[this.prevElem][ELEM_POSTER])(new Image).src=this.elemArray[this.prevElem][ELEM_POSTER];
if(this.nextElem in this.elemArray&&!this.options.autoplayvideo&&this.elemArray[this.nextElem][ELEM_POSTER])(new Image).src=this.elemArray[this.nextElem][ELEM_POSTER];if(this.curElem==this.elemArray.length-1)this.looptimes++;var instance=this;if((type==TYPE_IMAGE||this.showingPoster)&&!this.isPaused&&this.elemArray.length>1&&(!this.options.loop||this.looptimes<this.options.loop)){this.slideshowTimeout=setTimeout(function(){instance.slideRun(-1)},this.options.slideshowinterval);if(this.isFullscreen)$(".html5gallery-fullscreen-timer-"+
this.id,this.$fullscreen).css({width:0});else $(".html5gallery-timer-"+this.id,this.$gallery).css({width:0});this.slideTimerCount=0;if(this.options.showtimer)this.slideTimer=setInterval(function(){instance.showSlideTimer()},50)}if(this.options.loop&&this.looptimes>=this.options.loop){this.looptimes=0;this.pauseGallery()}if(this.elemArray[this.curElem][ELEM_LINK]){$elem.css({cursor:"pointer"});$elem.unbind("click").bind("click",function(){if(instance.elemArray[instance.curElem][ELEM_LINKTARGET])window.open(instance.elemArray[instance.curElem][ELEM_LINK],
instance.elemArray[instance.curElem][ELEM_LINKTARGET]);else window.open(instance.elemArray[instance.curElem][ELEM_LINK])})}else{$elem.css({cursor:""});$elem.unbind("click")}},showImage:function(){var parent=this.isFullscreen?this.$fullscreen:this.$gallery;var $elem=$(".html5gallery-elem-"+this.id,parent);if($elem.html()==="")$preloading=$("<div class='html5gallery-loading-center-"+this.id+"'></div>").appendTo($elem);else $preloading=$("<div class='html5gallery-loading-"+this.id+"'></div>").appendTo($elem);
var instance=this;var imgLoader=new Image;$(imgLoader).load(function(){$preloading.remove();instance.elemArray[instance.curElem][ELEM_WIDTH]=this.width;instance.elemArray[instance.curElem][ELEM_HEIGHT]=this.height;var scale;if(instance.isFullscreen){scale=Math.min(instance.fullscreenWidth/this.width,instance.fullscreenHeight/this.height);scale=scale>1?1:scale}else if(instance.options.resizemode=="fill")scale=Math.max(instance.options.width/this.width,instance.options.height/this.height);else scale=
Math.min(instance.options.width/this.width,instance.options.height/this.height);var w=Math.round(scale*this.width);var h=Math.round(scale*this.height);var w1=instance.isFullscreen?w:instance.options.width;var h1=instance.isFullscreen?h:instance.options.height;var l=Math.round(w1/2-w/2);var t=Math.round(h1/2-h/2);if(instance.isFullscreen)instance.adjustFullscreen(w1,h1);$elem.css({"width":w1,"height":h1});var $imgCur=$("<div class='html5gallery-elem-img-"+instance.id+"' style='display:block; position:absolute; overflow:hidden; width:"+
w1+"px; height:"+h1+"px; left:0px; margin-left:"+(instance.options.slideshadow&&!instance.isFullscreen?4:0)+"px; top:0px; margin-top:"+(instance.options.slideshadow&&!instance.isFullscreen?4:0)+"px;'><img class='html5gallery-elem-image-"+instance.id+"' style='border:none; position:absolute; opacity:inherit; filter:inherit; padding:0px; margin:0px; left:"+l+"px; top:"+t+"px; max-width:none; max-height:none; width:"+w+"px; height:"+h+"px;' src='"+instance.elemArray[instance.curElem][ELEM_SRC]+"' />"+
instance.options.watermarkcode+"</div>");var $imgPrev=$(".html5gallery-elem-img-"+instance.id,$elem);if($imgPrev.length){$elem.prepend($imgCur);$elem.html5boxTransition(instance.id,$imgPrev,$imgCur,{effect:instance.options.effect,easing:instance.options.easing,duration:instance.options.duration,direction:instance.curElem>=instance.savedElem,slide:instance.options.slide},function(){})}else $elem.html($imgCur);if(instance.options.googleanalyticsaccount)window._gaq.push(["_trackEvent","Image","Play",
instance.elemArray[instance.curElem][ELEM_TITLE]])});$(imgLoader).error(function(){$preloading.remove();if(instance.isFullscreen)instance.adjustFullscreen(instance.options.width,instance.options.height);$elem.html("<div class='html5gallery-elem-error-"+instance.id+"' style='display:block; position:absolute; overflow:hidden; text-align:center; width:"+instance.options.width+"px; left:0px; top:"+Math.round(instance.options.height/2-10)+"px; margin:4px;'><div class='html5gallery-error-"+instance.id+
"'>The requested content cannot be found</div>");if(instance.options.googleanalyticsaccount)window._gaq.push(["_trackEvent","Image","Error",instance.elemArray[instance.curElem][ELEM_TITLE]])});imgLoader.src=this.elemArray[this.curElem][ELEM_SRC]},adjustFullscreen:function(w1,h1,noanimation){var fullW=this.options.isMobile?Math.max($(window).width(),$(document).width()):$(window).width();this.fullscreenWidth=fullW-2*this.fullscreenMargin-2*this.fullscreenOutsideMargin;var winH=window.innerHeight?window.innerHeight:
$(window).height();this.fullscreenHeight=winH-2*this.fullscreenMargin-this.fullscreenBarH-2*this.fullscreenOutsideMargin;var fullH=Math.max(winH,$(document).height());var scale=Math.min(this.fullscreenWidth/w1,this.fullscreenHeight/h1);if(scale<1)w1*=scale,h1*=scale;var marginT=$(window).scrollTop()+Math.round((winH-(h1+2*this.fullscreenMargin+this.fullscreenBarH))/2);$(".html5gallery-fullscreen-"+this.id).css({width:fullW+"px",height:fullH+"px"});$(".html5gallery-fullscreen-title-"+this.id,this.$fullscreen).css({"width":w1-
72});if(noanimation){$(".html5gallery-fullscreen-box-"+this.id,this.$fullscreen).css({"width":w1+2*this.fullscreenMargin,"height":h1+2*this.fullscreenMargin+this.fullscreenBarH,"top":marginT});$(".html5gallery-fullscreen-elem-"+this.id,this.$fullscreen).css({"width":w1,"height":h1});$(".html5gallery-fullscreen-bar-"+this.id,this.$fullscreen).css({"width":w1,"top":h1+this.fullscreenMargin})}else{$(".html5gallery-fullscreen-box-"+this.id,this.$fullscreen).animate({"width":w1+2*this.fullscreenMargin,
"height":h1+2*this.fullscreenMargin+this.fullscreenBarH,"top":marginT},"slow");$(".html5gallery-fullscreen-elem-"+this.id,this.$fullscreen).animate({"width":w1,"height":h1},"slow");$(".html5gallery-fullscreen-bar-"+this.id,this.$fullscreen).animate({"width":w1,"top":h1+this.fullscreenMargin},"slow")}$(".html5gallery-fullscreen-next-"+this.id,this.$fullscreen).css({"top":Math.round(h1/2)});$(".html5gallery-fullscreen-prev-"+this.id,this.$fullscreen).css({"top":Math.round(h1/2)});$(".html5gallery-fullscreen-play-"+
this.id,this.$fullscreen).css("display",this.isPaused&&this.elemArray.length>1&&this.elemArray[this.curElem][ELEM_TYPE]==1?"block":"none");$(".html5gallery-fullscreen-pause-"+this.id,this.$fullscreen).css("display",this.isPaused||this.elemArray.length<=1||this.elemArray[this.curElem][ELEM_TYPE]!=1?"none":"block");$(".html5gallery-elem-"+this.id,this.$fullscreen).css({"width":w1,"height":h1});$(".html5gallery-fullscreen-timer-"+this.id,this.$fullscreen).css({top:String(h1-4)+"px"})},showPoster:function(){var parent=
this.isFullscreen?this.$fullscreen:this.$gallery;var $elem=$(".html5gallery-elem-"+this.id,parent);if($elem.html()==="")$preloading=$("<div class='html5gallery-loading-center-"+this.id+"'></div>").appendTo($elem);else $preloading=$("<div class='html5gallery-loading-"+this.id+"'></div>").appendTo($elem);var instance=this;var dataW=this.elemArray[this.curElem][ELEM_WIDTH];var dataH=this.elemArray[this.curElem][ELEM_HEIGHT];var imgLoader=new Image;$(imgLoader).load(function(){$preloading.remove();var scale,
w1,h1;if(instance.isFullscreen){scale=Math.max(dataW/this.width,dataH/this.height);scale=scale>1?1:scale;w1=dataW;h1=dataH}else{if(instance.options.resizemode=="fill")scale=Math.max(instance.options.width/this.width,instance.options.height/this.height);else scale=Math.min(instance.options.width/this.width,instance.options.height/this.height);w1=instance.options.width;h1=instance.options.height}var w=Math.round(scale*this.width);var h=Math.round(scale*this.height);var l=Math.round(w1/2-w/2);var t=
Math.round(h1/2-h/2);if(instance.isFullscreen)instance.adjustFullscreen(w1,h1);$elem.css({"width":w1,"height":h1});var $imgCur=$("<div class='html5gallery-elem-img-"+instance.id+"' style='display:block; position:absolute; overflow:hidden; width:"+w1+"px; height:"+h1+"px; left:0px; margin-left:"+(instance.options.slideshadow&&!instance.isFullscreen?4:0)+"px; top:0px; margin-top:"+(instance.options.slideshadow&&!instance.isFullscreen?4:0)+"px;'><img class='html5gallery-elem-image-"+instance.id+"' style='border:none; position:absolute; opacity:inherit; filter:inherit; padding:0px; margin:0px; left:"+
l+"px; top:"+t+"px; max-width:none; max-height:none; width:"+w+"px; height:"+h+"px;' src='"+instance.elemArray[instance.curElem][ELEM_POSTER]+"' />"+instance.options.watermarkcode+"</div>");var $imgPrev=$(".html5gallery-elem-img-"+instance.id,$elem);if($imgPrev.length){$elem.prepend($imgCur);$elem.html5boxTransition(instance.id,$imgPrev,$imgCur,{effect:instance.options.effect,easing:instance.options.easing,duration:instance.options.duration,direction:instance.curElem>=instance.savedElem,slide:instance.options.slide},
function(){})}else $elem.html($imgCur);if(!$(".html5gallery-video-play-"+instance.id,parent).length){var $play=$("<div class='html5gallery-video-play-"+instance.id+"' style='position:absolute;display:block;cursor:pointer;top:50%;left:50%;width:64px;height:64px;margin-left:-32px;margin-top:-32px;background:url(\""+instance.options.skinfolder+"playvideo_64.png\") no-repeat center center;'></div>").appendTo($elem);$play.unbind(instance.eClick).bind(instance.eClick,function(){$(this).remove();clearTimeout(instance.slideshowTimeout);
$(".html5gallery-timer-"+instance.id,instance.$gallery).css({width:0});clearInterval(instance.slideTimer);instance.slideTimerCount=0;var type=instance.elemArray[instance.curElem][ELEM_TYPE];if(type==TYPE_VIDEO_FLASH||type==TYPE_VIDEO_MP4||type==TYPE_VIDEO_OGG||type==TYPE_VIDEO_WEBM)instance.showVideo(true);else if(type==TYPE_VIDEO_YOUTUBE)instance.showYoutube(true);else if(type==TYPE_VIDEO_VIMEO)instance.showVimeo(true)})}});$(imgLoader).error(function(){$preloading.remove();if(instance.isFullscreen)instance.adjustFullscreen(instance.options.width,
instance.options.height);$elem.html("<div class='html5gallery-elem-error-"+instance.id+"' style='display:block; position:absolute; overflow:hidden; text-align:center; width:"+instance.options.width+"px; left:0px; top:"+Math.round(instance.options.height/2-10)+"px; margin:4px;'><div class='html5gallery-error-"+instance.id+"'>The requested content cannot be found</div>");if(instance.options.googleanalyticsaccount)window._gaq.push(["_trackEvent","Image","Error",instance.elemArray[instance.curElem][ELEM_TITLE]])});
imgLoader.src=this.elemArray[this.curElem][ELEM_POSTER]},showVideo:function(autoPlay,videoSwitching){this.disableTouchSwipe=true;var parent=this.isFullscreen?this.$fullscreen:this.$gallery;var dataW=this.elemArray[this.curElem][ELEM_WIDTH];var dataH=this.elemArray[this.curElem][ELEM_HEIGHT];var w1,h1;if(this.isFullscreen){this.adjustFullscreen(dataW,dataH);w1=dataW;h1=dataH}else{$(".html5gallery-elem-"+this.id,this.$gallery).css({"width":this.options.width,"height":this.options.height});w1=this.options.width;
h1=this.options.height}var timeStamp=-1;if(videoSwitching&&$(".html5gallery-elem-"+this.id,parent).find("video").length)timeStamp=$(".html5gallery-elem-"+this.id,parent).find("video:first").get(0).currentTime;$(".html5gallery-elem-"+this.id,parent).html("<div class='html5gallery-loading-center-"+this.id+"'></div><div class='html5gallery-elem-video-"+this.id+"' style='display:block;position:absolute;overflow:hidden;top:"+(this.options.slideshadow&&!this.isFullscreen?4:0)+"px;left:"+(this.options.slideshadow&&
!this.isFullscreen?4:0)+"px;width:"+w1+"px;height:"+h1+"px;'></div>"+this.options.watermarkcode);this.isHTML5=false;if(this.options.isIE678||this.options.isIE9&&this.options.useflashonie9||this.options.isIE10&&this.options.useflashonie10||this.options.isIE11&&this.options.useflashonie11)this.isHTML5=false;else if(this.options.isMobile)this.isHTML5=true;else if((this.options.html5player||!this.options.flashInstalled)&&this.options.html5VideoSupported)if(!this.options.isFirefox&&!this.options.isOpera||
(this.options.isFirefox||this.options.isOpera)&&(this.elemArray[this.curElem][ELEM_SRC_OGG]||this.elemArray[this.curElem][ELEM_SRC_WEBM]))this.isHTML5=true;if(this.isHTML5){var videoSrc=this.elemArray[this.curElem][ELEM_SRC];var videoHd=this.elemArray[this.curElem][ELEM_HD];if(this.options.isFirefox||this.options.isOpera||!videoSrc){videoSrc=this.elemArray[this.curElem][ELEM_SRC_WEBM]?this.elemArray[this.curElem][ELEM_SRC_WEBM]:this.elemArray[this.curElem][ELEM_SRC_OGG];videoHd=this.elemArray[this.curElem][ELEM_HD_WEBM]?
this.elemArray[this.curElem][ELEM_HD_WEBM]:this.elemArray[this.curElem][ELEM_HD_OGG]}this.embedHTML5Video($(".html5gallery-elem-video-"+this.id,parent),w1,h1,videoSrc,videoHd,autoPlay,timeStamp,videoSwitching)}else{var videoFile=this.elemArray[this.curElem][ELEM_SRC];if(videoFile.charAt(0)!="/"&&videoFile.substring(0,5)!="http:"&&videoFile.substring(0,6)!="https:")videoFile=this.options.htmlfolder+videoFile;var hdFile="";if(this.elemArray[this.curElem][ELEM_HD]){hdFile=this.elemArray[this.curElem][ELEM_HD];
if(hdFile.charAt(0)!="/"&&hdFile.substring(0,5)!="http:"&&hdFile.substring(0,6)!="https:")hdFile=this.options.htmlfolder+hdFile}this.embedFlash($(".html5gallery-elem-video-"+this.id,parent),"100%","100%",this.options.jsfolder+"html5boxplayer.swf","transparent",{width:w1,height:h1,videofile:videoFile,hdfile:hdFile,ishd:this.isHd?"1":"0",autoplay:autoPlay?"1":"0",errorcss:".html5box-error"+this.options.errorcss,id:this.id})}if(this.options.googleanalyticsaccount)window._gaq.push(["_trackEvent","Video",
"Play",this.elemArray[this.curElem][ELEM_TITLE]])},showSWF:function(){var parent=this.isFullscreen?this.$fullscreen:this.$gallery;var w1=this.elemArray[this.curElem][ELEM_WIDTH];var h1=this.elemArray[this.curElem][ELEM_HEIGHT];if(this.isFullscreen)this.adjustFullscreen(w1,h1);else $(".html5gallery-elem-"+this.id,this.$gallery).css({"width":this.options.width,"height":this.options.height});var t1=this.isFullscreen?0:Math.round((this.options.height-h1)/2)+(this.options.slideshadow?4:0);var l1=this.isFullscreen?
0:Math.round((this.options.width-w1)/2)+(this.options.slideshadow?4:0);$(".html5gallery-elem-"+this.id,parent).html("<div class='html5gallery-elem-flash-"+this.id+"' style='display:block;position:absolute;overflow:hidden;top:"+t1+"px;left:"+l1+"px;width:"+w1+"px;height:"+h1+"px;'></div>"+this.options.watermarkcode);this.embedFlash($(".html5gallery-elem-flash-"+this.id,parent),w1,h1,this.elemArray[this.curElem][ELEM_SRC],"window",{});if(this.options.googleanalyticsaccount)window._gaq.push(["_trackEvent",
"Flash","Play",this.elemArray[this.curElem][ELEM_TITLE]])},prepareYoutubeHref:function(href){var youtubeId=href.match(/(\?v=|\/\d\/|\/embed\/|\/v\/|\.be\/)([a-zA-Z0-9\-\_]+)/)[2];var result="http://www.youtube.com/embed/"+youtubeId;var params=this.getYoutubeParams(href);var first=true;for(var key in params){if(first){result+="?";first=false}else result+="&";result+=key+"="+params[key]}return result},getYoutubeParams:function(href){var result={};if(href.indexOf("?")<0)return result;var params=href.substring(href.indexOf("?")+
1).split("&");for(var i=0;i<params.length;i++){var value=params[i].split("=");if(value&&value.length==2&&value[0].toLowerCase()!="v")result[value[0].toLowerCase()]=value[1]}return result},initYoutubeApi:function(){var i,initYoutube=false;for(i=0;i<this.elemArray.length;i++)if(this.elemArray[i][ELEM_TYPE]==TYPE_VIDEO_YOUTUBE){initYoutube=true;break}if(initYoutube){var tag=document.createElement("script");tag.src=("https:"==document.location.protocol?"https":"http")+"://www.youtube.com/iframe_api";
var firstScriptTag=document.getElementsByTagName("script")[0];firstScriptTag.parentNode.insertBefore(tag,firstScriptTag)}},showYoutube:function(autoPlay){var parent=this.isFullscreen?this.$fullscreen:this.$gallery;var dataW=this.elemArray[this.curElem][ELEM_WIDTH];var dataH=this.elemArray[this.curElem][ELEM_HEIGHT];var w1,h1;if(this.isFullscreen){this.adjustFullscreen(dataW,dataH);w1=dataW;h1=dataH}else{$(".html5gallery-elem-"+this.id,this.$gallery).css({"width":this.options.width,"height":this.options.height});
w1=this.options.width;h1=this.options.height}var src=this.elemArray[this.curElem][ELEM_SRC];$(".html5gallery-elem-"+this.id,parent).html("<div class='html5gallery-loading-center-"+this.id+"'></div><div id='html5gallery-elem-video-"+this.id+"' style='display:block;position:absolute;overflow:hidden;top:"+(this.options.slideshadow&&!this.isFullscreen?4:0)+"px;left:"+(this.options.slideshadow&&!this.isFullscreen?4:0)+"px;width:"+w1+"px;height:"+h1+"px;'></div>"+this.options.watermarkcode);var instance=
this;if(!ASYouTubeIframeAPIReady){ASYouTubeTimeout+=100;if(ASYouTubeTimeout<3E3){setTimeout(function(){instance.showYoutube(autoPlay)},100);return}}if(ASYouTubeIframeAPIReady&&!this.options.isMobile&&!this.options.isIE6&&!this.options.isIE7){var id=this.elemArray[this.curElem][ELEM_SRC].match(/(\?v=|\/\d\/|\/embed\/|\/v\/|\.be\/)([a-zA-Z0-9\-\_]+)/)[2];var onPlayReady=null;if(autoPlay)onPlayReady=function(event){event.target.playVideo()};var youtubeParams=this.getYoutubeParams(this.elemArray[this.curElem][ELEM_SRC]);
youtubeParams=$.extend({"autoplay":autoPlay?1:0,"rel":0,"wmode":"transparent"},youtubeParams);new YT.Player("html5gallery-elem-video-"+this.id,{width:w1,height:h1,videoId:id,playerVars:youtubeParams,events:{"onReady":onPlayReady,"onStateChange":function(event){if(event.data==YT.PlayerState.ENDED){instance.onVideoEnd();if(!instance.isPaused)instance.slideRun(-1)}}}})}else{src=this.prepareYoutubeHref(src);if(autoPlay)if(src.indexOf("?")<0)src+="?autoplay=1";else src+="&autoplay=1";if(src.indexOf("?")<
0)src+="?wmode=transparent&rel=0";else src+="&wmode=transparent&rel=0";$("#html5gallery-elem-video-"+this.id,parent).html("<iframe width='"+w1+"' height='"+h1+"' src='"+src+"' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>")}if(this.options.googleanalyticsaccount)window._gaq.push(["_trackEvent","Video","Play",this.elemArray[this.curElem][ELEM_TITLE]])},showVimeo:function(autoPlay){var parent=this.isFullscreen?this.$fullscreen:this.$gallery;var dataW=this.elemArray[this.curElem][ELEM_WIDTH];
var dataH=this.elemArray[this.curElem][ELEM_HEIGHT];var w1,h1;if(this.isFullscreen){this.adjustFullscreen(dataW,dataH);w1=dataW;h1=dataH}else{$(".html5gallery-elem-"+this.id,this.$gallery).css({"width":this.options.width,"height":this.options.height});w1=this.options.width;h1=this.options.height}var src=this.elemArray[this.curElem][ELEM_SRC];if(autoPlay)if(src.indexOf("?")<0)src+="?autoplay=1";else src+="&autoplay=1";$(".html5gallery-elem-"+this.id,parent).html("<div class='html5gallery-loading-center-"+
this.id+"'></div><div class='html5gallery-elem-video-"+this.id+"' style='display:block;position:absolute;overflow:hidden;top:"+(this.options.slideshadow&&!this.isFullscreen?4:0)+"px;left:"+(this.options.slideshadow&&!this.isFullscreen?4:0)+"px;width:"+w1+"px;height:"+h1+"px;'></div>"+this.options.watermarkcode);$(".html5gallery-elem-video-"+this.id,parent).html("<iframe width='"+w1+"' height='"+h1+"' src='"+src+"' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>");
if(this.options.googleanalyticsaccount)window._gaq.push(["_trackEvent","Video","Play",this.elemArray[this.curElem][ELEM_TITLE]])},checkType:function(href){if(!href)return-1;if(href.match(/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i))return TYPE_IMAGE;if(href.match(/[^\.]\.(swf)\s*$/i))return TYPE_SWF;if(href.match(/[^\.]\.(mp3)\s*$/i))return TYPE_MP3;if(href.match(/[^\.]\.(pdf)\s*$/i))return TYPE_PDF;if(href.match(/\.(flv)(.*)?$/i))return TYPE_VIDEO_FLASH;if(href.match(/\.(mp4|m4v)(.*)?$/i))return TYPE_VIDEO_MP4;
if(href.match(/\.(ogv|ogg)(.*)?$/i))return TYPE_VIDEO_OGG;if(href.match(/\.(webm)(.*)?$/i))return TYPE_VIDEO_WEBM;if(href.match(/\:\/\/.*(youtube\.com)/i)||href.match(/\:\/\/.*(youtu\.be)/i))return TYPE_VIDEO_YOUTUBE;if(href.match(/\:\/\/.*(vimeo\.com)/i))return TYPE_VIDEO_VIMEO;return 0},onChange:function(){if(this.options.onchange&&window[this.options.onchange]&&typeof window[this.options.onchange]=="function")window[this.options.onchange](this.elemArray[this.curElem])},onSlideshowOver:function(){if(this.options.onslideshowover&&
window[this.options.onslideshowover]&&typeof window[this.options.onslideshowover]=="function")window[this.options.onslideshowover](this.elemArray[this.curElem])},onThumbOver:function(){if(this.options.onthumbover&&window[this.options.onthumbover]&&typeof window[this.options.onthumbover]=="function")window[this.options.onthumbover](this.elemArray[this.curElem])},onVideoEnd:function(){if(this.options.onvideoend&&window[this.options.onvideoend]&&typeof window[this.options.onvideoend]=="function")window[this.options.onvideoend](this.elemArray[this.curElem])},
embedHTML5Video:function($container,w,h,src,hd,autoPlay,timeStamp,videoSwitching){$container.html("<div class='html5gallery-elem-video-container-"+this.id+"' style='position:relative;display:block;width:"+w+"px;height:"+h+"px;'><video width='"+w+"px' height='"+h+"px'"+(this.options.nativehtml5controls?" controls":"")+"></div>");$("video",$container).get(0).setAttribute("src",(hd&&this.isHd?hd:src)+(timeStamp>0?"#t="+timeStamp:""));if(!this.options.nativehtml5controls){$("video",$container).data("src",
src);$("video",$container).data("hd",hd);$("video",$container).data("ishd",this.isHd);$("video",$container).addHTML5VideoControls(this.options.skinfolder,this)}if(autoPlay||videoSwitching)$("video",$container).get(0).play();var instance=this;$("video",$container).unbind("ended").bind("ended",function(){instance.onVideoEnd();if(!instance.isPaused)instance.slideRun(-1)})},embedFlash:function($container,w,h,src,wmode,flashVars){if(this.options.flashInstalled){var htmlOptions={pluginspage:"http://www.adobe.com/go/getflashplayer",
quality:"high",allowFullScreen:"true",allowScriptAccess:"always",type:"application/x-shockwave-flash"};htmlOptions.width=w;htmlOptions.height=h;htmlOptions.src=src;htmlOptions.wmode=wmode;htmlOptions.flashVars=$.param(flashVars);var htmlString="";for(var key in htmlOptions)htmlString+=key+"="+htmlOptions[key]+" ";$container.html("<embed "+htmlString+"/>")}else $container.html("<div class='html5gallery-elem-error-"+this.id+"' style='display:block; position:absolute; text-align:center; width:"+this.options.width+
"px; left:0px; top:"+Math.round(this.options.height/2-10)+"px;'><div class='html5gallery-error-"+this.id+"'><div>The required Adobe Flash Player plugin is not installed</div><div style='display:block;position:relative;text-align:center;width:112px;height:33px;margin:0px auto;'><a href='http://www.adobe.com/go/getflashplayer'><img src='http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' width='112' height='33'></img></a></div></div>")}};this.each(function(){var $this=
$(this);options=options||{};for(var key in options)if(key.toLowerCase()!==key){options[key.toLowerCase()]=options[key];delete options[key]}this.options=$.extend({},options);var instance=this;$.each($this.data(),function(key,value){instance.options[key.toLowerCase()]=value});if("skin"in this.options)this.options.skin=this.options.skin.toLowerCase();var commonOptions={freelink:"http://www.wonderplugin.com/wordpress-gallery/",watermark:"",watermarklink:"",skin:"horizontal",googlefonts:"Armata",enabletouchswipe:true,
enabletouchswipeonandroid:true,responsive:false,responsivefullscreen:false,screenquery:{},src:"",xml:"",xmlnocache:true,autoslide:false,slideshowinterval:6E3,random:false,borderradius:0,loop:0,notupdatecarousel:false,updatecarouselinterval:6E4,autoplayvideo:false,html5player:true,playvideoonclick:true,nativehtml5controls:false,hddefault:false,useflashonie9:true,useflashonie10:false,useflashonie11:false,lightboxborder:8,lightboxtextheight:54,lightboxmargin:8,lightboxbgcolor:"#fff",effect:"fade",easing:"easeOutCubic",
duration:1500,slide:{duration:1E3,easing:"easeOutExpo"},width:480,height:270,showtimer:true,resizemode:"fit",showtitle:true,titleheight:45,errorcss:" {text-align:center; color:#ff0000; font-size:14px; font-family:Arial, sans-serif;}",titlefullscreencss:" {color:#333333; font-size:16px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; line-height:24px;}",titlefullscreencsslink:" a {color:#333333;}",shownumbering:false,numberingformat:"%NUM / %TOTAL",googleanalyticsaccount:"",
showsocialmedia:false,socialheight:30,socialurlforeach:false,showfacebooklike:true,facebooklikeurl:"",showtwitter:true,twitterurl:"",twitterusername:"",twittervia:"html5box",showgoogleplus:true,googleplusurl:"",showimagetoolbox:"always",imagetoolboxstyle:"side",imagetoolboxmode:"mouseover",showplaybutton:true,showprevbutton:true,shownextbutton:true,showfullscreenbutton:true,carouselbgtransparent:true,carouselbgcolorstart:"#ffffff",carouselbgcolorend:"#ffffff",carouseltopborder:"#ffffff",carouselbottomborder:"#ffffff",
carouselbgimage:"",carouseleasing:"easeOutCirc",carouselmultirows:false,thumbrowgap:16,version:"3.6",fv:true,fm:"wmoangdiecrpluginh.iclolms"};var horizontalSkinOptions={skinfolder:"skins/horizontal/",padding:6,bgcolor:"#ffffff",bgimage:"",galleryshadow:true,slideshadow:false,showsocialmedia:false,headerpos:"top",showdescription:true,titleoverlay:true,titleautohide:true,titlecss:" {color:#ffffff; font-size:14px; font-family:Armata, sans-serif, Arial; overflow:hidden; text-align:left; padding:10px 0px 10px 10px; background:rgb(102, 102, 102) transparent; background: rgba(102, 102, 102, 0.6); filter:'progid:DXImageTransform.Microsoft.gradient(startColorstr=#99666666, endColorstr=#99666666)'; -ms-filter:'progid:DXImageTransform.Microsoft.gradient(startColorstr=#99666666, endColorstr=#99666666)'; }",
titlecsslink:" a {color:#ffffff;}",descriptioncss:" {color:#ffffff; font-size:13px; font-family:Armata, sans-serif, Arial; overflow:hidden; text-align:left; padding:0px 0px 10px 10px; background:rgb(102, 102, 102) transparent; background: rgba(102, 102, 102, 0.6); filter:'progid:DXImageTransform.Microsoft.gradient(startColorstr=#99666666, endColorstr=#99666666)'; -ms-filter:'progid:DXImageTransform.Microsoft.gradient(startColorstr=#99666666, endColorstr=#99666666)'; }",descriptioncsslink:" a {color:#ffffff;}",
showcarousel:true,carouselmargin:0,carouselbgtransparent:false,carouselbgcolorstart:"#494f54",carouselbgcolorend:"#292c31",carouseltopborder:"#666666",carouselbottomborder:"#111111",thumbwidth:64,thumbheight:48,thumbgap:4,thumbmargin:6,thumbunselectedimagebordercolor:"",thumbimageborder:1,thumbimagebordercolor:"#ffffff",thumbshowplayonvideo:true,thumbshadow:false,thumbopacity:0.8};var lightSkinOptions={padding:12,skinfolder:"skins/light/",bgcolor:"",bgimage:"",galleryshadow:false,slideshadow:true,
showsocialmedia:false,headerpos:"top",showdescription:true,titleoverlay:true,titleautohide:true,titlecss:" {color:#ffffff; font-size:14px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:10px 0px 10px 10px;  background:rgb(102, 102, 102) transparent; background: rgba(102, 102, 102, 0.6); filter:'progid:DXImageTransform.Microsoft.gradient(startColorstr=#99666666, endColorstr=#99666666)'; -ms-filter:'progid:DXImageTransform.Microsoft.gradient(startColorstr=#99666666, endColorstr=#99666666)'; }",
titlecsslink:" a {color:#ffffff;}",descriptioncss:" {color:#ffffff; font-size:12px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:0px 0px 10px 10px;  background:rgb(102, 102, 102) transparent; background: rgba(102, 102, 102, 0.6); filter:'progid:DXImageTransform.Microsoft.gradient(startColorstr=#99666666, endColorstr=#99666666)'; -ms-filter:'progid:DXImageTransform.Microsoft.gradient(startColorstr=#99666666, endColorstr=#99666666)'; }",descriptioncsslink:" a {color:#ffffff;}",
showcarousel:true,carouselmargin:10,carouselbgtransparent:true,thumbwidth:48,thumbheight:48,thumbgap:8,thumbmargin:12,thumbunselectedimagebordercolor:"#fff",thumbimageborder:2,thumbimagebordercolor:"#fff",thumbshowplayonvideo:true,thumbshadow:true,thumbopacity:0.8};var mediapageSkinOptions={padding:0,skinfolder:"skins/mediapage/",bgcolor:"",bgimage:"",galleryshadow:false,slideshadow:false,showsocialmedia:false,headerpos:"top",showdescription:true,titleoverlay:true,titleautohide:true,titlecss:" {color:#ffffff; font-size:14px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:10px 0px 10px 10px;  background:rgb(102, 102, 102) transparent; background: rgba(102, 102, 102, 0.6); filter:'progid:DXImageTransform.Microsoft.gradient(startColorstr=#99666666, endColorstr=#99666666)'; -ms-filter:'progid:DXImageTransform.Microsoft.gradient(startColorstr=#99666666, endColorstr=#99666666)'; }",
titlecsslink:" a {color:#ffffff;}",descriptioncss:" {color:#ffffff; font-size:12px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:0px 0px 10px 10px;  background:rgb(102, 102, 102) transparent; background: rgba(102, 102, 102, 0.6); filter:'progid:DXImageTransform.Microsoft.gradient(startColorstr=#99666666, endColorstr=#99666666)'; -ms-filter:'progid:DXImageTransform.Microsoft.gradient(startColorstr=#99666666, endColorstr=#99666666)'; }",descriptioncsslink:" a {color:#ffffff;}",
showcarousel:true,carouselmargin:24,carouselmultirows:true,thumbrowgap:16,carouselbgtransparent:true,thumbwidth:120,thumbheight:60,thumbgap:10,thumbmargin:12,thumbunselectedimagebordercolor:"#fff",thumbimageborder:0,thumbimagebordercolor:"#fff",thumbshowplayonvideo:true,thumbshadow:false,thumbopacity:0.8,thumbshowtitle:true,thumbtitlecss:"{text-align:center; color:#000; font-size:12px; font-family:Armata,Arial,Helvetica,sans-serif; overflow:hidden;}",thumbtitleheight:24};var gallerySkinOptions={padding:12,
skinfolder:"skins/gallery/",bgcolor:"",bgimage:"",galleryshadow:false,slideshadow:true,showsocialmedia:false,headerpos:"top",showdescription:true,titleoverlay:true,titleautohide:true,titlecss:" {color:#ffffff; font-size:14px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:10px 0px 10px 10px;  background:rgb(102, 102, 102) transparent; background: rgba(102, 102, 102, 0.6); filter:'progid:DXImageTransform.Microsoft.gradient(startColorstr=#99666666, endColorstr=#99666666)'; -ms-filter:'progid:DXImageTransform.Microsoft.gradient(startColorstr=#99666666, endColorstr=#99666666)'; }",
titlecsslink:" a {color:#ffffff;}",descriptioncss:" {color:#ffffff; font-size:12px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:0px 0px 10px 10px;  background:rgb(102, 102, 102) transparent; background: rgba(102, 102, 102, 0.6); filter:'progid:DXImageTransform.Microsoft.gradient(startColorstr=#99666666, endColorstr=#99666666)'; -ms-filter:'progid:DXImageTransform.Microsoft.gradient(startColorstr=#99666666, endColorstr=#99666666)'; }",descriptioncsslink:" a {color:#ffffff;}",
showcarousel:true,carouselmargin:10,carouselbgtransparent:true,thumbwidth:120,thumbheight:60,thumbgap:8,thumbmargin:12,thumbunselectedimagebordercolor:"#fff",thumbimageborder:2,thumbimagebordercolor:"#fff",thumbshowplayonvideo:true,thumbshadow:true,thumbopacity:0.8,thumbshowtitle:true,thumbtitlecss:"{text-align:center; color:#000; font-size:12px; font-family:Armata,Arial,Helvetica,sans-serif; overflow:hidden; white-space:nowrap;}",thumbtitleheight:18};var darknessSkinOptions={skinfolder:"skins/darkness/",
padding:12,bgcolor:"#444444",bgimage:"background.jpg",galleryshadow:false,slideshadow:false,headerpos:"bottom",showdescription:false,titleoverlay:false,titleautohide:false,titlecss:" {color:#ffffff; font-size:16px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:10px 0px;}",titlecsslink:" a {color:#ffffff;}",descriptioncss:" {color:#ffffff; font-size:12px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:0px 0px 10px 0px;}",
descriptioncsslink:" a {color:#ffffff;}",showcarousel:true,carouselmargin:8,carouselbgtransparent:false,carouselbgcolorstart:"#494f54",carouselbgcolorend:"#292c31",carouseltopborder:"#666666",carouselbottomborder:"#111111",thumbwidth:64,thumbheight:48,thumbgap:4,thumbmargin:6,thumbunselectedimagebordercolor:"",thumbimageborder:1,thumbimagebordercolor:"#cccccc",thumbshowplayonvideo:true,thumbshadow:false,thumbopacity:0.8};var verticalSkinOptions={skinfolder:"skins/vertical/",padding:12,bgcolor:"#444444",
bgimage:"background.jpg",galleryshadow:false,slideshadow:false,headerpos:"bottom",showdescription:false,titleoverlay:false,titleautohide:false,titlecss:" {color:#ffffff; font-size:16px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:10px 0px;}",titlecsslink:" a {color:#ffffff;}",descriptioncss:" {color:#ffffff; font-size:12px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:0px 0px 10px 0px;}",
descriptioncsslink:" a {color:#ffffff;}",showcarousel:true,carouselmargin:8,carouselposition:"right",carouselbgtransparent:false,carouselbgcolorstart:"#494f54",carouselbgcolorend:"#292c31",carouseltopborder:"#666666",carouselbottomborder:"#111111",carouselhighlightbgcolorstart:"#999999",carouselhighlightbgcolorend:"#666666",carouselhighlighttopborder:"#cccccc",carouselhighlightbottomborder:"#444444",carouselhighlightbgimage:"",thumbwidth:148,thumbheight:48,thumbgap:2,thumbmargin:6,thumbunselectedimagebordercolor:"",
thumbimageborder:1,thumbimagebordercolor:"#cccccc",thumbshowplayonvideo:true,thumbshadow:false,thumbopacity:0.8,thumbshowimage:true,thumbshowtitle:true,thumbtitlecss:"{text-align:center; color:#ffffff; font-size:12px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:nowrap;}"};var showcaseSkinOptions={skinfolder:"skins/showcase/",padding:12,bgcolor:"#444444",bgimage:"background.jpg",galleryshadow:false,slideshadow:false,showsocialmedia:false,headerpos:"bottom",showdescription:false,
titleoverlay:false,titleautohide:false,titlecss:" {color:#ffffff; font-size:16px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:10px 0px;}",titlecsslink:" a {color:#ffffff;}",descriptioncss:" {color:#ffffff; font-size:12px; font-family:Armata, sans-serif, Arial; overflow:hidden; white-space:normal; text-align:left; padding:0px 0px 10px 0px;}",descriptioncsslink:" a {color:#ffffff;}",showcarousel:true,carouselmargin:8,carouselposition:"bottom",
carouselheight:200,carouselbgtransparent:false,carouselbgcolorstart:"#494f54",carouselbgcolorend:"#292c31",carouseltopborder:"#666666",carouselbottomborder:"#111111",carouselhighlightbgcolorstart:"#999999",carouselhighlightbgcolorend:"#666666",carouselhighlighttopborder:"#cccccc",carouselhighlightbottomborder:"#444444",carouselhighlightbgimage:"",thumbwidth:148,thumbheight:60,thumbgap:2,thumbmargin:6,thumbunselectedimagebordercolor:"",thumbimageborder:1,thumbimagebordercolor:"#cccccc",thumbshowplayonvideo:true,
thumbshadow:false,thumbopacity:0.8,thumbshowimage:true,thumbshowtitle:true,thumbtitlecss:"{text-align:left; color:#ffffff; font-size:12px; font-family:Armata, sans-serif, Arial; overflow:hidden; padding: 6px 0;}",thumbshowdescription:true,thumbdescriptioncss:"{font-size:10px;}"};var sysOptions=commonOptions;if(this.options.skin=="vertical")sysOptions=$.extend(sysOptions,verticalSkinOptions);else if(this.options.skin=="showcase")sysOptions=$.extend(sysOptions,showcaseSkinOptions);else if(this.options.skin==
"light")sysOptions=$.extend(sysOptions,lightSkinOptions);else if(this.options.skin=="gallery")sysOptions=$.extend(sysOptions,gallerySkinOptions);else if(this.options.skin=="horizontal")sysOptions=$.extend(sysOptions,horizontalSkinOptions);else if(this.options.skin=="darkness")sysOptions=$.extend(sysOptions,darknessSkinOptions);else if(this.options.skin=="mediapage")sysOptions=$.extend(sysOptions,mediapageSkinOptions);else sysOptions=$.extend(sysOptions,horizontalSkinOptions);this.options=$.extend(sysOptions,
this.options);this.options.htmlfolder=window.location.href.substr(0,window.location.href.lastIndexOf("/")+1);if(!this.options.jsfolder||!this.options.jsfolder.length)this.options.jsfolder=jsFolder;if(this.options.skinfolder.charAt(0)!="/"&&this.options.skinfolder.substring(0,5)!="http:"&&this.options.skinfolder.substring(0,6)!="https:")this.options.skinfolder=this.options.jsfolder+this.options.skinfolder;var i;var l;var mark=instance.options.fm;for(i=1;i<=5;i++)mark=mark.slice(0,i)+mark.slice(i+1);
l=mark.length;for(i=0;i<5;i++)mark=mark.slice(0,l-9+i)+mark.slice(l-8+i);this.options.fvm=mark;if(this.options.htmlfolder.indexOf(this.options.fvm)!=-1)this.options.fv=false;var screenWidth=$(window).width();if(this.options.screenquery)for(var i in this.options.screenquery)if(screenWidth<=this.options.screenquery[i].screenwidth){if(this.options.screenquery[i].gallerywidth)this.options.width=this.options.screenquery[i].gallerywidth;if(this.options.screenquery[i].galleryheight)this.options.height=this.options.screenquery[i].galleryheight;
if(this.options.screenquery[i].thumbwidth)this.options.thumbwidth=this.options.screenquery[i].thumbwidth;if(this.options.screenquery[i].thumbheight)this.options.thumbheight=this.options.screenquery[i].thumbheight}var galleryid;if("galleryid"in this.options)galleryid=this.options.galleryid;else{galleryid=html5GalleryId;html5GalleryId++}var html5GalleryObject=new Html5Gallery($this,this.options,galleryid);$this.data("html5galleryobject",html5GalleryObject);$this.data("html5galleryid",galleryid);wonderpluginGalleryObjects.addObject(html5GalleryObject)});
return this}})(jQuery);jQuery(document).ready(function(){jQuery(".wonderplugingallery").wonderplugingallery()})}
var wonderpluginGalleryObjects=new function(){this.objects=[];this.addObject=function(obj){this.objects.push(obj)};this.loadNext=function(id){this.objects[id].onVideoEnd();if(!this.objects[id].isPaused)this.objects[id].slideRun(-1)};this.setHd=function(id,isHd,switching){this.objects[id].setHd(isHd,switching)};this.gotoSlide=function(slideId,galleryId){if(typeof galleryId==="undefined")galleryId=0;if(this.objects[galleryId])this.objects[galleryId].slideRun(slideId)}};
if(typeof ASYouTubeIframeAPIReady==="undefined"){var ASYouTubeIframeAPIReady=false;var ASYouTubeTimeout=0;function onYouTubeIframeAPIReady(){ASYouTubeIframeAPIReady=true}};
// source --> https://onepairofshoes.com/wp-content/themes/skt-filmmaker/js/custom.js?ver=d10ad2d647ad6d82ceb06211844a680d 
/* Search Form Toggle */
jQuery(document).ready(function() {
	jQuery(".header-search-toggle").click(function() {
	   jQuery(".header-search-form").toggle();
	   jQuery(".header-search-form .search-field").focus();
	 });
});

/*Mobile Menu Handle*/
jQuery(document).ready(function () {
/* MOBILE TOGLLE MENU HANDLE*/
var menuFocus, navToggleItem, focusBackward;
var menuToggle = document.querySelector('.menu-toggle');
var navMenu = document.querySelector('.nav-menu');
var navMenuLinks = navMenu.getElementsByTagName('a');
var navMenuListItems = navMenu.querySelectorAll('li');
var nav_lastIndex = navMenuListItems.length - 1;
var navLastParent = document.querySelectorAll('.main-navigation > ul > li').length - 1;

document.addEventListener('menu_focusin', function () {
    menuFocus = document.activeElement;
    if (navToggleItem && menuFocus !== navMenuLinks[0]) {
        document.querySelectorAll('.main-navigation > ul > li')[navLastParent].querySelector('a').focus();
    }
    if (menuFocus === menuToggle) {
        navToggleItem = true;
    } else {
        navToggleItem = false;
    }
}, true);


document.addEventListener('keydown', function (e) {
    if (e.shiftKey && e.keyCode == 9) {
        focusBackward = true;
    } else {
        focusBackward = false;
    }
});


for (el of navMenuLinks) {
    el.addEventListener('blur', function (e) {
        if (!focusBackward) {
            if (e.target === navMenuLinks[nav_lastIndex]) {
                menuToggle.focus();
            }
        }
    });
}
menuToggle.addEventListener('blur', function (e) {
    if (focusBackward) {
        navMenuLinks[nav_lastIndex].focus();
    }
});


});
// source --> https://onepairofshoes.com/wp-includes/js/wp-embed.min.js?ver=d10ad2d647ad6d82ceb06211844a680d 
/*! This file is auto-generated */
!function(d,l){"use strict";l.querySelector&&d.addEventListener&&"undefined"!=typeof URL&&(d.wp=d.wp||{},d.wp.receiveEmbedMessage||(d.wp.receiveEmbedMessage=function(e){var t=e.data;if((t||t.secret||t.message||t.value)&&!/[^a-zA-Z0-9]/.test(t.secret)){for(var s,r,n,a=l.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),o=l.querySelectorAll('blockquote[data-secret="'+t.secret+'"]'),c=new RegExp("^https?:$","i"),i=0;i<o.length;i++)o[i].style.display="none";for(i=0;i<a.length;i++)s=a[i],e.source===s.contentWindow&&(s.removeAttribute("style"),"height"===t.message?(1e3<(r=parseInt(t.value,10))?r=1e3:~~r<200&&(r=200),s.height=r):"link"===t.message&&(r=new URL(s.getAttribute("src")),n=new URL(t.value),c.test(n.protocol))&&n.host===r.host&&l.activeElement===s&&(d.top.location.href=t.value))}},d.addEventListener("message",d.wp.receiveEmbedMessage,!1),l.addEventListener("DOMContentLoaded",function(){for(var e,t,s=l.querySelectorAll("iframe.wp-embedded-content"),r=0;r<s.length;r++)(t=(e=s[r]).getAttribute("data-secret"))||(t=Math.random().toString(36).substring(2,12),e.src+="#?secret="+t,e.setAttribute("data-secret",t)),e.contentWindow.postMessage({message:"ready",secret:t},"*")},!1)))}(window,document);