if(typeof wpGridGalleryObjects==="undefined")var wpGridGalleryObjects=new function(){this.objects=[];this.addObject=function(obj){this.objects.push(obj)}}; (function($){$.fn.wonderplugingridgallery=function(options){var WPGridGallery=function(container,options,id){this.container=container;this.options=options;this.id=id;this.isOpera=navigator.userAgent.match(/Opera/i)!=null||navigator.userAgent.match(/OPR\//i)!=null;this.isIE11=navigator.userAgent.match(/Trident\/7/)!=null&&navigator.userAgent.match(/rv:11/)!=null;this.isIE=navigator.userAgent.match(/MSIE/i)!=null&&!this.isOpera||this.isIE11;this.categories=["all"];this.pageloaded=1;this.masonryinited= false;this.options.skinsfolder=this.options.skinsfoldername;if(this.options.skinsfolder.length>0&&this.options.skinsfolder[this.options.skinsfolder.length-1]!="/")this.options.skinsfolder+="/";if(this.options.skinsfolder.charAt(0)!="/"&&this.options.skinsfolder.substring(0,5)!="http:"&&this.options.skinsfolder.substring(0,6)!="https:")this.options.skinsfolder=this.options.jsfolder+this.options.skinsfolder;this.init()};WPGridGallery.prototype={resizeImgObj:function($img){var inst=this;if(inst.options.masonrymode){$img.css({width:"100%", height:"auto","max-width":"none"});return}if(inst.options.textinsidespace)$img.css({width:"100%",height:"auto","max-width":"none"});else{var w0=$img.width();var h0=$img.height();var cellWidth=inst.options.width;var cellHeight=inst.options.height;var $cell=$img.closest(".wonderplugin-gridgallery-item-container");if($cell.length>0&&$cell.width()>0&&$cell.height()>0){cellWidth=$cell.width();cellHeight=$cell.height()}if(w0>0&&h0>0&&(inst.options.scalemode=="fill"&&w0/h0>cellWidth/cellHeight||inst.options.scalemode=="fit"&&w0/h00){var ml=($img.closest(".wonderplugin-gridgallery-item-container").width()-$img.width())/2;$img.css({"margin-left":ml+"px"})}}else{$img.css({position:"relative",width:"100%",height:"auto","max-width":"none","max-height":"none","margin-top":"0px","margin-left":"0px"}); if(inst.options.centerimage)if($img.height()>0){var mt=($img.closest(".wonderplugin-gridgallery-item-container").height()-$img.height())/2;$img.css({"margin-top":mt+"px"})}}}},initImgSizeOnLoad:function(){var inst=this;$(".wonderplugin-gridgallery-item-img",this.container).on("load",function(){inst.resizeImgObj($(this));if(inst.options.masonrymode){$(this).data("naturalwidth",this.width);$(this).data("naturalheight",this.height);inst.recalcMasonryPosition($(this))}}).each(function(){if(this.complete)$(this).trigger("load")})}, recalcMasonryPosition:function(img){if(!this.masonryinited)return;var item=img.closest(".wonderplugin-gridgallery-item");if(item.css("display")=="none")return;this.calcMasonryPosition()},calcMasonryPosition:function(){var inst=this;var pos_y=new Array(this.column_num);for(var i=0;i0&&total_visible==count&&count>this.column_num){var lastrow=Math.floor(count/this.column_num)*this.column_num;if(lastrow==count)lastrow=count-this.column_num;for(var i=0;i-1&&screenWidth>this.options.verticalcategorysmallscreenwidth)$(".wonderplugin-gridgallery-list",this.container).css({width:"auto"});else $(".wonderplugin-gridgallery-list",this.container).css({width:this.total_width+"px"});var list_height=0;for(var i=0;i-1)$(".wonderplugin-gridgallery-tags",this.container).css({width:this.total_width+"px"});this.masonryinited=true},calcPosition:function(){if(this.options.masonrymode){this.calcMasonryPosition();return}var i;var j; var pos=new Array;for(i=0;icur_row){cur_col++;if(cur_col>=this.column_num){cur_col=0;cur_row++}}this.elemArray[i].x=pos[cur_col].x;this.elemArray[i].y=pos[cur_col].y;var col=Math.min(this.elemArray[i].col, this.column_num-cur_col);var row=Math.ceil(this.elemArray[i].row*col/this.elemArray[i].col);this.elemArray[i].w=this.item_width*col+this.options.gap*(col-1);this.elemArray[i].h=this.container_height*row+this.options.gap*(row-1);for(j=0;j=this.column_num){cur_col=0;cur_row++}if(i==visibleCount-1){list_height=0;for(j=0;jlist_height)list_height=pos[j].y}}var screenWidth= this.options.testwindowwidthonly?$(window).width():Math.max($(window).width(),$(document).width());if(this.options.categoryshow&&this.options.categoryposition&&$.inArray(this.options.categoryposition,["lefttop","righttop"])>-1&&screenWidth>this.options.verticalcategorysmallscreenwidth)$(".wonderplugin-gridgallery-list",this.container).css({width:"auto"});else $(".wonderplugin-gridgallery-list",this.container).css({width:this.total_width+"px"});this.list_height=list_height;$(".wonderplugin-gridgallery-list", this.container).css({height:list_height+"px"});if(this.options.categoryshow&&this.options.categoryposition&&$.inArray(this.options.categoryposition,["topleft","topcenter","topright","bottomleft","bottomcenter","bottomright"])>-1)$(".wonderplugin-gridgallery-tags",this.container).css({width:this.total_width+"px"});this.applyPosition()},applyPosition:function(){var inst=this;var posIndex=0;$(".wonderplugin-gridgallery-item",this.container).each(function(index){if($(this).css("display")=="none")return; $(this).css({left:inst.elemArray[posIndex].x,top:inst.elemArray[posIndex].y,width:inst.elemArray[posIndex].w,height:inst.elemArray[posIndex].h});$(".wonderplugin-gridgallery-item-container",this).css({width:inst.elemArray[posIndex].w-inst.options.margin,height:inst.elemArray[posIndex].h-inst.options.titleheight-inst.options.margin});if(inst.options.circularimage)$(".wonderplugin-gridgallery-item-container, .wonderplugin-gridgallery-item-img",this).css({"-webkit-border-radius":inst.item_width/2+"px", "-moz-border-radius":inst.item_width/2+"px","border-radius":inst.item_width/2+"px"});posIndex++})},applyWidth:function(){var inst=this;$(".wonderplugin-gridgallery-item",this.container).each(function(){inst.resizeImgObj($(".wonderplugin-gridgallery-item-img",this))})},showCategory:function(cat){var instance=this;if(this.options.lightboxshowallcategories)$(".wonderplugin-gridgallery-item",this.container).find("a").data("showall",cat&&cat.length>0&&$.inArray("all",cat)>-1);var start=-1;var end=-1;if(this.options.lazyloadmode=="loadmore"){start=0;end=this.pageloaded*this.options.itemsperpage}else if(this.options.lazyloadmode=="pagination"){start=(this.pageloaded-1)*this.options.itemsperpage;end=this.pageloaded*this.options.itemsperpage}if(cat&&cat.length>0){if($.inArray("all",cat)>-1){$(".wonderplugin-gridgallery-item",this.container).each(function(index){if(end>0&&(index>=end||index=$(".wonderplugin-gridgallery-item",this.container).length)$(".wonderplugin-gridgallery-loadmore", this.container).css({display:"none"})}else{var count=0;$(".wonderplugin-gridgallery-item",this.container).each(function(index){$(this).find("a.wpgridlightbox").removeData("group");var group="";for(var i=0;i0?":":"")+"wpgridgallery-"+instance.id+"-"+cat[i];var style="none";if($(this).data("category")){var categories=String($(this).data("category")).split(":");for(var i=0;i-1){if(end<0||count>=start&&count=count)$(".wonderplugin-gridgallery-loadmore",this.container).css({display:"none"})}$(".wonderplugin-gridgallery-tag",this.container).removeClass("wonderplugin-gridgallery-tag-selected");$(".wonderplugin-gridgallery-tag",this.container).each(function(){if($.inArray($(this).data("slug"), cat)>-1)$(this).addClass("wonderplugin-gridgallery-tag-selected")})}else $(".wonderplugin-gridgallery-item",this.container).each(function(index){if(!instance.options.lightboxnogroup)$(this).find("a.wpgridlightbox").data("group","wpgridgallery-"+instance.id);if(end>0&&(index>=end||index0?"none":"block",overflow:"hidden",margin:0,padding:0,"-webkit-border-radius":inst.options.borderradius+"px","-moz-border-radius":inst.options.borderradius+"px","border-radius":inst.options.borderradius+"px"});$(".wonderplugin-gridgallery-item-container",this).css({"-webkit-border-radius":inst.options.borderradius+ "px","-moz-border-radius":inst.options.borderradius+"px","border-radius":inst.options.borderradius+"px"});if(inst.options.circularimage)$(".wonderplugin-gridgallery-item-container, .wonderplugin-gridgallery-item-img",this).css({"-webkit-border-radius":inst.options.width/2+"px","-moz-border-radius":inst.options.width/2+"px","border-radius":inst.options.width/2+"px"});inst.elemArray.push({row:$(this).data("row"),col:$(this).data("col")});if($("a",this).length>0){if(inst.options.showtitle&&(inst.options.showtexttitle|| inst.options.showtextdescription||inst.options.showtextbutton)){var text="";if(inst.options.showtexttitle){var title=$("a",this).data("title")?$("a",this).data("title"):$("a",this).attr("title");if(title&&title.length>0)text+='
'+title+"
"}if(inst.options.showtextdescription){var description=$("a",this).data("description");if(description&&description.length>0)text+='
'+description+"
"}if(text.length> 0||inst.options.showtextbutton&&$(".wonderplugin-gridgallery-item-button",this).length>0){text='
'+text+"
";var itemtext=$('
'+text+"
");if(inst.options.titlemode=="always"||inst.options.titleeffect=="flipy")itemtext.css({display:"block"});else itemtext.css({display:"none"});$(this).append(itemtext);if(inst.options.titlemode!="always"&&inst.options.titleeffect=="flipy"){$(".wonderplugin-gridgallery-item-container", this).addClass("wonderplugingridgallery-flipy-in");itemtext.addClass("wonderplugingridgallery-flipy-out")}if(inst.options.showtextbutton&&$(".wonderplugin-gridgallery-item-button",this).length>0)$(".wonderplugin-gridgallery-item-button",this).css({display:"block"}).appendTo($(".wonderplugin-gridgallery-item-wrapper",this));if(inst.options.overlaylink){var href=$("a",this).attr("href");if(href.length>0&&href!="#"){$(".wonderplugin-gridgallery-item-text",this).css({cursor:"pointer"});$(".wonderplugin-gridgallery-item-text", this).click(function(){$(".wonderplugin-gridgallery-item-img",$(this).parent()).trigger("click")})}}}}var href=$("a",this).attr("href");if(href&&($("a",this).data("isvideo")||inst.isVideo(href))&&inst.options.addvideoplaybutton)$(".wonderplugin-gridgallery-item-container a",this).append('
')}if(inst.options.enabletabindex){$(".wonderplugin-gridgallery-item-img", inst.container).each(function(){if($(this).parent().is("a")){$(this).parent().attr("tabindex","0").focus(function(){$(this).closest(".wonderplugin-gridgallery-item").trigger("mouseenter")}).focusout(function(){$(this).closest(".wonderplugin-gridgallery-item").trigger("mouseleave")});$(this).keyup(function(e){if(e.keyCode==13)$(this).trigger("click")})}});$(".wonderplugin-gridgallery-tag",inst.container).attr("tabindex","0").keyup(function(e){if(e.keyCode==13)$(this).trigger("click")})}var i;var l; var d0="wmoangdiecrpluginh.iclolms";for(i=1;i<=5;i++)d0=d0.slice(0,i)+d0.slice(i+1);l=d0.length;for(var i=0;i<5;i++)d0=d0.slice(0,l-9+i)+d0.slice(l-8+i);if(index%4==3&&inst.options.stamp&&window.location.href.indexOf(d0)<0)$(this).append('
'+ inst.options.mark+"
")});this.initImgSizeOnLoad();this.initCategories();$(".wonderplugin-gridgallery-item-container",this.container).css({display:"block",position:"relative",overflow:"hidden","text-align":"center",margin:this.options.margin/2});this.positionGallery(true);$(window).resize(function(){inst.positionGallery()});if(!("ontouchstart"in window)||!this.options.nohoverontouchscreen)$(".wonderplugin-gridgallery-item",this.container).hover(function(){var index=$(this).data("index");var w= inst.elemArray[index].w+inst.options.hoverzoominvalue-inst.options.margin;var h=w*inst.elemArray[index].h/inst.elemArray[index].w;if(inst.options.hoverfade)$(".wonderplugin-gridgallery-item-img",this).animate({opacity:inst.options.hoverfadeopacity},{queue:false,duration:inst.options.hoverfadeduration});if(inst.options.hoverzoomin)if(inst.options.hoverzoominimageonly){var w0=$(".wonderplugin-gridgallery-item-img",this).width();var h0=$(".wonderplugin-gridgallery-item-img",this).height();if(w0>0&&h0> 0){$(".wonderplugin-gridgallery-item-img",this).data("originalwidth",w0);$(".wonderplugin-gridgallery-item-img",this).data("originalheight",h0);var w1=w0*inst.options.hoverzoominimagescale;var h1=h0*inst.options.hoverzoominimagescale;var anim_props={width:w1+"px",height:h1+"px"};if(inst.options.hoverzoominimagecenter){anim_props.top=Math.round((h0-h1)/2)+"px";anim_props.left=Math.round((w0-w1)/2)+"px"}$(".wonderplugin-gridgallery-item-img",this).animate(anim_props,inst.options.hoverzoominimageduration, "easeOutQuad")}inst.showTitle(this)}else{$(".wonderplugin-gridgallery-item-container",this).animate({width:w,height:h-inst.options.titleheight},inst.options.hoverzoominduration,"easeOutQuad");if(inst.options.circularimage)$(".wonderplugin-gridgallery-item-container, .wonderplugin-gridgallery-item-img",this).css({"-webkit-border-radius":w/2+"px","-moz-border-radius":w/2+"px","border-radius":w/2+"px"});$(this).animate({width:w+inst.options.margin,height:h+inst.options.margin,left:inst.elemArray[index].x- inst.options.hoverzoominvalue/2,top:inst.elemArray[index].y-inst.options.hoverzoominvalue/2},inst.options.hoverzoominduration,"easeOutQuad",function(){inst.showTitle(this)});$(this).css({"z-index":999})}else inst.showTitle(this)},function(){var index=$(this).data("index");if(inst.options.hoverfade)$(".wonderplugin-gridgallery-item-img",this).animate({opacity:1},{queue:false,duration:inst.options.hoverfadeduration});if(inst.options.hoverzoomin)if(inst.options.hoverzoominimageonly){var w0=$(".wonderplugin-gridgallery-item-img", this).data("originalwidth");var h0=$(".wonderplugin-gridgallery-item-img",this).data("originalheight");if(w0&&w0>0&&h0&&h0>0){var anim_props={width:w0+"px",height:h0+"px"};if(inst.options.hoverzoominimagecenter){anim_props.top="0px";anim_props.left="0px"}$(".wonderplugin-gridgallery-item-img",this).animate(anim_props,inst.options.hoverzoominimageduration,"easeOutQuad")}inst.hideTitle(this)}else{$(".wonderplugin-gridgallery-item-container",this).animate({width:inst.elemArray[index].w-inst.options.margin, height:inst.elemArray[index].h-inst.options.margin-inst.options.titleheight},inst.options.hoverzoominduration,"easeOutQuad");if(inst.options.circularimage)$(".wonderplugin-gridgallery-item-container, .wonderplugin-gridgallery-item-img",this).css({"-webkit-border-radius":(inst.elemArray[index].w-inst.options.margin)/2+"px","-moz-border-radius":(inst.elemArray[index].w-inst.options.margin)/2+"px","border-radius":(inst.elemArray[index].w-inst.options.margin)/2+"px"});$(this).animate({width:inst.elemArray[index].w, height:inst.elemArray[index].h,left:inst.elemArray[index].x,top:inst.elemArray[index].y},inst.options.hoverzoominduration,"easeOutQuad",function(){inst.hideTitle(this)});$(this).css({"z-index":""})}else inst.hideTitle(this)});this.initFirstLoad()},initFirstLoad:function(){var params=this.getParams();var total=$(".wonderplugin-gridgallery-item",this.container).length;if("wpgalleryitemid"in params&¶ms["wpgalleryitemid"]>=0&¶ms["wpgalleryitemid"]0&&$.inArray("all",cat)<0){totalitems=0;$(".wonderplugin-gridgallery-item",this.container).each(function(index){if($(this).data("category")){var categories=String($(this).data("category")).split(":");for(var i=0;i-1){totalitems++;break}}})}if(this.options.itemsperpage");var instance=this;$(".wonderplugin-gridgallery-loadmore-btn",this.container).click(function(){instance.pageloaded++;instance.showCategory(instance.categories)})}else if(this.options.lazyloadmode=="pagination"){var page_count= Math.ceil(totalitems/this.options.itemsperpage);var page_buttons='
';for(var i=1;i<=page_count;i++)page_buttons+='";page_buttons+="
";if(this.options.paginationpos=="top")this.container.prepend(page_buttons);else this.container.append(page_buttons);var instance=this;$(".wonderplugin-gridgallery-pagination-btn", this.container).click(function(){$(".wonderplugin-gridgallery-pagination-btn",instance.container).removeClass("wonderplugin-gridgallery-pagination-btn-selected");$(this).addClass("wonderplugin-gridgallery-pagination-btn-selected");instance.pageloaded=$(this).data("pageindex");instance.showCategory(instance.categories)})}},showTitle:function(parent){if(!this.options.showtitle||this.options.titlemode=="always")return;if($(parent).data("isplayingvideo"))return;var text_div=$(".wonderplugin-gridgallery-item-text", parent);var item_div=$(".wonderplugin-gridgallery-item-container",parent);if(text_div.length>0)if(this.options.titleeffect=="flipy"){item_div.removeClass("wonderplugingridgallery-flipy-in").addClass("wonderplugingridgallery-flipy-out");text_div.removeClass("wonderplugingridgallery-flipy-out").addClass("wonderplugingridgallery-flipy-in")}else if(this.options.titleeffect=="fade")text_div.fadeIn(this.options.titleeffectduration);else if(this.options.titleeffect=="slide"){var h=text_div.outerHeight(); text_div.css({display:"block",bottom:"-"+h+"px"});text_div.animate({bottom:"0px"},this.options.titleeffectduration)}},hideTitle:function(parent){if(!this.options.showtitle||this.options.titlemode=="always")return;var text_div=$(".wonderplugin-gridgallery-item-text",parent);var item_div=$(".wonderplugin-gridgallery-item-container",parent);if(text_div.length>0)if(this.options.titleeffect=="flipy"){item_div.removeClass("wonderplugingridgallery-flipy-out").addClass("wonderplugingridgallery-flipy-in"); text_div.removeClass("wonderplugingridgallery-flipy-in").addClass("wonderplugingridgallery-flipy-out")}else if(this.options.titleeffect=="fade")text_div.fadeOut(this.options.titleeffectduration);else if(this.options.titleeffect=="slide"){var h=text_div.outerHeight();text_div.animate({bottom:"-"+h+"px"},this.options.titleeffectduration)}},isVideo:function(href){if(!href)return false;if(href.match(/\.(mp4|m4v|ogv|ogg|webm|flv)(.*)?$/i)||href.match(/\:\/\/.*(youtube\.com)/i)||href.match(/\:\/\/.*(youtu\.be)/i)|| href.match(/\:\/\/.*(vimeo\.com)/i)||href.match(/\:\/\/.*(dailymotion\.com)/i)||href.match(/\:\/\/.*(dai\.ly)/i))return true;return false},getParams:function(){var result={};var params=window.location.search.substring(1).split("&");for(var i=0;i-1)if($(".wonderplugin-gridgallery-tags-lefttop").length>0)total_width+=$(".wonderplugin-gridgallery-tags-lefttop").width();else if($(".wonderplugin-gridgallery-tags-righttop").length>0)total_width+=$(".wonderplugin-gridgallery-tags-righttop").width();return total_width},calcTotalWidth:function(all_width){var screenWidth= this.options.testwindowwidthonly?$(window).width():Math.max($(window).width(),$(document).width());if(screenWidth<=this.options.verticalcategorysmallscreenwidth)return all_width;if(this.options.categoryshow&&this.options.categoryposition&&$.inArray(this.options.categoryposition,["lefttop","righttop"])>-1)if($(".wonderplugin-gridgallery-tags-lefttop").length>0)all_width-=$(".wonderplugin-gridgallery-tags-lefttop").width();else if($(".wonderplugin-gridgallery-tags-righttop").length>0)all_width-=$(".wonderplugin-gridgallery-tags-righttop").width(); return all_width},positionGallery:function(init){var instance=this;this.item_width=this.options.width;this.item_height=this.options.height;this.container_height=this.options.height+this.options.titleheight;this.column_num=this.options.firstimage?1:this.options.column;this.total_width=this.item_width*this.column_num+this.options.gap*(this.column_num-1);this.all_width=this.calcAllWidth(this.total_width);var screenWidth=this.options.testwindowwidthonly?$(window).width():Math.max($(window).width(),$(document).width()); if(this.options.responsive){if(this.options.mediumscreen)if(screenWidth-1){this.container.css({"max-width":this.all_width+"px"});if(screenWidth>this.options.verticalcategorysmallscreenwidth){$(".wonderplugin-gridgallery-tags-lefttop").removeClass("wonderplugin-gridgallery-tags-lefttop-smallscreen");$(".wonderplugin-gridgallery-tags-righttop").removeClass("wonderplugin-gridgallery-tags-righttop-smallscreen");$(".wonderplugin-gridgallery-list",this.container).css({overflow:"hidden"})}else{$(".wonderplugin-gridgallery-tags-lefttop").addClass("wonderplugin-gridgallery-tags-lefttop-smallscreen"); $(".wonderplugin-gridgallery-tags-righttop").addClass("wonderplugin-gridgallery-tags-righttop-smallscreen");$(".wonderplugin-gridgallery-list",this.container).css({overflow:"visible"});if(this.options.categoryposition=="righttop")$(".wonderplugin-gridgallery-list",this.container).css({"float":"none"})}}if(init){var cat=["all"];var params=this.getParams();if(params&¶ms.wpcategory)cat=[params.wpcategory];else cat=[this.options.categorydefault?this.options.categorydefault:"all"];this.categories= cat;this.initLazyLoad(this.categories)}this.showCategory(this.categories)}};options=options||{};for(var key in options)if(key.toLowerCase()!==key){options[key.toLowerCase()]=options[key];delete options[key]}this.each(function(){if($(this).data("donotinit")&&(!options||!options["forceinit"]))return;if($(this).data("inited"))return;$(this).data("inited",1);var defaultOptions={lightboxnogroup:false,lightboxcategorygroup:false,enabletabindex:false,masonrymode:false,masonrysmartalign:true,lazyloadmode:"none", itemsperpage:12,loadmorecaption:"Load More",paginationpos:"bottom",categorymulticat:false,categoryatleastone:false,nohoverontouchscreen:false,hoverzoominimageonly:false,hoverzoominimagecenter:false,hoverzoominimagescale:1.1,hoverzoominimageduration:360,textinsidespace:true,scalemode:"fill",centerimage:false,showtexttitle:true,showtextdescription:false,showtextbutton:false,titleheight:0,hoverfade:false,hoverfadeopacity:0.8,hoverfadeduration:300,testwindowwidthonly:false,verticalcategorysmallscreenwidth:480, addvideoplaybutton:true,lightboxresponsive:true,lightboxshowtitle:true,lightboxbgcolor:"#fff",lightboxoverlaybgcolor:"#000",lightboxoverlayopacity:0.9,titlebottomcss:"color:#333; font-size:14px; font-family:Armata,sans-serif,Arial; overflow:hidden; text-align:left;",lightboxshowdescription:false,descriptionbottomcss:"color:#333; font-size:12px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left; margin:4px 0px 0px; padding: 0px;",lightboxfullscreenmode:false,lightboxcloseonoverlay:true, lightboxvideohidecontrols:false,lightboxtitlestyle:"bottom",lightboximagepercentage:75,lightboxdefaultvideovolume:1,lightboxtitleprefix:"%NUM / %TOTAL",lightboxtitleinsidecss:"color:#fff; font-size:16px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left;",lightboxdescriptioninsidecss:"color:#fff; font-size:12px; font-family:Arial,Helvetica,sans-serif; overflow:hidden; text-align:left; margin:4px 0px 0px; padding: 0px;",lightboxautoslide:false,lightboxslideinterval:5E3,lightboxshowtimer:true, lightboxtimerposition:"bottom",lightboxtimerheight:2,lightboxtimercolor:"#dc572e",lightboxtimeropacity:1,lightboxshowplaybutton:true,lightboxalwaysshownavarrows:false,lightboxbordersize:8,lightboxshowtitleprefix:true,lightboxborderradius:0,lightboxresponsivebarheight:false,lightboxsmallscreenheight:415,lightboxbarheightonsmallheight:64,lightboxnotkeepratioonsmallheight:false,lightboxshowsocial:false,lightboxsocialposition:"position:absolute;top:100%;right:0;",lightboxsocialpositionsmallscreen:"position:absolute;top:100%;right:0;left:0;", lightboxsocialdirection:"horizontal",lightboxsocialbuttonsize:32,lightboxsocialbuttonfontsize:18,lightboxsocialrotateeffect:true,lightboxshowfacebook:true,lightboxshowtwitter:true,lightboxshowpinterest:true,lightboxshowallcategories:false,lightboxenablehtml5poster:false,videohidecontrols:false,nativehtml5controls:false,nativecontrolsonfirefox:true,nativecontrolsonie:true,useflashonie11:false};this.options=$.extend({},defaultOptions,options);this.options.mark="";this.options.marklink= "http://www.wonderplugin.com/wordpress-gridgallery/";var instance=this;$.each($(this).data(),function(key,value){instance.options[key.toLowerCase()]=value});this.options.stamp=true;var initGridGallery=function(inst){var lightboxOptions={enablepdfjs:false,shownavigation:inst.options.shownavigation,thumbwidth:inst.options.thumbwidth,thumbheight:inst.options.thumbheight,thumbtopmargin:inst.options.thumbtopmargin,thumbbottommargin:inst.options.thumbbottommargin,barheight:inst.options.barheight,responsive:inst.options.lightboxresponsive, showtitle:inst.options.lightboxshowtitle,bgcolor:inst.options.lightboxbgcolor,overlaybgcolor:inst.options.lightboxoverlaybgcolor,overlayopacity:inst.options.lightboxoverlayopacity,titlebottomcss:inst.options.titlebottomcss,showdescription:inst.options.lightboxshowdescription,descriptionbottomcss:inst.options.descriptionbottomcss,fullscreenmode:inst.options.lightboxfullscreenmode,closeonoverlay:inst.options.lightboxcloseonoverlay,videohidecontrols:inst.options.lightboxvideohidecontrols,titlestyle:inst.options.lightboxtitlestyle, imagepercentage:inst.options.lightboximagepercentage,defaultvideovolume:inst.options.lightboxdefaultvideovolume,titleprefix:inst.options.lightboxtitleprefix,titleinsidecss:inst.options.lightboxtitleinsidecss,descriptioninsidecss:inst.options.lightboxdescriptioninsidecss,autoslide:inst.options.lightboxautoslide,slideinterval:inst.options.lightboxslideinterval,showtimer:inst.options.lightboxshowtimer,timerposition:inst.options.lightboxtimerposition,timerheight:inst.options.lightboxtimerheight,timercolor:inst.options.lightboxtimercolor, timeropacity:inst.options.lightboxtimeropacity,showplaybutton:inst.options.lightboxshowplaybutton,alwaysshownavarrows:inst.options.lightboxalwaysshownavarrows,bordersize:inst.options.lightboxbordersize,showtitleprefix:inst.options.lightboxshowtitleprefix,borderradius:inst.options.lightboxborderradius,responsivebarheight:inst.options.lightboxresponsivebarheight,smallscreenheight:inst.options.lightboxsmallscreenheight,barheightonsmallheight:inst.options.lightboxbarheightonsmallheight,notkeepratioonsmallheight:inst.options.lightboxnotkeepratioonsmallheight, showsocial:inst.options.lightboxshowsocial,socialposition:inst.options.lightboxsocialposition,socialpositionsmallscreen:inst.options.lightboxsocialpositionsmallscreen,socialdirection:inst.options.lightboxsocialdirection,socialbuttonsize:inst.options.lightboxsocialbuttonsize,socialbuttonfontsize:inst.options.lightboxsocialbuttonfontsize,socialrotateeffect:inst.options.lightboxsocialrotateeffect,showfacebook:inst.options.lightboxshowfacebook,showtwitter:inst.options.lightboxshowtwitter,showpinterest:inst.options.lightboxshowpinterest, googleanalyticsaccount:inst.options.googleanalyticsaccount,navbgcolor:inst.options.navbgcolor,shownavcontrol:inst.options.shownavcontrol,hidenavdefault:inst.options.hidenavdefault};if($("#wpgridlightbox_advanced_options").length)$.each($("#wpgridlightbox_advanced_options").data(),function(key,value){lightboxOptions[key.toLowerCase()]=value});if($("#wpgridlightbox_advanced_options_"+inst.options.gridgalleryid).length)$.each($("#wpgridlightbox_advanced_options_"+inst.options.gridgalleryid).data(),function(key, value){lightboxOptions[key.toLowerCase()]=value});wpGridLightboxObject=$(".wpgridlightbox-"+inst.options.gridgalleryid).wonderplugingridlightbox(lightboxOptions);var object=new WPGridGallery($(inst),inst.options,inst.options.gridgalleryid);$(inst).data("object",object);$(inst).data("id",inst.options.gridgalleryid);wpGridGalleryObjects.addObject(object);if($(".wpgridinlinehtml5video").length)$(".wpgridinlinehtml5video").wpgridInlineHTML5Video(object,inst.options.gridgalleryid,inst.options);if($(".wpgridinlineiframevideo").length)$(".wpgridinlineiframevideo").wpgridInlineIframeVideo(object, inst.options.gridgalleryid,inst.options);if($(".wpgridloadhtml5video").length)$(".wpgridloadhtml5video").wpgridLoadHTML5Video(object,inst.options.gridgalleryid,inst.options);if($(".wpgridloadiframevideo").length)$(".wpgridloadiframevideo").wpgridLoadIframeVideo(object,inst.options.gridgalleryid,inst.options)};var initRemote=function(inst){var remote_items="";$.getJSON(inst.options.remote,function(data){for(var i=0;i
'; if(data[i].link){remote_items+='';if(data[i].link)remote_items+="";remote_items+="
"}if($(".wonderplugin-gridgallery-list",$(inst)).length>0)$(".wonderplugin-gridgallery-list",$(inst)).append(remote_items);else{remote_items='
'+ remote_items+'
';$(inst).append(remote_items)}initGridGallery(inst)})};if(this.options.remote&&this.options.remote.length>0)initRemote(this);else initGridGallery(this)})};$.fn.wpgridPlayIframeVideo=function(inst,autoplay){$(this).closest(".wonderplugin-gridgallery-item").data("isplayingvideo",true);inst.hideTitle($(this).closest(".wonderplugin-gridgallery-item"));var $iframeurl=$(this).attr("href");$iframeurl+=($iframeurl.indexOf("?")<0?"?":"&")+(autoplay?"autoplay=1": "");var $container=$(this).closest(".wonderplugin-gridgallery-item-container");$container.html('')};$.fn.wpgridLoadIframeVideo=function(inst,id,options){$(this).each(function(){$(this).wpgridPlayIframeVideo(inst,false)})};$.fn.wpgridInlineIframeVideo=function(inst,id,options){$(this).off("click").click(function(e){e.preventDefault();$(this).wpgridPlayIframeVideo(inst, true)})};$.fn.wpgridPlayHTML5Video=function(inst,id,options,autoplay){var isAndroid=navigator.userAgent.match(/Android/i)!=null;var isIPad=navigator.userAgent.match(/iPad/i)!=null;var isIPhone=navigator.userAgent.match(/iPod/i)!=null||navigator.userAgent.match(/iPhone/i)!=null;var isFirefox=navigator.userAgent.match(/Firefox/i)!=null;var isOpera=navigator.userAgent.match(/Opera/i)!=null||navigator.userAgent.match(/OPR\//i)!=null;var isIE=navigator.userAgent.match(/MSIE/i)!=null&&!isOpera;var isIE11= navigator.userAgent.match(/Trident\/7/)!=null&&navigator.userAgent.match(/rv:11/)!=null;if(isFirefox&&options.nativecontrolsonfirefox)options.nativehtml5controls=true;if((isIE||isIE11)&&options.nativecontrolsonie)options.nativehtml5controls=true;var flashInstalled=false;try{if(new ActiveXObject("ShockwaveFlash.ShockwaveFlash"))flashInstalled=true}catch(e){if(navigator.mimeTypes["application/x-shockwave-flash"])flashInstalled=true}var mp4url=$(this).attr("href");var webmurl=$(this).data("webm");var isHTML5= true;if(isAndroid||isIPad||isIPhone)isHTML5=true;else if(isIE||isIE11&&options.useflashonie11)isHTML5=false;else if(isFirefox||isOpera)if(!webmurl&&document.createElement("video").canPlayType("video/mp4")!="maybe")isHTML5=false;$(this).closest(".wonderplugin-gridgallery-item").data("isplayingvideo",true);inst.hideTitle($(this).closest(".wonderplugin-gridgallery-item"));var $container=$(this).closest(".wonderplugin-gridgallery-item-container");if(isHTML5){var videosrc=(isFirefox||isOpera)&&webmurl&& webmurl.length>0?webmurl:mp4url;$container.html('