YAHOO.util.Event.onDOMReady(function () {
    var a = $("default-container").getElementsByTagName('a');

    for (var i=0; i < a.length; i++) {  
        if (a[i].href && a[i].href.indexOf('/large/') !=-1 ) {
            YAHOO.util.Event.on(a[i], 'click', showLightbox, a[i]);
        }
    }
})

// Then the function is something like:
var lightbox; // keep a reference to the lightbox

function showLightbox(e, args) {
    
    var a = args; // weird YUI parameter syntax
    
    // cancel the link
    YAHOO.util.Event.stopEvent(e);

    // Create an overlay - actually a Panel, as we want shadows and modality
    if (!lightbox) {
         // First time - the panel doesn't exist yet
         lightbox = new YAHOO.widget.Panel(
               'lightbox',
               {
                    fixedcenter: true,
                    visible: false,
                    draggable: false,
                    modal: true,
                    close: true,
                    constraintoviewport: true,
                    zindex: 4
               }
          );
     }
     lightbox.setBody('<img src="' + a + '" />');
     lightbox.render(document.body);
     lightbox.show();
}
