   1. /** 
   2. * Override lightbox initialization. 
   3. * 
   4. */  
   5. Lightbox.prototype.initialize = function() {  
   6.   
   7. this.updateImageList();  
   8.   
   9. this.keyboardAction = this.keyboardAction.bindAsEventListener(this);  
  10.   
  11. if (LightboxOptions.resizeSpeed > 10) LightboxOptions.resizeSpeed = 10;  
  12. if (LightboxOptions.resizeSpeed < 1)  LightboxOptions.resizeSpeed = 1;  
  13.   
  14. this.resizeDuration = LightboxOptions.animate ? ((11 - LightboxOptions.resizeSpeed) * 0.15) : 0;  
  15. this.overlayDuration = LightboxOptions.animate ? 0.2 : 0;  // shadow fade in/out duration  
   
var size = (LightboxOptions.animate ? 250 : 1) + 'px';  
var objBody = $$('body')[0];  
  
objBody.appendChild(Builder.node('div',{id:'overlay'}));  
   
// Change lightbox html code and place next and previous link to bottom of box  
objBody.appendChild(Builder.node('div',{id:'lightbox'}, [  
Builder.node('div',{id:'outerImageContainer'},  
Builder.node('div',{id:'imageContainer'}, [  
Builder.node('a',{id:'bottomNavClose', href: '#' },  
Builder.node('img', { src: LightboxOptions.fileBottomNavCloseImage })  
),  
Builder.node('img',{id:'lightboxImage'}),  
Builder.node('div',{id:'loading'},  
Builder.node('a',{id:'loadingLink', href: '#' },  
Builder.node('img', {src: LightboxOptions.fileLoadingImage})  
)  
)  
 ])  
 ),  
 Builder.node('div', {id:'imageDataContainer'},  
 Builder.node('div',{id:'imageData'}, [  
 Builder.node('div',{id:'hoverNav'}, [  
 Builder.node('a',{id:'prevLink', href: '#' }),  
 Builder.node('a',{id:'nextLink', href: '#' }),  
 Builder.node('div',{id:'imageDetails'}, [  
 Builder.node('div',{id:'caption'}),  
 Builder.node('span',{id:'numberDisplay'})  
 ])  
 ])  
 ])  
 )  
 ]));  
   
 $('overlay').hide().observe('click', (function() { this.end(); }).bind(this));  
 $('lightbox').hide().observe('click', (function(event) { if (event.element().id == 'lightbox') this.end(); }).bind(this));  
 $('outerImageContainer').setStyle({ width: size, height: size });  
 $('prevLink').observe('click', (function(event) { event.stop(); this.changeImage(this.activeImage - 1); }).bindAsEventListener(this));  
 $('nextLink').observe('click', (function(event) { event.stop(); this.changeImage(this.activeImage + 1); }).bindAsEventListener(this));  
 $('loadingLink').observe('click', (function(event) { event.stop(); this.end(); }).bind(this));  
 $('bottomNavClose').observe('click', (function(event) { event.stop(); this.end(); }).bind(this));  
   
 var th = this;  
 (function(){  
 var ids =  
 'overlay lightbox outerImageContainer imageContainer lightboxImage hoverNav prevLink nextLink loading loadingLink ' +  
 'imageDataContainer imageData imageDetails caption numberDisplay bottomNav bottomNavClose';  
 $w(ids).each(function(id){ th[id] = $(id); });  
 }).defer();  
 };  
