onLoads.push( function() {
  $$(".tabs").each(function(tabs) {
    new Control.Tabs(tabs);
  });
});

function initLightboxWithOptions() {
  myLightbox = new Lightbox({ timedGallery:   	true,
                              autostart:      	false,
                              poll_for_new:	  	false,
                              start_by_polling: true,
                              autoloop:				  true,
                              all_medias_url: 	'http://' + window.location.host + window.location.pathname + '/medias',
                              before_renew_all:	function(){$('slideshowStart').hide()},
                              after_renew_all:	function(){
                                if (imageArray.length > 0) {
                                  $('slideshowStart').show();
                                } 
                              }
                            });  
}

Event.stopObserving(window, 'load', initLightbox, false);
Event.observe(window, 'load', initLightboxWithOptions, false);
