elgg.provide('elgg.tidypics'); elgg.tidypics.init = function() { if (elgg.ui.lightbox) { $('.elgg-lightbox, .elgg-lightbox-photo').colorbox({ href: function() { if ((new RegExp("photos/image/[0-9]+", 'i')).test($(this).attr('href'))) { var guid = (new RegExp("photos/image/[0-9]+", 'i')).exec($(this).attr('href')).toString().substr("photos/image/".length); return elgg.config.wwwroot + "photos/thumbnail/" + guid + "/large"; } else { return $(this).attr('href'); } }, title: function() { return '