function galerieBehaviour() {
  var anchors = document.getElementsByTagName( 'a' );
  if ( anchors.length > 0 ) {
    for( var i=0; i<anchors.length; i++ )
      if ( anchors[ i ].className.indexOf( 'lightbox' ) != -1 ) {
        anchors[ i ].onclick = function( e ) {
          var legend = ( this.firstChild.getAttribute )
            ? this.firstChild.getAttribute( 'alt' ) : this.firstChild.alt;
          Lightbox.showPicture( this.href, legend );
          return false;
        }
      }
  }
}

addListener( window, 'load', galerieBehaviour );