initLightbox = function() {	
  addRelLightboxAttribute('');
  myLightbox = new Lightbox();
};
addRelLightboxAttribute = function(id) {
  if (!document.getElementsByTagName) { return; }
  var ele;
  if (id) {
    ele = $(id);
    if (!ele) { return; }
  } else {
    ele = document.body;
  }
  var anchors = ele.getElementsByTagName('a');
  for (var i = 0; i < anchors.length; i++) {
    var anchor = anchors[i];
    if (anchor.getAttribute('href').match(/jpg$|gif$|png$/)) {
      var rel = String(anchor.getAttribute('rel'));
      if (!rel.toLowerCase().match('lightbox')) {
        anchor.setAttribute('rel', rel ? rel+' lightbox' : 'lightbox');
      }
    }
  }
};