jQuery(function(t){var a=function(){var a=t("a.use_imagebrowser_effect");a.click(function(a){a.preventDefault();var i=!0,o=t(this),n=o.attr("data-image-id"),r=o.attr("data-image-slug"),e=window.location.toString();e=e.split("/"+photocrati_ajax.ngg_param_slug+"/").shift(),"/"==e.substr(-1)&&(e=e.substr(0,e.length-1)),n=r?r:n;try{n||(n=parseInt(o.parents(".ngg-gallery-thumbnail-box").attr("id").match(/\d+/).join("")))}catch(t){i=!1}i&&(photocrati_ajax.wp_root_url.indexOf("index.php")>=0?(e=photocrati_ajax.wp_root_url+"/"+photocrati_ajax.ngg_param_slug+"/image/"+n,window.location.toString().indexOf("?")>=0&&(e+="?"+window.location.toString().split("?").pop())):e+="/"+photocrati_ajax.ngg_param_slug+"/image/"+n,window.location=e)}),a.length>0&&setTimeout(function(){a.each(function(){this.onclick=null})},200)};t(this).bind("refreshed",a),a()});