function lightboxOverlay(){

    $$('a[rel=lightbox]').each(function(el){
    
        var el_img = el.getElement('img')
        var size = el_img.getSize();
        var el_span = new Element('span').injectInside(el);
                
        el.setStyles({
          display: 'block',
          position: 'relative',
          width: size.x,
          height: size.y,
          border: 'none'
        });
        
        if (el_img.hasClass('left')) {
          el.setStyles({
            float: 'left',
            margin: '0 10px 10px 0',
            clear: 'both'
          });
        }
        
        else if (el_img.hasClass('right')) {
          el.setStyles({
            float: 'right',
            margin: '0 0 10px 10px',
            clear: 'both'
          });
        };

        el_img.setStyle('margin','0');

        el_span.setStyles({
          position: 'absolute',
          right: '0',
          top: '0',
          width: '40px', 
          height: '40px',
          background: 'url(http://www.tomstardust.com/wp-content/themes/appletom/images/image_expand.png) top right no-repeat'
        });
        
    });
    
}