var weekPhotos = document.getElementById("main-photos-box").getElementsByTagName("div");
var i=0
function weekPhotoNext() {
	var currentPhoto = i;
	if (i==weekPhotos.length-1) {
		var newPhoto = 0;
		i=0;
	}
	else {
		var newPhoto = i+1;
		i++;
	}
		weekPhotoChange(weekPhotos[currentPhoto],weekPhotos[newPhoto]);
}
function weekPhotoPrev() {
	var currentPhoto = i;
	if (i==0) {
		var newPhoto = weekPhotos.length-1;
		i=weekPhotos.length-1;
	}
	else {
		var newPhoto = i-1;
		i--;
	}
		weekPhotoChange(weekPhotos[currentPhoto],weekPhotos[newPhoto]);
}
function weekPhotoChange(photo1,photo2){ 
	photo1.tween('opacity', [1, 0]);
	photo2.style.opacity="0";
	photo2.style.display="block";
		var h1=photo1.offsetHeight;
		var h2=photo2.offsetHeight;
		document.getElementById("main-photos-box").tween('height',[h1,h2]);
	photo1.style.display="none";
	photo2.tween('opacity', [0, 1]);
}