function showPhoto(photo) {
	if(photolocked != "true") {
		photolocked = "true";
	
		if( photo != currentphoto) {
	
			hidePhoto(currentphoto);
			currentphoto = photo;

			element = document.getElementById(photo);
			Effect.BlindDown(element, {duration: 0});
		}
		setTimeout("photolocked= 'false';",300);
	}
}

function hidePhoto(photo) {
		element = document.getElementById(photo);
		Effect.BlindUp(element, {duration: 0});
}

function fadePhoto(photo) {
		element = document.getElementById(photo);
		Effect.Fade(element, {duration: .5});
}

function rotatePhoto(photo) {
	if(photolocked != "true") {
		photolocked = "true";
	
		if( photo != currentphoto) {
	
			fadePhoto(currentphoto);
			currentphoto = photo;

			element = document.getElementById(photo);
			setTimeout("Effect.Appear(element, {duration: 1});",500);
		}
		setTimeout("photolocked= 'false';",1500);
	}
}


function ImageRotator( ) {

		document.getElementById('Counter' + currentPhoto).src = ROOT + "/images/ProgressFilled.gif";

		currentPhoto = currentPhoto + 1;
		if(currentPhoto > lastPhoto) { currentPhoto = 1;}
		nextPhoto = 'Photo' + currentPhoto;
		rotatePhoto(nextPhoto);
		
		document.getElementById('Counter' + currentPhoto).src = ROOT + "./images/ProgressFilling.gif";
}

function ImageRotate(target) {
		document.getElementById('Counter' + currentPhoto).src = ROOT + "./images/ProgressFilled.gif";

		currentPhoto = target;
		if(currentPhoto > lastPhoto) { currentPhoto = 1;}
		nextPhoto = 'Photo' + currentPhoto;
		rotatePhoto(nextPhoto);
		
		document.getElementById('Counter' + currentPhoto).src = ROOT + "./images/ProgressFilling.gif";
}