$ = function(elementId) { return document.getElementById(elementId) }

function setOpacity(id, value) {
	if (document.all && !window.opera) $(id).style.filter='alpha(opacity='+value*100+')';
	else $(id).style.opacity=value;
}

var flashingPhotos = {
	photos: [],
	currentPhoto: 0,
	initialize: function() {
		for (i in ssp) {
			var img = new Image();
			img.src = ssp[i];
			img.id = 'photoOfTheDay';
			img.style.filter='alpha(opacity=0)';
			img.style.opacity='0';
			this.photos.push(img);
		}
		setInterval('flashingPhotos.showNextPhoto()', 5000);
	},
	showNextPhoto: function() {
		this.currentPhoto = (this.currentPhoto<ssp.length-1) ? this.currentPhoto+1 : 0;
		$('photoOfTheDayPlacer').replaceChild(this.photos[this.currentPhoto], $('photoOfTheDay'));
		for (i=0; i<11; i++) setTimeout('setOpacity("photoOfTheDay", '+i/10+')', i*50);
		try { 
			this.photos[this.currentPhoto-1].style.filter='alpha(opacity=0)';
			this.photos[this.currentPhoto-1].style.opacity='0';
		} 
		catch(err) {};
	}
}

window.onload = function() {
		flashingPhotos.initialize();
}
