// Lightbox for Traditional and AllThumbs!
function hackLightbox() {
  if (YD.hasClass(document.body,"traditional") || YD.hasClass(document.body,"allthumbs")) {
    var oLst = YD.getElementsByClassName("photoLink", "a", this);
    var re = /\/gallery\/\d+\/\d+\/(\d+)\//;

    for (i=0; i < oLst.length; i++) {
      if (re.test(oLst[i])) {
        re.exec(oLst[i]);
        var url = oLst[i].href;
        oLst[i].href = "javascript:openLB(" + RegExp.$1 + ",'Auto');";

        if (YD.hasClass(document.body,"loggedIn"))
          oLst[i].parentNode.innerHTML += "<a href ='"+ url +"'>edit</a>";
      }
    }
  }
}

YE.onContentReady("photos", hackLightbox);