var Photo = new Class({
	options: {
		photos: [],
		delay: 3500
	},
	
	initialize: function(options) {
		this.setOptions(options);
		this.photos = new Asset.images(this.options.photos, {
			onComplete: this.display.bind(this)
		})
	},
	
	display: function() {
		var top = -337;
		var marginB = -300;
		
		if(window.ie6 || window.ie7) {
			top = marginB = -334;
		}
		
		this.photos.each(function(image, index) {
			image.setStyles({
				opacity: 0
			})
		});
		
		var index = 0;
		this.showPhoto(index);
		
		(function() {
			index++;
			this.showPhoto(index % this.photos.length);
		}).periodical(this.options.delay, this);
	},
	
	showPhoto: function(index) {
		$('photo').setStyle('background', 'url(' + this.photos[index].src + ') no-repeat 14px 0px');
	}
});

Photo.implement(new Options, new Events);