(function(d,c){var f=c.Lang.Utils,e=c.Gallery.Registry,b=function(){return f.isDefined(d.query)},a=function(i){var h=i.lastIndexOf("_");return i.substring(16,h)},g=function(){d("a[id^='tubepress_']").each(function(){var i=d(this),h=i.attr("rel").split("_"),l,j,m,k=h[3];if(e.getPlayerLocationName(k)!=="solo"){return}j=a(i.attr("id"));l=e.getCurrentPageNumber(k);m=d.query.set("tubepress_video",j).set("tubepress_page",l).toString();i.attr("href",m);i.unbind("click")})};if(b()){g()}else{c.DomInjector.loadJs(c.Environment.getBaseUrl()+"/src/main/web/vendor/jquery.query/jQuery.query.js");f.callWhenTrue(g,b,100)}c.Beacon.subscribe("tubepress.gallery.newthumbs",g)}(jQuery,TubePress));