document.observe('dom:loaded', function(){

	var lightbox = new Lightbox(),
	lbCss = new Element('link', {
		rel: 'stylesheet',
		href: 'lightbox/css/lightbox.css',
		type: 'text/css',
		media: 'screen'
	});
	$$('head').first().insert(lbCss);
	
	var request = new Ajax.Updater('gallery', '/gallery/', {
		onSuccess: function(){
			lightbox.updateImageList();
		},
		onFailure: function(){
			$('gallery').update('There was an issue retrieving the gallery.');
		}
	});
	
});
