var CoverUps = {
	initialized: false,
	todo: [],
	initialize: function(thumbnails){
		thumbnails.each(function(i){
			var image = new Image();
			image.onload = function(){
				coverup = $('photo' + i.id + '_cover-up');
				if(coverup){
					new Effect.Fade(coverup);
				}else{
					CoverUps.todo.push('photo' + i.id + '_cover-up');
				}
			}
			image.src = i.image;
		});
		Event.observe(document, 'dom:loaded', CoverUps.fadeLeftovers);
	},
	fadeLeftovers: function(){
		CoverUps.todo.each(function(e){
			new Effect.Fade(e);
		});
	}
};